"Fossies" - the Fresh Open Source Software Archive

Member "PerlCDF38_0/CDF.xs" (15 Jan 2020, 191692 Bytes) of package /linux/misc/PerlCDF38_0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "CDF.xs": 36_4_vs_37_0.

    1 /******************************************************************************
    2 * Copyright 1996-2013 United States Government as represented by the
    3 * Administrator of the National Aeronautics and Space Administration.
    4 * All Rights Reserved.
    5 ******************************************************************************/
    6 
    7 #include "EXTERN.h"
    8 #include "perl.h"
    9 #include "XSUB.h"
   10 
   11 #include "cdf.h"
   12 
   13 static double
   14 constant(name)
   15 char *name;
   16 {
   17     errno = 0;
   18     switch (*name) {
   19     case 'A':
   20     if (strEQ(name, "AHUFF_COMPRESSION"))
   21 #ifdef AHUFF_COMPRESSION
   22         return AHUFF_COMPRESSION;
   23 #else
   24         goto not_there;
   25 #endif
   26     if (strEQ(name, "ALPHAOSF1_DECODING"))
   27 #ifdef ALPHAOSF1_DECODING
   28         return ALPHAOSF1_DECODING;
   29 #else
   30         goto not_there;
   31 #endif
   32     if (strEQ(name, "ALPHAOSF1_ENCODING"))
   33 #ifdef ALPHAOSF1_ENCODING
   34         return ALPHAOSF1_ENCODING;
   35 #else
   36         goto not_there;
   37 #endif
   38     if (strEQ(name, "ALPHAVMSd_DECODING"))
   39 #ifdef ALPHAVMSd_DECODING
   40         return ALPHAVMSd_DECODING;
   41 #else
   42         goto not_there;
   43 #endif
   44     if (strEQ(name, "ALPHAVMSd_ENCODING"))
   45 #ifdef ALPHAVMSd_ENCODING
   46         return ALPHAVMSd_ENCODING;
   47 #else
   48         goto not_there;
   49 #endif
   50     if (strEQ(name, "ALPHAVMSg_DECODING"))
   51 #ifdef ALPHAVMSg_DECODING
   52         return ALPHAVMSg_DECODING;
   53 #else
   54         goto not_there;
   55 #endif
   56     if (strEQ(name, "ALPHAVMSg_ENCODING"))
   57 #ifdef ALPHAVMSg_ENCODING
   58         return ALPHAVMSg_ENCODING;
   59 #else
   60         goto not_there;
   61 #endif
   62     if (strEQ(name, "ALPHAVMSi_DECODING"))
   63 #ifdef ALPHAVMSi_DECODING
   64         return ALPHAVMSi_DECODING;
   65 #else
   66         goto not_there;
   67 #endif
   68     if (strEQ(name, "ALPHAVMSi_ENCODING"))
   69 #ifdef ALPHAVMSi_ENCODING
   70         return ALPHAVMSi_ENCODING;
   71 #else
   72         goto not_there;
   73 #endif
   74         if (strEQ(name, "ARM_BIG_DECODING"))
   75 #ifdef ARM_BIG_DECODING
   76             return ARM_BIG_DECODING;
   77 #else
   78             goto not_there;
   79 #endif
   80         if (strEQ(name, "ARM_BIG_ENCODING"))
   81 #ifdef ARM_BIG_ENCODING
   82             return ARM_BIG_ENCODING;
   83 #else
   84             goto not_there;
   85 #endif
   86         if (strEQ(name, "ARM_LITTLE_DECODING"))
   87 #ifdef ARM_LITTLE_DECODING
   88             return ARM_LITTLE_DECODING;
   89 #else
   90             goto not_there;
   91 #endif
   92         if (strEQ(name, "ARM_LITTLE_ENCODING"))
   93 #ifdef ARM_LITTLE_ENCODING
   94             return ARM_LITTLE_ENCODING;
   95 #else
   96             goto not_there;
   97 #endif
   98     if (strEQ(name, "ATTR_"))
   99 #ifdef ATTR_
  100         return ATTR_;
  101 #else
  102         goto not_there;
  103 #endif
  104     if (strEQ(name, "ATTR_EXISTANCE_"))
  105 #ifdef ATTR_EXISTANCE_
  106         return ATTR_EXISTANCE_;
  107 #else
  108         goto not_there;
  109 #endif
  110     if (strEQ(name, "ATTR_EXISTENCE_"))
  111 #ifdef ATTR_EXISTENCE_
  112         return ATTR_EXISTENCE_;
  113 #else
  114         goto not_there;
  115 #endif
  116     if (strEQ(name, "ATTR_EXISTS"))
  117 #ifdef ATTR_EXISTS
  118         return ATTR_EXISTS;
  119 #else
  120         goto not_there;
  121 #endif
  122     if (strEQ(name, "ATTR_MAXENTRY_"))
  123 #ifdef ATTR_MAXENTRY_
  124         return ATTR_MAXENTRY_;
  125 #else
  126         goto not_there;
  127 #endif
  128     if (strEQ(name, "ATTR_MAXgENTRY_"))
  129 #ifdef ATTR_MAXgENTRY_
  130         return ATTR_MAXgENTRY_;
  131 #else
  132         goto not_there;
  133 #endif
  134     if (strEQ(name, "ATTR_MAXrENTRY_"))
  135 #ifdef ATTR_MAXrENTRY_
  136         return ATTR_MAXrENTRY_;
  137 #else
  138         goto not_there;
  139 #endif
  140     if (strEQ(name, "ATTR_MAXzENTRY_"))
  141 #ifdef ATTR_MAXzENTRY_
  142         return ATTR_MAXzENTRY_;
  143 #else
  144         goto not_there;
  145 #endif
  146     if (strEQ(name, "ATTR_NAME_"))
  147 #ifdef ATTR_NAME_
  148         return ATTR_NAME_;
  149 #else
  150         goto not_there;
  151 #endif
  152     if (strEQ(name, "ATTR_NAME_TRUNC"))
  153 #ifdef ATTR_NAME_TRUNC
  154         return ATTR_NAME_TRUNC;
  155 #else
  156         goto not_there;
  157 #endif
  158     if (strEQ(name, "ATTR_NUMBER_"))
  159 #ifdef ATTR_NUMBER_
  160         return ATTR_NUMBER_;
  161 #else
  162         goto not_there;
  163 #endif
  164     if (strEQ(name, "ATTR_NUMENTRIES_"))
  165 #ifdef ATTR_NUMENTRIES_
  166         return ATTR_NUMENTRIES_;
  167 #else
  168         goto not_there;
  169 #endif
  170     if (strEQ(name, "ATTR_NUMgENTRIES_"))
  171 #ifdef ATTR_NUMgENTRIES_
  172         return ATTR_NUMgENTRIES_;
  173 #else
  174         goto not_there;
  175 #endif
  176     if (strEQ(name, "ATTR_NUMrENTRIES_"))
  177 #ifdef ATTR_NUMrENTRIES_
  178         return ATTR_NUMrENTRIES_;
  179 #else
  180         goto not_there;
  181 #endif
  182     if (strEQ(name, "ATTR_NUMzENTRIES_"))
  183 #ifdef ATTR_NUMzENTRIES_
  184         return ATTR_NUMzENTRIES_;
  185 #else
  186         goto not_there;
  187 #endif
  188     if (strEQ(name, "ATTR_SCOPE_"))
  189 #ifdef ATTR_SCOPE_
  190         return ATTR_SCOPE_;
  191 #else
  192         goto not_there;
  193 #endif
  194     break;
  195     case 'B':
  196     if (strEQ(name, "BAD_ALLOCATE_RECS"))
  197 #ifdef BAD_ALLOCATE_RECS
  198         return BAD_ALLOCATE_RECS;
  199 #else
  200         goto not_there;
  201 #endif
  202     if (strEQ(name, "BAD_ARGUMENT"))
  203 #ifdef BAD_ARGUMENT
  204         return BAD_ARGUMENT;
  205 #else
  206         goto not_there;
  207 #endif
  208     if (strEQ(name, "BAD_ATTR_NAME"))
  209 #ifdef BAD_ATTR_NAME
  210         return BAD_ATTR_NAME;
  211 #else
  212         goto not_there;
  213 #endif
  214     if (strEQ(name, "BAD_ATTR_NUM"))
  215 #ifdef BAD_ATTR_NUM
  216         return BAD_ATTR_NUM;
  217 #else
  218         goto not_there;
  219 #endif
  220     if (strEQ(name, "BAD_BLOCKING_FACTOR"))
  221 #ifdef BAD_BLOCKING_FACTOR
  222         return BAD_BLOCKING_FACTOR;
  223 #else
  224         goto not_there;
  225 #endif
  226     if (strEQ(name, "BAD_CACHE_SIZE"))
  227 #ifdef BAD_CACHE_SIZE
  228         return BAD_CACHE_SIZE;
  229 #else
  230         goto not_there;
  231 #endif
  232     if (strEQ(name, "BAD_CDFSTATUS"))
  233 #ifdef BAD_CDFSTATUS
  234         return BAD_CDFSTATUS;
  235 #else
  236         goto not_there;
  237 #endif
  238     if (strEQ(name, "BAD_CDF_EXTENSION"))
  239 #ifdef BAD_CDF_EXTENSION
  240         return BAD_CDF_EXTENSION;
  241 #else
  242         goto not_there;
  243 #endif
  244     if (strEQ(name, "BAD_CDF_ID"))
  245 #ifdef BAD_CDF_ID
  246         return BAD_CDF_ID;
  247 #else
  248         goto not_there;
  249 #endif
  250     if (strEQ(name, "BAD_CDF_NAME"))
  251 #ifdef BAD_CDF_NAME
  252         return BAD_CDF_NAME;
  253 #else
  254         goto not_there;
  255 #endif
  256         if (strEQ(name, "BAD_CHECKSUM"))
  257 #ifdef BAD_CHECKSUM
  258             return BAD_CHECKSUM;
  259 #else
  260             goto not_there;
  261 #endif
  262     if (strEQ(name, "BAD_COMPRESSION_PARM"))
  263 #ifdef BAD_COMPRESSION_PARM
  264         return BAD_COMPRESSION_PARM;
  265 #else
  266         goto not_there;
  267 #endif
  268     if (strEQ(name, "BAD_DATA_TYPE"))
  269 #ifdef BAD_DATA_TYPE
  270         return BAD_DATA_TYPE;
  271 #else
  272         goto not_there;
  273 #endif
  274     if (strEQ(name, "BAD_DECODING"))
  275 #ifdef BAD_DECODING
  276         return BAD_DECODING;
  277 #else
  278         goto not_there;
  279 #endif
  280     if (strEQ(name, "BAD_DIM_COUNT"))
  281 #ifdef BAD_DIM_COUNT
  282         return BAD_DIM_COUNT;
  283 #else
  284         goto not_there;
  285 #endif
  286     if (strEQ(name, "BAD_DIM_INDEX"))
  287 #ifdef BAD_DIM_INDEX
  288         return BAD_DIM_INDEX;
  289 #else
  290         goto not_there;
  291 #endif
  292     if (strEQ(name, "BAD_DIM_INTERVAL"))
  293 #ifdef BAD_DIM_INTERVAL
  294         return BAD_DIM_INTERVAL;
  295 #else
  296         goto not_there;
  297 #endif
  298     if (strEQ(name, "BAD_DIM_SIZE"))
  299 #ifdef BAD_DIM_SIZE
  300         return BAD_DIM_SIZE;
  301 #else
  302         goto not_there;
  303 #endif
  304     if (strEQ(name, "BAD_ENCODING"))
  305 #ifdef BAD_ENCODING
  306         return BAD_ENCODING;
  307 #else
  308         goto not_there;
  309 #endif
  310     if (strEQ(name, "BAD_ENTRY_NUM"))
  311 #ifdef BAD_ENTRY_NUM
  312         return BAD_ENTRY_NUM;
  313 #else
  314         goto not_there;
  315 #endif
  316     if (strEQ(name, "BAD_EXTEND_RECS"))
  317 #ifdef BAD_EXTEND_RECS
  318         return BAD_EXTEND_RECS;
  319 #else
  320         goto not_there;
  321 #endif
  322     if (strEQ(name, "BAD_FNC_OR_ITEM"))
  323 #ifdef BAD_FNC_OR_ITEM
  324         return BAD_FNC_OR_ITEM;
  325 #else
  326         goto not_there;
  327 #endif
  328     if (strEQ(name, "BAD_FORMAT"))
  329 #ifdef BAD_FORMAT
  330         return BAD_FORMAT;
  331 #else
  332         goto not_there;
  333 #endif
  334     if (strEQ(name, "BAD_INITIAL_RECS"))
  335 #ifdef BAD_INITIAL_RECS
  336         return BAD_INITIAL_RECS;
  337 #else
  338         goto not_there;
  339 #endif
  340     if (strEQ(name, "BAD_MAJORITY"))
  341 #ifdef BAD_MAJORITY
  342         return BAD_MAJORITY;
  343 #else
  344         goto not_there;
  345 #endif
  346     if (strEQ(name, "BAD_MALLOC"))
  347 #ifdef BAD_MALLOC
  348         return BAD_MALLOC;
  349 #else
  350         goto not_there;
  351 #endif
  352     if (strEQ(name, "BAD_NEGtoPOSfp0_MODE"))
  353 #ifdef BAD_NEGtoPOSfp0_MODE
  354         return BAD_NEGtoPOSfp0_MODE;
  355 #else
  356         goto not_there;
  357 #endif
  358     if (strEQ(name, "BAD_NUM_DIMS"))
  359 #ifdef BAD_NUM_DIMS
  360         return BAD_NUM_DIMS;
  361 #else
  362         goto not_there;
  363 #endif
  364     if (strEQ(name, "BAD_NUM_ELEMS"))
  365 #ifdef BAD_NUM_ELEMS
  366         return BAD_NUM_ELEMS;
  367 #else
  368         goto not_there;
  369 #endif
  370     if (strEQ(name, "BAD_NUM_STRINGS"))
  371 #ifdef BAD_NUM_STRINGS
  372         return BAD_NUM_STRINGS;
  373 #else
  374         goto not_there;
  375 #endif
  376     if (strEQ(name, "BAD_NUM_VARS"))
  377 #ifdef BAD_NUM_VARS
  378         return BAD_NUM_VARS;
  379 #else
  380         goto not_there;
  381 #endif
  382     if (strEQ(name, "BAD_READONLY_MODE"))
  383 #ifdef BAD_READONLY_MODE
  384         return BAD_READONLY_MODE;
  385 #else
  386         goto not_there;
  387 #endif
  388     if (strEQ(name, "BAD_REC_COUNT"))
  389 #ifdef BAD_REC_COUNT
  390         return BAD_REC_COUNT;
  391 #else
  392         goto not_there;
  393 #endif
  394     if (strEQ(name, "BAD_REC_INTERVAL"))
  395 #ifdef BAD_REC_INTERVAL
  396         return BAD_REC_INTERVAL;
  397 #else
  398         goto not_there;
  399 #endif
  400     if (strEQ(name, "BAD_REC_NUM"))
  401 #ifdef BAD_REC_NUM
  402         return BAD_REC_NUM;
  403 #else
  404         goto not_there;
  405 #endif
  406     if (strEQ(name, "BAD_SCOPE"))
  407 #ifdef BAD_SCOPE
  408         return BAD_SCOPE;
  409 #else
  410         goto not_there;
  411 #endif
  412     if (strEQ(name, "BAD_SCRATCH_DIR"))
  413 #ifdef BAD_SCRATCH_DIR
  414         return BAD_SCRATCH_DIR;
  415 #else
  416         goto not_there;
  417 #endif
  418     if (strEQ(name, "BAD_SPARSEARRAYS_PARM"))
  419 #ifdef BAD_SPARSEARRAYS_PARM
  420         return BAD_SPARSEARRAYS_PARM;
  421 #else
  422         goto not_there;
  423 #endif
  424     if (strEQ(name, "BAD_VAR_NAME"))
  425 #ifdef BAD_VAR_NAME
  426         return BAD_VAR_NAME;
  427 #else
  428         goto not_there;
  429 #endif
  430     if (strEQ(name, "BAD_VAR_NUM"))
  431 #ifdef BAD_VAR_NUM
  432         return BAD_VAR_NUM;
  433 #else
  434         goto not_there;
  435 #endif
  436     if (strEQ(name, "BAD_zMODE"))
  437 #ifdef BAD_zMODE
  438         return BAD_zMODE;
  439 #else
  440         goto not_there;
  441 #endif
  442     break;
  443     case 'C':
  444     if (strEQ(name, "CANNOT_ALLOCATE_RECORDS"))
  445 #ifdef CANNOT_ALLOCATE_RECORDS
  446         return CANNOT_ALLOCATE_RECORDS;
  447 #else
  448         goto not_there;
  449 #endif
  450     if (strEQ(name, "CANNOT_CHANGE"))
  451 #ifdef CANNOT_CHANGE
  452         return CANNOT_CHANGE;
  453 #else
  454         goto not_there;
  455 #endif
  456     if (strEQ(name, "CANNOT_COMPRESS"))
  457 #ifdef CANNOT_COMPRESS
  458         return CANNOT_COMPRESS;
  459 #else
  460         goto not_there;
  461 #endif
  462     if (strEQ(name, "CANNOT_SPARSEARRAYS"))
  463 #ifdef CANNOT_SPARSEARRAYS
  464         return CANNOT_SPARSEARRAYS;
  465 #else
  466         goto not_there;
  467 #endif
  468     if (strEQ(name, "CANNOT_SPARSERECORDS"))
  469 #ifdef CANNOT_SPARSERECORDS
  470         return CANNOT_SPARSERECORDS;
  471 #else
  472         goto not_there;
  473 #endif
  474     if (strEQ(name, "CDF_"))
  475 #ifdef CDF_
  476         return CDF_;
  477 #else
  478         goto not_there;
  479 #endif
  480     if (strEQ(name, "CDF_ACCESS_"))
  481 #ifdef CDF_ACCESS_
  482         return CDF_ACCESS_;
  483 #else
  484         goto not_there;
  485 #endif
  486     if (strEQ(name, "CDF_BYTE"))
  487 #ifdef CDF_BYTE
  488         return CDF_BYTE;
  489 #else
  490         goto not_there;
  491 #endif
  492     if (strEQ(name, "CDF_CACHESIZE_"))
  493 #ifdef CDF_CACHESIZE_
  494         return CDF_CACHESIZE_;
  495 #else
  496         goto not_there;
  497 #endif
  498     if (strEQ(name, "CDF_CHAR"))
  499 #ifdef CDF_CHAR
  500         return CDF_CHAR;
  501 #else
  502         goto not_there;
  503 #endif
  504     if (strEQ(name, "CDF_CHECKSUM_"))
  505 #ifdef CDF_CHECKSUM_
  506         return CDF_CHECKSUM_;
  507 #else
  508         goto not_there;
  509 #endif
  510     if (strEQ(name, "CDF_CLOSE_ERROR"))
  511 #ifdef CDF_CLOSE_ERROR
  512         return CDF_CLOSE_ERROR;
  513 #else
  514         goto not_there;
  515 #endif
  516     if (strEQ(name, "CDF_COMPRESSION_"))
  517 #ifdef CDF_COMPRESSION_
  518         return CDF_COMPRESSION_;
  519 #else
  520         goto not_there;
  521 #endif
  522     if (strEQ(name, "CDF_COPYRIGHT_"))
  523 #ifdef CDF_COPYRIGHT_
  524         return CDF_COPYRIGHT_;
  525 #else
  526         goto not_there;
  527 #endif
  528     if (strEQ(name, "CDF_CREATE_ERROR"))
  529 #ifdef CDF_CREATE_ERROR
  530         return CDF_CREATE_ERROR;
  531 #else
  532         goto not_there;
  533 #endif
  534     if (strEQ(name, "CDF_DECODING_"))
  535 #ifdef CDF_DECODING_
  536         return CDF_DECODING_;
  537 #else
  538         goto not_there;
  539 #endif
  540     if (strEQ(name, "CDF_DELETE_ERROR"))
  541 #ifdef CDF_DELETE_ERROR
  542         return CDF_DELETE_ERROR;
  543 #else
  544         goto not_there;
  545 #endif
  546     if (strEQ(name, "CDF_DIMCOUNTS_"))
  547 #ifdef CDF_DIMCOUNTS_
  548         return CDF_DIMCOUNTS_;
  549 #else
  550         goto not_there;
  551 #endif
  552     if (strEQ(name, "CDF_DIMINDICES_"))
  553 #ifdef CDF_DIMINDICES_
  554         return CDF_DIMINDICES_;
  555 #else
  556         goto not_there;
  557 #endif
  558     if (strEQ(name, "CDF_DIMINTERVALS_"))
  559 #ifdef CDF_DIMINTERVALS_
  560         return CDF_DIMINTERVALS_;
  561 #else
  562         goto not_there;
  563 #endif
  564     if (strEQ(name, "CDF_DIMSIZES_"))
  565 #ifdef CDF_DIMSIZES_
  566         return CDF_DIMSIZES_;
  567 #else
  568         goto not_there;
  569 #endif
  570     if (strEQ(name, "CDF_DOUBLE"))
  571 #ifdef CDF_DOUBLE
  572         return CDF_DOUBLE;
  573 #else
  574         goto not_there;
  575 #endif
  576     if (strEQ(name, "CDF_ENCODING_"))
  577 #ifdef CDF_ENCODING_
  578         return CDF_ENCODING_;
  579 #else
  580         goto not_there;
  581 #endif
  582     if (strEQ(name, "CDF_EPOCH"))
  583 #ifdef CDF_EPOCH
  584         return CDF_EPOCH;
  585 #else
  586         goto not_there;
  587 #endif
  588     if (strEQ(name, "CDF_EPOCH16"))
  589 #ifdef CDF_EPOCH16
  590         return CDF_EPOCH16;
  591 #else
  592         goto not_there;
  593 #endif
  594     if (strEQ(name, "CDF_EXISTS"))
  595 #ifdef CDF_EXISTS
  596         return CDF_EXISTS;
  597 #else
  598         goto not_there;
  599 #endif
  600     if (strEQ(name, "CDF_FLOAT"))
  601 #ifdef CDF_FLOAT
  602         return CDF_FLOAT;
  603 #else
  604         goto not_there;
  605 #endif
  606     if (strEQ(name, "CDF_FORMAT_"))
  607 #ifdef CDF_FORMAT_
  608         return CDF_FORMAT_;
  609 #else
  610         goto not_there;
  611 #endif
  612     if (strEQ(name, "CDF_INCREMENT_"))
  613 #ifdef CDF_INCREMENT_
  614         return CDF_INCREMENT_;
  615 #else
  616         goto not_there;
  617 #endif
  618         if (strEQ(name, "CDF_INFO_"))
  619 #ifdef CDF_INFO_
  620             return CDF_INFO_;
  621 #else
  622             goto not_there;
  623 #endif
  624     if (strEQ(name, "CDF_INT1"))
  625 #ifdef CDF_INT1
  626         return CDF_INT1;
  627 #else
  628         goto not_there;
  629 #endif
  630     if (strEQ(name, "CDF_INT2"))
  631 #ifdef CDF_INT2
  632         return CDF_INT2;
  633 #else
  634         goto not_there;
  635 #endif
  636     if (strEQ(name, "CDF_INT4"))
  637 #ifdef CDF_INT4
  638         return CDF_INT4;
  639 #else
  640         goto not_there;
  641 #endif
  642     if (strEQ(name, "CDF_INT8"))
  643 #ifdef CDF_INT8
  644         return CDF_INT8;
  645 #else
  646         goto not_there;
  647 #endif
  648     if (strEQ(name, "CDF_INTERNAL_ERROR"))
  649 #ifdef CDF_INTERNAL_ERROR
  650         return CDF_INTERNAL_ERROR;
  651 #else
  652         goto not_there;
  653 #endif
  654     if (strEQ(name, "CDF_LEAPSECONDLASTUPDATED_"))
  655 #ifdef CDF_LEAPSECONDLASTUPDATED_
  656         return CDF_LEAPSECONDLASTUPDATED_;
  657 #else
  658         goto not_there;
  659 #endif
  660     if (strEQ(name, "CDF_MAJORITY_"))
  661 #ifdef CDF_MAJORITY_
  662         return CDF_MAJORITY_;
  663 #else
  664         goto not_there;
  665 #endif
  666     if (strEQ(name, "CDF_MAXREC_"))
  667 #ifdef CDF_MAXREC_
  668         return CDF_MAXREC_;
  669 #else
  670         goto not_there;
  671 #endif
  672     if (strEQ(name, "CDF_MAX_DIMS"))
  673 #ifdef CDF_MAX_DIMS
  674         return CDF_MAX_DIMS;
  675 #else
  676         goto not_there;
  677 #endif
  678         if (strEQ(name, "CDF_MAX_PARMS"))
  679 #ifdef CDF_MAX_PARMS
  680             return CDF_MAX_PARMS;
  681 #else
  682             goto not_there;
  683 #endif
  684     if (strEQ(name, "CDF_MIN_DIMS"))
  685 #ifdef CDF_MIN_DIMS
  686         return CDF_MIN_DIMS;
  687 #else
  688         goto not_there;
  689 #endif
  690     if (strEQ(name, "CDF_NAME_"))
  691 #ifdef CDF_NAME_
  692         return CDF_NAME_;
  693 #else
  694         goto not_there;
  695 #endif
  696     if (strEQ(name, "CDF_NAME_TRUNC"))
  697 #ifdef CDF_NAME_TRUNC
  698         return CDF_NAME_TRUNC;
  699 #else
  700         goto not_there;
  701 #endif
  702     if (strEQ(name, "CDF_NEGtoPOSfp0_MODE_"))
  703 #ifdef CDF_NEGtoPOSfp0_MODE_
  704         return CDF_NEGtoPOSfp0_MODE_;
  705 #else
  706         goto not_there;
  707 #endif
  708     if (strEQ(name, "CDF_NUMATTRS_"))
  709 #ifdef CDF_NUMATTRS_
  710         return CDF_NUMATTRS_;
  711 #else
  712         goto not_there;
  713 #endif
  714     if (strEQ(name, "CDF_NUMDIMS_"))
  715 #ifdef CDF_NUMDIMS_
  716         return CDF_NUMDIMS_;
  717 #else
  718         goto not_there;
  719 #endif
  720     if (strEQ(name, "CDF_NUMVARS_"))
  721 #ifdef CDF_NUMVARS_
  722         return CDF_NUMVARS_;
  723 #else
  724         goto not_there;
  725 #endif
  726     if (strEQ(name, "CDF_NUMgATTRS_"))
  727 #ifdef CDF_NUMgATTRS_
  728         return CDF_NUMgATTRS_;
  729 #else
  730         goto not_there;
  731 #endif
  732     if (strEQ(name, "CDF_NUMrVARS_"))
  733 #ifdef CDF_NUMrVARS_
  734         return CDF_NUMrVARS_;
  735 #else
  736         goto not_there;
  737 #endif
  738     if (strEQ(name, "CDF_NUMvATTRS_"))
  739 #ifdef CDF_NUMvATTRS_
  740         return CDF_NUMvATTRS_;
  741 #else
  742         goto not_there;
  743 #endif
  744     if (strEQ(name, "CDF_NUMzVARS_"))
  745 #ifdef CDF_NUMzVARS_
  746         return CDF_NUMzVARS_;
  747 #else
  748         goto not_there;
  749 #endif
  750     if (strEQ(name, "CDF_OK"))
  751 #ifdef CDF_OK
  752         return CDF_OK;
  753 #else
  754         goto not_there;
  755 #endif
  756     if (strEQ(name, "CDF_OPEN_ERROR"))
  757 #ifdef CDF_OPEN_ERROR
  758         return CDF_OPEN_ERROR;
  759 #else
  760         goto not_there;
  761 #endif
  762     if (strEQ(name, "CDF_READONLY_MODE_"))
  763 #ifdef CDF_READONLY_MODE_
  764         return CDF_READONLY_MODE_;
  765 #else
  766         goto not_there;
  767 #endif
  768     if (strEQ(name, "CDF_READ_ERROR"))
  769 #ifdef CDF_READ_ERROR
  770         return CDF_READ_ERROR;
  771 #else
  772         goto not_there;
  773 #endif
  774     if (strEQ(name, "CDF_REAL4"))
  775 #ifdef CDF_REAL4
  776         return CDF_REAL4;
  777 #else
  778         goto not_there;
  779 #endif
  780     if (strEQ(name, "CDF_REAL8"))
  781 #ifdef CDF_REAL8
  782         return CDF_REAL8;
  783 #else
  784         goto not_there;
  785 #endif
  786     if (strEQ(name, "CDF_RECCOUNT_"))
  787 #ifdef CDF_RECCOUNT_
  788         return CDF_RECCOUNT_;
  789 #else
  790         goto not_there;
  791 #endif
  792     if (strEQ(name, "CDF_RECINTERVAL_"))
  793 #ifdef CDF_RECINTERVAL_
  794         return CDF_RECINTERVAL_;
  795 #else
  796         goto not_there;
  797 #endif
  798     if (strEQ(name, "CDF_RECNUMBER_"))
  799 #ifdef CDF_RECNUMBER_
  800         return CDF_RECNUMBER_;
  801 #else
  802         goto not_there;
  803 #endif
  804     if (strEQ(name, "CDF_RELEASE_"))
  805 #ifdef CDF_RELEASE_
  806         return CDF_RELEASE_;
  807 #else
  808         goto not_there;
  809 #endif
  810         if (strEQ(name, "CDF_SCRATCHDIR_"))
  811 #ifdef CDF_SCRATCHDIR_
  812             return CDF_SCRATCHDIR_;
  813 #else
  814             goto not_there;
  815 #endif
  816     if (strEQ(name, "CDF_STATUS_"))
  817 #ifdef CDF_STATUS_
  818         return CDF_STATUS_;
  819 #else
  820         goto not_there;
  821 #endif
  822     if (strEQ(name, "CDF_TIME_TT2000"))
  823 #ifdef CDF_TIME_TT2000
  824         return CDF_TIME_TT2000;
  825 #else
  826         goto not_there;
  827 #endif
  828     if (strEQ(name, "CDF_UCHAR"))
  829 #ifdef CDF_UCHAR
  830         return CDF_UCHAR;
  831 #else
  832         goto not_there;
  833 #endif
  834     if (strEQ(name, "CDF_UINT1"))
  835 #ifdef CDF_UINT1
  836         return CDF_UINT1;
  837 #else
  838         goto not_there;
  839 #endif
  840     if (strEQ(name, "CDF_UINT2"))
  841 #ifdef CDF_UINT2
  842         return CDF_UINT2;
  843 #else
  844         goto not_there;
  845 #endif
  846     if (strEQ(name, "CDF_UINT4"))
  847 #ifdef CDF_UINT4
  848         return CDF_UINT4;
  849 #else
  850         goto not_there;
  851 #endif
  852     if (strEQ(name, "CDF_VERSION_"))
  853 #ifdef CDF_VERSION_
  854         return CDF_VERSION_;
  855 #else
  856         goto not_there;
  857 #endif
  858     if (strEQ(name, "CDF_WARN"))
  859 #ifdef CDF_WARN
  860         return CDF_WARN;
  861 #else
  862         goto not_there;
  863 #endif
  864     if (strEQ(name, "CDF_WRITE_ERROR"))
  865 #ifdef CDF_WRITE_ERROR
  866         return CDF_WRITE_ERROR;
  867 #else
  868         goto not_there;
  869 #endif
  870     if (strEQ(name, "CDF_zMODE_"))
  871 #ifdef CDF_zMODE_
  872         return CDF_zMODE_;
  873 #else
  874         goto not_there;
  875 #endif
  876     if (strEQ(name, "CDFwithSTATS_"))
  877 #ifdef CDFwithSTATS_
  878         return CDFwithSTATS_;
  879 #else
  880         goto not_there;
  881 #endif
  882     if (strEQ(name, "CHECKSUM_ERROR"))
  883 #ifdef CHECKSUM_ERROR
  884         return CHECKSUM_ERROR;
  885 #else
  886         goto not_there;
  887 #endif
  888         if (strEQ(name, "CHECKSUM_"))
  889 #ifdef CHECKSUM_
  890             return CHECKSUM_;
  891 #else   
  892             goto not_there;
  893 #endif      
  894         if (strEQ(name, "CHECKSUM_NOT_ALLOWED"))
  895 #ifdef CHECKSUM_NOT_ALLOWED
  896             return CHECKSUM_NOT_ALLOWED;
  897 #else
  898             goto not_there;
  899 #endif
  900     if (strEQ(name, "CLOSE_"))
  901 #ifdef CLOSE_
  902         return CLOSE_;
  903 #else
  904         goto not_there;
  905 #endif
  906     if (strEQ(name, "COLUMN_MAJOR"))
  907 #ifdef COLUMN_MAJOR
  908         return COLUMN_MAJOR;
  909 #else
  910         goto not_there;
  911 #endif
  912     if (strEQ(name, "COL_MAJOR"))
  913 #ifdef COL_MAJOR
  914         return COL_MAJOR;
  915 #else
  916         goto not_there;
  917 #endif
  918         if (strEQ(name, "COMPRESSION_ERROR"))
  919 #ifdef COMPRESSION_ERROR
  920             return COMPRESSION_ERROR;
  921 #else
  922             goto not_there;
  923 #endif
  924         if (strEQ(name, "COMPRESS_CACHESIZE_"))
  925 #ifdef COMPRESS_CACHESIZE_
  926             return COMPRESS_CACHESIZE_;
  927 #else
  928             goto not_there;
  929 #endif
  930     if (strEQ(name, "CONFIRM_"))
  931 #ifdef CONFIRM_
  932         return CONFIRM_;
  933 #else
  934         goto not_there;
  935 #endif
  936     if (strEQ(name, "CORRUPTED_V2_CDF"))
  937 #ifdef CORRUPTED_V2_CDF
  938         return CORRUPTED_V2_CDF;
  939 #else
  940         goto not_there;
  941 #endif
  942     if (strEQ(name, "CREATE_"))
  943 #ifdef CREATE_
  944         return CREATE_;
  945 #else
  946         goto not_there;
  947 #endif
  948     if (strEQ(name, "CURgENTRY_EXISTENCE_"))
  949 #ifdef CURgENTRY_EXISTENCE_
  950         return CURgENTRY_EXISTENCE_;
  951 #else
  952         goto not_there;
  953 #endif
  954     if (strEQ(name, "CURrENTRY_EXISTENCE_"))
  955 #ifdef CURrENTRY_EXISTENCE_
  956         return CURrENTRY_EXISTENCE_;
  957 #else
  958         goto not_there;
  959 #endif
  960     if (strEQ(name, "CURzENTRY_EXISTENCE_"))
  961 #ifdef CURzENTRY_EXISTENCE_
  962         return CURzENTRY_EXISTENCE_;
  963 #else
  964         goto not_there;
  965 #endif
  966     break;
  967     case 'D':
  968     if (strEQ(name, "DATATYPE_SIZE_"))
  969 #ifdef DATATYPE_SIZE_
  970         return DATATYPE_SIZE_;
  971 #else
  972         goto not_there;
  973 #endif
  974     if (strEQ(name, "DECOMPRESSION_ERROR"))
  975 #ifdef DECOMPRESSION_ERROR
  976         return DECOMPRESSION_ERROR;
  977 #else
  978         goto not_there;
  979 #endif
  980     if (strEQ(name, "DECSTATION_DECODING"))
  981 #ifdef DECSTATION_DECODING
  982         return DECSTATION_DECODING;
  983 #else
  984         goto not_there;
  985 #endif
  986     if (strEQ(name, "DECSTATION_ENCODING"))
  987 #ifdef DECSTATION_ENCODING
  988         return DECSTATION_ENCODING;
  989 #else
  990         goto not_there;
  991 #endif
  992     if (strEQ(name, "DELETE_"))
  993 #ifdef DELETE_
  994         return DELETE_;
  995 #else
  996         goto not_there;
  997 #endif
  998     if (strEQ(name, "DID_NOT_COMPRESS"))
  999 #ifdef DID_NOT_COMPRESS
 1000         return DID_NOT_COMPRESS;
 1001 #else
 1002         goto not_there;
 1003 #endif
 1004     if (strEQ(name, "EMPTY_COMPRESSED_CDF"))
 1005 #ifdef EMPTY_COMPRESSED_CDF
 1006         return EMPTY_COMPRESSED_CDF;
 1007 #else
 1008         goto not_there;
 1009 #endif
 1010     break;
 1011     case 'E':
 1012     if (strEQ(name, "END_OF_VAR"))
 1013 #ifdef END_OF_VAR
 1014         return END_OF_VAR;
 1015 #else
 1016         goto not_there;
 1017 #endif
 1018     if (strEQ(name, "ENTRY_"))
 1019 #ifdef ENTRY_
 1020         return ENTRY_;
 1021 #else
 1022         goto not_there;
 1023 #endif
 1024     if (strEQ(name, "ENTRY_DATATYPE_"))
 1025 #ifdef ENTRY_DATATYPE_
 1026         return ENTRY_DATATYPE_;
 1027 #else
 1028         goto not_there;
 1029 #endif
 1030     if (strEQ(name, "ENTRY_DATA_"))
 1031 #ifdef ENTRY_DATA_
 1032         return ENTRY_DATA_;
 1033 #else
 1034         goto not_there;
 1035 #endif
 1036     if (strEQ(name, "ENTRY_NUMELEMS_"))
 1037 #ifdef ENTRY_NUMELEMS_
 1038         return ENTRY_NUMELEMS_;
 1039 #else
 1040         goto not_there;
 1041 #endif
 1042     if (strEQ(name, "EPOCH_STRING_LEN"))
 1043 #ifdef EPOCH_STRING_LEN
 1044         return EPOCH_STRING_LEN;
 1045 #else
 1046         goto not_there;
 1047 #endif
 1048     if (strEQ(name, "EPOCH1_STRING_LEN"))
 1049 #ifdef EPOCH1_STRING_LEN
 1050         return EPOCH1_STRING_LEN;
 1051 #else
 1052         goto not_there;
 1053 #endif
 1054     if (strEQ(name, "EPOCH2_STRING_LEN"))
 1055 #ifdef EPOCH2_STRING_LEN
 1056         return EPOCH2_STRING_LEN;
 1057 #else
 1058         goto not_there;
 1059 #endif
 1060     if (strEQ(name, "EPOCH3_STRING_LEN"))
 1061 #ifdef EPOCH3_STRING_LEN
 1062         return EPOCH3_STRING_LEN;
 1063 #else
 1064         goto not_there;
 1065 #endif
 1066     if (strEQ(name, "EPOCH4_STRING_LEN"))
 1067 #ifdef EPOCH4_STRING_LEN
 1068         return EPOCH4_STRING_LEN;
 1069 #else
 1070         goto not_there;
 1071 #endif
 1072     if (strEQ(name, "EPOCH16_STRING_LEN"))
 1073 #ifdef EPOCH16_STRING_LEN
 1074         return EPOCH16_STRING_LEN;
 1075 #else
 1076         goto not_there;
 1077 #endif
 1078     if (strEQ(name, "EPOCH16_1_STRING_LEN"))
 1079 #ifdef EPOCH16_1_STRING_LEN
 1080         return EPOCH16_1_STRING_LEN;
 1081 #else
 1082         goto not_there;
 1083 #endif
 1084     if (strEQ(name, "EPOCH16_2_STRING_LEN"))
 1085 #ifdef EPOCH16_2_STRING_LEN
 1086         return EPOCH16_2_STRING_LEN;
 1087 #else
 1088         goto not_there;
 1089 #endif
 1090     if (strEQ(name, "EPOCH16_3_STRING_LEN"))
 1091 #ifdef EPOCH16_3_STRING_LEN
 1092         return EPOCH16_3_STRING_LEN;
 1093 #else
 1094         goto not_there;
 1095 #endif
 1096     if (strEQ(name, "EPOCH16_4_STRING_LEN"))
 1097 #ifdef EPOCH16_4_STRING_LEN
 1098         return EPOCH16_4_STRING_LEN;
 1099 #else
 1100         goto not_there;
 1101 #endif
 1102     if (strEQ(name, "EPOCHx_FORMAT_MAX"))
 1103 #ifdef EPOCHx_FORMAT_MAX
 1104         return EPOCHx_FORMAT_MAX;
 1105 #else
 1106         goto not_there;
 1107 #endif
 1108     if (strEQ(name, "EPOCHx_STRING_MAX"))
 1109 #ifdef EPOCHx_STRING_MAX
 1110         return EPOCHx_STRING_MAX;
 1111 #else
 1112         goto not_there;
 1113 #endif
 1114     break;
 1115     case 'F':
 1116     if (strEQ(name, "FORCED_PARAMETER"))
 1117 #ifdef FORCED_PARAMETER
 1118         return FORCED_PARAMETER;
 1119 #else
 1120         goto not_there;
 1121 #endif
 1122     break;
 1123     case 'G':
 1124     if (strEQ(name, "GET_"))
 1125 #ifdef GET_
 1126         return GET_;
 1127 #else
 1128         goto not_there;
 1129 #endif
 1130     if (strEQ(name, "GLOBAL_SCOPE"))
 1131 #ifdef GLOBAL_SCOPE
 1132         return GLOBAL_SCOPE;
 1133 #else
 1134         goto not_there;
 1135 #endif
 1136     if (strEQ(name, "GLOBAL_SCOPE_ASSUMED"))
 1137 #ifdef GLOBAL_SCOPE_ASSUMED
 1138         return GLOBAL_SCOPE_ASSUMED;
 1139 #else
 1140         goto not_there;
 1141 #endif
 1142     if (strEQ(name, "GZIP_COMPRESSION"))
 1143 #ifdef GZIP_COMPRESSION
 1144         return GZIP_COMPRESSION;
 1145 #else
 1146         goto not_there;
 1147 #endif
 1148     break;
 1149     case 'H':
 1150     if (strEQ(name, "HOST_DECODING"))
 1151 #ifdef HOST_DECODING
 1152         return HOST_DECODING;
 1153 #else
 1154         goto not_there;
 1155 #endif
 1156     if (strEQ(name, "HOST_ENCODING"))
 1157 #ifdef HOST_ENCODING
 1158         return HOST_ENCODING;
 1159 #else
 1160         goto not_there;
 1161 #endif
 1162     if (strEQ(name, "HP_DECODING"))
 1163 #ifdef HP_DECODING
 1164         return HP_DECODING;
 1165 #else
 1166         goto not_there;
 1167 #endif
 1168     if (strEQ(name, "HP_ENCODING"))
 1169 #ifdef HP_ENCODING
 1170         return HP_ENCODING;
 1171 #else
 1172         goto not_there;
 1173 #endif
 1174     if (strEQ(name, "HUFF_COMPRESSION"))
 1175 #ifdef HUFF_COMPRESSION
 1176         return HUFF_COMPRESSION;
 1177 #else
 1178         goto not_there;
 1179 #endif
 1180     break;
 1181     case 'I':
 1182         if (strEQ(name, "IA64VMSd_DECODING"))
 1183 #ifdef IA64VMSd_DECODING
 1184             return IA64VMSd_DECODING;
 1185 #else
 1186             goto not_there;
 1187 #endif
 1188         if (strEQ(name, "IA64VMSd_ENCODING"))
 1189 #ifdef IA64VMSd_ENCODING
 1190             return IA64VMSd_ENCODING;
 1191 #else
 1192             goto not_there;
 1193 #endif
 1194         if (strEQ(name, "IA64VMSg_DECODING"))
 1195 #ifdef IA64VMSg_DECODING
 1196             return IA64VMSg_DECODING;
 1197 #else
 1198             goto not_there;
 1199 #endif
 1200         if (strEQ(name, "IA64VMSg_ENCODING"))
 1201 #ifdef IA64VMSg_ENCODING
 1202             return IA64VMSg_ENCODING;
 1203 #else
 1204             goto not_there;
 1205 #endif
 1206         if (strEQ(name, "IA64VMSi_DECODING"))
 1207 #ifdef IA64VMSi_DECODING
 1208             return IA64VMSi_DECODING;
 1209 #else
 1210             goto not_there;
 1211 #endif
 1212         if (strEQ(name, "IA64VMSi_ENCODING"))
 1213 #ifdef IA64VMSi_ENCODING
 1214             return IA64VMSi_ENCODING;
 1215 #else
 1216             goto not_there;
 1217 #endif
 1218     if (strEQ(name, "IBMPC_DECODING"))
 1219 #ifdef IBMPC_DECODING
 1220         return IBMPC_DECODING;
 1221 #else
 1222         goto not_there;
 1223 #endif
 1224     if (strEQ(name, "IBMPC_ENCODING"))
 1225 #ifdef IBMPC_ENCODING
 1226         return IBMPC_ENCODING;
 1227 #else
 1228         goto not_there;
 1229 #endif
 1230     if (strEQ(name, "IBMRS_DECODING"))
 1231 #ifdef IBMRS_DECODING
 1232         return IBMRS_DECODING;
 1233 #else
 1234         goto not_there;
 1235 #endif
 1236     if (strEQ(name, "IBMRS_ENCODING"))
 1237 #ifdef IBMRS_ENCODING
 1238         return IBMRS_ENCODING;
 1239 #else
 1240         goto not_there;
 1241 #endif
 1242     if (strEQ(name, "IBM_PC_OVERFLOW"))
 1243 #ifdef IBM_PC_OVERFLOW
 1244         return IBM_PC_OVERFLOW;
 1245 #else
 1246         goto not_there;
 1247 #endif
 1248     if (strEQ(name, "ILLEGAL_EPOCH_VALUE"))
 1249 #ifdef ILLEGAL_EPOCH_VALUE
 1250         return ILLEGAL_EPOCH_VALUE;
 1251 #else
 1252         goto not_there;
 1253 #endif
 1254     if (strEQ(name, "ILLEGAL_FOR_SCOPE"))
 1255 #ifdef ILLEGAL_FOR_SCOPE
 1256         return ILLEGAL_FOR_SCOPE;
 1257 #else
 1258         goto not_there;
 1259 #endif
 1260     if (strEQ(name, "ILLEGAL_IN_zMODE"))
 1261 #ifdef ILLEGAL_IN_zMODE
 1262         return ILLEGAL_IN_zMODE;
 1263 #else
 1264         goto not_there;
 1265 #endif
 1266     if (strEQ(name, "ILLEGAL_ON_V1_CDF"))
 1267 #ifdef ILLEGAL_ON_V1_CDF
 1268         return ILLEGAL_ON_V1_CDF;
 1269 #else
 1270         goto not_there;
 1271 #endif
 1272     if (strEQ(name, "IS_A_NETCDF"))
 1273 #ifdef IS_A_NETCDF
 1274         return IS_A_NETCDF;
 1275 #else
 1276         goto not_there;
 1277 #endif
 1278     break;
 1279     case 'J':
 1280     break;
 1281     case 'K':
 1282     break;
 1283     case 'L':
 1284     if (strEQ(name, "LIB_COPYRIGHT_"))
 1285 #ifdef LIB_COPYRIGHT_
 1286         return LIB_COPYRIGHT_;
 1287 #else
 1288         goto not_there;
 1289 #endif
 1290     if (strEQ(name, "LIB_INCREMENT_"))
 1291 #ifdef LIB_INCREMENT_
 1292         return LIB_INCREMENT_;
 1293 #else
 1294         goto not_there;
 1295 #endif
 1296     if (strEQ(name, "LIB_RELEASE_"))
 1297 #ifdef LIB_RELEASE_
 1298         return LIB_RELEASE_;
 1299 #else
 1300         goto not_there;
 1301 #endif
 1302     if (strEQ(name, "LIB_VERSION_"))
 1303 #ifdef LIB_VERSION_
 1304         return LIB_VERSION_;
 1305 #else
 1306         goto not_there;
 1307 #endif
 1308     if (strEQ(name, "LIB_subINCREMENT_"))
 1309 #ifdef LIB_subINCREMENT_
 1310         return LIB_subINCREMENT_;
 1311 #else
 1312         goto not_there;
 1313 #endif
 1314     break;
 1315     case 'M':
 1316     if (strEQ(name, "MAC_DECODING"))
 1317 #ifdef MAC_DECODING
 1318         return MAC_DECODING;
 1319 #else
 1320         goto not_there;
 1321 #endif
 1322     if (strEQ(name, "MAC_ENCODING"))
 1323 #ifdef MAC_ENCODING
 1324         return MAC_ENCODING;
 1325 #else
 1326         goto not_there;
 1327 #endif
 1328     if (strEQ(name, "MD5_CHECKSUM"))
 1329 #ifdef MD5_CHECKSUM
 1330         return MD5_CHECKSUM;
 1331 #else
 1332         goto not_there;
 1333 #endif
 1334     if (strEQ(name, "MIPSEB_ENCODING"))
 1335 #ifdef MIPSEB_ENCODING
 1336         return MIPSEB_ENCODING;
 1337 #else
 1338         goto not_there;
 1339 #endif
 1340     if (strEQ(name, "MIPSEL_ENCODING"))
 1341 #ifdef MIPSEL_ENCODING
 1342         return MIPSEL_ENCODING;
 1343 #else
 1344         goto not_there;
 1345 #endif
 1346     if (strEQ(name, "MULTI_FILE"))
 1347 #ifdef MULTI_FILE
 1348         return MULTI_FILE;
 1349 #else
 1350         goto not_there;
 1351 #endif
 1352     if (strEQ(name, "MULTI_FILE_FORMAT"))
 1353 #ifdef MULTI_FILE_FORMAT
 1354         return MULTI_FILE_FORMAT;
 1355 #else
 1356         goto not_there;
 1357 #endif
 1358     break;
 1359     case 'N':
 1360     if (strEQ(name, "NA_FOR_VARIABLE"))
 1361 #ifdef NA_FOR_VARIABLE
 1362         return NA_FOR_VARIABLE;
 1363 #else
 1364         goto not_there;
 1365 #endif
 1366     if (strEQ(name, "NEGATIVE_FP_ZERO"))
 1367 #ifdef NEGATIVE_FP_ZERO
 1368         return NEGATIVE_FP_ZERO;
 1369 #else
 1370         goto not_there;
 1371 #endif
 1372     if (strEQ(name, "NEGtoPOSfp0off"))
 1373 #ifdef NEGtoPOSfp0off
 1374         return NEGtoPOSfp0off;
 1375 #else
 1376         goto not_there;
 1377 #endif
 1378     if (strEQ(name, "NEGtoPOSfp0on"))
 1379 #ifdef NEGtoPOSfp0on
 1380         return NEGtoPOSfp0on;
 1381 #else
 1382         goto not_there;
 1383 #endif
 1384     if (strEQ(name, "NETWORK_DECODING"))
 1385 #ifdef NETWORK_DECODING
 1386         return NETWORK_DECODING;
 1387 #else
 1388         goto not_there;
 1389 #endif
 1390     if (strEQ(name, "NETWORK_ENCODING"))
 1391 #ifdef NETWORK_ENCODING
 1392         return NETWORK_ENCODING;
 1393 #else
 1394         goto not_there;
 1395 #endif
 1396     if (strEQ(name, "NOT_A_CDF"))
 1397 #ifdef NOT_A_CDF
 1398         return NOT_A_CDF;
 1399 #else
 1400         goto not_there;
 1401 #endif
 1402     if (strEQ(name, "NOVARY"))
 1403 #ifdef NOVARY
 1404         return NOVARY;
 1405 #else
 1406         goto not_there;
 1407 #endif
 1408     if (strEQ(name, "NO_ATTR_SELECTED"))
 1409 #ifdef NO_ATTR_SELECTED
 1410         return NO_ATTR_SELECTED;
 1411 #else
 1412         goto not_there;
 1413 #endif
 1414     if (strEQ(name, "NO_CDF_SELECTED"))
 1415 #ifdef NO_CDF_SELECTED
 1416         return NO_CDF_SELECTED;
 1417 #else
 1418         goto not_there;
 1419 #endif
 1420     if (strEQ(name, "NO_CHECKSUM"))
 1421 #ifdef NO_CHECKSUM
 1422         return NO_CHECKSUM;
 1423 #else
 1424         goto not_there;
 1425 #endif
 1426     if (strEQ(name, "NO_COMPRESSION"))
 1427 #ifdef NO_COMPRESSION
 1428         return NO_COMPRESSION;
 1429 #else
 1430         goto not_there;
 1431 #endif
 1432     if (strEQ(name, "NO_DELETE_ACCESS"))
 1433 #ifdef NO_DELETE_ACCESS
 1434         return NO_DELETE_ACCESS;
 1435 #else
 1436         goto not_there;
 1437 #endif
 1438     if (strEQ(name, "NO_ENTRY_SELECTED"))
 1439 #ifdef NO_ENTRY_SELECTED
 1440         return NO_ENTRY_SELECTED;
 1441 #else
 1442         goto not_there;
 1443 #endif
 1444     if (strEQ(name, "NO_MORE_ACCESS"))
 1445 #ifdef NO_MORE_ACCESS
 1446         return NO_MORE_ACCESS;
 1447 #else
 1448         goto not_there;
 1449 #endif
 1450     if (strEQ(name, "NO_PADVALUE_SPECIFIED"))
 1451 #ifdef NO_PADVALUE_SPECIFIED
 1452         return NO_PADVALUE_SPECIFIED;
 1453 #else
 1454         goto not_there;
 1455 #endif
 1456     if (strEQ(name, "NO_SPARSEARRAYS"))
 1457 #ifdef NO_SPARSEARRAYS
 1458         return NO_SPARSEARRAYS;
 1459 #else
 1460         goto not_there;
 1461 #endif
 1462     if (strEQ(name, "NO_SPARSERECORDS"))
 1463 #ifdef NO_SPARSERECORDS
 1464         return NO_SPARSERECORDS;
 1465 #else
 1466         goto not_there;
 1467 #endif
 1468     if (strEQ(name, "NO_STATUS_SELECTED"))
 1469 #ifdef NO_STATUS_SELECTED
 1470         return NO_STATUS_SELECTED;
 1471 #else
 1472         goto not_there;
 1473 #endif
 1474     if (strEQ(name, "NO_SUCH_ATTR"))
 1475 #ifdef NO_SUCH_ATTR
 1476         return NO_SUCH_ATTR;
 1477 #else
 1478         goto not_there;
 1479 #endif
 1480     if (strEQ(name, "NO_SUCH_CDF"))
 1481 #ifdef NO_SUCH_CDF
 1482         return NO_SUCH_CDF;
 1483 #else
 1484         goto not_there;
 1485 #endif
 1486     if (strEQ(name, "NO_SUCH_ENTRY"))
 1487 #ifdef NO_SUCH_ENTRY
 1488         return NO_SUCH_ENTRY;
 1489 #else
 1490         goto not_there;
 1491 #endif
 1492     if (strEQ(name, "NO_SUCH_RECORD"))
 1493 #ifdef NO_SUCH_RECORD
 1494         return NO_SUCH_RECORD;
 1495 #else
 1496         goto not_there;
 1497 #endif
 1498     if (strEQ(name, "NO_SUCH_VAR"))
 1499 #ifdef NO_SUCH_VAR
 1500         return NO_SUCH_VAR;
 1501 #else
 1502         goto not_there;
 1503 #endif
 1504     if (strEQ(name, "NO_VARS_IN_CDF"))
 1505 #ifdef NO_VARS_IN_CDF
 1506         return NO_VARS_IN_CDF;
 1507 #else
 1508         goto not_there;
 1509 #endif
 1510     if (strEQ(name, "NO_VAR_SELECTED"))
 1511 #ifdef NO_VAR_SELECTED
 1512         return NO_VAR_SELECTED;
 1513 #else
 1514         goto not_there;
 1515 #endif
 1516     if (strEQ(name, "NO_WRITE_ACCESS"))
 1517 #ifdef NO_WRITE_ACCESS
 1518         return NO_WRITE_ACCESS;
 1519 #else
 1520         goto not_there;
 1521 #endif
 1522         if (strEQ(name, "NONE_CHECKSUM"))
 1523 #ifdef NONE_CHECKSUM
 1524             return NONE_CHECKSUM;
 1525 #else
 1526             goto not_there;
 1527 #endif
 1528     if (strEQ(name, "NULL_"))
 1529 #ifdef NULL_
 1530         return NULL_;
 1531 #else
 1532         goto not_there;
 1533 #endif
 1534     if (strEQ(name, "NeXT_DECODING"))
 1535 #ifdef NeXT_DECODING
 1536         return NeXT_DECODING;
 1537 #else
 1538         goto not_there;
 1539 #endif
 1540     if (strEQ(name, "NeXT_ENCODING"))
 1541 #ifdef NeXT_ENCODING
 1542         return NeXT_ENCODING;
 1543 #else
 1544         goto not_there;
 1545 #endif
 1546     break;
 1547     case 'O':
 1548     if (strEQ(name, "OPEN_"))
 1549 #ifdef OPEN_
 1550         return OPEN_;
 1551 #else
 1552         goto not_there;
 1553 #endif
 1554     if (strEQ(name, "OPTIMAL_ENCODING_TREES"))
 1555 #ifdef OPTIMAL_ENCODING_TREES
 1556         return OPTIMAL_ENCODING_TREES;
 1557 #else
 1558         goto not_there;
 1559 #endif
 1560     break;
 1561     case 'P':
 1562         if (strEQ(name, "PAD_SPARSERECORDS"))
 1563 #ifdef PAD_SPARSERECORDS
 1564             return PAD_SPARSERECORDS;
 1565 #else
 1566             goto not_there;
 1567 #endif
 1568         if (strEQ(name, "PRECEEDING_RECORDS_ALLOCATED"))
 1569 #ifdef PRECEEDING_RECORDS_ALLOCATED
 1570             return PRECEEDING_RECORDS_ALLOCATED;
 1571 #else
 1572             goto not_there;
 1573 #endif
 1574         if (strEQ(name, "PREV_SPARSERECORDS"))
 1575 #ifdef PREV_SPARSERECORDS
 1576             return PREV_SPARSERECORDS;
 1577 #else
 1578             goto not_there;
 1579 #endif
 1580     if (strEQ(name, "PUT_"))
 1581 #ifdef PUT_
 1582         return PUT_;
 1583 #else
 1584         goto not_there;
 1585 #endif
 1586     break;
 1587     case 'Q':
 1588     break;
 1589     case 'R':
 1590     if (strEQ(name, "READONLYoff"))
 1591 #ifdef READONLYoff
 1592         return READONLYoff;
 1593 #else
 1594         goto not_there;
 1595 #endif
 1596     if (strEQ(name, "READONLYon"))
 1597 #ifdef READONLYon
 1598         return READONLYon;
 1599 #else
 1600         goto not_there;
 1601 #endif
 1602     if (strEQ(name, "READ_ONLY_DISTRIBUTION"))
 1603 #ifdef READ_ONLY_DISTRIBUTION
 1604         return READ_ONLY_DISTRIBUTION;
 1605 #else
 1606         goto not_there;
 1607 #endif
 1608     if (strEQ(name, "READ_ONLY_MODE"))
 1609 #ifdef READ_ONLY_MODE
 1610         return READ_ONLY_MODE;
 1611 #else
 1612         goto not_there;
 1613 #endif
 1614     if (strEQ(name, "RESERVED_CDFSTATUS"))
 1615 #ifdef RESERVED_CDFSTATUS
 1616         return RESERVED_CDFSTATUS;
 1617 #else
 1618         goto not_there;
 1619 #endif
 1620     if (strEQ(name, "RLE_COMPRESSION"))
 1621 #ifdef RLE_COMPRESSION
 1622         return RLE_COMPRESSION;
 1623 #else
 1624         goto not_there;
 1625 #endif
 1626     if (strEQ(name, "RLE_OF_ZEROs"))
 1627 #ifdef RLE_OF_ZEROs
 1628         return RLE_OF_ZEROs;
 1629 #else
 1630         goto not_there;
 1631 #endif
 1632     if (strEQ(name, "ROW_MAJOR"))
 1633 #ifdef ROW_MAJOR
 1634         return ROW_MAJOR;
 1635 #else
 1636         goto not_there;
 1637 #endif
 1638         break;
 1639     case 'S':
 1640         if (strEQ(name, "SCRATCH_CREATE_ERROR"))
 1641 #ifdef SCRATCH_CREATE_ERROR
 1642             return SCRATCH_CREATE_ERROR;
 1643 #else
 1644             goto not_there;
 1645 #endif
 1646         if (strEQ(name, "SCRATCH_DELETE_ERROR"))
 1647 #ifdef SCRATCH_DELETE_ERROR
 1648             return SCRATCH_DELETE_ERROR;
 1649 #else
 1650             goto not_there;
 1651 #endif
 1652         if (strEQ(name, "SCRATCH_READ_ERROR"))
 1653 #ifdef DASCRATCH_READ_ERROR
 1654             return SCRATCH_READ_ERROR;
 1655 #else
 1656             goto not_there;
 1657 #endif
 1658         if (strEQ(name, "SCRATCH_WRITE_ERROR"))
 1659 #ifdef SCRATCH_WRITE_ERROR
 1660             return SCRATCH_WRITE_ERROR;
 1661 #else
 1662             goto not_there;
 1663 #endif
 1664     if (strEQ(name, "SELECT_"))
 1665 #ifdef SELECT_
 1666         return SELECT_;
 1667 #else
 1668         goto not_there;
 1669 #endif
 1670     if (strEQ(name, "SGi_DECODING"))
 1671 #ifdef SGi_DECODING
 1672         return SGi_DECODING;
 1673 #else
 1674         goto not_there;
 1675 #endif
 1676     if (strEQ(name, "SGi_ENCODING"))
 1677 #ifdef SGi_ENCODING
 1678         return SGi_ENCODING;
 1679 #else
 1680         goto not_there;
 1681 #endif
 1682     if (strEQ(name, "SINGLE_FILE"))
 1683 #ifdef SINGLE_FILE
 1684         return SINGLE_FILE;
 1685 #else
 1686         goto not_there;
 1687 #endif
 1688     if (strEQ(name, "SINGLE_FILE_FORMAT"))
 1689 #ifdef SINGLE_FILE_FORMAT
 1690         return SINGLE_FILE_FORMAT;
 1691 #else
 1692         goto not_there;
 1693 #endif
 1694     if (strEQ(name, "SOME_ALREADY_ALLOCATED"))
 1695 #ifdef SOME_ALREADY_ALLOCATED
 1696         return SOME_ALREADY_ALLOCATED;
 1697 #else
 1698         goto not_there;
 1699 #endif
 1700     if (strEQ(name, "STAGE_CACHESIZE_"))
 1701 #ifdef STAGE_CACHESIZE_
 1702         return STAGE_CACHESIZE_;
 1703 #else
 1704         goto not_there;
 1705 #endif
 1706     if (strEQ(name, "STATUS_TEXT_"))
 1707 #ifdef STATUS_TEXT_
 1708         return STATUS_TEXT_;
 1709 #else
 1710         goto not_there;
 1711 #endif
 1712     if (strEQ(name, "SUN_DECODING"))
 1713 #ifdef SUN_DECODING
 1714         return SUN_DECODING;
 1715 #else
 1716         goto not_there;
 1717 #endif
 1718     if (strEQ(name, "SUN_ENCODING"))
 1719 #ifdef SUN_ENCODING
 1720         return SUN_ENCODING;
 1721 #else
 1722         goto not_there;
 1723 #endif
 1724     break;
 1725     case 'T':
 1726     if (strEQ(name, "TOO_MANY_PARMS"))
 1727 #ifdef TOO_MANY_PARMS
 1728         return TOO_MANY_PARMS;
 1729 #else
 1730         goto not_there;
 1731 #endif
 1732     if (strEQ(name, "TOO_MANY_VARS"))
 1733 #ifdef TOO_MANY_VARS
 1734         return TOO_MANY_VARS;
 1735 #else
 1736         goto not_there;
 1737 #endif
 1738     if (strEQ(name, "TT2000_0_STRING_LEN"))
 1739 #ifdef TT2000_0_STRING_LEN
 1740         return TT2000_0_STRING_LEN;
 1741 #else
 1742         goto not_there;
 1743 #endif
 1744     if (strEQ(name, "TT2000_1_STRING_LEN"))
 1745 #ifdef TT2000_1_STRING_LEN
 1746         return TT2000_1_STRING_LEN;
 1747 #else
 1748         goto not_there;
 1749 #endif
 1750     if (strEQ(name, "TT2000_2_STRING_LEN"))
 1751 #ifdef TT2000_2_STRING_LEN
 1752         return TT2000_2_STRING_LEN;
 1753 #else
 1754         goto not_there;
 1755 #endif
 1756     if (strEQ(name, "TT2000_3_STRING_LEN"))
 1757 #ifdef TT2000_3_STRING_LEN
 1758         return TT2000_3_STRING_LEN;
 1759 #else
 1760         goto not_there;
 1761 #endif
 1762     if (strEQ(name, "TT2000_TIME_ERROR"))
 1763 #ifdef TT2000_TIME_ERROR
 1764         return TT2000_TIME_ERROR;
 1765 #else
 1766         goto not_there;
 1767 #endif
 1768     break;
 1769     case 'U':
 1770     if (strEQ(name, "UNABLE_TO_PROCESS_CDF"))
 1771 #ifdef UNABLE_TO_PROCESS_CDF
 1772         return UNABLE_TO_PROCESS_CDF;
 1773 #else
 1774         goto not_there;
 1775 #endif
 1776     if (strEQ(name, "UNKNOWN_COMPRESSION"))
 1777 #ifdef UNKNOWN_COMPRESSION
 1778         return UNKNOWN_COMPRESSION;
 1779 #else
 1780         goto not_there;
 1781 #endif
 1782         if (strEQ(name, "UNKNOWN_SPARSENESS"))
 1783 #ifdef UNKNOWN_SPARSENESS
 1784             return UNKNOWN_SPARSENESS;
 1785 #else
 1786             goto not_there;
 1787 #endif
 1788         if (strEQ(name, "UNSUPPORTED_OPERATION"))
 1789 #ifdef UNSUPPORTED_OPERATION
 1790             return UNSUPPORTED_OPERATION;
 1791 #else
 1792             goto not_there;
 1793 #endif
 1794     break;
 1795     case 'V':
 1796     if (strEQ(name, "VALIDATEFILEoff"))
 1797 #ifdef VALIDATEFILEoff
 1798         return VALIDATEFILEoff;
 1799 #else
 1800         goto not_there;
 1801 #endif
 1802     if (strEQ(name, "VALIDATEFILEon"))
 1803 #ifdef VALIDATEFILEon
 1804         return VALIDATEFILEon;
 1805 #else
 1806         goto not_there;
 1807 #endif
 1808     if (strEQ(name, "VARIABLE_SCOPE"))
 1809 #ifdef VARIABLE_SCOPE
 1810         return VARIABLE_SCOPE;
 1811 #else
 1812         goto not_there;
 1813 #endif
 1814     if (strEQ(name, "VARIABLE_SCOPE_ASSUMED"))
 1815 #ifdef VARIABLE_SCOPE_ASSUMED
 1816         return VARIABLE_SCOPE_ASSUMED;
 1817 #else
 1818         goto not_there;
 1819 #endif
 1820     if (strEQ(name, "VARY"))
 1821 #ifdef VARY
 1822         return VARY;
 1823 #else
 1824         goto not_there;
 1825 #endif
 1826     if (strEQ(name, "VAR_"))
 1827 #ifdef VAR_
 1828         return VAR_;
 1829 #else
 1830         goto not_there;
 1831 #endif
 1832     if (strEQ(name, "VAR_ALREADY_CLOSED"))
 1833 #ifdef VAR_ALREADY_CLOSED
 1834         return VAR_ALREADY_CLOSED;
 1835 #else
 1836         goto not_there;
 1837 #endif
 1838     if (strEQ(name, "VAR_CLOSE_ERROR"))
 1839 #ifdef VAR_CLOSE_ERROR
 1840         return VAR_CLOSE_ERROR;
 1841 #else
 1842         goto not_there;
 1843 #endif
 1844     if (strEQ(name, "VAR_CREATE_ERROR"))
 1845 #ifdef VAR_CREATE_ERROR
 1846         return VAR_CREATE_ERROR;
 1847 #else
 1848         goto not_there;
 1849 #endif
 1850     if (strEQ(name, "VAR_DATASPEC_"))
 1851 #ifdef VAR_DATASPEC_
 1852         return VAR_DATASPEC_;
 1853 #else
 1854         goto not_there;
 1855 #endif
 1856     if (strEQ(name, "VAR_DATATYPE_"))
 1857 #ifdef VAR_DATATYPE_
 1858         return VAR_DATATYPE_;
 1859 #else
 1860         goto not_there;
 1861 #endif
 1862     if (strEQ(name, "VAR_DATA_"))
 1863 #ifdef VAR_DATA_
 1864         return VAR_DATA_;
 1865 #else
 1866         goto not_there;
 1867 #endif
 1868     if (strEQ(name, "VAR_DELETE_ERROR"))
 1869 #ifdef VAR_DELETE_ERROR
 1870         return VAR_DELETE_ERROR;
 1871 #else
 1872         goto not_there;
 1873 #endif
 1874     if (strEQ(name, "VAR_DIMVARYS_"))
 1875 #ifdef VAR_DIMVARYS_
 1876         return VAR_DIMVARYS_;
 1877 #else
 1878         goto not_there;
 1879 #endif
 1880     if (strEQ(name, "VAR_EXISTS"))
 1881 #ifdef VAR_EXISTS
 1882         return VAR_EXISTS;
 1883 #else
 1884         goto not_there;
 1885 #endif
 1886     if (strEQ(name, "VAR_EXTENDRECS_"))
 1887 #ifdef VAR_EXTENDRECS_
 1888         return VAR_EXTENDRECS_;
 1889 #else
 1890         goto not_there;
 1891 #endif
 1892     if (strEQ(name, "VAR_FILLVALUE_"))
 1893 #ifdef VAR_FILLVALUE_
 1894         return VAR_FILLVALUE_;
 1895 #else
 1896         goto not_there;
 1897 #endif
 1898     if (strEQ(name, "VAR_HYPERDATA_"))
 1899 #ifdef VAR_HYPERDATA_
 1900         return VAR_HYPERDATA_;
 1901 #else
 1902         goto not_there;
 1903 #endif
 1904     if (strEQ(name, "VAR_INITIALRECS_"))
 1905 #ifdef VAR_INITIALRECS_
 1906         return VAR_INITIALRECS_;
 1907 #else
 1908         goto not_there;
 1909 #endif
 1910     if (strEQ(name, "VAR_MAXREC_"))
 1911 #ifdef VAR_MAXREC_
 1912         return VAR_MAXREC_;
 1913 #else
 1914         goto not_there;
 1915 #endif
 1916     if (strEQ(name, "VAR_NAME_"))
 1917 #ifdef VAR_NAME_
 1918         return VAR_NAME_;
 1919 #else
 1920         goto not_there;
 1921 #endif
 1922     if (strEQ(name, "VAR_NAME_TRUNC"))
 1923 #ifdef VAR_NAME_TRUNC
 1924         return VAR_NAME_TRUNC;
 1925 #else
 1926         goto not_there;
 1927 #endif
 1928     if (strEQ(name, "VAR_NUMBER_"))
 1929 #ifdef VAR_NUMBER_
 1930         return VAR_NUMBER_;
 1931 #else
 1932         goto not_there;
 1933 #endif
 1934     if (strEQ(name, "VAR_NUMELEMS_"))
 1935 #ifdef VAR_NUMELEMS_
 1936         return VAR_NUMELEMS_;
 1937 #else
 1938         goto not_there;
 1939 #endif
 1940     if (strEQ(name, "VAR_OPEN_ERROR"))
 1941 #ifdef VAR_OPEN_ERROR
 1942         return VAR_OPEN_ERROR;
 1943 #else
 1944         goto not_there;
 1945 #endif
 1946     if (strEQ(name, "VAR_READ_ERROR"))
 1947 #ifdef VAR_READ_ERROR
 1948         return VAR_READ_ERROR;
 1949 #else
 1950         goto not_there;
 1951 #endif
 1952     if (strEQ(name, "VAR_RECVARY_"))
 1953 #ifdef VAR_RECVARY_
 1954         return VAR_RECVARY_;
 1955 #else
 1956         goto not_there;
 1957 #endif
 1958     if (strEQ(name, "VAR_SEQDATA_"))
 1959 #ifdef VAR_SEQDATA_
 1960         return VAR_SEQDATA_;
 1961 #else
 1962         goto not_there;
 1963 #endif
 1964     if (strEQ(name, "VAR_SEQPOS_"))
 1965 #ifdef VAR_SEQPOS_
 1966         return VAR_SEQPOS_;
 1967 #else
 1968         goto not_there;
 1969 #endif
 1970     if (strEQ(name, "VAR_WRITE_ERROR"))
 1971 #ifdef VAR_WRITE_ERROR
 1972         return VAR_WRITE_ERROR;
 1973 #else
 1974         goto not_there;
 1975 #endif
 1976     if (strEQ(name, "VAX_DECODING"))
 1977 #ifdef VAX_DECODING
 1978         return VAX_DECODING;
 1979 #else
 1980         goto not_there;
 1981 #endif
 1982     if (strEQ(name, "VAX_ENCODING"))
 1983 #ifdef VAX_ENCODING
 1984         return VAX_ENCODING;
 1985 #else
 1986         goto not_there;
 1987 #endif
 1988     if (strEQ(name, "VIRTUAL_RECORD_DATA"))
 1989 #ifdef VIRTUAL_RECORD_DATA
 1990         return VIRTUAL_RECORD_DATA;
 1991 #else
 1992         goto not_there;
 1993 #endif
 1994     break;
 1995     case 'W':
 1996     break;
 1997     case 'X':
 1998     break;
 1999     case 'Y':
 2000     break;
 2001     case 'Z':
 2002     break;
 2003     case 'a':
 2004     break;
 2005     case 'b':
 2006     break;
 2007     case 'c':
 2008     break;
 2009     case 'd':
 2010     break;
 2011     case 'e':
 2012     break;
 2013     case 'f':
 2014     break;
 2015     case 'g':
 2016     if (strEQ(name, "gENTRY_"))
 2017 #ifdef gENTRY_
 2018         return gENTRY_;
 2019 #else
 2020         goto not_there;
 2021 #endif
 2022     if (strEQ(name, "gENTRY_DATASPEC_"))
 2023 #ifdef gENTRY_DATASPEC_
 2024         return gENTRY_DATASPEC_;
 2025 #else
 2026         goto not_there;
 2027 #endif
 2028     if (strEQ(name, "gENTRY_DATATYPE_"))
 2029 #ifdef gENTRY_DATATYPE_
 2030         return gENTRY_DATATYPE_;
 2031 #else
 2032         goto not_there;
 2033 #endif
 2034     if (strEQ(name, "gENTRY_DATA_"))
 2035 #ifdef gENTRY_DATA_
 2036         return gENTRY_DATA_;
 2037 #else
 2038         goto not_there;
 2039 #endif
 2040     if (strEQ(name, "gENTRY_EXISTANCE_"))
 2041 #ifdef gENTRY_EXISTANCE_
 2042         return gENTRY_EXISTANCE_;
 2043 #else
 2044         goto not_there;
 2045 #endif
 2046     if (strEQ(name, "gENTRY_EXISTENCE_"))
 2047 #ifdef gENTRY_EXISTENCE_
 2048         return gENTRY_EXISTENCE_;
 2049 #else
 2050         goto not_there;
 2051 #endif
 2052     if (strEQ(name, "gENTRY_NUMELEMS_"))
 2053 #ifdef gENTRY_NUMELEMS_
 2054         return gENTRY_NUMELEMS_;
 2055 #else
 2056         goto not_there;
 2057 #endif
 2058     break;
 2059     case 'h':
 2060     break;
 2061     case 'i':
 2062     break;
 2063     case 'j':
 2064     break;
 2065     case 'k':
 2066     break;
 2067     case 'l':
 2068     break;
 2069     case 'm':
 2070     break;
 2071     case 'n':
 2072     break;
 2073     case 'o':
 2074     break;
 2075     case 'p':
 2076     break;
 2077     case 'q':
 2078     break;
 2079     case 'r':
 2080     if (strEQ(name, "rENTRY_"))
 2081 #ifdef rENTRY_
 2082         return rENTRY_;
 2083 #else
 2084         goto not_there;
 2085 #endif
 2086     if (strEQ(name, "rENTRY_DATASPEC_"))
 2087 #ifdef rENTRY_DATASPEC_
 2088         return rENTRY_DATASPEC_;
 2089 #else
 2090         goto not_there;
 2091 #endif
 2092     if (strEQ(name, "rENTRY_DATATYPE_"))
 2093 #ifdef rENTRY_DATATYPE_
 2094         return rENTRY_DATATYPE_;
 2095 #else
 2096         goto not_there;
 2097 #endif
 2098     if (strEQ(name, "rENTRY_DATA_"))
 2099 #ifdef rENTRY_DATA_
 2100         return rENTRY_DATA_;
 2101 #else
 2102         goto not_there;
 2103 #endif
 2104     if (strEQ(name, "rENTRY_EXISTANCE_"))
 2105 #ifdef rENTRY_EXISTANCE_
 2106         return rENTRY_EXISTANCE_;
 2107 #else
 2108         goto not_there;
 2109 #endif
 2110     if (strEQ(name, "rENTRY_EXISTENCE_"))
 2111 #ifdef rENTRY_EXISTENCE_
 2112         return rENTRY_EXISTENCE_;
 2113 #else
 2114         goto not_there;
 2115 #endif
 2116     if (strEQ(name, "rENTRY_NAME_"))
 2117 #ifdef rENTRY_NAME_
 2118         return rENTRY_NAME_;
 2119 #else
 2120         goto not_there;
 2121 #endif
 2122     if (strEQ(name, "rENTRY_NUMELEMS_"))
 2123 #ifdef rENTRY_NUMELEMS_
 2124         return rENTRY_NUMELEMS_;
 2125 #else
 2126         goto not_there;
 2127 #endif
 2128     if (strEQ(name, "rENTRY_NUMSTRINGS_"))
 2129 #ifdef rENTRY_NUMSTRINGS_
 2130         return rENTRY_NUMSTRINGS_;
 2131 #else
 2132         goto not_there;
 2133 #endif
 2134     if (strEQ(name, "rENTRY_STRINGSDATA_"))
 2135 #ifdef rENTRY_STRINGSDATA_
 2136         return rENTRY_STRINGSDATA_;
 2137 #else
 2138         goto not_there;
 2139 #endif
 2140     if (strEQ(name, "rVAR_"))
 2141 #ifdef rVAR_
 2142         return rVAR_;
 2143 #else
 2144         goto not_there;
 2145 #endif
 2146         if (strEQ(name, "rVAR_ALLOCATEBLOCK_"))
 2147 #ifdef rVAR_ALLOCATEBLOCK_
 2148             return rVAR_ALLOCATEBLOCK_;
 2149 #else
 2150             goto not_there;
 2151 #endif
 2152         if (strEQ(name, "rVAR_ALLOCATEDFROM_"))
 2153 #ifdef rVAR_ALLOCATEDFROM_
 2154             return rVAR_ALLOCATEDFROM_;
 2155 #else
 2156             goto not_there;
 2157 #endif
 2158         if (strEQ(name, "rVAR_ALLOCATEDTO_"))
 2159 #ifdef rVAR_ALLOCATEDTO_
 2160             return rVAR_ALLOCATEDTO_;
 2161 #else
 2162             goto not_there;
 2163 #endif
 2164     if (strEQ(name, "rVAR_ALLOCATERECS_"))
 2165 #ifdef rVAR_ALLOCATERECS_
 2166         return rVAR_ALLOCATERECS_;
 2167 #else
 2168         goto not_there;
 2169 #endif
 2170         if (strEQ(name, "rVAR_BLOCKINGFACTOR_"))
 2171 #ifdef rVAR_BLOCKINGFACTOR_
 2172             return rVAR_BLOCKINGFACTOR_;
 2173 #else
 2174             goto not_there;
 2175 #endif
 2176     if (strEQ(name, "rVAR_CACHESIZE_"))
 2177 #ifdef rVAR_CACHESIZE_
 2178         return rVAR_CACHESIZE_;
 2179 #else
 2180         goto not_there;
 2181 #endif
 2182         if (strEQ(name, "rVAR_COMPRESSION_"))
 2183 #ifdef rVAR_COMPRESSION_
 2184             return rVAR_COMPRESSION_;
 2185 #else
 2186             goto not_there;
 2187 #endif
 2188     if (strEQ(name, "rVAR_DATASPEC_"))
 2189 #ifdef rVAR_DATASPEC_
 2190         return rVAR_DATASPEC_;
 2191 #else
 2192         goto not_there;
 2193 #endif
 2194     if (strEQ(name, "rVAR_DATATYPE_"))
 2195 #ifdef rVAR_DATATYPE_
 2196         return rVAR_DATATYPE_;
 2197 #else
 2198         goto not_there;
 2199 #endif
 2200     if (strEQ(name, "rVAR_DATA_"))
 2201 #ifdef rVAR_DATA_
 2202         return rVAR_DATA_;
 2203 #else
 2204         goto not_there;
 2205 #endif
 2206     if (strEQ(name, "rVAR_DIMVARYS_"))
 2207 #ifdef rVAR_DIMVARYS_
 2208         return rVAR_DIMVARYS_;
 2209 #else
 2210         goto not_there;
 2211 #endif
 2212     if (strEQ(name, "rVAR_EXISTANCE_"))
 2213 #ifdef rVAR_EXISTANCE_
 2214         return rVAR_EXISTANCE_;
 2215 #else
 2216         goto not_there;
 2217 #endif
 2218     if (strEQ(name, "rVAR_EXISTENCE_"))
 2219 #ifdef rVAR_EXISTENCE_
 2220         return rVAR_EXISTENCE_;
 2221 #else
 2222         goto not_there;
 2223 #endif
 2224     if (strEQ(name, "rVAR_EXTENDRECS_"))
 2225 #ifdef rVAR_EXTENDRECS_
 2226         return rVAR_EXTENDRECS_;
 2227 #else
 2228         goto not_there;
 2229 #endif
 2230     if (strEQ(name, "rVAR_HYPERDATA_"))
 2231 #ifdef rVAR_HYPERDATA_
 2232         return rVAR_HYPERDATA_;
 2233 #else
 2234         goto not_there;
 2235 #endif
 2236     if (strEQ(name, "rVAR_INITIALRECS_"))
 2237 #ifdef rVAR_INITIALRECS_
 2238         return rVAR_INITIALRECS_;
 2239 #else
 2240         goto not_there;
 2241 #endif
 2242     if (strEQ(name, "rVAR_MAXREC_"))
 2243 #ifdef rVAR_MAXREC_
 2244         return rVAR_MAXREC_;
 2245 #else
 2246         goto not_there;
 2247 #endif
 2248     if (strEQ(name, "rVAR_MAXallocREC_"))
 2249 #ifdef rVAR_MAXallocREC_
 2250         return rVAR_MAXallocREC_;
 2251 #else
 2252         goto not_there;
 2253 #endif
 2254     if (strEQ(name, "rVAR_NAME_"))
 2255 #ifdef rVAR_NAME_
 2256         return rVAR_NAME_;
 2257 #else
 2258         goto not_there;
 2259 #endif
 2260     if (strEQ(name, "rVAR_NUMBER_"))
 2261 #ifdef rVAR_NUMBER_
 2262         return rVAR_NUMBER_;
 2263 #else
 2264         goto not_there;
 2265 #endif
 2266     if (strEQ(name, "rVAR_NUMELEMS_"))
 2267 #ifdef rVAR_NUMELEMS_
 2268         return rVAR_NUMELEMS_;
 2269 #else
 2270         goto not_there;
 2271 #endif
 2272         if (strEQ(name, "rVAR_NUMRECS_"))
 2273 #ifdef rVAR_NUMRECS_
 2274             return rVAR_NUMRECS_;
 2275 #else
 2276             goto not_there;
 2277 #endif
 2278         if (strEQ(name, "rVAR_NUMallocRECS_"))
 2279 #ifdef rVAR_NUMallocRECS_
 2280             return rVAR_NUMallocRECS_;
 2281 #else
 2282             goto not_there;
 2283 #endif
 2284     if (strEQ(name, "rVAR_PADVALUE_"))
 2285 #ifdef rVAR_PADVALUE_
 2286         return rVAR_PADVALUE_;
 2287 #else
 2288         goto not_there;
 2289 #endif
 2290     if (strEQ(name, "rVAR_RECORDS_"))
 2291 #ifdef rVAR_RECORDS_
 2292         return rVAR_RECORDS_;
 2293 #else
 2294         goto not_there;
 2295 #endif
 2296     if (strEQ(name, "rVAR_RECORDS_RENUMBER_"))
 2297 #ifdef rVAR_RECORDS_RENUMBER_
 2298         return rVAR_RECORDS_RENUMBER_;
 2299 #else
 2300         goto not_there;
 2301 #endif
 2302         if (strEQ(name, "rVAR_RECVARY_"))
 2303 #ifdef rVAR_RECVARY_
 2304             return rVAR_RECVARY_;
 2305 #else
 2306             goto not_there;
 2307 #endif
 2308         if (strEQ(name, "rVAR_RESERVEPERCENT_"))
 2309 #ifdef rVAR_RESERVEPERCENT_
 2310             return rVAR_RESERVEPERCENT_;
 2311 #else
 2312             goto not_there;
 2313 #endif
 2314         if (strEQ(name, "rVAR_SEQDATA_"))
 2315 #ifdef rVAR_SEQDATA_
 2316         return rVAR_SEQDATA_;
 2317 #else
 2318         goto not_there;
 2319 #endif
 2320     if (strEQ(name, "rVAR_SEQPOS_"))
 2321 #ifdef rVAR_SEQPOS_
 2322         return rVAR_SEQPOS_;
 2323 #else
 2324         goto not_there;
 2325 #endif
 2326         if (strEQ(name, "rVAR_SPARSEARRAYS_"))
 2327 #ifdef rVAR_SPARSEARRAYS_
 2328             return rVAR_SPARSEARRAYS_;
 2329 #else
 2330             goto not_there;
 2331 #endif
 2332         if (strEQ(name, "rVAR_SPARSERECORDS_"))
 2333 #ifdef rVAR_SPARSERECORDS_
 2334             return rVAR_SPARSERECORDS_;
 2335 #else
 2336             goto not_there;
 2337 #endif
 2338     if (strEQ(name, "rVAR_nINDEXENTRIES_"))
 2339 #ifdef rVAR_nINDEXENTRIES_
 2340         return rVAR_nINDEXENTRIES_;
 2341 #else
 2342         goto not_there;
 2343 #endif
 2344     if (strEQ(name, "rVAR_nINDEXLEVELS_"))
 2345 #ifdef rVAR_nINDEXLEVELS_
 2346         return rVAR_nINDEXLEVELS_;
 2347 #else
 2348         goto not_there;
 2349 #endif
 2350         if (strEQ(name, "rVAR_nINDEXRECORDS_"))
 2351 #ifdef rVAR_nINDEXRECORDS_
 2352             return rVAR_nINDEXRECORDS_;
 2353 #else
 2354             goto not_there;
 2355 #endif
 2356     if (strEQ(name, "rVARs_CACHESIZE_"))
 2357 #ifdef rVARs_CACHESIZE_
 2358         return rVARs_CACHESIZE_;
 2359 #else
 2360         goto not_there;
 2361 #endif
 2362     if (strEQ(name, "rVARs_DIMCOUNTS_"))
 2363 #ifdef rVARs_DIMCOUNTS_
 2364         return rVARs_DIMCOUNTS_;
 2365 #else
 2366         goto not_there;
 2367 #endif
 2368     if (strEQ(name, "rVARs_DIMINDICES_"))
 2369 #ifdef rVARs_DIMINDICES_
 2370         return rVARs_DIMINDICES_;
 2371 #else
 2372         goto not_there;
 2373 #endif
 2374     if (strEQ(name, "rVARs_DIMINTERVALS_"))
 2375 #ifdef rVARs_DIMINTERVALS_
 2376         return rVARs_DIMINTERVALS_;
 2377 #else
 2378         goto not_there;
 2379 #endif
 2380     if (strEQ(name, "rVARs_DIMSIZES_"))
 2381 #ifdef rVARs_DIMSIZES_
 2382         return rVARs_DIMSIZES_;
 2383 #else
 2384         goto not_there;
 2385 #endif
 2386     if (strEQ(name, "rVARs_MAXREC_"))
 2387 #ifdef rVARs_MAXREC_
 2388         return rVARs_MAXREC_;
 2389 #else
 2390         goto not_there;
 2391 #endif
 2392     if (strEQ(name, "rVARs_NUMDIMS_"))
 2393 #ifdef rVARs_NUMDIMS_
 2394         return rVARs_NUMDIMS_;
 2395 #else
 2396         goto not_there;
 2397 #endif
 2398     if (strEQ(name, "rVARs_RECCOUNT_"))
 2399 #ifdef rVARs_RECCOUNT_
 2400         return rVARs_RECCOUNT_;
 2401 #else
 2402         goto not_there;
 2403 #endif
 2404     if (strEQ(name, "rVARs_RECDATA_"))
 2405 #ifdef rVARs_RECDATA_
 2406         return rVARs_RECDATA_;
 2407 #else
 2408         goto not_there;
 2409 #endif
 2410     if (strEQ(name, "rVARs_RECINTERVAL_"))
 2411 #ifdef rVARs_RECINTERVAL_
 2412         return rVARs_RECINTERVAL_;
 2413 #else
 2414         goto not_there;
 2415 #endif
 2416     if (strEQ(name, "rVARs_RECNUMBER_"))
 2417 #ifdef rVARs_RECNUMBER_
 2418         return rVARs_RECNUMBER_;
 2419 #else
 2420         goto not_there;
 2421 #endif
 2422     break;
 2423     case 's':
 2424     break;
 2425     case 't':
 2426     break;
 2427     case 'u':
 2428     break;
 2429     case 'v':
 2430     break;
 2431     case 'w':
 2432     break;
 2433     case 'x':
 2434     break;
 2435     case 'y':
 2436     break;
 2437     case 'z':
 2438     if (strEQ(name, "zENTRY_"))
 2439 #ifdef zENTRY_
 2440         return zENTRY_;
 2441 #else
 2442         goto not_there;
 2443 #endif
 2444     if (strEQ(name, "zENTRY_DATASPEC_"))
 2445 #ifdef zENTRY_DATASPEC_
 2446         return zENTRY_DATASPEC_;
 2447 #else
 2448         goto not_there;
 2449 #endif
 2450     if (strEQ(name, "zENTRY_DATATYPE_"))
 2451 #ifdef zENTRY_DATATYPE_
 2452         return zENTRY_DATATYPE_;
 2453 #else
 2454         goto not_there;
 2455 #endif
 2456     if (strEQ(name, "zENTRY_DATA_"))
 2457 #ifdef zENTRY_DATA_
 2458         return zENTRY_DATA_;
 2459 #else
 2460         goto not_there;
 2461 #endif
 2462     if (strEQ(name, "zENTRY_EXISTANCE_"))
 2463 #ifdef zENTRY_EXISTANCE_
 2464         return zENTRY_EXISTANCE_;
 2465 #else
 2466         goto not_there;
 2467 #endif
 2468     if (strEQ(name, "zENTRY_EXISTENCE_"))
 2469 #ifdef zENTRY_EXISTENCE_
 2470         return zENTRY_EXISTENCE_;
 2471 #else
 2472         goto not_there;
 2473 #endif
 2474     if (strEQ(name, "zENTRY_NAME_"))
 2475 #ifdef zENTRY_NAME_
 2476         return zENTRY_NAME_;
 2477 #else
 2478         goto not_there;
 2479 #endif
 2480     if (strEQ(name, "zENTRY_NUMELEMS_"))
 2481 #ifdef zENTRY_NUMELEMS_
 2482         return zENTRY_NUMELEMS_;
 2483 #else
 2484         goto not_there;
 2485 #endif
 2486     if (strEQ(name, "zENTRY_NUMSTRINGS_"))
 2487 #ifdef zENTRY_NUMSTRINGS_
 2488         return zENTRY_NUMSTRINGS_;
 2489 #else
 2490         goto not_there;
 2491 #endif
 2492     if (strEQ(name, "zENTRY_STRINGSDATA_"))
 2493 #ifdef zENTRY_STRINGSDATA_
 2494         return zENTRY_STRINGSDATA_;
 2495 #else
 2496         goto not_there;
 2497 #endif
 2498     if (strEQ(name, "zMODEoff"))
 2499 #ifdef zMODEoff
 2500         return zMODEoff;
 2501 #else
 2502         goto not_there;
 2503 #endif
 2504     if (strEQ(name, "zMODEon1"))
 2505 #ifdef zMODEon1
 2506         return zMODEon1;
 2507 #else
 2508         goto not_there;
 2509 #endif
 2510     if (strEQ(name, "zMODEon2"))
 2511 #ifdef zMODEon2
 2512         return zMODEon2;
 2513 #else
 2514         goto not_there;
 2515 #endif
 2516     if (strEQ(name, "zVAR_"))
 2517 #ifdef zVAR_
 2518         return zVAR_;
 2519 #else
 2520         goto not_there;
 2521 #endif
 2522         if (strEQ(name, "zVAR_ALLOCATEBLOCK_"))
 2523 #ifdef zVAR_ALLOCATEBLOCK_
 2524             return zVAR_ALLOCATEBLOCK_;
 2525 #else
 2526             goto not_there;
 2527 #endif
 2528         if (strEQ(name, "zVAR_ALLOCATEDFROM_"))
 2529 #ifdef zVAR_ALLOCATEDFROM_
 2530             return zVAR_ALLOCATEDFROM_;
 2531 #else
 2532             goto not_there;
 2533 #endif
 2534         if (strEQ(name, "zVAR_ALLOCATEDTO_"))
 2535 #ifdef zVAR_ALLOCATEDTO_
 2536             return zVAR_ALLOCATEDTO_;
 2537 #else
 2538             goto not_there;
 2539 #endif
 2540     if (strEQ(name, "zVAR_ALLOCATERECS_"))
 2541 #ifdef zVAR_ALLOCATERECS_
 2542         return zVAR_ALLOCATERECS_;
 2543 #else
 2544         goto not_there;
 2545 #endif
 2546         if (strEQ(name, "zVAR_BLOCKINGFACTOR_"))
 2547 #ifdef zVAR_BLOCKINGFACTOR_
 2548             return zVAR_BLOCKINGFACTOR_;
 2549 #else
 2550             goto not_there;
 2551 #endif
 2552     if (strEQ(name, "zVAR_CACHESIZE_"))
 2553 #ifdef zVAR_CACHESIZE_
 2554         return zVAR_CACHESIZE_;
 2555 #else
 2556         goto not_there;
 2557 #endif
 2558         if (strEQ(name, "zVAR_COMPRESSION_"))
 2559 #ifdef zVAR_COMPRESSION_
 2560             return zVAR_COMPRESSION_;
 2561 #else
 2562             goto not_there;
 2563 #endif
 2564     if (strEQ(name, "zVAR_DATASPEC_"))
 2565 #ifdef zVAR_DATASPEC_
 2566         return zVAR_DATASPEC_;
 2567 #else
 2568         goto not_there;
 2569 #endif
 2570     if (strEQ(name, "zVAR_DATATYPE_"))
 2571 #ifdef zVAR_DATATYPE_
 2572         return zVAR_DATATYPE_;
 2573 #else
 2574         goto not_there;
 2575 #endif
 2576     if (strEQ(name, "zVAR_DATA_"))
 2577 #ifdef zVAR_DATA_
 2578         return zVAR_DATA_;
 2579 #else
 2580         goto not_there;
 2581 #endif
 2582     if (strEQ(name, "zVAR_DIMCOUNTS_"))
 2583 #ifdef zVAR_DIMCOUNTS_
 2584         return zVAR_DIMCOUNTS_;
 2585 #else
 2586         goto not_there;
 2587 #endif
 2588     if (strEQ(name, "zVAR_DIMINDICES_"))
 2589 #ifdef zVAR_DIMINDICES_
 2590         return zVAR_DIMINDICES_;
 2591 #else
 2592         goto not_there;
 2593 #endif
 2594     if (strEQ(name, "zVAR_DIMINTERVALS_"))
 2595 #ifdef zVAR_DIMINTERVALS_
 2596         return zVAR_DIMINTERVALS_;
 2597 #else
 2598         goto not_there;
 2599 #endif
 2600     if (strEQ(name, "zVAR_DIMSIZES_"))
 2601 #ifdef zVAR_DIMSIZES_
 2602         return zVAR_DIMSIZES_;
 2603 #else
 2604         goto not_there;
 2605 #endif
 2606     if (strEQ(name, "zVAR_DIMVARYS_"))
 2607 #ifdef zVAR_DIMVARYS_
 2608         return zVAR_DIMVARYS_;
 2609 #else
 2610         goto not_there;
 2611 #endif
 2612     if (strEQ(name, "zVAR_EXISTANCE_"))
 2613 #ifdef zVAR_EXISTANCE_
 2614         return zVAR_EXISTANCE_;
 2615 #else
 2616         goto not_there;
 2617 #endif
 2618     if (strEQ(name, "zVAR_EXISTENCE_"))
 2619 #ifdef zVAR_EXISTENCE_
 2620         return zVAR_EXISTENCE_;
 2621 #else
 2622         goto not_there;
 2623 #endif
 2624     if (strEQ(name, "zVAR_EXTENDRECS_"))
 2625 #ifdef zVAR_EXTENDRECS_
 2626         return zVAR_EXTENDRECS_;
 2627 #else
 2628         goto not_there;
 2629 #endif
 2630     if (strEQ(name, "zVAR_HYPERDATA_"))
 2631 #ifdef zVAR_HYPERDATA_
 2632         return zVAR_HYPERDATA_;
 2633 #else
 2634         goto not_there;
 2635 #endif
 2636     if (strEQ(name, "zVAR_INITIALRECS_"))
 2637 #ifdef zVAR_INITIALRECS_
 2638         return zVAR_INITIALRECS_;
 2639 #else
 2640         goto not_there;
 2641 #endif
 2642     if (strEQ(name, "zVAR_MAXREC_"))
 2643 #ifdef zVAR_MAXREC_
 2644         return zVAR_MAXREC_;
 2645 #else
 2646         goto not_there;
 2647 #endif
 2648     if (strEQ(name, "zVAR_MAXallocREC_"))
 2649 #ifdef zVAR_MAXallocREC_
 2650         return zVAR_MAXallocREC_;
 2651 #else
 2652         goto not_there;
 2653 #endif
 2654     if (strEQ(name, "zVAR_NAME_"))
 2655 #ifdef zVAR_NAME_
 2656         return zVAR_NAME_;
 2657 #else
 2658         goto not_there;
 2659 #endif
 2660     if (strEQ(name, "zVAR_NUMBER_"))
 2661 #ifdef zVAR_NUMBER_
 2662         return zVAR_NUMBER_;
 2663 #else
 2664         goto not_there;
 2665 #endif
 2666     if (strEQ(name, "zVAR_NUMDIMS_"))
 2667 #ifdef zVAR_NUMDIMS_
 2668         return zVAR_NUMDIMS_;
 2669 #else
 2670         goto not_there;
 2671 #endif
 2672     if (strEQ(name, "zVAR_NUMELEMS_"))
 2673 #ifdef zVAR_NUMELEMS_
 2674         return zVAR_NUMELEMS_;
 2675 #else
 2676         goto not_there;
 2677 #endif
 2678         if (strEQ(name, "zVAR_NUMRECS_"))
 2679 #ifdef zVAR_NUMRECS_
 2680             return zVAR_NUMRECS_;
 2681 #else
 2682             goto not_there;
 2683 #endif
 2684         if (strEQ(name, "zVAR_NUMallocRECS_"))
 2685 #ifdef zVAR_NUMallocRECS_
 2686             return zVAR_NUMallocRECS_;
 2687 #else
 2688             goto not_there;
 2689 #endif
 2690     if (strEQ(name, "zVAR_PADVALUE_"))
 2691 #ifdef zVAR_PADVALUE_
 2692         return zVAR_PADVALUE_;
 2693 #else
 2694         goto not_there;
 2695 #endif
 2696     if (strEQ(name, "zVAR_RECCOUNT_"))
 2697 #ifdef zVAR_RECCOUNT_
 2698         return zVAR_RECCOUNT_;
 2699 #else
 2700         goto not_there;
 2701 #endif
 2702     if (strEQ(name, "zVAR_RECINTERVAL_"))
 2703 #ifdef zVAR_RECINTERVAL_
 2704         return zVAR_RECINTERVAL_;
 2705 #else
 2706         goto not_there;
 2707 #endif
 2708     if (strEQ(name, "zVAR_RECNUMBER_"))
 2709 #ifdef zVAR_RECNUMBER_
 2710         return zVAR_RECNUMBER_;
 2711 #else
 2712         goto not_there;
 2713 #endif
 2714         if (strEQ(name, "zVAR_RECORDS_"))
 2715 #ifdef zVAR_RECORDS_
 2716             return zVAR_RECORDS_;
 2717 #else
 2718             goto not_there;
 2719 #endif
 2720         if (strEQ(name, "zVAR_RECORDS_RENUMBER_"))
 2721 #ifdef zVAR_RECORDS_RENUMBER_
 2722             return zVAR_RECORDS_RENUMBER_;
 2723 #else
 2724             goto not_there;
 2725 #endif
 2726     if (strEQ(name, "zVAR_RECVARY_"))
 2727 #ifdef zVAR_RECVARY_
 2728         return zVAR_RECVARY_;
 2729 #else
 2730         goto not_there;
 2731 #endif
 2732         if (strEQ(name, "zVAR_RESERVEPERCENT_"))
 2733 #ifdef zVAR_RESERVEPERCENT_
 2734             return zVAR_RESERVEPERCENT_;
 2735 #else
 2736             goto not_there;
 2737 #endif
 2738     if (strEQ(name, "zVAR_SEQDATA_"))
 2739 #ifdef zVAR_SEQDATA_
 2740         return zVAR_SEQDATA_;
 2741 #else
 2742         goto not_there;
 2743 #endif
 2744     if (strEQ(name, "zVAR_SEQPOS_"))
 2745 #ifdef zVAR_SEQPOS_
 2746         return zVAR_SEQPOS_;
 2747 #else
 2748         goto not_there;
 2749 #endif
 2750     if (strEQ(name, "zVAR_SPARSEARRAYS_"))
 2751 #ifdef zVAR_SPARSEARRAYS_
 2752         return zVAR_SPARSEARRAYS_;
 2753 #else
 2754         goto not_there;
 2755 #endif
 2756         if (strEQ(name, "zVAR_SPARSERECORDS_"))
 2757 #ifdef zVAR_SPARSERECORDS_
 2758             return zVAR_SPARSERECORDS_;
 2759 #else
 2760             goto not_there;
 2761 #endif
 2762         if (strEQ(name, "zVAR_nINDEXENTRIES_"))
 2763 #ifdef zVAR_nINDEXENTRIES_
 2764             return zVAR_nINDEXENTRIES_;
 2765 #else
 2766             goto not_there;
 2767 #endif
 2768         if (strEQ(name, "zVAR_nINDEXLEVELS_"))
 2769 #ifdef zVAR_nINDEXLEVELS_
 2770             return zVAR_nINDEXLEVELS_;
 2771 #else
 2772             goto not_there;
 2773 #endif
 2774     if (strEQ(name, "zVAR_nINDEXRECORDS_"))
 2775 #ifdef zVAR_nINDEXRECORDS_
 2776         return zVAR_nINDEXRECORDS_;
 2777 #else
 2778         goto not_there;
 2779 #endif
 2780     if (strEQ(name, "zVARs_CACHESIZE_"))
 2781 #ifdef zVARs_CACHESIZE_
 2782         return zVARs_CACHESIZE_;
 2783 #else
 2784         goto not_there;
 2785 #endif
 2786     if (strEQ(name, "zVARs_MAXREC_"))
 2787 #ifdef zVARs_MAXREC_
 2788         return zVARs_MAXREC_;
 2789 #else
 2790         goto not_there;
 2791 #endif
 2792     if (strEQ(name, "zVARs_RECDATA_"))
 2793 #ifdef zVARs_RECDATA_
 2794         return zVARs_RECDATA_;
 2795 #else
 2796         goto not_there;
 2797 #endif
 2798     if (strEQ(name, "zVARs_RECNUMBER_"))
 2799 #ifdef zVARs_RECNUMBER_
 2800         return zVARs_RECNUMBER_;
 2801 #else
 2802         goto not_there;
 2803 #endif
 2804     break;
 2805     }
 2806     errno = EINVAL;
 2807     return 0;
 2808 
 2809 not_there:
 2810     errno = ENOENT;   
 2811     return 0;
 2812 }
 2813 
 2814 MODULE = CDF        PACKAGE = CDF
 2815 
 2816 double
 2817 constant(name)
 2818     char *  name
 2819 
 2820 CDFstatus
 2821 CDFlibnone(operation, item)
 2822     long    operation
 2823     long    item
 2824     CODE:
 2825         RETVAL = CDFlib(operation, item, NULL_);
 2826     OUTPUT:
 2827     RETVAL
 2828     
 2829 CDFstatus
 2830 CDFlibs(operation, item, AnyString)
 2831     long    operation
 2832     long    item
 2833     char *  AnyString
 2834     CODE:
 2835         RETVAL = CDFlib(operation, item, AnyString, NULL_);
 2836     OUTPUT:
 2837     RETVAL
 2838     
 2839 CDFstatus
 2840 CDFlib6(operation, item, AnyString)
 2841     long    operation
 2842     long    item
 2843     char *  AnyString = NO_INIT
 2844     CODE:
 2845     {
 2846         char temp[CDF_COPYRIGHT_LEN+1]; 
 2847         AnyString = temp;
 2848         RETVAL = CDFlib(operation, item, AnyString, NULL_);
 2849     }     
 2850     OUTPUT:
 2851     AnyString
 2852     RETVAL
 2853 
 2854 CDFstatus
 2855 CDFlib3(operation, item, AnyChar)
 2856     long    operation
 2857     long    item
 2858     char    AnyChar = NO_INIT
 2859     CODE:
 2860         RETVAL = CDFlib(operation, item, &AnyChar, NULL_);
 2861     OUTPUT:
 2862     AnyChar
 2863     RETVAL
 2864 
 2865 CDFstatus
 2866 CDFlibs5(operation, item, AnyString, AnyLong)
 2867     long    operation
 2868     long    item
 2869     char *  AnyString
 2870     long    AnyLong = NO_INIT
 2871     CODE:
 2872         RETVAL = CDFlib(operation, item, AnyString, &AnyLong, NULL_);
 2873     OUTPUT:
 2874     AnyLong
 2875     RETVAL
 2876 
 2877 CDFstatus
 2878 CDFlibs4(operation, item, CDFpath, AnyId)
 2879     long    operation
 2880     long    item
 2881     char *  CDFpath
 2882     CDFid   AnyId = NO_INIT
 2883     CODE:
 2884         RETVAL = CDFlib(operation, item, CDFpath, &AnyId, NULL_);
 2885     OUTPUT:
 2886     AnyId
 2887     RETVAL
 2888     
 2889 CDFstatus
 2890 CDFlibd(operation, item, AnyId)
 2891     long    operation
 2892     long    item
 2893     CDFid   AnyId
 2894     CODE:
 2895         RETVAL = CDFlib(operation, item, AnyId, NULL_);
 2896     OUTPUT:
 2897     RETVAL
 2898 
 2899 CDFstatus       
 2900 CDFlib4(operation, item, AnyId)
 2901         long    operation
 2902         long    item
 2903         CDFid   AnyId = NO_INIT
 2904         CODE:
 2905                 RETVAL = CDFlib(operation, item, &AnyId, NULL_);
 2906         OUTPUT:
 2907     AnyId
 2908         RETVAL
 2909 
 2910 CDFstatus
 2911 CDFlibl(operation, item, AnyLong)
 2912     long    operation
 2913     long    item
 2914     long    AnyLong
 2915     CODE:
 2916         RETVAL = CDFlib(operation, item, AnyLong, NULL_);
 2917     OUTPUT:
 2918     RETVAL
 2919     
 2920 CDFstatus
 2921 CDFlibl5(operation, item, AnyLong, AnotherLong)
 2922     long    operation
 2923     long    item
 2924     long    AnyLong
 2925     long    AnotherLong = NO_INIT
 2926     CODE:
 2927         RETVAL = CDFlib(operation, item, AnyLong, &AnotherLong, NULL_);
 2928     OUTPUT:
 2929     AnotherLong
 2930     RETVAL
 2931     
 2932 CDFstatus
 2933 CDFlibll(operation, item, AnyLong, AnotherLong)
 2934     long    operation
 2935     long    item
 2936     long    AnyLong
 2937     long    AnotherLong
 2938     CODE:
 2939         RETVAL = CDFlib(operation, item, AnyLong, AnotherLong, NULL_);
 2940     OUTPUT:
 2941     RETVAL
 2942     
 2943 CDFstatus
 2944 CDFlibla(operation, item, AnyLong, ArrayRef)
 2945     long    operation
 2946     long    item
 2947     long    AnyLong
 2948     AV *    ArrayRef
 2949     CODE:
 2950     {
 2951         long LongArray[CDF_MAX_DIMS]; 
 2952         I32 count, i;
 2953         count = (int) av_len(ArrayRef); 
 2954         if (count < 0) 
 2955           printf(" Put compression/sparsearray: No values specified\n");
 2956         else {
 2957           for ( i=0 ; i<=count ; i++) 
 2958             LongArray[i] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 2959         }
 2960         RETVAL = CDFlib(operation, item, AnyLong, LongArray, NULL_);
 2961     }
 2962     OUTPUT:
 2963     RETVAL
 2964     
 2965 CDFstatus
 2966 CDFlibllv(operation, item, DataType, numElems, DataRef)
 2967     long    operation
 2968     long    item
 2969     long    DataType
 2970     long    numElems
 2971     SV *    DataRef = NO_INIT
 2972     CODE:
 2973     {
 2974       I32 i;
 2975       STRLEN len;
 2976           RETVAL = 0;
 2977       DataRef = (SV *) SvRV(ST(4));
 2978       switch (DataType) {
 2979         case CDF_UCHAR:
 2980         case CDF_CHAR:  {
 2981             char * buffer;
 2982             New(42, buffer, numElems+1, char); 
 2983                 strncpy(buffer, SvPV(DataRef, len), numElems);
 2984                 *(buffer+numElems) = '\0';
 2985         if ((int) strlen(buffer) < (int) numElems) {
 2986           for (i=(int)strlen(buffer); i<(int)numElems; i++)
 2987                     buffer[i] = '\0';
 2988         }
 2989         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 2990                 NULL_);
 2991         Safefree(buffer); 
 2992         break;
 2993         }
 2994 /*
 2995         case CDF_UCHAR:  {
 2996             void * buffer;
 2997             New(42, buffer, numElems+1, unsigned char);
 2998                 strncpy((char *)buffer, SvPV(DataRef, len), numElems);
 2999                 if ((int) strlen((char *)buffer) < (int) numElems) {
 3000                   for (i=(int)strlen((char *)buffer); i<(int)numElems; i++) 
 3001             *(((char *)buffer)+i) = '\0';
 3002                   *(((char *)buffer)+numElems) = '\0';
 3003                 }
 3004         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3005                 NULL_);
 3006         Safefree(buffer);
 3007         break;
 3008         }
 3009 */
 3010         case CDF_BYTE:
 3011         case CDF_INT1:  {
 3012             I8 buffer;
 3013         buffer = (I8) SvIV(DataRef);
 3014         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3015                 NULL_);
 3016         break;
 3017         }
 3018         case CDF_UINT1: { 
 3019             U8 buffer;
 3020         buffer = (U8) SvIV(DataRef);
 3021         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3022                 NULL_);
 3023         break;
 3024         }
 3025         case CDF_EPOCH:
 3026         case CDF_DOUBLE:
 3027         case CDF_REAL8: {
 3028         double buffer;
 3029         buffer = (double) SvNV(DataRef);
 3030         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3031                 NULL_);
 3032         break; 
 3033         }
 3034 /*
 3035         case CDF_EPOCH16: {
 3036         double buffer[2];
 3037                 buffer[0] = (double) SvNV(*(av_fetch(DataRef, 0, 0)));
 3038                 buffer[1] = (double) SvNV(*(av_fetch(DataRef, 1, 0)));
 3039         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3040                 NULL_);
 3041         Safefree(buffer);
 3042         break; 
 3043         }
 3044 */
 3045         case CDF_REAL4:
 3046         case CDF_FLOAT: {
 3047         float buffer;
 3048         buffer = (float) SvNV(DataRef);
 3049         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3050                 NULL_);
 3051         break;
 3052         }
 3053         case CDF_INT4:  {
 3054         I32 buffer;
 3055         buffer = (I32) SvIV(DataRef);
 3056         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3057                 NULL_);
 3058         break;
 3059         }
 3060         case CDF_INT8:
 3061         case CDF_TIME_TT2000:  {
 3062         long long buffer;
 3063                 if (SvIOK(DataRef)) {
 3064                   buffer = (long long) SvIV(DataRef);
 3065                 } else if (SvNOK(DataRef)) {
 3066                   buffer = (long long) SvNV(DataRef);
 3067                 } else {
 3068                   sscanf(SvPV_nolen(DataRef),"%lld",&buffer);
 3069                 }
 3070         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3071                 NULL_);
 3072         break;
 3073         }
 3074         case CDF_UINT4:  {
 3075         U32 buffer;
 3076         buffer = (U32) SvIV(DataRef);
 3077         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3078                 NULL_);
 3079         break;
 3080         }
 3081         case CDF_INT2:  {
 3082         I16 buffer;
 3083         buffer = (I16) SvIV(DataRef);
 3084         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3085                 NULL_);
 3086         break;
 3087         }
 3088         case CDF_UINT2:  {
 3089         U16 buffer;
 3090         buffer = (U16) SvIV(DataRef);
 3091         RETVAL = CDFlib(operation, item, DataType, numElems, &buffer, 
 3092                 NULL_);
 3093         break;
 3094         }
 3095         default: {
 3096         printf ("PUT attribute information: Bad Datatype = %ld \n", 
 3097             DataType);
 3098         }
 3099       }
 3100     }
 3101     OUTPUT:
 3102     RETVAL
 3103     
 3104 CDFstatus
 3105 CDFliblla(operation, item, DataType, numElems, ArrayRef)
 3106     long    operation
 3107     long    item
 3108     long    DataType
 3109     long    numElems
 3110     AV *    ArrayRef
 3111     CODE:
 3112     {
 3113       I32 count, i, j;
 3114           RETVAL = 0;
 3115       count = (int) av_len(ArrayRef)+1;
 3116       if (count < 1)
 3117         printf(" Put Entry data: No values specified\n");
 3118       switch (DataType) {
 3119         case CDF_UCHAR:
 3120         case CDF_CHAR:  {
 3121         char * buffer;
 3122         char * temp;
 3123         STRLEN len;
 3124         New(42, buffer, numElems*count+1, char); 
 3125         New(42, temp, numElems+1, char);
 3126             for (i=0 ; i < count; i++) {
 3127                strncpy(temp, SvPV(*(av_fetch(ArrayRef, i, 0)), len),
 3128                        numElems+1);
 3129                    *(temp+numElems) = '\0';
 3130                if ((int) strlen(temp) < (int) numElems) {
 3131                  for (j=(int)strlen(temp); j<(int)numElems; j++)
 3132                        temp[j] = '\0';
 3133                }
 3134                strncpy(buffer+i*numElems, temp, numElems);
 3135             }
 3136 
 3137         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3138                 NULL_);
 3139         Safefree(buffer); 
 3140         Safefree(temp); 
 3141         break;
 3142         }
 3143 /*
 3144         case CDF_UCHAR:  {
 3145             void * buffer;
 3146         void * temp;
 3147         STRLEN len;
 3148             New(42, buffer, numElems*count+1, unsigned char);
 3149         New(42, temp, numElems+1, unsigned char);
 3150                 for (i=0 ; i < count; i++) {
 3151                    strncpy((char *)temp, SvPV(*(av_fetch(ArrayRef, i, 0)), len),
 3152                            numElems+1);
 3153                    if ((int) strlen((char *)temp) < (int) numElems) {
 3154                      for (j=(int)strlen((char *)temp); j<(int)numElems; j++)
 3155                         *(((char *)temp)+j) = '\0';
 3156                      *(((char *)temp)+numElems) = '\0';
 3157                    }
 3158                    strncpy((char *)buffer+i*numElems, temp, numElems+1);
 3159                 }
 3160 
 3161         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3162                 NULL_);
 3163         Safefree(buffer);
 3164         Safefree(temp); 
 3165         break;
 3166         }
 3167 */
 3168         case CDF_BYTE:
 3169         case CDF_INT1:  {
 3170             I8 * buffer;
 3171             New(42, buffer, count, I8); 
 3172                 for (i=0 ; i < count; i++)
 3173                    buffer[i] = (I8) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3174 
 3175         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3176                 NULL_);
 3177         Safefree(buffer); 
 3178         break;
 3179         }
 3180         case CDF_UINT1: { 
 3181             U8 * buffer;
 3182             New(42, buffer, count, U8); 
 3183                 for (i=0 ; i < count; i++)
 3184                    buffer[i] = (U8) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3185 
 3186         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3187                 NULL_);
 3188         Safefree(buffer); 
 3189         break;
 3190         }
 3191         case CDF_EPOCH:
 3192         case CDF_DOUBLE:
 3193         case CDF_REAL8: {
 3194         double * buffer;
 3195         New(42, buffer, count, double);
 3196                 for (i=0 ; i < count; i++)
 3197                    buffer[i] = (double) SvNV(*(av_fetch(ArrayRef, i, 0)));
 3198 
 3199         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3200                 NULL_);
 3201         Safefree(buffer);
 3202         break; 
 3203         }
 3204         case CDF_EPOCH16: {
 3205         double * buffer;
 3206         New(42, buffer, 2*count, double);
 3207                 for (i=0 ; i < 2*count; i++)
 3208            buffer[i] = (double) SvNV(*(av_fetch(ArrayRef, i, 0)));  
 3209 
 3210         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3211                 NULL_);
 3212         Safefree(buffer);
 3213         break; 
 3214         }
 3215         case CDF_REAL4:
 3216         case CDF_FLOAT: {
 3217         float * buffer;
 3218         New(42, buffer, count, float);
 3219                 for (i=0 ; i < count; i++)
 3220                    buffer[i] = (float) SvNV(*(av_fetch(ArrayRef, i, 0)));
 3221 
 3222         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3223                 NULL_);
 3224         Safefree(buffer);
 3225         break;
 3226         }
 3227         case CDF_INT4:  {
 3228         I32 * buffer;
 3229         New(42, buffer, count, I32);
 3230                 for (i=0 ; i < count; i++)
 3231                    buffer[i] = (I32) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3232 
 3233         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3234                 NULL_);
 3235         Safefree(buffer);
 3236         break;
 3237         }
 3238         case CDF_INT8:
 3239         case CDF_TIME_TT2000:  {
 3240         double * buffer;
 3241                 SV **value;
 3242                 long long tmp;
 3243         New(42, buffer, count, double);
 3244                 for (i=0 ; i < count; i++) {
 3245                   value = av_fetch(ArrayRef, i, 0);
 3246                   if (SvIOK(*value)) {
 3247                     tmp = (long long) SvIV(*value);
 3248                   } else if (SvNOK(*value)) {
 3249                     tmp = (long long) SvNV(*value);
 3250                   } else {
 3251                     sscanf(SvPV_nolen(*value),"%lld",&tmp);
 3252                   }
 3253                   memcpy (buffer+i, &tmp, 8);
 3254                 }
 3255         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3256                 NULL_);
 3257         Safefree(buffer);
 3258         break;
 3259         }
 3260         case CDF_UINT4:  {
 3261         U32 * buffer;
 3262         New(42, buffer, count, U32);
 3263                 for (i=0 ; i < count; i++)
 3264                    buffer[i] = (U32) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3265 
 3266         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3267                 NULL_);
 3268         Safefree(buffer);
 3269         break;
 3270         }
 3271         case CDF_INT2:  {
 3272         I16 * buffer;
 3273         New(42, buffer, count, I16);
 3274                 for (i=0 ; i < count; i++) {
 3275                    buffer[i] = (I16) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3276         }
 3277 
 3278         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3279                 NULL_);
 3280         Safefree(buffer);
 3281         break;
 3282         }
 3283         case CDF_UINT2:  {
 3284         U16 * buffer;
 3285         New(42, buffer, count, U16);
 3286                 for (i=0 ; i < count; i++)
 3287                    buffer[i] = (U16) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3288 
 3289         RETVAL = CDFlib(operation, item, DataType, numElems, buffer, 
 3290                 NULL_);
 3291         Safefree(buffer);
 3292         break;
 3293         }
 3294         default: {
 3295         printf ("PUT attribute information: Bad Datatype = %ld \n", 
 3296             DataType);
 3297         }
 3298       }
 3299     }
 3300     OUTPUT:
 3301     RETVAL
 3302     
 3303 CDFstatus
 3304 CDFliblab(operation, item, AnyLong, ArrayRef, DataRef)
 3305     long    operation
 3306     long    item
 3307     long    AnyLong
 3308     AV *    ArrayRef
 3309     AV *    DataRef
 3310     CODE:
 3311     {
 3312       long Varnum[1];
 3313       long dimsizes[CDF_MAX_DIMS], numdims, DataType, numElems;
 3314           long dimVarys[CDF_MAX_DIMS]; 
 3315       CDFstatus status = CDF_OK;
 3316       I32 i, j, idx;
 3317       I32 numValues=1;
 3318           RETVAL = 0;
 3319       idx = 0;
 3320       for ( i=0; i<AnyLong; i++) {
 3321         Varnum[0] = (long) SvIV(*(av_fetch(ArrayRef, i, 0)));
 3322         if (item == rVARs_RECDATA_) 
 3323         status = CDFlib(SELECT_, rVAR_, Varnum[0], 
 3324                 GET_, rVAR_DATATYPE_, &DataType,
 3325                       rVAR_NUMELEMS_, &numElems,
 3326                                       rVAR_DIMVARYS_, dimVarys,
 3327                       rVARs_NUMDIMS_, &numdims,
 3328                       rVARs_DIMSIZES_, dimsizes, NULL_);
 3329         else
 3330                 status = CDFlib(SELECT_, zVAR_, Varnum[0],
 3331                 GET_, zVAR_DATATYPE_, &DataType,
 3332                                       zVAR_NUMELEMS_, &numElems,
 3333                                       zVAR_DIMVARYS_, dimVarys,
 3334                                       zVAR_NUMDIMS_, &numdims,
 3335                                       zVAR_DIMSIZES_, dimsizes, NULL_);
 3336             if (status == CDF_OK) {
 3337           numValues = 1;
 3338           for (j=0; j < numdims; j++) 
 3339         if (dimVarys[j]) numValues *=dimsizes[j];
 3340           switch (DataType) {
 3341                case CDF_UCHAR:
 3342            case CDF_CHAR:  {
 3343              char * buffer; char * temp;
 3344          STRLEN len;
 3345              New(42, buffer, numElems*numValues+1, char);
 3346              New(42, temp, numElems+1, char);
 3347                  for (j=0; j<numValues; j++) {
 3348            strncpy(temp, SvPV(*(av_fetch(DataRef, idx+j, 0)), len),
 3349                numElems);
 3350                    *(temp+numElems) = '\0';
 3351            if ((int) strlen(temp) < (int) numElems) {
 3352              int ix;
 3353              for (ix=(int)strlen(temp); ix<(int)numElems; ix++)
 3354                        temp[ix] = '\0';
 3355            }
 3356            strncpy(buffer+j*numElems, temp, numElems);
 3357          }
 3358          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3359          idx += numValues;
 3360          Safefree(buffer);
 3361          Safefree(temp);
 3362          break;
 3363            }
 3364 /*
 3365            case CDF_UCHAR:  {
 3366              void * buffer; 
 3367          void * temp;
 3368          STRLEN len;
 3369              New(42, buffer, numElems*numValues+1, U8);
 3370              New(42, temp, numElems+1, U8);
 3371                  for (j=0; j<numValues; j++) {
 3372            strncpy((char *)temp, SvPV(*(av_fetch(DataRef, idx+j, 0)), len),
 3373                numElems+1);
 3374                    if ((int) strlen((char *)temp) < (int) numElems) {
 3375                      int ix;
 3376                      for (ix=(int)strlen((char *)temp); ix<(int)numElems; ix++) 
 3377              *(((char *)temp)+ix) = '\0';
 3378                      *(((char *) temp)+numElems) = '\0';
 3379                    }
 3380                    strncpy((char *)buffer+j*numElems, (char *)temp, numElems+1);
 3381          }
 3382          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3383          idx += numValues;
 3384          Safefree(buffer);
 3385          Safefree(temp);
 3386          break;
 3387            }
 3388 */
 3389            case CDF_BYTE:
 3390            case CDF_INT1:  {
 3391              I8 * buffer;
 3392              New(42, buffer, numValues, I8);
 3393                  for (j=0; j<numValues; j++) 
 3394            buffer[j] = (I8) SvIV(*(av_fetch(DataRef, idx+j, 0))); 
 3395          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3396                  idx += numValues;
 3397          Safefree(buffer);
 3398          break;
 3399            }
 3400            case CDF_UINT1: {
 3401              U8 * buffer;
 3402              New(42, buffer, numValues, U8);
 3403                  for (j=0; j<numValues; j++) 
 3404            buffer[j] = (U8) SvIV(*(av_fetch(DataRef, idx+j, 0))); 
 3405          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3406                  idx += numValues;
 3407          Safefree(buffer);
 3408          break;
 3409            }
 3410            case CDF_DOUBLE:
 3411            case CDF_REAL8: {
 3412          double * buffer;
 3413          New(42, buffer, numValues, double);
 3414          for (j=0; j<numValues; j++) 
 3415            buffer[j] = (double) SvNV(*(av_fetch(DataRef, idx+j, 0)));
 3416          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3417                  idx += numValues;
 3418          Safefree(buffer);
 3419          break; 
 3420            } 
 3421            case CDF_REAL4:
 3422            case CDF_FLOAT: {
 3423          float * buffer; 
 3424          New(42, buffer, numValues, float);
 3425          for (j=0; j<numValues; j++) 
 3426            buffer[j] = (float) SvNV(*(av_fetch(DataRef, idx+j, 0)));
 3427          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3428                  idx += numValues;
 3429          Safefree(buffer);
 3430          break;
 3431            }
 3432            case CDF_INT4:  {
 3433          I32 * buffer;
 3434          New(42, buffer, numValues, I32);
 3435          for (j=0; j<numValues; j++) 
 3436            buffer[j] = (I32) SvIV(*(av_fetch(DataRef, idx+j, 0)));
 3437          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3438                  idx += numValues;
 3439          Safefree(buffer);
 3440          break;
 3441            }
 3442            case CDF_INT8:
 3443            case CDF_TIME_TT2000:  {
 3444                  double * buffer;
 3445                  SV **value;
 3446                  long long tmp;
 3447                  New(42, buffer, numValues, double);
 3448                  for (j=0 ; j < numValues; j++) {
 3449                    value = av_fetch(ArrayRef, idx+j, 0);
 3450                    if (SvIOK(*value)) {
 3451                      tmp = (long long) SvIV(*value);
 3452                    } else if (SvNOK(*value)) {
 3453                      tmp = (long long) SvNV(*value);
 3454                    } else {
 3455                      sscanf(SvPV_nolen(*value),"%lld",&tmp);
 3456                    }
 3457                    memcpy (buffer+j, &tmp, 8);
 3458                  }
 3459          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3460                  idx += numValues;
 3461          Safefree(buffer);
 3462          break;
 3463            }
 3464            case CDF_UINT4:  {
 3465          U32 * buffer;
 3466          New(42, buffer, numValues, U32);
 3467          for (j=0; j<numValues; j++) 
 3468            buffer[j] = (U32) SvIV(*(av_fetch(DataRef, idx+j, 0)));
 3469          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3470                  idx += numValues;
 3471          Safefree(buffer);
 3472          break;
 3473            }
 3474            case CDF_INT2:  {
 3475          I16 * buffer;
 3476          New(42, buffer, numValues, I16);
 3477          for (j=0; j<numValues; j++) 
 3478            buffer[j] = (I16) SvIV(*(av_fetch(DataRef, idx+j, 0)));
 3479          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3480                  idx += numValues;
 3481          Safefree(buffer);
 3482          break;
 3483            }
 3484            case CDF_UINT2:  {
 3485          U16 * buffer;
 3486          New(42, buffer, numValues, U16);
 3487          for (j=0; j<numValues; j++) 
 3488            buffer[j] = (U16) SvIV(*(av_fetch(DataRef, idx+j, 0)));
 3489          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3490          idx += numValues;
 3491          Safefree(buffer);
 3492          break;
 3493            }
 3494            default:
 3495          printf ("PUT RECDATA: Bad Datatype = %ld \n", DataType);
 3496           }
 3497         } else {
 3498               RETVAL = status;
 3499               break;
 3500             }
 3501           }
 3502     }
 3503     OUTPUT:
 3504     RETVAL  
 3505     
 3506 CDFstatus
 3507 CDFlibla2(operation, item, AnyLong, ArrayRef, DataRef)
 3508     long    operation
 3509     long    item
 3510     long    AnyLong
 3511     AV *    ArrayRef
 3512     AV *    DataRef
 3513     CODE:
 3514     {
 3515       long Varnum[1];
 3516       CDFstatus status = CDF_OK;
 3517       I32 i, j; 
 3518       long DataType, numElems, numDims, dimSizes[CDF_MAX_DIMS];
 3519       long numValues, dimVarys[CDF_MAX_DIMS];
 3520           RETVAL = 0;
 3521       for ( i=0 ; i<AnyLong ; i++) {
 3522         Varnum[0] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 3523         if (item == rVARs_RECDATA_) 
 3524         status = CDFlib(SELECT_, rVAR_, Varnum[0], 
 3525                 GET_, rVAR_DATATYPE_, &DataType,
 3526                       rVAR_NUMELEMS_, &numElems, 
 3527                                       rVAR_DIMVARYS_, dimVarys,
 3528                                       rVARs_NUMDIMS_, &numDims,
 3529                                       rVARs_DIMSIZES_, dimSizes,
 3530                 NULL_);
 3531         else
 3532                 status = CDFlib(SELECT_, zVAR_, Varnum[0],
 3533                 GET_, zVAR_DATATYPE_, &DataType,
 3534                                       zVAR_NUMELEMS_, &numElems, 
 3535                                       zVAR_DIMVARYS_, dimVarys,
 3536                                       zVAR_NUMDIMS_, &numDims,
 3537                                       zVAR_DIMSIZES_, dimSizes,
 3538                 NULL_);
 3539             if (status == CDF_OK) {
 3540           numValues = 1;  
 3541           for (j=0; j<numDims; j++) 
 3542         if (dimVarys[j]) numValues *= dimSizes[j]; 
 3543           switch (DataType) {
 3544            case CDF_UCHAR:
 3545            case CDF_CHAR:  {
 3546                  int x, iend;
 3547              char * buffer, *temp;
 3548              New(42, buffer, numElems*numValues+1, char);
 3549              New(42, temp, numElems+1, char);
 3550          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3551                  *(buffer+numElems*numValues) = '\0';
 3552          for (j=0; j<numValues; j++) {
 3553                    memcpy(temp, buffer+j*numElems, numElems);
 3554                    *(temp+numElems) = '\0';
 3555                    iend = numElems;
 3556                    for (x = 0; x < numElems; ++x) {
 3557                      if (*(temp+x) == '\0') {
 3558                        iend = x;
 3559                        break;
 3560                      }
 3561                    }
 3562                    av_push(DataRef, newSVpv((char *) temp, iend));
 3563                  }
 3564          Safefree(buffer);
 3565          Safefree(temp);
 3566          break;
 3567            }
 3568 /*
 3569            case CDF_UCHAR:  {
 3570              void * buffer;
 3571              New(42, buffer, numElems*numValues+1, U8);
 3572          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3573                  for (j=0; j<numValues; j++)
 3574                    av_push(DataRef, newSVpv((char *)buffer+j*numElems,
 3575                          numElems));
 3576          Safefree(buffer);
 3577          break;
 3578            }
 3579 */
 3580            case CDF_BYTE:
 3581            case CDF_INT1:  {
 3582              I8 * buffer;
 3583              New(42, buffer, numValues, I8);
 3584          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3585                  for (j=0; j<numValues; j++)
 3586                    av_push(DataRef, newSViv((I8) buffer[j]));
 3587          Safefree(buffer);
 3588          break;
 3589            }
 3590            case CDF_UINT1: {
 3591              U8 * buffer;
 3592              New(42, buffer, numValues, U8);
 3593          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3594                  for (j=0; j<numValues; j++)
 3595                    av_push(DataRef, newSViv((U8) buffer[j]));
 3596          Safefree(buffer);
 3597          break;
 3598            }
 3599            case CDF_EPOCH:
 3600            case CDF_DOUBLE:
 3601            case CDF_REAL8: {
 3602          double * buffer;
 3603          New(42, buffer, numValues, double);
 3604          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3605          for (j=0; j<numValues; j++) 
 3606                    av_push(DataRef, newSVnv(buffer[j]));
 3607          Safefree(buffer);
 3608          break; 
 3609            }
 3610            case CDF_EPOCH16: {
 3611          double * buffer;
 3612          New(42, buffer, 2*numValues, double);
 3613          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3614          for (j=0; j<2*numValues; j++) 
 3615                    av_push(DataRef, newSVnv(buffer[j]));
 3616          Safefree(buffer);
 3617          break; 
 3618            }
 3619            case CDF_REAL4:
 3620            case CDF_FLOAT: {
 3621          float * buffer;
 3622          New(42, buffer, numValues, float);
 3623          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3624          for (j=0; j<numValues; j++) 
 3625                    av_push(DataRef, newSVnv((double)buffer[j]));
 3626          Safefree(buffer);
 3627          break;
 3628            }
 3629            case CDF_INT4:  {
 3630          I32 * buffer;
 3631          New(42, buffer, numValues, I32);
 3632          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3633          for (j=0; j<numValues; j++) 
 3634                    av_push(DataRef, newSViv((IV)buffer[j]));
 3635          Safefree(buffer);
 3636          break;
 3637            }
 3638            case CDF_INT8:
 3639            case CDF_TIME_TT2000:  {
 3640          double * buffer;
 3641                  long long tmp;
 3642                  char str[25];
 3643          New(42, buffer, numValues, double);
 3644          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3645                  for (j=0 ; j < numValues; j++) {
 3646                    memcpy (&tmp, buffer+j, 8);
 3647                    snprintf(str, 24, "%lld", tmp);
 3648                    av_push(DataRef, newSVpv(str, strlen(str)));
 3649                  }
 3650          Safefree(buffer);
 3651          break;
 3652            }
 3653            case CDF_UINT4:  {
 3654          U32 * buffer;
 3655          New(42, buffer, numValues, U32);
 3656          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3657          for (j=0; j<numValues; j++) 
 3658                    av_push(DataRef, newSViv((IV)buffer[j]));
 3659          Safefree(buffer);
 3660          break;
 3661            }
 3662            case CDF_INT2:  {
 3663          I16 * buffer;
 3664          New(42, buffer, numValues, I16);
 3665          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3666          for (j=0; j<numValues; j++) 
 3667                    av_push(DataRef, newSViv((IV)buffer[j]));
 3668          Safefree(buffer);
 3669          break;
 3670            }
 3671            case CDF_UINT2:  {
 3672          U16 * buffer;
 3673          New(42, buffer, numValues, U16);
 3674          RETVAL = CDFlib(operation, item, 1, Varnum, buffer, NULL_);
 3675          for (j=0; j<numValues; j++) 
 3676            av_push(DataRef, newSViv((IV)buffer[j]));
 3677          Safefree(buffer);
 3678          break;
 3679            }
 3680            default:
 3681          printf ("GET RECDATA: Bad Datatype = %ld \n", DataType);
 3682           }
 3683             } else {
 3684               RETVAL = status;
 3685               break;
 3686             }
 3687       }
 3688     }
 3689     OUTPUT:
 3690     DataRef
 3691     RETVAL  
 3692     
 3693 CDFstatus
 3694 CDFlib5(operation, item, AnyLong)
 3695     long    operation
 3696     long    item
 3697     long    AnyLong = NO_INIT
 3698     CODE:
 3699         RETVAL = CDFlib(operation, item, &AnyLong, NULL_);
 3700     OUTPUT:
 3701     AnyLong
 3702     RETVAL
 3703     
 3704 CDFstatus
 3705 CDFlib51(operation, item, recNumber, ArrayRef)
 3706     long    operation
 3707     long    item
 3708     long    recNumber = NO_INIT
 3709     AV *    ArrayRef
 3710     CODE:
 3711     {
 3712       long LongArray[CDF_MAX_DIMS];
 3713       long count;
 3714       int i;
 3715       CDFstatus status = CDF_OK;
 3716       RETVAL = CDFlib(operation, item, &recNumber, LongArray, NULL_);
 3717       if (item == rVAR_SEQPOS_) 
 3718         status = CDFlib(GET_, rVARs_NUMDIMS_, &count, NULL_);
 3719       else 
 3720         status = CDFlib(GET_, zVAR_NUMDIMS_, &count, NULL_);
 3721           if (status == CDF_OK) {
 3722         ArrayRef = (AV *)SvRV(ST(3)); 
 3723         av_clear(ArrayRef); 
 3724         if (count == 0)  
 3725         av_push(ArrayRef, newSViv((IV)0));
 3726         else {
 3727           for ( i=0 ; i<(int)count ; i++) 
 3728             av_push(ArrayRef, newSViv((IV)LongArray[i]));
 3729         }
 3730           } else
 3731             RETVAL = status;
 3732     }
 3733     OUTPUT:
 3734     recNumber
 3735     ArrayRef
 3736     RETVAL
 3737     
 3738 CDFstatus
 3739 CDFlib1(operation, item, ArrayRef)
 3740     long    operation
 3741     long    item
 3742     AV *    ArrayRef
 3743     CODE:
 3744     {
 3745        int i;
 3746        long count;
 3747        CDFstatus status = CDF_OK;
 3748        long LongArray[CDF_MAX_DIMS];
 3749        RETVAL = CDFlib(operation, item, LongArray, NULL_);
 3750        if (item == rVARs_DIMCOUNTS_ || item == rVARs_DIMINDICES_ ||
 3751            item == rVARs_DIMINTERVALS_ || item == rVAR_DIMVARYS_ ||
 3752            item == rVARs_DIMSIZES_) 
 3753         status = CDFlib(GET_, rVARs_NUMDIMS_, &count, NULL_);
 3754        else 
 3755         status = CDFlib(GET_, zVAR_NUMDIMS_, &count, NULL_);
 3756            if (status == CDF_OK) {
 3757          ArrayRef = (AV *)SvRV(ST(2)); 
 3758          av_clear(ArrayRef); 
 3759          if (count == 0) 
 3760         av_push(ArrayRef, newSViv((IV)0)); 
 3761          else {
 3762         for (i=0; i < (int)count ; i++) 
 3763             av_push(ArrayRef, newSViv((IV)LongArray[i]));
 3764          }
 3765           } else
 3766             RETVAL = status;
 3767     }
 3768     OUTPUT:
 3769     ArrayRef
 3770     RETVAL
 3771     
 3772 CDFstatus
 3773 CDFliba(operation, item, ArrayRef)
 3774     long    operation
 3775     long    item
 3776     AV *    ArrayRef
 3777     CODE:
 3778     {
 3779        I32 count, i;
 3780        long LongArray[CDF_MAX_DIMS];
 3781        count = (int) av_len(ArrayRef); 
 3782        if (count < 0) 
 3783         printf ("Input Long Array: No values specified\n");
 3784        else {
 3785         for ( i=0 ; i<=count ; i++) 
 3786             LongArray[i] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 3787        }
 3788        RETVAL = CDFlib(operation, item, LongArray, NULL_);
 3789     }      
 3790     OUTPUT:
 3791     RETVAL
 3792     
 3793 CDFstatus
 3794 CDFlib8B(operation, item, numStrings, ArrayRef)
 3795     long    operation
 3796     long    item
 3797     long    numStrings
 3798     AV *    ArrayRef
 3799     CODE:
 3800     {
 3801        long count = numStrings;
 3802        if (count < 0) { 
 3803         printf ("Input string Array: No values specified\n");
 3804                 RETVAL = BAD_NUM_STRINGS;
 3805        } else {
 3806                 I32  i;
 3807                 char **buffer = NULL;
 3808                 STRLEN len2;
 3809                 buffer = (char **) malloc (sizeof(char *) * count);
 3810         for ( i=0 ; i<count ; i++) {
 3811                    buffer[i] = malloc(strlen(SvPV(*(av_fetch(ArrayRef, i, 0)),
 3812                                                   len2))+1);
 3813                    strcpy (buffer[i], SvPV(*(av_fetch(ArrayRef, i, 0)), len2));
 3814                 }
 3815             RETVAL = CDFlib(operation, item, numStrings, buffer, NULL_);
 3816                 CDF_Free_String (count, buffer);
 3817            }
 3818     }      
 3819     OUTPUT:
 3820     RETVAL
 3821     
 3822 CDFstatus
 3823 CDFlibv(operation, item, DataRef)
 3824     long    operation
 3825     long    item
 3826     SV *    DataRef = NO_INIT
 3827     CODE:
 3828     {
 3829        I32 j;
 3830        CDFstatus status = CDF_OK;
 3831        long DataType, numElems;
 3832            RETVAL = 0;
 3833        DataRef = (SV *) SvRV(ST(2));
 3834        if (item == rVAR_DATA_ || item == rVAR_PADVALUE_ ||
 3835            item == rVAR_SEQDATA_)
 3836          status = CDFlib(GET_, rVAR_DATATYPE_, &DataType,
 3837                                rVAR_NUMELEMS_, &numElems,
 3838                      NULL_);
 3839        else 
 3840         status = CDFlib(GET_, zVAR_DATATYPE_, &DataType,
 3841                               zVAR_NUMELEMS_, &numElems,
 3842                     NULL_);
 3843            if (status == CDF_OK) {
 3844          switch (DataType) {
 3845           case CDF_UCHAR:
 3846           case CDF_CHAR:  {
 3847         char *  buffer;
 3848         STRLEN len;
 3849         New(42, buffer, numElems+1, char); 
 3850         strncpy(buffer, SvPV(DataRef, len), numElems);
 3851                 *(buffer+numElems) = '\0';
 3852         if ((int) strlen(buffer) < (int) numElems) { 
 3853           for (j=(int)strlen(buffer); j<(int)numElems; j++)
 3854                     buffer[j] = '\0';
 3855         }
 3856         RETVAL = CDFlib(operation, item, buffer, NULL_);
 3857         Safefree(buffer);
 3858         break;
 3859           }
 3860 /*
 3861           case CDF_UCHAR:  {
 3862             void *  buffer;
 3863         STRLEN len;
 3864         New(42, buffer, numElems+1, unsigned char);
 3865                 strncpy((char *)buffer, SvPV(DataRef, len), numElems);
 3866                 if ((int) strlen((char *)buffer) < (int) numElems) {
 3867                   for (j=(int)strlen((char *)buffer); j<(int)numElems; j++) 
 3868             *(((char *)buffer)+j) = '\0';
 3869                  *(((char *) buffer)+numElems) = '\0';
 3870                 }
 3871         RETVAL = CDFlib(operation, item, buffer, NULL_);
 3872         Safefree(buffer);
 3873         break;
 3874           }
 3875 */
 3876           case CDF_BYTE:
 3877           case CDF_INT1:  {
 3878                 I8    buffer;
 3879                 buffer = (I8) SvIV(DataRef);
 3880                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3881                 break;
 3882               }
 3883               case CDF_UINT1: {
 3884                 U8    buffer;
 3885                 buffer = (U8) SvIV(DataRef);
 3886                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3887                 break;
 3888               }
 3889               case CDF_EPOCH:
 3890               case CDF_DOUBLE:
 3891               case CDF_REAL8: {
 3892                 double buffer;
 3893                 buffer = (double) SvNV(DataRef);
 3894                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3895                 break;
 3896               }
 3897 /*
 3898               case CDF_EPOCH16: {
 3899                 double buffer[2];
 3900                 buffer[0] = (double) SvNV(*(av_fetch(DataRef, 0, 0)));
 3901                 buffer[1] = (double) SvNV(*(av_fetch(DataRef, 1, 0)));
 3902                 RETVAL = CDFlib(operation, item, buffer, NULL_);
 3903                 break;
 3904               }
 3905 */
 3906               case CDF_REAL4:
 3907               case CDF_FLOAT: {
 3908                 float buffer;
 3909                 buffer = (float) SvNV(DataRef);
 3910                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3911                 break;
 3912               }
 3913               case CDF_INT4: { 
 3914                 I32 buffer;
 3915                 buffer = (I32) SvIV(DataRef);
 3916                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3917                 break;
 3918               }
 3919               case CDF_INT8:
 3920               case CDF_TIME_TT2000: { 
 3921                 long long buffer;
 3922                 if (SvIOK(DataRef)) {
 3923                   buffer = (long long) SvIV(DataRef);
 3924                 } else if (SvNOK(DataRef)) {
 3925                   buffer = (long long) SvNV(DataRef);
 3926                 } else {
 3927                   sscanf(SvPV_nolen(DataRef),"%lld",&buffer);
 3928                 }
 3929                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3930                 break;
 3931               }
 3932               case CDF_UINT4: { 
 3933                 U32 buffer;
 3934                 buffer = (U32) SvIV(DataRef);
 3935                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3936                 break;
 3937               }
 3938               case CDF_INT2: {
 3939                 I16 buffer;
 3940                 buffer = (I16) SvIV(DataRef);
 3941                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3942                 break;
 3943               }
 3944               case CDF_UINT2: {
 3945                 U16 buffer;
 3946                 buffer = (U16) SvIV(DataRef);
 3947                 RETVAL = CDFlib(operation, item, &buffer, NULL_);
 3948                 break;
 3949           }
 3950           default:
 3951         printf ("Put value: Bad Datatype = %ld \n", DataType);
 3952          }
 3953        } else
 3954              RETVAL = status;
 3955     }
 3956     OUTPUT:
 3957     RETVAL
 3958 
 3959 CDFstatus       
 3960 CDFlibb(operation, item, DataRef)
 3961     long    operation
 3962     long    item
 3963     AV *    DataRef
 3964     CODE:
 3965     {
 3966        I32 i, j;
 3967        CDFstatus status = CDF_OK;
 3968        long DataType, numElems;
 3969        long recCount, dimCounts[CDF_MAX_DIMS], numDims;
 3970        long numValues; 
 3971            RETVAL = 0;
 3972        if (item == rVAR_HYPERDATA_)
 3973         status = CDFlib(GET_, rVAR_DATATYPE_, &DataType,
 3974                               rVAR_NUMELEMS_, &numElems,
 3975                                       rVARs_NUMDIMS_, &numDims,
 3976                         CONFIRM_, rVARs_RECCOUNT_, &recCount,
 3977                                           rVARs_DIMCOUNTS_, dimCounts,
 3978                     NULL_);
 3979        else 
 3980         status = CDFlib(GET_, zVAR_DATATYPE_, &DataType,
 3981                               zVAR_NUMELEMS_, &numElems,
 3982                                       zVAR_NUMDIMS_, &numDims,
 3983                         CONFIRM_, zVAR_RECCOUNT_, &recCount,
 3984                                           zVAR_DIMCOUNTS_, dimCounts,
 3985                     NULL_);
 3986            if (status == CDF_OK) {
 3987          numValues = recCount;
 3988          for (i = 0; i<numDims ; i++) numValues *= dimCounts[i];
 3989          switch (DataType) {
 3990               case CDF_UCHAR:
 3991           case CDF_CHAR:  {
 3992             char *  buffer; 
 3993         char *  temp;
 3994         STRLEN len;
 3995         New(42, buffer, numElems*numValues+1, char); 
 3996         New(42, temp, numElems+1, char); 
 3997         for (i=0 ; i < numValues; i++) {
 3998            strncpy(temp, SvPV(*(av_fetch(DataRef, i, 0)), len), 
 3999                numElems);
 4000                    *(temp+numElems) = '\0';
 4001            if ((int) strlen(temp) < (int) numElems) { 
 4002              for (j=(int)strlen(temp); j<(int)numElems; j++)
 4003                        temp[j] = '\0';
 4004            }
 4005            strncpy(buffer+i*numElems, temp, numElems);
 4006         }
 4007         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4008         Safefree(buffer);
 4009         Safefree(temp);
 4010         break;
 4011           }
 4012 /*
 4013           case CDF_UCHAR:  {
 4014             void *  buffer;
 4015             void *  temp;
 4016         STRLEN len;
 4017         New(42, buffer, numElems*numValues+1, unsigned char);
 4018                 New(42, temp, numElems+1, U8);
 4019         for (i=0 ; i < numValues; i++) {
 4020                    strncpy((char *)temp, SvPV(*(av_fetch(DataRef, i, 0)), len),
 4021                numElems+1);
 4022                    if ((int) strlen((char *)temp) < (int) numElems) {
 4023                      for (j=(int)strlen((char *)temp); j<(int)numElems; j++) 
 4024             *(((char *)temp)+j) = '\0';
 4025                      *(((char *)temp)+numElems) = '\0';
 4026                    }
 4027                    strncpy((char *)buffer+i*numElems, temp, numElems+1);
 4028                 }
 4029         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4030         Safefree(buffer);
 4031                 Safefree(temp);
 4032         break;
 4033           }
 4034 */
 4035           case CDF_BYTE:
 4036           case CDF_INT1:  {
 4037             I8 *    buffer;
 4038         New(42, buffer, numValues, I8); 
 4039         for (i=0 ; i < numValues; i++) 
 4040            buffer[i] = (I8) SvIV(*(av_fetch(DataRef, i, 0)));
 4041         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4042         Safefree(buffer);
 4043         break;
 4044           }
 4045           case CDF_UINT1: {
 4046             U8 *    buffer;
 4047         New(42, buffer, numValues, U8); 
 4048         for (i=0 ; i < numValues; i++) 
 4049            buffer[i] = (U8) SvIV(*(av_fetch(DataRef, i, 0)));
 4050         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4051         Safefree(buffer);
 4052         break;
 4053           }
 4054           case CDF_EPOCH:
 4055           case CDF_DOUBLE:
 4056           case CDF_REAL8: {
 4057         double * buffer;
 4058         New(42, buffer, numValues, double);
 4059         for (i=0; i<numValues; i++) 
 4060           buffer[i] = (double) SvNV(*(av_fetch(DataRef, i, 0)));
 4061         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4062         Safefree(buffer);
 4063         break; 
 4064           }
 4065           case CDF_EPOCH16: {
 4066         double * buffer;
 4067         New(42, buffer, 2*numValues, double);
 4068         for (i=0; i<2*numValues; i++) 
 4069           buffer[i] = (double) SvNV(*(av_fetch(DataRef, i, 0)));
 4070         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4071         Safefree(buffer);
 4072         break; 
 4073           }
 4074           case CDF_REAL4:
 4075           case CDF_FLOAT: {
 4076         float * buffer;
 4077         New(42, buffer, numValues, float);
 4078         for (i=0; i<numValues; i++) 
 4079           buffer[i] = (float) SvNV(*(av_fetch(DataRef, i, 0)));
 4080         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4081         Safefree(buffer);
 4082         break;
 4083           }
 4084           case CDF_INT4:  {
 4085         I32 * buffer;
 4086         New(42, buffer, numValues, I32);
 4087         for (i=0; i<numValues; i++) 
 4088           buffer[i] = (I32) SvIV(*(av_fetch(DataRef, i, 0)));
 4089         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4090         Safefree(buffer);
 4091         break;
 4092           }
 4093           case CDF_INT8:
 4094           case CDF_TIME_TT2000:  {
 4095                 double * buffer;
 4096                 SV **value;
 4097                 long long tmp;
 4098                 New(42, buffer, numValues, double);
 4099                 for (i=0 ; i < numValues; i++) {
 4100                   value = av_fetch(DataRef, i, 0);
 4101                   if (SvIOK(*value)) {
 4102                     tmp = (long long) SvIV(*value);
 4103                   } else if (SvNOK(*value)) {
 4104                     tmp = (long long) SvNV(*value);
 4105                   } else {
 4106                     sscanf(SvPV_nolen(*value),"%lld",&tmp);
 4107                   }
 4108                   memcpy (buffer+i, &tmp, 8);
 4109                 }
 4110         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4111         Safefree(buffer);
 4112         break;
 4113           }
 4114           case CDF_UINT4:  {
 4115         U32 * buffer;
 4116         New(42, buffer, numValues, U32);
 4117         for (i=0; i<numValues; i++) 
 4118           buffer[i] = (U32) SvIV(*(av_fetch(DataRef, i, 0)));
 4119         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4120         Safefree(buffer);
 4121         break;
 4122           }
 4123           case CDF_INT2:  {
 4124         I16 * buffer;
 4125         New(42, buffer, numValues, I16);
 4126         for (i=0; i<numValues; i++) 
 4127           buffer[i] = (I16) SvIV(*(av_fetch(DataRef, i, 0)));
 4128         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4129         Safefree(buffer);
 4130         break;
 4131           }
 4132           case CDF_UINT2:  {
 4133         U16 * buffer;
 4134         New(42, buffer, numElems, U16);
 4135         for (i=0; i<numValues; i++) 
 4136           buffer[i] = (U16) SvIV(*(av_fetch(DataRef, i, 0)));
 4137         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4138         Safefree(buffer);
 4139         break;
 4140           }
 4141           default:
 4142         printf ("Put Buffer: Bad Datatype = %ld \n", DataType);
 4143          }
 4144        } else
 4145              RETVAL = status;
 4146     }
 4147     OUTPUT:
 4148     RETVAL
 4149         
 4150 CDFstatus
 4151 CDFlib7(operation, item, DataRef)
 4152     long    operation
 4153     long    item
 4154     SV *    DataRef = NO_INIT
 4155     CODE:
 4156     {
 4157       CDFstatus status = CDF_OK;
 4158       long DataType, numElems;
 4159 
 4160           RETVAL = 0;
 4161           DataRef = (SV *)SvRV(ST(2));
 4162       if (item == gENTRY_DATA_) 
 4163         status = CDFlib(GET_, gENTRY_DATATYPE_, &DataType,
 4164                           gENTRY_NUMELEMS_, &numElems,
 4165                     NULL_);
 4166       else if (item == zENTRY_DATA_)
 4167         status = CDFlib(GET_, zENTRY_DATATYPE_, &DataType,
 4168                           zENTRY_NUMELEMS_, &numElems,
 4169                     NULL_);
 4170       else if (item == rENTRY_DATA_)
 4171         status = CDFlib(GET_, rENTRY_DATATYPE_, &DataType,
 4172                           rENTRY_NUMELEMS_, &numElems,
 4173                     NULL_);
 4174       else if (item == rVAR_DATA_ || item == rVAR_PADVALUE_ ||
 4175            item == rVAR_SEQDATA_)
 4176             status = CDFlib(GET_, rVAR_DATATYPE_, &DataType, 
 4177                                   rVAR_NUMELEMS_, &numElems, 
 4178                     NULL_);
 4179       else if (item == zVAR_DATA_ || item == zVAR_PADVALUE_ ||
 4180            item == zVAR_SEQDATA_)
 4181             status = CDFlib(GET_, zVAR_DATATYPE_, &DataType, 
 4182                                   zVAR_NUMELEMS_, &numElems, 
 4183                     NULL_);
 4184           if (status == CDF_OK) {
 4185         switch (DataType) {
 4186               case CDF_UCHAR:
 4187           case CDF_CHAR:  { 
 4188             char * buffer;
 4189                 int x, iend;
 4190         New(42, buffer, numElems+1, char);
 4191         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4192                 *(buffer+numElems) = '\0';
 4193                 iend = numElems;
 4194                 for (x = 0; x < numElems; ++x) {
 4195                   if (*(buffer+x) == '\0') {
 4196                     iend = x;
 4197                     break;
 4198                   }
 4199                 } 
 4200         sv_setpvn(DataRef, buffer, iend);
 4201         Safefree(buffer);
 4202         break;
 4203           }
 4204 /*
 4205           case CDF_UCHAR:  {
 4206             void *  buffer;
 4207         New(42, buffer, numElems, unsigned char);
 4208         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4209                 sv_setpvn(DataRef, (char *)buffer, numElems);
 4210         Safefree(buffer);
 4211         break;
 4212           }
 4213 */
 4214           case CDF_BYTE:
 4215           case CDF_INT1:  {
 4216             I8  buffer;
 4217         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4218         sv_setiv(DataRef, (IV) buffer); 
 4219         break;
 4220           }
 4221           case CDF_UINT1: {
 4222             U8  buffer;
 4223         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4224                 sv_setiv(DataRef, (IV) buffer); 
 4225         break;
 4226           }
 4227           case CDF_EPOCH:
 4228           case CDF_DOUBLE:
 4229           case CDF_REAL8: {
 4230         double buffer;
 4231         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4232                 sv_setnv(DataRef, (double) buffer); 
 4233         break; 
 4234           }
 4235 /*
 4236           case CDF_EPOCH16: {
 4237         double buffer[2];
 4238         int j;
 4239         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4240         for (j=0; j<2; j++) 
 4241                   av_push(DataRef, newSVnv(buffer[j]));
 4242         break; 
 4243           }
 4244 */
 4245           case CDF_REAL4:
 4246           case CDF_FLOAT: {
 4247         float buffer;
 4248         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4249                 sv_setnv(DataRef, (double) buffer); 
 4250         break;
 4251           }
 4252           case CDF_INT4:  {
 4253         I32 buffer;
 4254         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4255                 sv_setiv(DataRef, (IV) buffer); 
 4256         break;
 4257           }
 4258           case CDF_INT8:
 4259           case CDF_TIME_TT2000:  {
 4260                 long long buffer;
 4261                 char tmp[25];
 4262         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4263                 snprintf(tmp, 24, "%lld", buffer);
 4264                 sv_setpvn(DataRef, tmp, strlen(tmp)); 
 4265         break;
 4266           }
 4267           case CDF_UINT4:  {
 4268         U32 buffer;
 4269         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4270                 sv_setiv(DataRef, (IV) buffer); 
 4271         break;
 4272           }
 4273           case CDF_INT2:  {
 4274         I16 buffer;
 4275         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4276                 sv_setiv(DataRef, (IV) buffer); 
 4277         break;
 4278           }
 4279           case CDF_UINT2:  {
 4280         U16 buffer;
 4281         RETVAL = CDFlib(operation, item, &buffer, NULL_);
 4282         sv_setiv(DataRef, (IV) buffer); 
 4283         break;
 4284           }
 4285           default:
 4286         printf ("GET value: Bad Datatype = %ld \n", DataType);
 4287         }
 4288       } else
 4289             RETVAL = status;
 4290         }
 4291     OUTPUT:
 4292     DataRef
 4293     RETVAL
 4294         
 4295 CDFstatus
 4296 CDFlib7A(operation, item, DataRef)
 4297     long    operation
 4298     long    item
 4299     AV *    DataRef = NO_INIT
 4300     CODE:
 4301     {
 4302       CDFstatus status = CDF_OK;
 4303       long DataType, numElems;
 4304       int i;
 4305 
 4306       RETVAL = 0;
 4307 
 4308           DataRef = (AV *)SvRV(ST(2));
 4309       if (item == gENTRY_DATA_) 
 4310         status = CDFlib(GET_, gENTRY_DATATYPE_, &DataType,
 4311                           gENTRY_NUMELEMS_, &numElems,
 4312                     NULL_);
 4313       else if (item == zENTRY_DATA_)
 4314         status = CDFlib(GET_, zENTRY_DATATYPE_, &DataType,
 4315                           zENTRY_NUMELEMS_, &numElems,
 4316                     NULL_);
 4317       else if (item == rENTRY_DATA_)
 4318         status = CDFlib(GET_, rENTRY_DATATYPE_, &DataType,
 4319                           rENTRY_NUMELEMS_, &numElems,
 4320                     NULL_);
 4321       else if (item == rVAR_DATA_ || item == rVAR_PADVALUE_ ||
 4322            item == rVAR_SEQDATA_)
 4323             status = CDFlib(GET_, rVAR_DATATYPE_, &DataType, 
 4324                                   rVAR_NUMELEMS_, &numElems, 
 4325                     NULL_);
 4326       else if (item == zVAR_DATA_ || item == zVAR_PADVALUE_ ||
 4327            item == zVAR_SEQDATA_)
 4328             status = CDFlib(GET_, zVAR_DATATYPE_, &DataType, 
 4329                                   zVAR_NUMELEMS_, &numElems, 
 4330                     NULL_);
 4331           if (status == CDF_OK) {
 4332         switch (DataType) {
 4333           case CDF_UCHAR:
 4334           case CDF_CHAR:  { 
 4335             char * buffer;
 4336                 int x, iend;
 4337         New(42, buffer, numElems+1, char);
 4338         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4339                 *(buffer+numElems) = '\0';
 4340                 iend = numElems;
 4341                 for (x = 0; x < numElems; ++x) {
 4342                   if (*(buffer+x) == '\0') {
 4343                     iend = x;
 4344                     break;
 4345                   }
 4346                 }
 4347                 av_push(DataRef, newSVpv((char*)buffer, iend));
 4348         Safefree(buffer);
 4349         break;
 4350           }
 4351 /*
 4352           case CDF_UCHAR:  {
 4353             void *  buffer;
 4354         New(42, buffer, numElems, unsigned char);
 4355         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4356                 av_push(DataRef, newSVpv((char *)buffer, numElems));
 4357         Safefree(buffer);
 4358         break;
 4359           }
 4360 */
 4361           case CDF_BYTE:
 4362           case CDF_INT1:  {
 4363             I8 *    buffer;
 4364                 New(42, buffer, numElems, I8);
 4365         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4366                 for (i=0 ; i < (int) numElems; i++)
 4367                   av_push(DataRef, newSViv((I8)buffer[i]));
 4368                 Safefree(buffer);
 4369         break;
 4370           }
 4371           case CDF_UINT1: {
 4372             U8 *    buffer;
 4373                 New(42, buffer, numElems, U8);
 4374         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4375                 for (i=0 ; i < (int) numElems; i++)
 4376                   av_push(DataRef, newSViv((U8)buffer[i]));
 4377                 Safefree(buffer);
 4378         break;
 4379           }
 4380           case CDF_EPOCH:
 4381           case CDF_DOUBLE:
 4382           case CDF_REAL8: {
 4383         double *  buffer;
 4384                 New(42, buffer, numElems, double);
 4385         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4386                 for (i=0 ; i < (int) numElems; i++)
 4387                   av_push(DataRef, newSVnv((double)buffer[i]));
 4388                 Safefree(buffer);
 4389         break; 
 4390           }
 4391           case CDF_EPOCH16: {
 4392         double *  buffer;
 4393                 New(42, buffer, 2*numElems, double);
 4394         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4395                 for (i=0 ; i < 2*numElems; i++)
 4396                   av_push(DataRef, newSVnv((double)buffer[i]));
 4397                 Safefree(buffer);
 4398         break; 
 4399           }
 4400           case CDF_REAL4:
 4401           case CDF_FLOAT: {
 4402         float * buffer;
 4403                 New(42, buffer, numElems, float);
 4404         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4405                 for (i=0 ; i < (int) numElems; i++)
 4406                   av_push(DataRef, newSVnv((float)buffer[i]));
 4407                 Safefree(buffer);
 4408         break;
 4409           }
 4410           case CDF_INT4:  {
 4411         I32 * buffer;
 4412                 New(42, buffer, numElems, I32);
 4413         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4414                 for (i=0 ; i < (int) numElems; i++)
 4415                   av_push(DataRef, newSViv((I32)buffer[i]));
 4416                 Safefree(buffer);
 4417         break;
 4418           }
 4419           case CDF_INT8:
 4420           case CDF_TIME_TT2000:  {
 4421         double * buffer;
 4422                 long long tmp;
 4423                 char str[25];
 4424                 New(42, buffer, numElems, double);
 4425         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4426                 for (i=0 ; i < (int) numElems; i++) {
 4427                   memcpy (&tmp, buffer+i, 8);
 4428                   snprintf(str, 24, "%lld", tmp);
 4429                   av_push(DataRef, newSVpvn(str, strlen(str)));
 4430                 }
 4431                 Safefree(buffer);
 4432         break;
 4433           }
 4434           case CDF_UINT4:  {
 4435         U32 * buffer;
 4436                 New(42, buffer, numElems, U32);
 4437         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4438                 for (i=0 ; i < (int) numElems; i++)
 4439                   av_push(DataRef, newSViv((U32)buffer[i]));
 4440                 Safefree(buffer);
 4441         break;
 4442           }
 4443           case CDF_INT2:  {
 4444         I16 * buffer;
 4445                 New(42, buffer, numElems, I16);
 4446         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4447                 for (i=0 ; i < (int) numElems; i++)
 4448                   av_push(DataRef, newSViv((I16)buffer[i]));
 4449                 Safefree(buffer);
 4450         break;
 4451           }
 4452           case CDF_UINT2:  {
 4453         U16 * buffer;
 4454                 New(42, buffer, numElems, U16);
 4455         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4456                 for (i=0 ; i < (int) numElems; i++)
 4457                   av_push(DataRef, newSViv((U16)buffer[i]));
 4458         Safefree(buffer);
 4459         break;
 4460          }
 4461          default:
 4462         printf ("GET value: Bad Datatype = %ld \n", DataType);
 4463         }
 4464       } else
 4465             RETVAL = status;
 4466         }
 4467     OUTPUT:
 4468     DataRef
 4469     RETVAL
 4470         
 4471 CDFstatus
 4472 CDFlib8A(operation, item, ArrayRef)
 4473     long    operation
 4474     long    item
 4475     AV *    ArrayRef
 4476     CODE:
 4477     {
 4478       CDFstatus status = CDF_OK;
 4479       long numStrings, DataType;
 4480           char **buffer;
 4481       int i;
 4482 
 4483       RETVAL = 0;
 4484 
 4485       if (item == zENTRY_STRINGSDATA_) {
 4486         status = CDFlib(GET_, zENTRY_DATATYPE_, &DataType,
 4487                           zENTRY_NUMSTRINGS_, &numStrings,
 4488                     NULL_);
 4489       } else {
 4490         status = CDFlib(GET_, rENTRY_DATATYPE_, &DataType,
 4491                           rENTRY_NUMSTRINGS_, &numStrings,
 4492                     NULL_);
 4493           }
 4494           if (status == CDF_OK) {
 4495             if (DataType != CDF_CHAR && DataType != CDF_UCHAR)
 4496               RETVAL = TRY_TO_READ_NONSTRING_DATA;
 4497             else {
 4498               ArrayRef = (AV *)SvRV(ST(2));
 4499               av_clear(ArrayRef);
 4500           RETVAL = CDFlib(operation, item, &numStrings, &buffer, NULL_);
 4501               for (i = 0; i < numStrings; ++i)
 4502                 av_store(ArrayRef, i, newSVpv((char*)buffer[i],
 4503                                               strlen(buffer[i])));
 4504           CDF_Free_String (numStrings, buffer);
 4505             }
 4506           } else
 4507             RETVAL = status;
 4508         }
 4509     OUTPUT:
 4510     ArrayRef
 4511     RETVAL
 4512         
 4513 CDFstatus
 4514 CDFlib2(operation, item, DataRef)
 4515     long    operation
 4516     long    item
 4517     AV *    DataRef = NO_INIT
 4518     CODE:
 4519     {
 4520       CDFstatus status = CDF_OK;
 4521       long DataType, numElems;
 4522           long recCount;
 4523           long dimCounts[CDF_MAX_DIMS];
 4524           long numDims;
 4525       long numValues; 
 4526       int i;
 4527           RETVAL = 0;
 4528       DataRef = (AV *)SvRV(ST(2)); 
 4529       av_clear(DataRef); 
 4530       if (item == rVAR_HYPERDATA_ )
 4531                 status = CDFlib(CONFIRM_, rVARs_RECCOUNT_, &recCount,
 4532                                           rVARs_DIMCOUNTS_, dimCounts,
 4533                                 GET_, rVARs_NUMDIMS_, &numDims,
 4534                                   rVAR_DATATYPE_, &DataType,
 4535                                       rVAR_NUMELEMS_, &numElems,
 4536                                 NULL_);
 4537       else
 4538         status = CDFlib(CONFIRM_, zVAR_RECCOUNT_, &recCount,
 4539                                   zVAR_DIMCOUNTS_, dimCounts,
 4540                         GET_, zVAR_NUMDIMS_, &numDims,
 4541                                   zVAR_DATATYPE_, &DataType,
 4542                                       zVAR_NUMELEMS_, &numElems,
 4543                         NULL_);
 4544       if (status == CDF_OK) {   
 4545         numValues = recCount;
 4546         for (i = 0; i < numDims ; i++) numValues *= dimCounts[i];
 4547         switch (DataType) {
 4548               case CDF_UCHAR:
 4549           case CDF_CHAR:  { 
 4550             char * buffer;
 4551             char * temp;
 4552                 int x, iend;
 4553         New(42, buffer, numElems*numValues+1, char);
 4554         New(42, temp, numElems+1, char);
 4555         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4556         for (i=0; i < numValues; i++) {
 4557                   memcpy (temp, buffer+i*numElems, numElems);
 4558                   *(temp+numElems) = '\0';
 4559                   iend = numElems;
 4560                   for (x=0; x < numElems; x++) {
 4561                     if (*(temp+x) == '\0') {
 4562                       iend = x;
 4563                       break;
 4564                     }
 4565                   }
 4566           av_push(DataRef, newSVpv(temp, iend)); 
 4567                 }
 4568         Safefree(buffer);
 4569         Safefree(temp);
 4570         break;
 4571           }
 4572 /*
 4573           case CDF_UCHAR:  {
 4574             void *  buffer;
 4575             void * temp;
 4576         New(42, buffer, numElems*numValues+1, unsigned char);
 4577         New(42, temp, numElems+1, unsigned char);
 4578         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4579         for (i=0 ; i < numValues; i++) 
 4580           av_push(DataRef, newSVpv(strncpy((char *)temp, 
 4581                            (char *)buffer+i*numElems, 
 4582                            numElems), numElems)); 
 4583         Safefree(buffer);
 4584         Safefree(temp);
 4585         break;
 4586           }
 4587 */
 4588           case CDF_BYTE:
 4589           case CDF_INT1:  {
 4590             I8 *    buffer;
 4591         New(42, buffer, numValues, I8);
 4592         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4593         for (i=0 ; i < numValues; i++)  
 4594           av_push(DataRef, newSViv((I8)buffer[i]));
 4595         Safefree(buffer);
 4596         break;
 4597           }
 4598           case CDF_UINT1: {
 4599             U8 *    buffer;
 4600         New(42, buffer, numValues, U8);
 4601         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4602         for (i=0 ; i < numValues; i++)  
 4603           av_push(DataRef, newSViv((U8)buffer[i]));
 4604         Safefree(buffer);
 4605         break;
 4606           }
 4607           case CDF_EPOCH:
 4608           case CDF_DOUBLE:
 4609           case CDF_REAL8: {
 4610         double * buffer;
 4611         New(42, buffer, numValues, double);
 4612         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4613         for (i=0; i < numValues ; i++) 
 4614           av_push(DataRef, newSVnv((double)buffer[i]));
 4615         Safefree(buffer);
 4616         break; 
 4617           }
 4618           case CDF_EPOCH16: {
 4619         double * buffer;
 4620         New(42, buffer, 2*numValues, double);
 4621         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4622         for (i=0; i < 2*numValues ; i++) 
 4623           av_push(DataRef, newSVnv((double)buffer[i]));
 4624         Safefree(buffer);
 4625         break; 
 4626           }
 4627           case CDF_REAL4:
 4628           case CDF_FLOAT: {
 4629         float * buffer;
 4630         New(42, buffer, numValues, float);
 4631         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4632         for (i=0; i < numValues ; i++)
 4633           av_push(DataRef, newSVnv((float)buffer[i]));
 4634         Safefree(buffer);
 4635         break;
 4636           }
 4637           case CDF_INT4:  {
 4638         I32 * buffer;
 4639         New(42, buffer, numValues, I32);
 4640         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4641         for (i=0; i < numValues ; i++) 
 4642           av_push(DataRef, newSViv((IV)buffer[i]));
 4643         Safefree(buffer);
 4644         break;
 4645           }
 4646           case CDF_INT8:
 4647           case CDF_TIME_TT2000:  {
 4648         double * buffer;
 4649                 long long tmp;
 4650                 char str[25];
 4651         New(42, buffer, numValues, double);
 4652         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4653         for (i=0; i < numValues ; i++) {
 4654                   memcpy(&tmp, buffer+i, 8);
 4655                   snprintf(str, 24, "%lld", tmp);
 4656           av_push(DataRef, newSVpvn(str, strlen(str)));
 4657                 }
 4658         Safefree(buffer);
 4659         break;
 4660           }
 4661           case CDF_UINT4:  {
 4662         U32 * buffer;
 4663         New(42, buffer, numValues, U32);
 4664         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4665                 for (i=0; i < numValues ; i++)
 4666           av_push(DataRef, newSViv((IV)buffer[i]));
 4667         Safefree(buffer);
 4668         break;
 4669           }
 4670           case CDF_INT2:  {
 4671         I16 * buffer;
 4672         New(42, buffer, numValues, I16);
 4673         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4674         for (i=0; i < numValues ; i++) 
 4675           av_push(DataRef, newSViv((IV)buffer[i]));
 4676         Safefree(buffer);
 4677         break;
 4678           }
 4679           case CDF_UINT2:  {
 4680         U16 * buffer;
 4681         New(42, buffer, numValues, U16);
 4682         RETVAL = CDFlib(operation, item, buffer, NULL_);
 4683         for (i=0; i < numValues ; i++) 
 4684           av_push(DataRef, newSViv((IV)buffer[i]));
 4685         Safefree(buffer);
 4686         break;
 4687           }
 4688           default:
 4689         printf ("GET buffer: Bad Datatype = %ld \n", DataType);
 4690         }
 4691       } else
 4692             RETVAL = status;
 4693         }
 4694     OUTPUT:
 4695     DataRef
 4696     RETVAL
 4697         
 4698 CDFstatus
 4699 CDFlib515(operation, item, Type, ArrayRef, Pct)
 4700     long    operation
 4701     long    item
 4702     long    Type = NO_INIT
 4703     AV *    ArrayRef = NO_INIT
 4704     long    Pct = NO_INIT
 4705     CODE:
 4706     {
 4707       long LongArray[CDF_MAX_DIMS];
 4708       RETVAL = CDFlib(operation, item, &Type, LongArray, &Pct, 
 4709               NULL_);
 4710       ArrayRef = (AV *)SvRV(ST(3)); 
 4711       av_clear(ArrayRef); 
 4712       if (item == CDF_COMPRESSION_ || item == rVAR_COMPRESSION_ ||
 4713           item == zVAR_COMPRESSION_) { 
 4714         if (Type != NO_COMPRESSION) 
 4715         av_push(ArrayRef, newSViv((IV)LongArray[0]));
 4716         else
 4717                 av_push(ArrayRef, newSViv((IV) 0 ));
 4718       }
 4719     }
 4720     OUTPUT:
 4721     Type
 4722     ArrayRef
 4723     Pct
 4724     RETVAL
 4725     
 4726 CDFstatus
 4727 CDFlibs5155(operation, item, path, Type, ArrayRef, cSize, uSize)
 4728     long    operation
 4729     long    item
 4730     char *  path
 4731     long    Type = NO_INIT
 4732     AV *    ArrayRef = NO_INIT
 4733     long    cSize = NO_INIT
 4734     long    uSize = NO_INIT
 4735     CODE:
 4736     {
 4737       long LongArray[CDF_MAX_DIMS];
 4738       RETVAL = CDFlib(operation, item, path, &Type, LongArray,  
 4739               &cSize, &uSize, NULL_);
 4740       ArrayRef = (AV *)SvRV(ST(4)); 
 4741       av_clear(ArrayRef); 
 4742       if (Type != NO_COMPRESSION) 
 4743         av_push(ArrayRef, newSViv((IV)LongArray[0]));
 4744             else
 4745                 av_push(ArrayRef, newSViv((IV) 0 ));
 4746     }
 4747     OUTPUT:
 4748     Type
 4749     ArrayRef
 4750     cSize
 4751     uSize
 4752     RETVAL
 4753     
 4754 CDFstatus
 4755 CDFCreateAttr(operation, item, AnyString, AnyLong, AnotherLong)
 4756     long    operation
 4757     long    item
 4758     char *  AnyString
 4759     long    AnyLong
 4760     long    AnotherLong = NO_INIT
 4761     CODE:
 4762         RETVAL = CDFlib(operation, item, AnyString, AnyLong, 
 4763                 &AnotherLong, NULL_);
 4764     OUTPUT:
 4765     AnotherLong
 4766     RETVAL
 4767     
 4768 CDFstatus
 4769 CDFCreateCDF(operation, item, AnyString, numDims, ArrayRef, AnyId)
 4770     long    operation
 4771     long    item
 4772     char *  AnyString
 4773     long    numDims
 4774     AV *    ArrayRef
 4775     CDFid   AnyId = NO_INIT
 4776     CODE:
 4777     {
 4778       long LongArray[CDF_MAX_DIMS];
 4779       I32 count, i;
 4780       count = (int) av_len(ArrayRef);
 4781       if (count < 0)
 4782         printf ("Create CDF: No dimension values specified\n");
 4783       else {
 4784         for ( i=0 ; i<=count ; i++) 
 4785           LongArray[i] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 4786       }
 4787       RETVAL = CDFlib(operation, item, AnyString, numDims, LongArray, 
 4788               &AnyId, NULL_);
 4789     }
 4790     OUTPUT:
 4791     AnyId
 4792     RETVAL
 4793     
 4794 CDFstatus
 4795 CDFCreateRvar(operation, item, AnyString, AnyLong, AnotherLong, FurtherLong, ArrayRef, FinalLong)
 4796     long    operation
 4797     long    item
 4798     char *  AnyString
 4799     long    AnyLong
 4800     long    AnotherLong
 4801     long    FurtherLong
 4802     AV *    ArrayRef
 4803     long    FinalLong = NO_INIT
 4804     CODE:
 4805     {
 4806       long LongArray[CDF_MAX_DIMS];
 4807       I32 count, i;
 4808       count = (int) av_len(ArrayRef);
 4809       if (count < 0)
 4810         printf (" Create R Variable: No dimension sizes specified\n");
 4811       else {
 4812         for ( i=0 ; i<=count; i++) 
 4813           LongArray[i] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 4814       }
 4815       RETVAL = CDFlib(operation, item, AnyString, AnyLong, AnotherLong, 
 4816               FurtherLong, LongArray, &FinalLong, NULL_);
 4817     }
 4818     OUTPUT:
 4819     FinalLong
 4820     RETVAL
 4821     
 4822 CDFstatus
 4823 CDFCreateZvar(operation, item, varName, dataType, numElems, numDims, ArrayRef, recVary, AnotherArrayRef, varNum)
 4824     long    operation
 4825     long    item
 4826     char *  varName
 4827     long    dataType
 4828     long    numElems
 4829     long    numDims
 4830     AV *    ArrayRef
 4831     long    recVary
 4832     AV *    AnotherArrayRef
 4833     long    varNum = NO_INIT
 4834     CODE:
 4835     {
 4836       I32 count, i;
 4837       long dimSizes[CDF_MAX_DIMS];
 4838       long dimVarys[CDF_MAX_DIMS];
 4839       count = (int) av_len(ArrayRef);
 4840       if (count < 0) {
 4841         dimSizes[0] = 1;
 4842         dimVarys[0] = VARY;
 4843       } else {
 4844         for (i=0;i<=count;i++) {
 4845           dimSizes[i] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 4846           dimVarys[i] = (long)SvIV(*(av_fetch(AnotherArrayRef, i, 0)));
 4847         }
 4848       }
 4849       RETVAL = CDFlib(operation, item, varName, dataType, numElems, 
 4850               numDims, dimSizes, recVary, dimVarys, &varNum, NULL_);
 4851     }
 4852     OUTPUT:
 4853     varNum
 4854     RETVAL
 4855 
 4856 CDFstatus
 4857 CDFcreateX(AnyString, numDims, ArrayRef, encoding, majority, AnyId)
 4858         char *  AnyString
 4859         long    numDims
 4860         AV *    ArrayRef
 4861     long    encoding
 4862     long    majority
 4863         CDFid   AnyId = NO_INIT
 4864         CODE:
 4865         {
 4866           long LongArray[CDF_MAX_DIMS];
 4867           I32 count, i;
 4868           count = (int) av_len(ArrayRef);
 4869           if (count < 0)
 4870                 printf ("Create CDF: No dimension values specified\n");
 4871           else {
 4872                 for ( i=0 ; i<=count ; i++)
 4873                   LongArray[i] = (long)SvIV(*(av_fetch(ArrayRef, i, 0)));
 4874           }
 4875           RETVAL = CDFlib(CREATE_, CDF_, AnyString, numDims, LongArray, &AnyId,
 4876               PUT_, CDF_ENCODING_, encoding,
 4877                     CDF_MAJORITY_, majority,
 4878               NULL_);
 4879         }
 4880         OUTPUT:
 4881         AnyId
 4882         RETVAL
 4883 
 4884 CDFstatus
 4885 CDFopenX(AnyString, AnyId)
 4886         char *  AnyString
 4887         CDFid   AnyId = NO_INIT
 4888         CODE:
 4889         {
 4890           RETVAL = CDFlib(OPEN_, CDF_, AnyString, &AnyId, 
 4891               NULL_);
 4892         }
 4893         OUTPUT:
 4894         AnyId
 4895         RETVAL
 4896 
 4897 CDFstatus
 4898 CDFdocX(AnyId, version, release, AnyString)
 4899         CDFid   AnyId
 4900     long    version = NO_INIT
 4901     long    release = NO_INIT
 4902         char *  AnyString = NO_INIT
 4903         CODE:
 4904         {
 4905       char temp[CDF_COPYRIGHT_LEN+1];
 4906       AnyString = temp;
 4907           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 4908               GET_, CDF_VERSION_, &version,
 4909                 CDF_RELEASE_, &release,
 4910                 CDF_COPYRIGHT_, AnyString,
 4911                           NULL_);
 4912         }
 4913         OUTPUT:
 4914         version
 4915     release
 4916     AnyString
 4917         RETVAL
 4918 
 4919 CDFstatus
 4920 CDFinquireX(AnyId, numDims, dimSizesRef, encoding, majority, maxRec, numVars, numAttrs)
 4921         CDFid   AnyId
 4922         long    numDims = NO_INIT
 4923         AV *    dimSizesRef = NO_INIT
 4924         long    encoding = NO_INIT
 4925         long    majority = NO_INIT
 4926         long    maxRec = NO_INIT
 4927         long    numVars = NO_INIT
 4928         long    numAttrs = NO_INIT
 4929         CODE:
 4930         {
 4931           long LongArray[CDF_MAX_DIMS];
 4932           I32 i;
 4933           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 4934                           GET_, rVARs_NUMDIMS_, &numDims,
 4935                 rVARs_DIMSIZES_, LongArray,
 4936                 CDF_ENCODING_, &encoding,
 4937                                 CDF_MAJORITY_, &majority,
 4938                                 rVARs_MAXREC_, &maxRec,
 4939                 CDF_NUMrVARS_, &numVars,
 4940                 CDF_NUMATTRS_, &numAttrs,
 4941                           NULL_);
 4942           dimSizesRef = (AV *)SvRV(ST(2));
 4943           av_clear(dimSizesRef);
 4944           if (numDims == 0)
 4945                 av_push(dimSizesRef, newSViv((IV)0));
 4946           else {
 4947                   for ( i=0 ; i<numDims ; i++)
 4948                         av_push(dimSizesRef, newSViv((IV)LongArray[i]));
 4949           }
 4950         }
 4951         OUTPUT:
 4952     numDims
 4953     dimSizesRef 
 4954     encoding 
 4955     majority 
 4956     maxRec 
 4957     numVars 
 4958     numAttrs
 4959         RETVAL
 4960 
 4961 CDFstatus
 4962 CDFcloseX(AnyId)
 4963         CDFid   AnyId
 4964         CODE:
 4965         {
 4966           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 4967                           CLOSE_, CDF_,
 4968                           NULL_);
 4969         }
 4970         OUTPUT:
 4971         RETVAL
 4972 
 4973 CDFstatus
 4974 CDFdeleteX(AnyId)
 4975         CDFid   AnyId
 4976         CODE:
 4977         {
 4978           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 4979                           DELETE_, CDF_,
 4980                           NULL_);
 4981         }
 4982         OUTPUT:
 4983         RETVAL
 4984 
 4985 CDFstatus
 4986 CDFerrorX(stat, AnyString)
 4987         CDFstatus   stat
 4988     char *  AnyString = NO_INIT
 4989         CODE:
 4990         {
 4991           char temp[CDF_STATUSTEXT_LEN+1];
 4992           AnyString = temp;
 4993           RETVAL = CDFlib(SELECT_, CDF_STATUS_, stat,
 4994                           GET_, STATUS_TEXT_, AnyString,
 4995                           NULL_);
 4996         }
 4997         OUTPUT:
 4998     AnyString
 4999         RETVAL
 5000 
 5001 CDFstatus
 5002 CDFattrCreateX(AnyId, AnyString, attrScope, attrNum)
 5003         CDFid   AnyId
 5004         char *  AnyString 
 5005     long    attrScope
 5006     long    attrNum = NO_INIT
 5007         CODE:
 5008         {
 5009           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5010                           CREATE_, ATTR_, AnyString, attrScope, &attrNum,
 5011                           NULL_);
 5012         }
 5013         OUTPUT:
 5014     attrNum
 5015         RETVAL
 5016 
 5017 long
 5018 CDFattrNumX(AnyId, AnyString)
 5019         CDFid   AnyId
 5020         char *  AnyString
 5021         CODE:
 5022         {
 5023       long  attrNum;
 5024           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5025                           GET_, ATTR_NUMBER_, AnyString, &attrNum, 
 5026                           NULL_);
 5027       if (RETVAL == CDF_OK) RETVAL = attrNum;
 5028         }
 5029         OUTPUT:
 5030         RETVAL
 5031 
 5032 CDFstatus
 5033 CDFattrRenameX(AnyId, attrNum, AnyString)
 5034         CDFid   AnyId
 5035     long    attrNum
 5036         char *  AnyString
 5037         CODE:
 5038         {
 5039           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5040                    ATTR_, attrNum,
 5041                           PUT_, ATTR_NAME_, AnyString, 
 5042                           NULL_);
 5043         }
 5044         OUTPUT:
 5045         RETVAL
 5046 
 5047 CDFstatus
 5048 CDFattrInquireX(AnyId, attrNum, AnyString, attrScope, maxEntry)
 5049         CDFid   AnyId
 5050         long    attrNum
 5051         char *  AnyString = NO_INIT
 5052     long    attrScope = NO_INIT
 5053     long    maxEntry = NO_INIT
 5054         CODE:
 5055         {
 5056       char temp[CDF_ATTR_NAME_LEN +1];
 5057       AnyString = temp;
 5058           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5059                                    ATTR_, attrNum,
 5060               GET_, ATTR_SCOPE_, &attrScope,
 5061               GET_, ATTR_NAME_, AnyString,
 5062               NULL_);
 5063       if (attrScope == GLOBAL_SCOPE) 
 5064         RETVAL = CDFlib(GET_, ATTR_MAXgENTRY_, &maxEntry,
 5065                 NULL_);
 5066       else
 5067                 RETVAL = CDFlib(GET_, ATTR_MAXrENTRY_, &maxEntry,
 5068                                 NULL_);
 5069         }
 5070         OUTPUT:
 5071     AnyString
 5072     attrScope
 5073     maxEntry
 5074         RETVAL
 5075 
 5076 CDFstatus
 5077 CDFattrEntryInquireX(AnyId, attrNum, entryNum, dataType, numElements)
 5078         CDFid   AnyId
 5079         long    attrNum
 5080         long    entryNum
 5081         long    dataType = NO_INIT
 5082         long    numElements = NO_INIT
 5083         CODE:
 5084         {
 5085       long attrScope;
 5086           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5087                                    ATTR_, attrNum,
 5088                           GET_, ATTR_SCOPE_, &attrScope,
 5089                           NULL_);
 5090           if (attrScope == GLOBAL_SCOPE)
 5091                 RETVAL = CDFlib(SELECT_, gENTRY_, entryNum,
 5092                 GET_, gENTRY_DATATYPE_, &dataType,
 5093                       gENTRY_NUMELEMS_, &numElements, 
 5094                                 NULL_);
 5095           else
 5096                 RETVAL = CDFlib(SELECT_, rENTRY_, entryNum,
 5097                                 GET_, rENTRY_DATATYPE_, &dataType,
 5098                                       rENTRY_NUMELEMS_, &numElements,
 5099                                 NULL_);
 5100         }
 5101         OUTPUT:
 5102         dataType
 5103         numElements
 5104         RETVAL
 5105 
 5106 CDFstatus
 5107 CDFattrPutX(AnyId, attrNum, entryNum, DataType, numElems, DataRef)
 5108         CDFid   AnyId
 5109         long    attrNum
 5110         long    entryNum
 5111         long    DataType
 5112         long    numElems 
 5113     SV *    DataRef = NO_INIT
 5114         CODE:
 5115         {
 5116           long attrScope, item;
 5117       I32 j;
 5118       DataRef = (SV *) SvRV(ST(5));
 5119           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5120                                    ATTR_, attrNum,
 5121                           GET_, ATTR_SCOPE_, &attrScope,
 5122                           NULL_);
 5123           if (attrScope == GLOBAL_SCOPE) {
 5124                 RETVAL = CDFlib(SELECT_, gENTRY_, entryNum,
 5125                                 NULL_);
 5126         item = gENTRY_DATA_;
 5127       }
 5128           else {
 5129                 RETVAL = CDFlib(SELECT_, rENTRY_, entryNum,
 5130                                 NULL_);
 5131         item = rENTRY_DATA_;
 5132       }
 5133           switch (DataType) {
 5134             case CDF_UCHAR:
 5135             case CDF_CHAR:  {
 5136                 char *  buffer;
 5137         STRLEN len;
 5138                 New(42, buffer, numElems+1, char);
 5139                 strncpy(buffer, SvPV(DataRef, len), numElems);
 5140                 *(buffer+numElems) = '\0';
 5141                 if ((int) strlen(buffer) < (int) numElems) {
 5142                   for (j=(int)strlen(buffer); j<(int)numElems; j++)
 5143                     buffer[j] = '\0';
 5144                 }
 5145                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5146                 Safefree(buffer);
 5147                 break;
 5148             }
 5149 /*
 5150             case CDF_UCHAR:  {
 5151                 void * buffer;
 5152         STRLEN len;
 5153                 New(42, buffer, numElems+1, unsigned char);
 5154                 strncpy((char *)buffer, SvPV(DataRef, len), numElems);
 5155                 if ((int) strlen((char *)buffer) < (int) numElems) {
 5156                   for (j=(int)strlen((char *)buffer); j<(int)numElems; j++) 
 5157             *(((char *)buffer)+j) = '\0';
 5158                   *(((char *)buffer)+numElems) = '\0';
 5159                 }
 5160                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5161                 Safefree(buffer);
 5162                 break;
 5163             }
 5164 */
 5165             case CDF_BYTE:
 5166             case CDF_INT1:  {
 5167                 I8    buffer;
 5168                 buffer = (I8) SvIV(DataRef);
 5169                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5170                 break;
 5171             }
 5172             case CDF_UINT1: {
 5173                 U8    buffer;
 5174                 buffer = (U8) SvIV(DataRef);
 5175                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5176                 break;
 5177             }
 5178             case CDF_EPOCH:
 5179             case CDF_DOUBLE:
 5180             case CDF_REAL8: {
 5181                 double buffer;
 5182                 buffer = (double) SvNV(DataRef);
 5183                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5184                 break;
 5185             }
 5186 /*
 5187             case CDF_EPOCH16: {
 5188                 double buffer[2];
 5189                 buffer[0] = (double) SvNV(*(av_fetch(DataRef, 0, 0)));
 5190                 buffer[1] = (double) SvNV(*(av_fetch(DataRef, 1, 0)));
 5191                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5192                 break;
 5193             }
 5194 */
 5195             case CDF_REAL4:
 5196             case CDF_FLOAT: {
 5197                 float buffer;
 5198                 buffer = (float) SvNV(DataRef);
 5199                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5200                 break;
 5201             }
 5202             case CDF_INT4: {
 5203                 I32 buffer;
 5204                 buffer = (I32) SvIV(DataRef);
 5205                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5206                 break;
 5207             }
 5208             case CDF_INT8:
 5209             case CDF_TIME_TT2000: {
 5210                 long long buffer;
 5211                 if (SvIOK(DataRef)) {
 5212                   buffer = (long long) SvIV(DataRef);
 5213                 } else if (SvNOK(DataRef)) {
 5214                   buffer = (long long) SvNV(DataRef);
 5215                 } else {
 5216                   sscanf(SvPV_nolen(DataRef),"%lld",&buffer);
 5217                 }
 5218                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5219                 break;
 5220             }
 5221             case CDF_UINT4: {
 5222                 U32 buffer;
 5223                 buffer = (U32) SvIV(DataRef);
 5224                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5225                 break;
 5226             }
 5227             case CDF_INT2: {
 5228                 I16 buffer;
 5229                 buffer = (I16) SvIV(DataRef);
 5230                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5231                 break;
 5232             }
 5233             case CDF_UINT2: {
 5234                 U16 buffer;
 5235                 buffer = (U16) SvIV(DataRef);
 5236                 RETVAL = CDFlib(PUT_, item, DataType, numElems, &buffer, NULL_);
 5237                 break;
 5238             }
 5239             default:        {
 5240                 printf ("AttrPut Data: Bad Datatype = %ld \n", DataType);
 5241             }
 5242           }
 5243         }
 5244         OUTPUT:
 5245         RETVAL
 5246 
 5247 CDFstatus
 5248 CDFattrPutXA(AnyId, attrNum, entryNum, DataType, numElems, DataRef)
 5249         CDFid   AnyId
 5250         long    attrNum
 5251         long    entryNum
 5252         long    DataType
 5253         long    numElems 
 5254     AV *    DataRef
 5255         CODE:
 5256         {
 5257           long attrScope, item;
 5258       I32 i, count;
 5259       DataRef = (AV *) SvRV(ST(5));
 5260       count = (int) av_len(DataRef);
 5261           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5262                                    ATTR_, attrNum,
 5263                           GET_, ATTR_SCOPE_, &attrScope,
 5264                           NULL_);
 5265           if (attrScope == GLOBAL_SCOPE) {
 5266                 RETVAL = CDFlib(SELECT_, gENTRY_, entryNum,
 5267                                 NULL_);
 5268         item = gENTRY_DATA_;
 5269       }
 5270           else {
 5271                 RETVAL = CDFlib(SELECT_, rENTRY_, entryNum,
 5272                                 NULL_);
 5273         item = rENTRY_DATA_;
 5274       }
 5275           switch (DataType) {
 5276             case CDF_CHAR:  
 5277         case CDF_UCHAR: {
 5278                 break;
 5279             }
 5280             case CDF_BYTE:
 5281             case CDF_INT1:  {
 5282                 I8 *    buffer;
 5283                 New(42, buffer, count+1, I8);
 5284                 for (i=0 ; i<=count ; i++)
 5285                   buffer[i] = (I8)SvIV(*(av_fetch(DataRef, i, 0)));
 5286                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5287                 Safefree(buffer);
 5288                 break;
 5289             }
 5290             case CDF_UINT1: {
 5291                 U8 *    buffer;
 5292                 New(42, buffer, count+1, U8);
 5293                 for (i=0 ; i<=count ; i++)
 5294                   buffer[i] = (U8)SvIV(*(av_fetch(DataRef, i, 0)));
 5295                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5296                 Safefree(buffer);
 5297                 break;
 5298             }
 5299             case CDF_EPOCH:
 5300             case CDF_DOUBLE:
 5301             case CDF_REAL8: {
 5302                 double * buffer;
 5303                 New(42, buffer, count+1, double);
 5304                 for (i=0 ; i<=count ; i++)
 5305                   buffer[i] = (double)SvNV(*(av_fetch(DataRef, i, 0)));
 5306                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5307                 Safefree(buffer);
 5308                 break;
 5309             }
 5310             case CDF_EPOCH16: {
 5311                 double * buffer;
 5312                 New(42, buffer, 2*(count+1), double);
 5313                 for (i=0 ; i<2*(count+1) ; i++)
 5314                   buffer[i] = (double)SvNV(*(av_fetch(DataRef, i, 0)));
 5315                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5316                 Safefree(buffer);
 5317                 break;
 5318             }
 5319             case CDF_REAL4:
 5320             case CDF_FLOAT: {
 5321                 float * buffer;
 5322                 New(42, buffer, count+1, float);
 5323                 for (i=0 ; i<=count ; i++)
 5324                   buffer[i] = (float)SvNV(*(av_fetch(DataRef, i, 0)));
 5325                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5326                 Safefree(buffer);
 5327                 break;
 5328             }
 5329             case CDF_INT4: {
 5330                 I32 * buffer;
 5331                 New(42, buffer, count+1, I32);
 5332                 for (i=0 ; i<=count ; i++)
 5333                   buffer[i] = (I32)SvIV(*(av_fetch(DataRef, i, 0)));
 5334                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5335                 Safefree(buffer);
 5336                 break;
 5337             }
 5338             case CDF_INT8:
 5339             case CDF_TIME_TT2000: {
 5340                 double * buffer;
 5341                 SV **value;
 5342                 long long tmp;
 5343                 New(42, buffer, count+1, double);
 5344                 for (i=0 ; i <= count; i++) {
 5345                   value = av_fetch(DataRef, i, 0);
 5346                   if (SvIOK(*value)) {
 5347                     tmp = (long long) SvIV(*value);
 5348                   } else if (SvNOK(*value)) {
 5349                     tmp = (long long) SvNV(*value);
 5350                   } else {
 5351                     sscanf(SvPV_nolen(*value),"%lld",&tmp);
 5352                   }
 5353                   memcpy (buffer+i, &tmp, 8);
 5354                 }
 5355                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5356                 Safefree(buffer);
 5357                 break;
 5358             }
 5359             case CDF_UINT4: {
 5360                 U32 * buffer;
 5361                 New(42, buffer, count+1, U32);
 5362                 for (i=0 ; i<=count ; i++)
 5363                   buffer[i] = (U32)SvIV(*(av_fetch(DataRef, i, 0)));
 5364                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5365                 Safefree(buffer);
 5366                 break;
 5367             }
 5368             case CDF_INT2: {
 5369                 I16 * buffer;
 5370                 New(42, buffer, count+1, I16);
 5371                 for (i=0 ; i<=count ; i++)
 5372                   buffer[i] = (I16)SvIV(*(av_fetch(DataRef, i, 0)));
 5373                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5374                 Safefree(buffer);
 5375                 break;
 5376             }
 5377             case CDF_UINT2: {
 5378                 U16 * buffer;
 5379                 New(42, buffer, count+1, U16);
 5380                 for (i=0 ; i<=count ; i++)
 5381                   buffer[i] = (U16)SvIV(*(av_fetch(DataRef, i, 0)));
 5382                 RETVAL = CDFlib(PUT_, item, DataType, numElems, buffer, NULL_);
 5383                 Safefree(buffer);
 5384                 break;
 5385             }
 5386             default:        {
 5387                 printf ("AttrPut Data: Bad Datatype = %ld \n", DataType);
 5388             }
 5389           }
 5390         }
 5391         OUTPUT:
 5392         RETVAL
 5393 
 5394 CDFstatus
 5395 CDFattrGetX(AnyId, attrNum, entryNum, DataRef)
 5396         CDFid   AnyId
 5397         long    attrNum
 5398         long    entryNum
 5399     SV *    DataRef = NO_INIT
 5400         CODE:
 5401         {
 5402           long attrScope, item, DataType, numElems;
 5403       DataRef = (SV *) SvRV(ST(3));
 5404           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5405                                    ATTR_, attrNum,
 5406                           GET_, ATTR_SCOPE_, &attrScope,
 5407                           NULL_);
 5408           if (attrScope == GLOBAL_SCOPE) {
 5409                 RETVAL = CDFlib(SELECT_, gENTRY_, entryNum,
 5410                 GET_, gENTRY_DATATYPE_, &DataType,
 5411                                       gENTRY_NUMELEMS_, &numElems,
 5412                                 NULL_);
 5413         item = gENTRY_DATA_;
 5414       }
 5415           else {
 5416                 RETVAL = CDFlib(SELECT_, rENTRY_, entryNum,
 5417                                 GET_, rENTRY_DATATYPE_, &DataType,
 5418                                       rENTRY_NUMELEMS_, &numElems,
 5419                                 NULL_);
 5420         item = rENTRY_DATA_;
 5421       }
 5422           switch (DataType) {
 5423             case CDF_UCHAR:
 5424             case CDF_CHAR:  {
 5425                 char *  buffer;
 5426                 int x, iend;
 5427                 New(42, buffer, numElems+1, char);
 5428                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5429                 *(buffer+numElems) = '\0';
 5430                 iend = numElems;
 5431                 for (x = 0; x < numElems; ++x) {
 5432                   if (*(buffer+x) == '\0') {
 5433                     iend = x;
 5434                     break;
 5435                   }
 5436                 }
 5437                 sv_setpvn(DataRef, buffer, iend); 
 5438                 Safefree(buffer);
 5439                 break;
 5440             }
 5441 /*
 5442             case CDF_UCHAR:  {
 5443                 void * buffer;
 5444                 New(42, buffer, numElems+1, unsigned char);
 5445                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5446                 sv_setpvn(DataRef, buffer, numElems); 
 5447                 Safefree(buffer);
 5448                 break;
 5449             }
 5450 */
 5451             case CDF_BYTE:
 5452             case CDF_INT1:  {
 5453                 I8    buffer;
 5454                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5455                 sv_setiv(DataRef, (IV) buffer); 
 5456                 break;
 5457             }
 5458             case CDF_UINT1: {
 5459                 U8    buffer;
 5460                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5461                 sv_setiv(DataRef, (IV) buffer); 
 5462                 break;
 5463             }
 5464             case CDF_EPOCH:
 5465             case CDF_DOUBLE:
 5466             case CDF_REAL8: {
 5467                 double buffer;
 5468                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5469                 sv_setnv(DataRef, (double) buffer); 
 5470                 break;
 5471             }
 5472 /*
 5473             case CDF_EPOCH16: {
 5474                 double buffer[2];
 5475                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5476                 for (i=0 ; i < 2; i++)
 5477                   av_push(DataRef, newSVnv((double)buffer[i]));
 5478                 break;
 5479             }
 5480 */
 5481             case CDF_REAL4:
 5482             case CDF_FLOAT: {
 5483                 float buffer;
 5484                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5485                 sv_setnv(DataRef, (double) buffer); 
 5486                 break;
 5487             }
 5488             case CDF_INT4: {
 5489                 I32 buffer;
 5490                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5491                 sv_setiv(DataRef, (IV) buffer); 
 5492                 break;
 5493             }
 5494             case CDF_INT8:
 5495             case CDF_TIME_TT2000: {
 5496                 long long buffer;
 5497                 char tmp[25];
 5498                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5499                 snprintf(tmp, 24, "%lld", buffer);
 5500                 sv_setpvn(DataRef, tmp, strlen(tmp)); 
 5501                 break;
 5502             }
 5503             case CDF_UINT4: {
 5504                 U32 buffer;
 5505                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5506                 sv_setiv(DataRef, (IV) buffer); 
 5507                 break;
 5508             }
 5509             case CDF_INT2: {
 5510                 I16 buffer;
 5511                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5512                 sv_setiv(DataRef, (IV) buffer); 
 5513                 break;
 5514             }
 5515             case CDF_UINT2: {
 5516                 U16 buffer;
 5517                 RETVAL = CDFlib(GET_, item, &buffer, NULL_);
 5518                 sv_setiv(DataRef, (IV) buffer); 
 5519                 break;
 5520             }
 5521             default:        {
 5522                 printf ("AttrGet Data: Bad Datatype = %ld \n", DataType);
 5523             }
 5524           }
 5525         }
 5526         OUTPUT:
 5527     DataRef
 5528         RETVAL
 5529 
 5530 CDFstatus
 5531 CDFattrGetXA(AnyId, attrNum, entryNum, DataRef)
 5532         CDFid   AnyId
 5533         long    attrNum
 5534         long    entryNum
 5535     AV *    DataRef = NO_INIT
 5536         CODE:
 5537         {
 5538           long attrScope, item, DataType, numElems, i;
 5539       DataRef = (AV *) SvRV(ST(3));
 5540           RETVAL = CDFlib(SELECT_, CDF_, AnyId,
 5541                                    ATTR_, attrNum,
 5542                           GET_, ATTR_SCOPE_, &attrScope,
 5543                           NULL_);
 5544           if (attrScope == GLOBAL_SCOPE) {
 5545                 RETVAL = CDFlib(SELECT_, gENTRY_, entryNum,
 5546                 GET_, gENTRY_DATATYPE_, &DataType,
 5547                                       gENTRY_NUMELEMS_, &numElems,
 5548                                 NULL_);
 5549         item = gENTRY_DATA_;
 5550       }
 5551           else {
 5552                 RETVAL = CDFlib(SELECT_, rENTRY_, entryNum,
 5553                                 GET_, rENTRY_DATATYPE_, &DataType,
 5554                                       rENTRY_NUMELEMS_, &numElems,
 5555                                 NULL_);
 5556         item = rENTRY_DATA_;
 5557       }
 5558           switch (DataType) {
 5559             case CDF_UCHAR:
 5560             case CDF_CHAR:  {
 5561                 char *  buffer;
 5562                 int x, iend;
 5563                 New(42, buffer, numElems+1, char);
 5564                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5565                 *(buffer+numElems) = '\0';
 5566                 iend = numElems;
 5567                 for (x = 0; x < numElems; ++x) {
 5568                   if (*(buffer+x) == '\0') {
 5569                     iend = x;
 5570                     break;
 5571                   }
 5572                 }
 5573                 av_push(DataRef, newSVpv((char*)buffer, iend));
 5574                 Safefree(buffer);
 5575                 break;
 5576             }
 5577 /*
 5578             case CDF_UCHAR:  {
 5579                 void * buffer;
 5580                 New(42, buffer, numElems+1, unsigned char);
 5581                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5582                 av_push(DataRef, newSVpv((char*)buffer, numElems));
 5583                 Safefree(buffer);
 5584                 break;
 5585             }
 5586 */
 5587             case CDF_BYTE:
 5588             case CDF_INT1:  {
 5589                 I8 *    buffer;
 5590                 New(42, buffer, numElems, I8);
 5591                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5592                 for (i=0 ; i < (int) numElems; i++)
 5593                   av_push(DataRef, newSViv((I8)buffer[i]));
 5594                 Safefree(buffer);
 5595                 break;
 5596             }
 5597             case CDF_UINT1: {
 5598                 U8 *    buffer;
 5599                 New(42, buffer, numElems, U8);
 5600                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5601                 for (i=0 ; i < (int) numElems; i++)
 5602                   av_push(DataRef, newSViv((U8)buffer[i]));
 5603                 Safefree(buffer);
 5604                 break;
 5605             }
 5606             case CDF_EPOCH:
 5607             case CDF_DOUBLE:
 5608             case CDF_REAL8: {
 5609                 double * buffer;
 5610                 New(42, buffer, numElems, double);
 5611                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5612                 for (i=0 ; i < (int) numElems; i++)
 5613                   av_push(DataRef, newSVnv((double)buffer[i]));
 5614                 Safefree(buffer);
 5615                 break;
 5616             }
 5617             case CDF_EPOCH16: {
 5618                 double * buffer;
 5619                 New(42, buffer, 2*numElems, double);
 5620                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5621                 for (i=0 ; i < 2*numElems; i++)
 5622                   av_push(DataRef, newSVnv((double)buffer[i]));
 5623                 Safefree(buffer);
 5624                 break;
 5625             }
 5626             case CDF_REAL4:
 5627             case CDF_FLOAT: {
 5628                 float * buffer;
 5629                 New(42, buffer, numElems, float);
 5630                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5631                 for (i=0 ; i < (int) numElems; i++)
 5632                   av_push(DataRef, newSVnv((float)buffer[i]));
 5633                 Safefree(buffer);
 5634                 break;
 5635             }
 5636             case CDF_INT4: {
 5637                 I32 * buffer;
 5638                 New(42, buffer, numElems, I32);
 5639                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5640                 for (i=0 ; i < (int) numElems; i++)
 5641                   av_push(DataRef, newSViv((I32)buffer[i]));
 5642                 Safefree(buffer);
 5643                 break;
 5644             }
 5645             case CDF_INT8:
 5646             case CDF_TIME_TT2000: {
 5647                 double * buffer;
 5648                 long long tmp;
 5649                 char str[25];
 5650                 New(42, buffer, numElems, double);
 5651                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5652                 for (i=0 ; i < (int) numElems; i++) {
 5653                   memcpy (&tmp, buffer+i, 8);
 5654                   snprintf(str, 24, "%lld", tmp); 
 5655                   av_push(DataRef, newSVpvn(str, strlen(str)));
 5656                 }
 5657                 Safefree(buffer);
 5658                 break;
 5659             }
 5660             case CDF_UINT4: {
 5661                 U32 * buffer;
 5662                 New(42, buffer, numElems, U32);
 5663                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5664                 for (i=0 ; i < (int) numElems; i++)
 5665                   av_push(DataRef, newSViv((U32)buffer[i]));
 5666                 Safefree(buffer);
 5667                 break;
 5668             }
 5669             case CDF_INT2: {
 5670                 I16 * buffer;
 5671                 New(42, buffer, numElems, I16);
 5672                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5673                 for (i=0 ; i < (int) numElems; i++)
 5674                   av_push(DataRef, newSViv((I16)buffer[i]));
 5675                 Safefree(buffer);
 5676                 break;
 5677             }
 5678             case CDF_UINT2: {
 5679                 U16 * buffer;
 5680                 New(42, buffer, numElems, U16);
 5681                 RETVAL = CDFlib(GET_, item, buffer, NULL_);
 5682                 for (i=0 ; i < (int) numElems; i++)
 5683                   av_push(DataRef, newSViv((U16)buffer[i]));
 5684                 Safefree(buffer);
 5685                 break;
 5686             }
 5687             default:        {
 5688                 printf ("AttrGet Data: Bad Datatype = %ld \n", DataType);
 5689             }
 5690           }
 5691         }
 5692         OUTPUT:
 5693     DataRef
 5694         RETVAL
 5695 
 5696 CDFstatus
 5697 CDFvarCreateX(AnyId, AnyString, dataType, numElements, recVary, dimVaryRef, varNum)
 5698         CDFid   AnyId
 5699         char *  AnyString
 5700         long    dataType 
 5701         long    numElements 
 5702     long    recVary
 5703     AV *    dimVaryRef
 5704     long    varNum