Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 1575 → Rev 1576

/sved/trunk/libc.c
8,31 → 8,6
#include "libc.h"
 
 
 
unsigned short mdr_dos_resizeblock(unsigned short siz, unsigned short segn) {
unsigned short res = 0;
 
_asm {
push bx
push es
 
mov ah, 0x4a
mov bx, siz
mov es, segn
int 0x21
jnc done
mov res, ax
 
done:
 
pop es
pop bx
}
 
return(res);
}
 
 
unsigned short mdr_dos_write(unsigned short handle, const void far *buf, unsigned short count, unsigned short *bytes) {
unsigned short res = 0;
unsigned short resax = 0;
/sved/trunk/libc.h
2,7 → 2,6
#ifndef LIBC_H
#define LIBC_H
 
unsigned short mdr_dos_resizeblock(unsigned short siz, unsigned short segn);
unsigned short mdr_dos_write(unsigned short handle, const void far *buf, unsigned short count, unsigned short *bytes);
 
#endif
/sved/trunk/sved.c
140,8 → 140,18
parm [bx] [dx] [cx] [di] \
value [ax]
 
unsigned short dos_resizeblock(unsigned short siz, unsigned short segn);
 
#pragma aux dos_resizeblock = \
"mov ah, 0x4a" \
"int 0x21" \
"jc done" \
"xor ax, ax" \
"done:" \
parm [bx] [es] \
value [ax]
 
 
/*****************************************************************************
* functions *
*****************************************************************************/
198,7 → 208,7
struct line far *newptr;
 
/* try resizing the block (much faster) */
if (mdr_dos_resizeblock((sizeof(struct line) + newsiz + 15) / 16, FP_SEG(db->cursor)) == 0) return(0);
if (dos_resizeblock((sizeof(struct line) + newsiz + 15) / 16, FP_SEG(db->cursor)) == 0) return(0);
 
/* create a new block and copy data over */
newptr = line_calloc(newsiz);