1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
|
/* Copyright (C) 1998 Robert de Bath <rdebath@cix.compulink.co.uk>
* This file is part of the Linux-8086 C library and is distributed
* under the GNU Library General Public License.
*/
#if !__FIRST_ARG_IN_AX__
#ifdef __AS386_16__
#ifdef __MSDOS__
#include <dos.h>
#include <fcntl.h>
#include <errno.h>
int errno;
#ifdef L_dos_chdir
chdir(path)
char * path;
{
#asm
mov bx,sp
mov bx,_chdir.path[bx]
cmp [bx+1],':
jnz do_chdir
mov dl,[bx]
and dl,#$3F
dec dl
mov ah,#$0E
int $21
do_chdir:
mov ah,#$3B
mov dx,bx
do_dxop:
int $21
jnc op_ok
br exterror
op_ok:
xor ax,ax
#endasm
}
#endif
#ifdef L_mkdir
mkdir(path)
char * path;
{
#asm
mov bx,sp
mov dx,_mkdir.path[bx]
mov ah,#$39
j do_dxop
#endasm
}
#endif
#ifdef L_rmdir
rmdir(path)
char * path;
{
#asm
mov bx,sp
mov dx,_rmdir.path[bx]
mov ah,#$3A
j do_dxop
#endasm
}
#endif
#ifdef L_unlink
unlink(path)
char * path;
{
#asm
mov bx,sp
mov dx,_unlink.path[bx]
mov ah,#$41
xor cx,cx ! Attrib 0 for servers.
j do_dxop
#endasm
}
#endif
/*************************************************************************
TO TEST ...
*/
#ifdef L_sleep
sleep(secs)
unsigned secs;
{
int counter = 0;
int es = __get_es();
__set_es(0x40);
while(secs>0)
{
int c = __peek_es(0x6C);
while( c == __peek_es(0x6C) ) ;
counter += 549;
if( counter > 10000 )
{
secs--;
counter -= 10000;
}
/* Interrupt on ctrl-break */
if( __peek_es(0x71) & 0x80 ) break;
}
__set_es(es);
return secs;
}
#endif
/*************************************************************************
TODO ...
*/
#ifdef L_dos_access
access(filename, amode)
char * filename;
int amode;
{
XXX;
}
#endif
#ifdef L__dos_allocmem
_dos_allocmem(size ...)
{
}
#endif
#ifdef L__chmod
_chmod(path, func, attrib)
char * path;
int func, attrib;
{
XXX;
}
#endif
#ifdef L_chmod
chmod(path, mode)
char * path;
int mode;
{
XXX;
}
#endif
#ifdef L_clock
clock_t clock()
{
XXX;
}
#endif
#ifdef L_ctrlbrk
ctrlbrk(func)
int (*func)();
{
XXX;
}
#endif
#ifdef L_delay
delay(millis)
unsigned millis;
{
XXX;
}
#endif
#ifdef L_dosexterr
dosexterr(ptr)
struct DOSERROR * ptr;
{
XXX;
}
#endif
/*
#ifdef __dos_getdiskfree
*/
#ifdef L_dup
dup(fd)
int fd;
{
XXX;
}
#endif
#ifdef L_dup2
dup2(ofd, nfd)
int ofd, nfd;
{
XXX;
}
#endif
#ifdef L_filelength
long
filelength(fd)
int fd;
{
XXX;
}
#endif
#ifdef L_findfirst
findfirst(path, fcb, attrib)
char * path;
void * fcb;
int attrib;
{
XXX;
}
#endif
#ifdef L_findnext
findnext(fcb)
void * fcb;
{
XXX;
}
#endif
#ifdef L_stat
stat(path, st)
char * path;
struct stat * st;
{
XXX;
}
#endif
#ifdef L_fstat
fstat(fd, st)
int fd;
struct stat * st;
{
XXX;
}
#endif
#ifdef L_getcbrk
getcbrk()
{
XXX int 0x21/33;
}
#endif
#ifdef L_setcbrk
setcbrk(mode)
int mode;
{
XXX int 0x21/33;
}
#endif
#ifdef L_getcwd
getcwd(buf, buflen)
char * buf;
int buflen;
{
XXX;
}
#endif
#ifdef L__getdrive
_getdrive()
{
XXX;
}
#endif
#ifdef L_getenv
char *
getenv(varname)
char * varname;
{
XXX;
}
#endif
#ifdef L_putenv
putenv(varname)
char * varname;
{
XXX;
}
#endif
#ifdef L_getpid
getpid()
{
XXX;
}
#endif
#ifdef L_rename
rename(oldname, newpath)
char *oldpath, *newpath;
{
XXX;
}
#endif
#ifdef L_setmode
setmode(fd, amode)
int fd, amode;
{
XXX;
}
#endif
#ifdef L_system
system(cmd)
char * cmd;
{
XXX;
}
#endif
#ifdef L_umask
umask(mode)
int mode;
{
XXX;
/*
* save umask value for open() use it for read-only bit.
*/
}
#endif
#ifdef L_utime
utime(path, times)
char * path;
stuct utimbuf * times;
{
XXX;
}
#endif
#endif /* __MSDOS__ */
#endif /* __AS386_16__ */
#endif /* !__FIRST_ARG_IN_AX__ */
|