Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 1572 → Rev 1573

/sved/trunk/libc.c
32,24 → 32,7
}
}
 
unsigned short mdr_dos_fclose(unsigned short handle) {
unsigned short res = 0;
_asm {
push bx
 
mov ah, 0x3e
mov bx, handle
int 0x21
jnc done
mov res, ax
done:
 
pop bx
}
return(res);
}
 
 
unsigned short mdr_dos_resizeblock(unsigned short siz, unsigned short segn) {
unsigned short res = 0;
 
/sved/trunk/libc.h
7,11 → 7,8
size_t strlen(const char *s);
void bzero(void *ptr, size_t len);
void fmemmove(void far *dst, const void far *src, size_t len);
unsigned short mdr_dos_fopen(const char *fname, unsigned short *fhandle);
unsigned short mdr_dos_fclose(unsigned short handle);
unsigned short mdr_dos_resizeblock(unsigned short siz, unsigned short segn);
unsigned short mdr_dos_read(unsigned short handle, void far *buf, unsigned short count, unsigned short *bytes);
 
unsigned short mdr_dos_write(unsigned short handle, const void far *buf, unsigned short count, unsigned short *bytes);
 
#endif
/sved/trunk/sved.c
117,7 → 117,18
parm [es] \
value [ax];
 
unsigned short dosfclose(unsigned short handle);
 
#pragma aux dosfclose = \
"mov ah,0x3e" \
"int 0x21" \
"jc done" \
"xor ax, ax" \
"done:" \
parm [bx] \
value [ax];
 
 
/*****************************************************************************
* functions *
*****************************************************************************/
304,7 → 315,7
l = l->next;
}
 
errflag |= mdr_dos_fclose(fd);
errflag |= dosfclose(fd);
 
/* did it all work? */
if (errflag == 0) {
785,7 → 796,7
 
}
 
mdr_dos_fclose(fd);
dosfclose(fd);
 
SKIPLOADING:
 
795,7 → 806,7
return(err);
 
IOERR:
mdr_dos_fclose(fd);
dosfclose(fd);
return(1);
}