Subversion Repositories SvarDOS

Rev

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

Rev 1336 Rev 1337
Line 97... Line 97...
97
    l->next = db->cursor->next;
97
    l->next = db->cursor->next;
98
    db->cursor->next = l;
98
    db->cursor->next = l;
99
    l->next->prev = l;
99
    l->next->prev = l;
100
  }
100
  }
101
  db->cursor = l;
101
  db->cursor = l;
102
  _fmemcpy(l->payload, line, slen);
102
  _fmemmove(l->payload, line, slen);
103
  l->len = slen;
103
  l->len = slen;
104
 
104
 
105
  db->totlines += 1;
105
  db->totlines += 1;
106
  db->curline += 1;
106
  db->curline += 1;
107
 
107
 
Line 153... Line 153...
153
  struct line far *n;
153
  struct line far *n;
154
  if (sizeof(struct line) + f->cursor->len + len < len) return(-1); /* overflow check */
154
  if (sizeof(struct line) + f->cursor->len + len < len) return(-1); /* overflow check */
155
  n = _frealloc(f->cursor, sizeof(struct line) + f->cursor->len + len);
155
  n = _frealloc(f->cursor, sizeof(struct line) + f->cursor->len + len);
156
  if (n == NULL) return(-1);
156
  if (n == NULL) return(-1);
157
  f->cursor = n;
157
  f->cursor = n;
158
  _fmemcpy(f->cursor->payload + f->cursor->len, buf, len);
158
  _fmemmove(f->cursor->payload + f->cursor->len, buf, len);
159
  f->cursor->len += len;
159
  f->cursor->len += len;
160
 
160
 
161
  /* rewire the linked list */
161
  /* rewire the linked list */
162
  if (f->cursor->next) f->cursor->next->prev = f->cursor;
162
  if (f->cursor->next) f->cursor->next->prev = f->cursor;
163
  if (f->cursor->prev) f->cursor->prev->next = f->cursor;
163
  if (f->cursor->prev) f->cursor->prev->next = f->cursor;
Line 229... Line 229...
229
  for (i = 2; i < 18; i++) {
229
  for (i = 2; i < 18; i++) {
230
    mdr_cout_char_rep(i, offset - 2, ' ', SCHEME_STBAR1, MAXLINLEN + 2);
230
    mdr_cout_char_rep(i, offset - 2, ' ', SCHEME_STBAR1, MAXLINLEN + 2);
231
  }
231
  }
232
 
232
 
233
  for (i = 0; i < 20; i++) {
233
  for (i = 0; i < 20; i++) {
234
    const char *s = svarlang_strid(i);
234
    const char *s = svarlang_str(8, i);
235
    if (s[0] == 0) break;
235
    if (s[0] == 0) break;
236
    if (s[0] == '.') continue;
236
    if (s[0] == '.') continue;
237
    mdr_cout_locate(3 + i, offset + mdr_cout_str(3 + i, offset, s, SCHEME_STBAR1, MAXLINLEN));
237
    mdr_cout_locate(3 + i, offset + mdr_cout_str(3 + i, offset, s, SCHEME_STBAR1, MAXLINLEN));
238
  }
238
  }
239
 
239
 
Line 429... Line 429...
429
    struct line far *nextline = db->cursor->next;
429
    struct line far *nextline = db->cursor->next;
430
    if (db->cursor->next->len > 0) {
430
    if (db->cursor->next->len > 0) {
431
      void far *newptr = _frealloc(db->cursor, sizeof(struct line) + db->cursor->len + db->cursor->next->len + 1);
431
      void far *newptr = _frealloc(db->cursor, sizeof(struct line) + db->cursor->len + db->cursor->next->len + 1);
432
      if (newptr != NULL) {
432
      if (newptr != NULL) {
433
        db->cursor = newptr;
433
        db->cursor = newptr;
434
        _fmemcpy(db->cursor->payload + db->cursor->len, db->cursor->next->payload, db->cursor->next->len + 1);
434
        _fmemmove(db->cursor->payload + db->cursor->len, db->cursor->next->payload, db->cursor->next->len + 1);
435
        db->cursor->len += db->cursor->next->len;
435
        db->cursor->len += db->cursor->next->len;
436
      }
436
      }
437
    }
437
    }
438
    db->cursor->next = db->cursor->next->next;
438
    db->cursor->next = db->cursor->next->next;
439
    db->cursor->next->prev = db->cursor;
439
    db->cursor->next->prev = db->cursor;