retire _PROTOTYPE

. only good for obsolete K&R support
	. also remove a stray ansi.h and the proto cmd
This commit is contained in:
Ben Gras 2012-03-24 16:16:34 +01:00
parent cf720a028a
commit 6a73e85ad1
475 changed files with 5256 additions and 6252 deletions

View file

@ -21,7 +21,7 @@ SUBDIR= add_route arp ash at awk \
mkproto mount mt netconf newroot nice acknm nohup \ mkproto mount mt netconf newroot nice acknm nohup \
nonamed od paste patch pax \ nonamed od paste patch pax \
ping postinstall poweroff pr prep printf printroot \ ping postinstall poweroff pr prep printf printroot \
profile progressbar proto pr_routes ps pwd pwdauth \ profile progressbar pr_routes ps pwd pwdauth \
ramdisk rarpd rawspeed rcp rdate readall readclock \ ramdisk rarpd rawspeed rcp rdate readall readclock \
reboot remsync rev rget rlogin \ reboot remsync rev rget rlogin \
rotate rsh rshd sed service setup shar acksize \ rotate rsh rshd sed service setup shar acksize \

View file

@ -44,11 +44,11 @@ char io_buf[BUFSIZ]; /* io buffer */
struct exec header; /* header of a.out file */ struct exec header; /* header of a.out file */
int stbl_elems; /* #elements in symbol table */ int stbl_elems; /* #elements in symbol table */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(int nm_sort, (const void *tmp_stbl1, const void *tmp_stbl2)); int nm_sort(const void *tmp_stbl1, const void *tmp_stbl2);
_PROTOTYPE(void nm, (char *file)); void nm(char *file);
_PROTOTYPE(int read_header, (int fd)); int read_header(int fd);
_PROTOTYPE(void nm_print, (char *file, struct nlist *stbl)); void nm_print(char *file, struct nlist *stbl);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -10,8 +10,8 @@
int heading; /* set when heading printed */ int heading; /* set when heading printed */
int error; int error;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void size, (char *name)); void size(char *name);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -18,10 +18,10 @@
#define NODAY (-2) #define NODAY (-2)
char CRONPID[] = "/usr/run/cron.pid"; char CRONPID[] = "/usr/run/cron.pid";
_PROTOTYPE(int main, (int argc, char **argv, char **envp)); int main(int argc, char **argv, char **envp);
_PROTOTYPE(int getltim, (char *t)); int getltim(char *t);
_PROTOTYPE(int getlday, (char *m, char *d)); int getlday(char *m, char *d);
_PROTOTYPE(int digitstring, (char *s)); int digitstring(char *s);
int main(argc, argv, envp) int main(argc, argv, envp)
int argc; int argc;

View file

@ -71,19 +71,19 @@ int dflag, jflag, mflag, nflag, oflag, rflag, sflag, tflag, vflag, zflag;
extern int errno; extern int errno;
extern char **environ; extern char **environ;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void maketarget, (char *dir2)); void maketarget(char *dir2);
_PROTOTYPE(int make_dir, (char *dir)); int make_dir(char *dir);
_PROTOTYPE(int stat_all, (char *dir1, int n)); int stat_all(char *dir1, int n);
_PROTOTYPE(void sort_dir, (int m)); void sort_dir(int m);
_PROTOTYPE(void process, (int m, char *dir1, char *dir2)); void process(int m, char *dir1, char *dir2);
_PROTOTYPE(void swap, (struct sorted *sp1, struct sorted *sp2)); void swap(struct sorted *sp1, struct sorted *sp2);
_PROTOTYPE(int copy, (char *dir1, struct sorted *sp, char *cbuf2)); int copy(char *dir1, struct sorted *sp, char *cbuf2);
_PROTOTYPE(int zcopy, (char *src, char *targ)); int zcopy(char *src, char *targ);
_PROTOTYPE(void copydir, (char *dir1, char *dir2, char *namep)); void copydir(char *dir1, char *dir2, char *namep);
_PROTOTYPE(void newdisk, (char *dir)); void newdisk(char *dir);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(void error, (int type, char *s1, char *s2, char *s3)); void error(int type, char *s1, char *s2, char *s3);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -39,22 +39,22 @@
#define EXTERN extern #define EXTERN extern
#include "mfs/super.h" #include "mfs/super.h"
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void get_super, (void)); void get_super(void);
_PROTOTYPE(void rw_inode, (struct stat * stat_ptr, int rw_mode)); void rw_inode(struct stat * stat_ptr, int rw_mode);
_PROTOTYPE(void get_inode, (struct stat * stat_ptr)); void get_inode(struct stat * stat_ptr);
_PROTOTYPE(void put_inode, (struct stat * stat_ptr)); void put_inode(struct stat * stat_ptr);
_PROTOTYPE(long rd_cmdline, (int argc, char *argv[])); long rd_cmdline(int argc, char *argv[]);
_PROTOTYPE(void modify, (int nr_blocks)); void modify(int nr_blocks);
_PROTOTYPE(void save_blk, (block_t blk_num)); void save_blk(block_t blk_num);
_PROTOTYPE(void reset_blks, (void)); void reset_blks(void);
_PROTOTYPE(void show_blks, (void)); void show_blks(void);
_PROTOTYPE(int blk_is_used, (block_t blk_num)); int blk_is_used(block_t blk_num);
_PROTOTYPE(int blk_ok, (block_t num)); int blk_ok(block_t num);
_PROTOTYPE(void set_bit, (zone_t num)); void set_bit(zone_t num);
_PROTOTYPE(long rd_num, (void)); long rd_num(void);
_PROTOTYPE(int ok, (char *str)); int ok(char *str);
_PROTOTYPE(void done, (int nr)); void done(int nr);
/* Super block table. /* Super block table.
* *

View file

@ -23,7 +23,7 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
char *glyphs[] = { char *glyphs[] = {
" @@@ @@ @@ @ @ @@@@@ @@ @@@ ", " @@@ @@ @@ @ @ @@@@@ @@ @@@ ",

View file

@ -20,7 +20,7 @@
#define EOS '\0' #define EOS '\0'
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -33,16 +33,16 @@ char *monthname[] = {
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}; };
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void doyear, (int year)); void doyear(int year);
_PROTOTYPE(void domonth, (int year, int month)); void domonth(int year, int month);
_PROTOTYPE(void output, (int nmonths)); void output(int nmonths);
_PROTOTYPE(void calendar, (int year, int month, int indx)); void calendar(int year, int month, int indx);
_PROTOTYPE(void usage, (char *s)); void usage(char *s);
_PROTOTYPE(int date, (int year, int month, int week, int wday)); int date(int year, int month, int week, int wday);
_PROTOTYPE(void setmonth, (int year, int month)); void setmonth(int year, int month);
_PROTOTYPE(int getdate, (int week, int wday)); int getdate(int week, int wday);
_PROTOTYPE(static int Jan1, (int year)); static int Jan1(int year);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -1,56 +0,0 @@
/* The <minix/ansi.h> header attempts to decide whether the compiler has enough
* conformance to Standard C for Minix to take advantage of. If so, the
* symbol _ANSI is defined (as 31415). Otherwise _ANSI is not defined
* here, but it may be defined by applications that want to bend the rules.
* The magic number in the definition is to inhibit unnecessary bending
* of the rules. (For consistency with the new '#ifdef _ANSI" tests in
* the headers, _ANSI should really be defined as nothing, but that would
* break many library routines that use "#if _ANSI".)
* If _ANSI ends up being defined, a macro
*
* _PROTOTYPE(function, params)
*
* is defined. This macro expands in different ways, generating either
* ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
* prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
* in such a way that they are portable over both ANSI and K&R compilers.
* The appropriate macros are defined here.
*/
#ifndef _MINIX_ANSI_H
#define _MINIX_ANSI_H
#if __STDC__ == 1
#define _ANSI 31459 /* compiler claims full ANSI conformance */
#endif
#ifdef __GNUC__
#define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
#endif
#ifdef _ANSI
/* Keep everything for ANSI prototypes. */
#define _PROTOTYPE(function, params) function params
#define _VOIDSTAR void *
#define _VOID void
#define _CONST const
#define _VOLATILE volatile
#define _SIZET size_t
#else
/* Throw away the parameters for K&R prototypes. */
#define _PROTOTYPE(function, params) function()
#define _VOIDSTAR void *
#define _VOID void
#define _CONST
#define _VOLATILE
#define _SIZET int
#endif /* _ANSI */
#endif /* _MINIX_ANSI_H */

View file

@ -42,7 +42,7 @@
#include <sys/types.h> #include <sys/types.h>
#include "ansi.h" #include <minix/ansi.h>
#define MAXLL 2048 /* ridiculous maximum line length */ #define MAXLL 2048 /* ridiculous maximum line length */
@ -53,7 +53,7 @@ char *Pname; /* program name */
unsigned char Ulb[MAXLL]; /* underline buffer */ unsigned char Ulb[MAXLL]; /* underline buffer */
int Ulx = 0; /* underline buffer index */ int Ulx = 0; /* underline buffer index */
_PROTOTYPE(void Putchar,(int ch)); void Putchar(int ch);
main(argc, argv) main(argc, argv)
int argc; int argc;

View file

@ -31,9 +31,8 @@
#include "cawf.h" #include "cawf.h"
#include <ctype.h> #include <ctype.h>
_PROTOTYPE(static unsigned char *Convstr,(char *s, int *len)); static unsigned char *Convstr(char *s, int *len);
_PROTOTYPE(static int Convfont,(char *nm, char *s, char **fn, static int Convfont(char *nm, char *s, char **fn, unsigned char **fi);
unsigned char **fi));
#ifndef UNIX #ifndef UNIX
#define strcasecmp strcmpi #define strcasecmp strcmpi

View file

@ -36,32 +36,32 @@
* Prototypes for request processing functions. * Prototypes for request processing functions.
*/ */
_PROTOTYPE(static void nr_UL,(unsigned char *line, int brk)); static void nr_UL(unsigned char *line, int brk);
_PROTOTYPE(static void nr_Ub,(unsigned char *line, int brk)); static void nr_Ub(unsigned char *line, int brk);
_PROTOTYPE(static void nr_Uc,(unsigned char *line, int brk)); static void nr_Uc(unsigned char *line, int brk);
_PROTOTYPE(static void nr_Uf,(unsigned char *line, int brk)); static void nr_Uf(unsigned char *line, int brk);
_PROTOTYPE(static void nr_Ur,(unsigned char *line, int brk)); static void nr_Ur(unsigned char *line, int brk);
_PROTOTYPE(static void nr_ad,(unsigned char *line, int brk)); static void nr_ad(unsigned char *line, int brk);
_PROTOTYPE(static void nr_bp,(unsigned char *line, int brk)); static void nr_bp(unsigned char *line, int brk);
_PROTOTYPE(static void nr_br,(unsigned char *line, int brk)); static void nr_br(unsigned char *line, int brk);
_PROTOTYPE(static void nr_ce,(unsigned char *line, int brk)); static void nr_ce(unsigned char *line, int brk);
_PROTOTYPE(static void nr_di,(unsigned char *line, int brk)); static void nr_di(unsigned char *line, int brk);
_PROTOTYPE(static void nr_ds,(unsigned char *line, int brk)); static void nr_ds(unsigned char *line, int brk);
_PROTOTYPE(static void nr_fi,(unsigned char *line, int brk)); static void nr_fi(unsigned char *line, int brk);
_PROTOTYPE(static void nr_fl,(unsigned char *line, int brk)); static void nr_fl(unsigned char *line, int brk);
_PROTOTYPE(static void nr_ft,(unsigned char *line, int brk)); static void nr_ft(unsigned char *line, int brk);
_PROTOTYPE(static void nr_it,(unsigned char *line, int brk)); static void nr_it(unsigned char *line, int brk);
_PROTOTYPE(static void nr_na,(unsigned char *line, int brk)); static void nr_na(unsigned char *line, int brk);
_PROTOTYPE(static void nr_nf,(unsigned char *line, int brk)); static void nr_nf(unsigned char *line, int brk);
_PROTOTYPE(static void nr_ns,(unsigned char *line, int brk)); static void nr_ns(unsigned char *line, int brk);
_PROTOTYPE(static void nr_rm,(unsigned char *line, int brk)); static void nr_rm(unsigned char *line, int brk);
_PROTOTYPE(static void nr_rn,(unsigned char *line, int brk)); static void nr_rn(unsigned char *line, int brk);
_PROTOTYPE(static void nr_rr,(unsigned char *line, int brk)); static void nr_rr(unsigned char *line, int brk);
_PROTOTYPE(static void nr_rs,(unsigned char *line, int brk)); static void nr_rs(unsigned char *line, int brk);
_PROTOTYPE(static void nr_tm,(unsigned char *line, int brk)); static void nr_tm(unsigned char *line, int brk);
_PROTOTYPE(static void nr_tr,(unsigned char *line, int brk)); static void nr_tr(unsigned char *line, int brk);
_PROTOTYPE(static void nr_nil,(unsigned char *line, int brk)); static void nr_nil(unsigned char *line, int brk);
/* /*

View file

@ -28,7 +28,7 @@
* 4. This notice may not be removed or altered. * 4. This notice may not be removed or altered.
*/ */
#include "ansi.h" #include <minix/ansi.h>
#ifdef UNIX #ifdef UNIX
# ifdef USG # ifdef USG
@ -66,51 +66,51 @@
#include <malloc.h> #include <malloc.h>
# endif /* UNIX */ # endif /* UNIX */
#else /* not STDLIB */ #else /* not STDLIB */
_PROTOTYPE(char *getenv,(char *name)); char *getenv(char *name);
# ifdef UNIX # ifdef UNIX
# ifdef MALLOCH # ifdef MALLOCH
#include <malloc.h> #include <malloc.h>
# else /* not MALLOCH */ # else /* not MALLOCH */
_PROTOTYPE(char *malloc,(unsigned size)); char *malloc(unsigned size);
# endif /* MALLOCH */ # endif /* MALLOCH */
# else /* not UNIX */ # else /* not UNIX */
#include <malloc.h> #include <malloc.h>
# endif /* UNIX */ # endif /* UNIX */
#endif /* STDLIB */ #endif /* STDLIB */
_PROTOTYPE(unsigned char *Asmcode,(unsigned char **s, unsigned char *c)); unsigned char *Asmcode(unsigned char **s, unsigned char *c);
_PROTOTYPE(int Asmname,(unsigned char *s, unsigned char *c)); int Asmname(unsigned char *s, unsigned char *c);
_PROTOTYPE(void Charput,(int c)); void Charput(int c);
_PROTOTYPE(int Delmacro,(int mx)); int Delmacro(int mx);
_PROTOTYPE(int Defdev,()); int Defdev();
_PROTOTYPE(void Delstr,(int sx)); void Delstr(int sx);
_PROTOTYPE(void Error,(int t, int l, char *s1, char *s2)); void Error(int t, int l, char *s1, char *s2);
_PROTOTYPE(void Error3,(int len, char *word, char *sarg, int narg, char *msg)); void Error3(int len, char *word, char *sarg, int narg, char *msg);
_PROTOTYPE(void Expand,(unsigned char *line)); void Expand(unsigned char *line);
_PROTOTYPE(void Delnum,(int nx)); void Delnum(int nx);
_PROTOTYPE(unsigned char *Field,(int n, unsigned char *p, int c)); unsigned char *Field(int n, unsigned char *p, int c);
_PROTOTYPE(void Endword,()); void Endword();
_PROTOTYPE(int Findchar,(unsigned char *nm, int l, unsigned char *s, int e)); int Findchar(unsigned char *nm, int l, unsigned char *s, int e);
_PROTOTYPE(int Findhy,(unsigned char *s, int l, int e)); int Findhy(unsigned char *s, int l, int e);
_PROTOTYPE(int Findmacro,(unsigned char *p, int e)); int Findmacro(unsigned char *p, int e);
_PROTOTYPE(int Findnum,(unsigned char *n, int v, int e)); int Findnum(unsigned char *n, int v, int e);
_PROTOTYPE(int Findparms,(unsigned char *n)); int Findparms(unsigned char *n);
_PROTOTYPE(int Findscale,(int n, double v, int e)); int Findscale(int n, double v, int e);
_PROTOTYPE(unsigned char *Findstr,(unsigned char *nm, unsigned char *s, int e)); unsigned char *Findstr(unsigned char *nm, unsigned char *s, int e);
_PROTOTYPE(int LenprtHF,(unsigned char *s, int p, int t)); int LenprtHF(unsigned char *s, int p, int t);
_PROTOTYPE(int main,(int argc, char *argv[])); int main(int argc, char *argv[]);
_PROTOTYPE(void Macro,(unsigned char *inp)); void Macro(unsigned char *inp);
_PROTOTYPE(void Nreq,(unsigned char *line, int brk)); void Nreq(unsigned char *line, int brk);
_PROTOTYPE(void Free,(unsigned char **p)); void Free(unsigned char **p);
_PROTOTYPE(unsigned char *Newstr,(unsigned char *s)); unsigned char *Newstr(unsigned char *s);
_PROTOTYPE(void Pass2,(unsigned char *line)); void Pass2(unsigned char *line);
_PROTOTYPE(void Pass3,(int len, unsigned char *word, unsigned char *sarg, int narg)); void Pass3(int len, unsigned char *word, unsigned char *sarg, int narg);
_PROTOTYPE(void regerror,(char *s)); void regerror(char *s);
_PROTOTYPE(unsigned char *reg,(int paren, int *flagp)); unsigned char *reg(int paren, int *flagp);
_PROTOTYPE(unsigned char *regatom,(int *flagp)); unsigned char *regatom(int *flagp);
_PROTOTYPE(unsigned char *regbranch,(int *flagp)); unsigned char *regbranch(int *flagp);
_PROTOTYPE(regexp *regcomp,(char *exp)); regexp *regcomp(char *exp);
_PROTOTYPE(void regdump,(regexp *r)); void regdump(regexp *r);
_PROTOTYPE(int regexec,(regexp *prog, unsigned char *string)); int regexec(regexp *prog, unsigned char *string);
_PROTOTYPE(void Stringput,(unsigned char *s)); void Stringput(unsigned char *s);
_PROTOTYPE(int Str2word,(unsigned char *s, int len)); int Str2word(unsigned char *s, int len);

View file

@ -164,23 +164,23 @@ STATIC long regsize; /* Code size. */
/* /*
* Forward declarations for regcomp()'s friends. * Forward declarations for regcomp()'s friends.
*/ */
_PROTOTYPE(STATIC unsigned char *reg, (int paren, int *flagp )); STATIC unsigned char *reg(int paren, int *flagp );
_PROTOTYPE(STATIC unsigned char *regbranch, (int *flagp )); STATIC unsigned char *regbranch(int *flagp );
_PROTOTYPE(STATIC unsigned char *regpiece, (int *flagp )); STATIC unsigned char *regpiece(int *flagp );
_PROTOTYPE(STATIC unsigned char *regatom, (int *flagp )); STATIC unsigned char *regatom(int *flagp );
_PROTOTYPE(STATIC unsigned char *regnode, (int op )); STATIC unsigned char *regnode(int op );
_PROTOTYPE(STATIC void regc, (int b )); STATIC void regc(int b );
_PROTOTYPE(STATIC void reginsert, (int op, unsigned char *opnd )); STATIC void reginsert(int op, unsigned char *opnd );
_PROTOTYPE(STATIC void regtail, (unsigned char *p, unsigned char *val )); STATIC void regtail(unsigned char *p, unsigned char *val );
_PROTOTYPE(STATIC void regoptail, (unsigned char *p, unsigned char *val )); STATIC void regoptail(unsigned char *p, unsigned char *val );
_PROTOTYPE(STATIC int regtry, (regexp *prog, unsigned char *string )); STATIC int regtry(regexp *prog, unsigned char *string );
_PROTOTYPE(STATIC int regmatch, (unsigned char *prog )); STATIC int regmatch(unsigned char *prog );
_PROTOTYPE(STATIC int regrepeat, (unsigned char *p )); STATIC int regrepeat(unsigned char *p );
_PROTOTYPE(STATIC unsigned char *regnext, (unsigned char *p )); STATIC unsigned char *regnext(unsigned char *p );
_PROTOTYPE(STATIC unsigned char *regprop, (unsigned char *op )); STATIC unsigned char *regprop(unsigned char *op );
#ifdef STRCSPN #ifdef STRCSPN
_PROTOTYPE(STATIC int strcspn, (unsigned char *s1, unsigned char *s2 )); STATIC int strcspn(unsigned char *s1, unsigned char *s2 );
#endif #endif
/* /*

View file

@ -31,7 +31,7 @@
#include "cawf.h" #include "cawf.h"
#include <ctype.h> #include <ctype.h>
_PROTOTYPE(static void Setroman,()); static void Setroman();
/* /*

View file

@ -39,8 +39,8 @@ int rflag, errors;
struct stat st; struct stat st;
char path[PATH_MAX + 1]; char path[PATH_MAX + 1];
_PROTOTYPE(int do_change, (char *name)); int do_change(char *name);
_PROTOTYPE(void usage, (void)); void usage(void);
/* Parse a P1003.2 4.7.7-conformant symbolic mode. */ /* Parse a P1003.2 4.7.7-conformant symbolic mode. */
mode_t parsemode(const char *symbolic, mode_t oldmode) mode_t parsemode(const char *symbolic, mode_t oldmode)

View file

@ -36,9 +36,9 @@ char *pgmname, path[PATH_MAX + 1];
uid_t nuid; uid_t nuid;
gid_t ngid; gid_t ngid;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void do_chown, (char *file)); void do_chown(char *file);
_PROTOTYPE(void usage, (void)); void usage(void);
/* Main module. If chown(1) is invoked as chgrp(1), the behaviour is nearly /* Main module. If chown(1) is invoked as chgrp(1), the behaviour is nearly
* identical, except that the default when a single name is given as an * identical, except that the default when a single name is given as an

View file

@ -46,15 +46,15 @@ struct stat stb1, stb2; /* stat buffers for size compare */
char original[] = "/tmp/cioXXXXXX"; /* previous revision */ char original[] = "/tmp/cioXXXXXX"; /* previous revision */
char diffout[] = "/tmp/cidXXXXXX"; /* diffs */ char diffout[] = "/tmp/cidXXXXXX"; /* diffs */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void rundiff, (void)); void rundiff(void);
_PROTOTYPE(void logmsg, (FILE *fp)); void logmsg(FILE *fp);
_PROTOTYPE(void fname, (char *src, char *dst)); void fname(char *src, char *dst);
_PROTOTYPE(void svcname, (char *src, char *dst)); void svcname(char *src, char *dst);
_PROTOTYPE(int lockcheck, (FILE *fp, int rev)); int lockcheck(FILE *fp, int rev);
_PROTOTYPE(void onintr, (int dummy)); void onintr(int dummy);
_PROTOTYPE(void clean, (void)); void clean(void);
_PROTOTYPE(char *whoami, (void)); char *whoami(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -71,9 +71,9 @@ unsigned long crctab[] = {
0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
}; };
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void crc, (int fd, char *name)); void crc(int fd, char *name);
_PROTOTYPE(unsigned long strncrc, (unsigned char *b, int n, unsigned long s)); unsigned long strncrc(unsigned char *b, int n, unsigned long s);
static int aux; static int aux;

View file

@ -8,10 +8,10 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
_PROTOTYPE(void fatal, (char *label)); void fatal(char *label);
_PROTOTYPE(int cmp, (int fd1, int fd2)); int cmp(int fd1, int fd2);
_PROTOTYPE(void Usage, (void)); void Usage(void);
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
#define BLOCK 4096 #define BLOCK 4096

View file

@ -35,13 +35,13 @@ char *base; /* basename of file */
char difftemp[PATHLEN]; /* extract() fix/patch input */ char difftemp[PATHLEN]; /* extract() fix/patch input */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void fname, (char *src, char *dst)); void fname(char *src, char *dst);
_PROTOTYPE(void svcname, (char *src, char *dst)); void svcname(char *src, char *dst);
_PROTOTYPE(void extract, (char *script, char *out, int rev)); void extract(char *script, char *out, int rev);
_PROTOTYPE(char *basename, (char *name)); char *basename(char *name);
_PROTOTYPE(char *whoami, (void)); char *whoami(void);
_PROTOTYPE(int getyn, (void)); int getyn(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -37,15 +37,15 @@ int colflgs[3] = {1, 2, 3}; /* number of tabs + 1: 0 => no column */
static char *umsg = "Usage: comm [-[123]] file1 file2\n"; static char *umsg = "Usage: comm [-[123]] file1 file2\n";
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(void error, (char *s, char *f)); void error(char *s, char *f);
_PROTOTYPE(void eopen, (char *fn, struct file *file)); void eopen(char *fn, struct file *file);
_PROTOTYPE(int getbuf, (struct file *file)); int getbuf(struct file *file);
_PROTOTYPE(int readline, (int fno)); int readline(int fno);
_PROTOTYPE(void comm, (void)); void comm(void);
_PROTOTYPE(void putcol, (int col, char *buf)); void putcol(int col, char *buf);
_PROTOTYPE(void cpycol, (int col)); void cpycol(int col);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -218,22 +218,22 @@ count_int fsize;
code_int free_ent = 0; /* first unused entry */ code_int free_ent = 0; /* first unused entry */
int exit_stat = 0; int exit_stat = 0;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void Usage, (void)); void Usage(void);
_PROTOTYPE(void compress, (void)); void compress(void);
_PROTOTYPE(void onintr, (int dummy)); void onintr(int dummy);
_PROTOTYPE(void oops, (int dummy)); void oops(int dummy);
_PROTOTYPE(void output, (code_int code)); void output(code_int code);
_PROTOTYPE(int foreground, (void)); int foreground(void);
_PROTOTYPE(void decompress, (void)); void decompress(void);
_PROTOTYPE(code_int getcode, (void)); code_int getcode(void);
_PROTOTYPE(void writeerr, (void)); void writeerr(void);
_PROTOTYPE(void copystat, (char *ifname, char *ofname)); void copystat(char *ifname, char *ofname);
_PROTOTYPE(int foreground, (void)); int foreground(void);
_PROTOTYPE(void cl_block , (void)); void cl_block(void);
_PROTOTYPE(void cl_hash, (count_int hsize)); void cl_hash(count_int hsize);
_PROTOTYPE(void prratio, (FILE *stream, long int num, long int den)); void prratio(FILE *stream, long int num, long int den);
_PROTOTYPE(void version, (void)); void version(void);
void Usage() { void Usage() {
#ifdef DEBUG #ifdef DEBUG

View file

@ -18,16 +18,16 @@
char *pch, *errorp; char *pch, *errorp;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(BOOLEAN is, (char *pc)); BOOLEAN is(char *pc);
_PROTOTYPE(int num, (void)); int num(void);
_PROTOTYPE(void puto, (void)); void puto(void);
_PROTOTYPE(void statistics, (void)); void statistics(void);
_PROTOTYPE(int ulcase, (int c)); int ulcase(int c);
_PROTOTYPE(void cnull, (int c)); void cnull(int c);
_PROTOTYPE(void null, (int c)); void null(int c);
_PROTOTYPE(void extra, (void)); void extra(void);
_PROTOTYPE(void over, (int dummy)); void over(int dummy);
BOOLEAN is(pc) BOOLEAN is(pc)
char *pc; char *pc;

View file

@ -110,14 +110,14 @@ int maxbits; /* limit on number of bits */
int clearflg; /* if set, allow CLEAR */ int clearflg; /* if set, allow CLEAR */
int inmod; /* mod 8 for getbits() */ int inmod; /* mod 8 for getbits() */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void ffork, (void)); void ffork(void);
_PROTOTYPE(void die, (char *s)); void die(char *s);
_PROTOTYPE(void myputc, (unsigned c)); void myputc(unsigned c);
_PROTOTYPE(unsigned mygetc, (void)); unsigned mygetc(void);
_PROTOTYPE(void getbits, (void)); void getbits(void);
_PROTOTYPE(void getpipe, (void)); void getpipe(void);
_PROTOTYPE(void putpipe, (unsigned u, int flag)); void putpipe(unsigned u, int flag);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -191,29 +191,24 @@ typedef int boolean;
#include <sys/times.h> #include <sys/times.h>
#endif #endif
#ifndef _PROTOTYPE int main(void);
#define _PROTOTYPE(fun, args) fun args void prep_timer(void);
#endif void timeout(int sig);
void Proc0(void);
void Proc1(RecordPtr PtrParIn);
void Proc2(OneToFifty *IntParIO);
void Proc3(RecordPtr *PtrParOut);
void Proc4(void);
void Proc5(void);
void Proc6(Enumeration EnumParIn, Enumeration *EnumParOut);
void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty
*IntParOut);
void Proc8(Array1Dim Array1Par, Array2Dim Array2Par, OneToFifty
IntParI1, OneToFifty IntParI2);
boolean Func2(String30 StrParI1, String30 StrParI2);
boolean Func3(Enumeration EnumParIn);
_PROTOTYPE(int main, (void)); Enumeration Func1(int CharPar1, int CharPar2);
_PROTOTYPE(void prep_timer, (void));
_PROTOTYPE(void timeout, (int sig));
_PROTOTYPE(void Proc0, (void));
_PROTOTYPE(void Proc1, (RecordPtr PtrParIn));
_PROTOTYPE(void Proc2, (OneToFifty *IntParIO));
_PROTOTYPE(void Proc3, (RecordPtr *PtrParOut));
_PROTOTYPE(void Proc4, (void));
_PROTOTYPE(void Proc5, (void));
_PROTOTYPE(void Proc6, (Enumeration EnumParIn, Enumeration *EnumParOut));
_PROTOTYPE(void Proc7, (OneToFifty IntParI1, OneToFifty IntParI2,
OneToFifty *IntParOut));
_PROTOTYPE(void Proc8, (Array1Dim Array1Par, Array2Dim Array2Par,
OneToFifty IntParI1, OneToFifty IntParI2));
/*_PROTOTYPE(Enumeration Func1,(CapitalLetter CharPar1, CapitalLetter CharPar2));*/
_PROTOTYPE(boolean Func2, (String30 StrParI1, String30 StrParI2));
_PROTOTYPE(boolean Func3, (Enumeration EnumParIn));
_PROTOTYPE(Enumeration Func1, (int CharPar1, int CharPar2));
int main() int main()

View file

@ -117,31 +117,33 @@ static unsigned int cache_size;
/* Prototypes. */ /* Prototypes. */
_PROTOTYPE(void usage, (char *prog_name) ); void usage(char *prog_name);
_PROTOTYPE(unsigned c2u2, (unsigned char *ucarray) ); unsigned c2u2(unsigned char *ucarray);
_PROTOTYPE(unsigned long c4u4, (unsigned char *ucarray) ); unsigned long c4u4(unsigned char *ucarray);
_PROTOTYPE(void determine, (void)); void determine(void);
_PROTOTYPE(int main, (int argc, char *argv [])); int main(int argc, char *argv []);
_PROTOTYPE(DIRECTORY *directory, (DIRECTORY *dir, int entries, BOOL function, char *pathname) ); DIRECTORY *directory(DIRECTORY *dir, int entries, BOOL function, char
_PROTOTYPE(void extract, (DIRECTORY *entry) ); *pathname);
_PROTOTYPE(void make_file, (DIRECTORY *dir_ptr, int entries, char *name) ); void extract(DIRECTORY *entry);
_PROTOTYPE(void fill_date, (DIRECTORY *entry) ); void make_file(DIRECTORY *dir_ptr, int entries, char *name);
_PROTOTYPE(char *make_name, (DIRECTORY *dir_ptr, int dir_fl) ); void fill_date(DIRECTORY *entry);
_PROTOTYPE(int fill, (char *buffer, size_t size) ); char *make_name(DIRECTORY *dir_ptr, int dir_fl);
_PROTOTYPE(void xmodes, (int mode) ); int fill(char *buffer, size_t size);
_PROTOTYPE(void show, (DIRECTORY *dir_ptr, char *name) ); void xmodes(int mode);
_PROTOTYPE(void free_blocks, (void)); void show(DIRECTORY *dir_ptr, char *name);
_PROTOTYPE(DIRECTORY *read_cluster, (unsigned int cluster) ); void free_blocks(void);
_PROTOTYPE(unsigned short free_cluster, (BOOL leave_fl) ); DIRECTORY *read_cluster(unsigned int cluster);
_PROTOTYPE(void link_fat, (unsigned int cl_1, unsigned int cl_2) ); unsigned short free_cluster(BOOL leave_fl);
_PROTOTYPE(unsigned short next_cluster, (unsigned int cl_no) ); void link_fat(unsigned int cl_1, unsigned int cl_2);
_PROTOTYPE(char *slash, (char *str) ); unsigned short next_cluster(unsigned int cl_no);
_PROTOTYPE(void add_path, (char *file, BOOL slash_fl) ); char *slash(char *str);
_PROTOTYPE(void disk_io, (BOOL op, unsigned long seek, void *address, unsigned bytes) ); void add_path(char *file, BOOL slash_fl);
_PROTOTYPE(void flush_fat, (void)); void disk_io(BOOL op, unsigned long seek, void *address, unsigned
_PROTOTYPE(void read_fat, (unsigned int cl_no)); bytes);
_PROTOTYPE(BOOL free_range, (unsigned short *first, unsigned short *last)); void flush_fat(void);
_PROTOTYPE(long lmin, (long a, long b)); void read_fat(unsigned int cl_no);
BOOL free_range(unsigned short *first, unsigned short *last);
long lmin(long a, long b);
void usage(prog_name) void usage(prog_name)

View file

@ -11,8 +11,8 @@
int column = 0; /* Current column, retained between files */ int column = 0; /* Current column, retained between files */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void Expand, (FILE *f, int tab_index, int tabs [])); void Expand(FILE *f, int tab_index, int tabs []);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -3,8 +3,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(long first, (long k)); long first(long k);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -82,31 +82,31 @@ int ncyl = 1024;
int readonly; int readonly;
int override= 0; int override= 0;
_PROTOTYPE(int main, (int argc, char *argv [])); int main(int argc, char *argv []);
_PROTOTYPE(void getgeom, (void)); void getgeom(void);
_PROTOTYPE(int getboot, (char *buffer)); int getboot(char *buffer);
_PROTOTYPE(int putboot, (char *buffer)); int putboot(char *buffer);
_PROTOTYPE(void load_from_file, (void)); void load_from_file(void);
_PROTOTYPE(void save_to_file, (void)); void save_to_file(void);
_PROTOTYPE(int dpl_partitions, (int rawflag)); int dpl_partitions(int rawflag);
_PROTOTYPE(int chk_table, (void)); int chk_table(void);
_PROTOTYPE(int sec_to_hst, (long logsec, unsigned char *hd, unsigned char *sec, int sec_to_hst(long logsec, unsigned char *hd, unsigned char *sec,
unsigned char *cyl)); unsigned char *cyl);
_PROTOTYPE(int mark_partition, (struct part_entry *pe)); int mark_partition(struct part_entry *pe);
_PROTOTYPE(void change_partition, (struct part_entry *entry)); void change_partition(struct part_entry *entry);
_PROTOTYPE(int get_a_char, (void)); int get_a_char(void);
_PROTOTYPE(int print_menu, (void)); int print_menu(void);
_PROTOTYPE(void adj_base, (struct part_entry *pe)); void adj_base(struct part_entry *pe);
_PROTOTYPE(void adj_size, (struct part_entry *pe)); void adj_size(struct part_entry *pe);
_PROTOTYPE(struct part_entry *ask_partition, (void)); struct part_entry *ask_partition(void);
_PROTOTYPE(void footnotes, (void)); void footnotes(void);
_PROTOTYPE(int get_an_int, (char *prompt, int *intptr)); int get_an_int(char *prompt, int *intptr);
_PROTOTYPE(void list_part_types, (void)); void list_part_types(void);
_PROTOTYPE(void mark_npartition, (struct part_entry *pe)); void mark_npartition(struct part_entry *pe);
_PROTOTYPE(int mygets, (char *buf, int length)); int mygets(char *buf, int length);
_PROTOTYPE(char *systype, (int type)); char *systype(int type);
_PROTOTYPE(void toggle_active, (struct part_entry *pe)); void toggle_active(struct part_entry *pe);
_PROTOTYPE(void usage, (void)); void usage(void);
/* One featureful master bootstrap. */ /* One featureful master bootstrap. */
char bootstrap[] = { char bootstrap[] = {

View file

@ -65,10 +65,10 @@ struct info {
int tabsize = sizeof(table) / sizeof(struct info); int tabsize = sizeof(table) / sizeof(struct info);
int L_flag; int L_flag;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void file, (char *name)); void file(char *name);
_PROTOTYPE(void do_strip, (int type)); void do_strip(int type);
_PROTOTYPE(void usage, (void)); void usage(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -42,12 +42,13 @@ char *prog = 0, *processing = 0;
/* getline() already declared in stdio.h */ /* getline() already declared in stdio.h */
#define getline fix_getline #define getline fix_getline
#endif #endif
_PROTOTYPE(char *getline, (FILE *fp, char *b)); char *getline(FILE *fp, char *b);
_PROTOTYPE(char *range, (char *s, int *p1, int *p2)); char *range(char *s, int *p1, int *p2);
_PROTOTYPE(int getcommand, (FILE *fp, int *o1, int *o2, char *pcmd, int *n1, int *n2)); int getcommand(FILE *fp, int *o1, int *o2, char *pcmd, int *n1, int
_PROTOTYPE(void fatal, (const char *s, ...)); *n2);
_PROTOTYPE(int strwcmp, (char *s1, char *s2)); void fatal(const char *s, ...);
_PROTOTYPE(int whitespace, (int ch)); int strwcmp(char *s1, char *s2);
int whitespace(int ch);
char * char *
getline(FILE *fp, char *b) getline(FILE *fp, char *b)

View file

@ -10,8 +10,8 @@
int column = 0; /* Current column, retained between files */ int column = 0; /* Current column, retained between files */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void Fold, (FILE *f, int width)); void Fold(FILE *f, int width);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -12,8 +12,8 @@
static char *Copyright = "\0Copyright (c) 1990 Bert Reuling"; static char *Copyright = "\0Copyright (c) 1990 Bert Reuling";
static unsigned long seed; static unsigned long seed;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(unsigned long magic, (unsigned long range)); unsigned long magic(unsigned long range);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -154,72 +154,76 @@ int firstlist; /* has the listing header been printed? */
unsigned part_offset; /* sector offset for this partition */ unsigned part_offset; /* sector offset for this partition */
char answer[] = "Answer questions with y or n. Then hit RETURN"; char answer[] = "Answer questions with y or n. Then hit RETURN";
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void initvars, (void)); void initvars(void);
_PROTOTYPE(void fatal, (char *s)); void fatal(char *s);
_PROTOTYPE(int eoln, (int c)); int eoln(int c);
_PROTOTYPE(int yes, (char *question)); int yes(char *question);
_PROTOTYPE(int atoo, (char *s)); int atoo(char *s);
_PROTOTYPE(int input, (char *buf, int size)); int input(char *buf, int size);
_PROTOTYPE(char *alloc, (unsigned nelem, unsigned elsize)); char *alloc(unsigned nelem, unsigned elsize);
_PROTOTYPE(void printname, (char *s)); void printname(char *s);
_PROTOTYPE(void printrec, (struct stack *sp)); void printrec(struct stack *sp);
_PROTOTYPE(void printpath, (int mode, int nlcr)); void printpath(int mode, int nlcr);
_PROTOTYPE(void devopen, (void)); void devopen(void);
_PROTOTYPE(void devclose, (void)); void devclose(void);
_PROTOTYPE(void devio, (block_nr bno, int dir)); void devio(block_nr bno, int dir);
_PROTOTYPE(void devread, (long block, long offset, char *buf, int size)); void devread(long block, long offset, char *buf, int size);
_PROTOTYPE(void devwrite, (long block, long offset, char *buf, int size)); void devwrite(long block, long offset, char *buf, int size);
_PROTOTYPE(void pr, (char *fmt, int cnt, char *s, char *p)); void pr(char *fmt, int cnt, char *s, char *p);
_PROTOTYPE(void lpr, (char *fmt, long cnt, char *s, char *p)); void lpr(char *fmt, long cnt, char *s, char *p);
_PROTOTYPE(bit_nr getnumber, (char *s)); bit_nr getnumber(char *s);
_PROTOTYPE(char **getlist, (char ***argv, char *type)); char **getlist(char ***argv, char *type);
_PROTOTYPE(void lsuper, (void)); void lsuper(void);
#define SUPER_GET 0 #define SUPER_GET 0
#define SUPER_PUT 1 #define SUPER_PUT 1
_PROTOTYPE(void rw_super, (int mode)); void rw_super(int mode);
_PROTOTYPE(void chksuper, (void)); void chksuper(void);
_PROTOTYPE(void lsi, (char **clist)); void lsi(char **clist);
_PROTOTYPE(bitchunk_t *allocbitmap, (int nblk)); bitchunk_t *allocbitmap(int nblk);
_PROTOTYPE(void loadbitmap, (bitchunk_t *bitmap, block_nr bno, int nblk)); void loadbitmap(bitchunk_t *bitmap, block_nr bno, int nblk);
_PROTOTYPE(void dumpbitmap, (bitchunk_t *bitmap, block_nr bno, int nblk)); void dumpbitmap(bitchunk_t *bitmap, block_nr bno, int nblk);
_PROTOTYPE(void fillbitmap, (bitchunk_t *bitmap, bit_nr lwb, bit_nr upb, char **list)); void fillbitmap(bitchunk_t *bitmap, bit_nr lwb, bit_nr upb, char
_PROTOTYPE(void freebitmap, (bitchunk_t *p)); **list);
_PROTOTYPE(void getbitmaps, (void)); void freebitmap(bitchunk_t *p);
_PROTOTYPE(void putbitmaps, (void)); void getbitmaps(void);
_PROTOTYPE(void chkword, (unsigned w1, unsigned w2, bit_nr bit, char *type, int *n, int *report, bit_t)); void putbitmaps(void);
_PROTOTYPE(void chkmap, (bitchunk_t *cmap, bitchunk_t *dmap, bit_nr bit, block_nr blkno, int nblk, char *type)); void chkword(unsigned w1, unsigned w2, bit_nr bit, char *type, int *n,
_PROTOTYPE(void chkilist, (void)); int *report, bit_t);
_PROTOTYPE(void getcount, (void)); void chkmap(bitchunk_t *cmap, bitchunk_t *dmap, bit_nr bit, block_nr
_PROTOTYPE(void counterror, (ino_t ino)); blkno, int nblk, char *type);
_PROTOTYPE(void chkcount, (void)); void chkilist(void);
_PROTOTYPE(void freecount, (void)); void getcount(void);
_PROTOTYPE(void printperm, (mode_t mode, int shift, int special, int overlay)); void counterror(ino_t ino);
_PROTOTYPE(void list, (ino_t ino, d_inode *ip)); void chkcount(void);
_PROTOTYPE(int Remove, (dir_struct *dp)); void freecount(void);
_PROTOTYPE(void make_printable_name, (char *dst, char *src, int n)); void printperm(mode_t mode, int shift, int special, int overlay);
_PROTOTYPE(int chkdots, (ino_t ino, off_t pos, dir_struct *dp, ino_t exp)); void list(ino_t ino, d_inode *ip);
_PROTOTYPE(int chkname, (ino_t ino, dir_struct *dp)); int Remove(dir_struct *dp);
_PROTOTYPE(int chkentry, (ino_t ino, off_t pos, dir_struct *dp)); void make_printable_name(char *dst, char *src, int n);
_PROTOTYPE(int chkdirzone, (ino_t ino, d_inode *ip, off_t pos, zone_nr zno)); int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp);
_PROTOTYPE(int chksymlinkzone, (ino_t ino, d_inode *ip, off_t pos, int chkname(ino_t ino, dir_struct *dp);
zone_nr zno)); int chkentry(ino_t ino, off_t pos, dir_struct *dp);
_PROTOTYPE(void errzone, (char *mess, zone_nr zno, int level, off_t pos)); int chkdirzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno);
_PROTOTYPE(int markzone, (zone_nr zno, int level, off_t pos)); int chksymlinkzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno);
_PROTOTYPE(int chkindzone, (ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)); void errzone(char *mess, zone_nr zno, int level, off_t pos);
_PROTOTYPE(off_t jump, (int level)); int markzone(zone_nr zno, int level, off_t pos);
_PROTOTYPE(int zonechk, (ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)); int chkindzone(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int
_PROTOTYPE(int chkzones, (ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int len, int level)); level);
_PROTOTYPE(int chkfile, (ino_t ino, d_inode *ip)); off_t jump(int level);
_PROTOTYPE(int chkdirectory, (ino_t ino, d_inode *ip)); int zonechk(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level);
_PROTOTYPE(int chklink, (ino_t ino, d_inode *ip)); int chkzones(ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int
_PROTOTYPE(int chkspecial, (ino_t ino, d_inode *ip)); len, int level);
_PROTOTYPE(int chkmode, (ino_t ino, d_inode *ip)); int chkfile(ino_t ino, d_inode *ip);
_PROTOTYPE(int chkinode, (ino_t ino, d_inode *ip)); int chkdirectory(ino_t ino, d_inode *ip);
_PROTOTYPE(int descendtree, (dir_struct *dp)); int chklink(ino_t ino, d_inode *ip);
_PROTOTYPE(void chktree, (void)); int chkspecial(ino_t ino, d_inode *ip);
_PROTOTYPE(void printtotal, (void)); int chkmode(ino_t ino, d_inode *ip);
_PROTOTYPE(void chkdev, (char *f, char **clist, char **ilist, char **zlist)); int chkinode(ino_t ino, d_inode *ip);
int descendtree(dir_struct *dp);
void chktree(void);
void printtotal(void);
void chkdev(char *f, char **clist, char **ilist, char **zlist);
/* Initialize the variables used by this program. */ /* Initialize the variables used by this program. */
void initvars() void initvars()

View file

@ -22,10 +22,10 @@
#include "file.h" #include "file.h"
#include "net.h" #include "net.h"
_PROTOTYPE(static char *dir, (char *path, int full)); static char *dir(char *path, int full);
_PROTOTYPE(static int asciisize, (int fd, off_t *filesize)); static int asciisize(int fd, off_t *filesize);
_PROTOTYPE(static off_t asciisetsize, (int fd, off_t filesize)); static off_t asciisetsize(int fd, off_t filesize);
_PROTOTYPE(static int cloneit, (char *file, int mode)); static int cloneit(char *file, int mode);
#if (__WORD_SIZE == 4) #if (__WORD_SIZE == 4)
static char buffer[8192]; static char buffer[8192];

View file

@ -6,28 +6,28 @@
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com> * 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/ */
_PROTOTYPE(int recvfile, (int fd, int fdin)); int recvfile(int fd, int fdin);
_PROTOTYPE(int sendfile, (int fd, int fdout)); int sendfile(int fd, int fdout);
_PROTOTYPE(int DOascii, (void)); int DOascii(void);
_PROTOTYPE(int DObinary, (void)); int DObinary(void);
_PROTOTYPE(int DOblock, (void)); int DOblock(void);
_PROTOTYPE(int DOstream, (void)); int DOstream(void);
_PROTOTYPE(int DOpwd, (void)); int DOpwd(void);
_PROTOTYPE(int DOcd, (void)); int DOcd(void);
_PROTOTYPE(int DOmkdir, (void)); int DOmkdir(void);
_PROTOTYPE(int DOrmdir, (void)); int DOrmdir(void);
_PROTOTYPE(int DOdelete, (void)); int DOdelete(void);
_PROTOTYPE(int DOmdtm, (void)); int DOmdtm(void);
_PROTOTYPE(int DOsize, (void)); int DOsize(void);
_PROTOTYPE(int DOstat, (void)); int DOstat(void);
_PROTOTYPE(int DOlist, (void)); int DOlist(void);
_PROTOTYPE(int DOnlst, (void)); int DOnlst(void);
_PROTOTYPE(int DOretr, (void)); int DOretr(void);
_PROTOTYPE(int DOrretr, (void)); int DOrretr(void);
_PROTOTYPE(int DOMretr, (void)); int DOMretr(void);
_PROTOTYPE(int DOappe, (void)); int DOappe(void);
_PROTOTYPE(int DOstor, (void)); int DOstor(void);
_PROTOTYPE(int DOrstor, (void)); int DOrstor(void);
_PROTOTYPE(int DOstou, (void)); int DOstou(void);
_PROTOTYPE(int DOMstor, (void)); int DOMstor(void);
_PROTOTYPE(int DOclone, (void)); int DOclone(void);

View file

@ -50,11 +50,11 @@ char reply[1024];
#define getline ftp_getline #define getline ftp_getline
#endif #endif
_PROTOTYPE(static void makeargs, (char *buff)); static void makeargs(char *buff);
_PROTOTYPE(int DOver, (void)); int DOver(void);
_PROTOTYPE(int DOhelp, (void)); int DOhelp(void);
_PROTOTYPE(static int getline, (char *line, int len)); static int getline(char *line, int len);
_PROTOTYPE(int main, (int argc, char *argv[])); int main(int argc, char *argv[]);
static void makeargs(buff) static void makeargs(buff)
@ -310,7 +310,7 @@ char junk[10];
struct commands { struct commands {
char *name; char *name;
_PROTOTYPE(int (*func), (void)); int(*func) (void);
}; };
static struct commands commands[] = { static struct commands commands[] = {

View file

@ -33,7 +33,7 @@ extern char reply[1024];
#define MODE_B_EOF 64 #define MODE_B_EOF 64
_PROTOTYPE(int readline, (char *prompt, char *buff, int len)); int readline(char *prompt, char *buff, int len);
_PROTOTYPE(int DOgetreply, (void)); int DOgetreply(void);
_PROTOTYPE(int DOcmdcheck, (void)); int DOcmdcheck(void);
_PROTOTYPE(int DOcommand, (char *ftpcommand, char *ftparg)); int DOcommand(char *ftpcommand, char *ftparg);

View file

@ -19,7 +19,7 @@
static char line2[512]; static char line2[512];
_PROTOTYPE(static void dodir, (char *path, int full)); static void dodir(char *path, int full);
int DOlpwd() int DOlpwd()
{ {

View file

@ -6,10 +6,10 @@
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com> * 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/ */
_PROTOTYPE(int DOlpwd, (void)); int DOlpwd(void);
_PROTOTYPE(int DOlcd, (void)); int DOlcd(void);
_PROTOTYPE(int DOlmkdir, (void)); int DOlmkdir(void);
_PROTOTYPE(int DOlrmdir, (void)); int DOlrmdir(void);
_PROTOTYPE(int DOllist, (void)); int DOllist(void);
_PROTOTYPE(int DOlnlst, (void)); int DOlnlst(void);
_PROTOTYPE(int DOlshell, (void)); int DOlshell(void);

View file

@ -29,7 +29,7 @@
#include "xfer.h" #include "xfer.h"
#include "net.h" #include "net.h"
_PROTOTYPE(void donothing, (int sig)); void donothing(int sig);
int ftpcomm_fd; int ftpcomm_fd;
static ipaddr_t myip; static ipaddr_t myip;

View file

@ -6,10 +6,10 @@
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com> * 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/ */
_PROTOTYPE(int NETinit, (void)); int NETinit(void);
_PROTOTYPE(int DOopen, (void)); int DOopen(void);
_PROTOTYPE(int DOclose, (void)); int DOclose(void);
_PROTOTYPE(int DOquit, (void)); int DOquit(void);
_PROTOTYPE(int DOdata, (char *datacom, char *file, int direction, int fd)); int DOdata(char *datacom, char *file, int direction, int fd);
extern int ftpcomm_fd; extern int ftpcomm_fd;

View file

@ -16,7 +16,7 @@
#include "ftp.h" #include "ftp.h"
#include "other.h" #include "other.h"
_PROTOTYPE(static int docmdargs, (char *cmd, int fa)); static int docmdargs(char *cmd, int fa);
void FTPinit() void FTPinit()
{ {

View file

@ -6,12 +6,12 @@
* 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com> * 01/25/96 Initial Release Michael Temari, <Michael@TemWare.Com>
*/ */
_PROTOTYPE(void FTPinit, (void)); void FTPinit(void);
_PROTOTYPE(int DOpass, (void)); int DOpass(void);
_PROTOTYPE(int DOuser, (void)); int DOuser(void);
_PROTOTYPE(int DOnoop, (void)); int DOnoop(void);
_PROTOTYPE(int DOpassive, (void)); int DOpassive(void);
_PROTOTYPE(int DOsyst, (void)); int DOsyst(void);
_PROTOTYPE(int DOremotehelp, (void)); int DOremotehelp(void);
_PROTOTYPE(int DOquote, (void)); int DOquote(void);
_PROTOTYPE(int DOsite, (void)); int DOsite(void);

View file

@ -22,10 +22,10 @@
#include "ftp.h" #include "ftp.h"
#include "xfer.h" #include "xfer.h"
_PROTOTYPE(static int asciisend, (int fd, int fdout)); static int asciisend(int fd, int fdout);
_PROTOTYPE(static int binarysend, (int fd, int fdout)); static int binarysend(int fd, int fdout);
_PROTOTYPE(static int asciirecv, (int fd, int fdin)); static int asciirecv(int fd, int fdin);
_PROTOTYPE(static int binaryrecv, (int fd, int fdin)); static int binaryrecv(int fd, int fdin);
#if (__WORD_SIZE == 4) #if (__WORD_SIZE == 4)
static char buffer[8192]; static char buffer[8192];

View file

@ -4,5 +4,5 @@
* *
*/ */
_PROTOTYPE(int recvfile, (int fd, int fdin)); int recvfile(int fd, int fdin);
_PROTOTYPE(int sendfile, (int fd, int fdout)); int sendfile(int fd, int fdout);

View file

@ -7,9 +7,9 @@
#define DEFAULT 10 #define DEFAULT 10
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void do_file, (int n, FILE *f)); void do_file(int n, FILE *f);
_PROTOTYPE(void usage, (void)); void usage(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -53,18 +53,18 @@ extern int optind;
extern char *optarg; extern char *optarg;
/* Prototypes. */ /* Prototypes. */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(char fgetarg, (FILE *stream, char *cbuf)); char fgetarg(FILE *stream, char *cbuf);
_PROTOTYPE(int find, (char *symd)); int find(char *symd);
_PROTOTYPE(void defit, (char *sym, int redef, int typed)); void defit(char *sym, int redef, int typed);
_PROTOTYPE(void stop, (void)); void stop(void);
_PROTOTYPE(void gotoeoln, (void)); void gotoeoln(void);
_PROTOTYPE(void prteoln, (void)); void prteoln(void);
_PROTOTYPE(void printtable, (void)); void printtable(void);
_PROTOTYPE(char getendif, (void)); char getendif(void);
_PROTOTYPE(void gettable, (void)); void gettable(void);
_PROTOTYPE(void parse, (void)); void parse(void);
_PROTOTYPE(void usage, (void)); void usage(void);
#ifdef __STDC__ #ifdef __STDC__
char fgetarg ( FILE *stream , char *cbuf ) char fgetarg ( FILE *stream , char *cbuf )

View file

@ -142,27 +142,27 @@ struct dir_entry
#define IS_DIR(PTR) (PTR->flags[-High_Sierra] & 2 ? 1 : 0) #define IS_DIR(PTR) (PTR->flags[-High_Sierra] & 2 ? 1 : 0)
_PROTOTYPE (int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE (int iso_cmp, (char *name, struct dir_entry *dir_ptr, int dir_flag)); int iso_cmp(char *name, struct dir_entry *dir_ptr, int dir_flag);
_PROTOTYPE (void list_dir, (struct dir_entry *dir_ptr)); void list_dir(struct dir_entry *dir_ptr);
_PROTOTYPE (void list_file, (struct dir_entry *dir_ptr)); void list_file(struct dir_entry *dir_ptr);
_PROTOTYPE (struct dir_entry *look_up, (char *name)); struct dir_entry *look_up(char *name);
_PROTOTYPE (void recurse_dir, (char *path, struct dir_entry *dir_ptr)); void recurse_dir(char *path, struct dir_entry *dir_ptr);
_PROTOTYPE (void read_device, (long offset, int nr_of_bytes, char *buffer)); void read_device(long offset, int nr_of_bytes, char *buffer);
_PROTOTYPE (int valid_fs, (void) ); int valid_fs(void);
_PROTOTYPE (void usage, (void) ); void usage(void);
_PROTOTYPE (void print_date, (char *date)); void print_date(char *date);
_PROTOTYPE (void print_dir_date, (char *date)); void print_dir_date(char *date);
_PROTOTYPE (void iso_info, (struct iso9660_descriptor *vol_desc)); void iso_info(struct iso9660_descriptor *vol_desc);
_PROTOTYPE (void hs_info, (struct high_sierra_descriptor *vol_desc)); void hs_info(struct high_sierra_descriptor *vol_desc);
_PROTOTYPE (int iso_711, (char *c)); int iso_711(char *c);
_PROTOTYPE (int iso_712, (char *c)); int iso_712(char *c);
_PROTOTYPE (int iso_721, (char *c)); int iso_721(char *c);
_PROTOTYPE (int iso_722, (char *c)); int iso_722(char *c);
_PROTOTYPE (int iso_723, (char *c)); int iso_723(char *c);
_PROTOTYPE (long iso_731, (char *c)); long iso_731(char *c);
_PROTOTYPE (long iso_732, (char *c)); long iso_732(char *c);
_PROTOTYPE (long iso_733, (char *c)); long iso_733(char *c);
char Buffer[BLOCK_SIZE]; /* buffer to hold read data */ char Buffer[BLOCK_SIZE]; /* buffer to hold read data */

View file

@ -11,24 +11,24 @@
#define MAXFLD 200 /* maximum # of fields to accept */ #define MAXFLD 200 /* maximum # of fields to accept */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void error, (char *s, char *t)); void error(char *s, char *t);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(void match, (void)); void match(void);
_PROTOTYPE(void f1_only, (void)); void f1_only(void);
_PROTOTYPE(void f2_only, (void)); void f2_only(void);
_PROTOTYPE(void output, (int flag)); void output(int flag);
_PROTOTYPE(void outfld, (int file)); void outfld(int file);
_PROTOTYPE(void outputf, (int flag)); void outputf(int flag);
_PROTOTYPE(int compare, (void)); int compare(void);
_PROTOTYPE(int get1, (void)); int get1(void);
_PROTOTYPE(int get2, (int back)); int get2(int back);
_PROTOTYPE(int getrec, (int file)); int getrec(int file);
_PROTOTYPE(int split, (int file)); int split(int file);
_PROTOTYPE(int atoi, (char *str)); int atoi(char *str);
_PROTOTYPE(int exit, (int val)); int exit(int val);
_PROTOTYPE(FILE * efopen, (char *file, char *mode)); FILE * efopen(char *file, char *mode);
_PROTOTYPE(void (*outfun), (int file)); /* output func: output() or outputf()*/ void(*outfun) (int file);
#define F1 1 #define F1 1
#define F2 2 #define F2 2

View file

@ -7,8 +7,8 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void usage, (void)); void usage(void);
/* Table of signal names. */ /* Table of signal names. */
struct signames { struct signames {

View file

@ -95,15 +95,15 @@ char *boot_down; /* "crash" or "down " flag */
logout *first_link = NULL; /* List of logout times */ logout *first_link = NULL; /* List of logout times */
int interrupt = FALSE; /* If sigint or sigquit occurs */ int interrupt = FALSE; /* If sigint or sigquit occurs */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void Sigint, (int sig)); void Sigint(int sig);
_PROTOTYPE(void Sigquit, (int sig)); void Sigquit(int sig);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(void Process, (struct utmp *wtmp)); void Process(struct utmp *wtmp);
_PROTOTYPE(int Print_Record, (struct utmp *wtmp)); int Print_Record(struct utmp *wtmp);
_PROTOTYPE(void Print_Duration, (long from, long to)); void Print_Duration(long from, long to);
_PROTOTYPE(void Print_Uptime, (void)); void Print_Uptime(void);
_PROTOTYPE(void Record_Logout_Time, (struct utmp *wtmp)); void Record_Logout_Time(struct utmp *wtmp);
/* Sigint() and Sigquit() Flag occurrence of an interrupt. */ /* Sigint() and Sigquit() Flag occurrence of an interrupt. */
void Sigint(sig) void Sigint(sig)

View file

@ -99,12 +99,12 @@ char term[128];
char **env; char **env;
extern char **environ; extern char **environ;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void wtmp, (char *user, int uid)); void wtmp(char *user, int uid);
_PROTOTYPE(void show_file, (char *nam)); void show_file(char *nam);
_PROTOTYPE(void Time_out, (int dummy)); void Time_out(int dummy);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(void add2env, (char **env, char *entry, int replace)); void add2env(char **env, char *entry, int replace);
void wtmp(user, uid) void wtmp(user, uid)
char *user; /* user name */ char *user; /* user name */

View file

@ -73,23 +73,23 @@ unsigned oldmask; /* saved umask() */
extern int optind; extern int optind;
extern char *optarg; extern char *optarg;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(int deliver, (int count, char *vec [])); int deliver(int count, char *vec []);
_PROTOTYPE(FILE *makerewindable, (void)); FILE *makerewindable(void);
_PROTOTYPE(int copy, (FILE *fromfp, FILE *tofp)); int copy(FILE *fromfp, FILE *tofp);
_PROTOTYPE(void readbox, (void)); void readbox(void);
_PROTOTYPE(void printall, (void)); void printall(void);
_PROTOTYPE(void interact, (void)); void interact(void);
_PROTOTYPE(void onint, (int dummy)); void onint(int dummy);
_PROTOTYPE(void savelet, (struct letter *let, char *savefile)); void savelet(struct letter *let, char *savefile);
_PROTOTYPE(void updatebox, (void)); void updatebox(void);
_PROTOTYPE(void printlet, (struct letter *let, FILE *tofp)); void printlet(struct letter *let, FILE *tofp);
_PROTOTYPE(void doshell, (char *command)); void doshell(char *command);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(char *basename, (char *name)); char *basename(char *name);
_PROTOTYPE(char *whoami, (void)); char *whoami(void);
_PROTOTYPE(void dohelp, (void)); void dohelp(void);
_PROTOTYPE(int filesize, (char *name)); int filesize(char *name);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -55,13 +55,13 @@ PRIVATE char def_name[] = "core"; /* Default core name */
#define SIZE_KINFO sizeof(struct proc) #define SIZE_KINFO sizeof(struct proc)
#define SIZE_HEADER SIZE_MP_SEG #define SIZE_HEADER SIZE_MP_SEG
FORWARD _PROTOTYPE( int kernel_info , (int fd )); FORWARD int kernel_info(int fd );
FORWARD _PROTOTYPE( void setmap , (struct file *fp )); FORWARD void setmap(struct file *fp );
FORWARD _PROTOTYPE( void read_info , (struct file *fp )); FORWARD void read_info(struct file *fp );
FORWARD _PROTOTYPE( void ill_addr , (long d , int segment )); FORWARD void ill_addr(long d , int segment );
FORWARD _PROTOTYPE( long map_addr , (long d , int segment )); FORWARD long map_addr(long d , int segment );
FORWARD _PROTOTYPE( unsigned long c_status, (void)); FORWARD unsigned long c_status(void);
FORWARD _PROTOTYPE( long getn, (long d, int s) ); FORWARD long getn(long d, int s);
/* /*
* set and display mapping for core file * set and display mapping for core file

View file

@ -14,8 +14,8 @@
#include <minix/callnr.h> #include <minix/callnr.h>
#include "proto.h" #include "proto.h"
FORWARD _PROTOTYPE( void get_message, (message *m, unsigned bx) ); FORWARD void get_message(message *m, unsigned bx);
FORWARD _PROTOTYPE( void get_data, (char *s, unsigned bx, int cnt) ); FORWARD void get_data(char *s, unsigned bx, int cnt);
PRIVATE message sent; PRIVATE message sent;
PRIVATE message recv; PRIVATE message recv;

View file

@ -50,14 +50,13 @@ struct symtab_s
PRIVATE struct symtab_s symtab; PRIVATE struct symtab_s symtab;
FORWARD _PROTOTYPE( void gnu_sort , (struct newnlist *array , FORWARD void gnu_sort(struct newnlist *array , struct newnlist *top );
struct newnlist *top )); FORWARD int gnu_symeq(char *t , struct newnlist *sp );
FORWARD _PROTOTYPE( int gnu_symeq , (char *t , struct newnlist *sp )); FORWARD int gnu_symprefix(char *t , struct newnlist *sp );
FORWARD _PROTOTYPE( int gnu_symprefix , (char *t , struct newnlist *sp )); FORWARD struct newnlist *gnu_sname(char *name, int is_text, int
FORWARD _PROTOTYPE( struct newnlist *gnu_sname, (char *name, int is_text, allflag);
int allflag) ); FORWARD struct newnlist *gnu_sval(off_t value, int where);
FORWARD _PROTOTYPE( struct newnlist *gnu_sval, (off_t value, int where) ); FORWARD void gnu_sym(struct newnlist *sp, off_t off);
FORWARD _PROTOTYPE( void gnu_sym, (struct newnlist *sp, off_t off) );
PUBLIC void gnu_init( filename ) PUBLIC void gnu_init( filename )

View file

@ -25,7 +25,7 @@ PRIVATE FILE *outfile = stdout;
PRIVATE FILE *logfile; PRIVATE FILE *logfile;
PRIVATE int lineno; PRIVATE int lineno;
_PROTOTYPE( int _doprnt, (const char *format, va_list ap, FILE *stream )); int _doprnt(const char *format, va_list ap, FILE *stream );
PUBLIC char *get_cmd(cbuf, csize) PUBLIC char *get_cmd(cbuf, csize)
char *cbuf; char *cbuf;

View file

@ -73,22 +73,22 @@ struct b_pnt {
char cmd[1]; char cmd[1];
} *b_head, *curpnt; } *b_head, *curpnt;
_PROTOTYPE( int main , (int argc, char *argv[])); int main(int argc, char *argv[]);
FORWARD _PROTOTYPE( void cleanup , (void)); FORWARD void cleanup(void);
FORWARD _PROTOTYPE( void freepnt , (struct b_pnt *pnt )); FORWARD void freepnt(struct b_pnt *pnt );
FORWARD _PROTOTYPE( void findbpnt , (int verbose )); FORWARD void findbpnt(int verbose );
FORWARD _PROTOTYPE( int exebpnt , (int restart )); FORWARD int exebpnt(int restart );
FORWARD _PROTOTYPE( void catch , (int sig )); FORWARD void catch(int sig );
FORWARD _PROTOTYPE( int run , (char *name , char *argstr , int tflg )); FORWARD int run(char *name , char *argstr , int tflg );
FORWARD _PROTOTYPE( int dowait , (void)); FORWARD int dowait(void);
FORWARD _PROTOTYPE( void backtrace , (int all )); FORWARD void backtrace(int all );
FORWARD _PROTOTYPE( void modify , (long addr , int cnt , int verbose , int size )); FORWARD void modify(long addr , int cnt , int verbose , int size );
FORWARD _PROTOTYPE( void display , (long addr , int req )); FORWARD void display(long addr , int req );
FORWARD _PROTOTYPE( void fill , (long addr , int req )); FORWARD void fill(long addr , int req );
FORWARD _PROTOTYPE( void dorun , (char *cmd )); FORWARD void dorun(char *cmd );
FORWARD _PROTOTYPE( void not_for_core , (void)); FORWARD void not_for_core(void);
FORWARD _PROTOTYPE( void command , (void)); FORWARD void command(void);
PRIVATE void cleanup() PRIVATE void cleanup()

View file

@ -18,15 +18,15 @@ struct address_s
PRIVATE int bits32; PRIVATE int bits32;
PRIVATE struct address_s uptr; PRIVATE struct address_s uptr;
FORWARD _PROTOTYPE( u8_t get8, (void) ); FORWARD u8_t get8(void);
FORWARD _PROTOTYPE( u16_t get16, (void) ); FORWARD u16_t get16(void);
FORWARD _PROTOTYPE( u32_t get32, (void) ); FORWARD u32_t get32(void);
FORWARD _PROTOTYPE( u8_t peek_byte, (off_t addr) ); FORWARD u8_t peek_byte(off_t addr);
FORWARD _PROTOTYPE( u16_t peek_word, (off_t addr) ); FORWARD u16_t peek_word(off_t addr);
FORWARD _PROTOTYPE( int puti, (void) ); FORWARD int puti(void);
FORWARD _PROTOTYPE( int outsegaddr, (struct address_s *addr) ); FORWARD int outsegaddr(struct address_s *addr);
FORWARD _PROTOTYPE( int outssegaddr, (struct address_s *addr) ); FORWARD int outssegaddr(struct address_s *addr);
FORWARD _PROTOTYPE( int show1instruction , (void)); FORWARD int show1instruction(void);
/************************* UNASM ******************************/ /************************* UNASM ******************************/
@ -62,71 +62,71 @@ typedef int reg_pt;
typedef int su16_t; typedef int su16_t;
typedef int su8_pt; typedef int su8_pt;
FORWARD _PROTOTYPE( su8_pt get8s , (void)); FORWARD su8_pt get8s(void);
FORWARD _PROTOTYPE( void getmodregrm , (void)); FORWARD void getmodregrm(void);
FORWARD _PROTOTYPE( void i_00_to_3f , (opcode_pt opc )); FORWARD void i_00_to_3f(opcode_pt opc );
FORWARD _PROTOTYPE( void i_40_to_5f , (opcode_pt opc )); FORWARD void i_40_to_5f(opcode_pt opc );
FORWARD _PROTOTYPE( void i_60_to_6f , (opcode_pt opc )); FORWARD void i_60_to_6f(opcode_pt opc );
FORWARD _PROTOTYPE( void i_70_to_7f , (opcode_pt opc )); FORWARD void i_70_to_7f(opcode_pt opc );
FORWARD _PROTOTYPE( void i_80 , (opcode_pt opc )); FORWARD void i_80(opcode_pt opc );
FORWARD _PROTOTYPE( void i_88 , (opcode_pt opc )); FORWARD void i_88(opcode_pt opc );
FORWARD _PROTOTYPE( void i_90 , (opcode_pt opc )); FORWARD void i_90(opcode_pt opc );
FORWARD _PROTOTYPE( void i_98 , (opcode_pt opc )); FORWARD void i_98(opcode_pt opc );
FORWARD _PROTOTYPE( void i_a0 , (opcode_pt opc )); FORWARD void i_a0(opcode_pt opc );
FORWARD _PROTOTYPE( void i_a8 , (opcode_pt opc )); FORWARD void i_a8(opcode_pt opc );
FORWARD _PROTOTYPE( void i_b0 , (opcode_pt opc )); FORWARD void i_b0(opcode_pt opc );
FORWARD _PROTOTYPE( void i_b8 , (opcode_pt opc )); FORWARD void i_b8(opcode_pt opc );
FORWARD _PROTOTYPE( void i_c0 , (opcode_pt opc )); FORWARD void i_c0(opcode_pt opc );
FORWARD _PROTOTYPE( void i_c8 , (opcode_pt opc )); FORWARD void i_c8(opcode_pt opc );
FORWARD _PROTOTYPE( void i_d0 , (opcode_pt opc )); FORWARD void i_d0(opcode_pt opc );
FORWARD _PROTOTYPE( void i_d8 , (opcode_pt opc )); FORWARD void i_d8(opcode_pt opc );
FORWARD _PROTOTYPE( void i_e0 , (opcode_pt opc )); FORWARD void i_e0(opcode_pt opc );
FORWARD _PROTOTYPE( void i_e8 , (opcode_pt opc )); FORWARD void i_e8(opcode_pt opc );
FORWARD _PROTOTYPE( void i_f0 , (opcode_pt opc )); FORWARD void i_f0(opcode_pt opc );
FORWARD _PROTOTYPE( void i_f8 , (opcode_pt opc )); FORWARD void i_f8(opcode_pt opc );
FORWARD _PROTOTYPE( void outad , (opcode_pt opc )); FORWARD void outad(opcode_pt opc );
FORWARD _PROTOTYPE( void outad1 , (opcode_pt opc )); FORWARD void outad1(opcode_pt opc );
FORWARD _PROTOTYPE( void outalorx , (opcode_pt opc )); FORWARD void outalorx(opcode_pt opc );
FORWARD _PROTOTYPE( void outax , (void)); FORWARD void outax(void);
FORWARD _PROTOTYPE( void outbptr , (void)); FORWARD void outbptr(void);
FORWARD _PROTOTYPE( void outbwptr , (opcode_pt opc )); FORWARD void outbwptr(opcode_pt opc );
FORWARD _PROTOTYPE( void outea , (opcode_pt wordflags )); FORWARD void outea(opcode_pt wordflags );
FORWARD _PROTOTYPE( void outf1 , (void)); FORWARD void outf1(void);
FORWARD _PROTOTYPE( void out32offset , (void)); FORWARD void out32offset(void);
FORWARD _PROTOTYPE( void outfishy , (void)); FORWARD void outfishy(void);
FORWARD _PROTOTYPE( void outgetaddr , (void)); FORWARD void outgetaddr(void);
FORWARD _PROTOTYPE( void outimmed , (opcode_pt signwordflag )); FORWARD void outimmed(opcode_pt signwordflag );
FORWARD _PROTOTYPE( void outpc , (off_t pc )); FORWARD void outpc(off_t pc );
FORWARD _PROTOTYPE( void outsegpc , (void)); FORWARD void outsegpc(void);
FORWARD _PROTOTYPE( void oututstr , (char *s )); FORWARD void oututstr(char *s );
FORWARD _PROTOTYPE( void outword , (void)); FORWARD void outword(void);
FORWARD _PROTOTYPE( void outwptr , (void)); FORWARD void outwptr(void);
FORWARD _PROTOTYPE( void outwsize , (void)); FORWARD void outwsize(void);
FORWARD _PROTOTYPE( void pagef , (void)); FORWARD void pagef(void);
FORWARD _PROTOTYPE( void shift , (opcode_pt opc )); FORWARD void shift(opcode_pt opc );
FORWARD _PROTOTYPE( void checkmemory , (void)); FORWARD void checkmemory(void);
FORWARD _PROTOTYPE( void CL , (void)); FORWARD void CL(void);
FORWARD _PROTOTYPE( void Eb , (void)); FORWARD void Eb(void);
FORWARD _PROTOTYPE( void Ev , (void)); FORWARD void Ev(void);
FORWARD _PROTOTYPE( void EvGv , (void)); FORWARD void EvGv(void);
FORWARD _PROTOTYPE( void EvIb , (void)); FORWARD void EvIb(void);
FORWARD _PROTOTYPE( void Ew , (void)); FORWARD void Ew(void);
FORWARD _PROTOTYPE( void EwRw , (void)); FORWARD void EwRw(void);
FORWARD _PROTOTYPE( void Gv , (void)); FORWARD void Gv(void);
FORWARD _PROTOTYPE( void Gv1 , (void)); FORWARD void Gv1(void);
FORWARD _PROTOTYPE( void GvEv , (void)); FORWARD void GvEv(void);
FORWARD _PROTOTYPE( void GvEw , (void)); FORWARD void GvEw(void);
FORWARD _PROTOTYPE( void GvM , (void)); FORWARD void GvM(void);
FORWARD _PROTOTYPE( void GvMa , (void)); FORWARD void GvMa(void);
FORWARD _PROTOTYPE( void GvMp , (void)); FORWARD void GvMp(void);
FORWARD _PROTOTYPE( void Ib , (void)); FORWARD void Ib(void);
FORWARD _PROTOTYPE( void Iw , (void)); FORWARD void Iw(void);
FORWARD _PROTOTYPE( void Iv , (void)); FORWARD void Iv(void);
FORWARD _PROTOTYPE( void Jb , (void)); FORWARD void Jb(void);
FORWARD _PROTOTYPE( void Jv , (void)); FORWARD void Jv(void);
FORWARD _PROTOTYPE( void Ms , (void)); FORWARD void Ms(void);
_PROTOTYPE( typedef void (*pfv_t),(opcode_pt opc )); typedef void(*pfv_t) (opcode_pt opc );
PRIVATE pfv_t optable[] = PRIVATE pfv_t optable[] =
{ {

View file

@ -16,8 +16,8 @@
#include <string.h> #include <string.h>
#include "proto.h" #include "proto.h"
FORWARD _PROTOTYPE(long value , (char *s , char **s_p , int *seg_p )); FORWARD long value(char *s , char **s_p , int *seg_p );
FORWARD _PROTOTYPE(long lookup , (char *s , char **s_p , int *seg_p )); FORWARD long lookup(char *s , char **s_p , int *seg_p );
#define idchar(c) (isalpha(c) || isdigit(c) || (c) == '_') #define idchar(c) (isalpha(c) || isdigit(c) || (c) == '_')

View file

@ -12,7 +12,7 @@
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include "proto.h" #include "proto.h"
FORWARD _PROTOTYPE( void pr_ascii , (long val , int size )); FORWARD void pr_ascii(long val , int size );
/* Print ascii */ /* Print ascii */
PRIVATE void pr_ascii(val, size) PRIVATE void pr_ascii(val, size)

View file

@ -4,102 +4,102 @@
/* core.c */ /* core.c */
_PROTOTYPE( void prtmap, (void) ); void prtmap(void);
_PROTOTYPE( unsigned long core_init, (char *filename) ); unsigned long core_init(char *filename);
_PROTOTYPE( unsigned long file_init, (char *filename) ); unsigned long file_init(char *filename);
_PROTOTYPE( long read_core, (int req, long addr, long data) ); long read_core(int req, long addr, long data);
/* mdb.c */ /* mdb.c */
_PROTOTYPE( void mdb_error, (char *s) ); void mdb_error(char *s);
_PROTOTYPE( long breakpt , (long addr , char *cmd )); long breakpt(long addr , char *cmd );
_PROTOTYPE( void tstart , (int req , int verbose , int val , int cnt )); void tstart(int req , int verbose , int val , int cnt );
/* io.c */ /* io.c */
_PROTOTYPE( char *get_cmd , (char *cbuf, int csize) ); char *get_cmd(char *cbuf, int csize);
_PROTOTYPE( void openin , (char *s )); void openin(char *s );
_PROTOTYPE( void logging, (int c, char *name) ); void logging(int c, char *name);
_PROTOTYPE( void do_error, (char *message) ); void do_error(char *message);
_PROTOTYPE( int Printf, (const char *format, ...)); int Printf(const char *format, ...);
_PROTOTYPE( void outbyte, (int byte) ); void outbyte(int byte);
_PROTOTYPE( void outcomma, (void) ); void outcomma(void);
_PROTOTYPE( void outh8, (unsigned num) ); void outh8(unsigned num);
_PROTOTYPE( void outh16, (unsigned num) ); void outh16(unsigned num);
_PROTOTYPE( void outh32, (unsigned num) ); void outh32(unsigned num);
_PROTOTYPE( void outh4, (unsigned num) ); void outh4(unsigned num);
_PROTOTYPE( void outspace, (void) ); void outspace(void);
_PROTOTYPE( void outstr, (char *s) ); void outstr(char *s);
_PROTOTYPE( void outtab, (void) ); void outtab(void);
_PROTOTYPE( void outustr, (char *s) ); void outustr(char *s);
_PROTOTYPE( void closestring, (void) ); void closestring(void);
_PROTOTYPE( int mytolower, (int ch) ); int mytolower(int ch);
_PROTOTYPE( void openstring, (char *string) ); void openstring(char *string);
_PROTOTYPE( int stringpos, (void) ); int stringpos(void);
_PROTOTYPE( int stringtab, (void) ); int stringtab(void);
/* mdbdis86.c */ /* mdbdis86.c */
_PROTOTYPE( long dasm, (long addr, int count, int symflg) ); long dasm(long addr, int count, int symflg);
/* mdbexp.c */ /* mdbexp.c */
_PROTOTYPE( char *getexp, (char *buf, long *exp_p, int *seg_p) ); char *getexp(char *buf, long *exp_p, int *seg_p);
_PROTOTYPE( char *skip, (char *s) ); char *skip(char *s);
/* kernel.c */ /* kernel.c */
_PROTOTYPE( long get_reg, (int pid, long k) ); long get_reg(int pid, long k);
_PROTOTYPE( void set_reg, (int pid, long k, long value) ); void set_reg(int pid, long k, long value);
_PROTOTYPE( long reg_addr, (char *s) ); long reg_addr(char *s);
_PROTOTYPE( int disp_regs, (void) ); int disp_regs(void);
_PROTOTYPE( int outsegreg, (off_t num) ); int outsegreg(off_t num);
_PROTOTYPE( void update , (void)); void update(void);
_PROTOTYPE( void disp_maps , (void)); void disp_maps(void);
/* misc.c */ /* misc.c */
_PROTOTYPE( void dump_stack, (long count) ); void dump_stack(long count);
_PROTOTYPE( off_t file_size, (int fd) ); off_t file_size(int fd);
_PROTOTYPE( void help_on, (int h) ); void help_on(int h);
_PROTOTYPE( void version_info, (void) ); void version_info(void);
_PROTOTYPE( void help_page, (void) ); void help_page(void);
#if EXTRA_SYMBOLS #if EXTRA_SYMBOLS
/* gnu_sym.c */ /* gnu_sym.c */
_PROTOTYPE( void gnu_init, (char *filename) ); void gnu_init(char *filename);
_PROTOTYPE( long gnu_symbolvalue, (char *name, int is_text ) ); long gnu_symbolvalue(char *name, int is_text );
_PROTOTYPE( void gnu_symbolic, (off_t value, int separator) ); void gnu_symbolic(off_t value, int separator);
_PROTOTYPE( void gnu_listsym, (int tchar) ); void gnu_listsym(int tchar);
_PROTOTYPE( int gnu_text_symbol, (off_t value) ); int gnu_text_symbol(off_t value);
_PROTOTYPE( int gnu_finds_pc, (off_t pc) ); int gnu_finds_pc(off_t pc);
_PROTOTYPE( int gnu_finds_data, (off_t off, int data_seg) ); int gnu_finds_data(off_t off, int data_seg);
#endif /* EXTRA_SYMBOLS */ #endif /* EXTRA_SYMBOLS */
/* sym.c */ /* sym.c */
_PROTOTYPE( void syminit, (char *filename) ); void syminit(char *filename);
_PROTOTYPE( long symbolvalue, (char *name, int is_text ) ); long symbolvalue(char *name, int is_text );
_PROTOTYPE( void printhex, (off_t v) ); void printhex(off_t v);
_PROTOTYPE( void symbolic, (off_t value, int separator) ); void symbolic(off_t value, int separator);
_PROTOTYPE( void listsym, (char *cmd) ); void listsym(char *cmd);
_PROTOTYPE( int text_symbol, (off_t value) ); int text_symbol(off_t value);
_PROTOTYPE( int finds_pc, (off_t pc) ); int finds_pc(off_t pc);
_PROTOTYPE( int finds_data, (off_t off, int data_seg) ); int finds_data(off_t off, int data_seg);
/* trace.c */ /* trace.c */
_PROTOTYPE( long mdbtrace, (int req, int pid, long addr, long data) ); long mdbtrace(int req, int pid, long addr, long data);
_PROTOTYPE( u32_t peek_dword, (off_t addr)); u32_t peek_dword(off_t addr);
#if SYSCALLS_SUPPORT #if SYSCALLS_SUPPORT
/* syscalls.c */ /* syscalls.c */
_PROTOTYPE( void start_syscall, (long addr) ); void start_syscall(long addr);
_PROTOTYPE( void do_syscall, (long addr) ); void do_syscall(long addr);
/* decode.c */ /* decode.c */
_PROTOTYPE( void decode_message, (unsigned addr) ); void decode_message(unsigned addr);
_PROTOTYPE( void decode_result, (void) ); void decode_result(void);
/* ioctl.c */ /* ioctl.c */
_PROTOTYPE( void decode_ioctl, (int sr, message *m) ); void decode_ioctl(int sr, message *m);
#endif /* SYSCALLS_SUPPORT */ #endif /* SYSCALLS_SUPPORT */

View file

@ -23,13 +23,13 @@ struct symtab_s
PRIVATE struct symtab_s symtab; PRIVATE struct symtab_s symtab;
PRIVATE int type_of_exec; PRIVATE int type_of_exec;
FORWARD _PROTOTYPE( int check_exec, (struct exec *hdr) ); FORWARD int check_exec(struct exec *hdr);
FORWARD _PROTOTYPE( void sortsyms , (struct nlist *array , struct nlist *top )); FORWARD void sortsyms(struct nlist *array , struct nlist *top );
FORWARD _PROTOTYPE( int symeq , (char *t , struct nlist *sp )); FORWARD int symeq(char *t , struct nlist *sp );
FORWARD _PROTOTYPE( int symprefix , (char *t , struct nlist *sp )); FORWARD int symprefix(char *t , struct nlist *sp );
FORWARD _PROTOTYPE( struct nlist *findsname, (char *name, int is_text, int allflag) ); FORWARD struct nlist *findsname(char *name, int is_text, int allflag);
FORWARD _PROTOTYPE( void outsym, (struct nlist *sp, off_t off) ); FORWARD void outsym(struct nlist *sp, off_t off);
FORWARD _PROTOTYPE( struct nlist *findsval, (off_t value, int where) ); FORWARD struct nlist *findsval(off_t value, int where);
PUBLIC void syminit( filename ) PUBLIC void syminit( filename )
char *filename; char *filename;

View file

@ -20,7 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
_PROTOTYPE( int main, (int argc, char *argv []) ); int main(int argc, char *argv []);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -239,131 +239,135 @@ extern long chars_saved; /* Nr of chars saved in buffer */
/* mined1.c */ /* mined1.c */
_PROTOTYPE(void FS, (void)); void FS(void);
_PROTOTYPE(void VI, (void)); void VI(void);
_PROTOTYPE(int WT, (void)); int WT(void);
_PROTOTYPE(void XWT, (void)); void XWT(void);
_PROTOTYPE(void SH, (void)); void SH(void);
_PROTOTYPE(LINE *proceed, (LINE *line, int count )); LINE *proceed(LINE *line, int count );
_PROTOTYPE(int bottom_line, (FLAG revfl, char *s1, char *s2, char *inbuf, FLAG statfl )); int bottom_line(FLAG revfl, char *s1, char *s2, char *inbuf, FLAG statfl
_PROTOTYPE(int count_chars, (LINE *line )); );
_PROTOTYPE(void move, (int new_x, char *new_address, int new_y )); int count_chars(LINE *line );
_PROTOTYPE(int find_x, (LINE *line, char *address )); void move(int new_x, char *new_address, int new_y );
_PROTOTYPE(char *find_address, (LINE *line, int x_coord, int *old_x )); int find_x(LINE *line, char *address );
_PROTOTYPE(int length_of, (char *string )); char *find_address(LINE *line, int x_coord, int *old_x );
_PROTOTYPE(void copy_string, (char *to, char *from )); int length_of(char *string );
_PROTOTYPE(void reset, (LINE *head_line, int screen_y )); void copy_string(char *to, char *from );
_PROTOTYPE(void set_cursor, (int nx, int ny )); void reset(LINE *head_line, int screen_y );
_PROTOTYPE(void open_device, (void)); void set_cursor(int nx, int ny );
_PROTOTYPE(int getchar, (void)); void open_device(void);
_PROTOTYPE(void display, (int x_coord, int y_coord, LINE *line, int count )); int getchar(void);
_PROTOTYPE(int write_char, (int fd, int c )); void display(int x_coord, int y_coord, LINE *line, int count );
_PROTOTYPE(int writeline, (int fd, char *text )); int write_char(int fd, int c );
_PROTOTYPE(void put_line, (LINE *line, int offset, FLAG clear_line )); int writeline(int fd, char *text );
_PROTOTYPE(int flush_buffer, (int fd )); void put_line(LINE *line, int offset, FLAG clear_line );
_PROTOTYPE(void bad_write, (int fd )); int flush_buffer(int fd );
_PROTOTYPE(void catch, (int sig )); void bad_write(int fd );
_PROTOTYPE(void abort_mined, (void)); void catch(int sig );
_PROTOTYPE(void raw_mode, (FLAG state )); void abort_mined(void);
_PROTOTYPE(void panic, (char *message )); void raw_mode(FLAG state );
_PROTOTYPE(char *alloc, (int bytes )); void panic(char *message );
_PROTOTYPE(void free_space, (char *p )); char *alloc(int bytes );
void free_space(char *p );
/* /*
#ifdef UNIX #ifdef UNIX
_PROTOTYPE(void (*key_map [128]), (void)); void(*key_map [128]) (void);
#else #else
_PROTOTYPE(void (*key_map [256]), (void)); void(*key_map [256]) (void);
#endif #endif
*/ */
_PROTOTYPE(void initialize, (void)); void initialize(void);
_PROTOTYPE(char *basename, (char *path )); char *basename(char *path );
_PROTOTYPE(void load_file, (char *file )); void load_file(char *file );
_PROTOTYPE(int get_line, (int fd, char *buffer )); int get_line(int fd, char *buffer );
_PROTOTYPE(LINE *install_line, (char *buffer, int length )); LINE *install_line(char *buffer, int length );
_PROTOTYPE(int main, (int argc, char *argv [])); int main(int argc, char *argv []);
_PROTOTYPE(void RD, (void)); void RD(void);
_PROTOTYPE(void I, (void)); void I(void);
_PROTOTYPE(void XT, (void)); void XT(void);
_PROTOTYPE(void ESC, (void)); void ESC(void);
_PROTOTYPE(int ask_save, (void)); int ask_save(void);
_PROTOTYPE(int line_number, (void)); int line_number(void);
_PROTOTYPE(void file_status, (char *message, long count, char *file, int lines, void file_status(char *message, long count, char *file, int lines, FLAG
FLAG writefl, FLAG changed )); writefl, FLAG changed );
#if __STDC__ #if __STDC__
void build_string(char *buf, char *fmt, ...); void build_string(char *buf, char *fmt, ...);
#else #else
void build_string(); void build_string();
#endif #endif
_PROTOTYPE(char *num_out, (long number )); char *num_out(long number );
_PROTOTYPE(int get_number, (char *message, int *result )); int get_number(char *message, int *result );
_PROTOTYPE(int input, (char *inbuf, FLAG clearfl )); int input(char *inbuf, FLAG clearfl );
_PROTOTYPE(int get_file, (char *message, char *file )); int get_file(char *message, char *file );
_PROTOTYPE(int _getchar, (void)); int _getchar(void);
_PROTOTYPE(void _flush, (void)); void _flush(void);
_PROTOTYPE(void _putchar, (int c )); void _putchar(int c );
_PROTOTYPE(void get_term, (void)); void get_term(void);
/* mined2.c */ /* mined2.c */
_PROTOTYPE(void UP, (void)); void UP(void);
_PROTOTYPE(void DN, (void)); void DN(void);
_PROTOTYPE(void LF, (void)); void LF(void);
_PROTOTYPE(void RT, (void)); void RT(void);
_PROTOTYPE(void HIGH, (void)); void HIGH(void);
_PROTOTYPE(void LOW, (void)); void LOW(void);
_PROTOTYPE(void BL, (void)); void BL(void);
_PROTOTYPE(void EL, (void)); void EL(void);
_PROTOTYPE(void GOTO, (void)); void GOTO(void);
_PROTOTYPE(void PD, (void)); void PD(void);
_PROTOTYPE(void PU, (void)); void PU(void);
_PROTOTYPE(void HO, (void)); void HO(void);
_PROTOTYPE(void EF, (void)); void EF(void);
_PROTOTYPE(void SU, (void)); void SU(void);
_PROTOTYPE(void SD, (void)); void SD(void);
_PROTOTYPE(int forward_scroll, (void)); int forward_scroll(void);
_PROTOTYPE(int reverse_scroll, (void)); int reverse_scroll(void);
_PROTOTYPE(void MP, (void)); void MP(void);
_PROTOTYPE(void move_previous_word, (FLAG remove )); void move_previous_word(FLAG remove );
_PROTOTYPE(void MN, (void)); void MN(void);
_PROTOTYPE(void move_next_word, (FLAG remove )); void move_next_word(FLAG remove );
_PROTOTYPE(void DCC, (void)); void DCC(void);
_PROTOTYPE(void DPC, (void)); void DPC(void);
_PROTOTYPE(void DLN, (void)); void DLN(void);
_PROTOTYPE(void DNW, (void)); void DNW(void);
_PROTOTYPE(void DPW, (void)); void DPW(void);
_PROTOTYPE(void S, (int character )); void S(int character );
_PROTOTYPE(void CTL, (void)); void CTL(void);
_PROTOTYPE(void LIB, (void)); void LIB(void);
_PROTOTYPE(LINE *line_insert, (LINE *line, char *string, int len )); LINE *line_insert(LINE *line, char *string, int len );
_PROTOTYPE(int insert, (LINE *line, char *location, char *string )); int insert(LINE *line, char *location, char *string );
_PROTOTYPE(LINE *line_delete, (LINE *line )); LINE *line_delete(LINE *line );
_PROTOTYPE(void delete, (LINE *start_line, char *start_textp, LINE *end_line, char *end_textp )); void delete(LINE *start_line, char *start_textp, LINE *end_line, char
_PROTOTYPE(void PT, (void)); *end_textp );
_PROTOTYPE(void IF, (void)); void PT(void);
_PROTOTYPE(void file_insert, (int fd, FLAG old_pos )); void IF(void);
_PROTOTYPE(void WB, (void)); void file_insert(int fd, FLAG old_pos );
_PROTOTYPE(void MA, (void)); void WB(void);
_PROTOTYPE(void YA, (void)); void MA(void);
_PROTOTYPE(void DT, (void)); void YA(void);
_PROTOTYPE(void set_up, (FLAG remove )); void DT(void);
_PROTOTYPE(FLAG checkmark, (void)); void set_up(FLAG remove );
_PROTOTYPE(int legal, (void)); FLAG checkmark(void);
_PROTOTYPE(void yank, (LINE *start_line, char *start_textp, LINE *end_line, char *end_textp, FLAG remove )); int legal(void);
_PROTOTYPE(int scratch_file, (FLAG mode )); void yank(LINE *start_line, char *start_textp, LINE *end_line, char
_PROTOTYPE(void SF, (void)); *end_textp, FLAG remove );
_PROTOTYPE(void SR, (void)); int scratch_file(FLAG mode );
_PROTOTYPE(REGEX *get_expression, (char *message )); void SF(void);
_PROTOTYPE(void GR, (void)); void SR(void);
_PROTOTYPE(void LR, (void)); REGEX *get_expression(char *message );
_PROTOTYPE(void change, (char *message, FLAG file )); void GR(void);
_PROTOTYPE(char *substitute, (LINE *line, REGEX *program, char *replacement )); void LR(void);
_PROTOTYPE(void search, (char *message, FLAG method )); void change(char *message, FLAG file );
_PROTOTYPE(int find_y, (LINE *match_line )); char *substitute(LINE *line, REGEX *program, char *replacement );
_PROTOTYPE(void finished, (REGEX *program, int *last_exp )); void search(char *message, FLAG method );
_PROTOTYPE(void compile, (char *pattern, REGEX *program )); int find_y(LINE *match_line );
_PROTOTYPE(LINE *match, (REGEX *program, char *string, FLAG method )); void finished(REGEX *program, int *last_exp );
_PROTOTYPE(int line_check, (REGEX *program, char *string, FLAG method )); void compile(char *pattern, REGEX *program );
_PROTOTYPE(int check_string, (REGEX *program, char *string, int *expression )); LINE *match(REGEX *program, char *string, FLAG method );
_PROTOTYPE(int star, (REGEX *program, char *end_position, char *string, int *expression )); int line_check(REGEX *program, char *string, FLAG method );
_PROTOTYPE(int in_list, (int *list, int c, int list_length, int opcode )); int check_string(REGEX *program, char *string, int *expression );
_PROTOTYPE(void dummy_line, (void)); int star(REGEX *program, char *end_position, char *string, int
*expression );
int in_list(int *list, int c, int list_length, int opcode );
void dummy_line(void);

View file

@ -92,40 +92,40 @@ FILE *proto;
#define getline _mkfs_getline #define getline _mkfs_getline
#endif #endif
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(block_t sizeup, (char *device)); block_t sizeup(char *device);
_PROTOTYPE(void super, (zone_t zones, Ino_t inodes)); void super(zone_t zones, Ino_t inodes);
_PROTOTYPE(void rootdir, (Ino_t inode)); void rootdir(Ino_t inode);
_PROTOTYPE(void eat_dir, (Ino_t parent)); void eat_dir(Ino_t parent);
_PROTOTYPE(void eat_file, (Ino_t inode, int f)); void eat_file(Ino_t inode, int f);
_PROTOTYPE(void enter_dir, (Ino_t parent, char *name, Ino_t child)); void enter_dir(Ino_t parent, char *name, Ino_t child);
_PROTOTYPE(void incr_size, (Ino_t n, long count)); void incr_size(Ino_t n, long count);
_PROTOTYPE(PRIVATE ino_t alloc_inode, (int mode, int usrid, int grpid)); PRIVATE ino_t alloc_inode(int mode, int usrid, int grpid);
_PROTOTYPE(PRIVATE zone_t alloc_zone, (void)); PRIVATE zone_t alloc_zone(void);
_PROTOTYPE(void add_zone, (Ino_t n, zone_t z, long bytes, long cur_time)); void add_zone(Ino_t n, zone_t z, long bytes, long cur_time);
_PROTOTYPE(void add_z_1, (Ino_t n, zone_t z, long bytes, long cur_time)); void add_z_1(Ino_t n, zone_t z, long bytes, long cur_time);
_PROTOTYPE(void add_z_2, (Ino_t n, zone_t z, long bytes, long cur_time)); void add_z_2(Ino_t n, zone_t z, long bytes, long cur_time);
_PROTOTYPE(void incr_link, (Ino_t n)); void incr_link(Ino_t n);
_PROTOTYPE(void insert_bit, (block_t block, int bit)); void insert_bit(block_t block, int bit);
_PROTOTYPE(int mode_con, (char *p)); int mode_con(char *p);
_PROTOTYPE(void getline, (char line[LINE_LEN], char *parse[MAX_TOKENS])); void getline(char line[LINE_LEN], char *parse[MAX_TOKENS]);
_PROTOTYPE(void check_mtab, (char *devname)); void check_mtab(char *devname);
_PROTOTYPE(long file_time, (int f)); long file_time(int f);
_PROTOTYPE(void pexit, (char *s)); void pexit(char *s);
_PROTOTYPE(void copy, (char *from, char *to, int count)); void copy(char *from, char *to, int count);
_PROTOTYPE(void print_fs, (void)); void print_fs(void);
_PROTOTYPE(int read_and_set, (block_t n)); int read_and_set(block_t n);
_PROTOTYPE(void special, (char *string)); void special(char *string);
_PROTOTYPE(void get_block, (block_t n, char *buf)); void get_block(block_t n, char *buf);
_PROTOTYPE(void get_super_block, (char *buf)); void get_super_block(char *buf);
_PROTOTYPE(void put_block, (block_t n, char *buf)); void put_block(block_t n, char *buf);
_PROTOTYPE(void cache_init, (void)); void cache_init(void);
_PROTOTYPE(void flush, (void)); void flush(void);
_PROTOTYPE(void mx_read, (int blocknr, char *buf)); void mx_read(int blocknr, char *buf);
_PROTOTYPE(void mx_write, (int blocknr, char *buf)); void mx_write(int blocknr, char *buf);
_PROTOTYPE(void dexit, (char *s, int sectnum, int err)); void dexit(char *s, int sectnum, int err);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(char *alloc_block, (void)); char *alloc_block(void);
/*================================================================ /*================================================================
* mkfs - make filesystem * mkfs - make filesystem

View file

@ -10,11 +10,11 @@
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
_PROTOTYPE(int main, (int argc, char *argv [])); int main(int argc, char *argv []);
_PROTOTYPE(void badcomm, (void)); void badcomm(void);
_PROTOTYPE(void badfifo, (void)); void badfifo(void);
_PROTOTYPE(void badchar, (void)); void badchar(void);
_PROTOTYPE(void badblock, (void)); void badblock(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -35,11 +35,11 @@ FILE *outfile;
extern int optind; extern int optind;
extern char *optarg; extern char *optarg;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void descend, (char *dirname)); void descend(char *dirname);
_PROTOTYPE(void display_attrib, (char *name, struct stat *st)); void display_attrib(char *name, struct stat *st);
_PROTOTYPE(void usage, (char *binname)); void usage(char *binname);
_PROTOTYPE(void open_outfile, (void)); void open_outfile(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -18,9 +18,9 @@
#define MINIX_FS_TYPE "mfs" #define MINIX_FS_TYPE "mfs"
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void list, (void)); void list(void);
_PROTOTYPE(void usage, (void)); void usage(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -15,19 +15,19 @@ char buf[512], buffer[BUFSIZ];
int next; int next;
int bytespresent; int bytespresent;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(long offset, (int argc, char *argv [], int k)); long offset(int argc, char *argv [], int k);
_PROTOTYPE(void dumpfile, (void)); void dumpfile(void);
_PROTOTYPE(void wdump, (short *words, int k, int radix)); void wdump(short *words, int k, int radix);
_PROTOTYPE(void bdump, (char bytes [16 ], int k, int c)); void bdump(char bytes [16 ], int k, int c);
_PROTOTYPE(void byte, (int val, int c)); void byte(int val, int c);
_PROTOTYPE(int getwords, (short **words)); int getwords(short **words);
_PROTOTYPE(int same, (short *w1, int *w2)); int same(short *w1, int *w2);
_PROTOTYPE(void outword, (int val, int radix)); void outword(int val, int radix);
_PROTOTYPE(void outnum, (int num, int radix)); void outnum(int num, int radix);
_PROTOTYPE(void addrout, (long l)); void addrout(long l);
_PROTOTYPE(char hexit, (int k)); char hexit(int k);
_PROTOTYPE(void usage, (void)); void usage(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -90,11 +90,11 @@ static char default_delims[] = {TAB}; /* default delimiter string */
char *delims; /* the pointer to the delimiters */ char *delims; /* the pointer to the delimiters */
int number_of_delims = 1; /* number of delimiters to use */ int number_of_delims = 1; /* number of delimiters to use */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void docol, (int nfiles, char **fnamptr)); void docol(int nfiles, char **fnamptr);
_PROTOTYPE(void doserial, (int nfiles, char **fnamptr)); void doserial(int nfiles, char **fnamptr);
_PROTOTYPE(void delimbuild, (char *strptr)); void delimbuild(char *strptr);
_PROTOTYPE(void prerr, (int etype, char *estring)); void prerr(int etype, char *estring);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -17,8 +17,8 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <minix/sound.h> #include <minix/sound.h>
_PROTOTYPE( int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE( void usage, (void)); void usage(void);
/******* Wave format definitions *********/ /******* Wave format definitions *********/

View file

@ -93,14 +93,14 @@ char *line_buf; /* used in format for multi-column output */
char output[1024]; char output[1024];
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(static char *myalloc, (size_t size)); static char *myalloc(size_t size);
_PROTOTYPE(char skip_page, (int lines, int width, FILE * filep)); char skip_page(int lines, int width, FILE * filep);
_PROTOTYPE(void format, (FILE * filep)); void format(FILE * filep);
_PROTOTYPE(void print_page, (int pagenr, int maxcol)); void print_page(int pagenr, int maxcol);
_PROTOTYPE(void print, (FILE * filep)); void print(FILE * filep);
_PROTOTYPE(void out_header, (int page)); void out_header(int page);
_PROTOTYPE(void print_time, (time_t t)); void print_time(time_t t);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -12,10 +12,10 @@
int lfread; /* set when last char read was lf */ int lfread; /* set when last char read was lf */
int lfwritten = 1; /* set when last char written was lf */ int lfwritten = 1; /* set when last char written was lf */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void skipline, (void)); void skipline(void);
_PROTOTYPE(int backslash, (void)); int backslash(void);
_PROTOTYPE(void usage, (void)); void usage(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -32,8 +32,8 @@ static char MESSAGE[] = " / "; /* ditto */
#define ROOT "/" #define ROOT "/"
int rflag; int rflag;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void done, (char *name, int status)); void done(char *name, int status);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -66,16 +66,16 @@ struct sproc {
static struct sproc * proc_hash[HASH_MOD]; static struct sproc * proc_hash[HASH_MOD];
_PROTOTYPE(int handle_args, (int argc, char *argv[])); int handle_args(int argc, char *argv[]);
_PROTOTYPE(int start, (void)); int start(void);
_PROTOTYPE(int stop, (void)); int stop(void);
_PROTOTYPE(int get, (void)); int get(void);
_PROTOTYPE(int reset, (void)); int reset(void);
_PROTOTYPE(int create_named_pipe, (void)); int create_named_pipe(void);
_PROTOTYPE(int alloc_mem, (void)); int alloc_mem(void);
_PROTOTYPE(int init_outfile, (void)); int init_outfile(void);
_PROTOTYPE(int write_outfile, (void)); int write_outfile(void);
_PROTOTYPE(int detach, (void)); int detach(void);
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {

View file

@ -5,7 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
void void
prettyprogress(long b, long maxb, time_t starttime) prettyprogress(long b, long maxb, time_t starttime)

View file

@ -1,4 +0,0 @@
PROG= proto
MAN=
.include <bsd.prog.mk>

View file

@ -1,688 +0,0 @@
/* proto - Generate ANSI C prototypes. Author: Eric R. Smith */
/* Program to extract function declarations from C source code
* Written by Eric R. Smith and placed in the public domain
* Thanks are due to Jwahar R. Bammi for fixing several bugs
* And providing the Unix makefiles.
*/
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#define ISCSYM(x) ((x) > 0 && (isalnum(x) || (x) == '_' ))
#define ABORTED ( (Word *) -1 )
#define MAXPARAM 20 /* max. number of parameters to a function */
typedef struct word {
struct word *next;
char string[1];
} Word;
int inquote = 0; /* in a quote? */
int newline_seen = 1; /* are we at the start of a line */
long linenum = 1L; /* line number in current file */
long endline = 0L; /* the last line before the { of a f'n */
long symline = 0L; /* Line that symbol was on, set by getsym() */
int dostatic = 0; /* do static functions? */
int donum = 0; /* print line numbers? */
int dohead = 1; /* do file headers? */
int docond = 1; /* conditionalize for non-ANSI compilers? */
int dodiff = 0; /* Output a diff file to prototype original */
int doold = 0; /* do old style: P() */
int glastc = ' '; /* last char. seen by getsym() */
Word *endlist; /* Parentheses after the parameters */
char *progname; /* name of program (for error messages) */
_PROTOTYPE(Word * word_alloc, (char *s));
_PROTOTYPE(void word_free, (Word * w));
_PROTOTYPE(int List_len, (Word * w));
_PROTOTYPE(Word * word_append, (Word * w1, Word * w2));
_PROTOTYPE(int foundin, (Word * w1, Word * w2));
_PROTOTYPE(void addword, (Word * w, char *s));
_PROTOTYPE(void printlist, (Word * p));
_PROTOTYPE(Word * typelist, (Word * p));
_PROTOTYPE(void typefixhack, (Word * w));
_PROTOTYPE(int ngetc, (FILE * f));
_PROTOTYPE(int fnextch, (FILE * f));
_PROTOTYPE(int nextch, (FILE * f));
_PROTOTYPE(int getsym, (char *buf, FILE * f));
_PROTOTYPE(int skipit, (char *buf, FILE * f));
_PROTOTYPE(Word * getparamlist, (FILE * f));
_PROTOTYPE(void emit, (Word * wlist, Word * plist, long startline));
_PROTOTYPE(void getdecl, (FILE * f));
_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(void Usage, (void));
/* Routines for manipulating lists of words. */
Word *word_alloc(s)
char *s;
{
Word *w;
w = (Word *) malloc(sizeof(Word) + strlen(s) + 1);
if (w == NULL) {
fprintf(stderr, "%s: out of memory\n", progname);
exit(1);
}
(void) strcpy(w->string, s);
w->next = NULL;
return w;
}
void word_free(w)
Word *w;
{
Word *oldw;
while (w) {
oldw = w;
w = w->next;
free((char *) oldw);
}
}
/* Return the length of a list; empty words are not counted */
int List_len(w)
Word *w;
{
int count = 0;
while (w) {
if (*w->string) count++;
w = w->next;
}
return count;
}
/* Append two lists, and return the result */
Word *word_append(w1, w2)
Word *w1, *w2;
{
Word *r, *w;
r = w = word_alloc("");
while (w1) {
w->next = word_alloc(w1->string);
w = w->next;
w1 = w1->next;
}
while (w2) {
w->next = word_alloc(w2->string);
w = w->next;
w2 = w2->next;
}
return r;
}
/* See if the last entry in w2 is in w1 */
int foundin(w1, w2)
Word *w1, *w2;
{
while (w2->next) w2 = w2->next;
while (w1) {
if (!strcmp(w1->string, w2->string)) return 1;
w1 = w1->next;
}
return 0;
}
/* Add the string s to the given list of words */
void addword(w, s)
Word *w;
char *s;
{
while (w->next) w = w->next;
w->next = word_alloc(s);
}
/* Printlist: print out a list */
void printlist(p)
Word *p;
{
Word *w;
int i = 0;
for (w = p; w; w = w->next) {
printf("%s", w->string);
if (ISCSYM(w->string[0]) && i > 0
&& w->next && w->next->string[0] != ',') printf(" ");
i++;
}
}
/* Given a list representing a type and a variable name, extract just
* the base type, e.g. "struct word *x" would yield "struct word".
* Similarly, "unsigned char x[]" would yield "unsigned char".
*/
Word *typelist(p)
Word *p;
{
Word *w, *r, *last;
last = r = w = word_alloc("");
while (p && p->next) {
if (p->string[0] == '[') {
word_free(w);
last->next = NULL;
break;
}
if (p->string[0] && !ISCSYM(p->string[0])) break;
w->next = word_alloc(p->string);
last = w;
w = w->next;
p = p->next;
}
return r;
}
/* Typefixhack: promote formal parameters of type "char", "unsigned char",
* "short", or "unsigned short" to "int".
*/
void typefixhack(w)
Word *w;
{
Word *oldw = 0;
while (w) {
if (*w->string) {
if ((!strcmp(w->string, "char") ||
!strcmp(w->string, "short"))
&& (List_len(w->next) < 2)) {
if (oldw && !strcmp(oldw->string, "unsigned")) {
oldw->next = w->next;
free((char *) w);
w = oldw;
}
(void) strcpy(w->string, "int");
}
}
w = w->next;
}
}
/* Read a character: if it's a newline, increment the line count */
int ngetc(f)
FILE *f;
{
int c;
c = getc(f);
if (c == '\n') linenum++;
return c;
}
/* Read the next character from the file. If the character is '\' then
* read and skip the next character. Any comment sequence is converted
* to a blank.
*/
int fnextch(f)
FILE *f;
{
int c, lastc, incomment;
c = ngetc(f);
while (c == '\\') {
c = ngetc(f); /* skip a character */
c = ngetc(f);
}
if (c == '/' && !inquote) {
c = ngetc(f);
if (c == '*') {
incomment = 1;
c = ' ';
while (incomment) {
lastc = c;
c = ngetc(f);
if (lastc == '*' && c == '/')
incomment = 0;
else if (c < 0)
return c;
}
return fnextch(f);
} else {
if (c == '\n') linenum--;
(void) ungetc(c, f);
return '/';
}
}
return c;
}
/* Get the next "interesting" character. Comments are skipped, and strings
* are converted to "0". Also, if a line starts with "#" it is skipped.
*/
int nextch(f)
FILE *f;
{
int c;
c = fnextch(f);
if (newline_seen && c == '#') {
do {
c = fnextch(f);
} while (c >= 0 && c != '\n');
if (c < 0) return c;
}
newline_seen = (c == '\n');
if (c == '\'' || c == '\"') {
inquote = c;
while ((c = fnextch(f)) >= 0) {
if (c == inquote) {
inquote = 0;
return '0';
}
}
}
return c;
}
/* Get the next symbol from the file, skipping blanks.
* Return 0 if OK, -1 for EOF.
* Also collapses everything between { and }
*/
int getsym(buf, f)
char *buf;
FILE *f;
{
register int c;
int inbrack = 0;
c = glastc;
while ((c > 0) && isspace(c)) c = nextch(f);
if (c < 0) return -1;
if (c == '{') {
inbrack = 1;
endline = linenum;
while (inbrack) {
c = nextch(f);
if (c < 0) {
glastc = c;
return c;
}
if (c == '{')
inbrack++;
else if (c == '}')
inbrack--;
}
(void) strcpy(buf, "{}");
glastc = nextch(f);
return 0;
}
if (!ISCSYM(c)) {
*buf++ = c;
glastc = nextch(f);
if (c == '(' && glastc == '*') { /* Look for a 'f'n pointer */
*buf++ = glastc;
glastc = nextch(f);
}
*buf = 0;
return 0;
}
symline = linenum;
while (ISCSYM(c)) {
*buf++ = c;
c = nextch(f);
}
*buf = 0;
glastc = c;
return 0;
}
/* Skipit: skip until a ";" or the end of a function declaration is seen */
int skipit(buf, f)
char *buf;
FILE *f;
{
int i;
do {
i = getsym(buf, f);
if (i < 0) return i;
} while (*buf != ';' && *buf != '{');
return 0;
}
/* Get a parameter list; when this is called the next symbol in line
* should be the first thing in the list.
*/
Word *getparamlist(f)
FILE *f;
{
static Word *pname[MAXPARAM]; /* parameter names */
Word *tlist, /* type name */
*plist; /* temporary */
int np = 0; /* number of parameters */
int typed[MAXPARAM]; /* parameter has been given a type */
int tlistdone; /* finished finding the type name */
int sawsomething;
int i;
int inparen = 0;
char buf[80];
for (i = 0; i < MAXPARAM; i++) typed[i] = 0;
plist = word_alloc("");
endlist = word_alloc("");
/* First, get the stuff inside brackets (if anything) */
sawsomething = 0; /* gets set nonzero when we see an arg */
for (;;) {
if (getsym(buf, f) < 0) return(NULL);
if (*buf == ')' && (--inparen < 0)) {
if (sawsomething) { /* if we've seen an arg */
pname[np] = plist;
plist = word_alloc("");
np++;
}
break;
}
if (*buf == ';') { /* something weird */
return ABORTED;
}
sawsomething = 1; /* there's something in the arg. list */
if (*buf == ',' && inparen == 0) {
pname[np] = plist;
plist = word_alloc("");
np++;
} else {
addword(plist, buf);
if (*buf == '(') inparen++;
}
}
/* Next, get the declarations after the function header */
inparen = 0;
tlist = word_alloc("");
plist = word_alloc("");
tlistdone = 0;
sawsomething = 0;
for (;;) {
if (getsym(buf, f) < 0) return(NULL);
/* Handle parentheses, which should indicate func pointer rtn values */
if (*buf == '(') {
addword(endlist, buf);
addword(endlist, " void ");
inparen++;
} else if (*buf == ')') {
if (symline == linenum) {
addword(endlist, buf);
addword(endlist, buf);
}
inparen--;
} else if (*buf == ',' && !inparen) {
/* Handle a list like "int x,y,z" */
if (!sawsomething) return(NULL);
for (i = 0; i < np; i++) {
if (!typed[i] && foundin(plist, pname[i])) {
typed[i] = 1;
word_free(pname[i]);
pname[i] = word_append(tlist, plist);
/* Promote types */
typefixhack(pname[i]);
break;
}
}
if (!tlistdone) {
tlist = typelist(plist);
tlistdone = 1;
}
word_free(plist);
plist = word_alloc("");
} else if (*buf == ';') {
/* Handle the end of a list */
if (!sawsomething) return ABORTED;
for (i = 0; i < np; i++) {
if (!typed[i] && foundin(plist, pname[i])) {
typed[i] = 1;
word_free(pname[i]);
pname[i] = word_append(tlist, plist);
typefixhack(pname[i]);
break;
}
}
tlistdone = 0;
word_free(tlist);
word_free(plist);
tlist = word_alloc("");
plist = word_alloc("");
} else if (!strcmp(buf, "{}"))
break; /* Handle the beginning of the function */
/* Otherwise, throw word into list (except for "register") */
else if (strcmp(buf, "register")) {
sawsomething = 1;
addword(plist, buf);
if (*buf == '(') inparen++;
if (*buf == ')') inparen--;
}
}
/* Now take the info we have and build a prototype list */
/* Empty parameter list means "void" */
if (np == 0) return word_alloc("void");
plist = tlist = word_alloc("");
for (i = 0; i < np; i++) {
/* If no type provided, make it an "int" */
if (!(pname[i]->next) ||
(!(pname[i]->next->next)&&strcmp(pname[i]->next->string,"void"))) {
addword(tlist, "int");
}
while (tlist->next) tlist = tlist->next;
tlist->next = pname[i];
if (i < np - 1) addword(tlist, ", ");
}
return plist;
}
/* Emit a function declaration. The attributes and name of the function
* are in wlist; the parameters are in plist.
*/
void emit(wlist, plist, startline)
Word *wlist, *plist;
long startline;
{
Word *w;
int count = 0;
if (doold == 0) printf("_PROTOTYPE( ");
if (dodiff) {
printf("%lda%ld,%ld\n", startline - 1, startline, startline +2);
printf("> #ifdef __STDC__\n> ");
}
if (donum) printf("/*%8ld */ ", startline);
for (w = wlist; w; w = w->next) {
if (w->string[0]) count++;
}
if (count < 2) printf("int ");
printlist(wlist);
if (docond) {
if (doold)
printf(" P((");
else
printf(", (");
} else {
printf("(");
}
printlist(plist);
printlist(endlist);
if (docond) {
if (doold)
printf("))");
else
printf(") )");
} else {
printf(")");
}
if (!dodiff)
printf(";\n");
else
printf("\n");
if (dodiff) {
printf("> #else\n");
printf("%lda%ld\n", endline - 1, endline);
printf("> #endif\n");
}
}
/* Get all the function declarations */
void getdecl(f)
FILE *f;
{
Word *plist, *wlist = NULL;
char buf[80];
int sawsomething;
long startline = 0L; /* line where declaration started */
int oktoprint;
again: /* SHAME SHAME */
word_free(wlist);
wlist = word_alloc("");
sawsomething = 0;
oktoprint = 1;
for (;;) {
if (getsym(buf, f) < 0) return;
/* Guess when a declaration is not an external function definition */
if (!strcmp(buf, ",") || !strcmp(buf, "{}") ||
!strcmp(buf, "=") || !strcmp(buf, "typedef") ||
!strcmp(buf, "extern")) {
(void) skipit(buf, f);
goto again;
}
if (!dostatic && !strcmp(buf, "static")) oktoprint = 0;
/* For the benefit of compilers that allow "inline" declarations */
if (!strcmp(buf, "inline") && !sawsomething) continue;
if (!strcmp(buf, ";")) goto again;
/* A left parenthesis *might* indicate a function definition */
if (!strcmp(buf, "(")) {
if (!sawsomething || !(plist = getparamlist(f))) {
(void) skipit(buf, f);
goto again;
}
if (plist == ABORTED) goto again;
/* It seems to have been what we wanted */
if (oktoprint) emit(wlist, plist, startline);
word_free(plist);
goto again;
}
addword(wlist, buf);
if (!sawsomething) startline = symline;
sawsomething = 1;
}
}
int main(argc, argv)
int argc;
char **argv;
{
FILE *f, *g;
char *t;
char newname[40];
progname = argv[0];
argv++;
argc--;
g = stdout;
while (*argv && **argv == '-') {
t = *argv++;
--argc;
t++;
while (*t) {
if (*t == 's')
dostatic = 1;
else if (*t == 'n')
donum = 1;
else if (*t == 'p')
docond = 0;
else if (*t == 'P')
doold =1;
else if (*t == 'd') {
dodiff = 1;
doold = 1;
docond = 0;
donum = 0;
dostatic = 1;
} else
Usage();
t++;
}
}
if (docond && doold) {
printf("#ifdef __STDC__\n");
printf("# define P(args)\targs\n");
printf("#else\n");
printf("# define P(args)\t()\n");
printf("#endif\n\n");
}
if (argc == 0)
getdecl(stdin);
else
while (argc > 0 && *argv) {
if (!(f = fopen(*argv, "r"))) {
perror(*argv);
exit(EXIT_FAILURE);
}
#if 0
if (dodiff) {
(void) sprintf(newname, "%sdif", *argv);
(void) fclose(g);
if (!(g = fopen(newname, "w"))) {
perror(newname);
exit(EXIT_FAILURE);
}
}
#endif
if (doold && dohead && !dodiff) printf("\n/* %s */\n", *argv);
linenum = 1;
newline_seen = 1;
glastc = ' ';
getdecl(f);
argc--;
argv++;
(void) fclose(f);
}
if (docond && doold) printf("\n#undef P\n"); /* clean up namespace */
(void) fclose(g);
return(EXIT_SUCCESS);
}
void Usage()
{
fputs("Usage: ", stderr);
fputs(progname, stderr);
fputs(" [-d][-n][-p][-s] [files ...]\n", stderr);
fputs(" -P: use P() style instead of _PROTOTYPE\n", stderr);
fputs(" -d: produce a diff file to prototype original source\n", stderr);
fputs(" -n: put line numbers of declarations as comments\n", stderr);
fputs(" -p: don't make header files readable by K&R compilers\n", stderr);
fputs(" -s: include declarations for static functions\n", stderr);
exit(EXIT_FAILURE);
}

View file

@ -120,13 +120,13 @@ struct pstat { /* structure filled by pstat() */
char *ps_args; /* concatenated argument string */ char *ps_args; /* concatenated argument string */
}; };
_PROTOTYPE(int main, (int argc, char *argv [])); int main(int argc, char *argv []);
_PROTOTYPE(void plist, (void)); void plist(void);
_PROTOTYPE(int addrread, (int fd, phys_clicks base, vir_bytes addr, int addrread(int fd, phys_clicks base, vir_bytes addr, char *buf, int
char *buf, int nbytes )); nbytes );
_PROTOTYPE(void usage, (const char *pname )); void usage(const char *pname );
_PROTOTYPE(void err, (const char *s )); void err(const char *s );
_PROTOTYPE(int gettynames, (void)); int gettynames(void);
/* /*

View file

@ -27,7 +27,7 @@
#define SUCCESS 0 /* exit code in case of success */ #define SUCCESS 0 /* exit code in case of success */
#define FAILURE 1 /* or failure */ #define FAILURE 1 /* or failure */
_PROTOTYPE(int main, (void)); int main(void);
static char dir[PATH_MAX + 1]; static char dir[PATH_MAX + 1];
static char *errmsg = "pwd: cannot search some directory on the path\n"; static char *errmsg = "pwd: cannot search some directory on the path\n";

View file

@ -41,8 +41,8 @@ char *name; /* name of special file being read */
char a[CHUNK * BLOCK_SIZE]; /* read buffer */ char a[CHUNK * BLOCK_SIZE]; /* read buffer */
long rotten[STORE]; /* list of bad blocks */ long rotten[STORE]; /* list of bad blocks */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
static _PROTOTYPE(void output, (long blocks_read)); static void output(long blocks_read);
/* print pretty progress meter with remaining no. of blocks and ETA on /* print pretty progress meter with remaining no. of blocks and ETA on
* stderr * stderr

View file

@ -19,10 +19,10 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <minix/sound.h> #include <minix/sound.h>
_PROTOTYPE (int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE (void usage, (void)); void usage(void);
_PROTOTYPE ( void write_wave_header, (void)); void write_wave_header(void);
_PROTOTYPE ( void terminate, (int s)); void terminate(int s);
/******* Wave format definitions *********/ /******* Wave format definitions *********/

View file

@ -33,11 +33,11 @@
char *default_core = "core"; char *default_core = "core";
int stack[STACK_BYTES / sizeof (int)]; int stack[STACK_BYTES / sizeof (int)];
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void read_segmap, (int fd, struct mproc *mp, long *seg_size)); void read_segmap(int fd, struct mproc *mp, long *seg_size);
_PROTOTYPE(void read_registers, (int fd, struct proc *p)); void read_registers(int fd, struct proc *p);
_PROTOTYPE(void dump_stack, (int fd, struct mproc *mp, long *seg_size)); void dump_stack(int fd, struct mproc *mp, long *seg_size);
_PROTOTYPE(void error, (char *s1, char *s2)); void error(char *s1, char *s2);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -1,11 +1,10 @@
/* shar - make a shell archive Author: Michiel Husijes */ /* shar - make a shell archive Author: Michiel Husijes */
#include <stdlib.h> /* for the nonstd :-( _PROTOTYPE */ #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
static _PROTOTYPE( void error, (char *progname, char *operation, static void error(char *progname, char *operation, char *filename);
char *filename) ); int main(int argc, char **argv);
_PROTOTYPE( int main, (int argc, char **argv) );
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -5,7 +5,7 @@
#include <unistd.h> #include <unistd.h>
#include <minix/minlib.h> #include <minix/minlib.h>
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -129,40 +129,40 @@ int disabled; /* Nr of files done */
char USAGE[] = "Usage: sort [-funbirdcmt'x'] [+beg_pos [-end_pos]] [-o outfile] [file] .."; char USAGE[] = "Usage: sort [-funbirdcmt'x'] [+beg_pos [-end_pos]] [-o outfile] [file] ..";
/* Forward declarations */ /* Forward declarations */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void get_opts, (char *ptr, FIELD * field)); void get_opts(char *ptr, FIELD * field);
_PROTOTYPE(void new_field, (FIELD * field, int *offset, BOOL beg_fl)); void new_field(FIELD * field, int *offset, BOOL beg_fl);
_PROTOTYPE(void adjust_options, (FIELD * field)); void adjust_options(FIELD * field);
_PROTOTYPE(void error, (BOOL quit, char *message, char *arg)); void error(BOOL quit, char *message, char *arg);
_PROTOTYPE(void open_outfile, (void)); void open_outfile(void);
_PROTOTYPE(void get_file, (int fd, off_t size)); void get_file(int fd, off_t size);
_PROTOTYPE(int last_line, (void)); int last_line(void);
_PROTOTYPE(void print_table, (int fd)); void print_table(int fd);
_PROTOTYPE(char *file_name, (int nr)); char *file_name(int nr);
_PROTOTYPE(void mread, (int fd, char *address, int bytes)); void mread(int fd, char *address, int bytes);
_PROTOTYPE(void mwrite, (int fd, char *address, int bytes)); void mwrite(int fd, char *address, int bytes);
_PROTOTYPE(void sort, (void)); void sort(void);
_PROTOTYPE(void sort_table, (int nel)); void sort_table(int nel);
_PROTOTYPE(void incr, (int si, int ei)); void incr(int si, int ei);
_PROTOTYPE(int cmp_fields, (char *el1, char *el2)); int cmp_fields(char *el1, char *el2);
_PROTOTYPE(void build_field, (char *dest, FIELD * field, char *src)); void build_field(char *dest, FIELD * field, char *src);
_PROTOTYPE(char *skip_fields, (char *str, int nf)); char *skip_fields(char *str, int nf);
_PROTOTYPE(int compare, (char *el1, char *el2)); int compare(char *el1, char *el2);
_PROTOTYPE(int cmp, (unsigned char *el1, unsigned char *el2, FIELD * field)); int cmp(unsigned char *el1, unsigned char *el2, FIELD * field);
_PROTOTYPE(int digits, (char *str1, char *str2, BOOL check_sign)); int digits(char *str1, char *str2, BOOL check_sign);
_PROTOTYPE(void files_merge, (int file_cnt)); void files_merge(int file_cnt);
_PROTOTYPE(void merge, (int start_file, int limit_file)); void merge(int start_file, int limit_file);
_PROTOTYPE(void put_line, (char *line)); void put_line(char *line);
_PROTOTYPE(MERGE * print, (MERGE * merg, int file_cnt)); MERGE * print(MERGE * merg, int file_cnt);
_PROTOTYPE(int read_line, (MERGE * merg)); int read_line(MERGE * merg);
_PROTOTYPE(MERGE * skip_lines, (MERGE * smallest, int file_cnt)); MERGE * skip_lines(MERGE * smallest, int file_cnt);
_PROTOTYPE(void uniq_lines, (MERGE * merg)); void uniq_lines(MERGE * merg);
_PROTOTYPE(void check_file, (int fd, char *file)); void check_file(int fd, char *file);
_PROTOTYPE(int length, (char *line)); int length(char *line);
_PROTOTYPE(void copy, (char *dest, char *src)); void copy(char *dest, char *src);
_PROTOTYPE(char *msbrk, (int size)); char *msbrk(int size);
_PROTOTYPE(void mbrk, (char *address)); void mbrk(char *address);
_PROTOTYPE(void catch, (int dummy)); void catch(int dummy);
/* Table of all chars. 0 means no special meaning. */ /* Table of all chars. 0 means no special meaning. */
char table[256] = { char table[256] = {

View file

@ -14,11 +14,11 @@ int infile;
char out_file[100]; char out_file[100];
char *suffix; char *suffix;
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void split, (void)); void split(void);
_PROTOTYPE(int newfile, (void)); int newfile(void);
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(void quit, (void)); void quit(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -15,7 +15,7 @@
#endif #endif
#include <minix/minlib.h> #include <minix/minlib.h>
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -24,10 +24,10 @@ int rc = 0;
char *defargv[] = {"-", 0}; char *defargv[] = {"-", 0};
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(void error, (char *s, char *f)); void error(char *s, char *f);
_PROTOTYPE(void sum, (int fd, char *fname)); void sum(int fd, char *fname);
_PROTOTYPE(void putd, (int number, int fw, int zeros)); void putd(int number, int fw, int zeros);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -3,7 +3,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
_PROTOTYPE(int main, (void)); int main(void);
int main() int main()
{ {

View file

@ -79,10 +79,10 @@ extern int optind;
#define TRUE 1 #define TRUE 1
/* Internal functions - prototyped under Minix */ /* Internal functions - prototyped under Minix */
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
_PROTOTYPE(int tail, (int count, int bytes, int read_until_killed)); int tail(int count, int bytes, int read_until_killed);
_PROTOTYPE(int keep_reading, (void)); int keep_reading(void);
_PROTOTYPE(void usage, (void)); void usage(void);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -12,7 +12,7 @@
int fd[MAXFD]; int fd[MAXFD];
_PROTOTYPE(int main, (int argc, char **argv)); int main(int argc, char **argv);
int main(argc, argv) int main(argc, argv)
int argc; int argc;

View file

@ -41,10 +41,9 @@ static char *Version = "@(#) telnetd 1.00 (07/26/92)";
int opt_d = 0; /* debugging output flag */ int opt_d = 0; /* debugging output flag */
_PROTOTYPE(void usage, (void)); void usage(void);
_PROTOTYPE(int main, (int argc, char *argv[])); int main(int argc, char *argv[]);
_PROTOTYPE(void wtmp, (int type, int linenr, char *line, pid_t pid, void wtmp(int type, int linenr, char *line, pid_t pid, char *host);
char *host));
void usage() void usage()
{ {

View file

@ -27,12 +27,12 @@
#define IN_IAC2 3 #define IN_IAC2 3
#define IN_SB 4 #define IN_SB 4
_PROTOTYPE(static void dowill, (int c)); static void dowill(int c);
_PROTOTYPE(static void dowont, (int c)); static void dowont(int c);
_PROTOTYPE(static void dodo, (int c)); static void dodo(int c);
_PROTOTYPE(static void dodont, (int c)); static void dodont(int c);
_PROTOTYPE(static void respond, (int ack, int option)); static void respond(int ack, int option);
_PROTOTYPE(static void respond_really, (int ack, int option)); static void respond_really(int ack, int option);
#define LASTTELOPT TELOPT_SGA #define LASTTELOPT TELOPT_SGA

View file

@ -11,10 +11,10 @@
extern int opt_d; /* debugging flag */ extern int opt_d; /* debugging flag */
_PROTOTYPE(int get_pty, (int *, char **)); int get_pty(int *, char **);
_PROTOTYPE(void term_init, (void)); void term_init(void);
_PROTOTYPE(void term_inout, (int pty_fd)); void term_inout(int pty_fd);
_PROTOTYPE(void tel_init, (void)); void tel_init(void);
_PROTOTYPE(void telopt, (int fdout, int what, int option)); void telopt(int fdout, int what, int option);
_PROTOTYPE(int tel_in, (int fdout, int telout, char *buffer, int len)); int tel_in(int fdout, int telout, char *buffer, int len);
_PROTOTYPE(int tel_out, (int fdout, char *buf, int size)); int tel_out(int fdout, char *buf, int size);

View file

@ -25,7 +25,7 @@
#include "telnet.h" #include "telnet.h"
#include "telnetd.h" #include "telnetd.h"
_PROTOTYPE(void sig_done, (int sig)); void sig_done(int sig);
static char buff[4096]; static char buff[4096];

Some files were not shown because too many files have changed in this diff Show more