|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T u
Length: 2680 (0xa78) Types: TextFile Names: »util.h«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« └─⟦e5a54fb17⟧ └─⟦this⟧ »pp-5.0/h/util.h«
/* util.h: various useful utility definitions */ /* * @(#) $Header: /cs/research/pp/hubris/pp-beta/h/RCS/util.h,v 5.0 90/09/20 16:51:57 pp Exp Locker: pp $ * * $Log: util.h,v $ * Revision 5.0 90/09/20 16:51:57 pp * rcsforce : 5.0 public release * * */ #ifndef _H_UTIL #define _H_UTIL /* -- various common defines -- */ #include <stdio.h> /* -- minus the ctype stuff -- */ #include <ctype.h> #include <setjmp.h> #include <isode/psap.h> #include <errno.h> #include "config.h" #include "ll_log.h" /* -- declarations that should have been in the system files -- */ extern char *index (); extern char *malloc (); extern char *multcat (); extern char *multcpy (); extern char *rindex (); extern char *smalloc (); extern char *strcat (); extern char *strcpy (); extern char *strdup (); extern char *strncpy (); extern long lseek (); /* -- some common logical values -- */ #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #ifndef YES #define YES 1 #endif #ifndef NO #define NO 0 #endif #ifndef OK #define OK 0 #endif #ifndef DONE #define DONE 1 #endif #ifndef NOTOK #define NOTOK -1 #endif #ifndef MORE #define MORE 2 #endif #ifndef MAYBE #define MAYBE 1 #endif /* -- stdio extensions -- */ #ifndef lowtoup #define lowtoup(chr) (islower (chr) ? toupper (chr) : chr) #endif #ifndef uptolow #define uptolow(chr) (isupper (chr) ? tolower (chr) : chr) #endif #ifndef MIN #define MIN(a,b) (( (b) < (a) ) ? (b) : (a) ) #endif #ifndef MAX #define MAX(a,b) (( (b) > (a) ) ? (b) : (a) ) #endif #define isstr(ptr) ((ptr) != 0 && *(ptr) != '\0') #define isnull(chr) ((chr) == '\0') #define isnumber(c) ((c) >= '0' && (c) <= '9') /* -- provide a timeout facility -- */ extern jmp_buf _timeobuf; #define timeout(val) (setjmp(_timeobuf) ? 1 : (_timeout(val), 0)) /* -- some common extensions -- */ #define LINESIZE 512 /* -- max line length -- */ #define FILNSIZE 256 /* -- max filename length -- */ #define LOTS 1024 /* -- a max sort of thing -- */ #define MAXFORK 10 /* -- no. of times to try a fork() -- */ #ifndef NULLCP #define NULLCP ((char *)0) #define NULLVP ((char **)0) #endif #ifndef NULLFILE #define NULLFILE ((FILE *)0) #endif /* utctime stuff */ extern UTC time_t2utc (); extern time_t utc2time_t (); extern UTC utcdup (); extern UTC utcnow (); #define LOCK_FLOCK 0 #define LOCK_FCNTL 1 #define LOCK_FILE 2 #define LOCK_LOCKF 3 extern FILE *flckopen (); extern int flckclose (); #endif