Subversion Repositories SvarDOS

Rev

Rev 1575 | Rev 1577 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1575 Rev 1576
Line 138... Line 138...
138
"xor ax, ax" \
138
"xor ax, ax" \
139
"done:" \
139
"done:" \
140
parm [bx] [dx] [cx] [di] \
140
parm [bx] [dx] [cx] [di] \
141
value [ax]
141
value [ax]
142
 
142
 
-
 
143
unsigned short dos_resizeblock(unsigned short siz, unsigned short segn);
-
 
144
 
-
 
145
#pragma aux dos_resizeblock = \
-
 
146
"mov ah, 0x4a" \
-
 
147
"int 0x21" \
-
 
148
"jc done" \
-
 
149
"xor ax, ax" \
-
 
150
"done:" \
-
 
151
parm [bx] [es] \
-
 
152
value [ax]
143
 
153
 
144
 
154
 
145
/*****************************************************************************
155
/*****************************************************************************
146
 * functions                                                                 *
156
 * functions                                                                 *
147
 *****************************************************************************/
157
 *****************************************************************************/
Line 196... Line 206...
196
 
206
 
197
static int curline_resize(struct file *db, unsigned short newsiz) {
207
static int curline_resize(struct file *db, unsigned short newsiz) {
198
  struct line far *newptr;
208
  struct line far *newptr;
199
 
209
 
200
  /* try resizing the block (much faster) */
210
  /* try resizing the block (much faster) */
201
  if (mdr_dos_resizeblock((sizeof(struct line) + newsiz + 15) / 16, FP_SEG(db->cursor)) == 0) return(0);
211
  if (dos_resizeblock((sizeof(struct line) + newsiz + 15) / 16, FP_SEG(db->cursor)) == 0) return(0);
202
 
212
 
203
  /* create a new block and copy data over */
213
  /* create a new block and copy data over */
204
  newptr = line_calloc(newsiz);
214
  newptr = line_calloc(newsiz);
205
  if (newptr == NULL) return(-1);
215
  if (newptr == NULL) return(-1);
206
  fmemmove(newptr, db->cursor, sizeof(struct line) + db->cursor->len);
216
  fmemmove(newptr, db->cursor, sizeof(struct line) + db->cursor->len);