P99
p99_id.h
Go to the documentation of this file.
1 /* This may look like nonsense, but it really is -*- mode: C; coding: utf-8 -*- */
2 /* */
3 /* Except for parts copied from previous work and as explicitly stated below, */
4 /* the authors and copyright holders for this work are as follows: */
5 /* (C) copyright 2010-2013 Jens Gustedt, INRIA, France */
6 /* (C) copyright 2012 William Morris */
7 /* */
8 /* This file is free software; it is part of the P99 project. */
9 /* */
10 /* Licensed under the Apache License, Version 2.0 (the "License"); */
11 /* you may not use this file except in compliance with the License. */
12 /* You may obtain a copy of the License at */
13 /* */
14 /* http://www.apache.org/licenses/LICENSE-2.0 */
15 /* */
16 /* Unless required by applicable law or agreed to in writing, software */
17 /* distributed under the License is distributed on an "AS IS" BASIS, */
18 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
19 /* See the License for the specific language governing permissions and */
20 /* limitations under the License. */
21 /* */
22 #ifndef P99_ID_H_
23 # define P99_ID_H_
24 
25 #include "p99_if.h"
26 
38 #define P00_DOCUMENT_ID(X)
40 P00_DOCUMENT_ID(11)
41 #define P99_ID_11 0
42 
43 P00_DOCUMENT_ID(13)
44 #define P99_ID_13 0
45 
46 P00_DOCUMENT_ID(15)
47 #define P99_ID_15 0
48 
49 P00_DOCUMENT_ID(16)
50 #define P99_ID_16 0
51 
52 #define P00_ALPH_0 0
53 #define P00_ALPH_1 1
54 #define P00_ALPH_2 2
55 #define P00_ALPH_3 3
56 #define P00_ALPH_4 4
57 #define P00_ALPH_5 5
58 #define P00_ALPH_6 6
59 #define P00_ALPH_7 7
60 #define P00_ALPH_8 8
61 #define P00_ALPH_9 9
62 #define P00_ALPH_10 A
63 #define P00_ALPH_11 B
64 #define P00_ALPH_12 C
65 #define P00_ALPH_13 D
66 #define P00_ALPH_14 E
67 #define P00_ALPH_15 F
68 #define P00_ALPH_16 G
69 #define P00_ALPH_17 H
70 #define P00_ALPH_18 I
71 #define P00_ALPH_19 J
72 #define P00_ALPH_20 K
73 #define P00_ALPH_21 L
74 #define P00_ALPH_22 M
75 #define P00_ALPH_23 N
76 #define P00_ALPH_24 O
77 #define P00_ALPH_25 P
78 #define P00_ALPH_26 Q
79 #define P00_ALPH_27 R
80 #define P00_ALPH_28 S
81 #define P00_ALPH_29 T
82 #define P00_ALPH_30 U
83 #define P00_ALPH_31 V
84 #define P00_ALPH_32 W
85 #define P00_ALPH_33 X
86 #define P00_ALPH_34 Y
87 #define P00_ALPH_35 Z
88 
89 
90 
91 #define P00_ALPH_(A, X) P99_PASTE2(A, X)
92 #define P00_ALPH(X) P00_ALPH_(P00_ALPH_, X)
93 
94 #define P99_ID_11_ P00_ALPH(P99_ID_11)
95 #define P99_ID_13_ P00_ALPH(P99_ID_13)
96 #define P99_ID_15_ P00_ALPH(P99_ID_15)
97 #define P99_ID_16_ P00_ALPH(P99_ID_16)
98 
99 #define P99_ID() P99_PASTE4(P99_ID_11_, P99_ID_13_, P99_ID_15_, P99_ID_16_)
100 
107 #define P99_FILENO() P99_PASTE2(0x, P99_ID(), U)
108 
116 #define P99_FILEID(...) P99_PASTID(p00_fileid, P99_ID(), __VA_ARGS__)
117 
125 #define P99_LINENO() P99_PASTE4(0x, __LINE__, P99_ID(), ULL)
126 
141 #define P99_LINEID(...) P99_PASTID(p00_lineid, __LINE__, P99_ID(), __VA_ARGS__)
142 
143 #ifndef P00_UNIQ
144 # if __COUNTER__ || __COUNTER__
145 # define P00_UNIQ __COUNTER__
146 # else
147 # define P00_UNIQ p00_no_counter_feature
148 # endif
149 #endif
150 
197 #define P99_UNIQ(...) P99_IF_EMPTY(__VA_ARGS__)(P99_LINEID(P00_UNIQ, uniq))(P99_LINEID(P00_UNIQ, uniq, __VA_ARGS__))
198 
199 #ifdef P00_DOXYGEN
200 
208 # define P99_ADVANCE_ID P99_ADVANCE_ID
209 #else
210 # define P99_ADVANCE_ID "p99_id.h"
211 #endif
212 
213 #endif
214 
215 
216 #if P99_ID_11 >= 10
217 # undef P99_ID_11
218 # define P99_ID_11 0
219 #elif P99_ID_11 == 0
220 # undef P99_ID_11
221 # define P99_ID_11 1
222 #elif P99_ID_11 == 1
223 # undef P99_ID_11
224 # define P99_ID_11 2
225 #elif P99_ID_11 == 2
226 # undef P99_ID_11
227 # define P99_ID_11 3
228 #elif P99_ID_11 == 3
229 # undef P99_ID_11
230 # define P99_ID_11 4
231 #elif P99_ID_11 == 4
232 # undef P99_ID_11
233 # define P99_ID_11 5
234 #elif P99_ID_11 == 5
235 # undef P99_ID_11
236 # define P99_ID_11 6
237 #elif P99_ID_11 == 6
238 # undef P99_ID_11
239 # define P99_ID_11 7
240 #elif P99_ID_11 == 7
241 # undef P99_ID_11
242 # define P99_ID_11 8
243 #elif P99_ID_11 == 8
244 # undef P99_ID_11
245 # define P99_ID_11 9
246 #elif P99_ID_11 == 9
247 # undef P99_ID_11
248 # define P99_ID_11 10
249 #elif P99_ID_11 == 10
250 # undef P99_ID_11
251 # define P99_ID_11 11
252 #elif P99_ID_11 == 11
253 # undef P99_ID_11
254 # define P99_ID_11 12
255 #elif P99_ID_11 == 12
256 # undef P99_ID_11
257 # define P99_ID_11 13
258 #elif P99_ID_11 == 13
259 # undef P99_ID_11
260 # define P99_ID_11 14
261 #elif P99_ID_11 == 14
262 # undef P99_ID_11
263 # define P99_ID_11 15
264 #elif P99_ID_11 == 15
265 # undef P99_ID_11
266 # define P99_ID_11 16
267 #elif P99_ID_11 == 16
268 # undef P99_ID_11
269 # define P99_ID_11 17
270 #elif P99_ID_11 == 17
271 # undef P99_ID_11
272 # define P99_ID_11 18
273 #elif P99_ID_11 == 18
274 # undef P99_ID_11
275 # define P99_ID_11 19
276 #elif P99_ID_11 == 19
277 # undef P99_ID_11
278 # define P99_ID_11 20
279 #endif
280 
281 #if P99_ID_13 >= 12
282 # undef P99_ID_13
283 # define P99_ID_13 0
284 #elif P99_ID_13 == 0
285 # undef P99_ID_13
286 # define P99_ID_13 1
287 #elif P99_ID_13 == 1
288 # undef P99_ID_13
289 # define P99_ID_13 2
290 #elif P99_ID_13 == 2
291 # undef P99_ID_13
292 # define P99_ID_13 3
293 #elif P99_ID_13 == 3
294 # undef P99_ID_13
295 # define P99_ID_13 4
296 #elif P99_ID_13 == 4
297 # undef P99_ID_13
298 # define P99_ID_13 5
299 #elif P99_ID_13 == 5
300 # undef P99_ID_13
301 # define P99_ID_13 6
302 #elif P99_ID_13 == 6
303 # undef P99_ID_13
304 # define P99_ID_13 7
305 #elif P99_ID_13 == 7
306 # undef P99_ID_13
307 # define P99_ID_13 8
308 #elif P99_ID_13 == 8
309 # undef P99_ID_13
310 # define P99_ID_13 9
311 #elif P99_ID_13 == 9
312 # undef P99_ID_13
313 # define P99_ID_13 10
314 #elif P99_ID_13 == 10
315 # undef P99_ID_13
316 # define P99_ID_13 11
317 #elif P99_ID_13 == 11
318 # undef P99_ID_13
319 # define P99_ID_13 12
320 #elif P99_ID_13 == 12
321 # undef P99_ID_13
322 # define P99_ID_13 13
323 #elif P99_ID_13 == 13
324 # undef P99_ID_13
325 # define P99_ID_13 14
326 #elif P99_ID_13 == 14
327 # undef P99_ID_13
328 # define P99_ID_13 15
329 #elif P99_ID_13 == 15
330 # undef P99_ID_13
331 # define P99_ID_13 16
332 #elif P99_ID_13 == 16
333 # undef P99_ID_13
334 # define P99_ID_13 17
335 #elif P99_ID_13 == 17
336 # undef P99_ID_13
337 # define P99_ID_13 18
338 #elif P99_ID_13 == 18
339 # undef P99_ID_13
340 # define P99_ID_13 19
341 #elif P99_ID_13 == 19
342 # undef P99_ID_13
343 # define P99_ID_13 20
344 #endif
345 
346 #if P99_ID_15 >= 14
347 # undef P99_ID_15
348 # define P99_ID_15 0
349 #elif P99_ID_15 == 0
350 # undef P99_ID_15
351 # define P99_ID_15 1
352 #elif P99_ID_15 == 1
353 # undef P99_ID_15
354 # define P99_ID_15 2
355 #elif P99_ID_15 == 2
356 # undef P99_ID_15
357 # define P99_ID_15 3
358 #elif P99_ID_15 == 3
359 # undef P99_ID_15
360 # define P99_ID_15 4
361 #elif P99_ID_15 == 4
362 # undef P99_ID_15
363 # define P99_ID_15 5
364 #elif P99_ID_15 == 5
365 # undef P99_ID_15
366 # define P99_ID_15 6
367 #elif P99_ID_15 == 6
368 # undef P99_ID_15
369 # define P99_ID_15 7
370 #elif P99_ID_15 == 7
371 # undef P99_ID_15
372 # define P99_ID_15 8
373 #elif P99_ID_15 == 8
374 # undef P99_ID_15
375 # define P99_ID_15 9
376 #elif P99_ID_15 == 9
377 # undef P99_ID_15
378 # define P99_ID_15 10
379 #elif P99_ID_15 == 10
380 # undef P99_ID_15
381 # define P99_ID_15 11
382 #elif P99_ID_15 == 11
383 # undef P99_ID_15
384 # define P99_ID_15 12
385 #elif P99_ID_15 == 12
386 # undef P99_ID_15
387 # define P99_ID_15 13
388 #elif P99_ID_15 == 13
389 # undef P99_ID_15
390 # define P99_ID_15 14
391 #elif P99_ID_15 == 14
392 # undef P99_ID_15
393 # define P99_ID_15 15
394 #elif P99_ID_15 == 15
395 # undef P99_ID_15
396 # define P99_ID_15 16
397 #elif P99_ID_15 == 16
398 # undef P99_ID_15
399 # define P99_ID_15 17
400 #elif P99_ID_15 == 17
401 # undef P99_ID_15
402 # define P99_ID_15 18
403 #elif P99_ID_15 == 18
404 # undef P99_ID_15
405 # define P99_ID_15 19
406 #elif P99_ID_15 == 19
407 # undef P99_ID_15
408 # define P99_ID_15 20
409 #endif
410 
411 #if P99_ID_16 >= 15
412 # undef P99_ID_16
413 # define P99_ID_16 0
414 #elif P99_ID_16 == 0
415 # undef P99_ID_16
416 # define P99_ID_16 1
417 #elif P99_ID_16 == 1
418 # undef P99_ID_16
419 # define P99_ID_16 2
420 #elif P99_ID_16 == 2
421 # undef P99_ID_16
422 # define P99_ID_16 3
423 #elif P99_ID_16 == 3
424 # undef P99_ID_16
425 # define P99_ID_16 4
426 #elif P99_ID_16 == 4
427 # undef P99_ID_16
428 # define P99_ID_16 5
429 #elif P99_ID_16 == 5
430 # undef P99_ID_16
431 # define P99_ID_16 6
432 #elif P99_ID_16 == 6
433 # undef P99_ID_16
434 # define P99_ID_16 7
435 #elif P99_ID_16 == 7
436 # undef P99_ID_16
437 # define P99_ID_16 8
438 #elif P99_ID_16 == 8
439 # undef P99_ID_16
440 # define P99_ID_16 9
441 #elif P99_ID_16 == 9
442 # undef P99_ID_16
443 # define P99_ID_16 10
444 #elif P99_ID_16 == 10
445 # undef P99_ID_16
446 # define P99_ID_16 11
447 #elif P99_ID_16 == 11
448 # undef P99_ID_16
449 # define P99_ID_16 12
450 #elif P99_ID_16 == 12
451 # undef P99_ID_16
452 # define P99_ID_16 13
453 #elif P99_ID_16 == 13
454 # undef P99_ID_16
455 # define P99_ID_16 14
456 #elif P99_ID_16 == 14
457 # undef P99_ID_16
458 # define P99_ID_16 15
459 #elif P99_ID_16 == 15
460 # undef P99_ID_16
461 # define P99_ID_16 16
462 #elif P99_ID_16 == 16
463 # undef P99_ID_16
464 # define P99_ID_16 17
465 #elif P99_ID_16 == 17
466 # undef P99_ID_16
467 # define P99_ID_16 18
468 #elif P99_ID_16 == 18
469 # undef P99_ID_16
470 # define P99_ID_16 19
471 #elif P99_ID_16 == 19
472 # undef P99_ID_16
473 # define P99_ID_16 20
474 #endif
p99_if.h
preprocessor conditionals to use inside macros