DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T a

⟦f05611ffc⟧ TextFile

    Length: 3425 (0xd61)
    Types: TextFile
    Names: »argh.h«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/h/argh.h« 

TextFile

/* argh.h: Used by the mu program */

/*
 * @(#) $Header: /cs/research/pp/hubris/pp-beta/h/RCS/argh.h,v 5.0 90/09/20 16:49:40 pp Exp Locker: pp $
 *
 * $Log:	argh.h,v $
 * Revision 5.0  90/09/20  16:49:40  pp
 * rcsforce : 5.0 public release
 * 
 *
 */



#ifndef _H_ARGH
#define _H_ARGH



#define ARGHVER         "argh v. 1.1"   /* Version number */
#define MAXARGS         100     /* Maximum argument instances provided for */
#define MAXFLAGS        50      /* Maximum number of flags
				   needed to size sorting array argsort[] */
#define FLAGCHAR        '-'     /* introduces a flag on command line */
#define EQUCHAR         '='     /* to separate a partial but
				   unambiguous flag from its value */
#define MAXFLAGLEN      30                      /* max flag length */
#define VALIDTYPES      "0123456789amnz?"       /* allowed flag types */
#define ADJARGS         TRUE                    /* allow adjacent args */
#define ONECHARARGS     FALSE                   /* allow unambiguous one-byte flags without EQUCHAR */
#define ZEROCHECK       FALSE                   /* test type '0' against next arg */

int     flagcount;      /* Count from calling-program-specific table */
int     argcpi;         /* Current parameter index */
int     argsource;      /* Current argument source */

void    add_link();
void    take_next();
void    arg_error();
void    show_args();
void    call_args();
void    list_args();
void    quick_string();
void    qs_string();

int     scan_args();
int     prep_args();
int     count_to_flag();

char    *next_arg();
char    *nextc_arg();
char    *digit_word();

struct  arginst {               /* instance of one argument type */
	char    *argcp;         /* character pointer */
	int     argci;          /* argument counter e.g. argv[ai->argci] */
	int     argoi;          /* offset e.g. argv[ai->argci][ai->argoi] */
	int     argn;           /* instance in this run */
	int     argof;          /* ... of total instances in this run */
	int     argsrc;         /* source - i.e. which call to scan_args */
	int     argused;        /* used marker TRUE -> has been used */
	struct  arginst *next;  /* linked list */
};

struct  argdef {                /* user supplied flag list */
	char    *flag;          /* see below */
	void    (*function)();
	char    type;
	int     match;
};

struct  argfull {               /* argument ( flag ) definitions */

/*      char    flag[MAXFLAGLEN];       character(s) to follow '-' */
	char    *flag;          /* character(s) to follow '-' */

	void    (*function)();  /* to hold pointer to function */

	char    type;           /*      a : valued : adjacent to flag
					n : valued : next argument
					0 : lone ( no assoc. value )
					1 : valued : adjacent or next
					2 : as v but takes 2 args
					3 : as v but takes 3 args
					... etc. (up to 9)
					m : 1 or more ( up to next flag )
					z : as m but zero args allowed */

	int     match;          /* Minimum length for unambiguous
				   matching. These can be calculated
				  >0 indicates length to use
				   0 indicates calculation reqd.
				  -1 indicates exact match reqd.
				   If matching allowed, type a is not.
				   nor v(adjacent) less than
				   strlen(flag) unless EQUCHAR used */

	int     length;         /* length of flag */
	int     count;                  /* how many instances */
	struct  arginst *first,*last;   /* pointers to first, last instance */
};


#endif