~ubuntu-branches/ubuntu/trusty/libsereal-encoder-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to const-c.inc

  • Committer: Package Import Robot
  • Author(s): Alexandre Mestiashvili
  • Date: 2013-02-20 08:29:14 UTC
  • Revision ID: package-import@ubuntu.com-20130220082914-dljb6eixvtj2m1v2
Tags: upstream-0.31
ImportĀ upstreamĀ versionĀ 0.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define PERL_constant_NOTFOUND  1
 
2
#define PERL_constant_NOTDEF    2
 
3
#define PERL_constant_ISIV      3
 
4
#define PERL_constant_ISNO      4
 
5
#define PERL_constant_ISNV      5
 
6
#define PERL_constant_ISPV      6
 
7
#define PERL_constant_ISPVN     7
 
8
#define PERL_constant_ISSV      8
 
9
#define PERL_constant_ISUNDEF   9
 
10
#define PERL_constant_ISUV      10
 
11
#define PERL_constant_ISYES     11
 
12
 
 
13
#ifndef NVTYPE
 
14
typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it.  */
 
15
#endif
 
16
#ifndef aTHX_
 
17
#define aTHX_ /* 5.6 or later define this for threading support.  */
 
18
#endif
 
19
#ifndef pTHX_
 
20
#define pTHX_ /* 5.6 or later define this for threading support.  */
 
21
#endif
 
22
 
 
23
static int
 
24
constant_11 (pTHX_ const char *name, IV *iv_return) {
 
25
  /* When generated this function returned values for the list of names given
 
26
     here.  However, subsequent manual editing may have added or removed some.
 
27
     SRL_HDR_NEG SRL_HDR_PAD SRL_HDR_POS */
 
28
  /* Offset 9 gives the best switch position.  */
 
29
  switch (name[9]) {
 
30
  case 'A':
 
31
    if (memEQ(name, "SRL_HDR_PAD", 11)) {
 
32
    /*                        ^        */
 
33
#ifdef SRL_HDR_PAD
 
34
      *iv_return = SRL_HDR_PAD;
 
35
      return PERL_constant_ISIV;
 
36
#else
 
37
      return PERL_constant_NOTDEF;
 
38
#endif
 
39
    }
 
40
    break;
 
41
  case 'E':
 
42
    if (memEQ(name, "SRL_HDR_NEG", 11)) {
 
43
    /*                        ^        */
 
44
#ifdef SRL_HDR_NEG
 
45
      *iv_return = SRL_HDR_NEG;
 
46
      return PERL_constant_ISIV;
 
47
#else
 
48
      return PERL_constant_NOTDEF;
 
49
#endif
 
50
    }
 
51
    break;
 
52
  case 'O':
 
53
    if (memEQ(name, "SRL_HDR_POS", 11)) {
 
54
    /*                        ^        */
 
55
#ifdef SRL_HDR_POS
 
56
      *iv_return = SRL_HDR_POS;
 
57
      return PERL_constant_ISIV;
 
58
#else
 
59
      return PERL_constant_NOTDEF;
 
60
#endif
 
61
    }
 
62
    break;
 
63
  }
 
64
  return PERL_constant_NOTFOUND;
 
65
}
 
66
 
 
67
static int
 
68
constant_12 (pTHX_ const char *name, IV *iv_return) {
 
69
  /* When generated this function returned values for the list of names given
 
70
     here.  However, subsequent manual editing may have added or removed some.
 
71
     SRL_HDR_COPY SRL_HDR_HASH SRL_HDR_MANY SRL_HDR_REFN SRL_HDR_REFP
 
72
     SRL_HDR_TRUE */
 
73
  /* Offset 10 gives the best switch position.  */
 
74
  switch (name[10]) {
 
75
  case 'F':
 
76
    if (memEQ(name, "SRL_HDR_REFN", 12)) {
 
77
    /*                         ^        */
 
78
#ifdef SRL_HDR_REFN
 
79
      *iv_return = SRL_HDR_REFN;
 
80
      return PERL_constant_ISIV;
 
81
#else
 
82
      return PERL_constant_NOTDEF;
 
83
#endif
 
84
    }
 
85
    if (memEQ(name, "SRL_HDR_REFP", 12)) {
 
86
    /*                         ^        */
 
87
#ifdef SRL_HDR_REFP
 
88
      *iv_return = SRL_HDR_REFP;
 
89
      return PERL_constant_ISIV;
 
90
#else
 
91
      return PERL_constant_NOTDEF;
 
92
#endif
 
93
    }
 
94
    break;
 
95
  case 'N':
 
96
    if (memEQ(name, "SRL_HDR_MANY", 12)) {
 
97
    /*                         ^        */
 
98
#ifdef SRL_HDR_MANY
 
99
      *iv_return = SRL_HDR_MANY;
 
100
      return PERL_constant_ISIV;
 
101
#else
 
102
      return PERL_constant_NOTDEF;
 
103
#endif
 
104
    }
 
105
    break;
 
106
  case 'P':
 
107
    if (memEQ(name, "SRL_HDR_COPY", 12)) {
 
108
    /*                         ^        */
 
109
#ifdef SRL_HDR_COPY
 
110
      *iv_return = SRL_HDR_COPY;
 
111
      return PERL_constant_ISIV;
 
112
#else
 
113
      return PERL_constant_NOTDEF;
 
114
#endif
 
115
    }
 
116
    break;
 
117
  case 'S':
 
118
    if (memEQ(name, "SRL_HDR_HASH", 12)) {
 
119
    /*                         ^        */
 
120
#ifdef SRL_HDR_HASH
 
121
      *iv_return = SRL_HDR_HASH;
 
122
      return PERL_constant_ISIV;
 
123
#else
 
124
      return PERL_constant_NOTDEF;
 
125
#endif
 
126
    }
 
127
    break;
 
128
  case 'U':
 
129
    if (memEQ(name, "SRL_HDR_TRUE", 12)) {
 
130
    /*                         ^        */
 
131
#ifdef SRL_HDR_TRUE
 
132
      *iv_return = SRL_HDR_TRUE;
 
133
      return PERL_constant_ISIV;
 
134
#else
 
135
      return PERL_constant_NOTDEF;
 
136
#endif
 
137
    }
 
138
    break;
 
139
  }
 
140
  return PERL_constant_NOTFOUND;
 
141
}
 
142
 
 
143
static int
 
144
constant_13 (pTHX_ const char *name, IV *iv_return) {
 
145
  /* When generated this function returned values for the list of names given
 
146
     here.  However, subsequent manual editing may have added or removed some.
 
147
     SRL_HDR_ALIAS SRL_HDR_ARRAY SRL_HDR_FALSE SRL_HDR_FLOAT SRL_HDR_UNDEF */
 
148
  /* Offset 10 gives the best switch position.  */
 
149
  switch (name[10]) {
 
150
  case 'D':
 
151
    if (memEQ(name, "SRL_HDR_UNDEF", 13)) {
 
152
    /*                         ^         */
 
153
#ifdef SRL_HDR_UNDEF
 
154
      *iv_return = SRL_HDR_UNDEF;
 
155
      return PERL_constant_ISIV;
 
156
#else
 
157
      return PERL_constant_NOTDEF;
 
158
#endif
 
159
    }
 
160
    break;
 
161
  case 'I':
 
162
    if (memEQ(name, "SRL_HDR_ALIAS", 13)) {
 
163
    /*                         ^         */
 
164
#ifdef SRL_HDR_ALIAS
 
165
      *iv_return = SRL_HDR_ALIAS;
 
166
      return PERL_constant_ISIV;
 
167
#else
 
168
      return PERL_constant_NOTDEF;
 
169
#endif
 
170
    }
 
171
    break;
 
172
  case 'L':
 
173
    if (memEQ(name, "SRL_HDR_FALSE", 13)) {
 
174
    /*                         ^         */
 
175
#ifdef SRL_HDR_FALSE
 
176
      *iv_return = SRL_HDR_FALSE;
 
177
      return PERL_constant_ISIV;
 
178
#else
 
179
      return PERL_constant_NOTDEF;
 
180
#endif
 
181
    }
 
182
    break;
 
183
  case 'O':
 
184
    if (memEQ(name, "SRL_HDR_FLOAT", 13)) {
 
185
    /*                         ^         */
 
186
#ifdef SRL_HDR_FLOAT
 
187
      *iv_return = SRL_HDR_FLOAT;
 
188
      return PERL_constant_ISIV;
 
189
#else
 
190
      return PERL_constant_NOTDEF;
 
191
#endif
 
192
    }
 
193
    break;
 
194
  case 'R':
 
195
    if (memEQ(name, "SRL_HDR_ARRAY", 13)) {
 
196
    /*                         ^         */
 
197
#ifdef SRL_HDR_ARRAY
 
198
      *iv_return = SRL_HDR_ARRAY;
 
199
      return PERL_constant_ISIV;
 
200
#else
 
201
      return PERL_constant_NOTDEF;
 
202
#endif
 
203
    }
 
204
    break;
 
205
  }
 
206
  return PERL_constant_NOTFOUND;
 
207
}
 
208
 
 
209
static int
 
210
constant_14 (pTHX_ const char *name, IV *iv_return) {
 
211
  /* When generated this function returned values for the list of names given
 
212
     here.  However, subsequent manual editing may have added or removed some.
 
213
     SRL_HDR_BINARY SRL_HDR_DOUBLE SRL_HDR_EXTEND SRL_HDR_OBJECT SRL_HDR_REGEXP
 
214
     SRL_HDR_VARINT SRL_HDR_WEAKEN SRL_HDR_ZIGZAG */
 
215
  /* Offset 8 gives the best switch position.  */
 
216
  switch (name[8]) {
 
217
  case 'B':
 
218
    if (memEQ(name, "SRL_HDR_BINARY", 14)) {
 
219
    /*                       ^            */
 
220
#ifdef SRL_HDR_BINARY
 
221
      *iv_return = SRL_HDR_BINARY;
 
222
      return PERL_constant_ISIV;
 
223
#else
 
224
      return PERL_constant_NOTDEF;
 
225
#endif
 
226
    }
 
227
    break;
 
228
  case 'D':
 
229
    if (memEQ(name, "SRL_HDR_DOUBLE", 14)) {
 
230
    /*                       ^            */
 
231
#ifdef SRL_HDR_DOUBLE
 
232
      *iv_return = SRL_HDR_DOUBLE;
 
233
      return PERL_constant_ISIV;
 
234
#else
 
235
      return PERL_constant_NOTDEF;
 
236
#endif
 
237
    }
 
238
    break;
 
239
  case 'E':
 
240
    if (memEQ(name, "SRL_HDR_EXTEND", 14)) {
 
241
    /*                       ^            */
 
242
#ifdef SRL_HDR_EXTEND
 
243
      *iv_return = SRL_HDR_EXTEND;
 
244
      return PERL_constant_ISIV;
 
245
#else
 
246
      return PERL_constant_NOTDEF;
 
247
#endif
 
248
    }
 
249
    break;
 
250
  case 'O':
 
251
    if (memEQ(name, "SRL_HDR_OBJECT", 14)) {
 
252
    /*                       ^            */
 
253
#ifdef SRL_HDR_OBJECT
 
254
      *iv_return = SRL_HDR_OBJECT;
 
255
      return PERL_constant_ISIV;
 
256
#else
 
257
      return PERL_constant_NOTDEF;
 
258
#endif
 
259
    }
 
260
    break;
 
261
  case 'R':
 
262
    if (memEQ(name, "SRL_HDR_REGEXP", 14)) {
 
263
    /*                       ^            */
 
264
#ifdef SRL_HDR_REGEXP
 
265
      *iv_return = SRL_HDR_REGEXP;
 
266
      return PERL_constant_ISIV;
 
267
#else
 
268
      return PERL_constant_NOTDEF;
 
269
#endif
 
270
    }
 
271
    break;
 
272
  case 'V':
 
273
    if (memEQ(name, "SRL_HDR_VARINT", 14)) {
 
274
    /*                       ^            */
 
275
#ifdef SRL_HDR_VARINT
 
276
      *iv_return = SRL_HDR_VARINT;
 
277
      return PERL_constant_ISIV;
 
278
#else
 
279
      return PERL_constant_NOTDEF;
 
280
#endif
 
281
    }
 
282
    break;
 
283
  case 'W':
 
284
    if (memEQ(name, "SRL_HDR_WEAKEN", 14)) {
 
285
    /*                       ^            */
 
286
#ifdef SRL_HDR_WEAKEN
 
287
      *iv_return = SRL_HDR_WEAKEN;
 
288
      return PERL_constant_ISIV;
 
289
#else
 
290
      return PERL_constant_NOTDEF;
 
291
#endif
 
292
    }
 
293
    break;
 
294
  case 'Z':
 
295
    if (memEQ(name, "SRL_HDR_ZIGZAG", 14)) {
 
296
    /*                       ^            */
 
297
#ifdef SRL_HDR_ZIGZAG
 
298
      *iv_return = SRL_HDR_ZIGZAG;
 
299
      return PERL_constant_ISIV;
 
300
#else
 
301
      return PERL_constant_NOTDEF;
 
302
#endif
 
303
    }
 
304
    break;
 
305
  }
 
306
  return PERL_constant_NOTFOUND;
 
307
}
 
308
 
 
309
static int
 
310
constant_15 (pTHX_ const char *name, IV *iv_return) {
 
311
  /* When generated this function returned values for the list of names given
 
312
     here.  However, subsequent manual editing may have added or removed some.
 
313
     SRL_HDR_HASHREF SRL_HDR_NEG_LOW SRL_HDR_OBJECTV SRL_HDR_POS_LOW */
 
314
  /* Offset 8 gives the best switch position.  */
 
315
  switch (name[8]) {
 
316
  case 'H':
 
317
    if (memEQ(name, "SRL_HDR_HASHREF", 15)) {
 
318
    /*                       ^             */
 
319
#ifdef SRL_HDR_HASHREF
 
320
      *iv_return = SRL_HDR_HASHREF;
 
321
      return PERL_constant_ISIV;
 
322
#else
 
323
      return PERL_constant_NOTDEF;
 
324
#endif
 
325
    }
 
326
    break;
 
327
  case 'N':
 
328
    if (memEQ(name, "SRL_HDR_NEG_LOW", 15)) {
 
329
    /*                       ^             */
 
330
#ifdef SRL_HDR_NEG_LOW
 
331
      *iv_return = SRL_HDR_NEG_LOW;
 
332
      return PERL_constant_ISIV;
 
333
#else
 
334
      return PERL_constant_NOTDEF;
 
335
#endif
 
336
    }
 
337
    break;
 
338
  case 'O':
 
339
    if (memEQ(name, "SRL_HDR_OBJECTV", 15)) {
 
340
    /*                       ^             */
 
341
#ifdef SRL_HDR_OBJECTV
 
342
      *iv_return = SRL_HDR_OBJECTV;
 
343
      return PERL_constant_ISIV;
 
344
#else
 
345
      return PERL_constant_NOTDEF;
 
346
#endif
 
347
    }
 
348
    break;
 
349
  case 'P':
 
350
    if (memEQ(name, "SRL_HDR_POS_LOW", 15)) {
 
351
    /*                       ^             */
 
352
#ifdef SRL_HDR_POS_LOW
 
353
      *iv_return = SRL_HDR_POS_LOW;
 
354
      return PERL_constant_ISIV;
 
355
#else
 
356
      return PERL_constant_NOTDEF;
 
357
#endif
 
358
    }
 
359
    break;
 
360
  }
 
361
  return PERL_constant_NOTFOUND;
 
362
}
 
363
 
 
364
static int
 
365
constant_16 (pTHX_ const char *name, IV *iv_return) {
 
366
  /* When generated this function returned values for the list of names given
 
367
     here.  However, subsequent manual editing may have added or removed some.
 
368
     SRL_HDR_ARRAYREF SRL_HDR_NEG_HIGH SRL_HDR_POS_HIGH SRL_HDR_RESERVED
 
369
     SRL_HDR_STR_UTF8 SRL_NEG_MIN_SIZE SRL_POS_MAX_SIZE */
 
370
  /* Offset 8 gives the best switch position.  */
 
371
  switch (name[8]) {
 
372
  case 'A':
 
373
    if (memEQ(name, "SRL_HDR_ARRAYREF", 16)) {
 
374
    /*                       ^              */
 
375
#ifdef SRL_HDR_ARRAYREF
 
376
      *iv_return = SRL_HDR_ARRAYREF;
 
377
      return PERL_constant_ISIV;
 
378
#else
 
379
      return PERL_constant_NOTDEF;
 
380
#endif
 
381
    }
 
382
    break;
 
383
  case 'M':
 
384
    if (memEQ(name, "SRL_NEG_MIN_SIZE", 16)) {
 
385
    /*                       ^              */
 
386
#ifdef SRL_NEG_MIN_SIZE
 
387
      *iv_return = SRL_NEG_MIN_SIZE;
 
388
      return PERL_constant_ISIV;
 
389
#else
 
390
      return PERL_constant_NOTDEF;
 
391
#endif
 
392
    }
 
393
    if (memEQ(name, "SRL_POS_MAX_SIZE", 16)) {
 
394
    /*                       ^              */
 
395
#ifdef SRL_POS_MAX_SIZE
 
396
      *iv_return = SRL_POS_MAX_SIZE;
 
397
      return PERL_constant_ISIV;
 
398
#else
 
399
      return PERL_constant_NOTDEF;
 
400
#endif
 
401
    }
 
402
    break;
 
403
  case 'N':
 
404
    if (memEQ(name, "SRL_HDR_NEG_HIGH", 16)) {
 
405
    /*                       ^              */
 
406
#ifdef SRL_HDR_NEG_HIGH
 
407
      *iv_return = SRL_HDR_NEG_HIGH;
 
408
      return PERL_constant_ISIV;
 
409
#else
 
410
      return PERL_constant_NOTDEF;
 
411
#endif
 
412
    }
 
413
    break;
 
414
  case 'P':
 
415
    if (memEQ(name, "SRL_HDR_POS_HIGH", 16)) {
 
416
    /*                       ^              */
 
417
#ifdef SRL_HDR_POS_HIGH
 
418
      *iv_return = SRL_HDR_POS_HIGH;
 
419
      return PERL_constant_ISIV;
 
420
#else
 
421
      return PERL_constant_NOTDEF;
 
422
#endif
 
423
    }
 
424
    break;
 
425
  case 'R':
 
426
    if (memEQ(name, "SRL_HDR_RESERVED", 16)) {
 
427
    /*                       ^              */
 
428
#ifdef SRL_HDR_RESERVED
 
429
      *iv_return = SRL_HDR_RESERVED;
 
430
      return PERL_constant_ISIV;
 
431
#else
 
432
      return PERL_constant_NOTDEF;
 
433
#endif
 
434
    }
 
435
    break;
 
436
  case 'S':
 
437
    if (memEQ(name, "SRL_HDR_STR_UTF8", 16)) {
 
438
    /*                       ^              */
 
439
#ifdef SRL_HDR_STR_UTF8
 
440
      *iv_return = SRL_HDR_STR_UTF8;
 
441
      return PERL_constant_ISIV;
 
442
#else
 
443
      return PERL_constant_NOTDEF;
 
444
#endif
 
445
    }
 
446
    break;
 
447
  }
 
448
  return PERL_constant_NOTFOUND;
 
449
}
 
450
 
 
451
static int
 
452
constant_20 (pTHX_ const char *name, IV *iv_return) {
 
453
  /* When generated this function returned values for the list of names given
 
454
     here.  However, subsequent manual editing may have added or removed some.
 
455
     SRL_HDR_ARRAYREF_LOW SRL_HDR_HASHREF_HIGH SRL_HDR_PACKET_START
 
456
     SRL_HDR_RESERVED_LOW SRL_HDR_SHORT_BINARY SRL_PROTOCOL_VERSION */
 
457
  /* Offset 11 gives the best switch position.  */
 
458
  switch (name[11]) {
 
459
  case 'A':
 
460
    if (memEQ(name, "SRL_HDR_ARRAYREF_LOW", 20)) {
 
461
    /*                          ^               */
 
462
#ifdef SRL_HDR_ARRAYREF_LOW
 
463
      *iv_return = SRL_HDR_ARRAYREF_LOW;
 
464
      return PERL_constant_ISIV;
 
465
#else
 
466
      return PERL_constant_NOTDEF;
 
467
#endif
 
468
    }
 
469
    break;
 
470
  case 'E':
 
471
    if (memEQ(name, "SRL_HDR_RESERVED_LOW", 20)) {
 
472
    /*                          ^               */
 
473
#ifdef SRL_HDR_RESERVED_LOW
 
474
      *iv_return = SRL_HDR_RESERVED_LOW;
 
475
      return PERL_constant_ISIV;
 
476
#else
 
477
      return PERL_constant_NOTDEF;
 
478
#endif
 
479
    }
 
480
    break;
 
481
  case 'H':
 
482
    if (memEQ(name, "SRL_HDR_HASHREF_HIGH", 20)) {
 
483
    /*                          ^               */
 
484
#ifdef SRL_HDR_HASHREF_HIGH
 
485
      *iv_return = SRL_HDR_HASHREF_HIGH;
 
486
      return PERL_constant_ISIV;
 
487
#else
 
488
      return PERL_constant_NOTDEF;
 
489
#endif
 
490
    }
 
491
    break;
 
492
  case 'K':
 
493
    if (memEQ(name, "SRL_HDR_PACKET_START", 20)) {
 
494
    /*                          ^               */
 
495
#ifdef SRL_HDR_PACKET_START
 
496
      *iv_return = SRL_HDR_PACKET_START;
 
497
      return PERL_constant_ISIV;
 
498
#else
 
499
      return PERL_constant_NOTDEF;
 
500
#endif
 
501
    }
 
502
    break;
 
503
  case 'L':
 
504
    if (memEQ(name, "SRL_PROTOCOL_VERSION", 20)) {
 
505
    /*                          ^               */
 
506
#ifdef SRL_PROTOCOL_VERSION
 
507
      *iv_return = SRL_PROTOCOL_VERSION;
 
508
      return PERL_constant_ISIV;
 
509
#else
 
510
      return PERL_constant_NOTDEF;
 
511
#endif
 
512
    }
 
513
    break;
 
514
  case 'R':
 
515
    if (memEQ(name, "SRL_HDR_SHORT_BINARY", 20)) {
 
516
    /*                          ^               */
 
517
#ifdef SRL_HDR_SHORT_BINARY
 
518
      *iv_return = SRL_HDR_SHORT_BINARY;
 
519
      return PERL_constant_ISIV;
 
520
#else
 
521
      return PERL_constant_NOTDEF;
 
522
#endif
 
523
    }
 
524
    break;
 
525
  }
 
526
  return PERL_constant_NOTFOUND;
 
527
}
 
528
 
 
529
static int
 
530
constant_25 (pTHX_ const char *name, IV *iv_return) {
 
531
  /* When generated this function returned values for the list of names given
 
532
     here.  However, subsequent manual editing may have added or removed some.
 
533
     SRL_HDR_SHORT_BINARY_HIGH SRL_MASK_SHORT_BINARY_LEN
 
534
     SRL_PROTOCOL_ENCODING_RAW SRL_PROTOCOL_VERSION_BITS
 
535
     SRL_PROTOCOL_VERSION_MASK */
 
536
  /* Offset 24 gives the best switch position.  */
 
537
  switch (name[24]) {
 
538
  case 'H':
 
539
    if (memEQ(name, "SRL_HDR_SHORT_BINARY_HIG", 24)) {
 
540
    /*                                       H      */
 
541
#ifdef SRL_HDR_SHORT_BINARY_HIGH
 
542
      *iv_return = SRL_HDR_SHORT_BINARY_HIGH;
 
543
      return PERL_constant_ISIV;
 
544
#else
 
545
      return PERL_constant_NOTDEF;
 
546
#endif
 
547
    }
 
548
    break;
 
549
  case 'K':
 
550
    if (memEQ(name, "SRL_PROTOCOL_VERSION_MAS", 24)) {
 
551
    /*                                       K      */
 
552
#ifdef SRL_PROTOCOL_VERSION_MASK
 
553
      *iv_return = SRL_PROTOCOL_VERSION_MASK;
 
554
      return PERL_constant_ISIV;
 
555
#else
 
556
      return PERL_constant_NOTDEF;
 
557
#endif
 
558
    }
 
559
    break;
 
560
  case 'N':
 
561
    if (memEQ(name, "SRL_MASK_SHORT_BINARY_LE", 24)) {
 
562
    /*                                       N      */
 
563
#ifdef SRL_MASK_SHORT_BINARY_LEN
 
564
      *iv_return = SRL_MASK_SHORT_BINARY_LEN;
 
565
      return PERL_constant_ISIV;
 
566
#else
 
567
      return PERL_constant_NOTDEF;
 
568
#endif
 
569
    }
 
570
    break;
 
571
  case 'S':
 
572
    if (memEQ(name, "SRL_PROTOCOL_VERSION_BIT", 24)) {
 
573
    /*                                       S      */
 
574
#ifdef SRL_PROTOCOL_VERSION_BITS
 
575
      *iv_return = SRL_PROTOCOL_VERSION_BITS;
 
576
      return PERL_constant_ISIV;
 
577
#else
 
578
      return PERL_constant_NOTDEF;
 
579
#endif
 
580
    }
 
581
    break;
 
582
  case 'W':
 
583
    if (memEQ(name, "SRL_PROTOCOL_ENCODING_RA", 24)) {
 
584
    /*                                       W      */
 
585
#ifdef SRL_PROTOCOL_ENCODING_RAW
 
586
      *iv_return = SRL_PROTOCOL_ENCODING_RAW;
 
587
      return PERL_constant_ISIV;
 
588
#else
 
589
      return PERL_constant_NOTDEF;
 
590
#endif
 
591
    }
 
592
    break;
 
593
  }
 
594
  return PERL_constant_NOTFOUND;
 
595
}
 
596
 
 
597
static int
 
598
constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
 
599
  /* Initially switch on the length of the name.  */
 
600
  /* When generated this function returned values for the list of names given
 
601
     in this section of perl code.  Rather than manually editing these functions
 
602
     to add or remove constants, which would result in this comment and section
 
603
     of code becoming inaccurate, we recommend that you edit this section of
 
604
     code, and use it to regenerate a new set of constant functions which you
 
605
     then use to replace the originals.
 
606
 
 
607
     Regenerate these constant functions by feeding this entire source file to
 
608
     perl -x
 
609
 
 
610
#!/usr/bin/perl -w
 
611
use ExtUtils::Constant qw (constant_types C_constant XS_constant);
 
612
 
 
613
my $types = {map {($_, 1)} qw(IV)};
 
614
my @names = (qw(SRL_HDR_ALIAS SRL_HDR_ARRAY SRL_HDR_ARRAYREF
 
615
               SRL_HDR_ARRAYREF_HIGH SRL_HDR_ARRAYREF_LOW SRL_HDR_BINARY
 
616
               SRL_HDR_COPY SRL_HDR_DOUBLE SRL_HDR_EXTEND SRL_HDR_FALSE
 
617
               SRL_HDR_FLOAT SRL_HDR_HASH SRL_HDR_HASHREF SRL_HDR_HASHREF_HIGH
 
618
               SRL_HDR_HASHREF_LOW SRL_HDR_LONG_DOUBLE SRL_HDR_MANY SRL_HDR_NEG
 
619
               SRL_HDR_NEG_HIGH SRL_HDR_NEG_LOW SRL_HDR_OBJECT SRL_HDR_OBJECTV
 
620
               SRL_HDR_PACKET_START SRL_HDR_PAD SRL_HDR_POS SRL_HDR_POS_HIGH
 
621
               SRL_HDR_POS_LOW SRL_HDR_REFN SRL_HDR_REFP SRL_HDR_REGEXP
 
622
               SRL_HDR_RESERVED SRL_HDR_RESERVED_HIGH SRL_HDR_RESERVED_LOW
 
623
               SRL_HDR_SHORT_BINARY SRL_HDR_SHORT_BINARY_HIGH
 
624
               SRL_HDR_SHORT_BINARY_LOW SRL_HDR_STR_UTF8 SRL_HDR_TRACK_FLAG
 
625
               SRL_HDR_TRUE SRL_HDR_UNDEF SRL_HDR_VARINT SRL_HDR_WEAKEN
 
626
               SRL_HDR_ZIGZAG SRL_MAGIC_STRING_LILIPUTIAN
 
627
               SRL_MASK_ARRAYREF_COUNT SRL_MASK_HASHREF_COUNT
 
628
               SRL_MASK_SHORT_BINARY_LEN SRL_NEG_MIN_SIZE SRL_POS_MAX_SIZE
 
629
               SRL_PROTOCOL_ENCODING_MASK SRL_PROTOCOL_ENCODING_RAW
 
630
               SRL_PROTOCOL_ENCODING_SNAPPY
 
631
               SRL_PROTOCOL_ENCODING_SNAPPY_INCREMENTAL SRL_PROTOCOL_VERSION
 
632
               SRL_PROTOCOL_VERSION_BITS SRL_PROTOCOL_VERSION_MASK));
 
633
 
 
634
print constant_types(), "\n"; # macro defs
 
635
foreach (C_constant ("Sereal::Encoder::Constants", 'constant', 'IV', $types, undef, 3, @names) ) {
 
636
    print $_, "\n"; # C constant subs
 
637
}
 
638
print "\n#### XS Section:\n";
 
639
print XS_constant ("Sereal::Encoder::Constants", $types);
 
640
__END__
 
641
   */
 
642
 
 
643
  switch (len) {
 
644
  case 11:
 
645
    return constant_11 (aTHX_ name, iv_return);
 
646
    break;
 
647
  case 12:
 
648
    return constant_12 (aTHX_ name, iv_return);
 
649
    break;
 
650
  case 13:
 
651
    return constant_13 (aTHX_ name, iv_return);
 
652
    break;
 
653
  case 14:
 
654
    return constant_14 (aTHX_ name, iv_return);
 
655
    break;
 
656
  case 15:
 
657
    return constant_15 (aTHX_ name, iv_return);
 
658
    break;
 
659
  case 16:
 
660
    return constant_16 (aTHX_ name, iv_return);
 
661
    break;
 
662
  case 18:
 
663
    if (memEQ(name, "SRL_HDR_TRACK_FLAG", 18)) {
 
664
#ifdef SRL_HDR_TRACK_FLAG
 
665
      *iv_return = SRL_HDR_TRACK_FLAG;
 
666
      return PERL_constant_ISIV;
 
667
#else
 
668
      return PERL_constant_NOTDEF;
 
669
#endif
 
670
    }
 
671
    break;
 
672
  case 19:
 
673
    /* Names all of length 19.  */
 
674
    /* SRL_HDR_HASHREF_LOW SRL_HDR_LONG_DOUBLE */
 
675
    /* Offset 11 gives the best switch position.  */
 
676
    switch (name[11]) {
 
677
    case 'G':
 
678
      if (memEQ(name, "SRL_HDR_LONG_DOUBLE", 19)) {
 
679
      /*                          ^              */
 
680
#ifdef SRL_HDR_LONG_DOUBLE
 
681
        *iv_return = SRL_HDR_LONG_DOUBLE;
 
682
        return PERL_constant_ISIV;
 
683
#else
 
684
        return PERL_constant_NOTDEF;
 
685
#endif
 
686
      }
 
687
      break;
 
688
    case 'H':
 
689
      if (memEQ(name, "SRL_HDR_HASHREF_LOW", 19)) {
 
690
      /*                          ^              */
 
691
#ifdef SRL_HDR_HASHREF_LOW
 
692
        *iv_return = SRL_HDR_HASHREF_LOW;
 
693
        return PERL_constant_ISIV;
 
694
#else
 
695
        return PERL_constant_NOTDEF;
 
696
#endif
 
697
      }
 
698
      break;
 
699
    }
 
700
    break;
 
701
  case 20:
 
702
    return constant_20 (aTHX_ name, iv_return);
 
703
    break;
 
704
  case 21:
 
705
    /* Names all of length 21.  */
 
706
    /* SRL_HDR_ARRAYREF_HIGH SRL_HDR_RESERVED_HIGH */
 
707
    /* Offset 10 gives the best switch position.  */
 
708
    switch (name[10]) {
 
709
    case 'R':
 
710
      if (memEQ(name, "SRL_HDR_ARRAYREF_HIGH", 21)) {
 
711
      /*                         ^                 */
 
712
#ifdef SRL_HDR_ARRAYREF_HIGH
 
713
        *iv_return = SRL_HDR_ARRAYREF_HIGH;
 
714
        return PERL_constant_ISIV;
 
715
#else
 
716
        return PERL_constant_NOTDEF;
 
717
#endif
 
718
      }
 
719
      break;
 
720
    case 'S':
 
721
      if (memEQ(name, "SRL_HDR_RESERVED_HIGH", 21)) {
 
722
      /*                         ^                 */
 
723
#ifdef SRL_HDR_RESERVED_HIGH
 
724
        *iv_return = SRL_HDR_RESERVED_HIGH;
 
725
        return PERL_constant_ISIV;
 
726
#else
 
727
        return PERL_constant_NOTDEF;
 
728
#endif
 
729
      }
 
730
      break;
 
731
    }
 
732
    break;
 
733
  case 22:
 
734
    if (memEQ(name, "SRL_MASK_HASHREF_COUNT", 22)) {
 
735
#ifdef SRL_MASK_HASHREF_COUNT
 
736
      *iv_return = SRL_MASK_HASHREF_COUNT;
 
737
      return PERL_constant_ISIV;
 
738
#else
 
739
      return PERL_constant_NOTDEF;
 
740
#endif
 
741
    }
 
742
    break;
 
743
  case 23:
 
744
    if (memEQ(name, "SRL_MASK_ARRAYREF_COUNT", 23)) {
 
745
#ifdef SRL_MASK_ARRAYREF_COUNT
 
746
      *iv_return = SRL_MASK_ARRAYREF_COUNT;
 
747
      return PERL_constant_ISIV;
 
748
#else
 
749
      return PERL_constant_NOTDEF;
 
750
#endif
 
751
    }
 
752
    break;
 
753
  case 24:
 
754
    if (memEQ(name, "SRL_HDR_SHORT_BINARY_LOW", 24)) {
 
755
#ifdef SRL_HDR_SHORT_BINARY_LOW
 
756
      *iv_return = SRL_HDR_SHORT_BINARY_LOW;
 
757
      return PERL_constant_ISIV;
 
758
#else
 
759
      return PERL_constant_NOTDEF;
 
760
#endif
 
761
    }
 
762
    break;
 
763
  case 25:
 
764
    return constant_25 (aTHX_ name, iv_return);
 
765
    break;
 
766
  case 26:
 
767
    if (memEQ(name, "SRL_PROTOCOL_ENCODING_MASK", 26)) {
 
768
#ifdef SRL_PROTOCOL_ENCODING_MASK
 
769
      *iv_return = SRL_PROTOCOL_ENCODING_MASK;
 
770
      return PERL_constant_ISIV;
 
771
#else
 
772
      return PERL_constant_NOTDEF;
 
773
#endif
 
774
    }
 
775
    break;
 
776
  case 27:
 
777
    if (memEQ(name, "SRL_MAGIC_STRING_LILIPUTIAN", 27)) {
 
778
#ifdef SRL_MAGIC_STRING_LILIPUTIAN
 
779
      *iv_return = SRL_MAGIC_STRING_LILIPUTIAN;
 
780
      return PERL_constant_ISIV;
 
781
#else
 
782
      return PERL_constant_NOTDEF;
 
783
#endif
 
784
    }
 
785
    break;
 
786
  case 28:
 
787
    if (memEQ(name, "SRL_PROTOCOL_ENCODING_SNAPPY", 28)) {
 
788
#ifdef SRL_PROTOCOL_ENCODING_SNAPPY
 
789
      *iv_return = SRL_PROTOCOL_ENCODING_SNAPPY;
 
790
      return PERL_constant_ISIV;
 
791
#else
 
792
      return PERL_constant_NOTDEF;
 
793
#endif
 
794
    }
 
795
    break;
 
796
  case 40:
 
797
    if (memEQ(name, "SRL_PROTOCOL_ENCODING_SNAPPY_INCREMENTAL", 40)) {
 
798
#ifdef SRL_PROTOCOL_ENCODING_SNAPPY_INCREMENTAL
 
799
      *iv_return = SRL_PROTOCOL_ENCODING_SNAPPY_INCREMENTAL;
 
800
      return PERL_constant_ISIV;
 
801
#else
 
802
      return PERL_constant_NOTDEF;
 
803
#endif
 
804
    }
 
805
    break;
 
806
  }
 
807
  return PERL_constant_NOTFOUND;
 
808
}
 
809