>>>>>>>>>>>>>>>>>>> curs_help.c <<<<<<<<<<<<<<<< edit_help (label, menu) char *label, *menu; /* try to edit help for label from directory menu */ displ_help (label, menu) char *label, *menu; /* try to display help for label from directory menu */ FILE *find_help (label, menu) char *label; char *menu; /* Return file stream for label in menu. reference external variable HELP_DIR to find where to look below returns NULL if file can't be opened, if label or HELP_DIRS or menu are NULL, or if menu is the empty string (use "" for menu if there is to be no help for it save_bottom () /* stash the bottom two lines into a temp buffer */ restore_bottom (menu) char *menu; /* restore buffer to the bottom lines. if menu != NULL, try to see if it should highlight the ``M''s at beginnings of lines. Should look at standout, but it doesn't */ >>>>>>>>>>>>>>>>>>> curs_lib.c <<<<<<<<<<<<<<<< int win_prompt (wind, y, prompt, str, old, menu, help) WINDOW *wind; int y, menu; char *str, **old, *prompt, *help; /* prompt user for input. wind is the window to use y is the line to do it on (it will be done at column 0) prompt will be displayed user input will be returned in str (number of menu item selected will be returned by the call, also) old is the history list (menu list if menu) menu says if this is a menu item help names help information - directory if it is a menu, file if not a menu */ int win_string (wind, y, x, str, old, menu, help) /* read string from window "wind" at "y, x", into str */ /* allows limited editing */ /* return index of choice */ /* if old is null, use an internal table. if str is null, use internal str (only for menu) */ WINDOW *wind; int y, x, menu; char *str, **old, *help; >>>>>>>>>>>>>>>>>>> intro.c <<<<<<<<<<<<<<<< alphabetize_lists () /* alphabetize the function and variable lists */ do_alpha_ftn () /* Alphabetize the function name list (long_cmd_names) and adjust long_cmd_pointers and batch_cmd_pointers accordingly */ do_alpha_vbl () /* Alphabetize the variables according to variable_names, adjust variable_names accordingly introduce_function (name, i_ftn, b_ftn, def_binding) char *name; int (*i_ftn) (), (*b_ftn) (); unsigned int def_binding; /* introduce a function into the function handler. i_ftn is the interactive version, b_ftn is the batch version the def_binding will be installed */ var_node *introduce_variable (name, ptr, typ, hook, histry) char *name, **histry, *ptr; int typ, (*hook) (); /* Introduce a variable to the variable handler. name: text name by which it is to be accessed ptr: pointer to appropriate storage typ: variable type from "win-types.h" hook: function to run whenever variable is modified histry: use this storage as the history list. (if this is NULL, space will be allocated) */ >>>>>>>>>>>>>>>>>>> kbd.c <<<<<<<<<<<<<<<< unsigned char get_key (win) WINDOW *win; /* returns one "logical" key stroke from kbd - returns key or ku, kd, kr, kl references meta_next, literal_next, and the key remapping buffers */ Pause (level) int level; /* wait for user acknowlegment. if this session is not ``interactive'', and level != 0, then it will force a ``crash'' (good for batch mode) */ tty_mode () /* set terminal modes for glass tty */ full_screen_mode () /* put terminal modes back for full screen */ int meta_next () /* next character is to be metasized */ int literal_next () /* next character is not to be macro-expanded */ clean_bottom () /* erase the bottom of the screen */ >>>>>>>>>>>>>>>>>>> mapping.c <<<<<<<<<<<<<<<< static int bell () /* what else ??? */ map () /* interactively establish a key macro mapping */ do_map (key, stemp) /* set ``key'' code to be remapped into ``stemp'' */ text_map (map_chr, string) unsigned char *map_chr, *string; /* establish so tha key code indicated by the ``map_chr'' string should be macro mapped into ``string'' */ text_bind (mchr, ftn) unsigned char *mchr; char *ftn; /* set it up so that key indicated by string ``mchr'' will bound to ``ftn'' */ do_bind (chr, ftn_name) unsigned char *chr; char *ftn_name; /* establish binding for ``chr'' key code to ``fnt_name'' */ unbind () /* remove all bindings - then bind ``:'' to ``command-mode'' */ unbind_alpha () /* remove all alphabetic bindings */ unmap_alpha () /* remove all alphabetic macro maps */ unmap () /* remove all macro maps - - may inactivate cursors */ unsigned char *mapping_decode (c) unsigned char c; /* Return macro-expansion of character ``c'' - fully recursive return string is pointer to static space */ >>>>>>>>>>>>>>>>>>> w-open-file.c <<<<<<<<<<<<<<<< FILE *w_open_file (name, mode, history) char *name, *mode, **history; /* returns file pointer opened as requested name is default file name. if name is null, user is prompted. name is modified to reflect the actual name of the file opened. if name is a non-empty string, an open will be attempted before user is prompted o_mode is "w" or "r" (only first letter significant); if o_mode is "r", user continually prompted till file opened. if o_mode is "w", user is asked whether to append or overwrite if file already exists. file name can be: 1) a file name 2) name of a pipe (first character is ``!'') 3) network file (first character is ``:'', and ``:'' separates host name from remote file name) */ >>>>>>>>>>>>>>>>>>> intro-init.c <<<<<<<<<<<<<<<< /* allocate some things for standard use */ int nul_var; /* for @NONE variable set */ int bell () /* default binding for keys */ { putchar ('\007'); fflush (stdout); return; } bind_init () /* initialize the function and variable handlers attempt to map the cursor keys correctly attempt to bind */ >>>>>>>>>>>>>>>>>>> vars.c <<<<<<<<<<<<<<<< set_variable () /* Set a variable interactively */ var_initialize (argv) char **argv; /* initialize variable values from command tail (get pgm name) and init files (systemrc and user's) */ read_var_file (name) char *name; /* read a file containg ``VARNAME'' ``VALUE'' on each line if ``ignore_var_errors'', errors silently ignored; else, print error message */ text_set_variable (var_name, valu) char *var_name, *valu; /* Set variable referenced by var_name to a value intended by the text string valu. invoke variable hook if necessary var_node *find_var (name) char *name; /* Return pointer to variable node that has var name name must match EXACTLY if no match, return NULL */ >>>>>>>>>>>>>>>>>>> apropos.c <<<<<<<<<<<<<<<< apropos () /* show commands that reference the ``key'' string (input from kbd) */ run_apropos (string) /* show commands that reference the ``key'' string (key is string) */ >>>>>>>>>>>>>>>>>>> str-to-num.c <<<<<<<<<<<<<<<< int str_to_number (str) char *str; /* convert string ``str'' into an integer default is base 10 binary if first character is ``B'' octal if first character is ``0'' hex if first character is ``0'' and second character is ``X'' */ >>>>>>>>>>>>>>>>>>> str-cvt.c <<<<<<<<<<<<<<<< unsigned char *string_convert (old, new) unsigned char *old, *new; /* convert the text string ``old'' into ``binary'' string ``new'' does ``c'' like substitutions: \### - substitute octal value \n - new line \b - back space \s - space \M - meta the next character \Z - meta and control the next character ^ - control the next character */ >>>>>>>>>>>>>>>>>>> big-print.c <<<<<<<<<<<<<<<< big_print (str) char *str; /* display ``str'' on stdscr - justify it at the bottom */ >>>>>>>>>>>>>>>>>>> clib.c <<<<<<<<<<<<<<<< /* included in this unit are: int get_yes_no (prompt, default) char *prompt, *default prompts user with "prompt" if user types yes, y, t, true response - returns 1 if user types no, n, f, false response - returns 0 continually prompts user until answer is in set set "default" to NULL for no default answer case is not significant if user EOF's, returns according to default; if default not set, returns as FALSE char *uc_string (string) char *string converts string to all upper case letters returns pointer to string converted char *lc_string (string) char *string converts string to all lower case letters returns pointer to string converted char uc_char (character) char character returns upper case version of "character" char lc_char (character) char character returns lower case version of "character" int get_response (string, prompt, default) char *string, *prompt, *default prompts user with "prompt" if "default" is not NULL, it serves as default answer returns user response in "string" returns 0x0 if EOF, else 0x1 if user EOF's, returns default; if no default set, will return "" in string int get_input (string) char *string gets line of input from keyboard - strips nl from end returns 0x0 if EOF, else 0x1 int member (a, b, c, ...) char *a, *b, *c . . . list of character pointers is NULL terminated returns 1 if "a" is equal to any of terms, 0 if not int get_integer (prompt, min_good, default, max_good) char *prompt int min_good, default, max_good gets a digit of input from user, "default" is the default. response must be between min_good and max_good. float get_float (prompt, min_good, default, max_good) same as get_integer, but for floats char peek_char (file) FILE *file; returns next character that would be returned by a read to file. int strmatch (query, test) char *query, *test; returns true if running reg_ex query against test returns 1 char *emalloc (number) int number as malloc, but prints error message and dies if fails char *ecalloc (number, size) as above char *blstrip (string) char *string remove preliminary and trailing white spaces from "string" return pointer to the string char *new_string (string) char *string returns a pointer to a emalloc'ed block containing a copy of string */ int get_yes_no (prompt, in_default) /* returns 1 if user answers "YES" or "Y" or "TRUE" or "T" returns 0 if user answers "NO" or "N" or "FALSE" or "F" case is ignored if user EOF's, returns according to in_default or 0x0 */ char *uc_string (string) /* convert string to all uppercase returns pointer to converted string */ char uc_char (character) /* returns upper case of character */ char character; char *lc_string (string) /* convert string to all uppercase returns pointer to converted string */ char lc_char (character) /* returns lower case of character */ char character; int get_response (string, prompt, in_default) /* prompts user with prompt, returns his response. if , default is in_default. if in_default is NULL, then forces response. returns 1 if answered, 0 if EOF'ed string and in_default may be the same pointer */ char *string, *prompt, *in_default; int member (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) /* returns 0x1 if string a is equal to any of the subsequent arguments */ int get_integer (prompt, min_good, deflt, max_good) /* prompts user with "prompt" to enter a number response must be >= min_good and <= max_good */ char *prompt; int min_good, deflt, max_good; float get_float (prompt, min_good, deflt, max_good) /* prompts user with "prompt" to enter a number response must be >= min_good and <= max_good */ char *prompt; float min_good, deflt, max_good; char *emalloc (n_elements) /* runs malloc. dies if malloc fails */ int n_elements; char *ecalloc (n_elements, element_size) /* runs calloc. dies if calloc dies */ int n_elements, element_size; >>>>>>>>>>>>>>>>>>> decode.c <<<<<<<<<<<<<<<< /* in this module: int decode (query, t1, t2, t3, t4 . . .) all char * - term arg with NULL test query against each arg - return -1 if ambiguous return -2 if not found return indx if found unique t1 is #0 int vdecode (query, list) char *query, **list as decode, for pre-vectorized list int svdecode (query, list) char *query, **list as vdecode, uses strncmp rather than regex */ int decode (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) /* a is the query. returns index of unique member matching string a returns -1 if ambiguous, -2 if not found. string b is considered to be index 0 */ char *a, *b, *c, *d, *e, *f, *g, *h, *i, *j, *k, *l, *m, *n, *o, *p, *q, *r, *s, *t, *u, *v, *w, *x, *y, *z; int svdecode (a, vec) char *a, **vec; /* similar to vdecode, but use strncmp - - no regex */ >>>>>>>>>>>>>>>>>>> help.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> rdseq.c <<<<<<<<<<<<<<<< /* this unit contains the subroutines: rdseq to ask user for name of file and locus, then fetches it, and splices next_locus gets next locus contained in an open file, puts file pointer at start of sequence get_sequence gets next part of sequence in an opened file write_sequence output sequence - put into 70 chars per line rdseq (filnam, afnam, locus, alocus, max, len, seq, frgdsc, all) char *filnam, *locus, *seq, *frgdsc; int afnam, alocus, max, *len, all; next_locus (finp, locus) char *locus; FILE *finp; get_sequence (inseq, finp, len, max) char *inseq; FILE *finp; int *len, max; write_sequence (seq, fout) char *seq; FILE *fout */ rdseq (filnam, afnam, locus, alocus, max, len, seq, frgdsc, all) char *filnam, *locus, *seq, *frgdsc; int afnam, alocus, max, *len, all; /* filnam inputs default file name, outputs actual file name used. if alocus == 0 and filnam is not a null string, the user will not be prompted for a new file name. locus inputs default file name, outputs actual file name used. if alocus == 0 and filnam is not a null string, the user will not be prompted for a new file name. max inputs the maximum sequence that can be read in. len returns the length of the sequence as extracted seq is the array that returns the input sequence frgdsc contains character string defining extracted string comments are completely ignored */ next_locus (finp, locus) char *locus; FILE *finp; /* advances pointer on finp to point to the next sequence. pointer is left pointing to the first line past the locus line. locus is returned containing the locus name. returns TRUE if a locus was found, FALSE if the end of the file was met before a locus was found ASSUMES that there will be at least one comment line before the locus name appears */ get_sequence (inseq, finp, len, max) char *inseq; FILE *finp; int *len, max; /* reads the remainder of a sequence, up to max length. returns TRUE if some sequence was read, FALSE if no sequence information was found */ write_sequence (seq, fout) char *seq; FILE *fout; >>>>>>>>>>>>>>>>>>> lsearch.c <<<<<<<<<<<<<<<< /* in this module: xlsearch (string, list) char *string, **list; returns index of string within list. if string does not occur, appends it by using new_string to allocate space, then returns index of this entry To emulate the call from systemV - sort of */ xlsearch (strng, vec) char *strng, **vec; /* returns offset within vec of strng, according to strcmp if strng is not found, it is appended to vec. vec is NULL terminated */ >>>>>>>>>>>>>>>>>>> adecode.c <<<<<<<<<<<<<<<< /* this module includes adecode (query, choices, matches, base char *query, **choices; int *matches, base; fils in matches with indices of those who matched returns -1 if ambiguous, -2 if not found, index of choice if unambiguous */ int adecode (query, choices, matches, base) /* determines which members of choices that query matches, sets "matches" to contain those elements that matched. for numeric items, 'base' is subtracted from the user response before the item is placed in the array returns: -1 if query is ambiguous -2 if query matched no choices #of choice if unambiguous fills in matches array with things matched, terminates list with "-" */ char *query, **choices; int *matches, base; >>>>>>>>>>>>>>>>>>> string_subst.c <<<<<<<<<<<<<<<< /* this unit contains a set of subroutines that deal with alias substitution. They are: char *get_alias (string, aliases, substitutes) expands the alias "string" - returns it's substitution. if it is not found, returns NULL. upon return, pgm MUST NOT modify the the substituted string add_alias (new_alias, new_substitute, aliases, substitutes) adds a new alias to the lists. if alias exists, it the new will replace the old assumes that the lists are large enough. allocates space for the new entries via malloc char *alias_expand (string, aliases, substitutes) returns pointer to string which has aliases replaced of string - - aliases introduced with "ALIAS_CHAR", terminated by space or EOS, or "ALIAS_CHAR" - RECURSIVE ! ! ! returned string allocated via malloc () - free when finished show_aliases (aliases, substitutes) display current aliasing */ char *get_alias (string, aliases, substitutes) /* expands the alias "string" - returns it's substitution. if it is not found, returns NULL. upon return, pgm MUST NOT modify the the substituted string */ char **aliases, **substitutes; add_alias (new_alias, new_substitute, aliases, substitutes) /* adds a new alias to the lists. if alias exists, it the new will replace the old assumes that the lists are large enough. allocates space for the new entries via malloc */ char *new_alias, *new_substitute, **aliases, **substitutes; char *alias_expand (string, aliases, substitutes) /* returns pointer to string which has aliases replaced of string - - aliases introduced with "ALIAS_CHAR", terminated by space or EOS, or "ALIAS_CHAR" - RECURSIVE ! ! ! returned string allocated via malloc () - free when finished */ char *string, **aliases, **substitutes; show_aliases (aliases, substitutes) /* Display the current aliases for the user to see */ char **aliases, **substitutes; >>>>>>>>>>>>>>>>>>> name-expander.c <<<<<<<<<<<<<<<< name_expander (inp, outlist) char **inp, **outlist; /* expands the list from inp to outlist wild cards are expanded. uses the BSD re_exec package - WILL ZAP COMPILED PATTERNS ! ! ! if file names begins with ``@'', it is an indirect file - a list of filespecs (recursive) if DATA environment set, and the file name does not begin with a ``.'' or a ``/'', then the file will be searched for ONLY in the directories specified in the DATA environment. DATA path elements WILL NOT BE WILD CARD EXPANDED ! ! ! */ static name_part (front, iback, outlistp) char *front, *iback; char ***outlistp; /* front is a directory, iback is the remaining filespec file hits will be appended to outlist DIRECTORIES WILL NOT BE PUT INTO OUTLIST ! ! */ parse (name, list, delim, inc) char *name, **list, delim; int inc; /* no longer used in name_expander */ is_a_file (name) char *name; /* returns 1 if ``name'' is a file, 0 if not */ static do_indirect (name, outlistp) char *name, ***outlistp; /* handle the indirect files */ /* BEWARE OF SPACES IN FILESPECS ! ! ! NO GO */ /*ENDOC*/ fscanf (finp, "%s", buf); yuk [0] = buf; /* the individual elements will be expanded - so can be recursive */ is_a_dir (name) char *name; /* returns 1 if ``name'' is a file, 0 if not */ >>>>>>>>>>>>>>>>>>> usage.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> daemonize.c <<<<<<<<<<<<<<<< daemonize () /* make the current process a daemon. closes stdin */ >>>>>>>>>>>>>>>>>>> strrev.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> open_file.c <<<<<<<<<<<<<<<< FILE *nread (); FILE *open_file (name, o_mode) /* returns file pointer opened as requested name is default file name. if name is null, user is prompted. name is modified to reflect the actual name of the file opened. if name is a non-empty string, an open will be attempted before user is prompted o_mode is "w" or "r" (only first letter significant); if o_mode is "r", user continually prompted till file opened. if o_mode is "w", user is asked whether to append or overwrite if file already exists. file name can be: 1) a file name 2) name of a pipe (first character is ``!'') 3) network file (first character is ``:'', and ``:'' separates host name from remote file name) */ char *name, *o_mode; >>>>>>>>>>>>>>>>>>> nread.c <<<<<<<<<<<<<<<< FILE *nread (host, fname) char *host, *fname; >>>>>>>>>>>>>>>>>>> regex.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> regex-aux.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> regex-parse.c <<<<<<<<<<<<<<<< char *re_parse (src, dest) char *src, *dest; /* parse the repeat factors from src to a gnu-emacs regex string in dest repeat factors are a la SystemV */ >>>>>>>>>>>>>>>>>>> mkstemp.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> usleep.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> backup.c <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>> settty.c <<<<<<<<<<<<<<<<