Subversion Repositories SvarDOS

Rev

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

Rev 1454 Rev 1461
Line 91... Line 91...
91
 *****************************************************************************/
91
 *****************************************************************************/
92
 
92
 
93
static struct line far *line_calloc(unsigned short siz) {
93
static struct line far *line_calloc(unsigned short siz) {
94
  struct line far *res;
94
  struct line far *res;
95
  unsigned int seg;
95
  unsigned int seg;
-
 
96
 
96
  if (_dos_allocmem((sizeof(struct line) + siz + 15) / 16, &seg) != 0) return(NULL);
97
  if (_dos_allocmem((sizeof(struct line) + siz + 15) / 16, &seg) != 0) return(NULL);
-
 
98
 
97
  res = MK_FP(seg, 0);
99
  res = MK_FP(seg, 0);
-
 
100
  res->len = 0;
-
 
101
  res->next = NULL;
98
  _fmemset(res, 0, sizeof(struct line) + siz);
102
  res->prev = NULL;
-
 
103
 
99
  return(MK_FP(seg, 0));
104
  return(res);
100
}
105
}
101
 
106
 
102
 
107
 
103
static void line_free(struct line far *ptr) {
108
static void line_free(struct line far *ptr) {
104
  _dos_freemem(FP_SEG(ptr));
109
  _dos_freemem(FP_SEG(ptr));