File: constant.h

package info (click to toggle)
ldapjdk 4.20.0%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,708 kB
  • sloc: ansic: 44,727; java: 39,132; xml: 7,419; sh: 4,185; perl: 3,774; makefile: 1,681; cpp: 979
file content (973 lines) | stat: -rw-r--r-- 22,027 bytes parent folder | download | duplicates (8)
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
/*
 *******************************************************************************
 * $Id: constant.h,v 1.9 2007/06/19 11:27:05 gerv%gerv.net Exp $
 *
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is PerLDAP.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 2001
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Clayton Donley
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

/*
 * DESCRIPTION
 *    Constants.
 */
 
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
#endif

#include <ldap.h>

static int
not_here(s)
char *s;
{
    croak("%s not implemented on this architecture", s);
    return -1;
}

double
constant(name, arg)
char *name;
int arg;
{
    errno = 0;
    if (name[0] == 'L' && name[1] == 'D' && name[2] == 'A' && name[3] == 'P'
       && name[4] == '_')
    {
      switch (name[5]) {
       case 'A':
	if (strEQ(name, "LDAP_ADMINLIMIT_EXCEEDED"))
#ifdef LDAP_ADMINLIMIT_EXCEEDED
	    return LDAP_ADMINLIMIT_EXCEEDED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_AFFECTS_MULTIPLE_DSAS"))
#ifdef LDAP_AFFECTS_MULTIPLE_DSAS
	    return LDAP_AFFECTS_MULTIPLE_DSAS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_ALIAS_DEREF_PROBLEM"))
#ifdef LDAP_ALIAS_DEREF_PROBLEM
	    return LDAP_ALIAS_DEREF_PROBLEM;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_ALIAS_PROBLEM"))
#ifdef LDAP_ALIAS_PROBLEM
	    return LDAP_ALIAS_PROBLEM;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_ALREADY_EXISTS"))
#ifdef LDAP_ALREADY_EXISTS
	    return LDAP_ALREADY_EXISTS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_AUTH_METHOD_NOT_SUPPORTED"))
#ifdef LDAP_AUTH_METHOD_NOT_SUPPORTED
	    return LDAP_AUTH_METHOD_NOT_SUPPORTED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_AUTH_NONE"))
#ifdef LDAP_AUTH_NONE
	    return LDAP_AUTH_NONE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_AUTH_SASL"))
#ifdef LDAP_AUTH_SASL
	    return LDAP_AUTH_SASL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_AUTH_SIMPLE"))
#ifdef LDAP_AUTH_SIMPLE
	    return LDAP_AUTH_SIMPLE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_AUTH_UNKNOWN"))
#ifdef LDAP_AUTH_UNKNOWN
	    return LDAP_AUTH_UNKNOWN;
#else
	    goto not_there;
#endif
        break;
      case 'B':
	if (strEQ(name, "LDAP_BUSY"))
#ifdef LDAP_BUSY
	    return LDAP_BUSY;
#else
	    goto not_there;
#endif
	break;
      case 'C':
	if (strEQ(name, "LDAP_CACHE_CHECK"))
#ifdef LDAP_CACHE_CHECK
	    return LDAP_CACHE_CHECK;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CACHE_LOCALDB"))
#ifdef LDAP_CACHE_LOCALDB
	    return LDAP_CACHE_LOCALDB;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CACHE_POPULATE"))
#ifdef LDAP_CACHE_POPULATE
	    return LDAP_CACHE_POPULATE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CHANGETYPE_ADD"))
#ifdef LDAP_CHANGETYPE_ADD
	    return LDAP_CHANGETYPE_ADD;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CHANGETYPE_ANY"))
#ifdef LDAP_CHANGETYPE_ANY
	    return LDAP_CHANGETYPE_ANY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CHANGETYPE_DELETE"))
#ifdef LDAP_CHANGETYPE_DELETE
	    return LDAP_CHANGETYPE_DELETE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CHANGETYPE_MODDN"))
#ifdef LDAP_CHANGETYPE_MODDN
	    return LDAP_CHANGETYPE_MODDN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CHANGETYPE_MODIFY"))
#ifdef LDAP_CHANGETYPE_MODIFY
	    return LDAP_CHANGETYPE_MODIFY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CLIENT_LOOP"))
#ifdef LDAP_CLIENT_LOOP
	    return LDAP_CLIENT_LOOP;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_COMPARE_FALSE"))
#ifdef LDAP_COMPARE_FALSE
	    return LDAP_COMPARE_FALSE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_COMPARE_TRUE"))
#ifdef LDAP_COMPARE_TRUE
	    return LDAP_COMPARE_TRUE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CONFIDENTIALITY_REQUIRED"))
#ifdef LDAP_CONFIDENTIALITY_REQUIRED
	    return LDAP_CONFIDENTIALITY_REQUIRED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CONNECT_ERROR"))
#ifdef LDAP_CONNECT_ERROR
	    return LDAP_CONNECT_ERROR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_CONSTRAINT_VIOLATION"))
#ifdef LDAP_CONSTRAINT_VIOLATION
	    return LDAP_CONSTRAINT_VIOLATION;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_DECODING_ERROR"))
#ifdef LDAP_DECODING_ERROR
	    return LDAP_DECODING_ERROR;
#else
	    goto not_there;
#endif
	break;
      case 'D':
	if (strEQ(name, "LDAP_DEREF_ALWAYS"))
#ifdef LDAP_DEREF_ALWAYS
	    return LDAP_DEREF_ALWAYS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_DEREF_FINDING"))
#ifdef LDAP_DEREF_FINDING
	    return LDAP_DEREF_FINDING;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_DEREF_NEVER"))
#ifdef LDAP_DEREF_NEVER
	    return LDAP_DEREF_NEVER;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_DEREF_SEARCHING"))
#ifdef LDAP_DEREF_SEARCHING
	    return LDAP_DEREF_SEARCHING;
#else
	    goto not_there;
#endif
	break;
      case 'E':
	if (strEQ(name, "LDAP_ENCODING_ERROR"))
#ifdef LDAP_ENCODING_ERROR
	    return LDAP_ENCODING_ERROR;
#else
	    goto not_there;
#endif
	break;
      case 'F':
	if (strEQ(name, "LDAP_FILTER_ERROR"))
#ifdef LDAP_FILTER_ERROR
	    return LDAP_FILTER_ERROR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_FILT_MAXSIZ"))
#ifdef LDAP_FILT_MAXSIZ
	    return LDAP_FILT_MAXSIZ;
#else
	    goto not_there;
#endif
	break;
      case 'I':
	if (strEQ(name, "LDAP_INAPPROPRIATE_AUTH"))
#ifdef LDAP_INAPPROPRIATE_AUTH
	    return LDAP_INAPPROPRIATE_AUTH;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_INAPPROPRIATE_MATCHING"))
#ifdef LDAP_INAPPROPRIATE_MATCHING
	    return LDAP_INAPPROPRIATE_MATCHING;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_INSUFFICIENT_ACCESS"))
#ifdef LDAP_INSUFFICIENT_ACCESS
	    return LDAP_INSUFFICIENT_ACCESS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_INVALID_CREDENTIALS"))
#ifdef LDAP_INVALID_CREDENTIALS
	    return LDAP_INVALID_CREDENTIALS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_INVALID_DN_SYNTAX"))
#ifdef LDAP_INVALID_DN_SYNTAX
	    return LDAP_INVALID_DN_SYNTAX;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_INVALID_SYNTAX"))
#ifdef LDAP_INVALID_SYNTAX
	    return LDAP_INVALID_SYNTAX;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_IS_LEAF"))
#ifdef LDAP_IS_LEAF
	    return LDAP_IS_LEAF;
#else
	    goto not_there;
#endif
	break;
      case 'L':
	if (strEQ(name, "LDAP_LOCAL_ERROR"))
#ifdef LDAP_LOCAL_ERROR
	    return LDAP_LOCAL_ERROR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_LOOP_DETECT"))
#ifdef LDAP_LOOP_DETECT
	    return LDAP_LOOP_DETECT;
#else
	    goto not_there;
#endif
	break;
      case 'M':
	if (strEQ(name, "LDAP_MOD_ADD"))
#ifdef LDAP_MOD_ADD
	    return LDAP_MOD_ADD;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MOD_BVALUES"))
#ifdef LDAP_MOD_BVALUES
	    return LDAP_MOD_BVALUES;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MOD_DELETE"))
#ifdef LDAP_MOD_DELETE
	    return LDAP_MOD_DELETE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MOD_REPLACE"))
#ifdef LDAP_MOD_REPLACE
	    return LDAP_MOD_REPLACE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MORE_RESULTS_TO_RETURN"))
#ifdef LDAP_MORE_RESULTS_TO_RETURN
	    return LDAP_MORE_RESULTS_TO_RETURN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MSG_ALL"))
#ifdef LDAP_MSG_ALL
	    return LDAP_MSG_ALL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MSG_ONE"))
#ifdef LDAP_MSG_ONE
	    return LDAP_MSG_ONE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_MSG_RECEIVED"))
#ifdef LDAP_MSG_RECEIVED
	    return LDAP_MSG_RECEIVED;
#else
	    goto not_there;
#endif
	break;
      case 'N':
	if (strEQ(name, "LDAP_NAMING_VIOLATION"))
#ifdef LDAP_NAMING_VIOLATION
	    return LDAP_NAMING_VIOLATION;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NOT_ALLOWED_ON_NONLEAF"))
#ifdef LDAP_NOT_ALLOWED_ON_NONLEAF
	    return LDAP_NOT_ALLOWED_ON_NONLEAF;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NOT_ALLOWED_ON_RDN"))
#ifdef LDAP_NOT_ALLOWED_ON_RDN
	    return LDAP_NOT_ALLOWED_ON_RDN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NOT_SUPPORTED"))
#ifdef LDAP_NOT_SUPPORTED
	    return LDAP_NOT_SUPPORTED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NO_LIMIT"))
#ifdef LDAP_NO_LIMIT
	    return LDAP_NO_LIMIT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NO_MEMORY"))
#ifdef LDAP_NO_MEMORY
	    return LDAP_NO_MEMORY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NO_OBJECT_CLASS_MODS"))
#ifdef LDAP_NO_OBJECT_CLASS_MODS
	    return LDAP_NO_OBJECT_CLASS_MODS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NO_RESULTS_RETURNED"))
#ifdef LDAP_NO_RESULTS_RETURNED
	    return LDAP_NO_RESULTS_RETURNED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NO_SUCH_ATTRIBUTE"))
#ifdef LDAP_NO_SUCH_ATTRIBUTE
	    return LDAP_NO_SUCH_ATTRIBUTE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_NO_SUCH_OBJECT"))
#ifdef LDAP_NO_SUCH_OBJECT
	    return LDAP_NO_SUCH_OBJECT;
#else
	    goto not_there;
#endif
	break;
      case 'O':
	if (strEQ(name, "LDAP_OBJECT_CLASS_VIOLATION"))
#ifdef LDAP_OBJECT_CLASS_VIOLATION
	    return LDAP_OBJECT_CLASS_VIOLATION;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPERATIONS_ERROR"))
#ifdef LDAP_OPERATIONS_ERROR
	    return LDAP_OPERATIONS_ERROR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_CACHE_ENABLE"))
#ifdef LDAP_OPT_CACHE_ENABLE
	    return LDAP_OPT_CACHE_ENABLE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_CACHE_FN_PTRS"))
#ifdef LDAP_OPT_CACHE_FN_PTRS
	    return LDAP_OPT_CACHE_FN_PTRS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_CACHE_STRATEGY"))
#ifdef LDAP_OPT_CACHE_STRATEGY
	    return LDAP_OPT_CACHE_STRATEGY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_CLIENT_CONTROLS"))
#ifdef LDAP_OPT_CLIENT_CONTROLS
	    return LDAP_OPT_CLIENT_CONTROLS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_DEREF"))
#ifdef LDAP_OPT_DEREF
	    return LDAP_OPT_DEREF;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_DESC"))
#ifdef LDAP_OPT_DESC
	    return LDAP_OPT_DESC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_DNS"))
#ifdef LDAP_OPT_DNS
	    return LDAP_OPT_DNS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_DNS_FN_PTRS"))
#ifdef LDAP_OPT_DNS_FN_PTRS
	    return LDAP_OPT_DNS_FN_PTRS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_ERROR_NUMBER"))
#ifdef LDAP_OPT_ERROR_NUMBER
	    return LDAP_OPT_ERROR_NUMBER;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_ERROR_STRING"))
#ifdef LDAP_OPT_ERROR_STRING
	    return LDAP_OPT_ERROR_STRING;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_HOST_NAME"))
#ifdef LDAP_OPT_HOST_NAME
	    return LDAP_OPT_HOST_NAME;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_IO_FN_PTRS"))
#ifdef LDAP_OPT_IO_FN_PTRS
	    return LDAP_OPT_IO_FN_PTRS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_MEMALLOC_FN_PTRS"))
#ifdef LDAP_OPT_MEMALLOC_FN_PTRS
	    return LDAP_OPT_MEMALLOC_FN_PTRS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_PREFERRED_LANGUAGE"))
#ifdef LDAP_OPT_PREFERRED_LANGUAGE
	    return LDAP_OPT_PREFERRED_LANGUAGE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_PROTOCOL_VERSION"))
#ifdef LDAP_OPT_PROTOCOL_VERSION
	    return LDAP_OPT_PROTOCOL_VERSION;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_REBIND_ARG"))
#ifdef LDAP_OPT_REBIND_ARG
	    return LDAP_OPT_REBIND_ARG;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_REBIND_FN"))
#ifdef LDAP_OPT_REBIND_FN
	    return LDAP_OPT_REBIND_FN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_RECONNECT"))
#ifdef LDAP_OPT_RECONNECT
	    return LDAP_OPT_RECONNECT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_REFERRALS"))
#ifdef LDAP_OPT_REFERRALS
	    return LDAP_OPT_REFERRALS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_REFERRAL_HOP_LIMIT"))
#ifdef LDAP_OPT_REFERRAL_HOP_LIMIT
	    return LDAP_OPT_REFERRAL_HOP_LIMIT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_RESTART"))
#ifdef LDAP_OPT_RESTART
	    return LDAP_OPT_RESTART;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_RETURN_REFERRALS"))
#ifdef LDAP_OPT_RETURN_REFERRALS
	    return LDAP_OPT_RETURN_REFERRALS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_SERVER_CONTROLS"))
#ifdef LDAP_OPT_SERVER_CONTROLS
	    return LDAP_OPT_SERVER_CONTROLS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_SIZELIMIT"))
#ifdef LDAP_OPT_SIZELIMIT
	    return LDAP_OPT_SIZELIMIT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_SSL"))
#ifdef LDAP_OPT_SSL
	    return LDAP_OPT_SSL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_THREAD_FN_PTRS"))
#ifdef LDAP_OPT_THREAD_FN_PTRS
	    return LDAP_OPT_THREAD_FN_PTRS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OPT_TIMELIMIT"))
#ifdef LDAP_OPT_TIMELIMIT
	    return LDAP_OPT_TIMELIMIT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_OTHER"))
#ifdef LDAP_OTHER
	    return LDAP_OTHER;
#else
	    goto not_there;
#endif
	break;
      case 'P':
	if (strEQ(name, "LDAP_PARAM_ERROR"))
#ifdef LDAP_PARAM_ERROR
	    return LDAP_PARAM_ERROR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_PARTIAL_RESULTS"))
#ifdef LDAP_PARTIAL_RESULTS
	    return LDAP_PARTIAL_RESULTS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_PORT"))
#ifdef LDAP_PORT
	    return LDAP_PORT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_PORT_MAX"))
#ifdef LDAP_PORT_MAX
	    return LDAP_PORT_MAX;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_PROTOCOL_ERROR"))
#ifdef LDAP_PROTOCOL_ERROR
	    return LDAP_PROTOCOL_ERROR;
#else
	    goto not_there;
#endif
	break;
      case 'R':
	if (strEQ(name, "LDAP_REFERRAL"))
#ifdef LDAP_REFERRAL
	    return LDAP_REFERRAL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_REFERRAL_LIMIT_EXCEEDED"))
#ifdef LDAP_REFERRAL_LIMIT_EXCEEDED
	    return LDAP_REFERRAL_LIMIT_EXCEEDED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RESULTS_TOO_LARGE"))
#ifdef LDAP_RESULTS_TOO_LARGE
	    return LDAP_RESULTS_TOO_LARGE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_ADD"))
#ifdef LDAP_RES_ADD
	    return LDAP_RES_ADD;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_ANY"))
#ifdef LDAP_RES_ANY
	    return LDAP_RES_ANY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_BIND"))
#ifdef LDAP_RES_BIND
	    return LDAP_RES_BIND;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_COMPARE"))
#ifdef LDAP_RES_COMPARE
	    return LDAP_RES_COMPARE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_DELETE"))
#ifdef LDAP_RES_DELETE
	    return LDAP_RES_DELETE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_EXTENDED"))
#ifdef LDAP_RES_EXTENDED
	    return LDAP_RES_EXTENDED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_MODIFY"))
#ifdef LDAP_RES_MODIFY
	    return LDAP_RES_MODIFY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_MODRDN"))
#ifdef LDAP_RES_MODRDN
	    return LDAP_RES_MODRDN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_RENAME"))
#ifdef LDAP_RES_RENAME
	    return LDAP_RES_RENAME;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_SEARCH_ENTRY"))
#ifdef LDAP_RES_SEARCH_ENTRY
	    return LDAP_RES_SEARCH_ENTRY;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_SEARCH_REFERENCE"))
#ifdef LDAP_RES_SEARCH_REFERENCE
	    return LDAP_RES_SEARCH_REFERENCE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_RES_SEARCH_RESULT"))
#ifdef LDAP_RES_SEARCH_RESULT
	    return LDAP_RES_SEARCH_RESULT;
#else
	    goto not_there;
#endif
	break;
      case 'S':
	if (strEQ(name, "LDAP_SASL_BIND_IN_PROGRESS"))
#ifdef LDAP_SASL_BIND_IN_PROGRESS
	    return LDAP_SASL_BIND_IN_PROGRESS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SASL_SIMPLE"))
#ifdef LDAP_SASL_SIMPLE
	    return LDAP_SASL_SIMPLE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SCOPE_BASE"))
#ifdef LDAP_SCOPE_BASE
	    return LDAP_SCOPE_BASE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SCOPE_ONELEVEL"))
#ifdef LDAP_SCOPE_ONELEVEL
	    return LDAP_SCOPE_ONELEVEL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SCOPE_SUBTREE"))
#ifdef LDAP_SCOPE_SUBTREE
	    return LDAP_SCOPE_SUBTREE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SECURITY_NONE"))
#ifdef LDAP_SECURITY_NONE
	    return LDAP_SECURITY_NONE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SERVER_DOWN"))
#ifdef LDAP_SERVER_DOWN
	    return LDAP_SERVER_DOWN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SIZELIMIT_EXCEEDED"))
#ifdef LDAP_SIZELIMIT_EXCEEDED
	    return LDAP_SIZELIMIT_EXCEEDED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SORT_CONTROL_MISSING"))
#ifdef LDAP_SORT_CONTROL_MISSING
	    return LDAP_SORT_CONTROL_MISSING;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_STRONG_AUTH_NOT_SUPPORTED"))
#ifdef LDAP_STRONG_AUTH_NOT_SUPPORTED
	    return LDAP_STRONG_AUTH_NOT_SUPPORTED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_STRONG_AUTH_REQUIRED"))
#ifdef LDAP_STRONG_AUTH_REQUIRED
	    return LDAP_STRONG_AUTH_REQUIRED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_SUCCESS"))
#ifdef LDAP_SUCCESS
	    return LDAP_SUCCESS;
#else
	    goto not_there;
#endif
	break;
      case 'T':
	if (strEQ(name, "LDAP_TIMELIMIT_EXCEEDED"))
#ifdef LDAP_TIMELIMIT_EXCEEDED
	    return LDAP_TIMELIMIT_EXCEEDED;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_TIMEOUT"))
#ifdef LDAP_TIMEOUT
	    return LDAP_TIMEOUT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_TYPE_OR_VALUE_EXISTS"))
#ifdef LDAP_TYPE_OR_VALUE_EXISTS
	    return LDAP_TYPE_OR_VALUE_EXISTS;
#else
	    goto not_there;
#endif
	break;
      case 'U':
	if (strEQ(name, "LDAP_UNAVAILABLE"))
#ifdef LDAP_UNAVAILABLE
	    return LDAP_UNAVAILABLE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_UNAVAILABLE_CRITICAL_EXTENSION"))
#ifdef LDAP_UNAVAILABLE_CRITICAL_EXTENSION
	    return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_UNDEFINED_TYPE"))
#ifdef LDAP_UNDEFINED_TYPE
	    return LDAP_UNDEFINED_TYPE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_UNWILLING_TO_PERFORM"))
#ifdef LDAP_UNWILLING_TO_PERFORM
	    return LDAP_UNWILLING_TO_PERFORM;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_URL_ERR_BADSCOPE"))
#ifdef LDAP_URL_ERR_BADSCOPE
	    return LDAP_URL_ERR_BADSCOPE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_URL_ERR_MEM"))
#ifdef LDAP_URL_ERR_MEM
	    return LDAP_URL_ERR_MEM;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_URL_ERR_NODN"))
#ifdef LDAP_URL_ERR_NODN
	    return LDAP_URL_ERR_NODN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_URL_ERR_NOTLDAP"))
#ifdef LDAP_URL_ERR_NOTLDAP
	    return LDAP_URL_ERR_NOTLDAP;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_URL_ERR_PARAM"))
#ifdef LDAP_URL_ERR_PARAM
	    return LDAP_URL_ERR_PARAM;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_URL_OPT_SECURE"))
#ifdef LDAP_URL_OPT_SECURE
	    return LDAP_URL_OPT_SECURE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_USER_CANCELLED"))
#ifdef LDAP_USER_CANCELLED
	    return LDAP_USER_CANCELLED;
#else
	    goto not_there;
#endif
	break;
      case 'V':
	if (strEQ(name, "LDAP_VERSION"))
#ifdef LDAP_VERSION
	    return LDAP_VERSION;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_VERSION1"))
#ifdef LDAP_VERSION1
	    return LDAP_VERSION1;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_VERSION2"))
#ifdef LDAP_VERSION2
	    return LDAP_VERSION2;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_VERSION3"))
#ifdef LDAP_VERSION3
	    return LDAP_VERSION3;
#else
	    goto not_there;
#endif
	if (strEQ(name, "LDAP_VERSION_MAX"))
#ifdef LDAP_VERSION_MAX
	    return LDAP_VERSION_MAX;
#else
	    goto not_there;
#endif
	break;
      }
    } else {
	if (strEQ(name, "LDAPS_PORT"))
#ifdef LDAPS_PORT
	    return LDAPS_PORT;
#else
	    goto not_there;
#endif
    }

    errno = EINVAL;
    return 0;

not_there:
    errno = ENOENT;
    return 0;
}