forked from aquynh/unidos
-
Notifications
You must be signed in to change notification settings - Fork 2
/
defs.h
171 lines (157 loc) · 4.48 KB
/
defs.h
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
#ifndef UNIDOS_DEFS_H
#define UNIDOS_DEFS_H
// real-mode far pointer created from segment & offset
#include <stdint.h>
#define MK_FP(SEG, OFF) (((SEG) << 4) + (OFF))
#define MIN(a, b) ((a) < (b)? (a) : (b))
#define MAX(a, b) ((a) > (b)? (a) : (b))
#define ALIGN(a, b) (((a) + (b)) & ~((b) - 1))
enum DOS_ERROR
{
ERR_SUCCESS = 0x00,
ERR_INVALID_FUNCTION_NUMBER = 0x01,
ERR_FILE_NOT_FOUND = 0x02,
ERR_PATH_NOT_FOUND = 0x03,
ERR_TOO_MANY_OPEN_FILES = 0x04,
ERR_ACCESS_DENIED = 0x05,
ERR_INVALID_HANDLE = 0x06,
ERR_MEMORY_CONTROL_BLOCKS_DESTROYED = 0x07,
ERR_INSUFFICIENT_MEMORY = 0x08,
ERR_INVALID_MEMORY_BLOCK_ADDRESS = 0x09,
ERR_INVALID_ENVIRONMENT = 0x0A,
ERR_INVALID_FORMAT = 0x0B,
ERR_INVALID_ACCESS_MODE = 0x0C,
ERR_INVALID_DATA = 0x0D,
ERR_RESERVED = 0x0E,
ERR_INVALID_DRIVE_SPECIFIED = 0x0F,
ERR_ATTEMPT_TO_REMOVE_CURRENT_DIRECTORY = 0x10,
ERR_NOT_SAME_DEVICE = 0x11,
ERR_NO_MORE_FILES = 0x12,
ERR_ATTEMPT_TO_WRITE_ON_A_WRITE_PROTECTED_DISKETTE = 0x13,
ERR_UNKNOWN_UNIT = 0x14,
ERR_DRIVE_NOT_READY = 0x15,
ERR_UNKNOWN_COMMAND = 0x16,
ERR_CRC_ERROR = 0x17,
ERR_BAD_REQUEST_STRUCTURE_LENGTH = 0x18,
ERR_SEEK_ERROR = 0x19,
ERR_UNKNOWN_MEDIA_TYPE = 0x1A,
ERR_SECTOR_NOT_FOUND = 0x1B,
ERR_PRINTER_OUT_OF_PAPER = 0x1C,
ERR_WRITE_FAULT = 0x1D,
ERR_READ_FAULT = 0x1E,
ERR_GENERAL_FAILURE = 0x1F,
ERR_SHARING_VIOLATION = 0x20,
ERR_LOCK_VIOLATION = 0x21,
ERR_INVALID_DISK_CHANGE = 0x22,
ERR_FCB_UNAVAILABLE = 0x23,
ERR_SHARING_BUFFER_OVERFLOW = 0x24,
ERR_UNABLE_TO_COMPLETE_FILE_OPERATION = 0x26,
ERR_NETWORK_REQUEST_NOT_SUPPORTED = 0x32,
ERR_REMOTE_COMPUTER_NOT_LISTENING = 0x33,
ERR_DUPLICATE_NAME_ON_NETWORK = 0x34,
ERR_NETWORK_NAME_NOT_FOUND = 0x35,
ERR_NETWORK_BUSY = 0x36,
ERR_NETWORK_DEVICE_NO_LONGER_EXISTS = 0x37,
ERR_NETBIOS_COMMAND_LIMIT_EXCEEDED = 0x38,
ERR_NETWORK_ADAPTER_ERROR = 0x39,
ERR_INCORRECT_NETWORK_RESPONSE = 0x3A,
ERR_UNEXPECTED_NETWORK_ERROR = 0x3B,
ERR_INCOMPATIBLE_REMOTE_ADAPTER = 0x3C,
ERR_PRINT_QUEUE_FULL = 0x3D,
ERR_NO_SPACE_FOR_PRINT_FILE = 0x3E,
ERR_PRINT_FILE_DELETED = 0x3F,
ERR_NETWORK_NAME_DELETED = 0x40,
ERR_ACCESS_DENIED_2 = 0x41,
ERR_NETWORK_DEVICE_TYPE_INCORRECT = 0x42,
ERR_NETWORK_NAME_NOT_FOUND_2 = 0x43,
ERR_NETWORK_NAME_LIMIT_EXCEEDED = 0x44,
ERR_NETBIOS_SESSION_LIMIT_EXCEEDED = 0x45,
ERR_TEMPORARILY_PAUSED = 0x46,
ERR_NETWORK_REQUEST_NOT_ACCEPTED = 0x47,
ERR_PRINT_OR_DISK_REDIRECTION_IS_PAUSED = 0x48,
ERR_FILE_ALREADY_EXISTS = 0x50,
ERR_CANNOT_MAKE_DIRECTORY_ENTRY = 0x52,
ERR_FAIL_ON_INT_24 = 0x53,
ERR_TOO_MANY_REDIRECTIONS = 0x54,
ERR_DUPLICATE_REDIRECTION = 0x55,
ERR_INVALID_PASSWORD = 0x56,
ERR_INVALID_PARAMETER = 0x57,
ERR_NETWORK_DEVICE_FAULT = 0x58,
ERR_FUNCTION_NOT_SUPPORTED_BY_NETWORK = 0x59,
ERR_REQUIRED_SYSTEM_COMPONENT_NOT_INSTALLED = 0x5A
};
enum DOS_DATE_FORMAT
{
DATE_MDY = 0,
DATE_DMY = 1,
DATE_YMD = 2
};
enum DOS_CURRENCY_FORMAT
{
CUR_SYMBOL_BEFORE = 0,
CUR_SYMBOL_AFTER = 1,
CUR_SYMBOL_BEFORE_SPACE = 2,
CUR_SYMBOL_AFTER_SPACE = 3,
CUR_SYMBOL_REPLACE_DECIMAL = 4
};
enum DOS_TIME_FORMAT
{
TIME_12H = 0,
TIME_24H = 1
};
#pragma pack(push, 1)
struct dos_country_data
{
uint16_t date_format;
char currency_symbol[5];
char thousands_sep[2];
char decimal_sep[2];
};
struct dos_country_data_new
{
struct dos_country_data base_data;
char date_sep[2];
char time_sep[2];
uint8_t currency_symbol_loc;
uint8_t currency_decimal_places;
uint8_t time_format;
uint32_t ext_ascii_map_address;
char list_sep[2];
uint8_t reserved[10];
};
#pragma pack(pop)
enum DOS_COUNTRY_ID
{
CID_BELGIUM = 32,
CID_BRAZIL = 55,
CID_CANADIAN_FRENCH = 2,
CID_CROATIA = 38,
CID_CZECH_REPUBLIC = 42,
CID_DENMARK = 45,
CID_FINLAND = 358,
CID_FRANCE = 33,
CID_GERMANY = 49,
CID_HUNGARY = 36,
CID_INT_ENGLISH = 61,
CID_ITALY = 39,
CID_LATIN_AMERICA = 3,
CID_NETHERLANDS = 31,
CID_NORWAY = 47,
CID_POLAND = 48,
CID_PORTUGAL = 351,
CID_SERBIA_YUGOSLAVIA = 38,
CID_SLOVAKIA = 42,
CID_SLOVENIA = 38,
CID_SPAIN = 34,
CID_SWEDEN = 46,
CID_SWITZERLAND = 41,
CID_UNITED_KINGDOM = 44,
CID_UNITED_STATES = 1,
};
/*#if DBGPRINT || true
#define dbgprintf printf
#else
#define dbgprintf (void)sizeof
#endif*/
extern int (*dbgprintf)(const char *__restrict __format, ...);
#endif