IMD 1.17: 4/01/2010 22:38:44 NGEN High C Sample Programs 4/5/88 also Linker + Readme  ArchiveggKJ}9|M^ E f ' T } CKACTION BACK SPACEBOUNDCANCELCODECOPYDELETEFINISHGOHELPLOCKMARKMOVENEXT NEXT PAGE OVER TYPE PREV PAGERETURN SCROLL DOWN SCROLL UPSHIFTTAB#+17?GKQW]citGW;-  XXX@=PAfECopyright 1987 Convergent Technologies, Inc. All rights reserved.Ver x12.0-03/22/88-16:38 Linker x-03/22/88-16:36  8  r *    ~     s     [  @   . A &  0 J     n \    M c ,   L  9  ( |  =  C            E  1   m  G    y [  %  / y   a l I   H W } ] b   D  q X  > -  o 7  #    k = 3 T 4   6  8 g O  ^  e  t Q      L j  u v   V   w  ;   F f  {   B      R   S  N      i !      +      h 2   P ? ~ Z     $ d  B U    x   3 <   z Q ` V j e    _   "   K  ' t p   o  Y     : G     5  `   )  O Z i  T    1 " _ h p x }     S \      ! -      & / 4 =  X ]          5 z   : x       5 = M v   $ 0 8 @ S x            &  8 ]    i      & / 4 L d t }    #  - > [ v E   O W L  ) 1   U   =A^'q{0` ((/(>(l((((((((?(V(((((((( ((:(x((v({(((r((((( (((&(E(T(|(((((((((E(l(((R(p((((((((((*(;(@(H(U(i(( ( (] (n (s ( ( ( (B (c (u ( ( ( ( ( ( ( ( ( ( ( (@ (N ( ( ( ( ( ( (%(1(=(P("']ks{+>%*7/ex8 .?DLYm+F t     5 C Z           # r z         ) J k       . 1?Y^?\lw4 0? "Jg $)AJS!H6H  |{{{;;$;2;@;.HcHwHHHHpHHH HEHTHxHHH5HuHHYHmHHH:HGHnH{HHHHHHH/a|p &55U:IV.M]%w%93L3l33>>>>^  (H"%9{.7;@EHb &5U%/3>@  !R  ( , (  ,     "/6:>BFKOSW[`dhlpuy}Ğɞ͞ў՞ٞޞ GHuHHHHHH4H[HxHHH>HHHHH HGHdHHHQHHHHHH.HLH\HsHH:g54cbR  ( , (  ,     "/6:>BFKOSW[`dhlpuy}Ğɞ͞ў՞ٞޞ ~#9Q99 9|99]9 AK0Y%: \ b z&5cz]WfWf   Iy~C!eqt 0 @  {g{{M{{{{,{H{X3w8.G..IH0HHjHHHHgH @&K_wLg "F?qqbbbb/b>bbbbbbSb|bb4bb bgbwb-   e  &555  UU"UUUWUjU#U*UKTl&K"8K%#/3>$>{>>>>)Xz BG/   _ )006/ >?P>?PD pKV V YcfPk mn?poOoOp/Pppox?y@} `PoPoPP?0//Ф/?0@  ? O@+*h67-8'0(&/."E  )#+i7*3  %+,"$1d/m2!45)                        ! & + 0 5 : ? D I N S X ] b g l q v {                                  % * / 4 9 > C H M R W \ a f k p u z   | P ( ( ( (i ( (T (s ( (0m %"p%E)`&q]<w D~q P u    1 1 {{                ((! x[Kbd][Vid]l[Lpt][Nul][SysIn]H[SysOut]Mq,  49 W R\{/ >bیgی4]4442Knn,X` %K @?? @? @[sys]ptrAconfig.sys[sys]Com   %379=KQ[]agou{ Write error on symbol file Write error on symbol file Symbol file hash table overflow Warning: Code reader confused at procedure startWarning: Code reader found illegal instructionWarning: IDIV of unfixable type foundWarning: IDIV instruction in overlayDistrixGdtProtectedGdtPmosLowDataGdtProtectedProtectedPmosRealSuppressStubsYesNoV4Run file mode is not unique No run file .mapLinker .symBad run file type parameter Bad OS version parameter Requested stack size exceeds 64K Warning: Odd size stack requested; rounded up.Bad max parameter noreportnone[Sys]Ctos.LibBad numeric parametermXconfig.sysToo many public procedures in resident/overlay @static0000Bad object module, data record too large Error: DUP record too complexWarning: Proc near in doesn't follow CALL/RET conventions DGroupCodeDataStaticsConstsbVerRun StaticsDesc StaticsDataConst Program entry point at (. Referenced in near module offset h.' .Error: Large-model overlay fixup failedError: Invalid Abs#1 FixupError: Invalid Abs#2 FixupError: Relocation offset of 'from group is too largeError: Relocation offset is too largeError: Relocation offset of near reference to 'is too largeError: Illegal segment address reference type Symbol table capacity exceeded Too many segment or class names CODEAQMCODE MQ_CEL_CODECOEDToo many segments Warning: Odd length STACK in , rounded up.Segment size exceeds 65520 Too many groups Multiply defined symbol in file High CMetaWareMS PASCAL[Sys]Pascal.LibFORTRAN 7[Sys]Fortran.LibBasic[Sys]BasCompiler.LibWarning: Module compiled with Publics is not residentFORT86[Sys]Fort86.LibWarning: no First.Obj found before Fortran-86 module PLM86 VASM86MWC86Warning: Non Fortran 86 module(s) in overlays Invalid object module Too many segments Too many groups Internal error 6 Line numbers for H Invalid object module  Fatal Error: Input File: pos: Record Type: Status Code: Cannot open file An internal failure has occured. Module not found in in file(s): Linker Unresolved Externals: There were errors detected Input file read error, bad object module Write error on list file Bad object module, name index out of range Bad object module, external index out of range VM Read error [Scr]<$>Vm.TmpCannot open temporary file Write error in temporary file Attempt to access data outside of segment bounds, possibly bad object module Too many segments Too many segments Too many public, common, or external symbols in one module Too many areas Program size exceeds Linker capacityToo many PUBLIC symbolsLIBRARY: Too many libraries  OverlayFaultWarning: No 'OverlayFault' procedure loaded Warning: No STACK segment Warning: Non 'CODE' class loaded into overlay Error: Non-contiguous GROUPS not pMode compatible (selectors h and h) Internal error while sorting data segmentsh (h) h Abs Res Start Stop Length Name Class Resident Overlay h h 10000h h (h) h Publics by name  Address Overlay Publics by value Address Overlay Linker Copyright 1987 Convergent Technologies, Inc. All rights reserved.Write error on run file Too many segments Too many segments Too many segments Too many segments Too many segments Too many segments Ver Ver Error: Group larger than 64K Error during legalese, status code: Write error on run file  %)+/5;=CGIOSYaegkmq  yesnoynBad yes/no parameter VNVF       C>=\z2Q[sys]LptConfig.Sys[!Scr]$$.Tmp[KBD][VID]Press NEXT PAGE or SCROLL UP to continue(Press NEXT PAGE to continue>p[PTR]& $ % * -  ,[SYS]Config.sysCommPtr[8251] Q$,,; 0@ @ Pl*QU| @$Oy' l nJ4 0 (OfI%lYU@JdwiY!=asLVS "f0g   4 E @$$A$k$$$C$L $,,-,r,,44-444%4'4!44J4B444I4f4444[4m4444R444444E44444 44444444"44 4]44)44<444b44<DL T/TTT\\\*\8\F\)dddll6tWttttttOtt1tstY||+6Ho&>Oe[*r.Q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&48 ^& ~]N u+JVuF HN;v9@N +^vp^~&=9^YF@N +^&CFP6F u^&O@wA^~&=9^Y^&G@^&^v&48^&v&4^P^&wg&we^&^v&48^&]U ^vFF^&F^&G^vNFY^&Gw^ &Gj^&GyF^&^vNFYFP6F uQ^&G@^&^&O@wA^^Y^&Ƈ^&Ƈ^P6 &G ]UQF =wmt =mmt"6ڸwmP6rیt۠^&G ]U^&G :t ^&rSP6]UQ^&^ &&W^&G :t nS6G]U^&G :urSv6o ]U vPFPP67F uxFV^&&W~u~tYFuRFVFV)F^v^ SPvvFP62F u^ &?Gu&G &W^&&W] URPPFP6F uK~tE^&t6G8:^&G<&vHZ\^&@^~]Ux vuPPvP6F u{v&G < r < wf~rHF s8FF< ZFF^F| zuPPzP6F uoz&G ^ &:GwY^ &GzۋX ^F&G;FsF^ &GPP^&GȴP^Sv6F tn<~u8Fl^ &OQP^&OɵQPv6FF tUV~uF~ t~uF r~t6FPFP6#FF^&~uq븋F] U^ SP^S6g]U^ SP^S6g]U^ &G :gt xx vuPPvP6F uVv&G < rL< wH^&^&G^&GP^&G^&G^&G^&G^&GA^&G6| zuPPzP6F uz&G ^ &:Gw^ &Gzۋ@ FF^ &G^&^&G^&G^&G^&G^&G^&G^&G^&G^&8G uA^&O^&8G u@^&G^ &GA^&G^ &G^&G] LIBRARY: ctos.lib VERSION: x11.3-3/4 (friday march 4, 1988, 17:25) COPYRIGHT 1980, 1987 CONVERGENT TECHNOLOGIES, INC. ALL RIGHTS RESERVED THIS PROGRAM IS FURNISHED UNDER A LICENSE RESTRICTING ITS USE SOLELY FOR THE OPERATION OF A DESIGNATED COMPUTER FOR A PARTICULAR PURPOSE, AND MAY NOT BE COPIED OR OTHERWISE USED WITHOUT THE PRIOR WRITTEN CONSENT OF CONVERGENT TECHNOLOGIES, INC. TITLE TO AND OWNERSHIP OF THE PROGRAM, INCLUDING ITS SOURCE CODE, SHALL AT ALL TIMES REMAIN IN CONVERGENT TECHNOLOGIES. VERSION: 12.0 (tuesday march 1, 1988, 15:00) %' Video %'[Suppress pause between pages?]'y %'[Screen time out (in minutes)]' %'[Color (e.g., Green)]' %'[Narrow characters?]' %'[Background color]' Type %'File list'[kbd] %'[Confirm each?]' Install High C Libraries, and include files.  The submit form below defines parameters used to install the High C sample program files. The first parameter (defaulting to [sys]) tells this submit what volume to use to hold the sample files. The second parameter (defaulting to ) tells this submit what directory to use to hold the sample files. The third parameter (defaulting to [sys]) tells this submit what volume and directory has the system command file to be updated. If you are booted from a local disk, then [sys] is appropriate for this parameter. If you wish to update the master, then make sure that the samples are copied to a volume attached to the master, and set this parameter to [!sys]. Press GO to continue... Submit %'File list'[f0]continue.sub %'[Parameters]'[sys] [sys]Sys.cmds 1 [sys] 1     $ ) . 3 8 = B G L Q V [ ` e  O{ e    ( B W   0  p p   5 xCxNNN8NzN Z$Z<ZTZlZZZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666  lib procedures. This file requires that CTOStypes.h be included first. The definition of the CTOS routines is in the new ANSI proposed standard that enforces type checking of parameters. Note that upper/lower case sensitivity is in effect for all C compilations. CTOSTypes.h C include file that defines some standard CTOS types. CTYPE.H hc.pro C profile. This file is automatically included in C compilations if visible to the compiler. It can be used set default parameters, switches ect. It is usefull for setting the memory model pragma, for example. This file should be taylored for the specific environment desired by the user. hc.run This is the High C compiler. HC.sym This is the compiler symbol file. It can be used to aid debugging. (Remember, the port for this compiler is not yet complete.) hcbc.lib High C library: Big memory model, math coprocessor or math service required. hcbe.lib High C library: Big memory model, with floating point emulation. hclc.lib High C library: Large memory model, math co%' Type %'File list'[kbd] %'[Confirm each?]'  Finished installing High C Samples Oo@?O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0? %' Copy [kbd] [Scr]<$>args.Tmp Yes '[File List]' '[Keyword List]' Copy [kbd] [Scr]<$>desc.Tmp Yes 'find keywords in files' %' New Command %'Command name''keyword' %'Run file'%0%1keyword.run %'[Field names]'@[Scr]<$>args.Tmp %'[Description]'@[Scr]<$>desc.Tmp %'[Overwrite ok?]'yes %'[Case (default 00)]' %'[Command file]'%2 Type [kbd] When the restore program prompts for (name).01, Press GO. If further diskettes in this series are needed, they will be prompted for by (name).02, etc. In each case, the .0n refers to the disk n of m in the series. Insert the nth diskette at the prompt and press GO. Press GO to begin... 1Restore %'[Archive file]'[f0]Samples %'[File list from]*'* %'[File list to]*'%0%1* %'[Overwrite ok?]'y %'[Confirm each?]' %'[Sequence number]' %'[Merge with existing file?]' %'[List files only?]' %'[Log file]' Submit %'File list'[f0]Prompt.sub %'[Parameters]' %'[Force Expansion?]' %'[Show Expansion?]' /C H M R  MetaWare High C Preliminary User Notes April 4, 1988 MetaWare High C is a professional developers tool. It has built in switches and parameters that allow the sophisticated user nearly complete control over the environment in which the output code is to be executed. It is a full featured compiler that supports such sophisticated constructs as >64k arrays in both real and protected mode on the segmented architecture of the 80x86. The first step in using the compiler is to read over the manual. This is essential to gaining an understanding of what is happening when the compiler is invoked, and compilation begins. Even without a detailed understanding of all the topics, reading the manual will make the user familiar with some new concepts, and, especially, it will define some terms that are used throughout the rest of this document. Included in the manual (the PROGRAM section) are definitions of the available memory models, what a pragma is, what a profile is and why to use one, etc. Let me emphasize that at least scanning this section of the manual should be done before continuing. Installing the compiler. Currently the compiler is distributed on a QIC tape. This is for convenience, because the compiler, libraries and include files would take about 5 floppies otherwise. All the files on the tape are in the directory . The following is a list of the files, and a brief description of anything that is out of the ordinary for a C environment. ASSERT.H CTOSlib.h C include file that defines all CTOS. processor or math service required. hcle.lib High C library: Large memory model, with floating point emulation. InstallHc.sub Creates the HC command, used to invoke the compiler. It may have to be modified to correctly reflect the volume on which the directory is placed. LIMITS.H linker.run This is a preliminary version of the standard software linker that is required to link High C modules. Older linkers won't work. MATH.H readme.doc This document. SETJMP.H SIGNAL.H STDARG.H STDEFS.H STDIO.H STDLIB.H STRING.H STRINGS.H TIME.H. After the files have been restored, edit and submit the file InstallHc.sub. This should let you begin working with the compiler. Note that the compiler is not yet overlayed. This means that a large partition is required if running under the context manager. A 1 megabyte partition is the minimum size reccommended. A larger partition may be required for extreemly large compilations. (Over 7,000 lines of source in a single compilation took 1.5 megabytes of memory to successfully compile. This is considered an extreemly large source file) Note that only one C source file can be compiled at a time. Multiple source files must be compiled using multiple invocations of the command. A submit file to do this can be made, but that makes setting switches and parameters difficult. KNOWN DIFFERENCES FROM WORK STATION C: POINTERS The first major difference that will present itself is in systax checking. The new compiler actually checks syntax. Many old programs that compiled and ran using the old C will no longer compile. This is due to changes in the language that have occured over the many years between the development of the two compilers. These changes have been worked out over years by the committee that is proposing the C ANSI standard. These differences are outlined in a book by PLUM HALL - <<>>. Many of the differences can be overcome by using the appropriate compiler toggles. For example, the hc.pro file contains the statement: pragma on(Pointers_compatible); This statement says that all pointers are to be considered equal in the eyes of the compiler. This was an implementation specific thing that just happened to work for the old C on CTOS, but could have effected portability of the program to another system. The ANSI standard says tha all pointers are not equal, and inforces pointer type checking. Including the above statement in the compilation allows old source to work unchanged. LINKING WITH CTOS MetaWare C libraries and programs default to using the stack in a manner similar to many UNIX systems. Parameters are pushed onto the stack in left to right order (CTOS assumes right to left), and the caller removes the arguments from the stack (in CTOS the callee removes the parameters). KNOWN PROBLEMS: 1. Overlays work in some cases, not in others. This restriction will only be overcome by major changes to the linker, which did not anticipate the INTEL OMF well enough. 2. The compiler requires a large partition. 3. Of the 5 memory models (small, compact, medium, big, large) only big and large are working at this time. Big corresponds to what PLM and old workstation C considered medium. Changes From Prior Version: 1. The .lst file will be created automatically. The prior version assumed output of the .lst file went to [vid]. The assumption is now (file).lst. 2. Fgets now works. Even if the input file is [kbd]. Note that input from [kbd] will echo on [vid]... (so you can see what you are typing). 3. The library date/time routines now work in leap years also. 4. Stack checking now works. (It must be turned on first) 5. The compiler no longer error exits with the number of errors encountered during the compile. 6. Subtle changes to ctoslib.h, ctostypes.h. 7. Code gen bug exhibited by oracle source file osdctb.c has been fixed. 8. fseek now works. 9. open in mode A now works. DOCUMENTATION NOTES: 1. The maximum amount of memory that can be allocated by malloc is 64,486 bytes. This is 1048 bytes less than the real limit in a segment. The 1048 bytes are used   \asm.fls-New C_Samplesff*Vf   samgen.asm start.asm  @beeper.c c_samples@ff*Vf  by the heap manager to keep track of allocated/free space. This is required for free() to work. It would be best to have an include that defined MAX_MALLOC_SIZE or some similar name with the appropriate limit. 2C7Rk4döÆ̢FG(6δOPRk KSף+ ׁ # p  " ׯ ׶    ΢ C4[dY΢6='DF[@Qo 3E,,@  0,@ @ ,,@  ,@H@,H  */=Courier CourierGD9Imagen x2.0_11/62am e $  #define AllocExch #define CheckErc #define ChangePriority #define ConvertToSys #define ChangePriority #define Check #define Crash #define ErrorExit #define ForwardRequest #define GetUserNumber #define GetPartitionHandle #define QueryRequestInfo #define RemovePartition #define Respond #define Send #define SetMsgRet #define SetPartitionLock #define SetPartitionName #define ServeRq #define VacatePartition #define Wait #include #include /* opt out not needed library routines to conserve0 r space */ #include #define BEEPRQ 52 typedef struct { Byte sCntInfo; /* 00 number of control info bytes */ Byte RtCode; /* 01 routing code (SRP) */ Byte nReqPbCb; /* 02 number of req pbcb's */ Byte nRespPbCb; /* 03 number of resp pbcb's */ Word UserNum; /* 04 user number */ Word ExchResp; /* 06 exchange */ Word ErcRet; /* 08 erc to return */ Word RqCode; /* 10 request code */ } RqType; /* 12 */ typedef struct { Word exch; <  Word lsc; } rqInfoType; Word erc; char *psName; char *pServerName; rqInfoType rqInfo; Word exchServe; Word usernum; Word PhRet; char rgServerName[11] = "Beep Server"; char rgmsg1[23] = "Beep Server deinstalled"; char rgmsg2[21] = "Beep Server Installed"; void CrashIfErcNotOk(erc) Word erc; { if (erc != ercOK) Crash(erc); } /* PROCESS A REQUEST Process each request that comes in. */ void ProcessRequest(pRq) RqType *pRq; { if (pRq->UserNum > usernum) { if ((erc = Respond(pRq)) != ercOK) CrH ash(erc); } else { if ((erc = ForwardRequest(rqInfo.exch, pRq)) != ercOK) Crash(erc); } } /* DEINSTALL: This routine returns controll of the request back to its original owner. Then any pending messages on the local service exchange are processed. Then the partition is unlocked, and the priority set to 0xFF, so that no more time is ever spent in this routine. It is then up to the program that sent the deinstallation message to vacate and remove the partition. */ void DeInstall() { RqType *T pRq; /* Serve request to 0 first to avoid SPR OS bug*/ CrashIfErcNotOk(ServeRq(BEEPRQ, 0)); CrashIfErcNotOk(ServeRq(BEEPRQ, rqInfo.exch)); /* Loop here to clear all messages on this exchange */ while (Check(exchServe, &pRq) == ercOK) { ProcessRequest(pRq); } /* All done, unlock partition, and wait for removal by deinstall program */ CrashIfErcNotOk (SetPartitionLock(FALSE)); /* unlock partition  */ CrashIfErcNotOk (ChangePriority(0xFF)); /* sleep here forever */ Crash(3); /* ` Os problem if we ever get here */ } /* MAIN ROUTINE Set up the partition as a server. First check for the server already being installed. If it is, then send a message for the service to clean up and wait for removal, then remove it. Otherwise, proceed with installation. */ void main(){ RqType *pRq; CheckErc(GetUserNumber(&usernum)); CheckErc(AllocExch(&exchServe)); CheckErc( QueryRequestInfo(BEEPRQ, &rqInfo, sizeof(rqInfo)) ); /* This is the deinstallation check. If the named server isl  already in a partition, then the server is assumed to be alive and well. A message is sent to the service exchange for the server. In this case, instead of a request, the message is a special value pased as if it were a pointer to a request. The server recieves the message, and because it is running at a higher priority than this program, this program won't execute again until the server has had time to clean up and wait for removal. If the server process could block during deinstallation (wax it), then this program would have to be modified to send a request for deinstallation, and wait for the response before proceeding. When this program regains control, it then uses the partition handle obtained to vacate and remove the server partition. this program then sets up an appropriate exit message, and exits */ if (GetPartitionHandle(&rgServerName, 11, &PhRet  etitle = { 0, 24 ,(Byte *)"Save Filename List To File" ,&SaveFilenameFileName }; static char Replace[2] = {'Y', 0}; static char FileName[70] ={0}; static InputType lkfReplace = {4, 40, 2, (void *) &Replace, NULL}; static InputType lkfFileInput = {2, 10, 70,(void *)&FileName, &lkfReplace}; static InputType lkfFileOutput = {2, 10, 70, (void *) &FileName, NULL}; static MenuType LoadFilenameMenu = { &lkfFiletitle ,&lkfFileInput }; static M# enuType SaveFilenameMenu = {  &skfFiletitle ,&lkfFileOutput }; static char FilenameName[80] ={0}; static InputType EnteredFilename = {3, 0, 80, (void *) &FilenameName, NULL }; static PromptType EnterFilenametitle = { 1, 30 ,(Byte *)"Enter Filename below" ,NULL }; static MenuType EnterFilenameMenu = { &EnterFilenametitle ,&EnteredFilename }; static FileListType *DeleteNode = NULL; static PromptType DeleteWord = { 3, 0, NULL, NULL }; static PromptType DeleteFilena% metitle = { ) == ercOK){ CheckErc(Send(rqInfo.exch, (Pointer) 0x0000FFFFl)); CheckErc(VacatePartition(PhRet)); CheckErc(RemovePartition(P  hRet)); erc = SetMsgRet(&rgmsg1, 23); ErrorExit(erc); } /* BECOME A SERVER Since the server is not already installed, install now. Set up an appropriate exit message, and convert to sys (become a server). The ErrorExit call after the convertosys call allows the reloading of an exec in the primary partition. */ erc = SetMsgRet(&rgmsg2, 21); erc = ConvertToSys(); ErrorExit(erc); /* All servers must run at a priority higher than 40, else deadlocks can occur. */ CrashIfErcNotOk(ChangePriority(  12)); /* Set the partition name so that the deinstallation program can obtain this partition handle. */ CrashIfErcNotOk(SetPartitionName(0, &rgServerName, 11)); /* Now serve the request to the service exchange for this program. */ CrashIfErcNotOk(ServeRq(BEEPRQ, exchServe)); /* Server loop... */ while (TRUE) { CrashIfErcNotOk(Wait(exchServe, &pRq)); if (pRq == (Pointer) 0x0000FFFFl) DeInstall(); ProcessRequest(pRq); } } p- filelist.c C_samples-ff+Vf2V  /* * Filename list manipulation */ #define Beep #define CheckErc #define CSubparams #define ErrorExit #define PutFrameChars #define PutFrameAttrs #define ReadKbd #define ResetFrame #define RgParam #include #include "keyword.h" #include #include #include /* Vidio Routines found in Vidio.c */ extern void DrawFunctionKeyBar(Word iLine, Pointer psFnckys); extern Word DisplayLines; extern Pointer pBlanks; extern Pointer pSep; extern void SetUpMenu(MenuType *Menu) ; extern char InputLine[LINEMAX]; /* State machine varaibles */ extern void DrawMainDisplay(); extern void InputInformation (Byte chr); extern void (*(pState[STATESTACKSIZE]))(Byte); extern Word oStateStack; extern void (*(pCancelRoutine))(); extern void (*(pGoRoutine))(); /* Define the Filename list variables */ FileListType *pFileList = NULL; static FileListType *columns[MAXDSPCOLUMNS]; static Word nFileCols; static Word nFilenames; /* Number of Filename entries */ static Word nColumnOffset; st atic Word FileCursorLine; static Word FileCursorCol; /* Menu data */ static PromptType LoadFilenameReplace = { 4, 0 ,(Byte *)"[Replace Existing Filename List (y/n)?]" ,NULL }; static PromptType LoadFilenameFileName = { 2, 0 ,(Byte *)"File Name" ,&LoadFilenameReplace }; static PromptType lkfFiletitle = { 0, 25 ,(Byte *)"Load Filename List From File" ,&LoadFilenameFileName }; static PromptType SaveFilenameFileName = { 2, 0 ,(Byte *)"File Name" !  ,NULL }; static PromptType skfFil 1, 22 ,(Byte *)"Press GO to delete the Filename below" ,&DeleteWord }; static MenuType DeleteFilenameMenu = { &DeleteFilenametitle ,NULL }; static Word nEntriesPerColumn() { return ( (nFilenames/nFileCols) + ( ((nFilenames%nFileCols) != 0) ?1:0) ); } static Word ColumnOffset( Word iCol) { if (iCol > nFileCols) return(0); return( (iCol *(nFilenames / nFileCols)) + (min(iCol, nFilenames % nFileCols)) ); } static void ShowFilenameCursor() { CheckErc (PutFra' meAttrs( DISPLAYFRAME ,FileCursorCol * (80/nFileCols) ,FileCursorLine ,lUnderLine ,80/nFileCols )); } static void HideFilenameCursor() { CheckErc (PutFrameAttrs( DISPLAYFRAME ,FileCursorCol * (80/nFileCols) ,FileCursorLine ,lNormal ,80/nFileCols )); } static void EnableFilenameCursor() { FileCursorLine = FIRSTLINE; FileCursorCol = 0; ShowFilenameCursor(); } /* Define Filename list manipluation functions */ static void AddToFilenameList(FileListType *Node) { FileListType *Lis) t; FileListType *Parent; Node->Prev = NULL; if (pFileList == NULL) { /* if */ pFileList = Node; Node->Next = NULL; } /* if */ else { /* outer else */ if (strcmp(Node->Filename, pFileList->Filename) == 0) { /* if */ free(Node->Filename); free(Node); return; } /* if */ if (strcmp(Node->Filename, pFileList->Filename) < 0) { /* if */ /* add in as first element */ Node->Next = pFileList; pFileList->Prev = Node; pFileList = Node; } /* if */ else { /* else */ /* Add ,  into middle of list */ for (List = pFileList; List != NULL; List = List->Next) { /* for */ if (strcmp(Node->Filename, List->Filename) == 0) { /* if */ free(Node->Filename); free(Node); return; } /* if */ if (strcmp(Node->Filename, List->Filename) < 0) { /* if */ Parent = List->Prev; Parent->Next = Node; List->Prev = Node; Node->Prev = Parent; Node->Next = List; return; } /* if */ Parent = List; /* Save this for adding to end of list */ .  } /* for */ /* Add to end of list */ Parent->Next = Node; Node->Prev = Parent; Node->Next = NULL; } /* else */ } /* outer else */ } /* end void */ static void ShowFilenameList() { Word i, j; FileListType *Showcolumns[MAXDSPCOLUMNS]; HideFilenameCursor(); for (j = 0; j < nFileCols; j++) { Showcolumns[j] = columns[j]; } for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80) 0  ); if ( (i - FIRSTLINE) + nColumnOffset < nEntriesPerColumn()) { for (j = 0; j < nFileCols; j++) { if ( ((i - FIRSTLINE) + ColumnOffset(j) + nColumnOffset) < ColumnOffset(j+1)) { if (Showcolumns[j] != NULL) { CheckErc(PutFrameChars( DISPLAYFRAME ,j*(MAXCOLUMNS/nFileCols) ,i ,Showcolumns[j]->Filename ,strlen(Showcolumns[j]->Filename) )); Showcolumns[j] = Showcolumns[j]->Next; } }  } } } ShowFilenameCursor(); } stat,2  ic void ScrollFilenameList(int cLines) { Word i; if (columns[0] == NULL) return; if (cLines < 0) { /* Follow prev pointer */ while (cLines != 0) { if (nColumnOffset != 0) { for (i = 0; i < nFileCols; i++) { if (columns[i]->Prev != NULL) columns[i] = columns[i]->Prev; } nColumnOffset -= 1; } cLines += 1; } } else { /* Follow next pointer */ while (cLines != 0) { if ((nColumnOffset+(DisplayLines-FIRSTLINE))Next != NULL) columns[i] = columns[i]->Next; } nColumnOffset += 1; } cLines -= 1; } } ShowFilenameList(); } static void SizeFilenameList() { FileListType *pList; Word cbMax; cbMax = 0; nFilenames = 0; for (pList = pFileList; pList != NULL; pList = pList->Next) { if(strlen(pList->Filename) > cbMax) cbMax = strlen(pList->Filename); nFilenames += 1; } if (cbMax != 0) {    = LoadFilenameFile; oStateStack += 1; pState[oStateStack] = InputInformation; } static void ProcessFilenameEntry() { FileListType *NodeB ; oStateStack -= 1; if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(strlen(FilenameName)+1)) == NULL) ErrorExit(400); _move(FilenameName, Node->Filename, strlen(FilenameName)+1); AddToFilenameList(Node); DisplayFilenameList(); } static void EnterFilenameEntry() { FilenameName[0] = 0; /* Erase any old name entered previously */ HideFilenameCursor(); SetUpMenu(&EnterFilenameMenu); pCancelRoutine = FilenameCancel; pGoRoutine = ProcessFilenameEnD try; oStateStack += 1; pState[oStateStack] = InputInformation; } static void DeleteFilenameEntry() { oStateStack -= 1; if (DeleteNode->Prev == NULL) { /* First node in list */ pFileList = DeleteNode->Next; if (pFileList != NULL ) pFileList->Prev = NULL; } else { if (DeleteNode->Next != NULL) DeleteNode->Next->Prev = DeleteNode->nFileCols = (cbMax < 60) ? (MAXCOLUMNS / (cbMax + 1)): 1; } elseD6  nFileCols = 1; if (nFileCols > MAXDSPCOLUMNS) nFileCols = MAXDSPCOLUMNS; } void DisplayFilenameList() { Word i, j; Word Limit; /* SET UP WINDOW FOR DISPLAY Filename LIST */  CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 36, 1, "Filenames", 8)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80)); DrawFunctionKeyBar(2, " Add   Del Back    Load   Save "); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrP8 ameChars(FNCKEYFRAME, 0, 1, " ENTRY FILE ", 80)); SizeFilenameList(); if (nFilenames == 0){ columns[0] = NULL; } else { nColumnOffset = 0; for (i = 0; i < nFileCols; i++) { columns[i] = pFileList; Limit = ColumnOffset(i); for (j = 0; ((j < Limit) && (columns[i] != NULL)); j++) { columns[i] = columns[i]->Next; } } } EnableFilenameCursor(); ShowFilenameList(); } /* Get the initial Filename list. */ void I\: nputFilenameList() { Word i; sdType sdRet; FileListType *Node; nFilenames = CSubparams(FILELISTINDEX); for(i = 0; i < nFilenames; i++) { /* Pick up Filename. Put into Filename List Node */ RgParam(FILELISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->Filename, sdRet.cbString); Node->Filename[sdRet.cbString] = 0; AddToFilenameList(Node); } } voidh<  FilenameCancel() { DisplayFilenameList(); oStateStack -= 1; } extern void LoadFilenameList(); static void ParseLine() { FileListType *Node; Word i, j; j = 0; while (TRUE) { i = j; /* Start from end of last word found */ /* Find start of (next) Filename */ while(isWhiteSpace(InputLine[i])) { if (InputLine[i] == NEWLINE) return; i++; if (i == LINEMAX) return; } /* Find end of Filename */ for (j=i; !isWhiteSpace(InputLine[j]); j++) if (j == LINEMAX) return; if ((Node = malt> loc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc((j-i)+1)) == NULL) ErrorExit(400); _move(&InputLine[i], Node->Filename, (j-i)); Node->Filename[(j-i)] = 0; AddToFilenameList(Node); } } static void LoadFilenameFile() { FileListType *Node; FILE *inp; oStateStack -= 1; if ((Replace[0] == 'Y') || (Replace[0] == 'y')) { /* Throw away current Filenames */ for (Node = pFileList; Node != NULL; Node = pFileList) { pFileList = pFileList->Next; free(Node@ ->Filename); free(Node); } pFileList = NULL; } if ((inp = fopen(FileName, "r")) == NULL) { Beep(); LoadFilenameList(); return; } while (fgets(InputLine, 80, inp)) ParseLine(); fclose(inp); DisplayFilenameList(); } static void LoadFilenameList() { HideFilenameCursor(); SetUpMenu(&LoadFilenameMenu); pCancelRoutine = FilenameCancel; pGoRoutine Prev; DeleteNode->Prev->Next = DeleteNode->Next; } free(DeleteNode->Filename); free(DeleteNode); DisplayFilenameList(); } static void SetUpDeleteFilenameF Entry() { Word nLines; for (DeleteNode = columns[FileCursorCol], nLines = FIRSTLINE; ((DeleteNode != NULL) && (nLines < FileCursorLine) ); DeleteNode = DeleteNode->Next, nLines++); if (DeleteNode == NULL) { Beep(); return; } DeleteWord.pString = (Byte *) DeleteNode->Filename; DeleteWord.Col = ( (80-strlen(DeleteNode->Filename)) /2); HideFilenameCursor(); SetUpMenu(&DeleteFilenameMenu); pCancelRoutine = FilenameCancel; pGoRoutine = DeleteFilenameEntry; oStateStack += 1; pState[oStatH eStack] = InputInformation; } extern void SaveFilenameList(); static void SaveFilenameFile() { FileListType *Node; FILE *out; oStateStack -= 1; if ((out = fopen(FileName, "w")) == NULL) { Beep(); SaveFilenameList(); return; } for (Node = pFileList; Node != NULL; Node = Node->Next) { fputs(Node->Filename, out); fputs("\n", out); } fclose(out); ShowFilenameList(); ShowFilenameCursor(); } static void SaveFilenameList() { HideFilenameCursor(); SetUpMenu(&SaveFilenameMenu); pCancelRJ outine = FilenameCancel; pGoRoutine = SaveFilenameFile;  oStateStack += 1; pState[oStateStack] = InputInformation; } void fncFilenameList (Byte chr) { switch (chr) { case SCROLLUP: ScrollFilenameList(1); break; case SCROLLDN: ScrollFilenameList(-1); break; case PAGEUP: ScrollFilenameList(-21);  break; case PAGEDN: ScrollFilenameList(21); break; case UPARROW: HideFilenameCursor(); if (FileCursorLine > FIRSTLINE) FileCursorLine -= 1; ShowFilenameCursor(); break; case DOWNARROL W: HideFilenameCursor(); if (FileCursorLine < (DisplayLines-1)) FileCursorLine += 1; ShowFilenameCursor(); break; case LEFTARROW: HideFilenameCursor(); if (FileCursorCol > 0) FileCursorCol -= 1; ShowFilenameCursor(); break; case RIGHTARROW: HideFilenameCursor(); if (FileCursorCol < (nFileCols - 1)) FileCursorCol += 1; ShowFilenameCursor(); break; case F1: EnterFilenameEntry(); break; case F3: SetUpDeleteFilenameEntry(); break; case F4: DrawMainDisplay(); oStateStackN  -= 1; break; case F8: LoadFilenameList(); break; case F10: SaveFilenameList(); break; default: Beep(); break; } } i++) { /* Pick up Filename. Put into Filename List Node */ RgParam(FILELISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->Filename, sdRet.cbString); Node->Filename[sdRet.cbString] = 0; AddToFilenameList(Node); } } voidP #func1.c-New C_samples#ff+Vf,Q #include  #define OutputToVid0 #include extern long a,b,c; extern int inmain(); long * func1() { PutLabels(); c = a + b; return &c; } PutLabels() {return;} kbin() {return;} long *NewScreen() {return;} long * funcx() { long *d; int i; i = inmain(); for (i=0; i<10; i++){ double d1; d1 = i; OutputToVid0("this is a test of output", 24); printf("%f %f %f %f\n",d1+1.3,d1-1.3,d1*1.3,d1/1.3); } c = a + b; return &c; } O0? S ?func2.c C_samples?ff,Vf U #include extern long *func1(); extern long a,b; long (*pf)(); double *gd; static long c; static char qq[]="hello"; long * func2() { char *pqq; double d1, d2=5.0; char *prest; if (gd != 0) d2 = *gd; d1 = d2 * 3   printf("%s, %s, %s\n", rgbnode[0][0][0], rgbnode[0][0][1], rgbnode[12][12][12]); } main () db { unsigned int j; for (j = 60000; j >= 1000 ; j -= 1000) { Chunky(j); } accessarray(); return(0); }        $ ) . 3 8 = B G L Q V [ ` e  O{ e    ( B W   0  p p   5 xCxNNN8NzN Z$Z<ZTZlZZZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666pd h>0 keylist.c C_samples>0fUf/Vf<V |e /* * Keyword list manipulation */ #define Beep #define CheckErc #define CSubparams #define ErrorExit #define PutFrameC.0; d1 = d2 / 3.0; d1 = d2 + 3.0; d1 = d2 - 3.0; if (d1 == d2) d2 = 0.0; pqq = qq; c = strtol("1234", &prest, 0); c = *(func1()); c = b / a; c = (unsigned long)b / (unsigned long)a; c = a * b; return &c; } O0? W izlCglider c_sampleslC8-f9-f-VfX (Z ֑ @ HighC.fls-New C_Samples @Ufbf-Vfw84[ beeper.c filelist.c func1.c func2.c huge.c keylist.c keymain.c large.c life.c sample.c search.c swap.c vidio.c write.c o@?O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0? @] d?huge.c-New C_samples?ff.Vf L^  #include #include typedef int harray[8192]; harray _huge c[13] = { {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12} }; int _huge ca[13][8192] = { {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12} }; typedef char *chrp; chrp _huge rgbnode[27][27][27] = {{ { {"this is string 1"}, {"This is string 2"} } }}; typedef void *biggie; biggie _huge a[32000]; void header(si) { printf("Size %u",si); } void Chunky(unsigned int si) { unsigned int i; i =X`  1; header(si); while ( (a[i] = malloc(si)) != 0) i++; printf(", chunks %u \n",i); for (i--; i != 0; i--) free(a[i]); } void accessarray () { int i,j; for (i = 0; i < 13; i++) { printf("Element=%d Address=%lx\n", c[i][0], &c[i][0]); } /* Should print values 0, 1, ..., 13, and their addresses. */ i = 12; rgbnode[12][12][12] = "this is another string"; *rgbnode[12][12][12] = 'T';  hars #define PutFrameAttrs #define ReadKbd #define ResetFrame #define RgParam #include #include "keyword.h" #include #include #include /* Vidio Routines found in Vidio.c */ extern void DrawFunctionKeyBar(Word iLine, Pointer psFnckys); extern Word DisplayLines; extern Pointer pBlanks; extern Pointer pSep; extern void SetUpMenu(MenuType *Menu);g  extern char InputLine[LINEMAX]; /* State machine varaibles */ extern void DrawMainDisplay(); extern void InputInformation (Byte chr); extern void (*(pState[STATESTACKSIZE]))(Byte); extern Word oStateStack; extern void (*(pCancelRoutine))(); extern void (*(pGoRoutine))(); /* Define the Keyword list variables */ KeyListType *pKeyList = NULL; KeyListType *pSelectList = (void *) &pSelectList; static KeyListType *columns[MAXDSPCOLUMNS]; static Word nKeyCols; /* Number of columns of keyword data to be displayei d */ static Word nKeyWords; /* Number of keyword entries */ static Word nColumnOffset; static Word keyCursorLine; static Word keyCursorCol; /* Menu data */ static PromptType LoadKeywordReplace = { 4, 0 ,(Byte *)"[Replace Existing Keylist (y/n)?]" ,NULL }; static PromptType LoadKeyWordFileName = { 2, 0 ,(Byte *)"File Name"  ,&LoadKeywordReplace }; static PromptType lkfFiletitle = { 0, 25 ,(Byte *)"Load Keyword List From File" ,&LoadKeyWordFileName }; static k PromptType SaveKeyWordFileName = { 2, 0 ,(Byte *)"File Name" ,NULL }; static PromptType skfFiletitle = { 0, 24 ,(Byte *)"Save Keyword List To File" ,&SaveKeyWordFileName }; static char Replace[2] = {'Y', 0}; static char FileName[70] ={0}; static InputType lkfReplace = {4, 34, 2, (void *) &Replace, NULL}; static InputType lkfFileInput = {2, 10, 70,(void *)&FileName, &lkfReplace}; static InputType lkfFileOutput = {2, 10, 70, (void *) &FileName, NULL}; static MenuType LoadKem yWordMenu = { &lkfFiletitle ,&lkfFileInput }; static MenuType SaveKeyWordMenu = { &skfFiletitle ,&lkfFileOutput }; static char KeywordName[80] ={0}; static InputType EnteredKeyWord = {3, 0, 80, (void *) &KeywordName, NULL }; static PromptType EnterKeywordtitle = { 1, 30 ,(Byte *)"Enter keyword below" ,NULL }; static MenuType EnterKeyWordMenu = { &EnterKeywordtitle ,&EnteredKeyWord }; static KeyListType *DeleteNode = NULL; static PromptType DeleteWoo rd = { 3, 0, NULL, NULL }; static PromptType DeleteKeywordtitle = { 1, 22 ,(Byte *)"Press GO to delete the keyword below" ,&DeleteWord }; static MenuType DeleteKeyWordMenu = { &DeleteKeywordtitle ,NULL }; static Word nEntriesPerColumn() { return ( (nKeyWords/nKeyCols) + ( ((nKeyWords%nKeyCols) != 0) ?1:0) ); } static Word ColumnOffset( Word iCol) { if (iCol > nKeyCols) return(0); return( (iCol *(nKeyWords / nKeyCols)) + (min(iCol, nKeyWords % nKeyCols)) ); } static vq oid ShowKeywordCursor() { KeyListType *pThisNode; Word nLines; CheckErc (PutFrameAttrs( DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,lUnderLine ,80/nKeyCols )); /* Find out if this node is selected. Find the node first */ for (pThisNode = columns[keyCursorCol], nLines = FIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine) ); pThisNode = pThisNode->Next, nLines++); if (pThisNode == NULL) return; if (pThisNode->Selected == NULL) return; CheckErc(PutFrameAttrss (DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,(lUnderLine | lReverse) ,strlen(pThisNode->KeyWord) )); } static void HideKeywordCursor() { KeyListType *pThisNode; Word nLines; CheckErc (PutFrameAttrs( DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,lNormal ,80/nKeyCols )); /* Find out if this node is selected. Find the node first */ for (pThisNode = columns[keyCursorCol], nLines = FIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine) u  ); pThisNode = pThisNod   columns[i] = columns[i]->Pre$ v; } nColumnOffset -= 1; } cLines += 1; } } else { /* Follow next pointer */ while (cLines != 0) { if ((nColumnOffset+(DisplayLines-FIRSTLINE))Next != NULL) columns[i] = columns[i]->Next; } nColumnOffset += 1; } cLines -= 1; } } ShowKeywordList(); } static void SizeKeywordList() { KeyListType *pList; Word cbMax; cbMax = 0; nKeyWords = 0; for (pList = pKeyList; pLi0 st != NULL; pList = pList->Next) { if(strlen(pList->KeyWord) > cbMax) cbMax = strlen(pList->KeyWord); nKeyWords += 1; } if (cbMax != 0) { nKeyCols = (cbMax < 60) ? (MAXCOLUMNS / (cbMax + 1)): 1; } else nKeyCols = 1; if (nKeyCols > MAXDSPCOLUMNS) nKeyCols = MAXDSPCOLUMNS; } static void SelectKeyword() { KeyListType *pThisNode; Word nLines; HideKeywordCursor(); /* Find the node */ for (pThisNode = columns[keyCursorCol], nLines = Fe->Next, nLines++); if (pThisNode == NULL) return; if (pThisNode->Selected == NULL) return; CheckErc(PutFrameAttrs(DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,(lNormal | lReverse) ,strlen(pThisNode->KeyWord) )); } static void EnableKeywordCursor() { keyCursorLine = FIRSTLINE; keyCursorCol = 0; ShowKeywordCursor(); } /* Define Keyword list manipluation functions */ static void AddToKeyWordList(KeyListType *Node) { KeyListType *List; KeyLisw  tType *Parent; Node->Prev = NULL; Node->Selected = NULL; if (pKeyList == NULL) { /* if */ pKeyList = Node; Node->Next = NULL; Node->Selected = NULL; } /* if */ else { /* outer else */ if (strcmp(Node->KeyWord, pKeyList->KeyWord) == 0) { /* if */ free(Node->KeyWord); free(Node); return; } /* if */ if (strcmp(Node->KeyWord, pKeyList->KeyWord) < 0) { /* if */ /* add in as first element */ Node->Next = pKeyList; pKeyList->Prev = Node; pKeyList = Node; } /* if */ ey  lse { /* else */ /* Add into middle of list */ for (List = pKeyList; List != NULL; List = List->Next) { /* for */ if (strcmp(Node->KeyWord, List->KeyWord) == 0) { /* if */ free(Node->KeyWord); free(Node); return; } /* if */  if (strcmp(Node->KeyWord, List->KeyWord) < 0) { /* if */ Parent = List->Prev; Parent->Next = Node; List->Prev = Node; Node->Prev = Parent; Node->Next = List; return; } /* if */ Parent = List; /* Save this for adding|  to end of list */ } /* for */ /* Add to end of list */ Parent->Next = Node; Node->Prev = Parent; Node->Next = NULL; } /* else */ } /* outer else */ } /* end void */ static void ShowKeywordList() { Word i, j; KeyListType *Showcolumns[MAXDSPCOLUMNS]; HideKeywordCursor(); for (j = 0; j < nKeyCols; j++) { Showcolumns[j] = columns[j]; } for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0 ~  , i, lNormal, 80)); if ( (i - FIRSTLINE) + nColumnOffset < nEntriesPerColumn()) { for (j = 0; j < nKeyCols; j++) { if ( ((i - FIRSTLINE) + ColumnOffset(j) + nColumnOffset) < ColumnOffset(j+1)) { if (Showcolumns[j] != NULL) { CheckErc(PutFrameChars( DISPLAYFRAME ,j*(MAXCOLUMNS/nKeyCols) ,i ,Showcolumns[j]->KeyWord ,strlen(Showcolumns[j]->KeyWord) )); if (Showcolumns[j]->Selected != NULL) CheckErc(PutFrameAttrs( DISPLA YFRAME ,j*(MAXCOLUMNS/nKeyCols) ,i ,lReverse ,strlen(Showcolumns[j]->KeyWord) )); Showcolumns[j] = Showcolumns[j]->Next; } } } } } ShowKeywordCursor(); } static void ScrollKeyWordList(int cLines) { Word i; if (columns[0] == NULL) return; if (cLines < 0) { /* Follow prev pointer */ while (cLines != 0) { if (nColumnOffset != 0) { for (i = 0; i < nKeyCols; i++) { if (columns[i]->Prev != NULL) IRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine< ) ); pThisNode = pThisNode->Next, nLines++); if (pThisNode == NULL) {ShowKeywordCursor(); return;} if (pThisNode->Selected != NULL) {ShowKeywordCursor(); return;} pThisNode->Selected = pSelectList; pSelectList = pThisNode; ShowKeywordCursor(); } static void deSelectKeyword() { KeyListType *pThisNode, *pSlist, *Parent; Word nLines; HideKeywordCursor(); /* Find the node */ for (pThisNode = columns[keyCursorCol], nLines = FIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine) ); pThiH sNode = pThisNode->Next, nLines++); if (pThisNode == NULL) {ShowKeywordCursor(); return;} if (pThisNode->Selected == NULL) {ShowKeywordCursor(); return;} /* Special case for node at head of list */ if (pThisNode == pSelectList) { pSelectList = pThisNode->Selected; pThisNode->Selected = NULL; ShowKeywordCursor(); return; } for (pSlist = pSelectList; pSlist != (void *)&pSelectList; pSlist = pSlist->Selected) { if (pSlist == pThisNode) { /* Remove from list */ Parent->Selected = pTT hisNode->Selected; pThisNode->Selected = NULL; ShowKeywordCursor(); return; } Parent = pSlist; } ShowKeywordCursor(); } void DisplayKeywordList() { Word i, j; Word Limit; /* SET UP WINDOW FOR DISPLAY KEYWORD LIST */ CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 36, 1, "Keywords", 8)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80)); DrawFunctionKeyBar(2, "  Add   Del Back    Load   Save "); CheckErc(Pu` tFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, " ENTRY  FILE ", 80)); SizeKeywordList(); if (nKeyWords == 0){ columns[0] = NULL; } else { nColumnOffset = 0; for (i = 0; i < nKeyCols; i++) { columns[i] = pKeyList; Limit = ColumnOffset(i); for (j = 0; ((j < Limit) && (columns[i] != NULL)); j++) { columns[i] = columns[i]->Next; } } } EnableKeywordCursor(); ShowKeywordLisl t(); } /* Get the initial keyword list. */ void InputKeywordList() { Word i; sdType sdRet; KeyListType *Node; nKeyWords = CSubparams(KEYLISTINDEX); for(i = 0; i < nKeyWords; i++) { /* Pick up keyword. Put into Keyword List Node */ RgParam(KEYLISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->KeyWord, sdRet.cbString); Node->KeyWord[sdRet.cbString] = 0;x  AddToKeyWordList(Node); } } void KeywordCancel() { DisplayKeywordList(); oStateStack -= 1; } extern void LoadKeyWordList(); static void ParseLine() { KeyListType *Node; Word i, j; j = 0; while (TRUE) { i = j; /* Start from end of last word found */ /* Find start of (next) keyword */ while(isWhiteSpace(InputLine[i])) { if (InputLine[i] == NEWLINE) return;  i++; if (i == LINEMAX) return; } /* Find end of keyword */ for (j=i; !isWhiteSpace(InputLine[j]); j++) if (j == LIN EMAX) return; if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc((j-i)+1)) == NULL) ErrorExit(400); _move(&InputLine[i], Node->KeyWord, (j-i)); Node->KeyWord[(j-i)] = 0; AddToKeyWordList(Node); } } static void LoadKeywordFile() { KeyListType *Node; FILE *inp; oStateStack -= 1; if ((Replace[0] == 'Y') || (Replace[0] == 'y')) { /* Throw away current keywords */ pSelectList = (void *) &pSelectList; for (Node = pKeyList; Node != NULL; No de = pKeyList) { pKeyList = pKeyList->Next; free(Node->KeyWord); free(Node); } pKeyList = NULL; } if ((inp = fopen(FileName, "r")) == NULL) { Beep(); LoadKeyWordList(); return; } while (fgets(InputLine, 80, inp)) ParseLine(); fclose(inp); DisplayKeywordList(); } static void LoadKeyWordList() { HideKeywordCursor(); SetUp  - 1)) keyCursorCol += 1; ShowKeywordCursor(); break; case MARK: SelectKeyword(); break; case CODE_MARK: deSelectKeyword(); break; case F1: EnterKeyWordEntry(); break; case F3: SetUpDeleteKeyWordEntry();  break; case F4:  DrawMainDisplay(); oStateStack -= 1; break; case F8: LoadKeyWordList(); break; case F10: SaveKeyWordList(); break; default: Beep(); break; } } +) { /* Pick up keyword. Put into Keyword List Node */ RgParam(KEYLISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->KeyWord, sdRet.cbString); Node->KeyWord[sdRet.cbString] = 0;  =0 keymain.c C_samples=0ff/Vfl V Menu(&LoadKeyWordMenu); pCancelRoutine = KeywordCancel; pGoRoutine = LoadKeywordFile; oStateStack += 1; pState[oStateStack] = InputInformation; } stat ic void ProcessKeywordEntry() { KeyListType *Node; oStateStack -= 1; if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc(strlen(KeywordName)+1)) == NULL) ErrorExit(400); _move(KeywordName, Node->KeyWord, strlen(KeywordName)+1); AddToKeyWordList(Node); DisplayKeywordList(); } static void EnterKeyWordEntry() { KeywordName[0] = 0; /* Erase any old name entered previously */ HideKeywordCursor(); SetUpMenu(&EnterKeyWordMenu); pCancelRoutine = KeywordCan cel; pGoRoutine = ProcessKeywordEntry; oStateStack += 1; pState[oStateStack] = InputInformation; } static void DeleteKeywordEntry() { oStateStack -= 1; if (DeleteNode->Prev == NULL) { /* First node in list */ pKeyList = DeleteNode->Next; if (pKeyList != NULL ) pKeyList->Prev = NULL; } else { if (DeleteNode->Next != NULL) DeleteNode->Next->Prev = DeleteNode->Prev; DeleteNode->Prev->Next = DeleteNode->Next; } free(DeleteNode->KeyWord); free(DeleteNode); DisplayKeywordList(); } st atic void SetUpDeleteKeyWordEntry() { Word nLines; for (DeleteNode = columns[keyCursorCol], nLines = FIRSTLINE; ((DeleteNode != NULL) && (nLines < keyCursorLine) ); DeleteNode = DeleteNode->Next, nLines++); if (DeleteNode == NULL) { Beep(); return; } DeleteWord.pString = (Byte *) DeleteNode->KeyWord; DeleteWord.Col = ( (80-strlen(DeleteNode->KeyWord)) /2); HideKeywordCursor(); SetUpMenu(&DeleteKeyWordMenu); pCancelRoutine = KeywordCancel; pGoRoutine = DeleteKeywordEntry; oStateStack  += 1; pState[oStateStack] = InputInformation; } extern void SaveKeyWordList(); static void SaveKeywordFile() { KeyListType *Node; FILE *out; oStateStack -= 1; if ((out = fopen(FileName, "w")) == NULL) { Beep(); SaveKeyWordList(); return; } for (Node = pKeyList; Node != NULL; Node = Node->Next) { fputs(Node->KeyWord, out); fputs("\n", out); } fclose(out); DisplayKeywordList(); } static void SaveKeyWordList() { HideKeywordCursor(); SetUpMenu(&SaveKeyWordMenu); pCancelRoutine = K̞ eywordCancel; pGoRoutine = SaveKeywordFile; oStateStack += 1; pState[oStateStack] = InputInformation; } void fnckeywordList (Byte chr) { switch (chr) { case SCROLLUP: ScrollKeyWordList(1); break; case SCROLLDN: ScrollKeyWordList(-1); break; case PAGEUP: ScrollKeyWordList(-21);  break; case PAGEDN: ScrollKeyWordList(21); break; case UPARROW: HideKeywordCursor(); if (keyCursorLine > FIRSTLINE) keyCursorLine -= 1; ShowKeywordCursor(); break; case DOWNARROW: HideKeywordCursoؠ r(); if (keyCursorLine < (DisplayLines-1)) keyCursorLine += 1; ShowKeywordCursor(); break; case LEFTARROW: HideKeywordCursor(); if (keyCursorCol > 0) keyCursorCol -= 1; ShowKeywordCursor(); break; case RIGHTARROW: HideKeywordCursor(); if (keyCursorCol < (nKeyCols    /* * Keyword find program. * * Find a keyword in a file, display surrounding area * */ #define Beep #define CheckErc #define CSubparams #define ErrorExit #define PutFrameChars #define ReadKbd #define ResetFrame #define RgParam #include #include "keyword.h" #include #include /* Assumes no use of argc, argv */ /* Routines are actually called at init time, so must return valid values. */ _mwset_up_args() {return 0;} _mwcount_args() {return 0;} /* Vidio Routines found   in Vidio.c */ extern void InitVideo(); extern Word DisplayLines; extern void DrawFunctionKeyBar(Word iLine, Pointer psFunckeys); extern void SetUpMenu(MenuType pMenu); extern Pointer pSep; extern Pointer pBlanks; extern Word InputCursorLine; extern Word InputCursorCol; /* Keyword list routines found in keylist.c */ extern void InputKeywordList(); extern void InputfilenameList(); /* Define the state machine that handles the user interface */ void (*(pState[STATESTACKSIZE]))(Byte); Word oStateStack; /* De  fine the state machine functions */ extern void fnckeywordList (Byte chr); extern void DisplayKeywordList(); extern void fncFileNameList (Byte chr); extern void DisplayFilenameList(); extern void fncSearch (Byte chr); extern void SearchSetUp(); extern void InputInformation (Byte chr); /* Set up initial screen display */ void DrawMainDisplay() { CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 30, 1, "Keyword Find Program", 20)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80  )); CheckErc(PutFrameChars(DISPLAYFRAME, 31, 10, "Choose a function", 17)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, pBlanks, 80)); DrawFunctionKeyBar(2, " Keys  Files  Search      "); } /* Initial display - choose function */ static void fncMainDisplay(Byte chr) { switch (chr) { case F1: oStateStack += 1; pState[oStateStack] = fnckeywordList; DisplayKeywordList(); break; case F2:,   oStateStack += 1; pState[oStateStack] = fncFileNameList; DisplayFilenameList(); break; case F3: oStateStack += 1; pState[oStateStack] = fncSearch; SearchSetUp(); break; default: Beep(); break; } } void main() { Byte chr; /* Init the Vidio */ InitVideo(); /* Init the state machine */ oStateStack = 0; pState[oStateStack] = fncMainDisplay; /* Get initial Keyword, Filename lists */ InputKeywordList(); InputfilenameList(); DrawMainDisplay(); while (TRUE) { CheckErc(ReadKbd(&chr))8  ; switch (chr) { case FINISH: ErrorExit(0); default: (*pState[oStateStack])(chr); break; } } } into Filename List Node */ RgParam(FILELISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->Filename, sdRet.cbString); Node->Filename[sdRet.cbString] = 0; AddToFilenameList(Node); } }  void FilenameCancel() { ShowFilenameList(); ShowFilenameCursor()D  > keyword.h C_Samples> f f0VfV P   #define min(x,y) (x 0x7F)) /* define vidio display equates */ #define lNormal 0 #define lDim 1 #define lUnderLine 2 #define lReverse 4 #define lReverseHB 5 #define lBlink 8 #define DISPLAYFRAME 0 #define FNCKEYFRAME 1 #define SIZEFNCFRAME 3 #define MAXDSPCOLUMNS 4 #define MAXCOLUMNS 80 #define FIRSTLINE 3 #define NEWLINE 0x0A #define LINEMAX 512 /* Define keystroke values */ #define CANCEL 0x07 #define BACKSPACE 0x08 #define NEXT \   0x0A #define GO 0x1B #define UPARROW 0x01 #define DOWNARROW 0x0B #define LEFTARROW 0x0E #define RIGHTARROW 0x12 #define SCROLLUP 0x11 #define SCROLLD  C_Samples/1f@f2Vf   BEEPER.obj FILELIST.obj FUNC1.obj FUNC2.obj HUGE.obj KEYLIST.obj KEYMAIN.obj LARGE.obj LIFE.obj samgen.obj SAMPLE.obj SEARCH.obj start.obj SWAP.obj VIDIO.obj WRITE.obj  c"life.c-New c_samples"-f.f3Vf,  #include #include  F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0?   -1lib.fls-New C_Samples-1mff1Vf   Samples.lib_`@PopOo@pOo@?O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0?   s/1libSamples.fls-New  dio.h> #define AllocExch #define beep #define Check #define CheckErc #define CreateProcess #define Delay #define ErrorExit #define InitCharMap #define InitVidFrame #define PutFrameAttrs #define PutFrameChars #define QueryVidHdw #define ReadKbd #define ResetFrame #define ResetVideo #define Send #define SetScreenVidAttr #define Wait #include #define kernelErc #include #define lNormal 0 #define lDim 1 #define lUnderLine 2 #define lReverse 4 #define lRev erseHB 5 #define lBlink 8 #define CANCEL 0x07 #define BACKSPACE 0x08 #define NEXT 0x0A #define GO 0x1B #define UPARROW 0x01 #define DOWNARROW 0x0B #define LEFTARROW 0x0E #define RIGHTARROW 0x12 #define MARK 0x02 #define BOUND 0x0D #define FINISH 0x04 #define F1 0x15 #define F2 0x16 #define F9 0x1E #define F10 0x1F #define HOFF 20 #define VOFF 4 #define DELAYTIME 3 typedef struct PromptType { Word Line; Word Col; Byte *pString; struct PromptType *Next; } PromptType; typ edef struct InputType { Word Line; Word Col; Word Len; Byte *Data; struct InputType *Next; } InputType; typedef struct MenuType { PromptType *Prompt; InputType *Input; } MenuType; Word vcLines; Word vcCols; Byte old[20][20]; Byte new[20][20]; Word rgCol[6] = {0, 24, 56, 23, 31, 23}; char *psFunckeys; Word i, j; Word k, l; Word sum; MenuType *pActiveMenu; InputType *pActiveInputline; Byte *pActiveData; Word DisplayLines; Word InputCursorLine; Word InputCursorCol; Poi nter pBlanks = {" "}; Pointer pSep = {""}; /* Menu data */ PromptType LifeFileName = { 2, 0 ,(Byte *)"File Name" ,NULL }; PromptType lkfFiletitle = { 0, 25 ,(Byte *)"Load life game From File" ,&LifeFileName }; PromptType skfFiletitle = { 0, 24 ,(Byte *)"Save life game To File" ,&LifeFileName }; char  FileName[70] ={0}; InputType lkfFileInput = {2, 10, 70, (void *) &FileName, NULL}; InputType lkfFileOutput = {2, 10, 70, (void *) &FileName, NULL}; MenuType LoadLifeMenu = {&lkfFiletitle, &lkfFileInput}; MenuType SaveLifeMenu = {&skfFiletitle, &lkfFileOutput}; /* Process variables */ #define STACKSIZE 100 Word rgKbdStack[STACKSIZE]; Word kbdDefExch; Word kbdMsgExch; typedef struct { Pointer pEntry; Word saData; Word saExtra; Word saStack; Word oStackInit; Byte priority; Byte fSys; Word exch gDefaultResponse; Byte fDebug; } ProcDescType; void KbdProcess() { Byte chr; while(TRUE) { CheckErc(ReadKbd(&chr)); /* Be aware that because this routine does not wait for a reply from the process it sends the message to, that the chr may by changed by a subsequent readkbd request before the other process has acted on the chr sent. This is not likely for this program, but is likely in other circumstances!!! */ CheckErc(Send(kbdMsgExch, &chr)); } } void InitKbdProcess() { ProcDes cType processDscrptr; Pointer pStack; CheckErc(AllocExch(&kbdDefExch)); CheckErc(AllocExch(&kbdMsgExch)); pStack = &rgKbdStack; processDscrptr.pEntry = (void *) KbdProcess; processDscrptr.saData = selectorof(pStack); processDscrptr.saExtra = 0; processDscrptr.saStack = selectorof(pStack); pStack = &rgKbdStack[STACKSIZE-2]; processDscrptr.oStackInit = offsetof(pStack); processDscrptr.priority = 70; processDscrptr.fSys = FALSE; processDscrptr.exchgDefaultResponse = kbdDefExch; processDscrptr.( fDebug = FALSE; CheckErc(CreateProcess(&processDscrptr)); } void InitVideo() { ErcType erc; Word sMap; Byte rgbVidHdw[3]; CheckErc( QueryVidHdw (&rgbVidHdw, sizeof(rgbVidHdw)) ); vcLines = rgbVidHdw[1]; vcCols = rgbVidHdw[2]; CheckErc( ResetVideo (vcCols, vcLines, TRUE, 0x20, &sMap) ); /*Main frame*/ DisplayLines = vcLines - 3; CheckErc( InitVidFrame (0, 0, 0, vcCols, DisplayLines, 0, 0, 0, 0, 0) ); CheckErc( InitVidFrame (1, 0, DisplayLines  >Input->Line + (DisplayLines - 6); InputCursorCol = Menu->Input->Col; for (InputCursorCol = Menu->Input->Col; pActi| veData[InputCursorCol-Menu->Input->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } } void InputName (){ char *pChr; while(TRUE) { CheckErc( Wait(kbdMsgExch, &pChr) ); switch (*pChr) { case CANCEL: FileName[0] = 0; return; case GO: return; case NEXT: CheckErc(PutFrameAttrs(0,  InputCursorCol, InputCursorLine, lReverseHB, 1)); pActiveInputline = pActiveInputline->Next; if (pActiveInputline == NULL) pActive Inputline = pActiveMenu->Input; pActiveData = pActiveInputline->Data; InputCursorLine = pActiveInputline->Line + (DisplayLines - 6); for (InputCursorCol = pActiveInputline->Col; pActiveData[InputCursorCol-pActiveInputline->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); brea, vcCols, 3, 0, 0, 0, 0, 0) ); CheckErc( InitCha4  rMap(0, sMap) ); CheckErc( SetScreenVidAttr(1, TRUE) ); /*refresh*/ CheckErc( ResetFrame(0) ); CheckErc( ResetFrame(1) ); return; } void DrawFunctionKeyBar(Pointer psFunckeys) { CheckErc( PutFrameChars (1, 0, 2, psFunckeys, strlen(psFunckeys)) ); for (i = 0; i < 3; i++) { CheckErc( PutFrameAttrs(1, rgCol[i], 2, lReverseHB, rgCol[i+3]) ); } } void DrawBorder() { Word i; for (i = 0; i < 20; i++) { CheckErc(PutFrameAttrs(0, (i*2)+HOFF,  VOFF, lReverseHB, 2) ); CheckErc(PutFrameAttrs(0, (i*2)+HOFF,@  VOFF+20, lReverseHB, 2) ); } for (i = 0; i < 21; i++) { CheckErc(PutFrameAttrs(0, HOFF, i+VOFF, lReverseHB, 1) ); CheckErc(PutFrameAttrs(0, HOFF+40, i+VOFF, lReverseHB, 1) ); } } extern void LoadGeneration(); extern void SaveGeneration(); void InputGeneration(Word fTime) { char *pChr; if (fTime == TRUE) { for (i=0; i<20; i++) { /* clear out the arrays */ for (j=0; j<20; j++) { old[i][j] = 0; new[i][j] = 0; } }  } DrawFunctionKeyBar("  Run     L   Load  Save "); i = 9; j = 9; while (TRUE) { CheckErc( PutFrameAttrs(0, (j*2)+HOFF, i+VOFF, lUnderLine, 1) ); CheckErc( Wait(kbdMsgExch, &pChr) ); CheckErc( PutFrameAttrs(0, (j*2)+HOFF, i+VOFF, lNormal, 1) ); switch (*pChr) { case F9: LoadGeneration(); break; case F10: SaveGeneration(); break; case UPARROW: i -= 1; if (i < 1) i = 1; break; case DOWNARROW: i += 1; if (i > 19) i = 19; break; case LEFTARROW: j -= 1; if (j < 1) j = 1; break; case RIGHTARROWX  : j += 1; if (j > 19) j = 19; break; case MARK: old[i][j] = 1; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); break; case BOUND: old[i][j] = 0; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " ", 1)); break; case F2: DrawFunctionKeyBar(" Pause        "); return; case FINISH: ErrorExit(0); default: break; } } } void SetUpMenu(MenuType *Menu) { PromptType *Line; InputType *Data; Word i; pActiveMenud  = Menu; for (i = DisplayLines - 7; i < DisplayLines; i++) { CheckErc(PutFrameChars(0, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(0, 0, i, lNormal, 80)); } CheckErc(PutFrameChars(0, 0, DisplayLines - 7, pSep, 80)); for (Line = Menu->Prompt; Line != NULL; Line = Line->Next) { CheckErc(PutFrameChars( 0 ,Line->Col ,Line->Line + (DisplayLines - 6) ,Line->pString ,strlen(Line->pString) )); } for (Data = Menu->Input; Data != NULL; Data = Data->Next) { CheckErc(PutFrameAttrsp ( 0 ,Data->Col ,Data->Line + (DisplayLines - 6) ,lReverseHB ,Data->Len )); CheckErc(PutFrameChars( 0 ,Data->Col ,Data->Line + (DisplayLines - 6) ,Data->Data ,strlen(Data->Data) )); } /* Set up cursor at first position */ pActiveInputline = Menu->Input; if (pActiveInputline != NULL) { pActiveData = Menu->Input->Data; InputCursorLine = Menu- k; case BACKSPACE: CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col)  != 0) InputCursorCol -= 1; CheckErc(PutFrameChars(0, InputCursorCol, InputCursorLine, pBlanks, 1)); pActiveData[InputCursorCol-pActiveInputline->Col] = 0; CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); break; default: if (*pChr < 0x80) { /* Assume data char if not caught elsewhere */ CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col) < (pActiveInputline->Len -  1) ) { CheckErc(PutFrameChars(0, InputCursorCol, InputCursorLine, pChr, 1)); pActiveData[InputCursorCol - pActiveInputline->Col] = *pChr; pActiveData[(InputCursorCol-pActiveInputline->Col)+1] = 0; InputCursorCol += 1; } CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } else Beep(); break; } } } void reDrawGame() { Word i, j; for (i = DisplayLines - 7; i < DisplayLines; i++) { CheckErc(PutFrameChars(0, 0, i, pBlanks,  80)); CheckErc(PutFrameAttrs(0, 0, i, lNormal, 80)); } DrawBorder(); for (i=0; i < 20; i++) for (j = 0; j < 20; j++) { if (old[i][j] == 1) CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); else CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " ", 1)); } } void LoadGeneration() { FILE *inp; SetUpMenu(&LoadLifeMenu); InputName(); if (FileName[0] == 0) { reDrawGame(); return; } if ((inp = fopen(FileName, "r")) == NULL) { Beep(); reDrawGame(); return; } if(fread( old, 20, 20, inp) != 20) { Beep(); } fclose(inp); reDrawGame(); } void SaveGeneration() { FILE *out; SetUpMenu(&SaveLifeMenu); InputName(); reDrawGame(); if (FileName[0] == 0) return; if ((out = fopen(FileName, "w")) == NULL) { Beep(); return; } if(fwrite(old, 20, 20, out) != 20) { Beep();  } fclose(out); } void Play() { Word erc; Byte *pChr; erc = Check(kbdMsgExch, &pChr); if (erc != ercOK) { if (erc != ercNoMessage) { ErrorExit(erc); } } else { if (*pChr == (Byte) F1) { I nputGeneration(FALSE); } if (*pChr == (Byte) FINISH) { ErrorExit(0); } } for (i = 1; i < 20; i ++) { for (j = 1; j < 20; j ++) { sum = 0; for (k = i-1; k < i+2; k++) { for (l = j-1; l < j+2; l++) { sum += old[k][l]; } } if (old[i][j]) sum -= 1; switch (sum) { case 2: new[i][j] = old[i][j]; break; case 3: new[i][j] = 1; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); break; default: new[i][j] = 0; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " " , 1)); break; } } } CheckErc(Delay(DELAYTIME)); for (i = 1; i < 20; i ++) { for (j = 1; j < 20; j ++) { sum = 0; for (k = i-1; k < i+2; k++) { for (l = j-1; l < j+2; l++) { sum += new[k][l]; } } if (new[i][j]) sum -= 1; switch (sum) { case 2: old[i][j] = new[i][j]; break; case 3: old[i][j] = 1; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); break; default: old[i][j] = 0; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " ", 1)); break;   } } } CheckErc(Delay(DELAYTIME)); } void main() { InitKbdProcess(); InitVideo(); DrawBorder(); InputGeneration(TRUE); while (TRUE) Play(); }al, 80)); } CheckErc(PutFrameChars(0, 0, DisplayLines - 7, pSep, 80)); for (Line = Menu->Prompt; Line != NULL; Line = Line->Next) { CheckErc(PutFrameChars( 0 ,Line->Col ,Line->Line + (DisplayLines - 6) ,Line->pString ,strlen(Line->pString) )); } for (Data = Menu->Input; Data != NULL; Data = Data->Next) { CheckErc(PutFrameAttrs link.fls C_Samples5f6f3Vfq  l  T %' Bind %'Object modules'@linkHuge.fls %'Run file'huge.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]'  `P_Ш0o 0__0O0? ` /linkKeyword.fls-New C_samples/fyf6Vf:V l samples.lib(keymain keylist filelist search vidio samgen) pOo@pOo@?inkbeeper.sub linkHuge.sub linkKeyword.sub linklarge.sub linklife.sub linksample.sub linkswap.sub linkwrite.sub  Q@linkbeeper.fls-New C_Samples@ff4Vf  samples.lib(beeper start)UNC1.lst FUNC2.lst HUGE.lst KEYLIST.lst KEYMAIN.lst LARGE.lst LIFE.lst SAMPLE.lst START.lst SWAP.lst VIDIO.lst WRITE.lst  8@linkbeeper.sub-New C_Samples@lfDf4VfI $ %' Bind %'Object modules'@linkbeeper.fls %'Run file'beeper.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'600 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]' %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' pend]' %'[debug?]' `P_Ш0o 0__0O0? 0 # linkhuge.fls-New C_samples#Tfʔf5Vf < samples.lib(huge) H k? linkHuge.sub-New C_samples?4fRf5VfY  O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0? x AlinkKeyword.sub C_samplesff7VffV  %' Bind %'Object modules'@linkKeyword.fls %'Run file'Keyword.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[d1]hc\\big\\hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0?    linklarge.fls-New C_samplesYf˔f8Vf   samples.lib(Large) UNC1/o FUNC2/o )   !? linklarge.sub-New C_samples?ff9Vf[ %' Bind %'Object modules'@linkLarge.fls %'Run file'Large.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcle.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0?  <=# linklife.fls-New C_Samples=#Qf̔f9Vf  samples.lib(life)  O@ linklife.sub-New C_Samples@nfcf:VfY  %' Bind %'Object modules'@linklife.fls %'Run file'life.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]'   e]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]'  `P_Ш0o 0__0O0? P#  linkwrite.fls-New C_Samples[f˔f=Vf \$ samples.lib(write) UNC1/o FUNC2/o ) %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]'  `P_Ш0o 0__0O0?   linksample.fls-New C_Samples Ufʔf:Vf  samples.lib(sample) Re@linksample.sub-New C_Samples@kfFf;Vf]  %' Bind %'Object modules'@linksample.fls %'Run file'sample.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'1200 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0?   &n? linkswap.fls-New C_samples?&ffhcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0? )  --lst.fls-New C_Samplesff>Vf *  BEEPER.lst FILELIST.lst FUNC1.lst FUNC2.lst HUGE.lst KEYLIST.lst KEYMAIN.lst LARGE.lst LIFE.lst samgen.lst SAMPLE.lst SEARCH.lst SWAP.lst VIDIO.lst WRITE.lst , !#1map.fls C_Samples#1f͙f>VfQ - !beeper.map huge.map Keyword.map Large.map life.map sample.map swap.map write.map / "ln/obj.fls C_Samples/ff?Vf 0 "BEEPER.obj FILELIST.obj FUNC1.obj FUNC2.obj HUGE.obj KEYLIST.obj KEYMAIN.obj LARGE.obj LIFE.obj samgen.obj SAMPLE.obj SEARCH.obj start.obj SWAP.obj VIDIO.obj WRITE.obj 2 #\dž/run.fls C_Samples/͓fÙf@VfQ 3 #beeper.run huge.run Keyword.run Large.run life.run sample.run swap.run write.run 5 $/sa  ial printer byte streams. 4B % * ;******************************************************************************; $INCLUDE ([sys]samgen.mdf) %Init ; %DeviceOpen([Kbd],OpenByteStreamK) %DeviceOpen([Vid],OpenByteStreamVid) %DeviceOpen([Disk],OpenByteStreamAD) ;***************************************************************************** ; %tagProcs(tagDiskRead,FillBufferAD,FlushBufIllegal,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal) %tagProcs(tagDiskWrite,FillBufIllegal,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,@D %SetImageModeIllegal) %tagProcs(tagDiskModify,FillBufferAD,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal) %tagProcs(tagKbdRead,FillBufferK,FlushBufIllegal,ChkptNop,ReleaseEasy,SetImageModeIllegal) %tagProcs(tagVideoWrite,FillBufIllegal,FlushBufferVid,ChkptNop,ReleaseEasy,SetImageModeIllegal) ; ;***************************************************************************** ; %DevDepProc(QueryVidBs,QueryVideoBs) % c_samples/)-f*-f@Vf6 $8 %w"1 samgen.asm-New C_Samples"1ݗf.fAVf : %;***************************************************************************** ; FILE SAMGENALL.ASM -- * ; * ; COPYRIGHT 1981, 1986 CONVERGENT TECHNOLOGIES, INC. ALL RIGHTS RESERVED * ; * ; THIS PROGRAM IS FURNISHED UNDER A LICENSE RESTRICTING ITS USE SOLELY FOR * ; THE OPERATION OF A DESIGNATED COMPUT< %ER FOR A PARTICULAR PURPOSE, AND MAY * ; NOT BE COPIED OR OTHERWISE USED WITHOUT THE PRIOR WRITTEN CONSENT OF * ; CONVERGENT TECHNOLOGIES, INC. TITLE TO AND OWNERSHIP OF THE PROGRAM, * ; INCLUDING ITS SOURCE CODE, SHALL AT ALL TIMES REMAIN IN CONVERGENT * ; TECHNOLOGIES. * ; * ;  > % * ; The file "SamGen.Mdf" contains all of the macro definitions for the macros * ; which are contained in this file, "SamGenAll.Asm". The Sequential Access * ; Method (SAM) implementation contained in CTOS.Lib may be reconfigured by * ; creating a tailored SAMGEN module. First, the SAMGEN.ASM source file must * ; be edited to reflect the new configuration. After editing, the SAMGEN.ASM * ; file must be assembled and then the resulting object file, SAMGEN.OBJ, must* ; be included in the list of object(@ % modules at link time. Alternately, if the* ; new SAM configuration is to be the default SAM configuration, the Librarian* ; utility may be used to overwrite the SAMGEN module contained in CTOS.Lib. * ; The default SAM configuration contained in CTOS.Lib includes disk, * ; keyboard, video, parallel printer, null, and spooler byte streams. * ; In addition, the user may wish to include other byte streams, e.g. * ; communication or ser DevDepProc(GetBsLfa,GetBsLfaAsync) %DevDepProc(SetBsLfa,SetBsLfaAsync) %FinLF %al "AHH$H)H3HUH^HqHvHHHHYHHHHHHHHHH H7H<HHHHH HH'H9H]HHHHHHHH H4HoHtHHHHH<HDHhHtHHHHHHHHHft%d6hu\\\\\ \\\\\\\D\\\\ \+\=\Y\v\&D^gCjvPh$IrXH &P@sample.c c_samplesP@ffAVf dI & #define ULCMPB #include #include #include #include int main(argc, argv) int argc; char *argv[]; { FILE *inp, *out; char *pIfilename; char *pOfilename; char line[256]; time_t t1, t2; long int l; l = clock() / CLK_TCK; printf("%ld seconds = %ld hours and %ld minutes", l, l/3600, (l%3600)/60); printf(" past midnight\n"); time(&t1); printf("Greenwich time: %s", asctime(gmtime(&t1))); printf("Local time : %s", ctime(&t1)); if ( argc < 2 ) pIfilenpK &ame = "[kbd]"; else pIfilename = argv[1]; printf("Input file name : %s\n", pIfilename); if ((inp = fopen(pIfilename, "r")) == NULL) { printf("openfail"); return(0); } if ( argc < 3 ) pOfilename = "[vid]"; else pOfilename = argv[2]; printf("Output file name : %s\n", pOfilename); if ((out = fopen(pOfilename, "w")) == NULL) { printf("openfail"); return(0); } while (fgets(line, 256, inp)) fputs(line, out); printf("*******************EOF******************\n"); if (ULCMPB(pIfilename, "[kbd|M &]", 5) != 0xFFFF) { printf("\n***Now seek back to beginning of file***\n"); fseek(inp,0l,SEEK_SET); while (fgets(line, 256, inp)) fputs(line, out); printf("*****************EOF***************\n"); } time(&t2); printf("New local time : %s",asctime(localtime(&t2))); printf("Difference between the two local times "); printf("(in seconds): %.0f\n", difftime(t2,t1)); return (0); }ZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666O '"search.c C_Samples"efffBVf P '/* * Search keylist routine. */ #define Beep #define CheckErc #define PutFrameChars #define PutFrameAttrs #define ResetFrame #include #include "keyword.h" #include #include #include /* Vidio Routines found in Vidio.c */ extern void DrawFunctionKeyBar(Word iLine, Pointer psFnckys); extern Word DisplayLines; extern Pointer pBlanks; extern Pointer pSep; /* State machine varaibles */ extern void DrawMainDisplay(); extern Word oStateStack; extern KeyListType *R 'pKeyList; extern KeyListType *pSelectList; extern FileListType *pFileList; /*****************************************************************************/ Word waitforack; Word searchdone; Word KeyWordSize; KeyListType *pKeys; FileListType *pFiles; FILE *input; #define LNLINES 23 #define LINESIZE 256 #define STARTLINE 11 Byte line[LNLINES][LINESIZE]; Byte *pDisplayline[LNLINES]; Word iLine; Word nLine; char filedisplay[] = "Searching file: "; char positiondisplay[80]; /************************T '*****************************************************/ void InitFileUse() { Word i; if (input != NULL) fclose(input); /* Done with old file */ input = NULL; /* Done with this handle. */ nLine = 1; for (i = 0, line[0][0] = 0; i < LNLINES; i++) pDisplayline[i] = &line[0][0]; /* clear display */ if (pFiles == NULL) ret   i, lNormal, 80)); } CheckErc(PutFrameChars(DISPLAYFRAME,33,10,"Search done...", 14)); searchdone++; } else { /* display data around this match */ for (i = 0; i < LNLINES; i++) { if (pDisplayline[i] != NULL) { linesize = strlen((char *)c ' pDisplayline[i]); CheckErc(PutFrameChars (DISPLAYFRAME, 0, i + FIRSTLINE, pDisplayline[i], linesize)); CheckErc(PutFrameChars (DISPLAYFRAME, linesize, i + FIRSTLINE, pBlanks, 80-linesize)); } else { CheckErc(PutFrameChars (DISPLAYFRAME, 0, i + FIRSTLINE, pBlanks, 80)); } } CheckErc(PutFrameAttrs( DISPLAYFRAME,0,STARTLINE+ FIRSTLINE,lUnderLine,80)); if (positionfoundat < 80) CheckErc(PutFrameAttrs( DISPLAYFRAME,positionfoundat,STARTLINE+ FIRSTLINE,  e ' lUnderLine +lReverseHB,KeyWordSize)); } } void SearchSetUp(){ waitforack = 0; searchdone = 0; CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0urn; /* display file name on top line */ i = strlen(filedisplay); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 0, pBlanks, 80)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, pBlanks, 80V ')); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 0, filedisplay, i)); CheckErc(PutFrameChars(DISPLAYFRAME, i, 0, pFiles->Filename, ((strlen(pFiles->Filename)+i)<80) ? strlen(pFiles->Filename) : 80-i)); /* display current line number in file on next line */ sprintf(positiondisplay, "At line number: %d%n", nLine, &i); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, positiondisplay, i)); if ((input = fopen(pFiles->Filename, "r")) == NULL) { for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChaX 'rs(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80)); } CheckErc(PutFrameChars(DISPLAYFRAME,0,10,"File not found:", 15)); CheckErc(PutFrameChars(DISPLAYFRAME,16,10, pFiles->Filename, strlen(pFiles->Filename))); Beep(); waitforack = 1; return; } for (i = STARTLINE, iLine = 0; i < DisplayLines-FIRSTLINE; i++, iLine++) { if (fgets((char *)&line[iLine][0], LINESIZE, input) == NULL) line[iLine][0] = 0; pDisplayline[i] = &(line[iLine][0]); Z ' } } void FindNextFile() { if (pFiles != NULL) pFiles = pFiles->Next; InitFileUse(); } void ShiftLineBuffer() { Word i; nLine++; /* display this on top line */ sprintf(positiondisplay, "At line number: %d%n", nLine, &i); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, positiondisplay, i)); for (i = 0; i < LNLINES - 1; i++) pDisplayline[i] = pDisplayline[i+1]; if (++iLine == LNLINES) iLine = 0; if (fgets((char *)&line[iLine][0], LINESIZE, input) == NULL) line[iLine][0] = 0; pDisplayline[LNLINES - 1\ '] = &(line[iLine][0]); }  Word FindMatchInFile() { KeyListType *pSearch; Word limit; Word i; if (pKeys == NULL) return(0xFF); /* kick out, let search end */ while (TRUE) { if ((limit = strlen(pDisplayline[STARTLINE])) == 0) { FindNextFile(); if (input == NULL) return(0xFF); } else { for (pSearch = pKeys; ( (pSearch != NULL) && (pSearch != (void *)&pSelectList) ); pSearch = (pSelectList == (void *) &pSelectList) ? pSearch->Next : pSearch->Selected) { KeyWordSize =^ ' strlen(pSearch->KeyWord); if (KeyWordSize >= limit) continue; for (i = 0; (i+KeyWordSize) <= limit; i++) if (strncmp(pSearch->KeyWord, (char *)(&(pDisplayline[STARTLINE])[i]), KeyWordSize) == 0) return (i); } ShiftLineBuffer(); } } } void DisplayNext() { Word i, linesize; Word positionfoundat; if (waitforack != 0) { /* Any error to ack? */ waitforack = 0; return; } positionfoundat = FindMatchInFile(); if (waitforack != 0) { /* May have encountered new erro` ' r to ack */ waitforack = 0; return; } if ((pKeys == NULL) || (pFiles == NULL)) { /* search done */ for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, , 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, pBlanks, 80)); DrawFunctionKeyBar(2, "   Back      Next "); pKeys = (pSelectList == (void *) &pSelectList) ? pKeyList : pSelectList; pFiles = pFileList; g ' if (pKeys == NULL) { CheckErc(PutFrameChars(DISPLAYFRAME,31,10,"Nothing to find...", 18)); Beep(); waitforack = 1; } input = NULL; InitFileUse(); DisplayNext(); } void fncSearch (Byte chr){ if ((searchdone != 0) && ((chr == F10) || (chr == NEXT))) { DrawMainDisplay(); oStateStack -= 1; if (input != NULL) fclose(input); return; } switch (chr) { case F4: DrawMainDisplay(); oStateStack -= 1; if (input != NULL) fclose(input); break; case F10: if (input != NULL) ShiftLineB$i ' uffer(); DisplayNext(); break; case NEXT: if (input != NULL) ShiftLineBuffer(); DisplayNext(); break; default: Beep(); break; } } nput = NULL; /* Done with this handle. */ nLine = 1; for (i = 0, line[0][0] = 0; i < LNLINES; i++) pDisplayline[i] = &line[0][0]; /* clear display */ if (pFiles == NULL) return; /* display file name on top line */ i = strlen(filedisplay); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 0, pBlanks, 80)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, pBlanks, 800k (q@server.h C_Samples@ffCVf @@@A0B0CO@D? KVXoYZZO[[\P^?_ c/ 0g`q`s?v x/ yPzOpzz1|1E  0FIN/C H M R Tp )'1 Source.fls C_Samples'1Uf VfCVf`q )asm.fls beeper.c filelist.c func1.c func2.c glider HighC.fls huge.c keylist.c keymain.c keyword.h large.c lib.fls libSamples.fls life.c link.fls linkbeeper.fls linkbeeper.sub linkhuge.fls linkHuge.sub linkKeyword.fls linkKeyword.sub linklarge.fls linklarge.sub linklife.fls linklife.sub linksample.fls linksample.sub linkswap.fls linkswap.sub linkwrite.fls linkwrite.sub lst.fls map.fls obj.fls run.fls sa samgen.asm sample.c search.c server.h Source.fls start.asm swap.c sym.fls tree vidio.c write.c ls *@ start.asm c_samples@ffDVf xt *; ;************************************************************************* ; This initialization routine is designed for use with MetaWare C routines ; that do not use any of the MetaWare C library routines. This allows ; system programmers to write services that do not suffer from the C runtime ; memory overhead - which is between 7k and 42k bytes, depending on what ; subsys  ); PutLabels(); }       $ ) . 3 8 = B G L Q V [ ` e  O{ e    ( B W   0  p p   5 xCxNNN8NzN Z$Z<ZTZlZZZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666؃ , 1sym.fls C_Samples 1ՙf֙fEVfQ  ,beeper.sym huge.sym Keyword.sym Large.sym life.sym sample.sym swap.sym write.sym tems are cheated out of the link using dummy routine names. ; ; The additional memory recovered by avoiding the C runtime library cv *ompletely ; is worth the trouble, but care must be taken to insure that none of the ; runtime features are used when initialized from this routine. ; ; Fortunately, link errors will result in all known cases so far... ; stack segment word 'stack' stack_start equ this byte db 'MetaWare ' db 'High C' db ' Run-time Library Copyright (C) 1983-1988 MetaWare Incorporated..' stack ends data segment 'data' zero db 0 pzero dw OFFSET dgroup:zero dw dgroup data ends const segment 'const' const ends memory sex *gment 'memory' memory ends dgroup group stack,DATA,const,memory code segment 'code' code ends extrn main:FAR extrn exit:FAR init_code segment 'code' assume cs: init_code public _mwINIT _mwinit PROC FAR mwINIT: cli ; Wait 'til I have a stack. mov BP,0 ; Initialize stack frame pointer mov ax,dgroup mov ds,ax mov ss,ax assume ds:dgroup mov  sp, OFFSET dgroup:stack_start sti ; Stack in place, can handle interrupts now. ; ; set up argc, argv for no parameters from this initializer mov axz *, dgroup mov bx, offset dgroup: pzero push ax push bx mov ax,1 push ax CALL main ; ; If the C program returned, call ctos exit. CALL exit _mwinit endp init_code ends end _mwinit H(JjVVyVVV.VPVVVVwVHXdWz!`:`LM~JT!K!b!!6#!3!3!3!cD!D!D!! ! !/"""p"R"U""!2#Z2#r2#2#2#| +c?swap.c C_samples?ffDVf> } +#ifdef __LARGE__ #include #include #include  #include #else $#include $#define AllocMemorySL $#define InitLargeOverlays $#include pragma Calling_convention(_FAR_CALL|_CALLEE_POPS_STACK|_DGROUP_MODEL); extern int OutputToVid0(void *, int); extern int AllocMemorySL(int, void *); extern int InitLargeOverlays(void *, int); pragma Calling_convention(); #endif long *func1(), *func2(); long a=2, b=3, c ; extern char * sbVerrun; int inmain(){ + return 1; } main() { int erc; char *poverlay; /* address of overlay area */ int i; /* Allocate Memory for overlays. */ if( erc = AllocMemorySL(4096, &poverlay) ) ErrorExit( erc ); /* Initialize overlays */ if( erc = InitLargeOverlays(poverlay, 256) ) ErrorExit( erc ); for (i=0; i<20; i++){ printf("%ld + %ld = %ld; %ld * %ld = %ld\n", a, b, *(func1()), a, b, *(func2())); a++; b++; } for (i=0; i<10; i++){ double d1; d1 = i; printf("%f %f %f %f\n",d1+1.0,d1-1.0,d1*́ +1.0,d1/1.0); } NewScreen(); funcx(   -Ld0tree c_samples01-f2-fFVf - . vidio.c C_samplesffGVfV  ./* * Define a selection of vidio manipulation routines */ #define Beep #define CheckErc #define InitCharMap #define InitVidFrame #define PutFrameAttrs #define PutFrameChars #define QueryVidHdw #define ReadKbd #define ResetFrame #define ResetVideo #define SetScreenVidAttr #include #include "keyword.h" #include #include Word vcLines; Word vcCols; Word rgCol[6] = {0, 24, 56, 23, 31, 23}; Word DisplayLines; char Inputline[LINEMAX]; MenuType *pActiveMenu; InputType *  .pActiveInputline; Byte *pActiveData; void (*(pCancelRoutine))(); void (*(pGoRoutine))(); Word InputCursorLine; Word InputCursorCol; Pointer pBlanks = {"  "}; Pointer pSep = {""}; void InitVideo() { Word sMap; Byte rgbVidHdw[3]; CheckErc( QueryVidHdw (&rgbVidHdw, sizeof(rgbVidHdw)) ); vcLines = rgbVidHdw[1]; vcCols = rgbVidHdw[2]; CheckEr, .c( ResetVideo (vcCols, vcLines, TRUE, 0x20, &sMap) ); /*Main frame*/ DisplayLines = vcLines - SIZEFNCFRAME; CheckErc( InitVidFrame(DISPLAYFRAME, 0, 0, vcCols, DisplayLines, 0, 0, 0, 0, 0) ); /* function bar frame */ CheckErc( InitVidFrame(FNCKEYFRAME, 0, DisplayLines, vcCols, 3, 0, 0, 0, 0, 0) ); CheckErc( InitCharMap(0, sMap) ); CheckErc( SetScreenVidAttr(1, TRUE) ); /*refresh*/ CheckErc( ResetFrame(DISPLAYFRAME) ); CheckErc( ResetFrame(FNCKEYFRAME) ); return; } void DrawFunctionKeyB8 .ar(Word iLine, Pointer psFnckys) { Word i; CheckErc(PutFrameChars(FNCKEYFRAME, 0, iLine, psFnckys, strlen(psFnckys))); for (i = 0; i < 3; i++) { CheckErc( PutFrameAttrs(FNCKEYFRAME, rgCol[i], iLine, lReverseHB, rgCol[i+3]) ); } } void SetUpMenu(MenuType *Menu) { PromptType *Line; InputType *Data; Word i; pActiveMenu = Menu; for (i = DisplayLines - 7; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80)); D . } CheckErc(PutFrameChars(DISPLAYFRAME, 0, DisplayLines - 7, pSep, 80)); for (Line = Menu->Prompt; Line != NULL; Line = Line->Next) { CheckErc(PutFrameChars( DISPLAYFRAME ,Line->Col ,Line->Line + (DisplayLines - 6) ,Line->pString ,strlen(Line->pString) )); } for (Data = Menu->Input; Data != NULL; Data = Data->Next) { CheckErc(PutFrameAttrs( DISPLAYFRAME ,Data->Col ,Data->Line + (DisplayLines - 6) ,lReverseHB ,Data->Len )); CheckErc(PutFrameChars( DISPLAP .YFRAME ,Data->Col ,Data->Line + (DisplayLines - 6) ,Data->Data ,strlen(Data->Data) )); } /* Set up cursor at first position */ pActiveInputline =   ufufHVf / #include #include doone(char *mode) { FILE *out; long i; char filename[100]; strcpy(filename, "Test."); strcat(filename, mode); strcat(filename, ".tst"); remove(filename); if ((out = fopen(filename, mode)) == NULL) { printf("Open fail"); return(0); } for (i = 0; i < 7; i += 2) { if(fseek(out, i, SEEK_SET) != 0) { printf("Write fail"); return(0); } if(fwrite("AC", 2, 1, out) != 1) { printf("Write fail"); return(0); } } for (i = 1; i < 8; i += 2 /) { if(fseek(out, i, SEEK_SET) != 0) { printf("Write fail"); return(0); } if(fwrite("B", 1, 1, out) != 1) { printf("Write fail"); return(0); } } } int main() { char mode[4]; char *smodes[2] = {"w", "a"}; char *pmodes[5] = {"\0", "+", "+b", "+t", "+u"}; int i, j; for (i = 0; i < 2; i++) { for Menu->Input; if (pActiveInputline != NULL) { pActiveData = Menu->Input->Data; InputCursorLine = Menu->Input->Line + (DisplayLines - 6); InputCursorCol = Menu->Input->Col; for (InputCursorCol = Menu->Input->Col; pActiveData[InputCursorCol-Menu->Input->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(DISPLAYFRAME, InputC\ .ursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } CheckErc(PutFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, pBlanks, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 2, pBlanks, 80)); CheckErc(PutFrameAttrs(FNCKEYFRAME, 0, 2, lNormal, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 18, 2, "Press GO to act, press cancel to exit menu.", 43)); } void InputInformation (Byte chr){ switch (chr) { case CANCEL: (*pCancelRoutine)(); break; case GO: (*pGoRoutineh .)(); break; case NEXT: CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lReverseHB, 1)); pActiveInputline = pActiveInputline->Next; if (pActiveInputline == NULL) pActiveInputline = pActiveMenu->Input; pActiveData = pActiveInputline->Data; InputCursorLine = pActiveInputline->Line + (DisplayLines - 6); for (InputCursorCol = pActiveInputline->Col; pActiveData[InputCursorCol-pActiveInputline->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(DISPLAYFRAME, Inpt . utCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); break; case BACKSPACE: CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col) != 0) InputCursorCol -= 1; CheckErc(PutFrameChars(DISPLAYFRAME, InputCursorCol, InputCursorLine, pBlanks, 1)); pActiveData[InputCursorCol-pActiveInputline->Col] = 0; CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); br . eak; default: /* Assume data char if not caught elsewhere */ if ((chr < 0x80) && (pActiveInputline != NULL)) {  CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col) < (pActiveInputline->Len - 1) ) { CheckErc(PutFrameChars(DISPLAYFRAME, InputCursorCol, InputCursorLine, &chr, 1)); pActiveData[InputCursorCol - pActiveInputline->Col] = chr; pActiveData[(InputCursorCol-pActiveInputline->Col)+1] = . 0; InputCursorCol += 1; } CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } else Beep(); break; } } ine QueryVidHdw #define ReadKbd #define ResetFrame #define ResetVideo #define SetScreenVidAttr #include #include "keyword.h" #include #include Word vcLines; Word vcCols; Word rgCol[6] = {0, 24, 56, 23, 31, 23}; Word DisplayLines; char Inputline[LINEMAX]; MenuType *pActiveMenu; InputType * /1Dwrite.c C_SamplesD!  (j = 0; j < 5; j++){ strcpy(mode, smodes[i]); strcat(mode, pmodes[j]); doone(mode); } } }  %' Copy [kbd] [Scr]<$>args.Tmp Yes '[File List]' '[Keyword List]' Copy [kbd] [Scr]<$>desc.Tmp Yes 'find keywords in files' %' New Command %'Command name''keyword' %'Run file'%0keyword.run %'[Field names]'@[Scr]<$>args.Tmp %'[Description]'@[Scr]<$>desc.Tmp %'[Overwrite ok?]'yes %'[Case (default 00)]' %'[Command file]'%1sys.cmds Type [kbd] When the restore program prompts for Samples.01, Press GO. Press GO to begin restore... 1Restore %'[Archive file]'[f0]Samples %'[File list from]*'* %'[File list to]*'%0* %'[Overwrite ok?]'y %'[Confirm each?]' %'[Sequence number]' %'[Merge with existing file?]' %'[List files only?]' %'[Log file]' Type %'File list'[kbd] %'[Confirm each?]'  Finished installing High C Samples  yPzOpzz1|1E  0FIN/C H M R %' Video %'[Suppress pause between pages?]'y %'[Screen time out (in minutes)]' %'[Color (e.g., Green)]' %'[Narrow characters?]' %'[Background color]' Type %'File list'[kbd] %'[Confirm each?]' Install High C sample programs. The submit form below defines parameters used to install the High C sample program files. The first parameter (defaulting to [sys]) tells this submit what volume and directory to use to hold the sample files. The second parameter (defaulting to %#0:'[sys]':%0) tells this submit what volume and directory has the system command file to be updated. If you are booted from a local disk, then [sys] is appropriate for this parameter. If you wish to update the master, then make sure that the samples are copied to a volume attached to the master, and set this parameter to [!sys]. Press GO to continue... Submit %'File list'[f0]continue.sub %'[Parameters]'[sys] %#0:'[sys]':%0 1 1u z        $ ) . 3 8 = B G L Q V [ ` e  O{ e    ( B W   0  p p   5 xCxNNN8NzN Z$Z<ZTZlZZZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666!  " "  # #  $ $  % %  log.sys badBlk.sys Prompt.sub hdinstall.sub crashDump.sysfileHeaders.sysmfd.sys sysImage.sys continue.sub & ArchiveggK >: FSysctZ( 9|M^SysctZ(9{8xfileHeaders.sysSysgggmfd.sysSysgg glog.sysSysggg]U sysImage.sysSysggg badBlk.sysSysggg&  ] Samples.01ct 3gg[;gȦ,n  crashDump.sysSysggg linker.runctEggEg)DF hdinstall.subSys&ggg& Prompt.subSys $2gggkP continue.subSys )ggg"oY readme.docct nEggYg$V$MPBQffAlansteve' +m*l)k(j'i&h%g$f'  _^#e"d!c ba`( ]\ [ !Z!"Y"#X#$W$%V%&(   O,- N-.U&'T'(S()R)*Q*+P+,)  M./ L/0 K01J12I23H34G45F56)  ><===>E67D78C89B9:@:;?;<* <>?;?@:@A9AB8BC7CD6DE5EF*  4FG3GH2HI1IJ{J+  readme.doc +  , ,   linker.run-  Samples.01 2am e asm.fls-New C_Samplesff1g   samgen.asm start.asm  @beeper.c c_samples@ff1g -  estInfo(BEEPRQ, &rqInfo, sizeof(rqInfo)) ); /* This is the deinstallation check. If the named server isl  already in a partition, then the server is assumed to be alive and well. A message is sent to the service exchange for the server. In this case, instead of a request, the message is a special value pased as if it were a pointer to a request. The server recieves the message, and because it is running at a higher priority than this program, this program won't execute again until the server has had time to clean up and wait for removal. If the server process could block during deinstallation (wax it), then this program would have to be modified to send a request for deinstallation, and wait for the response before proceeding. When this program regains control, it then uses the partition handle obtained to vacate and remove the server partition. this program then sets up an appropriate exit message, and exits */ if (GetPartitionHandle(&rgServerName, 11, &PhRet$  #define AllocExch #define CheckErc #define ChangePriority #define ConvertToSys #define ChangePriority #define Check #define Crash #define ErrorExit #define ForwardRequest #define GetUserNumber #define GetPartitionHandle #define QueryRequestInfo #define RemovePartition #define Respond #define Send #define SetMsgRet #define SetPartitionLock #define SetPartitionName #define ServeRq #define VacatePartition #define Wait #include #include /* opt out not needed library routines to conserve0 r space */ #include #define BEEPRQ 52 typedef struct { Byte sCntInfo; /* 00 number of control info bytes */ Byte RtCode; /* 01 routing code (SRP) */ Byte nReqPbCb; /* 02 number of req pbcb's */ Byte nRespPbCb; /* 03 number of resp pbcb's */ Word UserNum; /* 04 user number */ Word ExchResp; /* 06 exchange */ Word ErcRet; /* 08 erc to return */ Word RqCode; /* 10 request code */ } RqType; /* 12 */ typedef struct { Word exch; <  Word lsc; } rqInfoType; Word erc; char *psName; char *pServerName; rqInfoType rqInfo; Word exchServe; Word usernum; Word PhRet; char rgServerName[11] = "Beep Server"; char rgmsg1[23] = "Beep Server deinstalled"; char rgmsg2[21] = "Beep Server Installed"; void CrashIfErcNotOk(erc) Word erc; { if (erc != ercOK) Crash(erc); } /* PROCESS A REQUEST Process each request that comes in. */ void ProcessRequest(pRq) RqType *pRq; { if (pRq->UserNum > usernum) { if ((erc = Respond(pRq)) != ercOK) CrH ash(erc); } else { if ((erc = ForwardRequest(rqInfo.exch, pRq)) != ercOK) Crash(erc); } } /* DEINSTALL: This routine returns controll of the request back to its original owner. Then any pending messages on the local service exchange are processed. Then the partition is unlocked, and the priority set to 0xFF, so that no more time is ever spent in this routine. It is then up to the program that sent the deinstallation message to vacate and remove the partition. */ void DeInstall() { RqType *T pRq; /* Serve request to 0 first to avoid SPR OS bug*/ CrashIfErcNotOk(ServeRq(BEEPRQ, 0)); CrashIfErcNotOk(ServeRq(BEEPRQ, rqInfo.exch)); /* Loop here to clear all messages on this exchange */ while (Check(exchServe, &pRq) == ercOK) { ProcessRequest(pRq); } /* All done, unlock partition, and wait for removal by deinstall program */ CrashIfErcNotOk (SetPartitionLock(FALSE)); /* unlock partition  */ CrashIfErcNotOk (ChangePriority(0xFF)); /* sleep here forever */ Crash(3); /* ` Os problem if we ever get here */ } /* MAIN ROUTINE Set up the partition as a server. First check for the server already being installed. If it is, then send a message for the service to clean up and wait for removal, then remove it. Otherwise, proceed with installation. */ void main(){ RqType *pRq; CheckErc(GetUserNumber(&usernum)); CheckErc(AllocExch(&exchServe)); CheckErc( QueryRequ. ) == ercOK){ CheckErc(Send(rqInfo.exch, (Pointer) 0x0000FFFFl)); CheckErc(VacatePartition(PhRet)); CheckErc(RemovePartition(P  hRet)); erc = SetMsgRet(&rgmsg1, 23); ErrorExit(erc); } /* BECOME A SERVER Since the server is not already installed, install now. Set up an appropriate exit message, and convert to sys (become a server). The ErrorExit call after the convertosys call allows the reloading of an exec in the primary partition. */ erc = SetMsgRet(&rgmsg2, 21); erc = ConvertToSys(); ErrorExit(erc); /* All servers must run at a priority higher than 40, else deadlocks can occur. */ CrashIfErcNotOk(ChangePriority(  12)); /* Set the partition name so that the deinstallation program can obtain this partition handle. */ CrashIfErcNotOk(SetPartitionName(0, &rgServerName, 11)); /* Now serve the request to the service exchange for this program. */ CrashIfErcNotOk(ServeRq(BEEPRQ, exchServe)); /* Server loop... */ while (TRUE) { CrashIfErcNotOk(Wait(exchServe, &pRq)); if (pRq == (Pointer) 0x0000FFFFl) DeInstall(); ProcessRequest(pRq); } } ő- filelist.c C_samples-ff1g2V  /* * Filename list manipulation */ #define Beep #define CheckErc #define CSubparams #define ErrorExit #define PutFrameChars #define PutFrameAttrs #define ReadKbd #define ResetFrame #define RgParam #include #include "keyword.h" #include #include #include /* Vidio Routines found in Vidio.c */ extern void DrawFunctionKeyBar(Word iLine, Pointer psFnckys); extern Word DisplayLines; extern Pointer pBlanks; extern Pointer pSep; extern void SetUpMenu(MenuType *Menu) ; extern char InputLine[LINEMAX]; /* State machine varaibles */ extern void DrawMainDisplay(); extern void InputInformation (Byte chr); extern void (*(pState[STATESTACKSIZE]))(Byte); extern Word oStateStack; extern void (*(pCancelRoutine))(); extern void (*(pGoRoutine))(); /* Define the Filename list variables */ FileListType *pFileList = NULL; static FileListType *columns[MAXDSPCOLUMNS]; static Word nFileCols; static Word nFilenames; /* Number of Filename entries */ static Word nColumnOffset; st atic Word FileCursorLine; static Word FileCursorCol; /* Menu data */ static PromptType LoadFilenameReplace = { 4, 0 ,(Byte *)"[Replace Existing Filename List (y/n)?]" ,NULL }; static PromptType LoadFilenameFileName = { 2, 0 ,(Byte *)"File Name" ,&LoadFilenameReplace }; static PromptType lkfFiletitle = { 0, 25 ,(Byte *)"Load Filename List From File" ,&LoadFilenameFileName }; static PromptType SaveFilenameFileName = { 2, 0 ,(Byte *)"File Name" !  ,NULL }; static PromptType skfFiletitle = { 0, 24 ,(Byte *)"Save Filename List To File" ,&SaveFilenameFileName }; static char Replace[2] = {'Y', 0}; static char FileName[70] ={0}; static InputType lkfReplace = {4, 40, 2, (void *) &Replace, NULL}; static InputType lkfFileInput = {2, 10, 70,(void *)&FileName, &lkfReplace}; static InputType lkfFileOutput = {2, 10, 70, (void *) &FileName, NULL}; static MenuType LoadFilenameMenu = { &lkfFiletitle ,&lkfFileInput }; static M# enuType SaveFilenameMenu = {  &skfFiletitle ,&lkfFileOutput }; static char FilenameName[80] ={0}; static InputType EnteredFilename = {3, 0, 80, (void *) &FilenameName, NULL }; static PromptType EnterFilenametitle = { 1, 30 ,(Byte *)"Enter Filename below" ,NULL }; static MenuType EnterFilenameMenu = { &EnterFilenametitle ,&EnteredFilename }; static FileListType *DeleteNode = NULL; static PromptType DeleteWord = { 3, 0, NULL, NULL }; static PromptType DeleteFilena% metitle = { .   } } } ShowFilenameCursor(); } stat,2  ic void ScrollFilenameList(int cLines) { Word i; if (columns[0] == NULL) return; if (cLines < 0) { /* Follow prev pointer */ while (cLines != 0) { if (nColumnOffset != 0) { for (i = 0; i < nFileCols; i++) { if (columns[i]->Prev != NULL) columns[i] = columns[i]->Prev; } nColumnOffset -= 1; } cLines += 1; } } else { /* Follow next pointer */ while (cLines != 0) { if ((nColumnOffset+(DisplayLines-FIRSTLINE))Next != NULL) columns[i] = columns[i]->Next; } nColumnOffset += 1; } cLines -= 1; } } ShowFilenameList(); } static void SizeFilenameList() { FileListType *pList; Word cbMax; cbMax = 0; nFilenames = 0; for (pList = pFileList; pList != NULL; pList = pList->Next) { if(strlen(pList->Filename) > cbMax) cbMax = strlen(pList->Filename); nFilenames += 1; } if (cbMax != 0) { 1, 22 ,(Byte *)"Press GO to delete the Filename below" ,&DeleteWord }; static MenuType DeleteFilenameMenu = { &DeleteFilenametitle ,NULL }; static Word nEntriesPerColumn() { return ( (nFilenames/nFileCols) + ( ((nFilenames%nFileCols) != 0) ?1:0) ); } static Word ColumnOffset( Word iCol) { if (iCol > nFileCols) return(0); return( (iCol *(nFilenames / nFileCols)) + (min(iCol, nFilenames % nFileCols)) ); } static void ShowFilenameCursor() { CheckErc (PutFra' meAttrs( DISPLAYFRAME ,FileCursorCol * (80/nFileCols) ,FileCursorLine ,lUnderLine ,80/nFileCols )); } static void HideFilenameCursor() { CheckErc (PutFrameAttrs( DISPLAYFRAME ,FileCursorCol * (80/nFileCols) ,FileCursorLine ,lNormal ,80/nFileCols )); } static void EnableFilenameCursor() { FileCursorLine = FIRSTLINE; FileCursorCol = 0; ShowFilenameCursor(); } /* Define Filename list manipluation functions */ static void AddToFilenameList(FileListType *Node) { FileListType *Lis) t; FileListType *Parent; Node->Prev = NULL; if (pFileList == NULL) { /* if */ pFileList = Node; Node->Next = NULL; } /* if */ else { /* outer else */ if (strcmp(Node->Filename, pFileList->Filename) == 0) { /* if */ free(Node->Filename); free(Node); return; } /* if */ if (strcmp(Node->Filename, pFileList->Filename) < 0) { /* if */ /* add in as first element */ Node->Next = pFileList; pFileList->Prev = Node; pFileList = Node; } /* if */ else { /* else */ /* Add ,  into middle of list */ for (List = pFileList; List != NULL; List = List->Next) { /* for */ if (strcmp(Node->Filename, List->Filename) == 0) { /* if */ free(Node->Filename); free(Node); return; } /* if */ if (strcmp(Node->Filename, List->Filename) < 0) { /* if */ Parent = List->Prev; Parent->Next = Node; List->Prev = Node; Node->Prev = Parent; Node->Next = List; return; } /* if */ Parent = List; /* Save this for adding to end of list */ .  } /* for */ /* Add to end of list */ Parent->Next = Node; Node->Prev = Parent; Node->Next = NULL; } /* else */ } /* outer else */ } /* end void */ static void ShowFilenameList() { Word i, j; FileListType *Showcolumns[MAXDSPCOLUMNS]; HideFilenameCursor(); for (j = 0; j < nFileCols; j++) { Showcolumns[j] = columns[j]; } for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80) 0  ); if ( (i - FIRSTLINE) + nColumnOffset < nEntriesPerColumn()) { for (j = 0; j < nFileCols; j++) { if ( ((i - FIRSTLINE) + ColumnOffset(j) + nColumnOffset) < ColumnOffset(j+1)) { if (Showcolumns[j] != NULL) { CheckErc(PutFrameChars( DISPLAYFRAME ,j*(MAXCOLUMNS/nFileCols) ,i ,Showcolumns[j]->Filename ,strlen(Showcolumns[j]->Filename) )); Showcolumns[j] = Showcolumns[j]->Next; } } / nFileCols = (cbMax < 60) ? (MAXCOLUMNS / (cbMax + 1)): 1; } elseD6  nFileCols = 1; if (nFileCols > MAXDSPCOLUMNS) nFileCols = MAXDSPCOLUMNS; } void DisplayFilenameList() { Word i, j; Word Limit; /* SET UP WINDOW FOR DISPLAY Filename LIST */  CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 36, 1, "Filenames", 8)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80)); DrawFunctionKeyBar(2, " Add   Del Back    Load   Save "); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrP8 ameChars(FNCKEYFRAME, 0, 1, " ENTRY FILE ", 80)); SizeFilenameList(); if (nFilenames == 0){ columns[0] = NULL; } else { nColumnOffset = 0; for (i = 0; i < nFileCols; i++) { columns[i] = pFileList; Limit = ColumnOffset(i); for (j = 0; ((j < Limit) && (columns[i] != NULL)); j++) { columns[i] = columns[i]->Next; } } } EnableFilenameCursor(); ShowFilenameList(); } /* Get the initial Filename list. */ void I\: nputFilenameList() { Word i; sdType sdRet; FileListType *Node; nFilenames = CSubparams(FILELISTINDEX); for(i = 0; i < nFilenames; i++) { /* Pick up Filename. Put into Filename List Node */ RgParam(FILELISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->Filename, sdRet.cbString); Node->Filename[sdRet.cbString] = 0; AddToFilenameList(Node); } } voidh<  FilenameCancel() { DisplayFilenameList(); oStateStack -= 1; } extern void LoadFilenameList(); static void ParseLine() { FileListType *Node; Word i, j; j = 0; while (TRUE) { i = j; /* Start from end of last word found */ /* Find start of (next) Filename */ while(isWhiteSpace(InputLine[i])) { if (InputLine[i] == NEWLINE) return; i++; if (i == LINEMAX) return; } /* Find end of Filename */ for (j=i; !isWhiteSpace(InputLine[j]); j++) if (j == LINEMAX) return; if ((Node = malt> loc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc((j-i)+1)) == NULL) ErrorExit(400); _move(&InputLine[i], Node->Filename, (j-i)); Node->Filename[(j-i)] = 0; AddToFilenameList(Node); } } static void LoadFilenameFile() { FileListType *Node; FILE *inp; oStateStack -= 1; if ((Replace[0] == 'Y') || (Replace[0] == 'y')) { /* Throw away current Filenames */ for (Node = pFileList; Node != NULL; Node = pFileList) { pFileList = pFileList->Next; free(Node@ ->Filename); free(Node); } pFileList = NULL; } if ((inp = fopen(FileName, "r")) == NULL) { Beep(); LoadFilenameList(); return; } while (fgets(InputLine, 80, inp)) ParseLine(); fclose(inp); DisplayFilenameList(); } static void LoadFilenameList() { HideFilenameCursor(); SetUpMenu(&LoadFilenameMenu); pCancelRoutine = FilenameCancel; pGoRoutine = LoadFilenameFile; oStateStack += 1; pState[oStateStack] = InputInformation; } static void ProcessFilenameEntry() { FileListType *NodeB ; oStateStack -= 1; if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(strlen(FilenameName)+1)) == NULL) ErrorExit(400); _move(FilenameName, Node->Filename, strlen(FilenameName)+1); AddToFilenameList(Node); DisplayFilenameList(); } static void EnterFilenameEntry() { FilenameName[0] = 0; /* Erase any old name entered previously */ HideFilenameCursor(); SetUpMenu(&EnterFilenameMenu); pCancelRoutine = FilenameCancel; pGoRoutine = ProcessFilenameEnD try; oStateStack += 1; pState[oStateStack] = InputInformation; } static void DeleteFilenameEntry() { oStateStack -= 1; if (DeleteNode->Prev == NULL) { /* First node in list */ pFileList = DeleteNode->Next; if (pFileList != NULL ) pFileList->Prev = NULL; } else { if (DeleteNode->Next != NULL) DeleteNode->Next->Prev = DeleteNode->/   #define OutputToVid0 #include extern long a,b,c; extern int inmain(); long * func1() { PutLabels(); c = a + b; return &c; } PutLabels() {return;} kbin() {return;} long *NewScreen() {return;} long * funcx() { long *d; int i; i = inmain(); for (i=0; i<10; i++){ double d1; d1 = i; OutputToVid0("this is a test of output", 24); printf("%f %f %f %f\n",d1+1.3,d1-1.3,d1*1.3,d1/1.3); } c = a + b; return &c; } O0? S ?func2.c C_samples?ff1g U #include extern long *func1(); extern long a,b; long (*pf)(); double *gd; static long c; static char qq[]="hello"; long * func2() { char *pqq; double d1, d2=5.0; char *prest; if (gd != 0) d2 = *gd; d1 = d2 * 3Prev; DeleteNode->Prev->Next = DeleteNode->Next; } free(DeleteNode->Filename); free(DeleteNode); DisplayFilenameList(); } static void SetUpDeleteFilenameF Entry() { Word nLines; for (DeleteNode = columns[FileCursorCol], nLines = FIRSTLINE; ((DeleteNode != NULL) && (nLines < FileCursorLine) ); DeleteNode = DeleteNode->Next, nLines++); if (DeleteNode == NULL) { Beep(); return; } DeleteWord.pString = (Byte *) DeleteNode->Filename; DeleteWord.Col = ( (80-strlen(DeleteNode->Filename)) /2); HideFilenameCursor(); SetUpMenu(&DeleteFilenameMenu); pCancelRoutine = FilenameCancel; pGoRoutine = DeleteFilenameEntry; oStateStack += 1; pState[oStatH eStack] = InputInformation; } extern void SaveFilenameList(); static void SaveFilenameFile() { FileListType *Node; FILE *out; oStateStack -= 1; if ((out = fopen(FileName, "w")) == NULL) { Beep(); SaveFilenameList(); return; } for (Node = pFileList; Node != NULL; Node = Node->Next) { fputs(Node->Filename, out); fputs("\n", out); } fclose(out); ShowFilenameList(); ShowFilenameCursor(); } static void SaveFilenameList() { HideFilenameCursor(); SetUpMenu(&SaveFilenameMenu); pCancelRJ outine = FilenameCancel; pGoRoutine = SaveFilenameFile;  oStateStack += 1; pState[oStateStack] = InputInformation; } void fncFilenameList (Byte chr) { switch (chr) { case SCROLLUP: ScrollFilenameList(1); break; case SCROLLDN: ScrollFilenameList(-1); break; case PAGEUP: ScrollFilenameList(-21);  break; case PAGEDN: ScrollFilenameList(21); break; case UPARROW: HideFilenameCursor(); if (FileCursorLine > FIRSTLINE) FileCursorLine -= 1; ShowFilenameCursor(); break; case DOWNARROL W: HideFilenameCursor(); if (FileCursorLine < (DisplayLines-1)) FileCursorLine += 1; ShowFilenameCursor(); break; case LEFTARROW: HideFilenameCursor(); if (FileCursorCol > 0) FileCursorCol -= 1; ShowFilenameCursor(); break; case RIGHTARROW: HideFilenameCursor(); if (FileCursorCol < (nFileCols - 1)) FileCursorCol += 1; ShowFilenameCursor(); break; case F1: EnterFilenameEntry(); break; case F3: SetUpDeleteFilenameEntry(); break; case F4: DrawMainDisplay(); oStateStackN  -= 1; break; case F8: LoadFilenameList(); break; case F10: SaveFilenameList(); break; default: Beep(); break; } } i++) { /* Pick up Filename. Put into Filename List Node */ RgParam(FILELISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->Filename, sdRet.cbString); Node->Filename[sdRet.cbString] = 0; AddToFilenameList(Node); } } voidP X,#func1.c-New C_samples#ff1g,Q #include 0 .0; d1 = d2 / 3.0; d1 = d2 + 3.0; d1 = d2 - 3.0; if (d1 == d2) d2 = 0.0; pqq = qq; c = strtol("1234", &prest, 0); c = *(func1()); c = b / a; c = (unsigned long)b / (unsigned long)a; c = a * b; return &c; } O0? W lCglider c_sampleslC8-f9-f1gX (Z - @ HighC.fls-New C_Samples @Ufbf1gw84[ beeper.c filelist.c func1.c func2.c huge.c keylist.c keymain.c large.c life.c sample.c search.c swap.c vidio.c write.c o@?O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0? @] ?huge.c-New C_samples?ff1g L^  #include #include typedef int harray[8192]; harray _huge c[13] = { {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12} }; int _huge ca[13][8192] = { {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12} }; typedef char *chrp; chrp _huge rgbnode[27][27][27] = {{ { {"this is string 1"}, {"This is string 2"} } }}; typedef void *biggie; biggie _huge a[32000]; void header(si) { printf("Size %u",si); } void Chunky(unsigned int si) { unsigned int i; i =X`  1; header(si); while ( (a[i] = malloc(si)) != 0) i++; printf(", chunks %u \n",i); for (i--; i != 0; i--) free(a[i]); } void accessarray () { int i,j; for (i = 0; i < 13; i++) { printf("Element=%d Address=%lx\n", c[i][0], &c[i][0]); } /* Should print values 0, 1, ..., 13, and their addresses. */ i = 12; rgbnode[12][12][12] = "this is another string"; *rgbnode[12][12][12] = 'T';  printf("%s, %s, %s\n", rgbnode[0][0][0], rgbnode[0][0][1], rgbnode[12][12][12]); } main () db { unsigned int j; for (j = 60000; j >= 1000 ; j -= 1000) { Chunky(j); } accessarray(); return(0); }        $ ) . 3 8 = B G L Q V [ ` e  O{ e    ( B W   0  p p   5 xCxNNN8NzN Z$Z<ZTZlZZZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666pd >0 keylist.c C_samples>0fUf1g<V |e /* * Keyword list manipulation */ #define Beep #define CheckErc #define CSubparams #define ErrorExit #define PutFrameC0   Word nLines; CheckErc (PutFrameAttrs( DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,lUnderLine ,80/nKeyCols )); /* Find out if this node is selected. Find the node first */ for (pThisNode = columns[keyCursorCol], nLines = FIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine) ); pThisNode = pThisNode->Next, nLines++); if (pThisNode == NULL) return; if (pThisNode->Selected == NULL) return; CheckErc(PutFrameAttrss (DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,(lUnderLine | lReverse) ,strlen(pThisNode->KeyWord) )); } static void HideKeywordCursor() { KeyListType *pThisNode; Word nLines; CheckErc (PutFrameAttrs( DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,lNormal ,80/nKeyCols )); /* Find out if this node is selected. Find the node first */ for (pThisNode = columns[keyCursorCol], nLines = FIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine) u  ); pThisNode = pThisNodhars #define PutFrameAttrs #define ReadKbd #define ResetFrame #define RgParam #include #include "keyword.h" #include #include #include /* Vidio Routines found in Vidio.c */ extern void DrawFunctionKeyBar(Word iLine, Pointer psFnckys); extern Word DisplayLines; extern Pointer pBlanks; extern Pointer pSep; extern void SetUpMenu(MenuType *Menu);g  extern char InputLine[LINEMAX]; /* State machine varaibles */ extern void DrawMainDisplay(); extern void InputInformation (Byte chr); extern void (*(pState[STATESTACKSIZE]))(Byte); extern Word oStateStack; extern void (*(pCancelRoutine))(); extern void (*(pGoRoutine))(); /* Define the Keyword list variables */ KeyListType *pKeyList = NULL; KeyListType *pSelectList = (void *) &pSelectList; static KeyListType *columns[MAXDSPCOLUMNS]; static Word nKeyCols; /* Number of columns of keyword data to be displayei d */ static Word nKeyWords; /* Number of keyword entries */ static Word nColumnOffset; static Word keyCursorLine; static Word keyCursorCol; /* Menu data */ static PromptType LoadKeywordReplace = { 4, 0 ,(Byte *)"[Replace Existing Keylist (y/n)?]" ,NULL }; static PromptType LoadKeyWordFileName = { 2, 0 ,(Byte *)"File Name"  ,&LoadKeywordReplace }; static PromptType lkfFiletitle = { 0, 25 ,(Byte *)"Load Keyword List From File" ,&LoadKeyWordFileName }; static k PromptType SaveKeyWordFileName = { 2, 0 ,(Byte *)"File Name" ,NULL }; static PromptType skfFiletitle = { 0, 24 ,(Byte *)"Save Keyword List To File" ,&SaveKeyWordFileName }; static char Replace[2] = {'Y', 0}; static char FileName[70] ={0}; static InputType lkfReplace = {4, 34, 2, (void *) &Replace, NULL}; static InputType lkfFileInput = {2, 10, 70,(void *)&FileName, &lkfReplace}; static InputType lkfFileOutput = {2, 10, 70, (void *) &FileName, NULL}; static MenuType LoadKem yWordMenu = { &lkfFiletitle ,&lkfFileInput }; static MenuType SaveKeyWordMenu = { &skfFiletitle ,&lkfFileOutput }; static char KeywordName[80] ={0}; static InputType EnteredKeyWord = {3, 0, 80, (void *) &KeywordName, NULL }; static PromptType EnterKeywordtitle = { 1, 30 ,(Byte *)"Enter keyword below" ,NULL }; static MenuType EnterKeyWordMenu = { &EnterKeywordtitle ,&EnteredKeyWord }; static KeyListType *DeleteNode = NULL; static PromptType DeleteWoo rd = { 3, 0, NULL, NULL }; static PromptType DeleteKeywordtitle = { 1, 22 ,(Byte *)"Press GO to delete the keyword below" ,&DeleteWord }; static MenuType DeleteKeyWordMenu = { &DeleteKeywordtitle ,NULL }; static Word nEntriesPerColumn() { return ( (nKeyWords/nKeyCols) + ( ((nKeyWords%nKeyCols) != 0) ?1:0) ); } static Word ColumnOffset( Word iCol) { if (iCol > nKeyCols) return(0); return( (iCol *(nKeyWords / nKeyCols)) + (min(iCol, nKeyWords % nKeyCols)) ); } static vq oid ShowKeywordCursor() { KeyListType *pThisNode;1 e->Next, nLines++); if (pThisNode == NULL) return; if (pThisNode->Selected == NULL) return; CheckErc(PutFrameAttrs(DISPLAYFRAME ,keyCursorCol * (80/nKeyCols) ,keyCursorLine ,(lNormal | lReverse) ,strlen(pThisNode->KeyWord) )); } static void EnableKeywordCursor() { keyCursorLine = FIRSTLINE; keyCursorCol = 0; ShowKeywordCursor(); } /* Define Keyword list manipluation functions */ static void AddToKeyWordList(KeyListType *Node) { KeyListType *List; KeyLisw  tType *Parent; Node->Prev = NULL; Node->Selected = NULL; if (pKeyList == NULL) { /* if */ pKeyList = Node; Node->Next = NULL; Node->Selected = NULL; } /* if */ else { /* outer else */ if (strcmp(Node->KeyWord, pKeyList->KeyWord) == 0) { /* if */ free(Node->KeyWord); free(Node); return; } /* if */ if (strcmp(Node->KeyWord, pKeyList->KeyWord) < 0) { /* if */ /* add in as first element */ Node->Next = pKeyList; pKeyList->Prev = Node; pKeyList = Node; } /* if */ ey  lse { /* else */ /* Add into middle of list */ for (List = pKeyList; List != NULL; List = List->Next) { /* for */ if (strcmp(Node->KeyWord, List->KeyWord) == 0) { /* if */ free(Node->KeyWord); free(Node); return; } /* if */  if (strcmp(Node->KeyWord, List->KeyWord) < 0) { /* if */ Parent = List->Prev; Parent->Next = Node; List->Prev = Node; Node->Prev = Parent; Node->Next = List; return; } /* if */ Parent = List; /* Save this for adding|  to end of list */ } /* for */ /* Add to end of list */ Parent->Next = Node; Node->Prev = Parent; Node->Next = NULL; } /* else */ } /* outer else */ } /* end void */ static void ShowKeywordList() { Word i, j; KeyListType *Showcolumns[MAXDSPCOLUMNS]; HideKeywordCursor(); for (j = 0; j < nKeyCols; j++) { Showcolumns[j] = columns[j]; } for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0 ~  , i, lNormal, 80)); if ( (i - FIRSTLINE) + nColumnOffset < nEntriesPerColumn()) { for (j = 0; j < nKeyCols; j++) { if ( ((i - FIRSTLINE) + ColumnOffset(j) + nColumnOffset) < ColumnOffset(j+1)) { if (Showcolumns[j] != NULL) { CheckErc(PutFrameChars( DISPLAYFRAME ,j*(MAXCOLUMNS/nKeyCols) ,i ,Showcolumns[j]->KeyWord ,strlen(Showcolumns[j]->KeyWord) )); if (Showcolumns[j]->Selected != NULL) CheckErc(PutFrameAttrs( DISPLA YFRAME ,j*(MAXCOLUMNS/nKeyCols) ,i ,lReverse ,strlen(Showcolumns[j]->KeyWord) )); Showcolumns[j] = Showcolumns[j]->Next; } } } } } ShowKeywordCursor(); } static void ScrollKeyWordList(int cLines) { Word i; if (columns[0] == NULL) return; if (cLines < 0) { /* Follow prev pointer */ while (cLines != 0) { if (nColumnOffset != 0) { for (i = 0; i < nKeyCols; i++) { if (columns[i]->Prev != NULL) columns[i] = columns[i]->Pre$ v; } nColumnOffset -= 1; } cLines += 1; } } else { /* Follow next pointer */ while (cLines != 0) { if ((nColumnOffset+(DisplayLines-FIRSTLINE))Next != NULL) columns[i] = columns[i]->Next; } nColumnOffset += 1; } cLines -= 1; } } ShowKeywordList(); } static void SizeKeywordList() { KeyListType *pList; Word cbMax; cbMax = 0; nKeyWords = 0; for (pList = pKeyList; pLi0 st != NULL; pList = pList->Next) { if(strlen(pList->KeyWord) > cbMax) cbMax = strlen(pList->KeyWord); nKeyWords += 1; } if (cbMax != 0) { nKeyCols = (cbMax < 60) ? (MAXCOLUMNS / (cbMax + 1)): 1; } else nKeyCols = 1; if (nKeyCols > MAXDSPCOLUMNS) nKeyCols = MAXDSPCOLUMNS; } static void SelectKeyword() { KeyListType *pThisNode; Word nLines; HideKeywordCursor(); /* Find the node */ for (pThisNode = columns[keyCursorCol], nLines = F1   i++; if (i == LINEMAX) return; } /* Find end of keyword */ for (j=i; !isWhiteSpace(InputLine[j]); j++) if (j == LIN EMAX) return; if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc((j-i)+1)) == NULL) ErrorExit(400); _move(&InputLine[i], Node->KeyWord, (j-i)); Node->KeyWord[(j-i)] = 0; AddToKeyWordList(Node); } } static void LoadKeywordFile() { KeyListType *Node; FILE *inp; oStateStack -= 1; if ((Replace[0] == 'Y') || (Replace[0] == 'y')) { /* Throw away current keywords */ pSelectList = (void *) &pSelectList; for (Node = pKeyList; Node != NULL; No de = pKeyList) { pKeyList = pKeyList->Next; free(Node->KeyWord); free(Node); } pKeyList = NULL; } if ((inp = fopen(FileName, "r")) == NULL) { Beep(); LoadKeyWordList(); return; } while (fgets(InputLine, 80, inp)) ParseLine(); fclose(inp); DisplayKeywordList(); } static void LoadKeyWordList() { HideKeywordCursor(); SetUpIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine< ) ); pThisNode = pThisNode->Next, nLines++); if (pThisNode == NULL) {ShowKeywordCursor(); return;} if (pThisNode->Selected != NULL) {ShowKeywordCursor(); return;} pThisNode->Selected = pSelectList; pSelectList = pThisNode; ShowKeywordCursor(); } static void deSelectKeyword() { KeyListType *pThisNode, *pSlist, *Parent; Word nLines; HideKeywordCursor(); /* Find the node */ for (pThisNode = columns[keyCursorCol], nLines = FIRSTLINE; ((pThisNode != NULL) && (nLines < keyCursorLine) ); pThiH sNode = pThisNode->Next, nLines++); if (pThisNode == NULL) {ShowKeywordCursor(); return;} if (pThisNode->Selected == NULL) {ShowKeywordCursor(); return;} /* Special case for node at head of list */ if (pThisNode == pSelectList) { pSelectList = pThisNode->Selected; pThisNode->Selected = NULL; ShowKeywordCursor(); return; } for (pSlist = pSelectList; pSlist != (void *)&pSelectList; pSlist = pSlist->Selected) { if (pSlist == pThisNode) { /* Remove from list */ Parent->Selected = pTT hisNode->Selected; pThisNode->Selected = NULL; ShowKeywordCursor(); return; } Parent = pSlist; } ShowKeywordCursor(); } void DisplayKeywordList() { Word i, j; Word Limit; /* SET UP WINDOW FOR DISPLAY KEYWORD LIST */ CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 36, 1, "Keywords", 8)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80)); DrawFunctionKeyBar(2, "  Add   Del Back    Load   Save "); CheckErc(Pu` tFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, " ENTRY  FILE ", 80)); SizeKeywordList(); if (nKeyWords == 0){ columns[0] = NULL; } else { nColumnOffset = 0; for (i = 0; i < nKeyCols; i++) { columns[i] = pKeyList; Limit = ColumnOffset(i); for (j = 0; ((j < Limit) && (columns[i] != NULL)); j++) { columns[i] = columns[i]->Next; } } } EnableKeywordCursor(); ShowKeywordLisl t(); } /* Get the initial keyword list. */ void InputKeywordList() { Word i; sdType sdRet; KeyListType *Node; nKeyWords = CSubparams(KEYLISTINDEX); for(i = 0; i < nKeyWords; i++) { /* Pick up keyword. Put into Keyword List Node */ RgParam(KEYLISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->KeyWord, sdRet.cbString); Node->KeyWord[sdRet.cbString] = 0;x  AddToKeyWordList(Node); } } void KeywordCancel() { DisplayKeywordList(); oStateStack -= 1; } extern void LoadKeyWordList(); static void ParseLine() { KeyListType *Node; Word i, j; j = 0; while (TRUE) { i = j; /* Start from end of last word found */ /* Find start of (next) keyword */ while(isWhiteSpace(InputLine[i])) { if (InputLine[i] == NEWLINE) return; 2 Menu(&LoadKeyWordMenu); pCancelRoutine = KeywordCancel; pGoRoutine = LoadKeywordFile; oStateStack += 1; pState[oStateStack] = InputInformation; } stat ic void ProcessKeywordEntry() { KeyListType *Node; oStateStack -= 1; if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc(strlen(KeywordName)+1)) == NULL) ErrorExit(400); _move(KeywordName, Node->KeyWord, strlen(KeywordName)+1); AddToKeyWordList(Node); DisplayKeywordList(); } static void EnterKeyWordEntry() { KeywordName[0] = 0; /* Erase any old name entered previously */ HideKeywordCursor(); SetUpMenu(&EnterKeyWordMenu); pCancelRoutine = KeywordCan cel; pGoRoutine = ProcessKeywordEntry; oStateStack += 1; pState[oStateStack] = InputInformation; } static void DeleteKeywordEntry() { oStateStack -= 1; if (DeleteNode->Prev == NULL) { /* First node in list */ pKeyList = DeleteNode->Next; if (pKeyList != NULL ) pKeyList->Prev = NULL; } else { if (DeleteNode->Next != NULL) DeleteNode->Next->Prev = DeleteNode->Prev; DeleteNode->Prev->Next = DeleteNode->Next; } free(DeleteNode->KeyWord); free(DeleteNode); DisplayKeywordList(); } st atic void SetUpDeleteKeyWordEntry() { Word nLines; for (DeleteNode = columns[keyCursorCol], nLines = FIRSTLINE; ((DeleteNode != NULL) && (nLines < keyCursorLine) ); DeleteNode = DeleteNode->Next, nLines++); if (DeleteNode == NULL) { Beep(); return; } DeleteWord.pString = (Byte *) DeleteNode->KeyWord; DeleteWord.Col = ( (80-strlen(DeleteNode->KeyWord)) /2); HideKeywordCursor(); SetUpMenu(&DeleteKeyWordMenu); pCancelRoutine = KeywordCancel; pGoRoutine = DeleteKeywordEntry; oStateStack  += 1; pState[oStateStack] = InputInformation; } extern void SaveKeyWordList(); static void SaveKeywordFile() { KeyListType *Node; FILE *out; oStateStack -= 1; if ((out = fopen(FileName, "w")) == NULL) { Beep(); SaveKeyWordList(); return; } for (Node = pKeyList; Node != NULL; Node = Node->Next) { fputs(Node->KeyWord, out); fputs("\n", out); } fclose(out); DisplayKeywordList(); } static void SaveKeyWordList() { HideKeywordCursor(); SetUpMenu(&SaveKeyWordMenu); pCancelRoutine = K̞ eywordCancel; pGoRoutine = SaveKeywordFile; oStateStack += 1; pState[oStateStack] = InputInformation; } void fnckeywordList (Byte chr) { switch (chr) { case SCROLLUP: ScrollKeyWordList(1); break; case SCROLLDN: ScrollKeyWordList(-1); break; case PAGEUP: ScrollKeyWordList(-21);  break; case PAGEDN: ScrollKeyWordList(21); break; case UPARROW: HideKeywordCursor(); if (keyCursorLine > FIRSTLINE) keyCursorLine -= 1; ShowKeywordCursor(); break; case DOWNARROW: HideKeywordCursoؠ r(); if (keyCursorLine < (DisplayLines-1)) keyCursorLine += 1; ShowKeywordCursor(); break; case LEFTARROW: HideKeywordCursor(); if (keyCursorCol > 0) keyCursorCol -= 1; ShowKeywordCursor(); break; case RIGHTARROW: HideKeywordCursor(); if (keyCursorCol < (nKeyCols - 1)) keyCursorCol += 1; ShowKeywordCursor(); break; case MARK: SelectKeyword(); break; case CODE_MARK: deSelectKeyword(); break; case F1: EnterKeyWordEntry(); break; case F3: SetUpDeleteKeyWordEntry();  break; case F4:  DrawMainDisplay(); oStateStack -= 1; break; case F8: LoadKeyWordList(); break; case F10: SaveKeyWordList(); break; default: Beep(); break; } } +) { /* Pick up keyword. Put into Keyword List Node */ RgParam(KEYLISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(KeyListType))) == NULL) ErrorExit(400); if ((Node->KeyWord = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->KeyWord, sdRet.cbString); Node->KeyWord[sdRet.cbString] = 0;  '=0 keymain.c C_samples=0ff1gl V 2   void FilenameCancel() { ShowFilenameList(); ShowFilenameCursor()D  > keyword.h C_Samples> f f1gV P   #define min(x,y) (x 0x7F)) /* define vidio display equates */ #define lNormal 0 #define lDim 1 #define lUnderLine 2 #define lReverse 4 #define lReverseHB 5 #define lBlink 8 #define DISPLAYFRAME 0 #define FNCKEYFRAME 1 #define SIZEFNCFRAME 3 #define MAXDSPCOLUMNS 4 #define MAXCOLUMNS 80 #define FIRSTLINE 3 #define NEWLINE 0x0A #define LINEMAX 512 /* Define keystroke values */ #define CANCEL 0x07 #define BACKSPACE 0x08 #define NEXT \   0x0A #define GO 0x1B #define UPARROW 0x01 #define DOWNARROW 0x0B #define LEFTARROW 0x0E #define RIGHTARROW 0x12 #define SCROLLUP 0x11 #define SCROLLD  /* * Keyword find program. * * Find a keyword in a file, display surrounding area * */ #define Beep #define CheckErc #define CSubparams #define ErrorExit #define PutFrameChars #define ReadKbd #define ResetFrame #define RgParam #include #include "keyword.h" #include #include /* Assumes no use of argc, argv */ /* Routines are actually called at init time, so must return valid values. */ _mwset_up_args() {return 0;} _mwcount_args() {return 0;} /* Vidio Routines found   in Vidio.c */ extern void InitVideo(); extern Word DisplayLines; extern void DrawFunctionKeyBar(Word iLine, Pointer psFunckeys); extern void SetUpMenu(MenuType pMenu); extern Pointer pSep; extern Pointer pBlanks; extern Word InputCursorLine; extern Word InputCursorCol; /* Keyword list routines found in keylist.c */ extern void InputKeywordList(); extern void InputfilenameList(); /* Define the state machine that handles the user interface */ void (*(pState[STATESTACKSIZE]))(Byte); Word oStateStack; /* De  fine the state machine functions */ extern void fnckeywordList (Byte chr); extern void DisplayKeywordList(); extern void fncFileNameList (Byte chr); extern void DisplayFilenameList(); extern void fncSearch (Byte chr); extern void SearchSetUp(); extern void InputInformation (Byte chr); /* Set up initial screen display */ void DrawMainDisplay() { CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 30, 1, "Keyword Find Program", 20)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80  )); CheckErc(PutFrameChars(DISPLAYFRAME, 31, 10, "Choose a function", 17)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, pBlanks, 80)); DrawFunctionKeyBar(2, " Keys  Files  Search      "); } /* Initial display - choose function */ static void fncMainDisplay(Byte chr) { switch (chr) { case F1: oStateStack += 1; pState[oStateStack] = fnckeywordList; DisplayKeywordList(); break; case F2:,   oStateStack += 1; pState[oStateStack] = fncFileNameList; DisplayFilenameList(); break; case F3: oStateStack += 1; pState[oStateStack] = fncSearch; SearchSetUp(); break; default: Beep(); break; } } void main() { Byte chr; /* Init the Vidio */ InitVideo(); /* Init the state machine */ oStateStack = 0; pState[oStateStack] = fncMainDisplay; /* Get initial Keyword, Filename lists */ InputKeywordList(); InputfilenameList(); DrawMainDisplay(); while (TRUE) { CheckErc(ReadKbd(&chr))8  ; switch (chr) { case FINISH: ErrorExit(0); default: (*pState[oStateStack])(chr); break; } } } into Filename List Node */ RgParam(FILELISTINDEX, i, &sdRet); if ((Node = malloc(sizeof(FileListType))) == NULL) ErrorExit(400); if ((Node->Filename = malloc(sdRet.cbString+1)) == NULL) ErrorExit(400); _move(sdRet.pbString, Node->Filename, sdRet.cbString); Node->Filename[sdRet.cbString] = 0; AddToFilenameList(Node); } } 3 N 0x13 #define PAGEUP 0x05 #define PAGEDN 0x0C #define MARK 0x02 #define CODE_MARK 0x82 #define BOUND 0x0D #define FINISH 0x04 #define F1 0x15 #define F2 0x16 #define F3 0x17 #define F4 0x18 #define F8 0x1D #define F9 0x1E #define F10 0x1F #define SPACE 0x20 #define STATESTACKSIZE 10 #define FILELISTINDEX 1 #define KEYLISTINDEX 2 typedh  ef struct { Byte *pbString; Word cbString; } sdType; typedef struct KeyListType { struct KeyListType *Next; struct KeyListType *Prev;  struct KeyListType *Selected; char *KeyWord; } KeyListType; typedef struct FileListType { struct FileListType *Next; struct FileListType *Prev; char *Filename; } FileListType; typedef struct PromptType { Word Line; Word Col; Byte *pString; struct PromptType *Next; } PromptType; typedef struct InputType { Word Line; Word Col; Wot  rd Len; Byte *Data; struct InputType *Next; } InputType; typedef struct MenuType { PromptType *Prompt; InputType *Input; } MenuType;  "); } /* Initial display - choose function */ static void fncMainDisplay(Byte chr) { switch (chr) { case F1: oStateStack += 1; pState[oStateStack] = fnckeywordList; break; case F2: oStateStack += 1; pState[oStateStack] = fncFileNameList; break; case F3: break; default: Beep(); break; } } void main() { Byte chr; /* I  l[?large.c-New C_samples?ff1g{    /* This program remakes the huge.c sample program into large model. */ pragma memory_model(Large); #include "huge.c" ?O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0?   ?-1lib.fls-New C_Samples-1mff1g   Samples.lib_`@PopOo@pOo@?O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0?   H/1libSamples.fls-New C_Samples/1f@f1g   BEEPER.obj FILELIST.obj FUNC1.obj FUNC2.obj HUGE.obj KEYLIST.obj KEYMAIN.obj LARGE.obj LIFE.obj samgen.obj SAMPLE.obj SEARCH.obj start.obj SWAP.obj VIDIO.obj WRITE.obj  "life.c-New c_samples"-f.f1g,  #include #include #define AllocExch #define beep #define Check #define CheckErc #define CreateProcess #define Delay #define ErrorExit #define InitCharMap #define InitVidFrame #define PutFrameAttrs #define PutFrameChars #define QueryVidHdw #define ReadKbd #define ResetFrame #define ResetVideo #define Send #define SetScreenVidAttr #define Wait #include #define kernelErc #include #define lNormal 0 #define lDim 1 #define lUnderLine 2 #define lReverse 4 #define lRev erseHB 5 #define lBlink 8 #define CANCEL 0x07 #define BACKSPACE 0x08 #define NEXT 0x0A #define GO 0x1B #define UPARROW 0x01 #define DOWNARROW 0x0B #define LEFTARROW 0x0E #define RIGHTARROW 0x12 #define MARK 0x02 #define BOUND 0x0D #define FINISH 0x04 #define F1 0x15 #define F2 0x16 #define F9 0x1E #define F10 0x1F #define HOFF 20 #define VOFF 4 #define DELAYTIME 3 typedef struct PromptType { Word Line; Word Col; Byte *pString; struct PromptType *Next; } PromptType; typ edef struct InputType { Word Line; Word Col; Word Len; Byte *Data; struct InputType *Next; } InputType; typedef struct MenuType { PromptType *Prompt; InputType *Input; } MenuType; Word vcLines; Word vcCols; Byte old[20][20]; Byte new[20][20]; Word rgCol[6] = {0, 24, 56, 23, 31, 23}; char *psFunckeys; Word i, j; Word k, l; Word sum; MenuType *pActiveMenu; InputType *pActiveInputline; Byte *pActiveData; Word DisplayLines; Word InputCursorLine; Word InputCursorCol; Poi nter pBlanks = {" "}; Pointer pSep = {""}; /* Menu data */ PromptType LifeFileName = { 2, 0 ,(Byte *)"File Name" ,NULL }; PromptType lkfFiletitle = { 0, 25 ,(Byte *)"Load life game From File" ,&LifeFileName }; PromptType skfFiletitle = { 0, 24 ,(Byte *)"Save life game To File" ,&LifeFileName }; char  FileName[70] ={0}; InputType lkfFileInput = {2, 10, 70, (void *) &FileName, NULL}; InputType lkfFileOutput = {2, 10, 70, (void *) &FileName, NULL}; MenuType LoadLifeMenu = {&lkfFiletitle, &lkfFileInput}; MenuType SaveLifeMenu = {&skfFiletitle, &lkfFileOutput}; /* Process variables */ #define STACKSIZE 100 Word rgKbdStack[STACKSIZE]; Word kbdDefExch; Word kbdMsgExch; typedef struct { Pointer pEntry; Word saData; Word saExtra; Word saStack; Word oStackInit; Byte priority; Byte fSys; Word exch gDefaultResponse; Byte fDebug; } ProcDescType; void KbdProcess() { Byte chr; while(TRUE) { CheckErc(ReadKbd(&chr)); /* Be aware that because this routine does not wait for a reply from the process it sends the message to, that the chr may by changed by a subsequent readkbd request before the other process has acted on the chr sent. This is not likely for this program, but is likely in other circumstances!!! */ CheckErc(Send(kbdMsgExch, &chr)); } } void4 , vcCols, 3, 0, 0, 0, 0, 0) ); CheckErc( InitCha4  rMap(0, sMap) ); CheckErc( SetScreenVidAttr(1, TRUE) ); /*refresh*/ CheckErc( ResetFrame(0) ); CheckErc( ResetFrame(1) ); return; } void DrawFunctionKeyBar(Pointer psFunckeys) { CheckErc( PutFrameChars (1, 0, 2, psFunckeys, strlen(psFunckeys)) ); for (i = 0; i < 3; i++) { CheckErc( PutFrameAttrs(1, rgCol[i], 2, lReverseHB, rgCol[i+3]) ); } } void DrawBorder() { Word i; for (i = 0; i < 20; i++) { CheckErc(PutFrameAttrs(0, (i*2)+HOFF,  VOFF, lReverseHB, 2) ); CheckErc(PutFrameAttrs(0, (i*2)+HOFF,@  VOFF+20, lReverseHB, 2) ); } for (i = 0; i < 21; i++) { CheckErc(PutFrameAttrs(0, HOFF, i+VOFF, lReverseHB, 1) ); CheckErc(PutFrameAttrs(0, HOFF+40, i+VOFF, lReverseHB, 1) ); } } extern void LoadGeneration(); extern void SaveGeneration(); void InputGeneration(Word fTime) { char *pChr; if (fTime == TRUE) { for (i=0; i<20; i++) { /* clear out the arrays */ for (j=0; j<20; j++) { old[i][j] = 0; new[i][j] = 0; } }  } DrawFunctionKeyBar("  Run     L   Load  Save "); i = 9; j = 9; while (TRUE) { CheckErc( PutFrameAttrs(0, (j*2)+HOFF, i+VOFF, lUnderLine, 1) ); CheckErc( Wait(kbdMsgExch, &pChr) ); CheckErc( PutFrameAttrs(0, (j*2)+HOFF, i+VOFF, lNormal, 1) ); switch (*pChr) { case F9: LoadGeneration(); break; case F10: SaveGeneration(); break; case UPARROW: i -= 1; if (i < 1) i = 1; break; case DOWNARROW: i += 1; if (i > 19) i = 19; break; case LEFTARROW: j -= 1; if (j < 1) j = 1; break; case RIGHTARROWX  : j += 1; if (j > 19) j = 19; break; case MARK: old[i][j] = 1; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); break; case BOUND: old[i][j] = 0; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " ", 1)); break; case F2: DrawFunctionKeyBar(" Pause        "); return; case FINISH: ErrorExit(0); default: break; } } } void SetUpMenu(MenuType *Menu) { PromptType *Line; InputType *Data; Word i; pActiveMenud  = Menu; for (i = DisplayLines - 7; i < DisplayLines; i++) { CheckErc(PutFrameChars(0, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(0, 0, i, lNormal, 80)); } CheckErc(PutFrameChars(0, 0, DisplayLines - 7, pSep, 80)); for (Line = Menu->Prompt; Line != NULL; Line = Line->Next) { CheckErc(PutFrameChars( 0 ,Line->Col ,Line->Line + (DisplayLines - 6) ,Line->pString ,strlen(Line->pString) )); } for (Data = Menu->Input; Data != NULL; Data = Data->Next) { CheckErc(PutFrameAttrsp ( 0 ,Data->Col ,Data->Line + (DisplayLines - 6) ,lReverseHB ,Data->Len )); CheckErc(PutFrameChars( 0 ,Data->Col ,Data->Line + (DisplayLines - 6) ,Data->Data ,strlen(Data->Data) )); } /* Set up cursor at first position */ pActiveInputline = Menu->Input; if (pActiveInputline != NULL) { pActiveData = Menu->Input->Data; InputCursorLine = Menu->Input->Line + (DisplayLines - 6); InputCursorCol = Menu->Input->Col; for (InputCursorCol = Menu->Input->Col; pActi| veData[InputCursorCol-Menu->Input->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } } void InputName (){ char *pChr; while(TRUE) { CheckErc( Wait(kbdMsgExch, &pChr) ); switch (*pChr) { case CANCEL: FileName[0] = 0; return; case GO: return; case NEXT: CheckErc(PutFrameAttrs(0,  InputCursorCol, InputCursorLine, lReverseHB, 1)); pActiveInputline = pActiveInputline->Next; if (pActiveInputline == NULL) pActive Inputline = pActiveMenu->Input; pActiveData = pActiveInputline->Data; InputCursorLine = pActiveInputline->Line + (DisplayLines - 6); for (InputCursorCol = pActiveInputline->Col; pActiveData[InputCursorCol-pActiveInputline->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); brea4   new[i][j]; break; case 3: old[i][j] = 1; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); break; default: old[i][j] = 0; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " ", 1)); break;   } } } CheckErc(Delay(DELAYTIME)); } void main() { InitKbdProcess(); InitVideo(); DrawBorder(); InputGeneration(TRUE); while (TRUE) Play(); }al, 80)); } CheckErc(PutFrameChars(0, 0, DisplayLines - 7, pSep, 80)); for (Line = Menu->Prompt; Line != NULL; Line = Line->Next) { CheckErc(PutFrameChars( 0 ,Line->Col ,Line->Line + (DisplayLines - 6) ,Line->pString ,strlen(Line->pString) )); } for (Data = Menu->Input; Data != NULL; Data = Data->Next) { CheckErc(PutFrameAttrs Q$link.fls C_Samples5f6f1gq  lk; case BACKSPACE: CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col)  != 0) InputCursorCol -= 1; CheckErc(PutFrameChars(0, InputCursorCol, InputCursorLine, pBlanks, 1)); pActiveData[InputCursorCol-pActiveInputline->Col] = 0; CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); break; default: if (*pChr < 0x80) { /* Assume data char if not caught elsewhere */ CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col) < (pActiveInputline->Len -  1) ) { CheckErc(PutFrameChars(0, InputCursorCol, InputCursorLine, pChr, 1)); pActiveData[InputCursorCol - pActiveInputline->Col] = *pChr; pActiveData[(InputCursorCol-pActiveInputline->Col)+1] = 0; InputCursorCol += 1; } CheckErc(PutFrameAttrs(0, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } else Beep(); break; } } } void reDrawGame() { Word i, j; for (i = DisplayLines - 7; i < DisplayLines; i++) { CheckErc(PutFrameChars(0, 0, i, pBlanks,  80)); CheckErc(PutFrameAttrs(0, 0, i, lNormal, 80)); } DrawBorder(); for (i=0; i < 20; i++) for (j = 0; j < 20; j++) { if (old[i][j] == 1) CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); else CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " ", 1)); } } void LoadGeneration() { FILE *inp; SetUpMenu(&LoadLifeMenu); InputName(); if (FileName[0] == 0) { reDrawGame(); return; } if ((inp = fopen(FileName, "r")) == NULL) { Beep(); reDrawGame(); return; } if(fread( old, 20, 20, inp) != 20) { Beep(); } fclose(inp); reDrawGame(); } void SaveGeneration() { FILE *out; SetUpMenu(&SaveLifeMenu); InputName(); reDrawGame(); if (FileName[0] == 0) return; if ((out = fopen(FileName, "w")) == NULL) { Beep(); return; } if(fwrite(old, 20, 20, out) != 20) { Beep();  } fclose(out); } void Play() { Word erc; Byte *pChr; erc = Check(kbdMsgExch, &pChr); if (erc != ercOK) { if (erc != ercNoMessage) { ErrorExit(erc); } } else { if (*pChr == (Byte) F1) { I nputGeneration(FALSE); } if (*pChr == (Byte) FINISH) { ErrorExit(0); } } for (i = 1; i < 20; i ++) { for (j = 1; j < 20; j ++) { sum = 0; for (k = i-1; k < i+2; k++) { for (l = j-1; l < j+2; l++) { sum += old[k][l]; } } if (old[i][j]) sum -= 1; switch (sum) { case 2: new[i][j] = old[i][j]; break; case 3: new[i][j] = 1; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, "*", 1)); break; default: new[i][j] = 0; CheckErc(PutFrameChars(0, (j*2)+HOFF, i+VOFF, " " , 1)); break; } } } CheckErc(Delay(DELAYTIME)); for (i = 1; i < 20; i ++) { for (j = 1; j < 20; j ++) { sum = 0; for (k = i-1; k < i+2; k++) { for (l = j-1; l < j+2; l++) { sum += new[k][l]; } } if (new[i][j]) sum -= 1; switch (sum) { case 2: old[i][j] =5 inkbeeper.sub linkHuge.sub linkKeyword.sub linklarge.sub linklife.sub linksample.sub linkswap.sub linkwrite.sub  u@linkbeeper.fls-New C_Samples@ff1g  samples.lib(beeper start)UNC1.lst FUNC2.lst HUGE.lst KEYLIST.lst KEYMAIN.lst LARGE.lst LIFE.lst SAMPLE.lst START.lst SWAP.lst VIDIO.lst WRITE.lst  @linkbeeper.sub-New C_Samples@lfDf1gI $ %' Bind %'Object modules'@linkbeeper.fls %'Run file'beeper.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'600 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]' %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' pend]' %'[debug?]' `P_Ш0o 0__0O0? 0 ܚ# linkhuge.fls-New C_samples#Tfʔf1g < samples.lib(huge) H *? linkHuge.sub-New C_samples?4fRf1gY T %' Bind %'Object modules'@linkHuge.fls %'Run file'huge.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]'  `P_Ш0o 0__0O0? `  ̖/linkKeyword.fls-New C_samples/fyf1g:V l samples.lib(keymain keylist filelist search vidio samgen) pOo@pOo@?5   @ linklife.sub-New C_Samples@nfcf1gY  %' Bind %'Object modules'@linklife.fls %'Run file'life.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' O o P  `0o$'`> F O OpY\ do`q Ѐ_o  `P_Ш0o 0__0O0? x linkKeyword.sub C_samplesff1gfV  %' Bind %'Object modules'@linkKeyword.fls %'Run file'Keyword.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[d1]hc\\big\\hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0?    linklarge.fls-New C_samplesYf˔f1g   samples.lib(Large) UNC1/o FUNC2/o )   v? linklarge.sub-New C_samples?ff1g[ %' Bind %'Object modules'@linkLarge.fls %'Run file'Large.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcle.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0?   a=# linklife.fls-New C_Samples=#Qf̔f1g  samples.lib(life) 6 %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]'  `P_Ш0o 0__0O0?  B' linksample.fls-New C_Samples Ufʔf1g  samples.lib(sample) @linksample.sub-New C_Samples@kfFf1g]  %' Bind %'Object modules'@linksample.fls %'Run file'sample.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'1200 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0?   {? linkswap.fls-New C_samples?&ff1g" , samples.lib(SWAP FUNC1/o FUNC2/o) st search vidio) t KEYLIST.lst KEYMAIN.lst LARGE.lst LIFE.lst SAMPLE.lst START.lst SWAP.lst VIDIO.lst WRITE.lst 8  Gg? linkswap.sub C_samples?'f(f1gY D! %' Bind %'Object modules'@linkswap.fls %'Run file'swap.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]'  `P_Ш0o 0__0O0? P# 3 linkwrite.fls-New C_Samples[f˔f1g \$ samples.lib(write) UNC1/o FUNC2/o ) 6  2 #/run.fls C_Samples/͓fÙf1gQ 3 #beeper.run huge.run Keyword.run Large.run life.run sample.run swap.run write.run 5 $3/sah& = linkwrite.sub-New C_Samples=ufIvf1g[t' %' Bind %'Object modules'@linkwrite.fls %'Run file'write.run %'[Map file]' %'[Publics?]' %'[Line numbers?]' %'[Stack size]'2000 %'[Max array, data, code]' %'[Min array, data, code]' %'[Run file mode]'prot %'[Version]'%0 %'[Libraries]'[s2]hcbe.lib %'[DS allocation?]' %'[Symbol file]' %'[Copyright Notice]' %'[File to append]' %'[debug?]' `P_Ш0o 0__0O0? )  Qlst.fls-New C_Samplesff1g *  BEEPER.lst FILELIST.lst FUNC1.lst FUNC2.lst HUGE.lst KEYLIST.lst KEYMAIN.lst LARGE.lst LIFE.lst samgen.lst SAMPLE.lst SEARCH.lst SWAP.lst VIDIO.lst WRITE.lst , ! #1map.fls C_Samples#1f͙f1gQ - !beeper.map huge.map Keyword.map Large.map life.map sample.map swap.map write.map / "/obj.fls C_Samples/ff1g 0 "BEEPER.obj FILELIST.obj FUNC1.obj FUNC2.obj HUGE.obj KEYLIST.obj KEYMAIN.obj LARGE.obj LIFE.obj samgen.obj SAMPLE.obj SEARCH.obj start.obj SWAP.obj VIDIO.obj WRITE.obj 7  c_samples/)-f*-f1g6 $8 %s"1 samgen.asm-New C_Samples"1ݗf.f1g : %;***************************************************************************** ; FILE SAMGENALL.ASM -- * ; * ; COPYRIGHT 1981, 1986 CONVERGENT TECHNOLOGIES, INC. ALL RIGHTS RESERVED * ; * ; THIS PROGRAM IS FURNISHED UNDER A LICENSE RESTRICTING ITS USE SOLELY FOR * ; THE OPERATION OF A DESIGNATED COMPUT< %ER FOR A PARTICULAR PURPOSE, AND MAY * ; NOT BE COPIED OR OTHERWISE USED WITHOUT THE PRIOR WRITTEN CONSENT OF * ; CONVERGENT TECHNOLOGIES, INC. TITLE TO AND OWNERSHIP OF THE PROGRAM, * ; INCLUDING ITS SOURCE CODE, SHALL AT ALL TIMES REMAIN IN CONVERGENT * ; TECHNOLOGIES. * ; * ;  > % * ; The file "SamGen.Mdf" contains all of the macro definitions for the macros * ; which are contained in this file, "SamGenAll.Asm". The Sequential Access * ; Method (SAM) implementation contained in CTOS.Lib may be reconfigured by * ; creating a tailored SAMGEN module. First, the SAMGEN.ASM source file must * ; be edited to reflect the new configuration. After editing, the SAMGEN.ASM * ; file must be assembled and then the resulting object file, SAMGEN.OBJ, must* ; be included in the list of object(@ % modules at link time. Alternately, if the* ; new SAM configuration is to be the default SAM configuration, the Librarian* ; utility may be used to overwrite the SAMGEN module contained in CTOS.Lib. * ; The default SAM configuration contained in CTOS.Lib includes disk, * ; keyboard, video, parallel printer, null, and spooler byte streams. * ; In addition, the user may wish to include other byte streams, e.g. * ; communication or serial printer byte streams. 4B % * ;******************************************************************************; $INCLUDE ([sys]samgen.mdf) %Init ; %DeviceOpen([Kbd],OpenByteStreamK) %DeviceOpen([Vid],OpenByteStreamVid) %DeviceOpen([Disk],OpenByteStreamAD) ;***************************************************************************** ; %tagProcs(tagDiskRead,FillBufferAD,FlushBufIllegal,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal) %tagProcs(tagDiskWrite,FillBufIllegal,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,@D %SetImageModeIllegal) %tagProcs(tagDiskModify,FillBufferAD,FlushBufferAD,CheckPointBsAD,ReleaseByteStreamAD,SetImageModeIllegal) %tagProcs(tagKbdRead,FillBufferK,FlushBufIllegal,ChkptNop,ReleaseEasy,SetImageModeIllegal) %tagProcs(tagVideoWrite,FillBufIllegal,FlushBufferVid,ChkptNop,ReleaseEasy,SetImageModeIllegal) ; ;***************************************************************************** ; %DevDepProc(QueryVidBs,QueryVideoBs) %7  es; extern Pointer pBlanks; extern Pointer pSep; /* State machine varaibles */ extern void DrawMainDisplay(); extern Word oStateStack; extern KeyListType *R 'pKeyList; extern KeyListType *pSelectList; extern FileListType *pFileList; /*****************************************************************************/ Word waitforack; Word searchdone; Word KeyWordSize; KeyListType *pKeys; FileListType *pFiles; FILE *input; #define LNLINES 23 #define LINESIZE 256 #define STARTLINE 11 Byte line[LNLINES][LINESIZE]; Byte *pDisplayline[LNLINES]; Word iLine; Word nLine; char filedisplay[] = "Searching file: "; char positiondisplay[80]; /************************T '*****************************************************/ void InitFileUse() { Word i; if (input != NULL) fclose(input); /* Done with old file */ input = NULL; /* Done with this handle. */ nLine = 1; for (i = 0, line[0][0] = 0; i < LNLINES; i++) pDisplayline[i] = &line[0][0]; /* clear display */ if (pFiles == NULL) retDevDepProc(GetBsLfa,GetBsLfaAsync) %DevDepProc(SetBsLfa,SetBsLfaAsync) %FinLF %al "AHH$H)H3HUH^HqHvHHHHYHHHHHHHHHH H7H<HHHHH HH'H9H]HHHHHHHH H4HoHtHHHHH<HDHhHtHHHHHHHHHft%d6hu\\\\\ \\\\\\\D\\\\ \+\=\Y\v\&D^gCjvPh$IrXH &ԼP@sample.c c_samplesP@ff1g dI & #define ULCMPB #include #include #include #include int main(argc, argv) int argc; char *argv[]; { FILE *inp, *out; char *pIfilename; char *pOfilename; char line[256]; time_t t1, t2; long int l; l = clock() / CLK_TCK; printf("%ld seconds = %ld hours and %ld minutes", l, l/3600, (l%3600)/60); printf(" past midnight\n"); time(&t1); printf("Greenwich time: %s", asctime(gmtime(&t1))); printf("Local time : %s", ctime(&t1)); if ( argc < 2 ) pIfilenpK &ame = "[kbd]"; else pIfilename = argv[1]; printf("Input file name : %s\n", pIfilename); if ((inp = fopen(pIfilename, "r")) == NULL) { printf("openfail"); return(0); } if ( argc < 3 ) pOfilename = "[vid]"; else pOfilename = argv[2]; printf("Output file name : %s\n", pOfilename); if ((out = fopen(pOfilename, "w")) == NULL) { printf("openfail"); return(0); } while (fgets(line, 256, inp)) fputs(line, out); printf("*******************EOF******************\n"); if (ULCMPB(pIfilename, "[kbd|M &]", 5) != 0xFFFF) { printf("\n***Now seek back to beginning of file***\n"); fseek(inp,0l,SEEK_SET); while (fgets(line, 256, inp)) fputs(line, out); printf("*****************EOF***************\n"); } time(&t2); printf("New local time : %s",asctime(localtime(&t2))); printf("Difference between the two local times "); printf("(in seconds): %.0f\n", difftime(t2,t1)); return (0); }ZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666O 'জ"search.c C_Samples"efff1g P '/* * Search keylist routine. */ #define Beep #define CheckErc #define PutFrameChars #define PutFrameAttrs #define ResetFrame #include #include "keyword.h" #include #include #include /* Vidio Routines found in Vidio.c */ extern void DrawFunctionKeyBar(Word iLine, Pointer psFnckys); extern Word DisplayLin8 urn; /* display file name on top line */ i = strlen(filedisplay); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 0, pBlanks, 80)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, pBlanks, 80V ')); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 0, filedisplay, i)); CheckErc(PutFrameChars(DISPLAYFRAME, i, 0, pFiles->Filename, ((strlen(pFiles->Filename)+i)<80) ? strlen(pFiles->Filename) : 80-i)); /* display current line number in file on next line */ sprintf(positiondisplay, "At line number: %d%n", nLine, &i); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, positiondisplay, i)); if ((input = fopen(pFiles->Filename, "r")) == NULL) { for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChaX 'rs(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80)); } CheckErc(PutFrameChars(DISPLAYFRAME,0,10,"File not found:", 15)); CheckErc(PutFrameChars(DISPLAYFRAME,16,10, pFiles->Filename, strlen(pFiles->Filename))); Beep(); waitforack = 1; return; } for (i = STARTLINE, iLine = 0; i < DisplayLines-FIRSTLINE; i++, iLine++) { if (fgets((char *)&line[iLine][0], LINESIZE, input) == NULL) line[iLine][0] = 0; pDisplayline[i] = &(line[iLine][0]); Z ' } } void FindNextFile() { if (pFiles != NULL) pFiles = pFiles->Next; InitFileUse(); } void ShiftLineBuffer() { Word i; nLine++; /* display this on top line */ sprintf(positiondisplay, "At line number: %d%n", nLine, &i); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, positiondisplay, i)); for (i = 0; i < LNLINES - 1; i++) pDisplayline[i] = pDisplayline[i+1]; if (++iLine == LNLINES) iLine = 0; if (fgets((char *)&line[iLine][0], LINESIZE, input) == NULL) line[iLine][0] = 0; pDisplayline[LNLINES - 1\ '] = &(line[iLine][0]); }  Word FindMatchInFile() { KeyListType *pSearch; Word limit; Word i; if (pKeys == NULL) return(0xFF); /* kick out, let search end */ while (TRUE) { if ((limit = strlen(pDisplayline[STARTLINE])) == 0) { FindNextFile(); if (input == NULL) return(0xFF); } else { for (pSearch = pKeys; ( (pSearch != NULL) && (pSearch != (void *)&pSelectList) ); pSearch = (pSelectList == (void *) &pSelectList) ? pSearch->Next : pSearch->Selected) { KeyWordSize =^ ' strlen(pSearch->KeyWord); if (KeyWordSize >= limit) continue; for (i = 0; (i+KeyWordSize) <= limit; i++) if (strncmp(pSearch->KeyWord, (char *)(&(pDisplayline[STARTLINE])[i]), KeyWordSize) == 0) return (i); } ShiftLineBuffer(); } } } void DisplayNext() { Word i, linesize; Word positionfoundat; if (waitforack != 0) { /* Any error to ack? */ waitforack = 0; return; } positionfoundat = FindMatchInFile(); if (waitforack != 0) { /* May have encountered new erro` ' r to ack */ waitforack = 0; return; } if ((pKeys == NULL) || (pFiles == NULL)) { /* search done */ for (i = FIRSTLINE; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80)); } CheckErc(PutFrameChars(DISPLAYFRAME,33,10,"Search done...", 14)); searchdone++; } else { /* display data around this match */ for (i = 0; i < LNLINES; i++) { if (pDisplayline[i] != NULL) { linesize = strlen((char *)c ' pDisplayline[i]); CheckErc(PutFrameChars (DISPLAYFRAME, 0, i + FIRSTLINE, pDisplayline[i], linesize)); CheckErc(PutFrameChars (DISPLAYFRAME, linesize, i + FIRSTLINE, pBlanks, 80-linesize)); } else { CheckErc(PutFrameChars (DISPLAYFRAME, 0, i + FIRSTLINE, pBlanks, 80)); } } CheckErc(PutFrameAttrs( DISPLAYFRAME,0,STARTLINE+ FIRSTLINE,lUnderLine,80)); if (positionfoundat < 80) CheckErc(PutFrameAttrs( DISPLAYFRAME,positionfoundat,STARTLINE+ FIRSTLINE,  e ' lUnderLine +lReverseHB,KeyWordSize)); } } void SearchSetUp(){ waitforack = 0; searchdone = 0; CheckErc(ResetFrame(DISPLAYFRAME)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 2, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 08  beeper.fls linkbeeper.sub linkhuge.fls linkHuge.sub linkKeyword.fls linkKeyword.sub linklarge.fls linklarge.sub linklife.fls linklife.sub linksample.fls linksample.sub linkswap.fls linkswap.sub linkwrite.fls linkwrite.sub lst.fls map.fls obj.fls run.fls sa samgen.asm sample.c search.c server.h Source.fls start.asm swap.c sym.fls tree vidio.c write.c ls * @ start.asm c_samples@ff1g xt *; ;************************************************************************* ; This initialization routine is designed for use with MetaWare C routines ; that do not use any of the MetaWare C library routines. This allows ; system programmers to write services that do not suffer from the C runtime ; memory overhead - which is between 7k and 42k bytes, depending on what ; subsys, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, pBlanks, 80)); DrawFunctionKeyBar(2, "   Back      Next "); pKeys = (pSelectList == (void *) &pSelectList) ? pKeyList : pSelectList; pFiles = pFileList; g ' if (pKeys == NULL) { CheckErc(PutFrameChars(DISPLAYFRAME,31,10,"Nothing to find...", 18)); Beep(); waitforack = 1; } input = NULL; InitFileUse(); DisplayNext(); } void fncSearch (Byte chr){ if ((searchdone != 0) && ((chr == F10) || (chr == NEXT))) { DrawMainDisplay(); oStateStack -= 1; if (input != NULL) fclose(input); return; } switch (chr) { case F4: DrawMainDisplay(); oStateStack -= 1; if (input != NULL) fclose(input); break; case F10: if (input != NULL) ShiftLineB$i ' uffer(); DisplayNext(); break; case NEXT: if (input != NULL) ShiftLineBuffer(); DisplayNext(); break; default: Beep(); break; } } nput = NULL; /* Done with this handle. */ nLine = 1; for (i = 0, line[0][0] = 0; i < LNLINES; i++) pDisplayline[i] = &line[0][0]; /* clear display */ if (pFiles == NULL) return; /* display file name on top line */ i = strlen(filedisplay); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 0, pBlanks, 80)); CheckErc(PutFrameChars(DISPLAYFRAME, 0, 1, pBlanks, 800k (@server.h C_Samples@ff1g @@@A0B0CO@D? KVXoYZZO[[\P^?_ c/ 0g`q`s?v x/ yPzOpzz1|1E  0FIN/C H M R Tp )<'1 Source.fls C_Samples'1Uf Vf1g`q )asm.fls beeper.c filelist.c func1.c func2.c glider HighC.fls huge.c keylist.c keymain.c keyword.h large.c lib.fls libSamples.fls life.c link.fls link9 tems are cheated out of the link using dummy routine names. ; ; The additional memory recovered by avoiding the C runtime library cv *ompletely ; is worth the trouble, but care must be taken to insure that none of the ; runtime features are used when initialized from this routine. ; ; Fortunately, link errors will result in all known cases so far... ; stack segment word 'stack' stack_start equ this byte db 'MetaWare ' db 'High C' db ' Run-time Library Copyright (C) 1983-1988 MetaWare Incorporated..' stack ends data segment 'data' zero db 0 pzero dw OFFSET dgroup:zero dw dgroup data ends const segment 'const' const ends memory sex *gment 'memory' memory ends dgroup group stack,DATA,const,memory code segment 'code' code ends extrn main:FAR extrn exit:FAR init_code segment 'code' assume cs: init_code public _mwINIT _mwinit PROC FAR mwINIT: cli ; Wait 'til I have a stack. mov BP,0 ; Initialize stack frame pointer mov ax,dgroup mov ds,ax mov ss,ax assume ds:dgroup mov  sp, OFFSET dgroup:stack_start sti ; Stack in place, can handle interrupts now. ; ; set up argc, argv for no parameters from this initializer mov axz *, dgroup mov bx, offset dgroup: pzero push ax push bx mov ax,1 push ax CALL main ; ; If the C program returned, call ctos exit. CALL exit _mwinit endp init_code ends end _mwinit H(JjVVyVVV.VPVVVVwVHXdWz!`:`LM~JT!K!b!!6#!3!3!3!cD!D!D!! ! !/"""p"R"U""!2#Z2#r2#2#2#| +?swap.c C_samples?ff1g> } +#ifdef __LARGE__ #include #include #include  #include #else $#include $#define AllocMemorySL $#define InitLargeOverlays $#include pragma Calling_convention(_FAR_CALL|_CALLEE_POPS_STACK|_DGROUP_MODEL); extern int OutputToVid0(void *, int); extern int AllocMemorySL(int, void *); extern int InitLargeOverlays(void *, int); pragma Calling_convention(); #endif long *func1(), *func2(); long a=2, b=3, c ; extern char * sbVerrun; int inmain(){ + return 1; } main() { int erc; char *poverlay; /* address of overlay area */ int i; /* Allocate Memory for overlays. */ if( erc = AllocMemorySL(4096, &poverlay) ) ErrorExit( erc ); /* Initialize overlays */ if( erc = InitLargeOverlays(poverlay, 256) ) ErrorExit( erc ); for (i=0; i<20; i++){ printf("%ld + %ld = %ld; %ld * %ld = %ld\n", a, b, *(func1()), a, b, *(func2())); a++; b++; } for (i=0; i<10; i++){ double d1; d1 = i; printf("%f %f %f %f\n",d1+1.0,d1-1.0,d1*́ +1.0,d1/1.0); } NewScreen(); funcx(); PutLabels(); }       $ ) . 3 8 = B G L Q V [ ` e  O{ e    ( B W   0  p p   5 xCxNNN8NzN Z$Z<ZTZlZZZZZZZZyZ Z Z Z Z1 ZF Z Z6O6y666)6Q6o66666&666؃ , 1sym.fls C_Samples 1ՙf֙f1gQ  ,beeper.sym huge.sym Keyword.sym Large.sym life.sym sample.sym swap.sym write.sym 9  ol[i], iLine, lReverseHB, rgCol[i+3]) ); } } void SetUpMenu(MenuType *Menu) { PromptType *Line; InputType *Data; Word i; pActiveMenu = Menu; for (i = DisplayLines - 7; i < DisplayLines; i++) { CheckErc(PutFrameChars(DISPLAYFRAME, 0, i, pBlanks, 80)); CheckErc(PutFrameAttrs(DISPLAYFRAME, 0, i, lNormal, 80)); D . } CheckErc(PutFrameChars(DISPLAYFRAME, 0, DisplayLines - 7, pSep, 80)); for (Line = Menu->Prompt; Line != NULL; Line = Line->Next) { CheckErc(PutFrameChars( DISPLAYFRAME ,Line->Col ,Line->Line + (DisplayLines - 6) ,Line->pString ,strlen(Line->pString) )); } for (Data = Menu->Input; Data != NULL; Data = Data->Next) { CheckErc(PutFrameAttrs( DISPLAYFRAME ,Data->Col ,Data->Line + (DisplayLines - 6) ,lReverseHB ,Data->Len )); CheckErc(PutFrameChars( DISPLAP .YFRAME ,Data->Col ,Data->Line + (DisplayLines - 6) ,Data->Data ,strlen(Data->Data) )); } /* Set up cursor at first position */ pActiveInputline = -0tree c_samples01-f2-f1g - .vidio.c C_samplesff1gV  ./* * Define a selection of vidio manipulation routines */ #define Beep #define CheckErc #define InitCharMap #define InitVidFrame #define PutFrameAttrs #define PutFrameChars #define QueryVidHdw #define ReadKbd #define ResetFrame #define ResetVideo #define SetScreenVidAttr #include #include "keyword.h" #include #include Word vcLines; Word vcCols; Word rgCol[6] = {0, 24, 56, 23, 31, 23}; Word DisplayLines; char Inputline[LINEMAX]; MenuType *pActiveMenu; InputType *  .pActiveInputline; Byte *pActiveData; void (*(pCancelRoutine))(); void (*(pGoRoutine))(); Word InputCursorLine; Word InputCursorCol; Pointer pBlanks = {"  "}; Pointer pSep = {""}; void InitVideo() { Word sMap; Byte rgbVidHdw[3]; CheckErc( QueryVidHdw (&rgbVidHdw, sizeof(rgbVidHdw)) ); vcLines = rgbVidHdw[1]; vcCols = rgbVidHdw[2]; CheckEr, .c( ResetVideo (vcCols, vcLines, TRUE, 0x20, &sMap) ); /*Main frame*/ DisplayLines = vcLines - SIZEFNCFRAME; CheckErc( InitVidFrame(DISPLAYFRAME, 0, 0, vcCols, DisplayLines, 0, 0, 0, 0, 0) ); /* function bar frame */ CheckErc( InitVidFrame(FNCKEYFRAME, 0, DisplayLines, vcCols, 3, 0, 0, 0, 0, 0) ); CheckErc( InitCharMap(0, sMap) ); CheckErc( SetScreenVidAttr(1, TRUE) ); /*refresh*/ CheckErc( ResetFrame(DISPLAYFRAME) ); CheckErc( ResetFrame(FNCKEYFRAME) ); return; } void DrawFunctionKeyB8 .ar(Word iLine, Pointer psFnckys) { Word i; CheckErc(PutFrameChars(FNCKEYFRAME, 0, iLine, psFnckys, strlen(psFnckys))); for (i = 0; i < 3; i++) { CheckErc( PutFrameAttrs(FNCKEYFRAME, rgC:  Menu->Input; if (pActiveInputline != NULL) { pActiveData = Menu->Input->Data; InputCursorLine = Menu->Input->Line + (DisplayLines - 6); InputCursorCol = Menu->Input->Col; for (InputCursorCol = Menu->Input->Col; pActiveData[InputCursorCol-Menu->Input->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(DISPLAYFRAME, InputC\ .ursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } CheckErc(PutFrameChars(FNCKEYFRAME, 0, 0, pSep, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 1, pBlanks, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 0, 2, pBlanks, 80)); CheckErc(PutFrameAttrs(FNCKEYFRAME, 0, 2, lNormal, 80)); CheckErc(PutFrameChars(FNCKEYFRAME, 18, 2, "Press GO to act, press cancel to exit menu.", 43)); } void InputInformation (Byte chr){ switch (chr) { case CANCEL: (*pCancelRoutine)(); break; case GO: (*pGoRoutineh .)(); break; case NEXT: CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lReverseHB, 1)); pActiveInputline = pActiveInputline->Next; if (pActiveInputline == NULL) pActiveInputline = pActiveMenu->Input; pActiveData = pActiveInputline->Data; InputCursorLine = pActiveInputline->Line + (DisplayLines - 6); for (InputCursorCol = pActiveInputline->Col; pActiveData[InputCursorCol-pActiveInputline->Col] != 0; InputCursorCol++); CheckErc(PutFrameAttrs(DISPLAYFRAME, Inpt . utCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); break; case BACKSPACE: CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col) != 0) InputCursorCol -= 1; CheckErc(PutFrameChars(DISPLAYFRAME, InputCursorCol, InputCursorLine, pBlanks, 1)); pActiveData[InputCursorCol-pActiveInputline->Col] = 0; CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); br . eak; default: /* Assume data char if not caught elsewhere */ if ((chr < 0x80) && (pActiveInputline != NULL)) {  CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lReverseHB, 1)); if ((InputCursorCol-pActiveInputline->Col) < (pActiveInputline->Len - 1) ) { CheckErc(PutFrameChars(DISPLAYFRAME, InputCursorCol, InputCursorLine, &chr, 1)); pActiveData[InputCursorCol - pActiveInputline->Col] = chr; pActiveData[(InputCursorCol-pActiveInputline->Col)+1] = . 0; InputCursorCol += 1; } CheckErc(PutFrameAttrs(DISPLAYFRAME, InputCursorCol, InputCursorLine, lUnderLine | lReverseHB, 1)); } else Beep(); break; } } ine QueryVidHdw #define ReadKbd #define ResetFrame #define ResetVideo #define SetScreenVidAttr #include #include "keyword.h" #include #include Word vcLines; Word vcCols; Word rgCol[6] = {0, 24, 56, 23, 31, 23}; Word DisplayLines; char Inputline[LINEMAX]; MenuType *pActiveMenu; InputType * /UDwrite.c C_SamplesDufuf1g / #include #include doone(char *mode) { FILE *out; long i; char filename[100]; strcpy(filename, "Test."); strcat(filename, mode); strcat(filename, ".tst"); remove(filename); if ((out = fopen(filename, mode)) == NULL) { printf("Open fail"); return(0); } for (i = 0; i < 7; i += 2) { if(fseek(out, i, SEEK_SET) != 0) { printf("Write fail"); return(0); } if(fwrite("AC", 2, 1, out) != 1) { printf("Write fail"); return(0); } } for (i = 1; i < 8; i += 2 /) { if(fseek(out, i, SEEK_SET) != 0) { printf("Write fail"); return(0); } if(fwrite("B", 1, 1, out) != 1) { printf("Write fail"); return(0); } } } int main() { char mode[4]; char *smodes[2] = {"w", "a"}; char *pmodes[5] = {"\0", "+", "+b", "+t", "+u"}; int i, j; for (i = 0; i < 2; i++) { for:   (j = 0; j < 5; j++){ strcpy(mode, smodes[i]); strcat(mode, pmodes[j]); doone(mode); } } }  ; ;  < <  = =  > >  ? ?  @ @  A A  B B  C C  D D  E E  F F  G G  H H  I I  J J  K K  L L