Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!ima!inmet!rgh From: rgh@inmet.UUCP Newsgroups: net.lang.c Subject: Re: Re: C portability between non-UNIX o Message-ID: <1803@inmet.UUCP> Date: Sat, 10-Nov-84 01:51:53 EST Article-I.D.: inmet.1803 Posted: Sat Nov 10 01:51:53 1984 Date-Received: Sat, 10-Nov-84 10:23:09 EST Lines: 62 Nf-ID: #R:munnari:-55200:inmet:5000029:000:2126 Nf-From: inmet!rgh Nov 8 19:26:00 1984 The ANSI C standards committee is addressing library standardization as well as language issues. To give you the flavor of what's being discussed, here's the standard header files, and a few sample declarations in each, from working drafts: #define assert(expression) ??? /* complain if expression==0, unless the macro NDEBUG is defined */ int isalpha(int); int tolower(int); /* etc. */ double sin(double); /* acos,asin,fmod,log,sqrt,tanh,fabs,etc. */ /* domain or range errors will post EDOM or ERANGE to errno */ /* etc. */ FILE * fopen(char *filename, char *mode); int sscanf(char *buffer, char *format, ...); /* format characters for printf/scanf/... are defined */ /* defines an l-value errno, which is used for posting error codes */ /* etc. */ -- general utility functions typedef ??? size_type; /* int big enough to hold size of object*/ void *calloc(unsigned int, size_type); void abort(); int atoi(char *); void exit(int); /* etc. */ typedef ??? jmp_buf; /* jmp_buf is an array */ int setjmp(jmp_buf); void longjmp(jmp_buf,int); char *strcat(char *, char *); size_type strlen(char *); /* etc. */ struct tm { int tm_sec, tm_min /* , etcetera */ ; int tm_isdst /* nonzero for daylight savings time */ /* etc. */ } typedef /*some_int_type*/ time_t; char * asctime(struct tm *); struct tm *localtime(time_t *); /* convert to local time */ double difftime(time_t, time_t); /* difference in seconds */ /* etc. */ -- to handle variable-length argument lists #define va_list ??? #define va_start(ap, parmN, type) ??? #define va_arg(ap, type) ??? #define va_end(ap) ??? "Unless explicitly stated otherwise, any function or object declared in a header may be redefined as a macro, within the header ... . Unless explicitly stated otherwise, any macro ... will expand to code that evaluates each of its arguments once ... ." Randy Hudson {ihnp4,harpo,ima}!inmet!rgh