📄 llib-lc
字号:
/* * * The lint library has been reorganized and updated. * * The first section contains all the Berkeley code as close to exact as * possible. Functions that don't return or return void are declared as * such, which is not the way it was done previously. In some places, * variables were declared as pointers to characters when they were * actually integers, and these have been corrected. The ifndef's are * because of conflicts with System V additions. * * The second section contains the Berkeley definitions that are not in * System V, and are not included in the System V lint library. * * The third section has all the System V additions to Ultrix that * don't conflict and have been included in the normal Ultrix lint * library. * * The fourth section, separated by an ifdef block, is all the * conflicting definitions between System V and Berkeley. * * The fifth section, separated by an ifdef block, is all the * conflicting definitions between System V/POSIX/X/Open and * (traditional) Berkeley. * *//* This is the basic Ultrix (Berkeley) lint library with the conflicting * definitions with System V 'ifndef'ed. *//*LINTLIBRARY*/#include <sys/types.h>#include <nl_types.h>#include <dbm.h>#undef NULL /* dbm's NULL is brain-dead */#include <disktab.h>#include <fstab.h>#include <grp.h>#include <sys/dir.h>#include <netdb.h>#include <nlist.h>#include <pwd.h>#include <setjmp.h>#include <stdio.h>#include <stdlib.h>#include <sgtty.h>#include <signal.h>#include <limits.h>#include <locale.h>#include <termios.h>#include <ttyent.h>#include <utime.h>#include <sys/param.h>#include <sys/mount.h>#include <sys/time.h>#include <sys/times.h>#include <sys/vtimes.h>#include <sys/timeb.h>#include <sys/resource.h>#include <sys/wait.h>#include <sys/socket.h>#include <sys/stat.h>#include <sys/uio.h>#include <netinet/in.h>#include <arpa/inet.h>#include <langinfo.h>#include <auth.h>#include <sys/svcinfo.h> /*** SECTION 2 ***//* ACCEPT(2) */int accept(s,a,l) int s; struct sockaddr *a; int *l; { return s; }/* ACCESS(2) */int access(p,m) char *p; int m; { return 0; }/* ACCT(2) */int acct(f) char *f; { return 0;}/* ADJTIME(2) */int adjtime(d, o) struct timeval *d, *o; { return 0; }/* ATOMIC_OP(2) */int atomic_op(o, a) int o; int *a; {return 0;}/* BRK(2) */#ifndef SYSTEM_FIVEcaddr_t brk(a) caddr_t a; { return(0); }#endifcaddr_t sbrk(i) int i; { return(0); }#ifdef mips/* CACHECTL(2) */int cachectl(a, n, o) char *a; int n, o; { return 0; }/* CACHEFLUSH(2) */int cacheflush(a, n, c) char *a; int n, c; { return 0; }#endif/* CHDIR(2) */int chdir(s) char *s; { return(0); }/* CHMOD(2) */int chmod(s,m) char *s; mode_t m; { return(0); }int fchmod(f, m) int f; mode_t m; { return(0); }/* CHOWN(2) */int chown(s,u,g) char *s; uid_t u; gid_t g; { return(0); }int fchown(f, u, g) int f; uid_t u; gid_t g; { return(0); }/* CHROOT(2) */int chroot(d) char *d; { return 0; }/* CLOSE(2) */int close(f) int f; { return(0); }/* CREAT(2) */int creat(s,m) char *s; mode_t m; { return(0); }/* DUP(2) */int dup(f) int f; { return(f); }int dup2(o,n) int o; int n; { return o; }/* EXECVE(2) */int execve(s,v,e) char *s, *v[], *e[]; {return(0);}/* EXIT(2) */void _exit(s) int s; {}/* EXPORTFS(2) */int exportfs(n, r, e) char *n; int r,e; { return 0; }/* FCNTL(2) */int fcntl(f,c,a) int f; int c; int a;{ return (0); }/* FORK(2) */pid_t fork() { return(0); }/* GETDIRENTRIES(2) */int getdirentries(f, b, n, bp) int f, n; char *b; long *bp; { return 0; }/* GETDOMAINNAME(2) */int getdomainname(n, nl) char *n; int nl; { return 0; }int setdomainname(n, nl) char *n; int nl; { return 0; }/* GETGID(2) */gid_t getgid() { return((gid_t)0); }gid_t getegid() { return((gid_t)0); }/* GETMNT(2) */int getmnt(s,b,n,m,p) int *s,n,m; struct fs_data *b; char *p; { return 0; }/* GETPGRP(2) */#if !defined(SYSTEM_FIVE) && !defined(POSIX)int getpgrp(p) int p; { return 1; }#endif/* GETPID(2) */pid_t getpid() { return((pid_t)1); }pid_t getppid() { return((pid_t)1); }/* GETSYSINFO(2) */int getsysinfo(o,b,n,s,a) unsigned o, n; char *b, *a; int *s; { return 0; }/* GETUID(2) */uid_t getuid() { return((uid_t)0); }uid_t geteuid() { return((uid_t)0); }/* IOCTL(2) */#ifndef SYSTEM_FIVEint ioctl(d,r,p) int d; int r; char *p; { return 0;}#endif/* KILL(2) */int kill(p,s) pid_t p; int s; { return(0); }int raise(s) int s; { return(0); }/* LINK(2) */int link(a,b) char *a, *b; { return(0); }/* LSEEK */off_t lseek(f,o,d) int f; off_t o; int d; { return (o); }off_t tell(f) int f; { return((off_t)0); }#ifdef SYSTEM_FIVEint madvise(a,l,b) char * a; int l, b; { return 0;}int mmap(a,l,p,s,f,o) char * a; int l,p,s,f; off_t o; { return 0;}int mincore(a,l,v) char * a; int l; char *v; { return 0; }#endif/* MKDIR(2) */int mkdir(p,m) char *p; mode_t m; { return 0; }/* MKNOD(2) */int mknod(n,m,a) char *n; mode_t m; int a; { return(0); }/* MOUNT(2) */#ifndef SYSTEM_FIVEint mount(s,n,f,t,o) char *s, *n, *o; int f, t; { return(0); }int umount(s) dev_t s; { return(0); }#endif#ifdef SYSTEM_FIVEint mprotect(a,l,p) char * a; int l,p; { return 0;}int mremap(a,l,p,s,f) char * a, f; int l,p,s; { return 0;}int munmap(a,l) char * a; int l; { return 0;}#endif/* NFS_SVC(2) -- return types are guesses */int nfs_svc(s) int s; { return 0; }void nfs_biod() { }/* OPEN(2) */ /*VARARGS2*/int open(f,m,stuff) char *f; int m,stuff; { return(0); }/* PIPE(2) */int pipe(f) int f[2]; { return(0); }/* PROFIL(2) */#ifndef SYSTEM_FIVEint profil(b,s,o,i) char *b; int s,o,i; { return(0);}#endif/* PTRACE(2) */int ptrace(r,p,a,d) int r,p,*a,d; { return(0); }/* READ(2) */#if !defined(SYSTEM_FIVE) && !defined(POSIX)int read(f,b,l) int f,l; char *b; { return(l); }#endif#ifndef SYSTEM_FIVEint readv(d,v,l) int d,l; struct iovec *v; { return l; }#endif/* SETPGRP(2) */#ifndef SYSTEM_FIVEint setpgrp(g,pg) int g, pg; { return 0; }#endif/* SETSYSINFO(2) */int setsysinfo(o,b,n,a,f) unsigned o, n, a, f; char *b; { return 0; }#ifdef mips/* SIGRETURN(2) */int sigreturn(s) struct sigcontext *s; { return 0; }#endif/* STARTCPU(2) */int startcpu(c) int c; { return 0; }int stopcpu(c) int c; { return 0; }/* STAT(2) */int stat(s,b) char *s; struct stat *b; { return(0); }int fstat(f,b) int f; struct stat *b; { return(0); }int lstat(s,b) char *s; struct stat *b; { return(0); }#ifdef SYSTEM_FIVEchar * stk(a) char * a; { return a; }char * sstk(a) int a; { return (char *)0; }#endif/* SYNC(2) */void sync(){}/* UMASK */mode_t umask(n) mode_t n; { return n; }/* UNLINK */int unlink(s) char *s; { return(0); }int remove(s) char *s; { return(0); }/* WAIT(2) */#if !defined(SYSTEM_FIVE) && !defined(POSIX)int wait(s) union wait *s; { return(1); }#endif#ifndef SYSTEM_FIVEint wait3(s,o,r) union wait *s; int o; struct rusage *r; { return 1;}#endif/* WAITPID(2) */pid_t waitpid(p,s,o) pid_t p; int *s; int o; { return (p); }/* WRITE(2) */#if !defined(SYSTEM_FIVE) && !defined(POSIX)int write(f,b,l) int f, l; char *b; { return(l); }#endif#ifndef SYSTEM_FIVEint writev(f,v,l) int f, l; struct iovec *v; { return l; }#endif /*** SECTION 3 ***//* ABORT(3) */void abort() {}/* ABS(3) */int abs(i) int i; { return(i); }long labs(i) long i; { return(i); }/* ALARM(3C) */unsigned alarm(s) unsigned s; { return (s); }/* CATGETS(3) */char * catgets(c,sn,m,s) nl_catd c; int sn,m; char *s; { return s; }/* CATOPEN(3) */nl_catd catopen(n,o) char *n; int o; {return (nl_catd)0;}int catclose(c) nl_catd c; {return 0;}/* CRYPT(3) */char * crypt(k,s) char *k, *s; { return(""); }#if !defined(SYSTEM_FIVE) && !defined(POSIX)void encrypt(s) char *s; {}#endifchar *crypt16(k,s) char *k, *s; { return k; }void setkey(k) char *k; {}/* CTIME(3) */char * ctime(c) time_t *c;{ return(""); }char * asctime(t) struct tm *t; { return(""); }struct tm *localtime(c) time_t *c; { return localtime(c); }struct tm *gmtime(c) time_t *c; { return gmtime(c); }size_t strftime(s,m,f,t) char *s, *f; size_t m; struct tm *t; { return (m); }double difftime(a,b) time_t a,b; { return(0.0); }time_t mktime(t) struct tm *t; { return mktime(t); }void tzset() {}char * tzname[2];#if !defined(SYSTEM_FIVE) && !defined(POSIX)char * timezone(z,d) int z, d; {return("");}#endif/* DBM(3) */int dbminit(f) char *f; { return 0; }datum fetch(k) datum k; { return k; }int store(k, c) datum k, c; { return 0; }int delete(k) datum k; { return 0; }datum firstkey() { static datum k; return k; }datum nextkey(k) datum k; { return k; }/* DIV(3) */div_t div(n,d) int n,d; { static div_t x; return (x); }ldiv_t ldiv(n,d) long n,d; { static ldiv_t x; return (x); }/* ECVT(3) */char * ecvt(v,n,d,s) double v; int n, *d, *s; { return(""); }char * fcvt(v,n,d,s) double v; int n, *d, *s; { return(""); }char * gcvt(v,n,b) double v; int n; char *b; { return(""); }/* END(3) */int end;int etext;int edata;/* EXECL(3) */ /*VARARGS*/int execl(f,a) char *f, *a; {return (1);} /*VARARGS*/int execle(f,a) char *f, *a; {return (1);}int execv(s,v) char *s, *v[]; {return (1);}int exect(s, v, e) char *s, *v[], *e[]; {;}/* EXIT(3) */void exit(s) int s; {}int atexit(f) void (*f)(); { return(0); }/* FCLOSE(3S) */int fclose(f) FILE *f; {return(0);}int fflush(f) FILE *f; {return(0);}/* FOPEN(3S) */FILE * fopen(s,m) char *s, *m; { return(stdin); }FILE * fdopen(fd,m) int fd; char *m; { return(stdin);}FILE * freopen(s,m,f) char *s, *m; FILE *f; { return(stdin); }/* FREAD(3S) */size_t fread(p,s,n,f) void *p; size_t s, n; FILE *f; { return s; }size_t fwrite(p,s,n,f) void *p; size_t s, n; FILE *f; { return s; }/* FREXP(3) */double frexp(v,e) double v; int *e; { return v; }double ldexp(v,e) double v; int e; { return v; }double modf(v,p) double v, *p; { return v; }/* FSEEK(3S) */int fseek(f,o,p) FILE *f; long o; int p; { return(0); }long ftell(f) FILE *f; { return(0L); }void rewind(f) FILE *f; {}int fgetpos(f,p) FILE *f; fpos_t *p; { return(0); }int fsetpos(f,p) FILE *f; fpos_t *p; { return(0); }/* GETAUTHUID(3) */AUTHORIZATION *getauthuid(u) uid_t u; { return (AUTHORIZATION *)0; }int storeauthent(a) AUTHORIZATION *a; { return 0; }void setauthfile(p) char *p; { ; }int endauthent() { return 0; }/* GETC(3S) */int fgetc(f) FILE *f; {return 0; }int getw(f) FILE *f; { return 0;}/* GETDISKBYNAME(3) */struct disktab * getdiskbyname(n) char *n; { return (struct disktab *) 0; }/* GETENV(3) */char * getenv(n) char *n; { return n; }int putenv(n) char *n; { return 0; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -