[comp.lang.c] Lint libraries for dpANS C and POSIX?

rsalz@bbn.com (Rich Salz) (01/06/89)

[ Wow, source code in alt.sources... ]

    This package is based on the X3J11 Draft of May 13, 1988.  It was
    written Rich $alz <rsalz@bbn.com> in January, 1989, who put it in the
    public domain.

    This package contains minimal header files and lint(1) library
    specification for "ANSI C."  Technically, there is no such thing as
    ANSI C yet; it's still in the "draft" stage.  It's unlikely to change
    very much, however, so I went ahead and used what I had.

    It's not clear how useful this will be to anyone -- if you've got an
    ANSI C compiler you probably don't need this.  Still and all,
    I found it useful, so somebody else might, too.

    When X3J11 is accepted by ANSI as a standard, then I might post
    this in comp.sources.unix, so if you find any errors or corrections
    please mail them to me, either at BBN or at uunet!rsalz.

    I'd be very interested in seeing something similar for IEEE Posix,
    hint! hint!
	/rich $alz

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  README errno.h float.h limits.h locale.h math.h setjmp.h
#   signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h ansilib.c
# Wrapped by rsalz@fig.bbn.com on Thu Jan  5 18:00:40 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(933 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X
X    This package is based on the X3J11 Draft of May 13, 1988.  It was
X    written Rich $alz <rsalz@bbn.com> in January, 1989, who put it in the
X    public domain.
X
X    This package contains minimal header files and lint(1) library
X    specification for "ANSI C."  Technically, there is no such thing as
X    ANSI C yet; it's still in the "draft" stage.  It's unlikely to change
X    very much, however, so I went ahead and used what I had.
X
X    It's not clear how useful this will be to anyone -- if you've got an
X    ANSI C compiler you probably don't need this.  Still and all,
X    I found it useful, so somebody else might, too.
X
X    When X3J11 is accepted by ANSI as a standard, then I might post
X    this in comp.sources.unix, so if you find any errors or corrections
X    please mail them to me, either at BBN or at uunet!rsalz.
X
X    I'd be very interested in seeing something similar for IEEE Posix,
X    hint! hint!
X	/rich $alz
END_OF_FILE
if test 933 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'errno.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'errno.h'\"
else
echo shar: Extracting \"'errno.h'\" \(428 characters\)
sed "s/^X//" >'errno.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_ERRNO_H_
X#define _HAVE_ERRNO_H_
X
X#define EDOM		(0)
X#define ERANGE		(0)
Xextern int errno;
X#endif	/* _HAVE_ERRNO_H_ */
END_OF_FILE
if test 428 -ne `wc -c <'errno.h'`; then
    echo shar: \"'errno.h'\" unpacked with wrong size!
fi
# end of 'errno.h'
fi
if test -f 'float.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'float.h'\"
else
echo shar: Extracting \"'float.h'\" \(1100 characters\)
sed "s/^X//" >'float.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_FLOAT_H_
X#define _HAVE_FLOAT_H_
X
X#define FLT_RADIX	(2)
X#define FLT_MANT_DIG	(6)
X#define DBL_MANT_DIG	(6)
X#define LDBL_MANT_DIG	(10)
X#define FLT_DIG		(6)
X#define DBL_DIG		(10)
X#define LDBL_DIG	(10)
X#define FLT_MIN_EXP	(-125)
X#define DBL_MIN_EXP	(-125)
X#define LDBL_MIN_EXP	(-125)
X#define FLT_MIN_10_EXP	(-37)
X#define DBL_MIN_10_EXP	(-37)
X#define LDBL_MIN_10_EXP	(-37)
X#define FLT_MAX_EXP	(128)
X#define DBL_MAX_EXP	(128)
X#define LDBL_MAX_EXP	(128)
X#define FLT_MAX_10_EXP	(37)
X#define DBL_MAX_10_EXP	(37)
X#define LDBL_MAX_10_EXP	(37)
X#define FLT_MAX		(1e37)
X#define DBL_MAX		(1e37)
X#define LDBL_MAX	(1e37)
X#define FLT_EPSILON	(1e-5)
X#define DBL_EPSILON	(1e-9)
X#define LDBL_EPSILON	(1e-9)
X#define FLT_MIN		(1e-37)
X#define DBL_MIN		(1e-37)
X#define LDBL_MIN	(1e-37)
X
X#endif	/* _HAVE_FLOAT_H_ */
END_OF_FILE
if test 1100 -ne `wc -c <'float.h'`; then
    echo shar: \"'float.h'\" unpacked with wrong size!
fi
# end of 'float.h'
fi
if test -f 'limits.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'limits.h'\"
else
echo shar: Extracting \"'limits.h'\" \(787 characters\)
sed "s/^X//" >'limits.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_LIMITS_H_
X#define _HAVE_LIMITS_H_
X
X#define CHAR_BIT	(8)
X#define SCHAR_MIN	(-127)
X#define SCHAR_MAX	(127)
X#define UCHAR_MAX	(255)
X#define CHAR_MIN	(0)
X#define CHAR_MAX	(UCHAR_MAX)
X#define MB_LEN_MAX	(1)
X#define SHRT_MIN	(-32767)
X#define SHRT_MAX	(32767)
X#define USHRT_MAX	(65535)
X#define INT_MIN		(-32767)
X#define INT_MAX		(32767)
X#define UINT_MAX	(65535)
X#define LONG_MIN	(-214748367)
X#define LONG_MAX	(2147483647)
X#define ULONG_MAX	(4294967295)
X
X#endif	/* _HAVE_LIMITS_H_ */
END_OF_FILE
if test 787 -ne `wc -c <'limits.h'`; then
    echo shar: \"'limits.h'\" unpacked with wrong size!
fi
# end of 'limits.h'
fi
if test -f 'locale.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'locale.h'\"
else
echo shar: Extracting \"'locale.h'\" \(813 characters\)
sed "s/^X//" >'locale.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_LOCALE_H_
X#define _HAVE_LOCALE_H_
X
Xstruct lconv {
X    char *decimal_point;
X    char *thousands_sep;
X    char *grouping;
X    char *int_curr_symbol;
X    char *mon_decimal_point;
X    char *mon_thousands_sep;
X    char *mon_grouping;
X    char *positive_sign;
X    char *negative_sign;
X    char int_frac_digits;
X    char frac_digits;
X    char p_cs_precedes;
X    char p_sep_by_space;
X    char n_cs_precedes;
X    char n_sep_by_space;
X    char p_sign_post;
X    char n_sign_post;
X};
X
X#endif	/* _HAVE_LOCALE_H_ */
END_OF_FILE
if test 813 -ne `wc -c <'locale.h'`; then
    echo shar: \"'locale.h'\" unpacked with wrong size!
fi
# end of 'locale.h'
fi
if test -f 'math.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'math.h'\"
else
echo shar: Extracting \"'math.h'\" \(399 characters\)
sed "s/^X//" >'math.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_MATH_H_
X#define _HAVE_MATH_H_
X
X#define HUGE_VAL ((double)1)
X
X#endif	/* _HAVE_MATH_H_ */
END_OF_FILE
if test 399 -ne `wc -c <'math.h'`; then
    echo shar: \"'math.h'\" unpacked with wrong size!
fi
# end of 'math.h'
fi
if test -f 'setjmp.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'setjmp.h'\"
else
echo shar: Extracting \"'setjmp.h'\" \(400 characters\)
sed "s/^X//" >'setjmp.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_SETJMP_H_
X#define _HAVE_SETJMP_H_
X
Xtypedef int jmp_buf[1];
X
X#endif	/* _HAVE_SETJMP_H_ */
END_OF_FILE
if test 400 -ne `wc -c <'setjmp.h'`; then
    echo shar: \"'setjmp.h'\" unpacked with wrong size!
fi
# end of 'setjmp.h'
fi
if test -f 'signal.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'signal.h'\"
else
echo shar: Extracting \"'signal.h'\" \(624 characters\)
sed "s/^X//" >'signal.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_SIGNAL_H_
X#define _HAVE_SIGNAL_H_
X
Xtypedef int sig_atomic_c;
X#define SIG_DFL		((void (*)())0)
X#define SIG_ERR		((void (*)())1)
X#define SIG_INT		((void (*)())2)
X#define SIGABRT		(3)
X#define SIGFPE		(4)
X#define SIGILL		(5)
X#define SIGINT		(6)
X#define SIGSEGV		(7)
X#define SIGTERM		(8)
X
X#endif	/* _HAVE_SIGNAL_H_ */
END_OF_FILE
if test 624 -ne `wc -c <'signal.h'`; then
    echo shar: \"'signal.h'\" unpacked with wrong size!
fi
# end of 'signal.h'
fi
if test -f 'stdarg.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'stdarg.h'\"
else
echo shar: Extracting \"'stdarg.h'\" \(500 characters\)
sed "s/^X//" >'stdarg.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_STDARG_H_
X#define _HAVE_STDARG_H_
X
Xtypedef char *va_list;
X#define va_start(ap, arg)	((void)0)
X#define va_arg(ap, type)	((type)0)
X#define va_end(ap)		((void)0)
X
X#endif	/* _HAVE_STDARG_H_ */
END_OF_FILE
if test 500 -ne `wc -c <'stdarg.h'`; then
    echo shar: \"'stdarg.h'\" unpacked with wrong size!
fi
# end of 'stdarg.h'
fi
if test -f 'stddef.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'stddef.h'\"
else
echo shar: Extracting \"'stddef.h'\" \(637 characters\)
sed "s/^X//" >'stddef.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_STDDEF_H_
X#define _HAVE_STDDEF_H_
X
Xtypedef int ptrdiff_t;
Xtypedef int size_t;
Xtypedef int wchar_t;
X#define NULL		(0)
X#define offsetof(type, member_designator)	((size_t)0)
X
X#define __LINE__	1
X#define __FILE__	"rsalz.c"
X#define __DATE__	"FEb 10 1960"
X#define __TIME__	"10:15:30"
X#define __STDC__	1
X
X#endif	/* _HAVE_STDDEF_H_ */
END_OF_FILE
if test 637 -ne `wc -c <'stddef.h'`; then
    echo shar: \"'stddef.h'\" unpacked with wrong size!
fi
# end of 'stddef.h'
fi
if test -f 'stdio.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'stdio.h'\"
else
echo shar: Extracting \"'stdio.h'\" \(782 characters\)
sed "s/^X//" >'stdio.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_STDIO_H_
X#define _HAVE_STDIO_H_
X
X#include <stddef.h>
Xtypedef struct { char c; } FILE;
Xtypedef int fpos_t;
X#define _IOFBF		(0)
X#define _IOLBF		(1)
X#define _IONBF		(2)
X#define BUFSIZ		(128)
X#define EOF		(-1)
X#define FOPEN_MAX	(20)
X#define FILENAME_MAX	(512)
X#define L_tmpnam	(24)
X#define SEEK_CUR	(0)
X#define SEEK_END	(1)
X#define SEEK_SET	(2)
X#define TEMP_MAX	(8)
X#define stderr	((FILE *)0)
X#define stdin	((FILE *)0)
X#define stdout	((FILE *)0)
X
X#endif	/* _HAVE_STDIO_H_ */
END_OF_FILE
if test 782 -ne `wc -c <'stdio.h'`; then
    echo shar: \"'stdio.h'\" unpacked with wrong size!
fi
# end of 'stdio.h'
fi
if test -f 'stdlib.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'stdlib.h'\"
else
echo shar: Extracting \"'stdlib.h'\" \(586 characters\)
sed "s/^X//" >'stdlib.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_STDLIB_H_
X#define _HAVE_STDLIB_H_
X
X#include <stddef.h>
Xtypedef struct { int quot; int rem; } div_t;
Xtypedef struct { long quot; long rem; } ldiv_t;
X#define EXIT_FAILURE	(1)
X#define EXIT_SUCCESS	(0)
X#define RAND_MAX	(2047)
X#define MB_CUR_MAX	(3)
X
X#endif	/* _HAVE_STDLIB_H_ */
END_OF_FILE
if test 586 -ne `wc -c <'stdlib.h'`; then
    echo shar: \"'stdlib.h'\" unpacked with wrong size!
fi
# end of 'stdlib.h'
fi
if test -f 'string.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'string.h'\"
else
echo shar: Extracting \"'string.h'\" \(396 characters\)
sed "s/^X//" >'string.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_STRING_H_
X#define _HAVE_STRING_H_
X
X#include <stddef.h>
X
X#endif	/* _HAVE_STRING_H_ */
END_OF_FILE
if test 396 -ne `wc -c <'string.h'`; then
    echo shar: \"'string.h'\" unpacked with wrong size!
fi
# end of 'string.h'
fi
if test -f 'time.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'time.h'\"
else
echo shar: Extracting \"'time.h'\" \(597 characters\)
sed "s/^X//" >'time.h' <<'END_OF_FILE'
X/*
X**  This is a placeholder header file for ANSI C.
X**  Any values given are for demonstration; don't use this file for
X**  anything "real."
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X#ifndef	_HAVE_TIME_H_
X#define _HAVE_TIME_H_
X
X#include <stddef.h>
Xtypedef int clock_t;
Xtypedef int time_t;
X
Xstruct tm {
X    int tm_sec;
X    int tm_min;
X    int tm_hour;
X    int tm_mday;
X    int tm_mon;
X    int tm_year;
X    int tm_wday;
X    int tm_yday;
X    int tm_isdst;
X};
X#endif	/* _HAVE_TIME_H_ */
END_OF_FILE
if test 597 -ne `wc -c <'time.h'`; then
    echo shar: \"'time.h'\" unpacked with wrong size!
fi
# end of 'time.h'
fi
if test -f 'ansilib.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ansilib.c'\"
else
echo shar: Extracting \"'ansilib.c'\" \(15073 characters\)
sed "s/^X//" >'ansilib.c' <<'END_OF_FILE'
X/*
X**
X**  This is a lint(1)-library specification for the ANSI C library.
X**  It is based on the X3J11 Draft of May 13, 1988.
X**  It was written Rich $alz <rsalz@bbn.com> in January, 1989, who put it
X**  in the public domain.
X*/
X
X/* Maybe comment this #define out? */
X#define const		/* empty */
X
X/* Maybe use just "long"? */
X#define longint		long int
X
X/* For use with "void *foo" -- maybe use "char"? */
X#define voidptr		void
X
X/* For use with "void foo()" -- maybe use "int"? */
X#define voidresult	void
X
X/* SECTION 4.1    INTRODUCTION */
X
X/* SECTION 4.1.1  Definitions of terms */
X
X/* SECTION 4.1.2  Standard headers */
X#include <assert.h>
X#include <ctype.h>
X#include <errno.h>
X#include <float.h>
X#include <limits.h>
X#include <locale.h>
X#include <math.h>
X#include <setjmp.h>
X#include <signal.h>
X#include <stdarg.h>
X#include <stddef.h>
X#include <stdio.h>
X#include <stdlib.h>
X#include <string.h>
X#include <time.h>
X
X/* SECTION 4.1.3  Errors <errno.h> */
X
X#undef errno
Xint errno = 0;
X
X/* SECTION 4.1.4  Limits <float.h> and <limits.h> */
X
X/* SECTION 4.1.5  Common definitions <stddef.h> */
X
X/* SECTION 4.1.6  Use of library functions */
X
X/* SECTION 4.2    DIAGNOSTICS <assert.h> */
X
X#undef assert
Xvoidresult assert(expression)
X    int expression;
X    { return; }
X
X/* SECTION 4.3    CHARACTER HANDLING <ctype.h> */
X
X/* SECTION 4.3.1  Character testing functions */
X
X#undef isalnum
Xint isalnum(c)
X    int c;
X    { return 0; }
X
X#undef isalpha
Xint isalpha(c)
X    int c;
X    { return 0; }
X
X#undef iscntrl
Xint iscntrl(c)
X    int c;
X    { return 0; }
X
X#undef isdigit
Xint isdigit(c)
X    int c;
X    { return 0; }
X
X#undef isgraph
Xint isgraph(c)
X    int c;
X    { return 0; }
X
X#undef islower
Xint islower(c)
X    int c;
X    { return 0; }
X
X#undef isprint
Xint isprint(c)
X    int c;
X    { return 0; }
X
X#undef ispunct
Xint ispunct(c)
X    int c;
X    { return 0; }
X
X#undef isspace
Xint isspace(c)
X    int c;
X    { return 0; }
X
X#undef isupper
Xint isupper(c)
X    int c;
X    { return 0; }
X
X#undef isxdigit
Xint isxdigit(c)
X    int c;
X    { return 0; }
X
X/* SECTION 4.3.2  Character case mapping functions. */
X
X#undef tolower
Xint tolower(c)
X    int c;
X    { return 0; }
X
X#undef toupper
Xint toupper(c)
X    int c;
X    { return 0; }
X
X/* SECTION 4.4    LOCALIZATION <locale.h> */
X
X/* SECTION 4.4.1  Locale control */
X
X#undef setlocale
Xchar *setlocale(category, locale)
X    int category; const char *locale;
X    { return 0; }
X
X/* SECTION 4.4.2  Numeric formatting convention inquiry */
X
X#undef localeconv
Xstruct lconv *localeconv()
X    { return 0; }
X
X/* SECTION 4.5    MATHEMATICS <math.h> */
X
X/* SECTION 4.5.1  Treatment of error conditions */
X
X/* SECTION 4.5.2  Trigonometric functions */
X
X#undef acos
Xdouble acos(x)
X    double x;
X    { return 0; }
X
X#undef asin
Xdouble asin(x)
X    double x;
X    { return 0; }
X
X#undef atan
Xdouble atan(x)
X    double x;
X    { return 0; }
X
X#undef atan2
Xdouble atan2(y, x)
X    double y, x;
X    { return 0; }
X
X#undef cos
Xdouble cos(x)
X    double x;
X    { return 0; }
X
X#undef sin
Xdouble sin(x)
X    double x;
X    { return 0; }
X
X#undef tan
Xdouble tan(x)
X    double x;
X    { return 0; }
X
X/* SECTION 4.5.3  Hyperbolic functions */
X
X#undef cosh
Xdouble cosh(x)
X    double x;
X    { return 0; }
X
X#undef sinh
Xdouble sinh(x)
X    double x;
X    { return 0; }
X
X#undef tanh
Xdouble tanh(x)
X    double x;
X    { return 0; }
X
X/* SECTION 4.5.4  Exponential and logarithmic functions */
X
X#undef exp
Xdouble exp(x)
X    double x;
X    { return 0; }
X
X#undef frexp
Xdouble frexp(value, exp)
X    double value; int *exp;
X    { return 0; }
X
X#undef ldexp
Xdouble ldexp(x, exp)
X    double x; int *exp;
X    { return 0; }
X
X#undef log
Xdouble log(x)
X    double x;
X    { return 0; }
X
X#undef log10
Xdouble log10(x)
X    double x;
X    { return 0; }
X
X#undef modf
Xdouble modf(value, iptr)
X    double value; double *iptr;
X    { return 0; }
X
X/* SECTION 4.5.5  Power functions */
X
X#undef pow
Xdouble pow(x, y)
X    double x; double y;
X    { return 0; }
X
X#undef sqrt
Xdouble sqrt(x)
X    double x;
X    { return 0; }
X
X/* SECTION 4.5.6  Nearest integer, absolute value, and remainder functions */
X
X#undef ceil
Xdouble ceil(x)
X    double x;
X    { return 0; }
X
X#undef fabs
Xdouble fabs(x)
X    double x;
X    { return 0; }
X
X#undef floor
Xdouble floor(x)
X    double x;
X    { return 0; }
X
X#undef fmod
Xdouble fmod(x, y)
X    double x; double y;
X    { return 0; }
X
X/* SECTION 4.6    NON-LOCAL JUMPS <setjmp.h> */
X
X#undef setjmp
Xint setjmp(env)
X    jmp_buf env;
X    { return 0; }
X
X#undef longjmp
Xvoidresult longjmp(env, val)
X    jmp_buf env; int val;
X    { return; }
X
X/* SECTION 4.7    SIGNAL HANDLING <signal.h> */
X
X/* "Too painful to do right" */
X#undef signal
Xint (*signal(sig, func))
X    int sig; void (*func)();
X    { return 0; }
X
X#undef raise
Xint raise(sig)
X    int sig;
X    { return 0; }
X
X/* SECTION 4.8    VARIABLE ARGUMENTS <stdarg.h> */
X
X#undef va_start
X#undef va_arg
X#undef va_end
X
X/* SECTION 4.9    INPUT/OUTPUT <stdio.h> */
X
X/* SECTION 4.9.1  Introduction */
X
X/* SECTION 4.9.2  Streams */
X
X/* SECTION 4.9.3  Files */
X
X/* SECTION 4.9.4  Operations on files */
X
X#undef remove
Xint remove(filename)
X    const char *filename;
X    { return 0; }
X
X#undef rename
Xint rename(old, new)
X    const char *old; const char *new;
X    { return 0; }
X
X#undef tmpfile
XFILE *tmpfile()
X    { return 0; }
X
X#undef tmpname
Xchar *tmpname(s)
X    char *s;
X    { return 0; }
X
X/* SECTION 4.9.5  File access functions */
X
X#undef fclose
Xint fclose(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef fflush
Xint fflush(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef fopen
XFILE *fopen(filename, mode)
X    const char *filename; const char *mode;
X    { return 0; }
X
X#undef freopen
XFILE *freopen(filename, mode, stream)
X    const char *filename; const char *mode; FILE *stream;
X    { return 0; }
X
X#undef setbuf
Xvoidresult setbuf(stream, buf)
X    FILE *stream; char *buf;
X    { return; }
X
X#undef setvbuf
Xint setvbuf(stream, buf, mode, size)
X    FILE *stream; char *buf; int mode; size_t size;
X    { return 0; }
X
X/* SECTION 4.9.6  Formatted input/output functions */
X
X#undef fprintf
X/* VARARGS2 */
Xint fprintf(stream, format)
X    FILE *stream; const char *format;
X    { return 0; }
X
X#undef fscanf
X/* VARARGS2 */
Xint fscanf(stream, format)
X    FILE *stream; const char *format;
X    { return 0; }
X
X#undef printf
X/* VARARGS1 */
Xint printf(format)
X    const char *format;
X    { return 0; }
X
X#undef scanf
X/* VARARGS1 */
Xint scanf(format)
X    const char *format;
X    { return 0; }
X
X#undef sprintf
X/* VARARGS1 */
Xint sprintf(s, format)
X    char *s; const char *format;
X    { return 0; }
X
X#undef sscanf
X/* VARARGS2 */
Xint sscanf(s, format)
X    char *s; const char *format;
X    { return 0; }
X
X#undef vfprintf
Xint vfprintf(stream, format, arg)
X    FILE *stream; const char *format; va_list arg;
X    { return 0; }
X
X#undef vprintf
Xint vprintf(format, arg)
X    const char *format; va_list arg;
X    { return 0; }
X
X#undef vsprintf
Xint vsprintf(s, format, arg)
X    char *s; const char *format; va_list arg;
X    { return 0; }
X
X/* SECTION 4.9.7  Character input/output functions */
X
X#undef fgetc
Xint fgetc(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef fgets
Xchar *fgets(s, n, stream)
X    char *s; int n; FILE *stream;
X    { return 0; }
X
X#undef fputc
Xint fputc(c, stream)
X    int c; FILE *stream;
X    { return 0; }
X
X#undef fputs
Xint fputs(s, stream)
X    const char *s; FILE *stream;
X    { return 0; }
X
X#undef getc
Xint getc(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef getchar()
Xint getchar()
X    { return 0; }
X
X#undef gets
Xint gets(s)
X    char *s;
X    { return 0; }
X
X#undef putc
Xint putc(c, stream)
X    int c; FILE *stream;
X    { return 0; }
X
X#undef putchar
Xint putchar(c)
X    int c;
X    { return 0; }
X
X#undef puts
Xint puts(s)
X    const char *s;
X    { return 0; }
X
X#undef ungetc
Xint ungetc(c, stream)
X    int c; FILE *stream;
X    { return 0; }
X
X/* SECTION 4.9.8  Direct input/output functions */
X
X#undef fread
Xsize_t fread(ptr, size, nmemb, stream)
X    voidptr *ptr; size_t size; size_t nmemb; FILE *stream;
X    { return 0; }
X
X#undef fwrite
Xsize_t fwrite(ptr, size, nmemb, stream)
X    voidptr *ptr; size_t size; size_t nmemb; FILE *stream;
X    { return 0; }
X
X/* SECTION 4.9.9  File positioning functions */
X
X#undef fgetpos
Xint fgetpos(stream, pos)
X    FILE *stream; fpos_t *pos;
X    { return 0; }
X
X#undef fseek
Xint fseek(stream, offset, whence)
X    FILE *stream; longint offset; int whence;
X    { return 0; }
X
X#undef fsetpos
Xint fsetpos(stream, pos)
X    FILE *stream; const fpos_t *pos;
X    { return 0; }
X
X#undef ftell
Xlongint ftell(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef rewind
Xvoidresult rewind(stream)
X    FILE *stream;
X    { return; }
X
X/* SECTION 4.9.10 Error-handling functions */
X
X#undef clearerr
Xvoidresult clearerr(stream)
X    FILE *stream;
X    { return; }
X
X#undef feof
Xint feof(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef ferror
Xint ferror(stream)
X    FILE *stream;
X    { return 0; }
X
X#undef perror
Xvoidresult perror(s)
X    const char *s;
X    { return; }
X
X/* SECTION 4.10   GENERAL UTILITIES <stdlib.h> */
X
X/* SECTION 4.10.1 String conversion functions */
X
X#undef  atof
Xdouble atof(nptr)
X    const char *nptr;
X    { return 0; }
X
X#undef atoi
Xint atoi(nptr)
X    const char *nptr;
X    { return 0; }
X
X#undef atol
Xlongint atol(nptr)
X    const char *nptr;
X    { return 0; }
X
X#undef strtod
Xdouble strtod(nptr, endptr)
X    const char *nptr; char **endptr;
X    { return 0; }
X
X#undef strtol
Xlongint strtol(nptr, endptr, base)
X    const char *nptr; char **endptr; int base;
X    { return 0; }
X
X#undef strtoul
Xunsigned longint strtoul(nptr, endptr, base)
X    const char *nptr; char **endptr; int base;
X    { return 0; }
X
X/* SECTION 4.10.2 Pseudo-random sequence generation functions */
X
X#undef rand
Xint rand()
X    { return 0; }
X
X#undef srand
Xvoidresult srand(seed)
X    unsigned int seed;
X    { return; }
X
X/* SECTION 4.10.3 Memory management functions */
X
X#undef calloc
Xvoidptr *calloc(nmemb, size)
X    size_t nmemb; size_t size;
X    { return 0; }
X
X#undef free
Xvoidresult free(ptr)
X    voidptr *ptr;
X    { return; }
X
X#undef malloc
Xvoidptr *malloc(size)
X    size_t size;
X    { return 0; }
X
X#undef realloc
Xvoidptr *realloc(ptr, size)
X    voidptr *ptr; size_t size;
X    { return 0; }
X
X/* SECTION 4.10.4 Communication with the environment */
X
X#undef abort
Xvoidresult abort()
X    { return; }
X
X#undef atexit
Xint atexit(func)
X    void (*func)();
X    { return 0; }
X
X#undef exit
Xvoidresult exit(status)
X    int status;
X    { return; }
X
X#undef getenv
Xchar *getenv(name)
X    const char *name;
X    { return 0; }
X
X#undef system
Xint system(string)
X    const char *string;
X    { return 0; }
X
X/* SECTION 4.10.5 Searching and sorting utilities */
X
X#undef bsearch
Xvoidptr *bsearch(key, base, nmemb, size, compar)
X    const voidptr *key; const voidptr *base; size_t nmemb; size_t size;
X    int (*compar)();
X    { return 0; }
X
X#undef qsort
Xvoidresult qsort(base, nmemb, size, compar)
X    voidptr *base; size_t nmemb; size_t size; int (*compar);
X    { return; }
X
X/* SECTION 4.10.6 Integer arithmetic functions */
X
X#undef abs
Xint abs(j)
X    int j;
X    { return 0; }
X
X#undef div
Xdiv_t div(number, denom)
X    int number; int denom;
X    { div_t c; return c; }
X
X#undef labs
Xlongint labs(j)
X    longint j;
X    { return 0; }
X
X#undef ldiv
Xldiv_t ldiv(number, denom)
X    longint number; longint denom;
X    { ldiv_t c; return c; }
X
X/* SECTION 4.10.7 Multibyte character functions */
X
X#undef mblen
Xint mblen(s, n)
X    const char *s; size_t n;
X    { return 0; }
X
X#undef mbtowc
Xint mbtowc(pwc, s, n)
X    wchar_t *pwc; const char *s; size_t n;
X    { return 0; }
X
X#undef wctomb
Xint wctomb(s, wchar)
X    char *s; wchar_t wchar;
X    { return 0; }
X
X/* SECTION 4.10.8 Multibyte string functions */
X
X#undef mbstowcs
Xsize_t mbstowcs(pwcs, s, n)
X    wchar_t *pwcs; const char *s; size_t n;
X    { return 0; }
X
X#undef wcstombs
Xsize_t wcstombs(s, pwcs, n)
X    char *s; const wchar_t *pwcs; size_t n;
X    { return 0; }
X
X/* SECTION 4.11   STRING HANDLING <string.h> */
X
X/* SECTION 4.11.1 String function conventions */
X
X/* SECTION 4.11.2 Copying functions */
X
X#undef memcpy
Xvoidptr *memcpy(s1, s2, n)
X    voidptr *s1; const voidptr *s2; size_t n;
X    { return 0; }
X
X#undef memmove
Xvoidptr *memmove(s1, s2, n)
X    voidptr *s1; const voidptr *s2; size_t n;
X    { return 0; }
X
X#undef strcpy
Xchar *strcpy(s1, s2)
X    char *s1; const char *s2;
X    { return 0; }
X
X#undef strncpy
Xchar *strncpy(s1, s2, n)
X    char *s1; const char *s2; size_t n;
X    { return 0; }
X
X/* SECTION 4.11.3 Concatenation functions */
X
X#undef strcat
Xchar *strcat(s1, s2)
X    char *s1; const char *s2;
X    { return 0; }
X
X#undef strncat
Xchar *strncat(s1, s2, n)
X    char *s1; const char *s2; size_t n;
X    { return 0; }
X
X/* SECTION 4.11.4 Comparison functions */
X
X#undef memcmp
Xint memcmp(s1, s2, n)
X    const voidptr *s1; const voidptr *s2; size_t n;
X    { return 0; }
X
X#undef strcmp
Xint strcmp(s1, s2)
X    const char *s1; const char *s2;
X    { return 0; }
X
X#undef strcoll
Xint strcoll(s1, s2)
X    const char *s1; const char *s2;
X    { return 0; }
X
X#undef strncmp
Xint strncmp(s1, s2, n)
X    const char *s1; const char *s2; size_t n;
X    { return 0; }
X
X#undef strxfrm
Xsize_t strxfrm(s1, s2, n)
X    char *s1; const char *s2; size_t n;
X    { return 0; }
X
X/* SECTION 4.11.5 Search functions */
X
X#undef memchr
Xvoidptr *memchr(s, c, n)
X    const voidptr *s; int c; size_t n;
X    { return 0; }
X
X#undef strchr
Xchar *strchr(s, c)
X    const char *s; int c;
X    { return 0; }
X
X#undef strcspn
Xsize_t strcspn(s1, s2)
X    const char *s1; const char *s2;
X    { return 0; }
X
X#undef strpbrk
Xchar *strpbrk(s1, s2)
X    const char *s1; const char *s2;
X    { return 0; }
X
X#undef strrchr
Xchar *strrchr(s, c)
X    const char *s; int c;
X    { return 0; }
X
X#undef strspn
Xsize_t strspn(s1, s2)
X    const char *s1; const char *s2;
X    { return 0; }
X
X#undef strstr
Xchar *strstr(s1, s2)
X    const char *s1; const char *s2;
X    { return 0; }
X
X#undef strtok
Xchar *strtok(s1, s2)
X    char *s1; const char *s2;
X    { return 0; }
X
X/* SECTION 4.11.6 Miscellaneous functions */
X
X#undef memset
Xvoidptr *memset(s, c, n)
X    voidptr *s; int c; size_t n;
X    { return 0; }
X
X#undef strerror
Xchar *strerror(errnum)
X    int errnum;
X    { return 0; }
X
X#undef strlen
Xsize_t strlen(s)
X    const char *s;
X    { return 0; }
X
X/* SECTION 4.12   DATE AND TIME <time.h> */
X
X/* SECTION 4.12.1 Components of time */
X
X/* SECTION 4.12.2 Time manipulation functions */
X
X#undef clock
Xclock_t clock()
X    { return 0; }
X
X#undef difftime
Xdouble difftime(time1, time0)
X    time_t time1; time_t time0;
X    { return 0; }
X
X#undef mktime
Xtime_t mktime(timeptr)
X    struct tm *timeptr;
X    { return 0; }
X
X#undef time
Xtime_t time(timer)
X    time_t *timer;
X    { return 0; }
X
X/* SECTION 4.12.3 Time conversion functions */
X
X#undef asctime
Xchar *asctime(timeptr)
X    const struct tm *timeptr;
X    { return 0; }
X
X#undef ctime
Xchar *ctime(timer)
X    const time_t *timer;
X    { return 0; }
X
X#undef gmtime
Xstruct tm *gmtime(timer)
X    const time_t *timer;
X    { return 0; }
X
X#undef localtime
Xstruct tm *localtime(timer)
X    const time_t *timer;
X    { return 0; }
X
X#undef strftime
Xsize_t strftime(s, maxsize, format, timeptr)
X    char *s; size_t maxsize; const char *format; const struct tm *timeptr;
X    { return 0; }
END_OF_FILE
if test 15073 -ne `wc -c <'ansilib.c'`; then
    echo shar: \"'ansilib.c'\" unpacked with wrong size!
fi
# end of 'ansilib.c'
fi
echo shar: End of shell archive.
exit 0

-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.

friedl@vsi.COM (Stephen J. Friedl) (01/08/89)

/rich $alz posted a complete lint library for ANSI C, but
maybe now is the time for an extension for lint.  Rather than
the standard lint function template format such as:

	char *strcpy(s1, s2) char *s1; const char *s2; { return 0; }

why not permit the prototype form?  Then, the lint library
would be something like:

	/* llib-lc.c */
	/*LINTPROTOLIBRARY*/	/* <---- I made this up	*/
	#include	<stdio.h>
	#include	<stddef.h>
	#include	....

Continue to support the old method, but this would make it
*much* easier to maintain lint libraries because they don't
have to be manually diddled with.

     Comments?
     Steve

-- 
Stephen J. Friedl        3B2-kind-of-guy            friedl@vsi.com
V-Systems, Inc.        I speak for me only      attmail!vsi!friedl
Santa Ana, CA  USA       +1 714 545 6442    {backbones}!vsi!friedl
-------Nancy Reagan on Usenix in San Diego: "Just say *go*"-------