Merge 0cb589cee4 into 4db99f4012
This commit is contained in:
commit
15df29af6f
|
|
@ -211,7 +211,7 @@ boolean Func3(Enumeration EnumParIn);
|
|||
Enumeration Func1(int CharPar1, int CharPar2);
|
||||
|
||||
|
||||
int main()
|
||||
int main(void)
|
||||
{
|
||||
Proc0();
|
||||
return(0);
|
||||
|
|
@ -224,14 +224,13 @@ volatile int done;
|
|||
int done;
|
||||
#endif
|
||||
|
||||
void prep_timer()
|
||||
void prep_timer(void)
|
||||
{
|
||||
signal(SIGALRM, timeout);
|
||||
done = 0;
|
||||
}
|
||||
|
||||
void timeout(sig)
|
||||
int sig;
|
||||
void timeout(int sig)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
|
|
@ -247,7 +246,7 @@ RecordPtr PtrGlb;
|
|||
RecordPtr PtrGlbNext;
|
||||
|
||||
|
||||
void Proc0()
|
||||
void Proc0(void)
|
||||
{
|
||||
OneToFifty IntLoc1;
|
||||
REG OneToFifty IntLoc2;
|
||||
|
|
@ -383,8 +382,7 @@ void Proc0()
|
|||
}
|
||||
|
||||
|
||||
void Proc1(PtrParIn)
|
||||
REG RecordPtr PtrParIn;
|
||||
void Proc1(REG RecordPtr PtrParIn)
|
||||
{
|
||||
#define NextRecord (*(PtrParIn->PtrComp))
|
||||
|
||||
|
|
@ -407,8 +405,7 @@ REG RecordPtr PtrParIn;
|
|||
}
|
||||
|
||||
|
||||
void Proc2(IntParIO)
|
||||
OneToFifty *IntParIO;
|
||||
void Proc2(OneToFifty *IntParIO)
|
||||
{
|
||||
REG OneToFifty IntLoc;
|
||||
REG Enumeration EnumLoc;
|
||||
|
|
@ -426,8 +423,7 @@ OneToFifty *IntParIO;
|
|||
}
|
||||
|
||||
|
||||
void Proc3(PtrParOut)
|
||||
RecordPtr *PtrParOut;
|
||||
void Proc3(RecordPtr *PtrParOut)
|
||||
{
|
||||
if (PtrGlb != NULL)
|
||||
*PtrParOut = PtrGlb->PtrComp;
|
||||
|
|
@ -437,7 +433,7 @@ RecordPtr *PtrParOut;
|
|||
}
|
||||
|
||||
|
||||
void Proc4()
|
||||
void Proc4(void)
|
||||
{
|
||||
REG boolean BoolLoc;
|
||||
|
||||
|
|
@ -448,16 +444,14 @@ void Proc4()
|
|||
}
|
||||
|
||||
|
||||
void Proc5()
|
||||
void Proc5(void)
|
||||
{
|
||||
Char1Glob = 'A';
|
||||
BoolGlob = FALSE;
|
||||
}
|
||||
|
||||
|
||||
void Proc6(EnumParIn, EnumParOut)
|
||||
REG Enumeration EnumParIn;
|
||||
REG Enumeration *EnumParOut;
|
||||
void Proc6(REG Enumeration EnumParIn, REG Enumeration *EnumParOut)
|
||||
{
|
||||
*EnumParOut = EnumParIn;
|
||||
if (!Func3(EnumParIn)) *EnumParOut = Ident4;
|
||||
|
|
@ -477,10 +471,7 @@ REG Enumeration *EnumParOut;
|
|||
}
|
||||
|
||||
|
||||
void Proc7(IntParI1, IntParI2, IntParOut)
|
||||
OneToFifty IntParI1;
|
||||
OneToFifty IntParI2;
|
||||
OneToFifty *IntParOut;
|
||||
void Proc7(OneToFifty IntParI1, OneToFifty IntParI2, OneToFifty *IntParOut)
|
||||
{
|
||||
REG OneToFifty IntLoc;
|
||||
|
||||
|
|
@ -490,11 +481,8 @@ OneToFifty *IntParOut;
|
|||
}
|
||||
|
||||
|
||||
void Proc8(Array1Par, Array2Par, IntParI1, IntParI2)
|
||||
Array1Dim Array1Par;
|
||||
Array2Dim Array2Par;
|
||||
OneToFifty IntParI1;
|
||||
OneToFifty IntParI2;
|
||||
void Proc8(Array1Dim Array1Par, Array2Dim Array2Par,
|
||||
OneToFifty IntParI1, OneToFifty IntParI2)
|
||||
{
|
||||
REG OneToFifty IntLoc;
|
||||
REG OneToFifty IntIndex;
|
||||
|
|
@ -512,9 +500,7 @@ OneToFifty IntParI2;
|
|||
}
|
||||
|
||||
|
||||
Enumeration Func1(CharPar1, CharPar2)
|
||||
CapitalLetter CharPar1;
|
||||
CapitalLetter CharPar2;
|
||||
Enumeration Func1(int CharPar1, int CharPar2)
|
||||
{
|
||||
REG CapitalLetter CharLoc1;
|
||||
REG CapitalLetter CharLoc2;
|
||||
|
|
@ -529,9 +515,7 @@ CapitalLetter CharPar2;
|
|||
}
|
||||
|
||||
|
||||
boolean Func2(StrParI1, StrParI2)
|
||||
String30 StrParI1;
|
||||
String30 StrParI2;
|
||||
boolean Func2(String30 StrParI1, String30 StrParI2)
|
||||
{
|
||||
REG OneToThirty IntLoc;
|
||||
REG CapitalLetter CharLoc;
|
||||
|
|
@ -556,8 +540,7 @@ String30 StrParI2;
|
|||
}
|
||||
|
||||
|
||||
boolean Func3(EnumParIn)
|
||||
REG Enumeration EnumParIn;
|
||||
boolean Func3(REG Enumeration EnumParIn)
|
||||
{
|
||||
REG Enumeration EnumLoc;
|
||||
|
||||
|
|
@ -569,10 +552,7 @@ REG Enumeration EnumParIn;
|
|||
|
||||
|
||||
#ifdef NOSTRUCTASSIGN
|
||||
memcpy(d, s, l)
|
||||
register char *d;
|
||||
register char *s;
|
||||
register int l;
|
||||
memcpy(register char *d, register char *s, register int l)
|
||||
{
|
||||
while (l--) *d++ = *s++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,29 +146,26 @@ BOOL free_range(unsigned short *first, unsigned short *last);
|
|||
long lmin(long a, long b);
|
||||
|
||||
|
||||
void usage(prog_name)
|
||||
register char *prog_name;
|
||||
void usage(register char *prog_name)
|
||||
{
|
||||
fprintf (stderr, "Usage: %s [%s\n", prog_name,
|
||||
(dos_dir ? "-lr] drive [dir]" : "-a] drive file"));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
unsigned c2u2(ucarray)
|
||||
unsigned char *ucarray;
|
||||
unsigned c2u2(unsigned char *ucarray)
|
||||
{
|
||||
return ucarray[0] + (ucarray[1] << 8); /* parens vital */
|
||||
}
|
||||
|
||||
unsigned long c4u4(ucarray)
|
||||
unsigned char *ucarray;
|
||||
unsigned long c4u4(unsigned char *ucarray)
|
||||
{
|
||||
return ucarray[0] + ((unsigned long) ucarray[1] << 8) +
|
||||
((unsigned long) ucarray[2] << 16) +
|
||||
((unsigned long) ucarray[3] << 24);
|
||||
}
|
||||
|
||||
void determine()
|
||||
void determine(void)
|
||||
{
|
||||
struct dosboot {
|
||||
unsigned char cjump[2]; /* unsigneds avoid bugs */
|
||||
|
|
@ -292,9 +289,7 @@ void determine()
|
|||
}
|
||||
}
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
register char *argv[];
|
||||
int main(int argc, register char *argv[])
|
||||
{
|
||||
register char *arg_ptr = slash(argv[0]);
|
||||
DIRECTORY *entry;
|
||||
|
|
@ -438,11 +433,7 @@ register char *argv[];
|
|||
* separated by slashes, but can be longer than than
|
||||
* 8+3 characters (The rest is ignored).
|
||||
*/
|
||||
DIRECTORY *directory(dir, entries, function, pathname)
|
||||
DIRECTORY *dir;
|
||||
int entries;
|
||||
int function;
|
||||
register char *pathname;
|
||||
DIRECTORY *directory(DIRECTORY *dir, int entries, int function, register char *pathname)
|
||||
{
|
||||
register DIRECTORY *dir_ptr = dir;
|
||||
DIRECTORY *mem = NULL;
|
||||
|
|
@ -564,8 +555,7 @@ register char *pathname;
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void extract(entry)
|
||||
register DIRECTORY *entry;
|
||||
void extract(register DIRECTORY *entry)
|
||||
{
|
||||
register unsigned short cl_no = entry->d_cluster;
|
||||
char buffer[MAX_CLUSTER_SIZE];
|
||||
|
|
@ -614,18 +604,14 @@ register DIRECTORY *entry;
|
|||
|
||||
/* Minimum of two long values
|
||||
*/
|
||||
long lmin (a, b)
|
||||
long a, b;
|
||||
long lmin (long a, long b)
|
||||
{
|
||||
if (a < b) return a;
|
||||
else return b;
|
||||
}
|
||||
|
||||
|
||||
void make_file(dir_ptr, entries, name)
|
||||
DIRECTORY *dir_ptr;
|
||||
int entries;
|
||||
char *name;
|
||||
void make_file(DIRECTORY *dir_ptr, int entries, char *name)
|
||||
{
|
||||
register DIRECTORY *entry = new_entry(dir_ptr, entries);
|
||||
register char *ptr;
|
||||
|
|
@ -693,8 +679,7 @@ done:
|
|||
|
||||
unsigned short mon_len[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
|
||||
void fill_date(entry)
|
||||
DIRECTORY *entry;
|
||||
void fill_date(DIRECTORY *entry)
|
||||
{
|
||||
register long cur_time = time(NULL) - DOS_TIME;
|
||||
unsigned short year = 0, month = 1, day, hour, minutes, seconds;
|
||||
|
|
@ -733,9 +718,7 @@ DIRECTORY *entry;
|
|||
entry->d_time = (hour << 11) | (minutes << 5) | seconds;
|
||||
}
|
||||
|
||||
char *make_name(dir_ptr, dir_fl)
|
||||
register DIRECTORY *dir_ptr;
|
||||
short dir_fl;
|
||||
char *make_name(register DIRECTORY *dir_ptr, int dir_fl)
|
||||
{
|
||||
static char name_buf[14];
|
||||
register char *ptr = name_buf;
|
||||
|
|
@ -760,9 +743,7 @@ short dir_fl;
|
|||
}
|
||||
|
||||
|
||||
int fill(buffer, size)
|
||||
register char *buffer;
|
||||
size_t size;
|
||||
int fill(register char *buffer, size_t size)
|
||||
{
|
||||
static BOOL nl_mark = FALSE;
|
||||
char *last = &buffer[size];
|
||||
|
|
@ -799,17 +780,14 @@ char *month[] = {
|
|||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
void xmodes(mode)
|
||||
int mode;
|
||||
void xmodes(int mode)
|
||||
{
|
||||
printf ( "\t%c%c%c%c%c", (mode & SUB_DIR) ? 'd' : '-',
|
||||
(mode & 02) ? 'h' : '-', (mode & 04) ? 's' : '-',
|
||||
(mode & 01) ? '-' : 'w', (mode & 0x20) ? 'a' : '-');
|
||||
}
|
||||
|
||||
void show(dir_ptr, name)
|
||||
DIRECTORY *dir_ptr;
|
||||
char *name;
|
||||
void show(DIRECTORY *dir_ptr, char *name)
|
||||
{
|
||||
register unsigned short e_date = dir_ptr->d_date;
|
||||
register unsigned short e_time = dir_ptr->d_time;
|
||||
|
|
@ -837,7 +815,7 @@ char *name;
|
|||
month[((e_date & MONTH) >> 5) - 1], ((e_date & YEAR) >> 9) + 1980);
|
||||
}
|
||||
|
||||
void free_blocks()
|
||||
void free_blocks(void)
|
||||
{
|
||||
register unsigned short cl_no;
|
||||
long nr_free = 0;
|
||||
|
|
@ -856,8 +834,7 @@ void free_blocks()
|
|||
}
|
||||
|
||||
|
||||
DIRECTORY *read_cluster(cluster)
|
||||
register unsigned int cluster;
|
||||
DIRECTORY *read_cluster(register unsigned int cluster)
|
||||
{
|
||||
register DIRECTORY *sub_dir;
|
||||
|
||||
|
|
@ -879,8 +856,7 @@ static unsigned short cl_index = 2;
|
|||
* Warning: Assumes that all of the range is used before the next call
|
||||
* to free_range or free_cluster.
|
||||
*/
|
||||
BOOL free_range (first, last)
|
||||
unsigned short *first, *last;
|
||||
BOOL free_range (unsigned short *first, unsigned short *last)
|
||||
{
|
||||
while (cl_index < total_clusters && next_cluster(cl_index) != FREE)
|
||||
cl_index++;
|
||||
|
|
@ -902,8 +878,7 @@ unsigned short *first, *last;
|
|||
* Warning: Assumes that the cluster is used before the next call
|
||||
* to free_range or free_cluster.
|
||||
*/
|
||||
unsigned short free_cluster(leave_fl)
|
||||
BOOL leave_fl;
|
||||
unsigned short free_cluster(BOOL leave_fl)
|
||||
{
|
||||
while (cl_index < total_clusters && next_cluster(cl_index) != FREE)
|
||||
cl_index++;
|
||||
|
|
@ -918,8 +893,7 @@ BOOL leave_fl;
|
|||
|
||||
/* read a portion of the fat containing |cl_no| into the cache
|
||||
*/
|
||||
void read_fat (cl_no)
|
||||
unsigned int cl_no;
|
||||
void read_fat (unsigned int cl_no)
|
||||
{
|
||||
|
||||
if (!cooked_fat) {
|
||||
|
|
@ -999,7 +973,7 @@ void read_fat (cl_no)
|
|||
|
||||
/* flush the fat cache out to disk
|
||||
*/
|
||||
void flush_fat ()
|
||||
void flush_fat (void)
|
||||
{
|
||||
if (fat_16) {
|
||||
if (big_endian) {
|
||||
|
|
@ -1037,9 +1011,7 @@ void flush_fat ()
|
|||
|
||||
/* make cl_2 the successor of cl_1
|
||||
*/
|
||||
void link_fat(cl_1, cl_2)
|
||||
unsigned int cl_1;
|
||||
unsigned int cl_2;
|
||||
void link_fat(unsigned int cl_1, unsigned int cl_2)
|
||||
{
|
||||
if (cl_1 < fat_low || cl_1 > fat_high) {
|
||||
if (fat_dirty) flush_fat ();
|
||||
|
|
@ -1050,8 +1022,7 @@ unsigned int cl_2;
|
|||
}
|
||||
|
||||
|
||||
unsigned short next_cluster(cl_no)
|
||||
register unsigned int cl_no;
|
||||
unsigned short next_cluster(register unsigned int cl_no)
|
||||
{
|
||||
if (cl_no < fat_low || cl_no > fat_high) {
|
||||
if (fat_dirty) flush_fat ();
|
||||
|
|
@ -1060,8 +1031,7 @@ register unsigned int cl_no;
|
|||
return cooked_fat [cl_no - fat_low];
|
||||
}
|
||||
|
||||
char *slash(str)
|
||||
register char *str;
|
||||
char *slash(register char *str)
|
||||
{
|
||||
register char *result = str;
|
||||
|
||||
|
|
@ -1071,9 +1041,7 @@ register char *str;
|
|||
return result;
|
||||
}
|
||||
|
||||
void add_path(file, slash_fl)
|
||||
char *file;
|
||||
BOOL slash_fl;
|
||||
void add_path(char *file, BOOL slash_fl)
|
||||
{
|
||||
register char *ptr = path;
|
||||
|
||||
|
|
@ -1091,11 +1059,7 @@ BOOL slash_fl;
|
|||
}
|
||||
|
||||
|
||||
void disk_io(op, seek, address, bytes)
|
||||
register BOOL op;
|
||||
unsigned long seek;
|
||||
void *address;
|
||||
register unsigned bytes;
|
||||
void disk_io(register BOOL op, unsigned long seek, void *address, register unsigned bytes)
|
||||
{
|
||||
unsigned int r;
|
||||
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ void printtotal(void);
|
|||
void chkdev(char *f, char **clist, char **ilist, char **zlist);
|
||||
|
||||
/* Initialize the variables used by this program. */
|
||||
void initvars()
|
||||
void initvars(void)
|
||||
{
|
||||
register int level;
|
||||
|
||||
|
|
@ -238,23 +238,20 @@ void initvars()
|
|||
}
|
||||
|
||||
/* Print the string `s' and exit. */
|
||||
void fatal(s)
|
||||
char *s;
|
||||
void fatal(char *s)
|
||||
{
|
||||
printf("%s\nfatal\n", s);
|
||||
exit(FSCK_EXIT_CHECK_FAILED);
|
||||
}
|
||||
|
||||
/* Test for end of line. */
|
||||
int eoln(c)
|
||||
int c;
|
||||
int eoln(int c)
|
||||
{
|
||||
return(c == EOF || c == '\n' || c == '\r');
|
||||
}
|
||||
|
||||
/* Ask a question and get the answer unless automatic is set. */
|
||||
int yes(question)
|
||||
char *question;
|
||||
int yes(char *question)
|
||||
{
|
||||
register int c, answerchar;
|
||||
static int note = 0;
|
||||
|
|
@ -280,8 +277,7 @@ char *question;
|
|||
}
|
||||
|
||||
/* Convert string to integer. Representation is octal. */
|
||||
int atoo(s)
|
||||
register char *s;
|
||||
int atoo(register char *s)
|
||||
{
|
||||
register int n = 0;
|
||||
|
||||
|
|
@ -293,9 +289,7 @@ register char *s;
|
|||
}
|
||||
|
||||
/* If repairing the file system, print a prompt and get a string from user. */
|
||||
int input(buf, size)
|
||||
char *buf;
|
||||
int size;
|
||||
int input(char *buf, int size)
|
||||
{
|
||||
register char *p = buf;
|
||||
|
||||
|
|
@ -319,8 +313,7 @@ int size;
|
|||
}
|
||||
|
||||
/* Allocate some memory and zero it. */
|
||||
char *alloc(nelem, elsize)
|
||||
unsigned nelem, elsize;
|
||||
char *alloc(unsigned nelem, unsigned elsize)
|
||||
{
|
||||
char *p;
|
||||
|
||||
|
|
@ -334,8 +327,7 @@ unsigned nelem, elsize;
|
|||
}
|
||||
|
||||
/* Print the name in a directory entry. */
|
||||
void printname(s)
|
||||
char *s;
|
||||
void printname(char *s)
|
||||
{
|
||||
register int n = MFS_NAME_MAX;
|
||||
int c;
|
||||
|
|
@ -361,9 +353,7 @@ void printrec(struct stack *sp)
|
|||
}
|
||||
|
||||
/* Print the current pathname. */
|
||||
void printpath(mode, nlcr)
|
||||
int mode;
|
||||
int nlcr;
|
||||
void printpath(int mode, int nlcr)
|
||||
{
|
||||
if (ftop->st_next == 0)
|
||||
putchar('/');
|
||||
|
|
@ -381,7 +371,7 @@ int nlcr;
|
|||
}
|
||||
|
||||
/* Open the device. */
|
||||
void devopen()
|
||||
void devopen(void)
|
||||
{
|
||||
if ((dev = open(fsck_device,
|
||||
(repair || markdirty) ? O_RDWR : O_RDONLY)) < 0) {
|
||||
|
|
@ -391,7 +381,7 @@ void devopen()
|
|||
}
|
||||
|
||||
/* Close the device. */
|
||||
void devclose()
|
||||
void devclose(void)
|
||||
{
|
||||
if (close(dev) != 0) {
|
||||
perror("close");
|
||||
|
|
@ -400,9 +390,7 @@ void devclose()
|
|||
}
|
||||
|
||||
/* Read or write a block. */
|
||||
void devio(bno, dir)
|
||||
block_nr bno;
|
||||
int dir;
|
||||
void devio(block_nr bno, int dir)
|
||||
{
|
||||
off_t r;
|
||||
|
||||
|
|
@ -437,11 +425,7 @@ printf("%s at block %5d\n", dir == READING ? "reading " : "writing", bno);
|
|||
/* Read `size' bytes from the disk starting at block 'block' and
|
||||
* byte `offset'.
|
||||
*/
|
||||
void devread(block, offset, buf, size)
|
||||
long block;
|
||||
long offset;
|
||||
char *buf;
|
||||
int size;
|
||||
void devread(long block, long offset, char *buf, int size)
|
||||
{
|
||||
if(!block_size) fatal("devread() with unknown block size");
|
||||
if (offset >= block_size)
|
||||
|
|
@ -456,11 +440,7 @@ int size;
|
|||
/* Write `size' bytes to the disk starting at block 'block' and
|
||||
* byte `offset'.
|
||||
*/
|
||||
void devwrite(block, offset, buf, size)
|
||||
long block;
|
||||
long offset;
|
||||
char *buf;
|
||||
int size;
|
||||
void devwrite(long block, long offset, char *buf, int size)
|
||||
{
|
||||
if(!block_size) fatal("devwrite() with unknown block size");
|
||||
if (!repair) fatal("internal error (devwrite)");
|
||||
|
|
@ -476,24 +456,19 @@ int size;
|
|||
}
|
||||
|
||||
/* Print a string with either a singular or a plural pronoun. */
|
||||
void pr(fmt, cnt, s, p)
|
||||
char *fmt, *s, *p;
|
||||
int cnt;
|
||||
void pr(char *fmt, int cnt, char *s, char *p)
|
||||
{
|
||||
printf(fmt, cnt, cnt == 1 ? s : p);
|
||||
}
|
||||
|
||||
/* Same as above, but with a long argument */
|
||||
void lpr(fmt, cnt, s, p)
|
||||
char *fmt, *s, *p;
|
||||
long cnt;
|
||||
void lpr(char *fmt, long cnt, char *s, char *p)
|
||||
{
|
||||
printf(fmt, cnt, cnt == 1 ? s : p);
|
||||
}
|
||||
|
||||
/* Convert string to number. */
|
||||
bit_nr getnumber(s)
|
||||
register char *s;
|
||||
bit_nr getnumber(register char *s)
|
||||
{
|
||||
register bit_nr n = 0;
|
||||
|
||||
|
|
@ -505,8 +480,7 @@ register char *s;
|
|||
}
|
||||
|
||||
/* See if the list pointed to by `argv' contains numbers. */
|
||||
char **getlist(argv, type)
|
||||
char ***argv, *type;
|
||||
char **getlist(char ***argv, char *type)
|
||||
{
|
||||
register char **list = *argv;
|
||||
register int empty = 1;
|
||||
|
|
@ -525,7 +499,7 @@ char ***argv, *type;
|
|||
/* Make a listing of the super block. If `repair' is set, ask the user
|
||||
* for changes.
|
||||
*/
|
||||
void lsuper()
|
||||
void lsuper(void)
|
||||
{
|
||||
char buf[80];
|
||||
|
||||
|
|
@ -599,7 +573,7 @@ void rw_super(int put)
|
|||
}
|
||||
|
||||
/* Check the super block for reasonable contents. */
|
||||
void chksuper()
|
||||
void chksuper(void)
|
||||
{
|
||||
register int n;
|
||||
register off_t maxsize;
|
||||
|
|
@ -667,8 +641,7 @@ int inooff(int inn)
|
|||
/* Make a listing of the inodes given by `clist'. If `repair' is set, ask
|
||||
* the user for changes.
|
||||
*/
|
||||
void lsi(clist)
|
||||
char **clist;
|
||||
void lsi(char **clist)
|
||||
{
|
||||
register bit_nr bit;
|
||||
register ino_t ino;
|
||||
|
|
@ -698,8 +671,7 @@ char **clist;
|
|||
}
|
||||
|
||||
/* Allocate `nblk' blocks worth of bitmap. */
|
||||
bitchunk_t *allocbitmap(nblk)
|
||||
int nblk;
|
||||
bitchunk_t *allocbitmap(int nblk)
|
||||
{
|
||||
register bitchunk_t *bitmap;
|
||||
|
||||
|
|
@ -709,10 +681,7 @@ int nblk;
|
|||
}
|
||||
|
||||
/* Load the bitmap starting at block `bno' from disk. */
|
||||
void loadbitmap(bitmap, bno, nblk)
|
||||
bitchunk_t *bitmap;
|
||||
block_nr bno;
|
||||
int nblk;
|
||||
void loadbitmap(bitchunk_t *bitmap, block_nr bno, int nblk)
|
||||
{
|
||||
register int i;
|
||||
register bitchunk_t *p;
|
||||
|
|
@ -724,10 +693,7 @@ int nblk;
|
|||
}
|
||||
|
||||
/* Write the bitmap starting at block `bno' to disk. */
|
||||
void dumpbitmap(bitmap, bno, nblk)
|
||||
bitchunk_t *bitmap;
|
||||
block_nr bno;
|
||||
int nblk;
|
||||
void dumpbitmap(bitchunk_t *bitmap, block_nr bno, int nblk)
|
||||
{
|
||||
register int i;
|
||||
register bitchunk_t *p = bitmap;
|
||||
|
|
@ -737,10 +703,7 @@ int nblk;
|
|||
}
|
||||
|
||||
/* Set the bits given by `list' in the bitmap. */
|
||||
void fillbitmap(bitmap, lwb, upb, list)
|
||||
bitchunk_t *bitmap;
|
||||
bit_nr lwb, upb;
|
||||
char **list;
|
||||
void fillbitmap(bitchunk_t *bitmap, bit_nr lwb, bit_nr upb, char **list)
|
||||
{
|
||||
register bit_nr bit;
|
||||
|
||||
|
|
@ -757,14 +720,13 @@ char **list;
|
|||
}
|
||||
|
||||
/* Deallocate the bitmap `p'. */
|
||||
void freebitmap(p)
|
||||
bitchunk_t *p;
|
||||
void freebitmap(bitchunk_t *p)
|
||||
{
|
||||
free((char *) p);
|
||||
}
|
||||
|
||||
/* Get all the bitmaps used by this program. */
|
||||
void getbitmaps()
|
||||
void getbitmaps(void)
|
||||
{
|
||||
imap = allocbitmap(N_IMAP);
|
||||
zmap = allocbitmap(N_ZMAP);
|
||||
|
|
@ -774,7 +736,7 @@ void getbitmaps()
|
|||
}
|
||||
|
||||
/* Release all the space taken by the bitmaps. */
|
||||
void putbitmaps()
|
||||
void putbitmaps(void)
|
||||
{
|
||||
freebitmap(imap);
|
||||
freebitmap(zmap);
|
||||
|
|
@ -786,12 +748,7 @@ void putbitmaps()
|
|||
/* `w1' and `w2' are differing words from two bitmaps that should be
|
||||
* identical. Print what's the matter with them.
|
||||
*/
|
||||
void chkword(w1, w2, bit, type, n, report, phys)
|
||||
unsigned w1, w2;
|
||||
char *type;
|
||||
bit_nr bit;
|
||||
int *n, *report;
|
||||
bit_nr phys;
|
||||
void chkword(unsigned w1, unsigned w2, bit_nr bit, char *type, int *n, int *report, bit_nr phys)
|
||||
{
|
||||
for (; (w1 | w2); w1 >>= 1, w2 >>= 1, bit++, phys++)
|
||||
if ((w1 ^ w2) & 1 && ++(*n) % MAXPRINT == 0 && *report &&
|
||||
|
|
@ -810,12 +767,7 @@ bit_nr phys;
|
|||
/* Check if the given (correct) bitmap is identical with the one that is
|
||||
* on the disk. If not, ask if the disk should be repaired.
|
||||
*/
|
||||
void chkmap(cmap, dmap, bit, blkno, nblk, type)
|
||||
bitchunk_t *cmap, *dmap;
|
||||
bit_nr bit;
|
||||
block_nr blkno;
|
||||
int nblk;
|
||||
char *type;
|
||||
void chkmap(bitchunk_t *cmap, bitchunk_t *dmap, bit_nr bit, block_nr blkno, int nblk, char *type)
|
||||
{
|
||||
register bitchunk_t *p = dmap, *q = cmap;
|
||||
int report = 1, nerr = 0;
|
||||
|
|
@ -841,7 +793,7 @@ char *type;
|
|||
}
|
||||
|
||||
/* See if the inodes that aren't allocated are cleared. */
|
||||
void chkilist()
|
||||
void chkilist(void)
|
||||
{
|
||||
register ino_t ino = 1;
|
||||
mode_t mode;
|
||||
|
|
@ -864,7 +816,7 @@ void chkilist()
|
|||
}
|
||||
|
||||
/* Allocate an array to maintain the inode reference counts in. */
|
||||
void getcount()
|
||||
void getcount(void)
|
||||
{
|
||||
count = (nlink_t *) alloc((unsigned) (sb.s_ninodes + 1), sizeof(nlink_t));
|
||||
}
|
||||
|
|
@ -898,7 +850,7 @@ void counterror(ino_t ino)
|
|||
* Thus, when the whole file system has been traversed, all the entries
|
||||
* should be zero.
|
||||
*/
|
||||
void chkcount()
|
||||
void chkcount(void)
|
||||
{
|
||||
register ino_t ino;
|
||||
|
||||
|
|
@ -908,7 +860,7 @@ void chkcount()
|
|||
}
|
||||
|
||||
/* Deallocate the `count' array. */
|
||||
void freecount()
|
||||
void freecount(void)
|
||||
{
|
||||
free((char *) count);
|
||||
}
|
||||
|
|
@ -983,10 +935,7 @@ int Remove(dir_struct *dp)
|
|||
}
|
||||
|
||||
/* Convert string so that embedded control characters are printable. */
|
||||
void make_printable_name(dst, src, n)
|
||||
register char *dst;
|
||||
register char *src;
|
||||
register int n;
|
||||
void make_printable_name(register char *dst, register char *src, register int n)
|
||||
{
|
||||
register int c;
|
||||
|
||||
|
|
@ -1194,11 +1143,7 @@ int chksymlinkzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno)
|
|||
}
|
||||
|
||||
/* There is something wrong with the given zone. Print some details. */
|
||||
void errzone(mess, zno, level, pos)
|
||||
char *mess;
|
||||
zone_nr zno;
|
||||
int level;
|
||||
off_t pos;
|
||||
void errzone(char *mess, zone_nr zno, int level, off_t pos)
|
||||
{
|
||||
printf("%s zone in ", mess);
|
||||
printpath(1, 0);
|
||||
|
|
@ -1215,10 +1160,7 @@ off_t pos;
|
|||
/* Found the given zone in the given inode. Check it, and if ok, mark it
|
||||
* in the zone bitmap.
|
||||
*/
|
||||
int markzone(zno, level, pos)
|
||||
zone_nr zno;
|
||||
int level;
|
||||
off_t pos;
|
||||
int markzone(zone_nr zno, int level, off_t pos)
|
||||
{
|
||||
register bit_nr bit = (bit_nr) zno - FIRST + 1;
|
||||
|
||||
|
|
@ -1259,8 +1201,7 @@ int chkindzone(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)
|
|||
/* Return the size of a gap in the file, represented by a null zone number
|
||||
* at some level of indirection.
|
||||
*/
|
||||
off_t jump(level)
|
||||
int level;
|
||||
off_t jump(int level)
|
||||
{
|
||||
off_t power = ZONE_SIZE;
|
||||
|
||||
|
|
@ -1451,8 +1392,7 @@ int chkinode(ino_t ino, d_inode *ip)
|
|||
}
|
||||
|
||||
/* Check the directory entry pointed to by dp, by checking the inode. */
|
||||
int descendtree(dp)
|
||||
dir_struct *dp;
|
||||
int descendtree(dir_struct *dp)
|
||||
{
|
||||
d_inode inode;
|
||||
register ino_t ino = dp->d_inum;
|
||||
|
|
@ -1488,7 +1428,7 @@ dir_struct *dp;
|
|||
}
|
||||
|
||||
/* Check the file system tree. */
|
||||
void chktree()
|
||||
void chktree(void)
|
||||
{
|
||||
dir_struct dir;
|
||||
|
||||
|
|
@ -1501,7 +1441,7 @@ void chktree()
|
|||
}
|
||||
|
||||
/* Print the totals of all the objects found. */
|
||||
void printtotal()
|
||||
void printtotal(void)
|
||||
{
|
||||
if(preen) {
|
||||
printf("%d files, %d directories, %d free inodes, %ld free zones\n",
|
||||
|
|
@ -1535,8 +1475,7 @@ void printtotal()
|
|||
* listed by `zlist' should be watched for while checking the file system.
|
||||
*/
|
||||
|
||||
void chkdev(f, clist, ilist, zlist)
|
||||
char *f, **clist, **ilist, **zlist;
|
||||
void chkdev(char *f, char **clist, char **ilist, char **zlist)
|
||||
{
|
||||
if (automatic) repair = 1;
|
||||
fsck_device = f;
|
||||
|
|
@ -1613,9 +1552,7 @@ char *f, **clist, **ilist, **zlist;
|
|||
devclose();
|
||||
}
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
register char **clist = 0, **ilist = 0, **zlist = 0;
|
||||
int badflag = 0;
|
||||
|
|
|
|||
|
|
@ -66,13 +66,11 @@ void gettable(void);
|
|||
void parse(void);
|
||||
void usage(void);
|
||||
|
||||
#ifdef __STDC__
|
||||
|
||||
/* Get next arg from file into cbuf, */
|
||||
/* returning the character that */
|
||||
/* terminated it. Cbuf returns 0 */
|
||||
char fgetarg ( FILE *stream , char *cbuf )
|
||||
#else
|
||||
char fgetarg(stream, cbuf) /* Get next arg from file into cbuf, */
|
||||
FILE *stream; /* returning the character that */
|
||||
char *cbuf; /* terminated it. Cbuf returns 0 */
|
||||
#endif
|
||||
{ /* if no arg. EOF is returned if no */
|
||||
int ch; /* args left in file. */
|
||||
int i;
|
||||
|
|
@ -95,12 +93,7 @@ char *cbuf; /* terminated it. Cbuf returns 0 */
|
|||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
int find ( char *sym )
|
||||
#else
|
||||
int find(sym)
|
||||
char *sym;
|
||||
#endif
|
||||
{ /* Return DEF if defined else UNDEF */
|
||||
|
||||
deftemp = defptr;
|
||||
|
|
@ -118,14 +111,10 @@ char *sym;
|
|||
#define Undefine(x,y) defit(x,y,UNDEF)
|
||||
#define Ignore(x,y) defit(x,y,IGN)
|
||||
|
||||
#ifdef __STDC__
|
||||
/* Add symbol to the define list */
|
||||
/* Mode: MUTABLE etc */
|
||||
/* Type: DEF, UNDEF, IGN */
|
||||
void defit ( char *sym , int redef , int type )
|
||||
#else
|
||||
void defit(sym, redef, type) /* Add symbol to the define list */
|
||||
char *sym;
|
||||
char redef; /* Mode: MUTABLE etc */
|
||||
char type; /* Type: DEF, UNDEF, IGN */
|
||||
#endif
|
||||
{
|
||||
struct DEFINE *temp;
|
||||
char c;
|
||||
|
|
@ -167,11 +156,7 @@ char type; /* Type: DEF, UNDEF, IGN */
|
|||
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void stop ( void )
|
||||
#else
|
||||
void stop()
|
||||
#endif
|
||||
{ /* Stop: Tidy up at EOF */
|
||||
if (table) printtable();
|
||||
(void)fclose(zin);
|
||||
|
|
@ -181,23 +166,16 @@ void stop()
|
|||
#define Goto { line++; if (ch!='\n') gotoeoln(); }
|
||||
#define Print { line++; if (ch!='\n') prteoln(); }
|
||||
|
||||
#ifdef __STDC__
|
||||
/* Go to the end of the line */
|
||||
void gotoeoln ( void )
|
||||
#else
|
||||
void gotoeoln() /* Go to the end of the line */
|
||||
#endif
|
||||
{
|
||||
int ch;
|
||||
while ((ch = fgetc(zin)) != '\n')
|
||||
if (ch == EOF) stop();
|
||||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
/* Print to the end of the line */
|
||||
void prteoln ( void )
|
||||
#else
|
||||
void prteoln() /* Print to the end of the line */
|
||||
#endif
|
||||
{
|
||||
int ch;
|
||||
while ((ch = fgetc(zin)) != '\n')
|
||||
|
|
@ -209,11 +187,8 @@ void prteoln() /* Print to the end of the line */
|
|||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
/* Print the defines in the SLL */
|
||||
void printtable ( void )
|
||||
#else
|
||||
void printtable() /* Print the defines in the SLL */
|
||||
#endif
|
||||
{
|
||||
struct DEFINE *temp;
|
||||
|
||||
|
|
@ -234,11 +209,7 @@ void printtable() /* Print the defines in the SLL */
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
char getendif ( void )
|
||||
#else
|
||||
char getendif()
|
||||
#endif
|
||||
{ /* Find matching endif when ignoring */
|
||||
char word[80]; /* Buffer for symbols */
|
||||
int ch;
|
||||
|
|
@ -268,11 +239,8 @@ char getendif()
|
|||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
/* Get & print a table of defines etc. */
|
||||
void gettable ( void )
|
||||
#else
|
||||
void gettable() /* Get & print a table of defines etc. */
|
||||
#endif
|
||||
{
|
||||
|
||||
char word[80]; /* Buffer for symbols */
|
||||
|
|
@ -313,11 +281,7 @@ void gettable() /* Get & print a table of defines etc. */
|
|||
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void parse ( void )
|
||||
#else
|
||||
void parse()
|
||||
#endif
|
||||
{ /* Parse & remove ifdefs from C source */
|
||||
char word[80]; /* Buffer for symbols */
|
||||
int ch;
|
||||
|
|
@ -435,24 +399,14 @@ void parse()
|
|||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void usage ( void )
|
||||
#else
|
||||
void usage()
|
||||
#endif
|
||||
{
|
||||
(void)fprintf(stderr, "Usage: ifdef [-t] [-Dsymbol] [-dsymbol] [-Usymbol] [-Isymbol] <file>\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
int main(int argc , char *argv [])
|
||||
#else
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#endif
|
||||
{
|
||||
char sym[80]; /* Temp symbol storage */
|
||||
int c;
|
||||
|
|
|
|||
|
|
@ -184,10 +184,7 @@ int Verbose = 0; /* 1 = Print all info on directories */
|
|||
int ByteOffset = 0; /* 1 = Print byte offset and length of files */
|
||||
int Aflag = 0; /* 1 = Suppress output of \r */
|
||||
|
||||
int iso_cmp(name, dir_ptr, dir_flag)
|
||||
char *name;
|
||||
struct dir_entry *dir_ptr;
|
||||
int dir_flag;
|
||||
int iso_cmp(char *name, struct dir_entry *dir_ptr, int dir_flag)
|
||||
{
|
||||
/* Compare name with directory entries, looking for match with a dirname.
|
||||
* An iso9660 filename is terminated by ";n", where n will probably
|
||||
|
|
@ -215,7 +212,7 @@ int dir_flag;
|
|||
}
|
||||
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
if (Read_Dir)
|
||||
fprintf (STDERR, "Usage: isodir [-lrB] inputfile [dir]\n");
|
||||
|
|
@ -227,9 +224,7 @@ void usage()
|
|||
}
|
||||
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct dir_entry *entry;
|
||||
char path[MAX_PATH_LENGTH];
|
||||
|
|
@ -352,8 +347,7 @@ char **argv;
|
|||
}
|
||||
|
||||
|
||||
struct dir_entry *look_up(path)
|
||||
char *path;
|
||||
struct dir_entry *look_up(char *path)
|
||||
{
|
||||
/* Lookup a file name */
|
||||
|
||||
|
|
@ -428,9 +422,7 @@ char *path;
|
|||
}
|
||||
|
||||
|
||||
void recurse_dir(path, dir_ptr)
|
||||
char *path;
|
||||
struct dir_entry *dir_ptr;
|
||||
void recurse_dir(char *path, struct dir_entry *dir_ptr)
|
||||
{
|
||||
/* Recursively descend all directories starting with dir_ptr */
|
||||
|
||||
|
|
@ -503,8 +495,7 @@ struct dir_entry *dir_ptr;
|
|||
}
|
||||
|
||||
|
||||
void list_dir(dir_ptr)
|
||||
struct dir_entry *dir_ptr;
|
||||
void list_dir(struct dir_entry *dir_ptr)
|
||||
{
|
||||
/* List all entries in a directory */
|
||||
int tty;
|
||||
|
|
@ -601,8 +592,7 @@ struct dir_entry *dir_ptr;
|
|||
}
|
||||
|
||||
|
||||
void print_dir_date(date)
|
||||
char *date;
|
||||
void print_dir_date(char *date)
|
||||
{
|
||||
/* Print date in a directory entry */
|
||||
|
||||
|
|
@ -623,8 +613,7 @@ char *date;
|
|||
}
|
||||
|
||||
|
||||
void list_file(dir_ptr)
|
||||
struct dir_entry *dir_ptr;
|
||||
void list_file(struct dir_entry *dir_ptr)
|
||||
{
|
||||
/* List contents of a file */
|
||||
|
||||
|
|
@ -658,8 +647,7 @@ struct dir_entry *dir_ptr;
|
|||
}
|
||||
|
||||
|
||||
void print_date(date)
|
||||
char *date;
|
||||
void print_date(char *date)
|
||||
{
|
||||
/* Print the date in a volume descriptor */
|
||||
|
||||
|
|
@ -680,8 +668,7 @@ char *date;
|
|||
date[13]);
|
||||
}
|
||||
|
||||
void iso_info(vol_desc)
|
||||
struct iso9660_descriptor *vol_desc;
|
||||
void iso_info(struct iso9660_descriptor *vol_desc)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -711,8 +698,7 @@ struct iso9660_descriptor *vol_desc;
|
|||
}
|
||||
|
||||
|
||||
void hs_info(vol_desc)
|
||||
struct high_sierra_descriptor *vol_desc;
|
||||
void hs_info(struct high_sierra_descriptor *vol_desc)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -730,7 +716,7 @@ struct high_sierra_descriptor *vol_desc;
|
|||
}
|
||||
|
||||
|
||||
int valid_fs()
|
||||
int valid_fs(void)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
|
@ -764,10 +750,7 @@ int valid_fs()
|
|||
}
|
||||
|
||||
|
||||
void read_device(offset, nr_of_bytes, buffer)
|
||||
long offset;
|
||||
int nr_of_bytes;
|
||||
char *buffer;
|
||||
void read_device(long offset, int nr_of_bytes, char *buffer)
|
||||
{
|
||||
int bytes_read;
|
||||
|
||||
|
|
@ -790,15 +773,13 @@ char *buffer;
|
|||
|
||||
/* The ISO9660 functions */
|
||||
|
||||
int iso_711 (c)
|
||||
char *c;
|
||||
int iso_711 (char *c)
|
||||
{
|
||||
return (*c & 0xff);
|
||||
}
|
||||
|
||||
|
||||
int iso_712 (c)
|
||||
char *c;
|
||||
int iso_712 (char *c)
|
||||
{
|
||||
int n;
|
||||
|
||||
|
|
@ -807,20 +788,17 @@ char *c;
|
|||
return n;
|
||||
}
|
||||
|
||||
int iso_721 (c)
|
||||
char *c;
|
||||
int iso_721 (char *c)
|
||||
{
|
||||
return ((c[0] & 0xff) | ((c[1] & 0xff) << 8));
|
||||
}
|
||||
|
||||
int iso_722 (c)
|
||||
char *c;
|
||||
int iso_722 (char *c)
|
||||
{
|
||||
return (((c[0] & 0xff) << 8) | (c[1] & 0xff));
|
||||
}
|
||||
|
||||
int iso_723 (c)
|
||||
char *c;
|
||||
int iso_723 (char *c)
|
||||
{
|
||||
if (c[0] != c[3] || c[1] != c[2])
|
||||
{
|
||||
|
|
@ -830,8 +808,7 @@ char *c;
|
|||
return (iso_721 (c));
|
||||
}
|
||||
|
||||
long iso_731 (c)
|
||||
char *c;
|
||||
long iso_731 (char *c)
|
||||
{
|
||||
return ((long)(c[0] & 0xff)
|
||||
| ((long)(c[1] & 0xff) << 8)
|
||||
|
|
@ -840,8 +817,7 @@ char *c;
|
|||
}
|
||||
|
||||
|
||||
long iso_732 (c)
|
||||
char *c;
|
||||
long iso_732 (char *c)
|
||||
{
|
||||
return (((long)(c[0] & 0xff) << 24)
|
||||
| (((long)c[1] & 0xff) << 16)
|
||||
|
|
@ -849,8 +825,7 @@ char *c;
|
|||
| ((long)c[3] & 0xff));
|
||||
}
|
||||
|
||||
long iso_733 (c)
|
||||
char *c;
|
||||
long iso_733 (char *c)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
|
|||
|
|
@ -91,9 +91,7 @@ char *whoami(void);
|
|||
void dohelp(void);
|
||||
int filesize(char *name);
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
|
||||
|
|
@ -161,9 +159,7 @@ char *argv[];
|
|||
return(0);
|
||||
}
|
||||
|
||||
int deliver(count, vec)
|
||||
int count;
|
||||
char *vec[];
|
||||
int deliver(int count, char *vec[])
|
||||
{
|
||||
int i, j;
|
||||
int errs = 0; /* count of errors */
|
||||
|
|
@ -343,7 +339,7 @@ nobox:
|
|||
* for interactive mails, this might be the place to do it (though the
|
||||
* case where a MAILER is being used would also need to be handled).
|
||||
*/
|
||||
FILE *makerewindable()
|
||||
FILE *makerewindable(void)
|
||||
{
|
||||
FILE *tempfp; /* temp file used for copy */
|
||||
int c; /* character being copied */
|
||||
|
|
@ -387,8 +383,7 @@ done:
|
|||
return tempfp;
|
||||
}
|
||||
|
||||
int copy(fromfp, tofp)
|
||||
FILE *fromfp, *tofp;
|
||||
int copy(FILE *fromfp, FILE *tofp)
|
||||
{
|
||||
int c; /* character being copied */
|
||||
int state; /* ".\n" and postmark detection state */
|
||||
|
|
@ -455,7 +450,7 @@ done:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void readbox()
|
||||
void readbox(void)
|
||||
{
|
||||
char linebuf[512];
|
||||
struct letter *let;
|
||||
|
|
@ -496,7 +491,7 @@ void readbox()
|
|||
}
|
||||
}
|
||||
|
||||
void printall()
|
||||
void printall(void)
|
||||
{
|
||||
struct letter *let;
|
||||
|
||||
|
|
@ -512,7 +507,7 @@ void printall()
|
|||
}
|
||||
}
|
||||
|
||||
void interact()
|
||||
void interact(void)
|
||||
{
|
||||
char linebuf[512]; /* user input line */
|
||||
struct letter *let, *next; /* current and next letter */
|
||||
|
|
@ -592,15 +587,13 @@ void interact()
|
|||
}
|
||||
}
|
||||
|
||||
void onint(dummy)
|
||||
int dummy; /* to satisfy ANSI compilers */
|
||||
/* dummy to satisfy ANSI compilers */
|
||||
void onint(int dummy)
|
||||
{
|
||||
longjmp(printjump, 1);
|
||||
}
|
||||
|
||||
void savelet(let, savefile)
|
||||
struct letter *let;
|
||||
char *savefile;
|
||||
void savelet(struct letter *let, char *savefile)
|
||||
{
|
||||
int waitstat, pid;
|
||||
FILE *savefp;
|
||||
|
|
@ -628,7 +621,7 @@ char *savefile;
|
|||
exit(0);
|
||||
}
|
||||
|
||||
void updatebox()
|
||||
void updatebox(void)
|
||||
{
|
||||
FILE *tempfp; /* fp for tempfile */
|
||||
char lockname[PATHLEN]; /* maildrop lock */
|
||||
|
|
@ -683,9 +676,7 @@ void updatebox()
|
|||
if (usedrop) unlink(lockname);
|
||||
}
|
||||
|
||||
void printlet(let, tofp)
|
||||
struct letter *let;
|
||||
FILE *tofp;
|
||||
void printlet(struct letter *let, FILE *tofp)
|
||||
{
|
||||
off_t current, limit;
|
||||
int c;
|
||||
|
|
@ -699,8 +690,7 @@ FILE *tofp;
|
|||
}
|
||||
}
|
||||
|
||||
void doshell(command)
|
||||
char *command;
|
||||
void doshell(char *command)
|
||||
{
|
||||
int waitstat, pid;
|
||||
char *shell;
|
||||
|
|
@ -725,14 +715,13 @@ char *command;
|
|||
exit(127);
|
||||
}
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: mail [-epqr] [-f file]\n");
|
||||
fprintf(stderr, " mail [-dtv] [-s subject] user [...]\n");
|
||||
}
|
||||
|
||||
char *basename(name)
|
||||
char *name;
|
||||
char *basename(char *name)
|
||||
{
|
||||
char *p;
|
||||
|
||||
|
|
@ -742,7 +731,7 @@ char *name;
|
|||
return p + 1;
|
||||
}
|
||||
|
||||
char *whoami()
|
||||
char *whoami(void)
|
||||
{
|
||||
struct passwd *pw;
|
||||
|
||||
|
|
@ -752,7 +741,7 @@ char *whoami()
|
|||
return "nobody";
|
||||
}
|
||||
|
||||
void dohelp()
|
||||
void dohelp(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char buffer[80];
|
||||
|
|
@ -768,8 +757,7 @@ void dohelp()
|
|||
fclose(fp);
|
||||
}
|
||||
|
||||
int filesize(name)
|
||||
char *name ;
|
||||
int filesize(char *name)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@ int mount_all(void);
|
|||
|
||||
static int write_mtab = 1;
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int all = 0, i, v = 0, mountflags, srvflags;
|
||||
char **ap, *opt, *err, *type, *args, *device;
|
||||
|
|
@ -88,7 +86,7 @@ char *argv[];
|
|||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
void list()
|
||||
void list(void)
|
||||
{
|
||||
int n;
|
||||
char dev[PATH_MAX], mountpoint[PATH_MAX], type[MNTNAMELEN], flags[MNTFLAGLEN];
|
||||
|
|
@ -121,7 +119,7 @@ has_opt(char *mntopts, char *option)
|
|||
|
||||
|
||||
int
|
||||
mount_all()
|
||||
mount_all(void)
|
||||
{
|
||||
struct fstab *fs;
|
||||
int ro, mountflags;
|
||||
|
|
@ -165,7 +163,7 @@ mount_all()
|
|||
return(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
std_err("Usage: mount [-a] [-r] [-e] [-t type] [-o options] special name\n");
|
||||
exit(1);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ DWORD data_len;
|
|||
/******** End of wave definitions *********/
|
||||
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage: playwav [-i] file\n");
|
||||
exit(-1);
|
||||
|
|
|
|||
|
|
@ -17,9 +17,7 @@ void skipline(void);
|
|||
int backslash(void);
|
||||
void usage(void);
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
int c;
|
||||
|
|
@ -66,7 +64,7 @@ char *argv[];
|
|||
}
|
||||
|
||||
|
||||
void skipline()
|
||||
void skipline(void)
|
||||
{
|
||||
char c;
|
||||
|
||||
|
|
@ -74,7 +72,7 @@ void skipline()
|
|||
}
|
||||
|
||||
|
||||
int backslash()
|
||||
int backslash(void)
|
||||
{
|
||||
/* A backslash has been seen. Eat troff stuff. */
|
||||
|
||||
|
|
@ -129,7 +127,7 @@ int backslash()
|
|||
}
|
||||
}
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
printf("Usage: prep [file]\n");
|
||||
exit(1);
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@ int rflag;
|
|||
int main(int argc, char **argv);
|
||||
void done(char *name, int status);
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
DIR *dp;
|
||||
struct dirent *entry;
|
||||
|
|
@ -56,9 +54,7 @@ char **argv;
|
|||
return(0); /* not reached */
|
||||
}
|
||||
|
||||
void done(name, status)
|
||||
char *name;
|
||||
int status;
|
||||
void done(char *name, int status)
|
||||
{
|
||||
int v;
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ int handle_args(int argc, char *argv[])
|
|||
}
|
||||
|
||||
|
||||
int start()
|
||||
int start(void)
|
||||
{
|
||||
/* This is the "starter process" for statistical profiling.
|
||||
*
|
||||
|
|
@ -262,7 +262,7 @@ int start()
|
|||
}
|
||||
|
||||
|
||||
int stop()
|
||||
int stop(void)
|
||||
{
|
||||
/* This is the "stopper" process for statistical profiling.
|
||||
*
|
||||
|
|
@ -296,7 +296,7 @@ int stop()
|
|||
}
|
||||
|
||||
|
||||
int alloc_mem()
|
||||
int alloc_mem(void)
|
||||
{
|
||||
if ((mem_ptr = malloc(mem_size)) == 0) {
|
||||
fprintf(stderr, "Unable to allocate memory.\n");
|
||||
|
|
@ -308,7 +308,7 @@ int alloc_mem()
|
|||
}
|
||||
|
||||
|
||||
int init_outfile()
|
||||
int init_outfile(void)
|
||||
{
|
||||
if ((outfile_fd = open(outfile, O_CREAT | O_TRUNC | O_WRONLY)) <= 0) {
|
||||
fprintf(stderr, "Unable to create outfile %s.\n", outfile);
|
||||
|
|
|
|||
|
|
@ -44,9 +44,7 @@ prettyprogress(long b, long maxb, time_t starttime)
|
|||
return;
|
||||
}
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
long i = 0, count = 0;
|
||||
int l;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ int old_stdin;
|
|||
struct termios old_tty, new_tty;
|
||||
int audio, file;
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage: recwav [-b -s -r] file_name\n");
|
||||
exit(-1);
|
||||
|
|
@ -90,7 +90,7 @@ void terminate(int s)
|
|||
exit(0);
|
||||
}
|
||||
|
||||
void write_wave_header()
|
||||
void write_wave_header(void)
|
||||
{
|
||||
/* RIFF fields */
|
||||
r_fields.RIFF_id = RIFF_ID;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ int main (int argc, char *argv[])
|
|||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void usage()
|
||||
static void usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage:\n");
|
||||
fprintf(stderr, " %s <vfs|pm> set <request> <value>\n", bin_name);
|
||||
|
|
|
|||
|
|
@ -46,10 +46,7 @@ static unsigned db_extend[] = { /* table for sign-extending */
|
|||
};
|
||||
|
||||
void
|
||||
db_read_bytes(addr, size, data)
|
||||
vm_offset_t addr;
|
||||
register int size;
|
||||
register char *data;
|
||||
db_read_bytes(vm_offset_t addr, register int size, register char *data)
|
||||
{
|
||||
register char *src;
|
||||
|
||||
|
|
@ -60,10 +57,7 @@ db_read_bytes(addr, size, data)
|
|||
}
|
||||
|
||||
db_expr_t
|
||||
db_get_value(addr, size, is_signed)
|
||||
db_addr_t addr;
|
||||
register int size;
|
||||
boolean_t is_signed;
|
||||
db_get_value(db_addr_t addr, register int size, boolean_t is_signed)
|
||||
{
|
||||
char data[sizeof(int)];
|
||||
register db_expr_t value;
|
||||
|
|
|
|||
|
|
@ -866,11 +866,7 @@ static db_addr_t
|
|||
* Read address at location and return updated location.
|
||||
*/
|
||||
static db_addr_t
|
||||
db_read_address(loc, short_addr, regmodrm, addrp)
|
||||
db_addr_t loc;
|
||||
int short_addr;
|
||||
int regmodrm;
|
||||
struct i_addr * addrp; /* out */
|
||||
db_read_address(db_addr_t loc, int short_addr, int regmodrm, struct i_addr *addrp /* out */)
|
||||
{
|
||||
int mod, rm, sib, index, disp;
|
||||
|
||||
|
|
|
|||
|
|
@ -137,10 +137,7 @@ void text_write_ub(void *addr, unsigned char value)
|
|||
}
|
||||
}
|
||||
|
||||
void load_nlist(exe_name, btextp, etextp)
|
||||
char *exe_name;
|
||||
unsigned long *btextp;
|
||||
unsigned long *etextp;
|
||||
void load_nlist(char *exe_name, unsigned long *btextp, unsigned long *etextp)
|
||||
{
|
||||
int i;
|
||||
unsigned long btext, etext;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ struct mode {
|
|||
static char *arg0; /* basename(argv[0]) */
|
||||
static int ex= 0; /* exit status. */
|
||||
|
||||
static void because()
|
||||
static void because(void)
|
||||
{
|
||||
fprintf(stderr, ": %s\n", strerror(errno));
|
||||
ex= 1;
|
||||
|
|
@ -255,7 +255,7 @@ static void sort(struct entry **ae)
|
|||
}
|
||||
}
|
||||
|
||||
static void enter()
|
||||
static void enter(void)
|
||||
/* Collect directory entries of E. */
|
||||
{
|
||||
struct entry **last= &E->con, *new;
|
||||
|
|
@ -399,7 +399,7 @@ static char *link_islink(struct stat *stp, const char *file)
|
|||
|
||||
#define cancellink() ((void) islink())
|
||||
|
||||
static char *islink()
|
||||
static char *islink(void)
|
||||
/* Returns the name of the file path is linked to. If no such link can be
|
||||
* found, then path is added to the list and nil is returned. If all the
|
||||
* links of a file have been seen, then it is removed from the list.
|
||||
|
|
@ -464,7 +464,7 @@ static int getstat(char *name, struct stat *stp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int advance()
|
||||
static int advance(void)
|
||||
/* Determine next pathname, return true on success. */
|
||||
{
|
||||
for (;;) {
|
||||
|
|
@ -517,7 +517,7 @@ static int advance()
|
|||
return 1;
|
||||
}
|
||||
|
||||
static enum orders request()
|
||||
static enum orders request(void)
|
||||
/* Slave reads command sent by master. */
|
||||
{
|
||||
static char buf[64], *bp;
|
||||
|
|
@ -547,7 +547,7 @@ static enum orders request()
|
|||
return (enum orders) req;
|
||||
}
|
||||
|
||||
static void report()
|
||||
static void report(void)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
|
@ -614,7 +614,7 @@ static void sendstat(struct stat *stp)
|
|||
|
||||
static int ask();
|
||||
|
||||
static void slave()
|
||||
static void slave(void)
|
||||
/* Carry out orders from the master, such as transmitting path names.
|
||||
* Note that the slave uses path, not Spath, the master uses Spath.
|
||||
*/
|
||||
|
|
@ -763,7 +763,7 @@ static void rread(char *buf, int n)
|
|||
}
|
||||
}
|
||||
|
||||
static enum answers answer()
|
||||
static enum answers answer(void)
|
||||
/* Master reads slave's reply. */
|
||||
{
|
||||
char c;
|
||||
|
|
@ -777,7 +777,7 @@ static enum answers answer()
|
|||
return (enum answers) a;
|
||||
}
|
||||
|
||||
static long recnum()
|
||||
static long recnum(void)
|
||||
/* Read number as pack of bytes from least to most significant. The data
|
||||
* is on the wire in little-endian format. (Mostly run on PC's).
|
||||
*/
|
||||
|
|
@ -822,7 +822,7 @@ static void recstat(struct stat *stp)
|
|||
stp->st_mtime= recnum();
|
||||
}
|
||||
|
||||
static int key()
|
||||
static int key(void)
|
||||
{
|
||||
int c;
|
||||
static int tty= -1;
|
||||
|
|
@ -1105,7 +1105,7 @@ static int delete(int update)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int different()
|
||||
static int different(void)
|
||||
/* Return true iff path and Spath are different. */
|
||||
{
|
||||
if (! ( (linkpath == nil && Slinkpath == nil)
|
||||
|
|
@ -1136,7 +1136,7 @@ static int different()
|
|||
}
|
||||
}
|
||||
|
||||
static void compare()
|
||||
static void compare(void)
|
||||
/* See if path and Spath are same. */
|
||||
{
|
||||
if (different()) {
|
||||
|
|
@ -1158,7 +1158,7 @@ static void compare()
|
|||
|
||||
static int done= 0, Sdone= 0;
|
||||
|
||||
static enum action { ADD, COMPARE, DELETE } action()
|
||||
static enum action { ADD, COMPARE, DELETE } action(void)
|
||||
/* Look at path's of master and slave, compare them alphabetically to see
|
||||
* who is ahead of who, then tell what is to be done.
|
||||
*/
|
||||
|
|
@ -1178,7 +1178,7 @@ static enum action { ADD, COMPARE, DELETE } action()
|
|||
return (c= strcmp(Sp, p)) == 0 ? COMPARE : c < 0 ? ADD : DELETE;
|
||||
}
|
||||
|
||||
static void master()
|
||||
static void master(void)
|
||||
/* Synchronise file tree to that of its slave. */
|
||||
{
|
||||
enum action a= COMPARE; /* Trick first advances. */
|
||||
|
|
@ -1244,7 +1244,7 @@ static void master()
|
|||
order(ex == 0 ? DIE : DIE_BAD);
|
||||
}
|
||||
|
||||
static void mediator()
|
||||
static void mediator(void)
|
||||
/* Sits at the local machine and passes orders from master to slave, both
|
||||
* on remote machines. Only diagnostics and questions are handled.
|
||||
*/
|
||||
|
|
@ -1346,7 +1346,7 @@ void splitcolon(char *path, char **amach, char **adir)
|
|||
}
|
||||
}
|
||||
|
||||
static void Usage()
|
||||
static void Usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-iuf] [[user@]machine:]dir1 [[user@]machine:]dir2\n",
|
||||
|
|
|
|||
|
|
@ -125,9 +125,7 @@ void set_uart(int argc, char *argv[], struct termios *tcp);
|
|||
void set_raw(struct termios *tcp);
|
||||
void quit(int code);
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
unsigned char key;
|
||||
|
|
@ -298,8 +296,7 @@ void tell(int fd, ...)
|
|||
}
|
||||
|
||||
|
||||
void reader(on)
|
||||
int on;
|
||||
void reader(int on)
|
||||
{
|
||||
/* Start or end a process that copies from the modem to the screen. */
|
||||
|
||||
|
|
@ -390,8 +387,7 @@ void shell(char *cmd)
|
|||
}
|
||||
|
||||
|
||||
void lock_device(device)
|
||||
char *device;
|
||||
void lock_device(char *device)
|
||||
{
|
||||
/* Lock a device by creating a lock file using SYSV style locking. */
|
||||
|
||||
|
|
@ -473,10 +469,7 @@ void setnum(char *s, int n)
|
|||
}
|
||||
|
||||
|
||||
void set_uart(argc, argv, tcp)
|
||||
int argc;
|
||||
char *argv[];
|
||||
struct termios *tcp;
|
||||
void set_uart(int argc, char *argv[], struct termios *tcp)
|
||||
{
|
||||
/* Set up the UART parameters. */
|
||||
|
||||
|
|
@ -515,8 +508,7 @@ struct termios *tcp;
|
|||
}
|
||||
|
||||
|
||||
void set_raw(tcp)
|
||||
struct termios *tcp;
|
||||
void set_raw(struct termios *tcp)
|
||||
{
|
||||
/* Set termios attributes for RAW mode. */
|
||||
|
||||
|
|
@ -528,8 +520,7 @@ struct termios *tcp;
|
|||
}
|
||||
|
||||
|
||||
void quit(code)
|
||||
int code;
|
||||
void quit(int code)
|
||||
{
|
||||
/* Stop the reader process, reset the terminal, and exit. */
|
||||
reader(0);
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@ int main(int argc, char **argv);
|
|||
void Print(char *comment, char *name);
|
||||
void Error(char *message, char *arg);
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char **argv)
|
||||
|
||||
{
|
||||
char *term;
|
||||
|
|
@ -154,9 +152,7 @@ void Print( comment, name )
|
|||
/****************************************************************/
|
||||
|
||||
|
||||
void Error( message, arg )
|
||||
char *message;
|
||||
char *arg;
|
||||
void Error( char *message, char *arg )
|
||||
|
||||
{
|
||||
fprintf( stderr, message, arg );
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ void usage(void);
|
|||
static char device[PATH_MAX], mount_point[PATH_MAX], type[MNTNAMELEN],
|
||||
flags[MNTFLAGLEN];
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int found;
|
||||
int umount_flags = 0UL;
|
||||
|
|
@ -62,8 +60,7 @@ char *argv[];
|
|||
return(0);
|
||||
}
|
||||
|
||||
int find_mtab_entry(name)
|
||||
char *name;
|
||||
int find_mtab_entry(char *name)
|
||||
{
|
||||
/* Find a matching mtab entry for 'name' which may be a special or a path,
|
||||
* and generate a new mtab file without this entry on the fly. Do not write
|
||||
|
|
@ -97,7 +94,7 @@ char *name;
|
|||
return found;
|
||||
}
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
std_err("Usage: umount [-e] name\n");
|
||||
exit(1);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
int main(void);
|
||||
|
||||
int main()
|
||||
int main(void)
|
||||
{
|
||||
/* Release all (?) open file descriptors. */
|
||||
close(0);
|
||||
|
|
|
|||
|
|
@ -58,9 +58,7 @@ void tape_inquire(char *name, int fd);
|
|||
void allocate_buffer(void);
|
||||
void diskio(int fd1, int fd2, char *file1, char *file2);
|
||||
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int volume = 1, fd, tty, i, init, autovolsize;
|
||||
char *p, *name;
|
||||
|
|
@ -208,18 +206,14 @@ char *argv[];
|
|||
}
|
||||
}
|
||||
|
||||
void usage()
|
||||
void usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: vol [-rw1] [-b blocksize] [-m max] [size] block-special\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
long str2size(name, str, min, max, assume_kb)
|
||||
char *name;
|
||||
char *str;
|
||||
long min, max;
|
||||
int assume_kb;
|
||||
long str2size(char *name, char *str, long min, long max, int assume_kb)
|
||||
{
|
||||
/* Convert a string to a size. The number may be followed by 'm', 'k', 'b'
|
||||
* or 'w' to multiply the size as shown below. If 'assume_kb' is set then
|
||||
|
|
@ -259,9 +253,7 @@ int assume_kb;
|
|||
return size;
|
||||
}
|
||||
|
||||
void tape_inquire(name, fd)
|
||||
char *name;
|
||||
int fd;
|
||||
void tape_inquire(char *name, int fd)
|
||||
{
|
||||
/* If the device happens to be a tape, then what is its block size? */
|
||||
struct mtget mtget;
|
||||
|
|
@ -288,7 +280,7 @@ int fd;
|
|||
}
|
||||
}
|
||||
|
||||
void allocate_buffer()
|
||||
void allocate_buffer(void)
|
||||
{
|
||||
/* Set block size and maximum multiple. */
|
||||
if (block_size == 0) block_size = variable ? 1 : FIX_BLKSIZ;
|
||||
|
|
@ -313,9 +305,7 @@ void allocate_buffer()
|
|||
}
|
||||
}
|
||||
|
||||
void diskio(fd1, fd2, file1, file2)
|
||||
int fd1, fd2;
|
||||
char *file1, *file2;
|
||||
void diskio(int fd1, int fd2, char *file1, char *file2)
|
||||
{
|
||||
/* Read 'volume_size' bytes from 'fd1' and write them on 'fd2'. Watch out for
|
||||
* the fact that reads on pipes can return less than the desired data.
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ Howmany must be 255 or less
|
|||
*/
|
||||
int Fromcu; /* Were called from cu or yam */
|
||||
|
||||
void from_cu()
|
||||
void from_cu(void)
|
||||
{
|
||||
struct stat a, b;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ void from_cu()
|
|||
return;
|
||||
}
|
||||
|
||||
void cucheck()
|
||||
void cucheck(void)
|
||||
{
|
||||
if (Fromcu)
|
||||
fprintf(stderr,"Please read the manual page BUGS chapter!\r\n");
|
||||
|
|
@ -123,7 +123,7 @@ char checked = '\0' ;
|
|||
/*
|
||||
* Nonblocking I/O is a bit different in System V, Release 2
|
||||
*/
|
||||
int rdchk(f)
|
||||
int rdchk(int f)
|
||||
{
|
||||
int lf, savestat;
|
||||
|
||||
|
|
@ -170,8 +170,7 @@ int iofd = 0; /* File descriptor for ioctls & reads */
|
|||
* 1: save old tty stat, set raw mode
|
||||
* 0: restore original tty mode
|
||||
*/
|
||||
int mode(n)
|
||||
int n;
|
||||
int mode(int n)
|
||||
{
|
||||
static int did0 = FALSE;
|
||||
|
||||
|
|
@ -397,7 +396,7 @@ int n;
|
|||
}
|
||||
}
|
||||
|
||||
void sendbrk()
|
||||
void sendbrk(void)
|
||||
{
|
||||
#ifdef POSIX
|
||||
tcsendbreak(iofd, 1);
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ FILE *fout;
|
|||
* Routine to calculate the free bytes on the current file system
|
||||
* ~0 means many free bytes (unknown)
|
||||
*/
|
||||
long getfree()
|
||||
long getfree(void)
|
||||
{
|
||||
return(~0L); /* many free bytes ... */
|
||||
}
|
||||
|
|
@ -240,8 +240,7 @@ jmp_buf tohere; /* For the interrupt on RX timeout */
|
|||
|
||||
int tryzhdrtype=ZRINIT; /* Header type to send corresponding to Last rx close */
|
||||
|
||||
void alrm(sig)
|
||||
int sig;
|
||||
void alrm(int sig)
|
||||
{
|
||||
longjmp(tohere, -1);
|
||||
}
|
||||
|
|
@ -373,7 +372,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
|
||||
int usage()
|
||||
int usage(void)
|
||||
{
|
||||
cucheck();
|
||||
#ifdef vax11c
|
||||
|
|
@ -513,7 +512,7 @@ et_tu:
|
|||
* Jack M. Wierda and Roderick W. Hart
|
||||
*/
|
||||
|
||||
int wcrx()
|
||||
int wcrx(void)
|
||||
{
|
||||
register int sectnum, sectcurr;
|
||||
register char sendchar;
|
||||
|
|
@ -711,7 +710,7 @@ int readline(int timeout)
|
|||
/*
|
||||
* Purge the modem input queue of all characters
|
||||
*/
|
||||
void purgeline()
|
||||
void purgeline(void)
|
||||
{
|
||||
Lleft = 0;
|
||||
#ifdef USG
|
||||
|
|
@ -1032,7 +1031,7 @@ void zperr(char *s, char *p, char *u)
|
|||
}
|
||||
|
||||
/* send cancel string to get the other end to shut up */
|
||||
void canit()
|
||||
void canit(void)
|
||||
{
|
||||
static char canistr[] = {
|
||||
24,24,24,24,24,24,24,24,24,24,8,8,8,8,8,8,8,8,8,8,0
|
||||
|
|
@ -1113,7 +1112,7 @@ void checkpath(char *name)
|
|||
* Return ZFILE if Zmodem filename received, -1 on error,
|
||||
* ZCOMPL if transaction finished, else 0
|
||||
*/
|
||||
int tryz()
|
||||
int tryz(void)
|
||||
{
|
||||
register int c, n;
|
||||
register int cmdzack1flg;
|
||||
|
|
@ -1209,7 +1208,7 @@ again:
|
|||
/*
|
||||
* Receive 1 or more files with ZMODEM protocol
|
||||
*/
|
||||
int rzfiles()
|
||||
int rzfiles(void)
|
||||
{
|
||||
register int c;
|
||||
|
||||
|
|
@ -1238,7 +1237,7 @@ int rzfiles()
|
|||
* Receive a file with ZMODEM protocol
|
||||
* Assumes file name frame is in secbuf
|
||||
*/
|
||||
int rzfile()
|
||||
int rzfile(void)
|
||||
{
|
||||
register int c, n;
|
||||
long rxbytes;
|
||||
|
|
@ -1437,7 +1436,7 @@ void zmputs(char *s)
|
|||
/*
|
||||
* Close the receive dataset, return OK or ERROR
|
||||
*/
|
||||
int closeit()
|
||||
int closeit(void)
|
||||
{
|
||||
time_t q;
|
||||
|
||||
|
|
@ -1468,7 +1467,7 @@ int closeit()
|
|||
/*
|
||||
* Ack a ZFIN packet, let byegones be byegones
|
||||
*/
|
||||
void ackbibi()
|
||||
void ackbibi(void)
|
||||
{
|
||||
register int n;
|
||||
|
||||
|
|
|
|||
|
|
@ -652,7 +652,7 @@ int wctxpn(char *name)
|
|||
return OK;
|
||||
}
|
||||
|
||||
int getnak()
|
||||
int getnak(void)
|
||||
{
|
||||
register int firstch;
|
||||
|
||||
|
|
@ -850,7 +850,7 @@ int filbuf(char *buf, int count)
|
|||
}
|
||||
|
||||
/* Fill buffer with blklen chars */
|
||||
int zfilbuf()
|
||||
int zfilbuf(void)
|
||||
{
|
||||
int n;
|
||||
|
||||
|
|
@ -984,13 +984,13 @@ int readline(int timeout)
|
|||
return (byt[0]&0377);
|
||||
}
|
||||
|
||||
void flushmo()
|
||||
void flushmo(void)
|
||||
{
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
void purgeline()
|
||||
void purgeline(void)
|
||||
{
|
||||
#ifdef USG
|
||||
ioctl(iofd, TCFLSH, 0);
|
||||
|
|
@ -1001,7 +1001,7 @@ void purgeline()
|
|||
#endif
|
||||
|
||||
/* send cancel string to get the other end to shut up */
|
||||
void canit()
|
||||
void canit(void)
|
||||
{
|
||||
static char canistr[] = {
|
||||
24,24,24,24,24,24,24,24,24,24,8,8,8,8,8,8,8,8,8,8,0
|
||||
|
|
@ -1099,7 +1099,7 @@ char *babble[] = {
|
|||
""
|
||||
};
|
||||
|
||||
int usage()
|
||||
int usage(void)
|
||||
{
|
||||
char **pp;
|
||||
|
||||
|
|
@ -1115,7 +1115,7 @@ int usage()
|
|||
/*
|
||||
* Get the receiver's init parameters
|
||||
*/
|
||||
int getzrxinit()
|
||||
int getzrxinit(void)
|
||||
{
|
||||
register int n;
|
||||
struct stat f;
|
||||
|
|
@ -1220,7 +1220,7 @@ int getzrxinit()
|
|||
}
|
||||
|
||||
/* Send send-init information */
|
||||
int sendzsinit()
|
||||
int sendzsinit(void)
|
||||
{
|
||||
register int c;
|
||||
|
||||
|
|
@ -1308,7 +1308,7 @@ again:
|
|||
}
|
||||
|
||||
/* Send the data in the file */
|
||||
int zsendfdata()
|
||||
int zsendfdata(void)
|
||||
{
|
||||
register int c, e, n;
|
||||
register int newcnt;
|
||||
|
|
@ -1564,7 +1564,7 @@ int getinsync(int flag)
|
|||
|
||||
|
||||
/* Say "bibi" to the receiver, try to do it cleanly */
|
||||
void saybibi()
|
||||
void saybibi(void)
|
||||
{
|
||||
for (;;) {
|
||||
stohdr(0L); /* CAF Was zsbhdr - minor change */
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ int mixer_ioctl(unsigned long request, void *val, int *UNUSED(len)) {
|
|||
/*=========================================================================*
|
||||
* mixer_init
|
||||
*=========================================================================*/
|
||||
int mixer_init() {
|
||||
int mixer_init(void) {
|
||||
/* Try to detect the mixer by writing to MIXER_DAC_LEVEL if the
|
||||
* value written can be read back the mixer is there
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ int main(void)
|
|||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
static void sef_local_startup()
|
||||
static void sef_local_startup(void)
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ static void add_sample(int source, unsigned long sample);
|
|||
static void data_block(rd_keyinstance *keyp, void *data);
|
||||
static void reseed(void);
|
||||
|
||||
void random_init()
|
||||
void random_init(void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
|
@ -54,17 +54,14 @@ void random_init()
|
|||
reseed_count= 0;
|
||||
}
|
||||
|
||||
int random_isseeded()
|
||||
int random_isseeded(void)
|
||||
{
|
||||
if (got_seeded)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void random_update(source, buf, count)
|
||||
int source;
|
||||
rand_t *buf;
|
||||
int count;
|
||||
void random_update(int source, rand_t *buf, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -78,9 +75,7 @@ int count;
|
|||
reseed();
|
||||
}
|
||||
|
||||
void random_getbytes(buf, size)
|
||||
void *buf;
|
||||
size_t size;
|
||||
void random_getbytes(void *buf, size_t size)
|
||||
{
|
||||
int n, r;
|
||||
u8_t *cp;
|
||||
|
|
@ -112,9 +107,7 @@ size_t size;
|
|||
data_block(&key, random_key+AES_BLOCKSIZE);
|
||||
}
|
||||
|
||||
void random_putbytes(buf, size)
|
||||
void *buf;
|
||||
size_t size;
|
||||
void random_putbytes(void *buf, size_t size)
|
||||
{
|
||||
/* Add bits to pool zero */
|
||||
SHA256_Update(&pool_ctx[0], buf, size);
|
||||
|
|
@ -127,9 +120,7 @@ size_t size;
|
|||
reseed();
|
||||
}
|
||||
|
||||
static void add_sample(source, sample)
|
||||
int source;
|
||||
unsigned long sample;
|
||||
static void add_sample(int source, unsigned long sample)
|
||||
{
|
||||
int i, pool_nr;
|
||||
unsigned long d, v, di, min;
|
||||
|
|
@ -178,9 +169,7 @@ unsigned long sample;
|
|||
pool_ind[source]= pool_nr;
|
||||
}
|
||||
|
||||
static void data_block(keyp, data)
|
||||
rd_keyinstance *keyp;
|
||||
void *data;
|
||||
static void data_block(rd_keyinstance *keyp, void *data)
|
||||
{
|
||||
int r;
|
||||
u8_t input[AES_BLOCKSIZE];
|
||||
|
|
@ -203,7 +192,7 @@ void *data;
|
|||
count_hi++;
|
||||
}
|
||||
|
||||
static void reseed()
|
||||
static void reseed(void)
|
||||
{
|
||||
int i;
|
||||
SHA256_CTX ctx;
|
||||
|
|
|
|||
|
|
@ -633,9 +633,9 @@ static int do_select(devminor_t minor, unsigned int ops, endpoint_t endpt)
|
|||
|
||||
/*===========================================================================*
|
||||
* handle_events *
|
||||
* tp: TTY to check for events *
|
||||
*===========================================================================*/
|
||||
void handle_events(tp)
|
||||
tty_t *tp; /* TTY to check for events. */
|
||||
void handle_events(tty_t *tp)
|
||||
{
|
||||
/* Handle any events pending on a TTY. */
|
||||
|
||||
|
|
@ -669,10 +669,10 @@ tty_t *tp; /* TTY to check for events. */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* in_transfer *
|
||||
* in_transfer *
|
||||
* tp: pointer to terminal to read from *
|
||||
*===========================================================================*/
|
||||
static void in_transfer(tp)
|
||||
register tty_t *tp; /* pointer to terminal to read from */
|
||||
static void in_transfer(register tty_t *tp)
|
||||
{
|
||||
/* Transfer bytes from the input queue to a process reading from a terminal. */
|
||||
|
||||
|
|
@ -732,12 +732,12 @@ register tty_t *tp; /* pointer to terminal to read from */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* in_process *
|
||||
* in_process *
|
||||
* tp: terminal on which character has arrived *
|
||||
* buf: buffer with input characters *
|
||||
* count: number of input characters *
|
||||
*===========================================================================*/
|
||||
int in_process(tp, buf, count)
|
||||
register tty_t *tp; /* terminal on which character has arrived */
|
||||
char *buf; /* buffer with input characters */
|
||||
int count; /* number of input characters */
|
||||
int in_process(register tty_t *tp, char *buf, int count)
|
||||
{
|
||||
/* Characters have just been typed in. Process, save, and echo them. Return
|
||||
* the number of characters processed.
|
||||
|
|
@ -897,11 +897,11 @@ int count; /* number of input characters */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* echo *
|
||||
* echo *
|
||||
* tp: terminal on which to echo *
|
||||
* ch: pointer to character to echo *
|
||||
*===========================================================================*/
|
||||
static int tty_echo(tp, ch)
|
||||
register tty_t *tp; /* terminal on which to echo */
|
||||
register int ch; /* pointer to character to echo */
|
||||
static int tty_echo(register tty_t *tp, register int ch)
|
||||
{
|
||||
/* Echo the character if echoing is on. Some control characters are echoed
|
||||
* with their normal effect, other control characters are echoed as "^X",
|
||||
|
|
@ -960,9 +960,7 @@ register int ch; /* pointer to character to echo */
|
|||
/*===========================================================================*
|
||||
* rawecho *
|
||||
*===========================================================================*/
|
||||
static void rawecho(tp, ch)
|
||||
register tty_t *tp;
|
||||
int ch;
|
||||
static void rawecho(register tty_t *tp, int ch)
|
||||
{
|
||||
/* Echo without interpretation if ECHO is set. */
|
||||
int rp = tp->tty_reprint;
|
||||
|
|
@ -973,8 +971,7 @@ int ch;
|
|||
/*===========================================================================*
|
||||
* back_over *
|
||||
*===========================================================================*/
|
||||
static int back_over(tp)
|
||||
register tty_t *tp;
|
||||
static int back_over(register tty_t *tp)
|
||||
{
|
||||
/* Backspace to previous character on screen and erase it. */
|
||||
u16_t *head;
|
||||
|
|
@ -1001,9 +998,9 @@ register tty_t *tp;
|
|||
|
||||
/*===========================================================================*
|
||||
* reprint *
|
||||
* tp: pointer to tty struct *
|
||||
*===========================================================================*/
|
||||
static void reprint(tp)
|
||||
register tty_t *tp; /* pointer to tty struct */
|
||||
static void reprint(register tty_t *tp)
|
||||
{
|
||||
/* Restore what has been echoed to screen before if the user input has been
|
||||
* messed up by output, or if REPRINT (^R) is typed.
|
||||
|
|
@ -1039,13 +1036,13 @@ register tty_t *tp; /* pointer to tty struct */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* out_process *
|
||||
* out_process *
|
||||
* bstart/bpos/bend: start/pos/end of circular buffer *
|
||||
* icount: # input chars / input chars used *
|
||||
* ocount: max output chars / output chars used *
|
||||
*===========================================================================*/
|
||||
void out_process(tp, bstart, bpos, bend, icount, ocount)
|
||||
tty_t *tp;
|
||||
char *bstart, *bpos, *bend; /* start/pos/end of circular buffer */
|
||||
int *icount; /* # input chars / input chars used */
|
||||
int *ocount; /* max output chars / output chars used */
|
||||
void out_process(tty_t *tp, char *bstart, char *bpos, char *bend, int *icount,
|
||||
int *ocount)
|
||||
{
|
||||
/* Perform output processing on a circular buffer. *icount is the number of
|
||||
* bytes to process, and the number of bytes actually processed on return.
|
||||
|
|
@ -1126,8 +1123,7 @@ out_done:
|
|||
/*===========================================================================*
|
||||
* dev_ioctl *
|
||||
*===========================================================================*/
|
||||
static void dev_ioctl(tp)
|
||||
tty_t *tp;
|
||||
static void dev_ioctl(tty_t *tp)
|
||||
{
|
||||
/* The ioctl's TCSETSW, TCSETSF and TIOCDRAIN wait for output to finish to make
|
||||
* sure that an attribute change doesn't affect the processing of current
|
||||
|
|
@ -1152,8 +1148,7 @@ tty_t *tp;
|
|||
/*===========================================================================*
|
||||
* setattr *
|
||||
*===========================================================================*/
|
||||
static void setattr(tp)
|
||||
tty_t *tp;
|
||||
static void setattr(tty_t *tp)
|
||||
{
|
||||
/* Apply the new line attributes (raw/canonical, line speed, etc.) */
|
||||
u16_t *inp;
|
||||
|
|
@ -1201,11 +1196,9 @@ tty_t *tp;
|
|||
|
||||
/*===========================================================================*
|
||||
* sigchar *
|
||||
* sig: SIGINT, SIGQUIT, SIGKILL or SIGHUP *
|
||||
*===========================================================================*/
|
||||
void sigchar(tp, sig, mayflush)
|
||||
register tty_t *tp;
|
||||
int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */
|
||||
int mayflush;
|
||||
void sigchar(tty_t *tp, int sig, int mayflush)
|
||||
{
|
||||
/* Process a SIGINT, SIGQUIT or SIGKILL char from the keyboard or SIGHUP from
|
||||
* a tty close, "stty 0", or a real RS-232 hangup. PM will send the signal to
|
||||
|
|
@ -1232,8 +1225,7 @@ int mayflush;
|
|||
/*===========================================================================*
|
||||
* tty_icancel *
|
||||
*===========================================================================*/
|
||||
static void tty_icancel(tp)
|
||||
register tty_t *tp;
|
||||
static void tty_icancel(register tty_t *tp)
|
||||
{
|
||||
/* Discard all pending input, tty buffer or device. */
|
||||
|
||||
|
|
@ -1300,11 +1292,11 @@ static void tty_timed_out(int arg)
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* settimer *
|
||||
* settimer *
|
||||
* tty_ptr: line to set or unset a timer on *
|
||||
* enable: set timer if true, otherwise unset *
|
||||
*===========================================================================*/
|
||||
static void settimer(tty_ptr, enable)
|
||||
tty_t *tty_ptr; /* line to set or unset a timer on */
|
||||
int enable; /* set timer if true, otherwise unset */
|
||||
static void settimer(tty_t *tty_ptr, int enable)
|
||||
{
|
||||
clock_t ticks;
|
||||
|
||||
|
|
|
|||
|
|
@ -155,10 +155,9 @@ static struct chardriver video_tab = {
|
|||
|
||||
/*===========================================================================*
|
||||
* cons_write *
|
||||
* tp tells which terminal is to be used *
|
||||
*===========================================================================*/
|
||||
static int cons_write(tp, try)
|
||||
register struct tty *tp; /* tells which terminal is to be used */
|
||||
int try;
|
||||
static int cons_write(register struct tty *tp, int try)
|
||||
{
|
||||
/* Copy as much data as possible to the output queue, then start I/O. On
|
||||
* memory-mapped terminals, such as the IBM console, the I/O will also be
|
||||
|
|
@ -236,10 +235,10 @@ int try;
|
|||
|
||||
/*===========================================================================*
|
||||
* cons_echo *
|
||||
* tp pointer to tty struct
|
||||
* c character to be echoed
|
||||
*===========================================================================*/
|
||||
static void cons_echo(tp, c)
|
||||
register tty_t *tp; /* pointer to tty struct */
|
||||
int c; /* character to be echoed */
|
||||
static void cons_echo(register tty_t *tp, int c)
|
||||
{
|
||||
/* Echo keyboard input (print & flush). */
|
||||
console_t *cons = tp->tty_priv;
|
||||
|
|
@ -250,10 +249,10 @@ int c; /* character to be echoed */
|
|||
|
||||
/*===========================================================================*
|
||||
* out_char *
|
||||
* cons - pointer to console struct
|
||||
* c - character to output
|
||||
*===========================================================================*/
|
||||
static void out_char(cons, c)
|
||||
register console_t *cons; /* pointer to console struct */
|
||||
int c; /* character to be output */
|
||||
static void out_char(register console_t *cons, int c)
|
||||
{
|
||||
/* Output a character on the console. Check for escape sequences first. */
|
||||
if (cons->c_esc_state > 0) {
|
||||
|
|
@ -345,10 +344,10 @@ int c; /* character to be output */
|
|||
|
||||
/*===========================================================================*
|
||||
* scroll_screen *
|
||||
* cons - pointer to console struct
|
||||
* dir - SCROLL_UP or SCROLL_DOWN
|
||||
*===========================================================================*/
|
||||
static void scroll_screen(cons, dir)
|
||||
register console_t *cons; /* pointer to console struct */
|
||||
int dir; /* SCROLL_UP or SCROLL_DOWN */
|
||||
static void scroll_screen(register console_t *cons, int dir)
|
||||
{
|
||||
unsigned new_line, new_org, chars;
|
||||
|
||||
|
|
@ -397,9 +396,9 @@ int dir; /* SCROLL_UP or SCROLL_DOWN */
|
|||
|
||||
/*===========================================================================*
|
||||
* flush *
|
||||
* cons - pointer to console struct
|
||||
*===========================================================================*/
|
||||
static void flush(cons)
|
||||
register console_t *cons; /* pointer to console struct */
|
||||
static void flush(register console_t *cons)
|
||||
{
|
||||
/* Send characters buffered in 'ramqueue' to screen memory, check the new
|
||||
* cursor position, compute the new hardware cursor position and set it.
|
||||
|
|
@ -429,10 +428,10 @@ register console_t *cons; /* pointer to console struct */
|
|||
|
||||
/*===========================================================================*
|
||||
* parse_escape *
|
||||
* cons pointer to console struct
|
||||
* c next character in escape sequence
|
||||
*===========================================================================*/
|
||||
static void parse_escape(cons, c)
|
||||
register console_t *cons; /* pointer to console struct */
|
||||
char c; /* next character in escape sequence */
|
||||
static void parse_escape(register console_t *cons, int c)
|
||||
{
|
||||
/* The following ANSI escape sequences are currently supported.
|
||||
* If n and/or m are omitted, they default to 1.
|
||||
|
|
@ -487,11 +486,11 @@ char c; /* next character in escape sequence */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* do_escape *
|
||||
* do_escape *
|
||||
* cons: pointer to console struct *
|
||||
* c: next character in escape sequence *
|
||||
*===========================================================================*/
|
||||
static void do_escape(cons, c)
|
||||
register console_t *cons; /* pointer to console struct */
|
||||
char c; /* next character in escape sequence */
|
||||
static void do_escape(register console_t *cons, int c)
|
||||
{
|
||||
int value, n;
|
||||
unsigned src, dst, count;
|
||||
|
|
@ -729,11 +728,11 @@ char c; /* next character in escape sequence */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* set_6845 *
|
||||
* set_6845 *
|
||||
* reg: which register pair to set *
|
||||
* val: 16-bit value to set it to *
|
||||
*===========================================================================*/
|
||||
static void set_6845(reg, val)
|
||||
int reg; /* which register pair to set */
|
||||
unsigned val; /* 16-bit value to set it to */
|
||||
static void set_6845(int reg, unsigned val)
|
||||
{
|
||||
/* Set a register pair inside the 6845.
|
||||
* Registers 12-13 tell the 6845 where in video ram to start
|
||||
|
|
@ -751,9 +750,9 @@ unsigned val; /* 16-bit value to set it to */
|
|||
/*===========================================================================*
|
||||
* get_6845 *
|
||||
*===========================================================================*/
|
||||
static void get_6845(reg, val)
|
||||
int reg; /* which register pair to set */
|
||||
unsigned *val; /* 16-bit value to set it to */
|
||||
static void get_6845(int reg, unsigned *val)
|
||||
/* int reg; /* which register pair to set */
|
||||
/* unsigned *val; /* 16-bit value to set it to */
|
||||
{
|
||||
char v1, v2;
|
||||
u32_t v;
|
||||
|
|
@ -789,7 +788,7 @@ static long beep_disabled(void)
|
|||
/*===========================================================================*
|
||||
* beep *
|
||||
*===========================================================================*/
|
||||
static void beep()
|
||||
static void beep(void)
|
||||
{
|
||||
/* Making a beeping sound on the speaker (output for CRTL-G).
|
||||
* This routine works by turning on the bits 0 and 1 in port B of the 8255
|
||||
|
|
@ -858,9 +857,7 @@ void do_video(message *m, int ipc_status)
|
|||
/*===========================================================================*
|
||||
* beep_x *
|
||||
*===========================================================================*/
|
||||
void beep_x(freq, dur)
|
||||
unsigned freq;
|
||||
clock_t dur;
|
||||
void beep_x(unsigned freq, clock_t dur)
|
||||
{
|
||||
/* Making a beeping sound on the speaker.
|
||||
* This routine works by turning on the bits 0 and 1 in port B of the 8255
|
||||
|
|
@ -907,8 +904,7 @@ static void stop_beep(int arg __unused)
|
|||
/*===========================================================================*
|
||||
* scr_init *
|
||||
*===========================================================================*/
|
||||
void scr_init(tp)
|
||||
tty_t *tp;
|
||||
void scr_init(tty_t *tp)
|
||||
{
|
||||
/* Initialize the screen driver. */
|
||||
console_t *cons;
|
||||
|
|
@ -1009,7 +1005,7 @@ tty_t *tp;
|
|||
/*===========================================================================*
|
||||
* toggle_scroll *
|
||||
*===========================================================================*/
|
||||
void toggle_scroll()
|
||||
void toggle_scroll(void)
|
||||
{
|
||||
/* Toggle between hardware and software scroll. */
|
||||
|
||||
|
|
@ -1021,7 +1017,7 @@ void toggle_scroll()
|
|||
/*===========================================================================*
|
||||
* cons_stop *
|
||||
*===========================================================================*/
|
||||
void cons_stop()
|
||||
void cons_stop(void)
|
||||
{
|
||||
/* Prepare for halt or reboot. */
|
||||
cons_org0();
|
||||
|
|
@ -1034,7 +1030,7 @@ void cons_stop()
|
|||
/*===========================================================================*
|
||||
* cons_org0 *
|
||||
*===========================================================================*/
|
||||
static void cons_org0()
|
||||
static void cons_org0(void)
|
||||
{
|
||||
/* Scroll video memory back to put the origin at 0. */
|
||||
int cons_line;
|
||||
|
|
@ -1058,7 +1054,7 @@ static void cons_org0()
|
|||
/*===========================================================================*
|
||||
* disable_console *
|
||||
*===========================================================================*/
|
||||
static void disable_console()
|
||||
static void disable_console(void)
|
||||
{
|
||||
if (disabled_vc != -1)
|
||||
return;
|
||||
|
|
@ -1076,7 +1072,7 @@ static void disable_console()
|
|||
/*===========================================================================*
|
||||
* reenable_console *
|
||||
*===========================================================================*/
|
||||
static void reenable_console()
|
||||
static void reenable_console(void)
|
||||
{
|
||||
if (disabled_vc == -1)
|
||||
return;
|
||||
|
|
@ -1146,8 +1142,7 @@ int con_loadfont(endpoint_t endpt, cp_grant_id_t grant)
|
|||
/*===========================================================================*
|
||||
* ga_program *
|
||||
*===========================================================================*/
|
||||
static int ga_program(seq)
|
||||
struct sequence *seq;
|
||||
static int ga_program(struct sequence *seq)
|
||||
{
|
||||
pvb_pair_t char_out[14];
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ static unsigned map_key(int scode);
|
|||
/*===========================================================================*
|
||||
* map_key *
|
||||
*===========================================================================*/
|
||||
static unsigned map_key(scode)
|
||||
int scode;
|
||||
static unsigned map_key(int scode)
|
||||
{
|
||||
/* Map a scan code to an ASCII code. */
|
||||
|
||||
|
|
@ -181,9 +180,7 @@ void do_input(message *msg)
|
|||
/*===========================================================================*
|
||||
* kb_read *
|
||||
*===========================================================================*/
|
||||
static int kb_read(tp, try)
|
||||
tty_t *tp;
|
||||
int try;
|
||||
static int kb_read(tty_t *tp, int try)
|
||||
{
|
||||
/* Process characters from the circular keyboard buffer. */
|
||||
char buf[7], *p, suffix;
|
||||
|
|
@ -387,8 +384,7 @@ static void set_leds(void)
|
|||
/*===========================================================================*
|
||||
* kb_init *
|
||||
*===========================================================================*/
|
||||
void kb_init(tp)
|
||||
tty_t *tp;
|
||||
void kb_init(tty_t *tp)
|
||||
{
|
||||
/* Initialize the keyboard driver. */
|
||||
|
||||
|
|
@ -425,9 +421,9 @@ int kbd_loadmap(endpoint_t endpt, cp_grant_id_t grant)
|
|||
|
||||
/*===========================================================================*
|
||||
* do_fkey_ctl *
|
||||
* m_ptr pointer to request message
|
||||
*===========================================================================*/
|
||||
void do_fkey_ctl(m_ptr)
|
||||
message *m_ptr; /* pointer to the request message */
|
||||
void do_fkey_ctl(message *m_ptr)
|
||||
{
|
||||
/* This procedure allows processes to register a function key to receive
|
||||
* notifications if it is pressed. At most one binding per key can exist.
|
||||
|
|
@ -527,10 +523,10 @@ message *m_ptr; /* pointer to the request message */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* func_key *
|
||||
* func_key *
|
||||
* scode: scan code for a function key *
|
||||
*===========================================================================*/
|
||||
static int func_key(scode)
|
||||
int scode; /* scan code for a function key */
|
||||
static int func_key(int scode)
|
||||
{
|
||||
/* This procedure traps function keys for debugging purposes. Observers of
|
||||
* function keys are kept in a global array. If a subject (a key) is pressed
|
||||
|
|
@ -574,7 +570,7 @@ int scode; /* scan code for a function key */
|
|||
/*===========================================================================*
|
||||
* show_key_mappings *
|
||||
*===========================================================================*/
|
||||
static void show_key_mappings()
|
||||
static void show_key_mappings(void)
|
||||
{
|
||||
int i,s;
|
||||
|
||||
|
|
|
|||
|
|
@ -312,11 +312,11 @@ static int rs_write(register tty_t *tp, int try)
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* rs_echo *
|
||||
* rs_echo *
|
||||
* tp: which TTY *
|
||||
* c: character to echo *
|
||||
*===========================================================================*/
|
||||
static void rs_echo(tp, c)
|
||||
tty_t *tp; /* which TTY */
|
||||
int c; /* character to echo */
|
||||
static void rs_echo(tty_t *tp, int c)
|
||||
{
|
||||
/* Echo one character. (Like rs_write, but only one character, optionally.) */
|
||||
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ line2tty(devminor_t line)
|
|||
/*===========================================================================*
|
||||
* sef_local_startup *
|
||||
*===========================================================================*/
|
||||
static void sef_local_startup()
|
||||
static void sef_local_startup(void)
|
||||
{
|
||||
/* Register init callbacks. */
|
||||
sef_setcb_init_fresh(sef_cb_init_fresh);
|
||||
|
|
@ -896,10 +896,10 @@ static int do_select(devminor_t minor, unsigned int ops, endpoint_t endpt)
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* handle_events *
|
||||
* handle_events *
|
||||
* tp: TTY to check for events *
|
||||
*===========================================================================*/
|
||||
void handle_events(tp)
|
||||
tty_t *tp; /* TTY to check for events. */
|
||||
void handle_events(tty_t *tp)
|
||||
{
|
||||
/* Handle any events pending on a TTY. These events are usually device
|
||||
* interrupts.
|
||||
|
|
@ -946,8 +946,7 @@ tty_t *tp; /* TTY to check for events. */
|
|||
/*===========================================================================*
|
||||
* in_transfer *
|
||||
*===========================================================================*/
|
||||
static void in_transfer(tp)
|
||||
register tty_t *tp; /* pointer to terminal to read from */
|
||||
static void in_transfer(register tty_t *tp)
|
||||
{
|
||||
/* Transfer bytes from the input queue to a process reading from a terminal. */
|
||||
|
||||
|
|
@ -1007,12 +1006,12 @@ register tty_t *tp; /* pointer to terminal to read from */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* in_process *
|
||||
* in_process *
|
||||
* terminal: on which character has arrived *
|
||||
* buf: buffer with input character *
|
||||
* count: number of input characters *
|
||||
*===========================================================================*/
|
||||
int in_process(tp, buf, count)
|
||||
register tty_t *tp; /* terminal on which character has arrived */
|
||||
char *buf; /* buffer with input characters */
|
||||
int count; /* number of input characters */
|
||||
int in_process(tty_t *tp, char *buf, int count)
|
||||
{
|
||||
/* Characters have just been typed in. Process, save, and echo them. Return
|
||||
* the number of characters processed.
|
||||
|
|
@ -1172,11 +1171,11 @@ int count; /* number of input characters */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* echo *
|
||||
* echo *
|
||||
* tp: terminal on which to echo *
|
||||
* ch: character to echo *
|
||||
*===========================================================================*/
|
||||
static int tty_echo(tp, ch)
|
||||
register tty_t *tp; /* terminal on which to echo */
|
||||
register int ch; /* pointer to character to echo */
|
||||
static int tty_echo(register tty_t *tp, register int ch)
|
||||
{
|
||||
/* Echo the character if echoing is on. Some control characters are echoed
|
||||
* with their normal effect, other control characters are echoed as "^X",
|
||||
|
|
@ -1235,9 +1234,7 @@ register int ch; /* pointer to character to echo */
|
|||
/*===========================================================================*
|
||||
* rawecho *
|
||||
*===========================================================================*/
|
||||
static void rawecho(tp, ch)
|
||||
register tty_t *tp;
|
||||
int ch;
|
||||
static void rawecho(tty_t *tp, int ch)
|
||||
{
|
||||
/* Echo without interpretation if ECHO is set. */
|
||||
int rp = tp->tty_reprint;
|
||||
|
|
@ -1248,8 +1245,7 @@ int ch;
|
|||
/*===========================================================================*
|
||||
* back_over *
|
||||
*===========================================================================*/
|
||||
static int back_over(tp)
|
||||
register tty_t *tp;
|
||||
static int back_over(register tty_t *tp)
|
||||
{
|
||||
/* Backspace to previous character on screen and erase it. */
|
||||
u16_t *head;
|
||||
|
|
@ -1275,10 +1271,10 @@ register tty_t *tp;
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* reprint *
|
||||
* reprint *
|
||||
* tp: pointer to tty struct *
|
||||
*===========================================================================*/
|
||||
static void reprint(tp)
|
||||
register tty_t *tp; /* pointer to tty struct */
|
||||
static void reprint(register tty_t *tp)
|
||||
{
|
||||
/* Restore what has been echoed to screen before if the user input has been
|
||||
* messed up by output, or if REPRINT (^R) is typed.
|
||||
|
|
@ -1314,13 +1310,13 @@ register tty_t *tp; /* pointer to tty struct */
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* out_process *
|
||||
* out_process *
|
||||
* bstart/bpos/bend: start/pos/end of circular buffer *
|
||||
* icount: #input chars / input chars used *
|
||||
* ocount: max output chars / output chars used *
|
||||
*===========================================================================*/
|
||||
void out_process(tp, bstart, bpos, bend, icount, ocount)
|
||||
tty_t *tp;
|
||||
char *bstart, *bpos, *bend; /* start/pos/end of circular buffer */
|
||||
int *icount; /* # input chars / input chars used */
|
||||
int *ocount; /* max output chars / output chars used */
|
||||
void out_process(tty_t *tp, char *bstart, char *bpos, char *bend, int *icount,
|
||||
int *ocount)
|
||||
{
|
||||
/* Perform output processing on a circular buffer. *icount is the number of
|
||||
* bytes to process, and the number of bytes actually processed on return.
|
||||
|
|
@ -1401,8 +1397,7 @@ out_done:
|
|||
/*===========================================================================*
|
||||
* dev_ioctl *
|
||||
*===========================================================================*/
|
||||
static void dev_ioctl(tp)
|
||||
tty_t *tp;
|
||||
static void dev_ioctl(tty_t *tp)
|
||||
{
|
||||
/* The ioctl's TCSETSW, TCSETSF and TIOCDRAIN wait for output to finish to make
|
||||
* sure that an attribute change doesn't affect the processing of current
|
||||
|
|
@ -1427,8 +1422,7 @@ tty_t *tp;
|
|||
/*===========================================================================*
|
||||
* setattr *
|
||||
*===========================================================================*/
|
||||
static void setattr(tp)
|
||||
tty_t *tp;
|
||||
static void setattr(tty_t *tp)
|
||||
{
|
||||
/* Apply the new line attributes (raw/canonical, line speed, etc.) */
|
||||
u16_t *inp;
|
||||
|
|
@ -1478,12 +1472,10 @@ tty_t *tp;
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* sigchar *
|
||||
* sigchar *
|
||||
* sig: SIGINT, SIGQUIT, SIGKILL or SIGHUP *
|
||||
*===========================================================================*/
|
||||
void sigchar(tp, sig, mayflush)
|
||||
register tty_t *tp;
|
||||
int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */
|
||||
int mayflush;
|
||||
void sigchar(register tty_t *tp, int sig, int mayflush)
|
||||
{
|
||||
/* Process a SIGINT, SIGQUIT or SIGKILL char from the keyboard or SIGHUP from
|
||||
* a tty close, "stty 0", or a real RS-232 hangup. PM will send the signal to
|
||||
|
|
@ -1510,8 +1502,7 @@ int mayflush;
|
|||
/*===========================================================================*
|
||||
* tty_icancel *
|
||||
*===========================================================================*/
|
||||
static void tty_icancel(tp)
|
||||
register tty_t *tp;
|
||||
static void tty_icancel(register tty_t *tp)
|
||||
{
|
||||
/* Discard all pending input, tty buffer or device. */
|
||||
|
||||
|
|
@ -1532,7 +1523,7 @@ static int tty_devnop(tty_t *UNUSED(tp), int UNUSED(try))
|
|||
/*===========================================================================*
|
||||
* tty_init *
|
||||
*===========================================================================*/
|
||||
static void tty_init()
|
||||
static void tty_init(void)
|
||||
{
|
||||
/* Initialize tty structure and call device initialization routines. */
|
||||
|
||||
|
|
@ -1583,11 +1574,11 @@ static void tty_timed_out(int arg)
|
|||
}
|
||||
|
||||
/*===========================================================================*
|
||||
* settimer *
|
||||
* settimer *
|
||||
* tty_ptr: line to set or unset a timer on *
|
||||
* enable: set timer if true, otherwise unset *
|
||||
*===========================================================================*/
|
||||
static void settimer(tty_ptr, enable)
|
||||
tty_t *tty_ptr; /* line to set or unset a timer on */
|
||||
int enable; /* set timer if true, otherwise unset */
|
||||
static void settimer(tty_t *tty_ptr, int enable)
|
||||
{
|
||||
clock_t ticks;
|
||||
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
static int
|
||||
keep_displaying_restarted()
|
||||
keep_displaying_restarted(void)
|
||||
{
|
||||
u64_t delta;
|
||||
u32_t micro_delta;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user