This utility is used to load text schemas into the OSR generator. It is called once for each schema that will be processed to create an Optimized Schema Representation.
There are no performance implications.
|
A pointer to an OSR generator Instance Memory Area (OIMA).
A pointer to an area where the utility stores the return code.
A pointer to an area where the utility stores the reason code. The reason code is only relevant if the return code is not XRC_SUCCESS.
All parameters in the parameter list are required.
Return Value:
The value returned by this service is return code (see below).
Return and Reason Codes:
On return from a call to this utility, register 15 will contain the return code. The return and reason code are both also set as output parameters. The value of the reason code is undefined when the return code has no associated reasons. Return and reason codes are defined in the header file gxlhxr.h (see gxlhxr.h (GXLYXR) - defines the return codes and reason codes). For reason code descriptions, also see Reason codes listed by value.
#include <stdlib.h>
#include <stdio.h>
#include <gxlhosrg.h>
#include <gxlhxec.h>
void * oima_p;
unsigned long oima_l;
char handler_parms[128];
char schema_uri[URI_LEN] = “file:///u/user01/myschema.xsd”;
int rc, rsn;
if (oima_p = malloc(GXLHXEC_MIN_OIMA_SIZE))
{ /* oima malloc succeeded */
oima_l = GXLHXEC_MIN_OIMA_SIZE;
gxluInitOSRG(oima_p, oima_l,
0,
(void *)handler_parms,
&rc, &rsn);
} /* oima malloc succeeded */
/* Now perform operations using the generator instance. */
if ((oima_p > 0) && (rc == GXLHXRC_SUCCESS))
{ /* generator initialized */
gxluLoadSchema(oima_p,
schema_uri,
&rc, &rsn);
if (rc == GXLHXRC_SUCCESS)
{/* schema load succeeded */
/*generate an OSR from the loaded schema*/
...
} /* schema load succeeded */
...
} /* generator initialized */
Call this service iteratively to load one or more schemas that will be processed to create an OSR. Once a schema has been loaded, the schema text buffer specified by the schema_resource_p parameter may be re-used for other purposes.