#-h- addset 744 asc 16-may-81 16:41:40 [002,100] .bp 1 .in 0 .he 'ADDSET (2)'11/13/78'ADDSET (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br addset - put c in array(j) if it fits, increment j .sp 1 .ti -7 SYNOPSIS .br .nf stat = addset(c, array, j, maxsize) character c, array(ARB) integer j # j is incremented integer maxsize integer stat returned as YES/NO .fi .sp 1 .ti -7 DESCRIPTION .br Adds a character at a time to a specified position of an array and increments the index. It also checks that there's enough room to do so. The array is an ascii character array stored one character per word. 'c' is a single ascii character. YES is returned if the routine succeeded, otherwise NO. .sp 1 .ti -7 SEE ALSO .br scopy, stcopy, addstr, concat .sp 1 .ti -7 DIAGNOSTICS .br None #-h- cant 634 asc 16-may-81 16:41:41 [002,100] .bp 1 .in 0 .he 'CANT (2)'11/13/78'CANT (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br cant - print 'name: can't open' and terminate execution .sp 1 .ti -7 SYNOPSIS .br call cant(name) character name(ARB) .sp 1 .ti -7 DESCRIPTION .br On ERROUT, prints the filename specified by 'name' followed by the message "can't open" and terminates execution. All open files are closed. Name is an ascii character array terminated with an EOS marker. .sp Cant is essentially: .br .in +5 .nf call putlin (name, ERROUT) call remark (": can't open.") call endst(ERR) .fi .in -5 .sp 1 .ti -7 SEE ALSO .br error, remark .sp 1 .ti -7 DIAGNOSTICS .br None #-h- chcopy 639 asc 16-may-81 17:10:05 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd CHCOPY 03/23/80 copy character into array, bump pointer .sy subroutine chcopy(c, buf, i) character c, buf(ARB) integer i .fs `chcopy' copies `c' into `buf(i)', increments `i' and places an EOS in this next free location. .sa stcopy - copy string, advancing pointer .bu #-h- clower 386 asc 16-may-81 16:41:42 [002,100] .bp 1 .in 0 .he 'CLOWER (2)'11/13/78'CLOWER (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br clower - fold c to lower case .sp 1 .ti -7 SYNOPSIS .br c = clower(c) character c .sp 1 .ti -7 DESCRIPTION .br Fold character c to lower case, if not already there. If c is not alphabetic, returns it unchanged. .sp 1 .ti -7 SEE ALSO .br fold, upper, lower, clower .sp 1 .ti -7 DIAGNOSTICS .br None #-h- concat 491 asc 16-may-81 16:41:43 [002,100] .bp 1 .in 0 .he 'CONCAT (2)'7/23/80'CONCAT (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br concat - concatenate 2 strings together .sp 1 .ti -7 SYNOPSIS .br .nf call concat(buf1, buf2, outstr) character buf1(ARB), buf2(ARB), outstr(ARB) .fi .sp 1 .ti -7 DESCRIPTION .br Copies the arrays buf1 and buf2 into the array outstr. All arrays are ascii character arrays stored one character per array element. .sp 1 .ti -7 SEE ALSO .br scopy, stcopy, addset, addstr .sp 1 .ti -7 DIAGNOSTICS .br None #-h- ctoi 921 asc 16-may-81 16:41:44 [002,100] .bp 1 .in 0 .he 'CTOI (2)'11/13/78'CTOI (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br ctoi - convert string at in(i) to integer, increment i .sp 1 .ti -7 SYNOPSIS .br .nf n = ctoi(in, i) character in(ARB) integer i # i is incremented integer n is returned as the converted integer .fi .sp 1 .ti -7 DESCRIPTION .br Converts a character string to an integer. Starts looking at position i of in. Plus and minus signs are not allowed. Leading blanks and tabs are ignored; any subsequent digits are converted to the correct numeric value. The first non-digit seen terminates the scan; upon return, i points to this position. n is returned as the value of the integer. The in array is an ascii character array terminated with an EOS marker (or a non-numeric character). Zero is returned if no digits are found. .sp 1 .ti -7 SEE ALSO .br itoc .sp 1 .ti -7 DIAGNOSTICS .br There are no checks for machine overflow. #-h- cupper 419 asc 16-may-81 16:41:45 [002,100] .bp 1 .in 0 .he 'CUPPER (2)'11/13/78'CUPPER (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br cupper - convert character to upper case .sp 1 .ti -7 SYNOPSIS .br .nf c = cupper(c) character c .fi .sp 1 .ti -7 DESCRIPTION .br Converts ascii character c to upper case, if not already there. Non-alphabetic characters are returned unchanged. .sp 1 .ti -7 SEE ALSO .br upper, clower, fold, lower .sp 1 .ti -7 DIAGNOSTICS .br None #-h- delete 1236 asc 16-may-81 15:39:58 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd DELETE 03/23/80 remove a symbol from a symbol table .sy subroutine delete (symbol, table) character symbol (ARB) pointer table .fs 'Delete' removes the character-string symbol given as its first argument from the symbol table given as its second argument. All information associated with the symbol is lost. .sp The symbol table specified must have been generated by the routine 'mktabl'. .sp If the given symbol is not present in the symbol table, 'delete' does nothing; this condition is not considered an error. .im 'Delete' calls 'stlu' to determine the location of the given symbol in the symbol table. If present, it is unlinked from its hash chain. The dynamic storage space allocated to the symbol's node is returned to the system by a call to 'dsfree'. .ca stlu, dsfree .sa enter (2), lookup (2), mktabl (2), rmtabl (2), dsget (2), dsfree (2), dsinit (2), sctabl (2) #-h- dsfree 1404 asc 16-may-81 15:39:50 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd DSFREE 03/23/80 free a block of dynamic storage .sy subroutine dsfree (block) pointer block .fs 'Dsfree' returns a block of storage allocated by 'dsget' to the available space list. The argument must be a pointer returned by 'dsget'. .sp See the remarks under 'dsget' for required initialization measures. .im 'Dsfree' is an implementation of Algorithm B on page 440 of Volume 1 of The Art of Computer Programming, by Donald E. Knuth. The reader is referred to that source for detailed information. .sp 'Dsfree' and 'dsget' maintain a list of free storage blocks, ordered by address. 'Dsfree' searches the list to find the proper location for the block being returned, and inserts the block into the list at that location. If blocks on either side of the newly-returned block are available, they are coalesced with the new block. If the block address does not correspond to the address of any allocated block, 'dsfree' remarks "attempt to free unallocated block" and returns. .bu The algorithm itself is not the best. .sa dsget (2), dsinit (2) #-h- dsget 2082 asc 16-may-81 15:39:51 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd DSGET 03/23/80 obtain a block of dynamic storage .sy pointer function dsget (w) integer w .fs 'Dsget' searches its available memory list for a block that is at least as large as its first argument. If such a block is found, its index in the memory list is returned; otherwise, the value LAMBDA is returned. .sp In order to use 'dsget', the following declaration must be present: DS_DECL (mem, MEMSIZE) .br where MEMSIZE is supplied by the user, and may take on any positive value between 6 and 32767, inclusive. Furthermore, memory must have been initialized with a call to 'dsinit': call dsinit (MEMSIZE) .im 'Dsget' is an implementation of Algorithm A' on pages 437-438 of Volume 1 of The Art of Computer Programming, by Donald E. Knuth. The reader is referred to that source for detailed information. .sp 'Dsget' searches a linear list of available blocks for one of sufficient size. If none are available, a null pointer (LAMBDA) is returned; otherwise, the block found is broken into two pieces, and the index (in array 'mem') of the piece of the desired size is returned to the user. The remaining piece is left on the available space list. Should this procedure cause a block to be left on the available space list that is smaller than a threshhold size, the few extra words are awarded to the user and the block is removed entirely, thus speeding up the next search for space. .ca .bu It is somewhat annoying for the user to have to declare the storage area, but Fortran prevents effective use of pointers, so this inconvenience is necessary for now. Note that the storage area is declared as .ul integer, not .ul character, which may be cause for caution in some implementations. .sa dsfree (2), dsinit (2) #-h- dsinit 1236 asc 16-may-81 15:39:48 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd DSINIT 03/23/80 initialize dynamic storage space .sy subroutine dsinit (w) integer w .fs 'Dsinit' initializes an area of storage in the common block CDSMEM so that the routines 'dsget' and 'dsfree' can be used for dynamic storage allocation. The memory to be managed must be supplied by the user, by a declaration of the form: DS_DECL (mem, MEMSIZE) .br which turns into something similar to integer mem (MEMSIZE) common /cdsmem/ mem .br The memory size must then be passed to 'dsinit' as its argument: call dsinit (MEMSIZE) .im 'Dsinit' sets up an available space list consisting of two blocks, the first empty and the second containing all remaining memory. The first word of memory (below the available space list) is set to the total size of memory; this information is used only by the dump routines 'dsdump' and 'dsdbiu'. .ca error .sa dsget (2), dsfree (2) #-h- enter 1807 asc 16-may-81 15:40:00 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd ENTER 03/23/80 place symbol in symbol table .sy integer function enter (symbol, info, table) character symbol (ARB) integer info (ARB) pointer table .fs 'Enter' places the character-string symbol given as its first argument, along with the information given in its second argument, into the symbol table given as its third argument. .sp The symbol table used must have been created by the routine 'mktabl'. The size of the info array must be at least as large as the symbol table node size, determined at table creation time. .sp Should the given symbol already be present in the symbol table, its information field will simply be overwritten with the new information. .sp 'Enter' uses the dynamic storage management routines, which require initialization by the user; see 'dsinit' for further details. .sp If the symbol and associated information were successfully entered into the table, the value of OK is returned; otherwise, ERR is returned. .im 'Enter' calls 'stlu' to find the proper location for the symbol. If the symbol is not present in the table, a call to 'dsget' fetches a block of memory of sufficient size, which is then linked onto the proper chain from the hash table. Once the location of the node for the given symbol is known, the contents of the information array are copied into the node's information field. .ca stlu, dsget .sa lookup (2), delete (2), mktabl (2), rmtabl (2), dsget (2), dsfree (2), dsinit (2), sctabl (2) #-h- equal 505 asc 16-may-81 16:41:46 [002,100] .bp 1 .in 0 .he 'EQUAL (2)'11/13/78'EQUAL (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br equal - compare str1 to str2; return YES if equal .sp 1 .ti -7 SYNOPSIS .br .nf stat = equal(str1, str2) character str1(ARB), str2(ARB) integer stat is returned as YES/NO .fi .sp 1 .ti -7 DESCRIPTION .br Compares two strings, returning YES if they are the same, NO if they differ. Each string is an ascii character array terminated with an EOS marker. .sp 1 .ti -7 SEE ALSO .br strcmp .sp 1 .ti -7 DIAGNOSTICS .br None #-h- error 828 asc 16-may-81 16:41:47 [002,100] .bp 1 .in 0 .he 'ERROR (2)'7/23/80'ERROR (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br error - print single-line message and terminate execution .sp 1 .ti -7 SYNOPSIS .br .nf call error (message) integer message #message is a hollerith array .fi .sp 1 .ti -7 DESCRIPTION .br Error writes the message onto the standard error file ERROUT. A NEWLINE is always generated, even though one may not appear in the message. Endst is called and execution ceases. Error is essentially a call to 'remark' and then to 'endst'. The message array is a Fortran hollerith string in the format generated by the Ratfor quoted string capability. On some systems, it may be necessary to terminate the string with a '.' or other end-of-string marker. .sp 1 .ti -7 SEE ALSO .br remark, putlin, prompt, endst .sp 1 .ti -7 DIAGNOSTICS .br None #-h- fcopy 621 asc 16-may-81 16:41:48 [002,100] .bp 1 .in 0 .he 'FCOPY (2)'11/13/7'FCOPY (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br fcopy - copy file in to file out .sp 1 .ti -7 SYNOPSIS .br .nf call fcopy (in, out) integer in, out .fi .sp 1 .ti -7 DESCRIPTION .br Assuming that both files are opened, positioned, and ready to go, the routine copies lines from the current file position until an EOF is reached on file 'in'. 'in' and 'out' are file identifiers returned by open or create. .sp 1 .ti -7 IMPLEMENTATION .br 'Fcopy' simply makes repeated calls to getlin and putlin. .sp 1 .ti -7 SEE ALSO .br open, create, getlin, putlin .sp 1 .ti -7 DIAGNOSTICS .br None #-h- fmtdat 1339 asc 16-may-81 16:41:49 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd FMTDAT 09/25/80 convert date information to character string .sy subroutine fmtdat (date, time, now, form) character date (ARB), time (ARB) integer now (7), form .fs 'Fmtdat' is used to convert date information (such as that provided by 'getnow') into human-readable graphics. The first argument is a character string to receive the representation of the current date. The second argument is a character string to receive the representation of the current time. The third argument is a date specification in the same 7-word integer array format as is returned by 'getnow' (year including century, month, day, hour, minute, second, millisecond). The fourth argument selects the format of the character representations; a value of DIGIT causes the date to formatted as MM/DD/YY, whereas a value of LETTER causes the format to be DD-MMM-YY, where MMM is the first three letters of the month name. .im Simple integer-to-character conversions. .am date, time .sa getnow (2), date (1) #-h- fold 520 asc 16-may-81 16:41:51 [002,100] .bp 1 .in 0 .he 'FOLD (2)'11/13/78'FOLD (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br fold - convert string to lower case .sp 1 .ti -7 SYNOPSIS .br .nf call fold (str) character str(ARB) .fi .sp 1 .ti -7 DESCRIPTION .br Converts the array 'str' to lower case characters. Non-alphabetic characters are left unchanged. The 'str' array is ascii characters terminated by an EOS marker. .sp (This routine is exactly the same as 'lower'.) .sp 1 .ti -7 SEE ALSO .br clower, cupper, upper, lower .sp 1 .ti -7 DIAGNOSTICS .br None #-h- getc 660 asc 16-may-81 16:41:52 [002,100] .bp 1 .in 0 .he 'GETC (2)'11/10/78'GETC (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br getc - read character from standard input .sp 1 .ti -7 SYNOPSIS .br .nf c = getc (c) character c .fi .sp 1 .ti -7 DESCRIPTION .br Getc reads the next character from the standard input. The character is returned in ascii format both as the functional return and in the parameter c. If the end of a line has been encountered, NEWLINE is returned. If the end of the file has been encountered, EOF is returned. If the input file is not ascii, characters are mapped into their corresponding ascii format. .sp 1 .ti -7 SEE ALSO .br getch, getlin .sp 1 .ti -7 DIAGNOSTICS .br None #-h- getwrd 858 asc 16-may-81 16:41:53 [002,100] .bp 1 .in 0 .he 'GETWRD (2)'11/13/78'GETWRD (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br getwrd - get non-blank word from in(i) into out, increment i .sp 1 .ti -7 SYNOPSIS .br .nf size = getwrd(in, i, out) character in(ARB), out(ARB) integer i # i is incremented integer size is returned as the length of the word found .fi .sp 1 .ti -7 DESCRIPTION .br Starting at position 'i' in array 'in', skips any leading blanks and tabs and returns the next word and its length. A word is any series of characters terminated by a BLANK, TAB, or NEWLINE. The terminator is not returned as part of the word. 'i' is incremented to the position just past the end of the word. The word is returned in array 'out'. Both 'in' and 'out' are ascii character arrays terminated with an EOS marker. .sp 1 .ti -7 SEE ALSO .br skipbl .sp 1 .ti -7 DIAGNOSTICS .br None #-h- imget 972 asc 16-may-81 16:16:55 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd IMGET 03/23/80 fetch next token from in-memory sort area .sy integer function imget(table, buf) pointer table character buf(ARB) .fs `imget' fetches the next token from the in-memory sort area pointed to by `table', which was returned as the function value if an `iminit' call. If there is another token which has not been fetched yet, it is returned in `buf' and a value of OK is returned as the value of the function; otherwise, the value EOF is returned. .sa iminit - initialize in-memory sort area imput - put another token into in-memory sort area imsort - sort tokens in in-memory sort area .bu #-h- iminit 1206 asc 16-may-81 16:16:54 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd IMINIT 03/23/80 initialize in-memory sort area .sy pointer function iminit(memsiz, avetok) integer memsiz, avetok .fs `iminit' initializes the dynamic storage region (via a `dsinit' call) and allocates a block of pointers for future use by `imget', `imput' and `imsort'. The pointer to this block of pointers is returned as the value of the function. The program calling `iminit' must have made the following declaration .ce DS_DECL(Mem,memsiz) to cause the memory area used by the dynamic storage routines to be allocated. `avetok' is an estimate of the average length of the tokens which will be inserted into the dynamic memory via `imput' calls. .sa dsinit - initialize dynamic storage region imput - put token into in-memory sort area imget - fetch token from in-memory sort area imsort - sort tokens in in-memory sort area .bu #-h- impath 803 asc 16-may-81 17:10:06 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd IMPATH 03/23/80 return standard search path .sy subroutine impath(path) character path(arith(3,*,FILENAMESIZE)) .fs `impath' returns the standard search path for known files to the user in `path'. The standard search path is current working directory, user's home directory, ~usr/ and ~bin/. The format of the search path may be discerned by reading the manual entry for `loccom'. .sa loccom - locate command along search path .bu #-h- imput 916 asc 16-may-81 16:16:56 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd IMPUT 03/23/80 place token into in-memory sort area .sy integer function imput(table, buf) pointer table character buf(ARB) .fs `imput' places the token passed in `buf' into the in-memory sort area pointed to by `table', which was returned as the function value of an `iminit' call. If there is room for the token, a value of OK is returned as the function value; otherwise, a value of ERR is returned. .sa iminit - initialize in-memory sort area imget - fetch next token from in-memory sort area imsort - sort tokens in in-memory sort area .bu #-h- imsort 956 asc 16-may-81 16:16:58 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd IMSORT 03/23/80 sort tokens in in-memory sort area .sy subroutine imsort(table) pointer table .fs `imsort' sorts the string tokens stored in the in-memory sort area pointed to by `table', which was returned as the function value of a previous `iminit' call. The strings are sorted according to the ASCII collating sequence, with all characters being significant. Upon completion, the tokens may be fetched via `imget' calls in sorted order. .sa iminit - initialize in-memory sort area imput - place tokens into in-memory sort area imget - fetch next token from in-memory sort area .bu #-h- index 572 asc 16-may-81 16:41:54 [002,100] .bp 1 .in 0 .he 'INDEX (2)'11/13/78'INDEX (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br index - find character c in string str .sp 1 .ti -7 SYNOPSIS .br .nf loc = index(str, c) character str(ARB), c integer loc is returned as the location is str where c was located .fi .sp 1 .ti -7 DESCRIPTION .br Returns the index of the first character in 'str' that matches 'c', or zero if 'c' isn't in the array. 'Str' is an ascii character array terminated with an EOS marker. 'c' is a single ascii character. .sp 1 .ti -7 SEE ALSO .br match, getpat .sp 1 .ti -7 DIAGNOSTICS .br None #-h- inihlp 1089 asc 16-may-81 16:16:50 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd INIHLP 03/23/80 initialize help facility on help archive .sy integer function inihlp(file, ptrara, ptrsiz, unit) integer ptrsiz, unit linepointer ptrara(ptrsiz) character file(FILENAMESIZE) .fs `inihlp' opens `file' at READ access, and notes the disk address of each archive header in the linepointer array, `ptrara'. If the number of headers is larger than `ptrsiz', only `ptrsiz' addresses are noted. The ratfor unit for using `mrkhlp' and `puthlp' is returned in `unit'. If the file could not be opened, ERR is returned as the function value; otherwise, OK is returned. .sa mrkhlp - mark elements matching pattern puthlp - output elements specified in pointer array markl - note disk address of current record .bu #-h- itoc 714 asc 16-may-81 16:41:55 [002,100] .bp 1 .in 0 .he 'ITOC (2)'11/13/78'ITOC (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br itoc - convert integer to character string .sp 1 .ti -7 SYNOPSIS .br .nf length = itoc(int, str, size) integer int, size character str(ARB) integer length returned as the number of characters needed .fi .sp 1 .ti -7 DESCRIPTION .br Converts an integer 'int' to characters in array 'str', which is at most 'size' characters long. 'length' is returned as the number of characters the integer took, not including the EOS marker. Characters are stored in ascii character arrays terminated with an EOS marker. .sp Negative numbers are handled correctly. .sp 1 .ti -7 SEE ALSO .br ctoi, putdec, putint .sp 1 .ti -7 DIAGNOSTICS .br None #-h- length 466 asc 16-may-81 16:41:56 [002,100] .bp 1 .in 0 .he 'LENGTH (2)'11/13/78'LENGTH (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br length - compute length of string .sp 1 .ti -7 SYNOPSIS .br .nf n = length(str) character str(ARB) integer n returned as the number of characters in str .fi .sp 1 .ti -7 DESCRIPTION .br Computes the length of a character string, excluding the EOS. The string is an ascii character array terminated with an EOS marker. .sp 1 .ti -7 SEE ALSO .br .sp 1 .ti -7 DIAGNOSTICS .br None #-h- logpmt 909 asc 16-may-81 16:24:00 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd LOGPMT 03/23/80 `prompt' with history mechanism .sy integer function logpmt(pstr, buf, fd) character pstr(ARB), buf(MAXLINE) integer fd .fs `logpmt' is semantically the same as `prompt', with the addition that is keeps a log of each line returned to the user, and permits the user to recall and edit lines previously entered. The writeup for `hsh', the history shell, may be consulted for the syntax of the history manipulating commands. .sa prompt - prompt for input form teletype channels rawpmt - `prompt' with raw I/O capabilities .bu #-h- lookup 1628 asc 16-may-81 15:40:01 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd LOOKUP 03/23/80 retrieve information from a symbol table .sy integer function lookup (symbol, info, table) character symbol (ARB) integer info (ARB) pointer table .fs 'Lookup' examines the symbol table given as its third argument for the presence of the character-string symbol given as its first argument. If the symbol is not present, 'lookup' returns 'NO'. If the symbol is present, the information associated with it is copied into the information array passed as the second argument to 'lookup', and 'lookup' returns 'YES'. .sp The symbol table used must have been created by the routine 'mktabl'. The size of the information array must be at least as great as the symbol table node size, specified at its creation. .sp Note that all symbol table routines use dynamic storage space, which must have been previously initialized by a call to 'dsinit'. .im 'Lookup' calls 'stlu' to determine the location of the symbol in the table. If 'stlu' returns NO, then the symbol is not present, and 'lookup' returns NO. Otherwise, 'lookup' copies the information field from the appropriate node of the symbol table into the information array and returns YES. .am info .ca stlu .sa enter (2), delete (2), mktabl (2), rmtabl (2), sctabl (2), dsinit (2), dsget (2), dsfree (2) #-h- mktabl 1574 asc 16-may-81 15:39:53 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd MKTABL 03/23/80 make a symbol table .sy pointer function mktabl (nodesize) integer nodesize .fs 'Mktabl' creates a symbol table for manipulation by the routines 'enter', 'lookup', 'delete', and 'rmtabl'. The symbol table is a general means of associating data with a symbol identified by a character string. The sole argument to 'mktabl' is the number of (integer) words of information that are to be associated with each symbol. The function return is the address of the symbol table in dynamic storage space (see 'dsinit' and 'dsget'). This value must be passed to the other symbol table routines to select the symbol table to be manipulated. .sp Note that dynamic storage space must be initialized by a call to 'dsinit' before using any symbol table routines. .im 'Mktabl' calls 'dsget' to allocate space for a hash table in dynamic memory. Each entry in the hash table is the head of a linked list (with zero used as a null link) of symbol table nodes. 'Mktabl' also records the nodesize specified by the user, so 'enter' will know how much space to allocate when a new symbol is entered in the table. .ca dsget .sa enter (2), lookup (2), delete (2), rmtabl (2), dsget (2), dsfree (2), dsinit (2), sctabl (2) #-h- mrkhlp 1207 asc 16-may-81 16:16:51 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd MRKHLP 03/23/80 mark help elements matching pattern .sy integer function mrkhlp(unit, ptrara, key, outara) linepointer ptrara(ARB), outara(ARB) integer unit character key(ARB) .fs `mrkhlp' goes through the set of archive modules pointed to by `ptrara' and copies those which match the pattern specified by `key' into `outara', terminating the list with an element having the value NULLPOINTER. If the key is one of the strings "%" or "?", all elements in `ptrara' are copied into `outara'; otherwise, only the module with a name which matches `key' exactly (via an `equal' call) is copied. If none of the modules match `key', ERR is returned; otherwise, OK is returned. .sa inihlp - initialize help archive for processing puthlp - output help archive modules specified equal - determine if two character strings are strictly equal .bu #-h- ngetch 854 asc 16-may-81 16:53:43 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd NGETCH 03/23/80 get a (possibly pushed back) character .sy character function ngetch(c, fd) character c integer fd .fs `ngetch' fetches the next character into the variable `c' and also returns it as its value. If there are any characters on the push back buffer, the most recently pushed back character will be returned and removed from the buffer. .sa putbak - push character onto push back buffer pbstr - push string onto push back buffer pbinit - initialize push back buffer .bu #-h- pbinit 757 asc 16-may-81 16:53:42 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd PBINIT 03/23/80 initialize push-back buffer .sy subroutine pbinit .fs `pbinit' permits the user to initialize the push-back buffer without knowledge of its implementation. After initialization, `ngetch', `putbak' and `pbstr' may be used. .sa ngetch - fetch a possibly pushed back character putbak - push character onto push-back buffer pbstr - push string back onto push-back buffer .bu #-h- pbstr 880 asc 16-may-81 16:53:46 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd PBSTR 03/23/80 push string onto push back buffer .sy subroutine pbstr(in) character in(ARB) .fs `pbstr' pushes the characters in the string `in' onto the push back buffer, from which they will be retrieved via future `ngetch' calls. If there is insufficient room in the buffer for the characters, an error message to that effect is displayed and the program terminated. .sa pbinit - initialize push back buffer putbak - push character onto push back buffer ngetch - get a (possibly pushed back) character .bu #-h- putbak 822 asc 16-may-81 16:53:45 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd PUTBAK 03/23/80 push character onto push back buffer .sy subroutine putbak(c) character c .fs `putbak' pushes `c' onto the push back buffer, from which it will be removed via a future `ngetch' call. If there is no room for the character, an error message will be displayed to that effect and the program terminated. .sa pbinit - initialize push back buffer pbstr - push string onto push back buffer ngetch - get a (possibly pushed back) character .bu #-h- putc 606 asc 16-may-81 16:41:57 [002,100] .bp 1 .in 0 .he 'PUTC (2)'11/10/78'PUTC (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br putc - write character to standard output .sp 1 .ti -7 SYNOPSIS .br .nf call putc (c) character c .fi .sp 1 .ti -7 DESCRIPTION .br Putc writes a character onto the standard output file (STDOUT). If c is a NEWLINE character, the appropriate action is taken to indicate the end of the record on the file. The character is assumed to be in ascii format; however, if the output file is not ascii, characters are mapped into their corresponding format. .sp 1 .ti -7 SEE ALSO .br putch, putlin .sp 1 .ti -7 DIAGNOSTICS .br None #-h- putdec 579 asc 16-may-81 16:41:58 [002,100] .bp 1 .in 0 .he 'PUTDEC (2)'11/13/78'PUTDEC (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br putdec - write integer n in field width >=w .sp 1 .ti -7 SYNOPSIS .br .nf call putdec(n, w) integer n, w .fi .sp 1 .ti -7 DESCRIPTION .br This routine writes onto the standard output the number 'n' as a string of at least 'w' characters, including a sign if 'n' is negative. If fewer than 'w' characters are needed, blanks are inserted to the left to make up the count; if more than 'w' are needed, more are provided. .sp 1 .ti -7 SEE ALSO .br itoc, putint .sp 1 .ti -7 DIAGNOSTICS .br None #-h- puthlp 1002 asc 16-may-81 16:16:53 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd PUTHLP 03/23/80 output marked modules from help archive .sy subroutine puthlp(unit, outara, key, out, putout) linepointer outara(ARB) integer unit, out character key(ARB) external putout .fs `puthlp' outputs the help archive entries marked in `outara' onto ratfor unit `out' using the external routine `putout' via calls of the form .ce call putout(buf, out) in a format depending upon `key'. If `key' is the string "%", only the first line of each marked entry is output; otherwise, the second through n-th lines of each entry is output. .sa inihlp - initialize help archive mrkhlp - mark help archive entries matching pattern .bu #-h- putint 731 asc 16-may-81 16:41:59 [002,100] .bp 1 .in 0 .he 'PUTINT (2)'7/23/80'PUTINT (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br putint - write integer n onto file fd in field width >=w .sp 1 .ti -7 SYNOPSIS .br .nf call putint(n, w, fd) integer n, w, fd .fi .sp 1 .ti -7 DESCRIPTION .br This routine writes on the file specified by 'fd' the number 'n' as a string of at least 'w' characters, including a sign if 'n' is negative. If fewer than 'w' characters are needed, blanks are inserted to the left to make up the count; if more than 'w' are needed, more are provided. If 'w' is negative, the number is left-justified in the field. .sp 'Fd' is a a file descriptor as returned by open or create. .sp 1 .ti -7 SEE ALSO .br itoc, putdec .sp 1 .ti -7 DIAGNOSTICS .br None #-h- putstr 737 asc 16-may-81 16:42:00 [002,100] .bp 1 .in 0 .he 'PUTSTR (2)'7/23/80'PUTSTR (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br putstr - write str onto file fd in field width >=w .sp 1 .ti -7 SYNOPSIS .br .nf call putstr(str, w, fd) character str(ARB) integer w, fd .fi .sp 1 .ti -7 DESCRIPTION .br Putstr writes the character string 'str' onto the file specified by 'fd', in a field at least 'w' characters long. If fewer than 'w' characters are needed, blanks are inserted to the left to make up the count; if more than 'w' are needed, more are provided. If 'w' is negative, the characters are left-justified in the field. .sp 'Fd' is a a file descriptor as returned by open or create. .sp 1 .ti -7 SEE ALSO .br putch, putlin, remark, error .sp 1 .ti -7 DIAGNOSTICS .br None #-h- query 1118 asc 16-may-81 16:42:01 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd QUERY 09/25/80 print command usage information on request .sy subroutine query (usage) hollerith_string usage (ARB) .fs Many Software Tools commands will supply usage information when invoked with a single argument consisting only of a question mark. 'Query' exists to simplify this convention for the programmer. .sp The sole argument is a period-terminated hollerith literal, such as that passed to 'error'. .sp When called, 'query' checks to see that the command calling it was invoked with exactly one argument, and that that argument is a question mark. If so, the usage message is passed along to 'error' and the command terminates. If not, 'query' returns quietly. .im Two calls to 'getarg', some tests, and a call to 'error'. .ca error .sa error (2) #-h- rawpmt 914 asc 16-may-81 16:24:02 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd RAWPMT 03/23/80 `prompt' with raw I/O capabilities .sy integer function rawpmt(pstr, buf, fd) character pstr(ARB), buf(MAXLINE) integer fd .fs `rawpmt' is semantically the same as `prompt' with the addition of providing word rubout and TENEX-style file recognition through the use of RAW terminal I/O. The writeup on `rsh', the raw shell may be consulted for the exact form of the special commands to cause `rawpmt' to perform these deeds. .sa `prompt' - prompt for input from teletype channels logpmt - `prompt' with history capabilities .bu #-h- rmtabl 1536 asc 16-may-81 15:39:55 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd RMTABL 03/23/80 remove a symbol table .sy subroutine rmtabl (table) pointer table .fs 'Rmtabl' is used to remove a symbol table created by 'mktabl'. The sole argument is the address of a symbol table in dynamic storage space, as returned by 'mktabl'. .sp 'Rmtabl' deletes each symbol still in the symbol table, so it is normally not necessary to empty a symbol table before deleting it. However, if the information associated with a symbol includes a pointer to dynamic storage space, the space will not be reclaimed. (This problem can be averted by scanning the symbol table with 'sctabl' and freeing dynamic objects, then removing the symbol table with 'rmtabl'.) .sp Please see the manual entry for 'dsinit' for instructions on initializing the dynamic storage space used by the symbol table routines. .im 'Rmtabl' traverses each chain headed by the hash table created by 'mktabl'. Each symbol table node encountered along the way is returned to free storage by a call to 'dsfree'. Once all symbols are removed, the hash table itself is returned by a similar call. .ca dsfree .sa mktabl (2), enter (2), lookup (2), delete (2), dsget (2), dsfree (2), dsinit (2), sctabl (2) #-h- scopy 443 asc 16-may-81 16:42:02 [002,100] .bp 1 .in 0 .he 'SCOPY (2)'11/13/78'SCOPY (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br scopy - copy string at from(i) to to(j) .sp 1 .ti -7 SYNOPSIS .br .nf call scopy(from, i, to, j) character from(ARB), to(ARB) integer i, j .fi .sp 1 .ti -7 DESCRIPTION .br Copies the (sub)string of 'from', starting in location 'i', into array 'to', starting at 'j'. .sp 1 .ti -7 SEE ALSO .br stcopy, addset, addstr, concat .sp 1 .ti -7 DIAGNOSTICS .br None #-h- sctabl 2504 asc 16-may-81 15:39:56 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .sp .ti -7 BUGS .br .en .hd SCTABL 03/16/80 scan all symbols in a symbol table .sy integer function sctabl (table, symbol, info, posn) pointer table, posn integer info (ARB) character symbol (ARB) .fs 'Sctabl' provides a means of accessing all symbols present in a symbol table (c.f. 'mktabl') without knowledge of the table's internal structure. After a simple initialization (see below), successive calls to 'sctabl' return symbols and their associated information. When the return value of 'sctabl' is EOF, the entire table has been scanned. .sp The first argument is the index in dynamic storage of the symbol table to be accessed. (This should be the value returned by 'mktabl'.) .sp The second and third arguments receive the character text of and integer information associated with the symbol currently under scan. .sp The fourth argument is used to keep track of the current position in the symbol table. It must be initialized to zero before 'sctabl' is called for the first time for a given scan. .sp The function return is EOF when the entire table has been scanned, not EOF otherwise. .im If 'posn' is zero, 'sctabl' assigns to it a pointer to a two word context block which was allocated along with the symbol table hash table entries. These words are used to keep track of (1) the hash table bucket currently in use and (2) the position in the bucket's list of the next symbol. If a symbol is available in the current list, 'sctabl' returns its data and records the position of the next symbol in the list; otherwise, it moves to the next bucket and examines that list. If there are no more buckets in the symbol table, EOF is returned as the function value. Incidentally, 'posn' is set to zero when the end of the table is encountered. .am symbol, info, posn .ca dsget, dsfree .bu A call to 'enter' must be made to update the information associated with a symbol. If new symbols are entered or old symbols deleted during a scan, the results are unpredictable. The argument order is bogus; all the other symbol table routines have the table pointer as the last argument. .sa lookup (2), delete (2), mktabl (2), rmtabl (2), dsget (2), dsfree (2), dsinit (2) #-h- strcpy 730 asc 16-may-81 17:10:07 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd STRCPY 03/23/80 copy one string to another .sy subroutine strcpy(from, to) character from(ARB), to(ARB) .fs `strcpy' simply copies the `from' string to the `to' string. It is exactly equivalent to "scopy(from, 1, to, 1)" but substantially easier to type and usually generates more compact and efficient Fortran code. .sa scopy - copy one string to another .bu #-h- tbinit 975 asc 16-may-81 17:02:31 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd TBINIT 03/23/80 initialize simple lookup table .sy subroutine tbinit(size) integer size .fs `tbinit' causes a symbol table to be created for the user by calling `mktabl' in anticipation of calling `tbinst' and `tblook', thus providing the same functionality as the old `lookup' and `instal' routines from rat4 without forcing the user to worry about the dynamic storage manipulation routines. `size' is the size of the dynamic storage region declared in the caller via .ce DS_DECL(Mem,size) .sa tbinst - install (name,defn) pair in lookup table tblook - lookup name in table and return defn if found .bu #-h- tbinst 815 asc 16-may-81 17:02:34 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd TBINST 03/23/80 install (name,defn) pair in lookup table .sy subroutine tbinst(name, defn) character name(ARB), defn(ARB) .fs `tbinst' installs the (name,defn) pair in the lookup table initialized by a `tbinit' call. If there is no room in the table, the message "in tbinst: no room for new definition." is displayed and control returned to the user. .sa tbinit - initialize simple lookup table tblook - look up name in simple lookup table .bu #-h- tblook 768 asc 16-may-81 17:02:33 [002,100] .de hd .bp 1 .in 0 .he '$1 (2)'$2'$1 (2)' .fo ''-#-'' .fi .in 7 .ti -7 NAME .br $1 - .en .de sy .sp 1 .ti -7 SYNOPSIS .br .nf .en .de fs .fi .sp .ti -7 DESCRIPTION .br .en .de im .sp .ti -7 IMPLEMENTATION .br .en .de sa .sp .ti -7 SEE ALSO .br .nf .en .de am .sp .ti -7 ARGUMENTS MODIFIED .br .en .de ca .sp .ti -7 CALLS .br .en .de bu .fi .sp .ti -7 BUGS .br .en .hd TBLOOK 03/23/80 look up name in simple lookup table .sy integer function tblook(name, defn) character name(ARB), defn(ARB) .fs `tblook' looks up `name' in the lookup table. If found, its definition is copied into `defn' and the value YES returned as the function value; otherwise, NO is returned. .sa tbinit - initialize simple lookup table tbinst - install (name,defn) pair into lookup table .bu