wok view linld/stuff/src/CRTL.H @ rev 25013
updated openal and openal-dev (1.20.1 -> 1.22.0)
author | Hans-G?nter Theisgen |
---|---|
date | Tue May 17 07:38:28 2022 +0100 (2022-05-17) |
parents | d70f7cc6e3ac |
children |
line source
1 // This file is distributed under GPL
2 //
3 // Bare bones of C runtime library
5 #define MK_FP(seg,ofs) ((void _seg *)(seg) + (void near *)(ofs))
6 #define FP_SEG(fp) ((unsigned) (void _seg*) (void far*)(fp))
7 #define FP_OFF(fp) ((unsigned) (fp))
8 #define NULL 0
10 const unsigned MIN_STACK = 0x400;
11 const unsigned MAX_MALLOC = 0xF000;
13 const char O_RDONLY = 0; // for open()
14 const char O_BINARY = 0;
16 extern char text_start; extern char text_end;
17 extern char data_start; extern char data_end;
18 extern char bss_start; extern char bss_end;
19 extern char* heap_top;
20 extern char xfer_buf[4096];
22 void parse_cmdline();
23 extern _fastcall void strcatb(const char* a,const char* b);
24 extern _fastcall void strcpy(const char* a,const char* b);
25 extern _fastcall int argstr(const char *s, const char keywords[], const char **var);
26 extern _fastcall int argnum(char *s, const char keywords[], unsigned long *var);
27 extern _fastcall void set_cmdline(const char *filename);
28 extern _fastcall int strcmp(const char* a,const char* b);
29 extern _fastcall int strhead(const char* a,const char* b);
30 extern _fastcall int fileexist(const char* name);
31 //extern "C" int open(const char* name, int flags);
32 extern _fastcall int open(const char* name);
33 #ifdef NO_CLOSE
34 #define close(x)
35 #else
36 extern _fastcall int close(int fd);
37 #endif
38 extern _fastcall int moverm(unsigned short *p);
39 extern _fastcall int readrm(struct image_himem *m, int sz);
40 extern _fastcall int read(int fd, void* data, int sz);
41 extern _fastcall long rewind(int fd);
42 extern _fastcall int puts(const char* s);
43 extern _fastcall unsigned long strtol(const char *s);
45 // Extensions
46 #define cli() do { asm { cli } } while(0)
47 #define sti() do { asm { sti } } while(0)
48 #define int3() do { asm { db 0cch } } while(0)
49 #define nop() do { asm { db 90h } } while(0)
50 extern void exit();
51 extern _fastcall int die(const char* msg);
52 //extern "C" char* malloc_or_die(unsigned size);
53 //extern "C" unsigned long* malloc_bufv_or_die(struct image_himem *m);
54 extern _fastcall int malloc_or_die(unsigned size);
55 extern _fastcall int malloc_bufv_or_die(struct image_himem *m);
56 extern char cpu_features[];
57 #define CPUMASKLM (0x20)
58 #define cpuhaslm() (cpu_features[3]&CPUMASKLM)
60 extern void loadfailure(void);