about summary refs log tree commit diff stats
path: root/LLVMprivateGenerator/registered_structs.cpp
blob: 0473deb56e2ff9955c05126bcd576860ec5b19b0 (plain) (blame)
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
#include <string>

#define ALL START() \
	/* libc */ \
	STRUCT("_IO_FILE", "a FILE") \
	STRUCT("_G_fpos_t", "a file position") \
	STRUCT("sockaddr", "a socket address") \
	STRUCT("itimerspec", "an itimerspec") \
	STRUCT("timespec", "a timespec") \
	STRUCT("itimerval", "an itimerval") \
	STRUCT("timeval", "a timeval") \
	STRUCT("timex", "a timex") \
	STRUCT("timezone", "a timezone") \
	STRUCT("dirent", "a dirent") \
	STRUCT("dirent64", "a dirent64") \
	STRUCT("__dirstream", "a dir stream") \
	STRUCT("tm", "a time structure (tm)") \
	STRUCT("cmsghdr", "a cmsghdr") \
	STRUCT("msghdr", "a msghdr") \
	STRUCT("rpcent", "an rpcent") \
	STRUCT("random_data", "a random_data structure") \
	STRUCT("drand48_data", "a drand48_data structure") \
	STRUCT("termios", "a termios") \
	STRUCT("iovec", "an iovec") \
	STRUCT("file_handle", "a file handle") \
	STRUCT("lconv", "an lconv") \
	STRUCT("__locale_struct", "a locale structure") \
	STRUCT("aliasent", "an alias") \
	STRUCT("fstab", "an fstab") \
	STRUCT("group", "a group") \
	STRUCT("hostent", "a hostent") \
	STRUCT("protoent", "a protoent") \
	STRUCT("passwd", "a password") \
	STRUCT("spwd", "an spwd") \
	STRUCT("ttyent", "a ttyent") \
	STRUCT("utmp", "an utmp structure") \
	STRUCT("utmpx", "an utmpx structure") \
	STRUCT("ifaddrs", "an ifaddrs structure") \
	STRUCT("statfs", "a statfs structure") \
	STRUCT("statfs64", "a statfs64 structure") \
	STRUCT("statvfs", "a statvfs structure") \
	STRUCT("statvfs64", "a statvfs64 structure") \
	STRUCT("timeb", "a timeb structure") \
	STRUCT("_ftsent", "an _ftsent structure") \
	STRUCT("sysinfo", "a sysinfo structure") \
	STRUCT("rlimit", "an rlimit structure") \
	STRUCT("rlimit64", "an rlimit64 structure") \
	STRUCT("rusage", "an rusage structure") \
	STRUCT("entry", "an entry structure") \
	STRUCT("pollfd", "a pollfd structure") \
	STRUCT("re_pattern_buffer", "a re_pattern_buffer structure") \
	STRUCT("sembuf", "a sembuf structure") \
	STRUCT("tms", "a tms structure") \
	STRUCT("utsname", "an utsname structure") \
	STRUCT("utimbuf", "an utimbuf structure") \
	STRUCT2("__va_list_tag", "__va_list_tag (aka, a va_list)", 'A') \
	/* ncurses */ \
	STRUCT("_win_st", "a _win_st structure") \
	STRUCT("MEVENT", "an MEVENT structure") \
	TYPEDEF("cchar_t", "a cchar_t") \
	/* zlib */ \
	STRUCT("gz_header_s", "a gz_header_s structure") \
	STRUCT("gzFile_s", "a gzFile_s structure") \
	STRUCT("z_stream_s", "a z_stream_s structure") \
	\
	END()

#define START()
#define STRUCT(s, ret) if (str == s) { return 'p'; } else
#define STRUCT2(s, ret, c) if (str == s) { return c; } else
#define TYPEDEF(s, ret) if (str == s) { return 'p'; } else
#define END() { return 0; }
char ptr2char(const std::string &str) {
	/*if ((str == "_IO_FILE")
	 || (str == "_G_fpos_t")
	 || (str == "sockaddr")
	 || (str == "itimerspec")
	 || (str == "timespec")
	 || (str == "itimerval")
	 || (str == "timeval")
	 || (str == "timex")
	 || (str == "timezone")
	 || (str == "dirent")
	 || (str == "dirent64")
	 || (str == "__dirstream")
	 || (str == "tm")
	 || (str == "cmsghdr")
	 || (str == "msghdr")
	 || (str == "rpcent")
	 || (str == "random_data")
	 || (str == "drand48_data")
	 || (str == "termios")
	 || (str == "iovec")
	 || (str == "file_handle")
	 || (str == "lconv")
	 || (str == "__locale_struct")
	 || (str == "aliasent")
	 || (str == "fstab")
	 || (str == "group")
	 || (str == "hostent")
	 || (str == "protoent")
	 || (str == "passwd")
	 || (str == "spwd")
	 || (str == "ttyent")
	 || (str == "utmp")
	 || (str == "utmpx")
	 || (str == "ifaddrs")
	 || (str == "statfs")
	 || (str == "statfs64")
	 || (str == "statvfs")
	 || (str == "timeb")
	 || (str == "_ftsent")
	 || (str == "sysinfo")
	 || (str == "rlimit")
	 || (str == "rlimit64")
	 || (str == "rusage")
	 || (str == "entry")
	 || (str == "pollfd")
	 || (str == "re_pattern_buffer")
	 || (str == "sembuf")
	 || (str == "tms")
	 || (str == "utsname")
	 || (str == "utimbuf")
	// ncurses
	 || (str == "_win_st")
	 
	 || (str == "cchar_t")
	) {
		// FILE*, fpos_t*, ...
		return 'p';
	} else if (str == "__va_list_tag") {
		return 'A';
	} else {
		return 0;
	}*/
	ALL
}
#undef END
#undef TYPEDEF
#undef STRUCT2
#undef STRUCT
#undef START

#define START()
#define STRUCT(s, ret) if (str == s) { return ret; } else
#define STRUCT2(s, ret, c) if (str == s) { return ret; } else
#define TYPEDEF(s, ret) if (str == s) { return ret; } else
#define END() return "";
const char *ptr2str(const std::string &str) {
	/*if (str == "_IO_FILE") {
		return "a FILE";
	} else if (str == "_G_fpos_t") {
		return "a file position";
	} else if (str == "sockaddr") {
		return "a socket address";
	} else if (str == "itimerspec") {
		return "an itimerspec";
	} else if (str == "timespec") {
		return "a timespec";
	} else if (str == "itimerval") {
		return "an itimerval";
	} else if (str == "timeval") {
		return "a timeval";
	} else if (str == "timex") {
		return "a timex";
	} else if (str == "timezone") {
		return "a timezone";
	} else if (str == "dirent") {
		return "a dirent";
	} else if (str == "dirent64") {
		return "a dirent64";
	} else if (str == "__dirstream") {
		return "a dir stream";
	} else if (str == "tm") {
		return "a time structure (tm)";
	} else if (str == "cmsghdr") {
		return "a cmsghdr";
	} else if (str == "msghdr") {
		return "a msghdr";
	} else if (str == "rpcent") {
		return "an rpcent";
	} else if (str == "random_data") {
		return "a random_data structure";
	} else if (str == "drand48_data") {
		return "a drand48_data structure";
	} else if (str == "termios") {
		return "a termios";
	} else if (str == "iovec") {
		return "an iovec";
	} else if (str == "file_handle") {
		return "a file handle";
	} else if (str == "lconv") {
		return "an lconv";
	} else if (str == "__locale_struct") {
		return "a locale structure";
	} else if (str == "aliasent") {
		return "an alias";
	} else if (str == "fstab") {
		return "an fstab";
	} else if (str == "group") {
		return "a group";
	} else if (str == "hostent") {
		return "a hostent";
	} else if (str == "protoent") {
		return "a protoent";
	} else if (str == "passwd") {
		return "a password";
	} else if (str == "spwd") {
		return "an spwd";
	} else if (str == "ttyent") {
		return "a ttyent";
	} else if (str == "utmp") {
		return "an utmp structure";
	} else if (str == "utmpx") {
		return "an utmpx structure";
	} else if (str == "ifaddrs") {
		return "an ifaddrs structure";
	} else if (str == "statfs") {
		return "a statfs structure";
	} else if (str == "statfs64") {
		return "a statfs64 structure";
	} else if (str == "statvfs") {
		return "a statvfs structure";
	} else if (str == "statvfs64") {
		return "a statvfs64 structure";
	} else if (str == "timeb") {
		return "a timeb structure";
	} else if (str == "_ftsent") {
		return "an _ftsent structure";
	} else if (str == "sysinfo") {
		return "a sysinfo structure";
	} else if (str == "rlimit") {
		return "an rlimit structure";
	} else if (str == "rlimit64") {
		return "an rlimit64 structure";
	} else if (str == "rusage") {
		return "an rusage structure";
	} else if (str == "entry") {
		return "an entry structure";
	} else if (str == "pollfd") {
		return "a pollfd structure";
	} else if (str == "re_pattern_buffer") {
		return "a re_pattern_buffer structure";
	} else if (str == "sembuf") {
		return "a sembuf structure";
	} else if (str == "tms") {
		return "a tms structure";
	} else if (str == "utsname") {
		return "an utsname structure";
	} else if (str == "utimbuf") {
		return "an utimbuf structure";
	} else if (str == "__va_list_tag") {
		return "__va_list_tag (aka, a va_list)";
	// ncurses
	} else if (str == "_win_st") {
		return "a _win_st structure";
		
	} else if (str == "cchar_t") {
		return "a cchar_t";
	} else return "";*/
	ALL
}
#undef END
#undef TYPEDEF
#undef STRUCT2
#undef STRUCT
#undef START