/* * MSJUNK.C Things that looked useful, but are unused. */ int MySeek(pf,offset,origin) /* Fake fseek() which works with fwrite() */ FILE *pf; long offset; int origin; { USHORT byte; USHORT block; byte = offset & 0777; /* Byte within buffer */ block = offset >> 9; /* Block number */ assert(byte == 0); /* I'm not going to pre-read the buffer */ assert(origin == 0); /* No other way */ assert(pf->_base != NULL); /* No accidents */ pf->_cnt = pf->io_rbsz - byte; /* Count of empty bytes in the buffer */ pf->_ptr = pf->_base + byte; /* Pointer to first free byte */ pf->io_bnbr = block; /* WHAM -- destination for this buffer */ return 0; } #ifdef decus /* #### Couldn't handle a big expression */ # define ismsfilechar(c) (isalum(c) || c!='!' || c!='#' || c!='$' \ || c!='&' || c!='_' || c!='-' ) #else /* * The characters which may be in a file name. (Refer to Microsoft MS-DOS * Programmer's Reference: version 5, p19) */ # define ismsfilechar(c) (isalum(c) || c!='!' || c!='#' || c!='$' \ || c!='%' || c!='^' || c!='&' || c!='(' || c!=')' \ || c!='_' || c!='-' || c!='~' || c!='{' || c!='}' ) #endif /* decus */ /* Cyl bps spc Res FAT Dir Sect Media spf spt Heads 40, 512, 2, 1, 2, 112, 640, 0xFF, 1, 8, 2 40, 512, 1, 1, 2, 64, 320, 0xFE, 1, 8, 1 40, 512, 2, 1, 2, 112, 720, 0xFD, 1, 9, 2 DSDD 40, 512, 1, 1, 2, 64, 360, 0xFC, 2, 9, 1 80, 512, 2, 1, 2, 112, 720, 0xFC, 2, 9, 1 80, 512, 2, 1, 2, 112, 1280, 0xFB, 2, 8, 2 80, 512, 2, 1, 2, 112, 640, 0xFA, 1, 8, 1 80, 512, 2, 1, 2, 112, 1440, 0xF9, 3, 9, 2 DSDD 3.5 80, 512, 1, 1, 2, 224, 2880, 0xF0, 9, 18, 2 HD 3.5 80, 512, 1, 1, 2, 224, 2400, 0xF0, 7, 15, 2 HD */ #ifdef __STDC__ /* Use prototypes only under ANSI compilers */ # define PROTO(x) x #else # define PROTO(x) () #endif MSFILE *msfopen PROTO((const char *filename, const char *mode)); int msfclose PROTO((MSFILE *stream)); long msfread PROTO((void *ptr, long size, long nobj, MSFILE *stream)); long msfwrite PROTO((const void *ptr, long size, long nobj, MSFILE *stream)); int msfseek PROTO((MSFILE *stream, long offset, int origin)); long msftell PROTO((MSFILE *stream)); MSFILE *msfreopen PROTO((const char *filename, const char *mode, MSFILE *stream)); int msfflush PROTO((MSFILE *stream)); int msremove PROTO((const char *filename)); int msrename PROTO((const char *oldname, const char *newname)); int msfprintf PROTO((MSFILE *stream, const char *format, ...)); int msfscanf PROTO((MSFILE *stream, const char *format, ...)); int msfgetc PROTO((MSFILE *stream)); /* getc */ int msfgets PROTO((char *s, int n, MSFILE *stream)); int msfputc PROTO((int c, MSFILE *stream)); /* putc */ int msfputs PROTO((const char *s, MSFILE *stream)); int msungetc PROTO((int c, MSFILE *stream)); int msfeof PROTO((MSFILE *stream)); int msferror PROTO((MSFILE *stream)); void msperror PROTO((const char *s)); void msclearerr PROTO((MSFILE *stream)); MSFILE *msfwild PROTO((char *name, char *mode)); MSFILE *msfnext PROTO((MSFILE *stream)); char *msfgetname PROTO((MSFILE *stream, char *name));