EdmiError rstat;
SdaiInteger nErr, nWrn;
SdaiInstance xpxMethodId;
SdaiString parNamesXpx[4] = {"Name", "Sex", "Weight", NULL};
SdaiPrimitiveType parTypesXpx[3] = {sdaiSTRING, sdaiINTEGER, sdaiREAL};
SdaiString type, name, schema, class, desc, *argNames;
SdaiPrimitiveType returnType, *argTypes;
SdaiInteger nArg;
/* Define Schemas */
rstat = edmiDefineSchema("c:/data/person.exp",
"c:/temp/person.dia",
"Person", 0, &nWrn, &nErr);
rstat = edmiDefineSchemaMap("c:/data/person_maps.xpx",
"c:/temp/person_maps.dia",
0, &nWrn, &nErr);
/* Define Method Signatures */
/* Only applicable for "XPX" */
rstat = edmiDefineMethodSignature( "XPX", "Insert a Person",
"InsertPerson", "CLASS_INPUT",
parNamesXpx, parTypesXpx,
"Inserts a new person");
rstat = edmiGetMethodSignatureId("XPX", "Insert a Person",
"InsertPerson", &xpxMethodId);
rstat = edmiGetMethodSignature(xpxMethodId, &type, &name, &schema,
&class, &nArg, &returnType, &argNames,
&argTypes, &desc);
printf("\nMethod Id: %d", xpxMethodId);
printf("\nMethod type : %s", strcmp(type,"XPX") ?
"Express-X SchemaMap" : "Query Function");
printf("\nMethod Name : %s", name);
printf("\nSchema Name : %s", schema);
printf("\nMethod Class: %s", class ? class : "Undefined";
for (i=0; i<nArg; i++) {
printf("\nParameter %d: %s (type %d)", i, argNames[i], argTypes[i]);
}
printf("\nMethod Return Type : %d", returnType);
printf("\nMethod Description : %s", desc);
edmiFree(xpxMethodId);
edmiFree(argNames);
edmiFree(argTypes);
edmiFree(schema);
edmiFree(returnType); |