Catalog.xs revision c227543f6890bd6f2054360ec1820bfef8132431
/*
*/
/*
* Catalog.xs contains XS code for exacct catalog tag manipulation. This
* consists of code to create the @_Constants array and %_Constants hash used
* for defining constants on the fly via AUTOLOAD, and utility functions for
* creaing double-typed SVs.
*/
#include "../exacct_common.xh"
/* Pull in the file generated by extract_defines. */
#include "CatalogDefs.xi"
/*
* This function populates the %_Constants hash and @_Constants array based on
* the values extracted from the exacct header files by the extract_defines
* script and written to the .xi file which is included above. It also creates
* a const sub for each constant that returns the associcated value. It should
* be called from the BOOT section of this module. The structure of the
* %_Constants hash is given below - this is used to map between the symbolic
* and numeric values of the various EX[CTD] constants. The register() method
* extends the %_Constants hash with values for the foreign catalog, so that it
* can be handled in exactly the same way as the built-in catalog.
*
* $Constants{catlg}{name}{EXC_DEFAULT} => 0
* ...
* {value}{0} => 'EXC_DEFAULT'
* ...
* *A*
* {id}{name}{EXD}{name}{EXD_CREATOR} => 3
* ...
* {value}{3} => 'EXD_CREATOR'
* ...
* {value}{0} => *A*
* ...
* {other}{name}{EXC_CATALOG_MASK} => 251658240
* ...
* {value}{251658240} => 'EXC_CATALOG_MASK'
* ...
* {type}{name}{EXT_DOUBLE} => 1342177280
* ...
* {value}{1342177280} => 'EXT_DOUBLE'
* ...
*/
#define CONST_NAME "::Catalog::_Constants"
static void
{
/* Create the two new perl variables. */
/* Create the 'type' subhash. */
type_by_name = newHV();
type_by_value = newHV();
/* Create the 'catlg' subhash. */
catlg_by_name = newHV();
catlg_by_value = newHV();
/*
* where the upper level is indexed by the catalog prefix (EXD for
* the default catalog). The lower two levels are actually the same
* hashes referenced by two parents, and hold the catalog id numeric
* values and corresponding string values.
*/
id_by_name = newHV();
id_by_value = newHV();
IdValueHash = newHV();
/* Create the 'other' subhash, for non-catalog #defines. */
other_by_name = newHV();
other_by_value = newHV();
/*
* Populate %_Constants and %_Constants from the contents of the
* generated constants array.
*/
/*
* based on consttype .
*/
case type:
break;
case catlg:
/* Special case for duplicated-value EXC_NONE tag. */
} else {
}
break;
case id:
break;
case other:
break;
}
/* Store in the appropriate name & value hashes. */
if (name_hv) {
}
if (value_hv) {
}
if (! name_hv) {
}
if (! value_hv) {
}
}
}
/*
* The XS code exported to perl is below here. Note that the XS preprocessor
* has its own commenting syntax, so all comments from this point on are in
* that form.
*
* All the following are private functions.
*/
#
#
BOOT:
init_stashes();
#
#
SV*
_double_type(i, c)
unsigned int i;
char *c;
CODE:
#
#
int
CODE:
#
#
int
CODE:
#
#
SV*
CODE:
#
#
int
CODE: