int truncate(int fd) { IREGS r; r.r_ax = 0x4000; /* Write to file descriptor */ r.r_bx = fd; r.r_cx = 0; /* Indicates "truncate" */ return invokeDOS(&r); }
int findnext(struct ffblk *ff) { void far *dta; IREGS r; int rv; dta = getdta(); setdta((void far*)ff); r.r_ax = 0x4f00; rv = invokeDOS(&r); setdta(dta); return rv; }
int findfirst(const char * const pattern, struct ffblk *ff, int attrib) { void far *dta; IREGS r; int rv; /* DOS uses the DTA to store the internal search data to. The usual implementation of find*() keeps the first 21 bytes of the DTA or simply hope that no DOS will use more than 21 byte and point the DTA directly on the search data buffer. */ dta = getdta(); setdta((void far*)ff); r.r_dx = FP_OFF(pattern); r.r_ds = FP_SEG(pattern); r.r_cx = attrib; r.r_ax = 0x4e00; rv = invokeDOS(&r); setdta(dta); return rv; }