Subversion Repositories SvarDOS

Rev

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

Rev 1568 Rev 1572
Line 87... Line 87...
87
  char slotid; /* 0..9 */
87
  char slotid; /* 0..9 */
88
  char fname[128];
88
  char fname[128];
89
};
89
};
90
 
90
 
91
 
91
 
-
 
92
 
-
 
93
/*****************************************************************************
-
 
94
 * assembly "functions"                                                      *
-
 
95
 *****************************************************************************/
-
 
96
 
-
 
97
unsigned short dosalloc(unsigned short siz);
-
 
98
 
-
 
99
#pragma aux dosalloc = \
-
 
100
"mov ah, 0x48" \
-
 
101
"int 0x21" \
-
 
102
"jnc done" \
-
 
103
"xor ax, ax" \
-
 
104
"done:" \
-
 
105
parm [bx] \
-
 
106
value [ax];
-
 
107
 
-
 
108
 
-
 
109
unsigned short dosfree(unsigned short segn);
-
 
110
 
-
 
111
#pragma aux dosfree = \
-
 
112
"mov ah, 0x49" \
-
 
113
"int 0x21" \
-
 
114
"jc done" \
-
 
115
"xor ax, ax" \
-
 
116
"done:" \
-
 
117
parm [es] \
-
 
118
value [ax];
-
 
119
 
-
 
120
 
92
/*****************************************************************************
121
/*****************************************************************************
93
 * functions                                                                 *
122
 * functions                                                                 *
94
 *****************************************************************************/
123
 *****************************************************************************/
95
 
124
 
96
static struct line far *line_calloc(unsigned short siz) {
125
static struct line far *line_calloc(unsigned short siz) {
97
  struct line far *res;
126
  struct line far *res;
98
  unsigned short seg;
127
  unsigned short seg;
99
 
128
 
100
  seg = mdr_dos_allocmem((sizeof(struct line) + siz + 15) / 16);
129
  seg = dosalloc((sizeof(struct line) + siz + 15) / 16);
101
  if (seg == 0) return(NULL);
130
  if (seg == 0) return(NULL);
102
  res = MK_FP(seg, 0);
131
  res = MK_FP(seg, 0);
103
  res->len = 0;
132
  res->len = 0;
104
  res->next = NULL;
133
  res->next = NULL;
105
  res->prev = NULL;
134
  res->prev = NULL;
Line 107... Line 136...
107
  return(res);
136
  return(res);
108
}
137
}
109
 
138
 
110
 
139
 
111
static void line_free(struct line far *ptr) {
140
static void line_free(struct line far *ptr) {
112
  _dos_freemem(FP_SEG(ptr));
141
  dosfree(FP_SEG(ptr));
113
}
142
}
114
 
143
 
115
 
144
 
116
static int curline_resize(struct file *db, unsigned short newsiz) {
145
static int curline_resize(struct file *db, unsigned short newsiz) {
117
  struct line far *newptr;
146
  struct line far *newptr;