This commit was manufactured by cvs2svn to create branch 'captive'.
[reactos.git] / include / crtdll / dos.h
1 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
2 #ifndef __dj_include_h_
3 #define __dj_include_h_
4
5 #ifndef __dj_ENFORCE_ANSI_FREESTANDING
6
7 #ifndef __STRICT_ANSI__
8
9 #ifndef _POSIX_SOURCE
10
11
12
13 struct ftime {
14   unsigned ft_tsec:5;   /* 0-29, double to get real seconds */
15   unsigned ft_min:6;    /* 0-59 */
16   unsigned ft_hour:5;   /* 0-23 */
17   unsigned ft_day:5;    /* 1-31 */
18   unsigned ft_month:4;  /* 1-12 */
19   unsigned ft_year:7;   /* since 1980 */
20 };
21
22 struct date {
23   short da_year;
24   char  da_day;
25   char  da_mon;
26 };
27
28 struct time {
29   unsigned char ti_min;
30   unsigned char ti_hour;
31   unsigned char ti_hund;
32   unsigned char ti_sec;
33 };
34
35 struct dfree {
36   unsigned df_avail;
37   unsigned df_total;
38   unsigned df_bsec;
39   unsigned df_sclus;
40 };
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 extern unsigned short   _osmajor, _osminor;
47 extern const    char  * _os_flavor;
48
49 unsigned short _get_version(int);
50
51
52
53
54 int getftime(int handle, struct ftime *ftimep);
55 int setftime(int handle, struct ftime *ftimep);
56
57 int getcbrk(void);
58 int setcbrk(int new_value);
59
60 void getdate(struct date *);
61 void gettime(struct time *);
62 void setdate(struct date *);
63 void settime(struct time *);
64
65 void getdfree(unsigned char drive, struct dfree *ptr);
66
67 void delay(unsigned msec);
68 /* int _get_default_drive(void);
69 void _fixpath(const char *, char *); */
70
71
72 /*
73  *  For compatibility with other DOS C compilers.
74  */
75
76 #define _A_NORMAL   0x00    /* Normal file - No read/write restrictions */
77 #define _A_RDONLY   0x01    /* Read only file */
78 #define _A_HIDDEN   0x02    /* Hidden file */
79 #define _A_SYSTEM   0x04    /* System file */
80 #define _A_VOLID    0x08    /* Volume ID file */
81 #define _A_SUBDIR   0x10    /* Subdirectory */
82 #define _A_ARCH     0x20    /* Archive file */
83
84 #define _enable   enable
85 #define _disable  disable
86
87 struct date_t {
88   unsigned char  day;       /* 1-31 */
89   unsigned char  month;     /* 1-12 */
90   unsigned short year;      /* 1980-2099 */
91   unsigned char  dayofweek; /* 0-6, 0=Sunday */
92 };
93 #define dosdate_t date_t
94
95 struct time_t {
96   unsigned char hour;     /* 0-23 */
97   unsigned char minute;   /* 0-59 */
98   unsigned char second;   /* 0-59 */
99   unsigned char hsecond;  /* 0-99 */
100 };
101 #define dostime_t time_t
102
103
104
105 #define finddata_t _finddata_t
106
107
108 #define diskfree_t _diskfree_t
109
110 struct _DOSERROR {
111   int  exterror;
112   #ifdef __cplusplus
113   char errclass;
114   #else
115   char class;
116   #endif
117   char action;
118   char locus;
119 };
120 #define DOSERROR _DOSERROR
121
122
123
124
125 void           _getdate(struct date_t *_date);
126 unsigned int   _setdate(struct date_t *_date);
127 void           _gettime(struct time_t *_time);
128 unsigned int   _settime(struct time_t *_time);
129
130 unsigned int   _getftime(int _handle, unsigned int *_p_date, unsigned int *_p_time);
131 unsigned int   _setftime(int _handle, unsigned int _date, unsigned int _time);
132 unsigned int   _getfileattr(const char *_filename, unsigned int *_p_attr);
133 unsigned int   _setfileattr(const char *_filename, unsigned int _attr);
134
135
136 void           _setdrive(unsigned int _drive, unsigned int *_p_drives);
137
138
139 int            exterr(struct _DOSERROR *_p_error);
140 #define dosexterr(_ep) exterr(_ep)
141
142 #include <crtdll/direct.h>
143
144 #define int386(_i, _ir, _or)         int86(_i, _ir, _or)
145 #define int386x(_i, _ir, _or, _sr)   int86x(_i, _ir, _or, _sr)
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif /* !_POSIX_SOURCE */
152 #endif /* !__STRICT_ANSI__ */
153 #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
154
155 #ifndef __dj_ENFORCE_FUNCTION_CALLS
156 #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
157
158 #endif /* !__dj_include_h_ */