Angband
ds_io.h
Go to the documentation of this file.
1 
2 #ifndef DS_FILEIO_H
3 #define DS_FILEIO_H
4 
5 // guarantee that this file will be included before the #defs
6 #include <fcntl.h>
7 
8 //#include "nds.h"
9 /*#define BG_GFX_SUB ((unsigned short*)0x6200000)
10 #define RGB15(r,g,b) ((r)|((g)<<5)|((b)<<10))
11 extern int vram_pos;
12 #define D(s) BG_GFX_SUB[vram_pos++] = RGB15(0,31,31) | (1<<15);
13 #define F(x,y) BG_GFX_SUB[y*256*2+x*2] = RGB15(31,0,0) | (1<<15);
14 #define G(x,y,r,g,b) BG_GFX_SUB[y*256*2+x*2] = RGB15(r,g,b) | (1<<15);*/
15 # define NDECL(f) f()
16 # define FDECL(f,p) f()
17 # define VDECL(f,p) f()
18 
19 /*
20 #define fopen ds_fopen
21 #define fclose ds_fclose
22 #define fseek ds_fseek
23 #define rewind ds_rewind
24 #define fgetc ds_fgetc
25 #define fgets ds_fgets
26 #define fread ds_fread
27 */
28 #define open ds_open
29 #define close ds_close
30 #define creat ds_creat
31 #define lseek ds_lseek
32 #define read ds_read
33 #define sopen ds_sopen
34 #define write ds_write
35 // I wish I knew a better way to do this...
36 /*
37 #define ftell ds_ftell
38 #define fputc ds_fputc
39 #define fputs ds_fputs
40 #define fwrite ds_fwrite
41 #define fscanf ds_fscanf
42 #define fprintf ds_fprintf
43 #define vfprintf ds_vfprintf
44 #define access ds_access
45 #define unlink ds_unlink
46 #define getuid ds_getuid
47 #define getgid ds_getgid
48 #define getpid ds_getpid
49 #define time ds_time
50 #define getenv ds_getenv
51 
52 #define freopen(a,b,c) ds_open(a,b)
53 */
54 //#define EOF -1
55 
56 #define E extern
57 E void VDECL(error, (const char *,...)); //PRINTF_F(1,2);
58 E void FDECL(regularize, (char *));
59 E char* FDECL(get_username, (int *));
60 E FILE* FDECL(ds_fopen, (const char *, const char *));
61 E int FDECL(ds_fclose, (FILE *));
62 E long FDECL(ds_ftell, (FILE *));
63 E int FDECL(ds_fseek, (FILE *, long, int));
64 E void FDECL(ds_rewind, (FILE *));
65 E int FDECL(ds_fgetc, (FILE *));
66 E int FDECL(ds_fputc, (int, FILE *));
67 E char* FDECL(ds_fgets, (char *, int, FILE *));
68 E int FDECL(ds_fputs, (const char *, FILE *));
69 E int FDECL(ds_fread, (void *, size_t, size_t, FILE *));
70 E int FDECL(ds_fwrite, (const void *, size_t, size_t, FILE *));
71 E int VDECL(ds_fscanf, (FILE *, const char *, ...));
72 E int VDECL(ds_fprintf, (FILE *, const char *, ...)); //PRINTF_F(2,3);
73 E int FDECL(ds_vfprintf, (FILE *, const char *, va_list));
74 E int FDECL(ds_access, (const char *, int));
75 E int FDECL(ds_close, (int));
76 E int FDECL(ds_creat, (const char *, int));
77 E off_t FDECL(ds_lseek, (int, off_t, int));
78 E int FDECL(ds_open, (const char *, int, int));
79 E int FDECL(ds_read, (int, void *, unsigned int));
80 E int FDECL(ds_sopen, (const char *, int, int, int));
81 E int FDECL(ds_unlink, (const char *));
82 E int FDECL(ds_write, (int, const void *, unsigned int));
83 E int NDECL(ds_getuid);
84 E int NDECL(ds_getgid);
85 E int NDECL(ds_getpid);
86 E time_t FDECL(ds_time, (time_t *));
87 E struct tm* FDECL(ds_localtime, (time_t *));
88 E char* FDECL(ds_getenv, (const char*));
89 
90 
91 
92 #endif
#define NDECL(f)
Definition: ds_io.h:15
#define E
Definition: ds_io.h:56
#define FDECL(f, p)
Definition: ds_io.h:16
#define VDECL(f, p)
Definition: ds_io.h:17