AcePerl

 view release on metacpan or  search on metacpan

acelib/wh/regular.h  view on Meta::CPAN

typedef unsigned char UCHAR ; /* for convenience */

typedef unsigned int KEY ;

typedef void (*VoidRoutine)(void) ;
typedef void (*Arg1Routine)(void *arg1) ;

/* magic_t : the type that all magic symbols are declared of.
   They become magic (i.e. unique) by using the pointer
   to that unique symbol, which has been placed somewhere
   in the address space by the compiler */
/* type-magics and associator codes are defined at
   magic_t MYTYPE_MAGIC = "MYTYPE";
   The address of the string is then used as the unique 
   identifier (as type->magic or graphAssXxx-code), and the
   string can be used during debugging */
typedef char* magic_t;



typedef struct freestruct
  { KEY  key ;
    char *text ;
  } FREEOPT ;


/*---------------------------------------------------------------------*/
/* The free package for reading from files/stdout, see freesubs.c      */
/*                                                                     */

UTIL_FUNC_DCL void freeinit (void) ;
UTIL_FUNC_DCL int freeCurrLevel(void) ;			    /* Returns current level. */
UTIL_FUNC_DCL char* freecard (int level) ;	/* 0 if below level (returned by freeset*) */
UTIL_FUNC_DCL void freecardback (void) ;  /* goes back one card */
UTIL_FUNC_DCL void freeforcecard (char *string);
UTIL_FUNC_DCL int  freesettext (char *string, char *parms) ; /* returns level to be used in freecard () */
UTIL_FUNC_DCL int  freesetfile (FILE *fil, char *parms) ;
UTIL_FUNC_DCL int  freesetpipe (FILE *fil, char *parms) ;  /* will call pclose */
UTIL_FUNC_DCL void freeclose(int level) ; /* closes the above */
UTIL_FUNC_DCL void freespecial (char *set) ;	/* set of chars to be recognized from "\n;/%\\@$" */
UTIL_FUNC_DCL BOOL freeread (FILE *fil) ;	/* returns FALSE if EOF */
UTIL_FUNC_DCL int  freeline (FILE *fil) ;	/* line number in file */
UTIL_FUNC_DCL int  freestreamline (int level) ;/* line number in stream(level)*/
UTIL_FUNC_DCL char *freeword (void) ;

#if defined(WIN32)  /* A variation to correctly parse MS DOS/Windows pathnames */
UTIL_FUNC_DCL   char *freepath (void) ;
#else	/* NOT defined(WIN32) */
#define freepath freeword  /* freeword() works fine if not in WIN32 */
#endif	/* defined(WIN32) */

UTIL_FUNC_DCL char *freewordcut (char *cutset, char *cutter) ;
UTIL_FUNC_DCL void freeback (void) ;		/* goes back one word */
UTIL_FUNC_DCL BOOL freeint (int *p) ;
UTIL_FUNC_DCL BOOL freefloat (float *p) ;
UTIL_FUNC_DCL BOOL freedouble (double *p) ;
UTIL_FUNC_DCL BOOL freekey (KEY *kpt, FREEOPT *options) ;
UTIL_FUNC_DCL BOOL freekeymatch (char *text, KEY *kpt, FREEOPT *options) ;
UTIL_FUNC_DCL void freemenu (void (*proc)(KEY), FREEOPT *options) ;
UTIL_FUNC_DCL char *freekey2text (KEY k, FREEOPT *o)  ;  /* Return text corresponding to key */
UTIL_FUNC_DCL BOOL freeselect (KEY *kpt, FREEOPT *options) ;
UTIL_FUNC_DCL BOOL freelevelselect (int level,
				    KEY *kpt, FREEOPT *options);
UTIL_FUNC_DCL void freedump (FREEOPT *options) ;
UTIL_FUNC_DCL BOOL freestep (char x) ;
UTIL_FUNC_DCL void freenext (void) ;
UTIL_FUNC_DCL BOOL freeprompt (char *prompt, char *dfault, char *fmt) ;/* gets a card */
UTIL_FUNC_DCL BOOL freecheck (char *fmt) ;	/* checks remaining card fits fmt */
UTIL_FUNC_DCL int  freefmtlength (char *fmt) ;
UTIL_FUNC_DCL BOOL freequery (char *query) ;
UTIL_FUNC_DCL char *freepos (void) ;		/* pointer to present position in card */
UTIL_FUNC_DCL char *freeprotect (char* text) ; /* protect so freeword() reads correctly */
UTIL_FUNC_DCL char* freeunprotect (char *text) ; /* reverse of protect, removes \ etc */

UTIL_VAR_DCL char FREE_UPPER[] ;
#define freeupper(x)	(FREE_UPPER[(x) & 0xff])  /* table is only 128 long */

UTIL_VAR_DCL char FREE_LOWER[] ;
#define freelower(x)	(FREE_LOWER[(x) & 0xff])




/**********************************************************************/
/******************** message routines - messubs.c ********************/
/**********************************************************************/

/* 'Internal' functions, do not call directly.                               */
UTIL_FUNC_DCL void uMessSetErrorOrigin(char *filename, int line_num) ;
UTIL_FUNC_DCL void uMessCrash(char *format, ...) ;

/* External Interface.                                                       */
/* Note that messcrash is a macro and that it makes use of the ',' operator  */
/* in C. This means that the messcrash macro will only produce a single C    */
/* statement and hence can be used within brackets etc. and will not break   */
/* existing code, e.g.                                                       */
/*                     funcblah(messcrash("hello")) ;                        */
/* will become:                                                              */
/* funcblah(uMessSetErrorOrigin(__FILE__, __LINE__), uMessCrash("hello")) ;  */
/*                                                                           */

UTIL_FUNC_DEF void messErrorInit (char *progname) ; /* Record the
					 applications name for use
					 in error messages, etc */
UTIL_FUNC_DEF char *messGetErrorProgram (void) ; /* Returns the
						    application name */

UTIL_FUNC_DCL char *messprintf (char *format, ...) ;	  
				/* sprintf into (static!) string */
				/* !!!! beware finite buffer size !!!! */

UTIL_FUNC_DCL void messbeep (void) ; /* make a beep */

UTIL_FUNC_DCL void messout (char *format, ...) ;  /* simple message */
UTIL_FUNC_DCL void messdump (char *format, ...) ; /* write to log file */
UTIL_FUNC_DCL void messerror (char *format, ...) ; /* error message and write to log file */
UTIL_FUNC_DCL void messExit(char *format, ...) ;  /* error message, write to log file & exit */
#define messcrash   uMessSetErrorOrigin(__FILE__, __LINE__), uMessCrash
						  /* abort - but see below */
UTIL_FUNC_DCL BOOL messQuery (char *text,...) ;	  /* ask yes/no question */
UTIL_FUNC_DCL BOOL messPrompt (char *prompt, char *dfault, char *fmt) ;
	/* ask for data satisfying format get results via freecard() */



( run in 0.665 second using v1.01-cache-2.11-cpan-39bf76dae61 )