Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

fallback.h

00001 #define PERL_constant_NOTFOUND  1
00002 #define PERL_constant_NOTDEF    2
00003 #define PERL_constant_ISIV      3
00004 #define PERL_constant_ISNO      4
00005 #define PERL_constant_ISNV      5
00006 #define PERL_constant_ISPV      6
00007 #define PERL_constant_ISPVN     7
00008 #define PERL_constant_ISSV      8
00009 #define PERL_constant_ISUNDEF   9
00010 #define PERL_constant_ISUV      10
00011 #define PERL_constant_ISYES     11
00012 
00013 #ifndef NVTYPE
00014 typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it.  */
00015 #endif
00016 #ifndef aTHX_
00017 #define aTHX_ /* 5.6 or later define this for threading support.  */
00018 #endif
00019 #ifndef pTHX_
00020 #define pTHX_ /* 5.6 or later define this for threading support.  */
00021 #endif
00022 
00023 static int
00024 constant_6 (pTHX_ const char *name, IV *iv_return) {
00025   /* When generated this function returned values for the list of names given
00026      here.  However, subsequent manual editing may have added or removed some.
00027      DB_TXN R_LAST R_NEXT R_PREV */
00028   /* Offset 2 gives the best switch position.  */
00029   switch (name[2]) {
00030   case 'L':
00031     if (memEQ(name, "R_LAST", 6)) {
00032     /*                 ^         */
00033 #ifdef R_LAST
00034       *iv_return = R_LAST;
00035       return PERL_constant_ISIV;
00036 #else
00037       return PERL_constant_NOTDEF;
00038 #endif
00039     }
00040     break;
00041   case 'N':
00042     if (memEQ(name, "R_NEXT", 6)) {
00043     /*                 ^         */
00044 #ifdef R_NEXT
00045       *iv_return = R_NEXT;
00046       return PERL_constant_ISIV;
00047 #else
00048       return PERL_constant_NOTDEF;
00049 #endif
00050     }
00051     break;
00052   case 'P':
00053     if (memEQ(name, "R_PREV", 6)) {
00054     /*                 ^         */
00055 #ifdef R_PREV
00056       *iv_return = R_PREV;
00057       return PERL_constant_ISIV;
00058 #else
00059       return PERL_constant_NOTDEF;
00060 #endif
00061     }
00062     break;
00063   case '_':
00064     if (memEQ(name, "DB_TXN", 6)) {
00065     /*                 ^         */
00066 #ifdef DB_TXN
00067       *iv_return = DB_TXN;
00068       return PERL_constant_ISIV;
00069 #else
00070       return PERL_constant_NOTDEF;
00071 #endif
00072     }
00073     break;
00074   }
00075   return PERL_constant_NOTFOUND;
00076 }
00077 
00078 static int
00079 constant_7 (pTHX_ const char *name, IV *iv_return) {
00080   /* When generated this function returned values for the list of names given
00081      here.  However, subsequent manual editing may have added or removed some.
00082      DB_LOCK R_FIRST R_NOKEY */
00083   /* Offset 3 gives the best switch position.  */
00084   switch (name[3]) {
00085   case 'I':
00086     if (memEQ(name, "R_FIRST", 7)) {
00087     /*                  ^         */
00088 #ifdef R_FIRST
00089       *iv_return = R_FIRST;
00090       return PERL_constant_ISIV;
00091 #else
00092       return PERL_constant_NOTDEF;
00093 #endif
00094     }
00095     break;
00096   case 'L':
00097     if (memEQ(name, "DB_LOCK", 7)) {
00098     /*                  ^         */
00099 #ifdef DB_LOCK
00100       *iv_return = DB_LOCK;
00101       return PERL_constant_ISIV;
00102 #else
00103       return PERL_constant_NOTDEF;
00104 #endif
00105     }
00106     break;
00107   case 'O':
00108     if (memEQ(name, "R_NOKEY", 7)) {
00109     /*                  ^         */
00110 #ifdef R_NOKEY
00111       *iv_return = R_NOKEY;
00112       return PERL_constant_ISIV;
00113 #else
00114       return PERL_constant_NOTDEF;
00115 #endif
00116     }
00117     break;
00118   }
00119   return PERL_constant_NOTFOUND;
00120 }
00121 
00122 static int
00123 constant_8 (pTHX_ const char *name, IV *iv_return) {
00124   /* When generated this function returned values for the list of names given
00125      here.  However, subsequent manual editing may have added or removed some.
00126      DB_SHMEM R_CURSOR R_IAFTER */
00127   /* Offset 5 gives the best switch position.  */
00128   switch (name[5]) {
00129   case 'M':
00130     if (memEQ(name, "DB_SHMEM", 8)) {
00131     /*                    ^        */
00132 #ifdef DB_SHMEM
00133       *iv_return = DB_SHMEM;
00134       return PERL_constant_ISIV;
00135 #else
00136       return PERL_constant_NOTDEF;
00137 #endif
00138     }
00139     break;
00140   case 'S':
00141     if (memEQ(name, "R_CURSOR", 8)) {
00142     /*                    ^        */
00143 #ifdef R_CURSOR
00144       *iv_return = R_CURSOR;
00145       return PERL_constant_ISIV;
00146 #else
00147       return PERL_constant_NOTDEF;
00148 #endif
00149     }
00150     break;
00151   case 'T':
00152     if (memEQ(name, "R_IAFTER", 8)) {
00153     /*                    ^        */
00154 #ifdef R_IAFTER
00155       *iv_return = R_IAFTER;
00156       return PERL_constant_ISIV;
00157 #else
00158       return PERL_constant_NOTDEF;
00159 #endif
00160     }
00161     break;
00162   }
00163   return PERL_constant_NOTFOUND;
00164 }
00165 
00166 static int
00167 constant_9 (pTHX_ const char *name, IV *iv_return) {
00168   /* When generated this function returned values for the list of names given
00169      here.  However, subsequent manual editing may have added or removed some.
00170      HASHMAGIC RET_ERROR R_IBEFORE */
00171   /* Offset 7 gives the best switch position.  */
00172   switch (name[7]) {
00173   case 'I':
00174     if (memEQ(name, "HASHMAGIC", 9)) {
00175     /*                      ^       */
00176 #ifdef HASHMAGIC
00177       *iv_return = HASHMAGIC;
00178       return PERL_constant_ISIV;
00179 #else
00180       return PERL_constant_NOTDEF;
00181 #endif
00182     }
00183     break;
00184   case 'O':
00185     if (memEQ(name, "RET_ERROR", 9)) {
00186     /*                      ^       */
00187 #ifdef RET_ERROR
00188       *iv_return = RET_ERROR;
00189       return PERL_constant_ISIV;
00190 #else
00191       return PERL_constant_NOTDEF;
00192 #endif
00193     }
00194     break;
00195   case 'R':
00196     if (memEQ(name, "R_IBEFORE", 9)) {
00197     /*                      ^       */
00198 #ifdef R_IBEFORE
00199       *iv_return = R_IBEFORE;
00200       return PERL_constant_ISIV;
00201 #else
00202       return PERL_constant_NOTDEF;
00203 #endif
00204     }
00205     break;
00206   }
00207   return PERL_constant_NOTFOUND;
00208 }
00209 
00210 static int
00211 constant_10 (pTHX_ const char *name, IV *iv_return) {
00212   /* When generated this function returned values for the list of names given
00213      here.  However, subsequent manual editing may have added or removed some.
00214      BTREEMAGIC R_FIXEDLEN R_SNAPSHOT __R_UNUSED */
00215   /* Offset 5 gives the best switch position.  */
00216   switch (name[5]) {
00217   case 'E':
00218     if (memEQ(name, "R_FIXEDLEN", 10)) {
00219     /*                    ^           */
00220 #ifdef R_FIXEDLEN
00221       *iv_return = R_FIXEDLEN;
00222       return PERL_constant_ISIV;
00223 #else
00224       return PERL_constant_NOTDEF;
00225 #endif
00226     }
00227     break;
00228   case 'M':
00229     if (memEQ(name, "BTREEMAGIC", 10)) {
00230     /*                    ^           */
00231 #ifdef BTREEMAGIC
00232       *iv_return = BTREEMAGIC;
00233       return PERL_constant_ISIV;
00234 #else
00235       return PERL_constant_NOTDEF;
00236 #endif
00237     }
00238     break;
00239   case 'N':
00240     if (memEQ(name, "__R_UNUSED", 10)) {
00241     /*                    ^           */
00242 #ifdef __R_UNUSED
00243       *iv_return = __R_UNUSED;
00244       return PERL_constant_ISIV;
00245 #else
00246       return PERL_constant_NOTDEF;
00247 #endif
00248     }
00249     break;
00250   case 'P':
00251     if (memEQ(name, "R_SNAPSHOT", 10)) {
00252     /*                    ^           */
00253 #ifdef R_SNAPSHOT
00254       *iv_return = R_SNAPSHOT;
00255       return PERL_constant_ISIV;
00256 #else
00257       return PERL_constant_NOTDEF;
00258 #endif
00259     }
00260     break;
00261   }
00262   return PERL_constant_NOTFOUND;
00263 }
00264 
00265 static int
00266 constant_11 (pTHX_ const char *name, IV *iv_return) {
00267   /* When generated this function returned values for the list of names given
00268      here.  However, subsequent manual editing may have added or removed some.
00269      HASHVERSION RET_SPECIAL RET_SUCCESS R_RECNOSYNC R_SETCURSOR */
00270   /* Offset 10 gives the best switch position.  */
00271   switch (name[10]) {
00272   case 'C':
00273     if (memEQ(name, "R_RECNOSYNC", 11)) {
00274     /*                         ^       */
00275 #ifdef R_RECNOSYNC
00276       *iv_return = R_RECNOSYNC;
00277       return PERL_constant_ISIV;
00278 #else
00279       return PERL_constant_NOTDEF;
00280 #endif
00281     }
00282     break;
00283   case 'L':
00284     if (memEQ(name, "RET_SPECIAL", 11)) {
00285     /*                         ^       */
00286 #ifdef RET_SPECIAL
00287       *iv_return = RET_SPECIAL;
00288       return PERL_constant_ISIV;
00289 #else
00290       return PERL_constant_NOTDEF;
00291 #endif
00292     }
00293     break;
00294   case 'N':
00295     if (memEQ(name, "HASHVERSION", 11)) {
00296     /*                         ^       */
00297 #ifdef HASHVERSION
00298       *iv_return = HASHVERSION;
00299       return PERL_constant_ISIV;
00300 #else
00301       return PERL_constant_NOTDEF;
00302 #endif
00303     }
00304     break;
00305   case 'R':
00306     if (memEQ(name, "R_SETCURSOR", 11)) {
00307     /*                         ^       */
00308 #ifdef R_SETCURSOR
00309       *iv_return = R_SETCURSOR;
00310       return PERL_constant_ISIV;
00311 #else
00312       return PERL_constant_NOTDEF;
00313 #endif
00314     }
00315     break;
00316   case 'S':
00317     if (memEQ(name, "RET_SUCCESS", 11)) {
00318     /*                         ^       */
00319 #ifdef RET_SUCCESS
00320       *iv_return = RET_SUCCESS;
00321       return PERL_constant_ISIV;
00322 #else
00323       return PERL_constant_NOTDEF;
00324 #endif
00325     }
00326     break;
00327   }
00328   return PERL_constant_NOTFOUND;
00329 }
00330 
00331 static int
00332 constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
00333   /* Initially switch on the length of the name.  */
00334   /* When generated this function returned values for the list of names given
00335      in this section of perl code.  Rather than manually editing these functions
00336      to add or remove constants, which would result in this comment and section
00337      of code becoming inaccurate, we recommend that you edit this section of
00338      code, and use it to regenerate a new set of constant functions which you
00339      then use to replace the originals.
00340 
00341      Regenerate these constant functions by feeding this entire source file to
00342      perl -x
00343 
00344 #!bleedperl -w
00345 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
00346 
00347 my $types = {map {($_, 1)} qw(IV)};
00348 my @names = (qw(BTREEMAGIC BTREEVERSION DB_LOCK DB_SHMEM DB_TXN HASHMAGIC
00349                HASHVERSION MAX_PAGE_NUMBER MAX_PAGE_OFFSET MAX_REC_NUMBER
00350                RET_ERROR RET_SPECIAL RET_SUCCESS R_CURSOR R_DUP R_FIRST
00351                R_FIXEDLEN R_IAFTER R_IBEFORE R_LAST R_NEXT R_NOKEY
00352                R_NOOVERWRITE R_PREV R_RECNOSYNC R_SETCURSOR R_SNAPSHOT
00353                __R_UNUSED));
00354 
00355 print constant_types(); # macro defs
00356 foreach (C_constant ("DB_File", 'constant', 'IV', $types, undef, 3, @names) ) {
00357     print $_, "\n"; # C constant subs
00358 }
00359 print "#### XS Section:\n";
00360 print XS_constant ("DB_File", $types);
00361 __END__
00362    */
00363 
00364   switch (len) {
00365   case 5:
00366     if (memEQ(name, "R_DUP", 5)) {
00367 #ifdef R_DUP
00368       *iv_return = R_DUP;
00369       return PERL_constant_ISIV;
00370 #else
00371       return PERL_constant_NOTDEF;
00372 #endif
00373     }
00374     break;
00375   case 6:
00376     return constant_6 (aTHX_ name, iv_return);
00377     break;
00378   case 7:
00379     return constant_7 (aTHX_ name, iv_return);
00380     break;
00381   case 8:
00382     return constant_8 (aTHX_ name, iv_return);
00383     break;
00384   case 9:
00385     return constant_9 (aTHX_ name, iv_return);
00386     break;
00387   case 10:
00388     return constant_10 (aTHX_ name, iv_return);
00389     break;
00390   case 11:
00391     return constant_11 (aTHX_ name, iv_return);
00392     break;
00393   case 12:
00394     if (memEQ(name, "BTREEVERSION", 12)) {
00395 #ifdef BTREEVERSION
00396       *iv_return = BTREEVERSION;
00397       return PERL_constant_ISIV;
00398 #else
00399       return PERL_constant_NOTDEF;
00400 #endif
00401     }
00402     break;
00403   case 13:
00404     if (memEQ(name, "R_NOOVERWRITE", 13)) {
00405 #ifdef R_NOOVERWRITE
00406       *iv_return = R_NOOVERWRITE;
00407       return PERL_constant_ISIV;
00408 #else
00409       return PERL_constant_NOTDEF;
00410 #endif
00411     }
00412     break;
00413   case 14:
00414     if (memEQ(name, "MAX_REC_NUMBER", 14)) {
00415 #ifdef MAX_REC_NUMBER
00416       *iv_return = MAX_REC_NUMBER;
00417       return PERL_constant_ISIV;
00418 #else
00419       return PERL_constant_NOTDEF;
00420 #endif
00421     }
00422     break;
00423   case 15:
00424     /* Names all of length 15.  */
00425     /* MAX_PAGE_NUMBER MAX_PAGE_OFFSET */
00426     /* Offset 9 gives the best switch position.  */
00427     switch (name[9]) {
00428     case 'N':
00429       if (memEQ(name, "MAX_PAGE_NUMBER", 15)) {
00430       /*                        ^            */
00431 #ifdef MAX_PAGE_NUMBER
00432         *iv_return = MAX_PAGE_NUMBER;
00433         return PERL_constant_ISIV;
00434 #else
00435         return PERL_constant_NOTDEF;
00436 #endif
00437       }
00438       break;
00439     case 'O':
00440       if (memEQ(name, "MAX_PAGE_OFFSET", 15)) {
00441       /*                        ^            */
00442 #ifdef MAX_PAGE_OFFSET
00443         *iv_return = MAX_PAGE_OFFSET;
00444         return PERL_constant_ISIV;
00445 #else
00446         return PERL_constant_NOTDEF;
00447 #endif
00448       }
00449       break;
00450     }
00451     break;
00452   }
00453   return PERL_constant_NOTFOUND;
00454 }
00455 

Generated on Sun Dec 25 12:14:43 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2