/* ** Title: Shapes ** SCCSid: %W% %E% %U% ** CCid: %W% %E% %U% ** Author: Informix Software Inc. ** Created: 06/26/1998 13:27 ** Description: This is the generated 'C' file for the Shapes DataBlade. ** Comments: Generated for project Shapes.3.6 */ /* ** The following is placed here to insure ** that name "mangling" does not occur. */ #ifdef __cplusplus extern "C" { #endif /* Standard library includes. */ #include #include #define _REENTRANT #include #undef _REENTRANT #include /* Used by Informix GLS routines. */ #include /* Include when accessing the Informix API. */ #include /* This is the project include file. */ #include "Shapes.h" #include "ShapeTypes.h" mi_lvarchar * MyShapeInput ( mi_lvarchar * Gen_param1, /* Pointer to the input text. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ); mi_lvarchar * MyShapeOutput ( mi_lvarchar * Gen_param1, /* The UDT value. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ); mi_integer MyShapeCompare ( mi_bitvarying * Gen_param1, /* The first UDT value to compare. */ mi_bitvarying * Gen_param2, /* The second UDT value to compare. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ); mi_boolean MyShapeEqual ( mi_bitvarying * Gen_param1, /* The first UDT value to compare. */ mi_bitvarying * Gen_param2, /* The second UDT value to compare. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ); mi_boolean MyShapeNotEqual ( mi_bitvarying * Gen_param1, /* The first UDT value to compare. */ mi_bitvarying * Gen_param2, /* The second UDT value to compare. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ); UDREXPORT mi_integer MyShapeOverlap ( MyShape * Argument1, MyShape * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ); UDREXPORT mi_integer MyShapeContains ( MyShape * Argument1, MyShape * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ); UDREXPORT mi_integer MyShapeWithin ( MyShape * Argument1, MyShape * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ); UDREXPORT mi_integer MyShapeUnion ( MyShape * Argument1, MyShape * Argument2, MyShape * Argument3, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ); UDREXPORT mi_integer MyShapeSize ( MyShape * Argument1, mi_double_precision * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ); UDREXPORT mi_integer MyShapeInter ( MyShape * Argument1, MyShape * Argument2, MyShape * Argument3, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ); /* {{FUNCTION(08ab3057-18e9-11d1-80b0-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxCompare ** ** Description: ** ** Perform the comparison operations required to compare two ** UDT values. ** ** This function returns zero if the two UDT values are equal and ** a non-zero value otherwise. ** ** Special Comments: ** ** Compares two variable-length opaque types ** ** Parameters: ** ** mi_bitvarying * Gen_param1; The first UDT value to compare. ** mi_bitvarying * Gen_param2; The second UDT value to compare. ** MI_FPARAM * Gen_fparam; Standard info - see DBDK docs. ** ** Return value: ** ** mi_integer The comparison result. ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** Warning: Do not remove or modify this comment: ** MyBoxCompare FunctionId: 08ab3057-18e9-11d1-80b0-0800095a455b ** ***************************************************************** */ mi_integer MyBoxCompare ( mi_bitvarying * Gen_param1, /* The first UDT value to compare. */ mi_bitvarying * Gen_param2, /* The second UDT value to compare. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ) { return MyShapeCompare( Gen_param1, Gen_param2, Gen_fparam ); } /* }}FUNCTION (#VVQN) */ /* {{FUNCTION(9a83089c-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxEqual ** ** Description: ** ** Determine if one UDT value is equal to another. ** ** Special Comments: ** ** Compares two variable-length opaque types for equality ** ** Parameters: ** ** mi_bitvarying * Gen_param1; The first UDT value to compare. ** mi_bitvarying * Gen_param2; The second UDT value to compare. ** MI_FPARAM * Gen_fparam; Standard info - see DBDK docs. ** ** Return value: ** ** mi_boolean The comparison result. ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** Warning: Do not remove or modify this comment: ** MyBoxEqual FunctionId: 9a83089c-133b-11d1-80af-0800095a455b ** ***************************************************************** */ mi_boolean MyBoxEqual ( mi_bitvarying * Gen_param1, /* The first UDT value to compare. */ mi_bitvarying * Gen_param2, /* The second UDT value to compare. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ) { /* Call Compare to perform the comparison. */ return (mi_boolean)(0 == MyShapeCompare( Gen_param1, Gen_param2, Gen_fparam )); } /* }}FUNCTION (#6OIK) */ /* {{FUNCTION(08ab3058-18e9-11d1-80b0-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxNotEqual ** ** Description: ** ** Determine if one UDT value is not equal to another. ** ** Special Comments: ** ** Compares two variable-length opaque types for non-equality ** ** Parameters: ** ** mi_bitvarying * Gen_param1; The first UDT value to compare. ** mi_bitvarying * Gen_param2; The second UDT value to compare. ** MI_FPARAM * Gen_fparam; Standard info - see DBDK docs. ** ** Return value: ** ** mi_boolean The comparison result. ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** Warning: Do not remove or modify this comment: ** MyBoxNotEqual FunctionId: 08ab3058-18e9-11d1-80b0-0800095a455b ** ***************************************************************** */ mi_boolean MyBoxNotEqual ( mi_bitvarying * Gen_param1, /* The first UDT value to compare. */ mi_bitvarying * Gen_param2, /* The second UDT value to compare. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ) { /* Call Compare to perform the comparison. */ return (mi_boolean)(0 != MyShapeCompare( Gen_param1, Gen_param2, Gen_fparam )); } /* }}FUNCTION (#GTQO) */ /* {{FUNCTION(9a8308a2-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxOverlap ** ** Description: ** ** Special Comments: ** ** Entrypoint for the SQL routine Overlap (MyBox,MyBox) returns boolean. ** ** Parameters: ** ** Return value: ** ** mi_integer ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** NOTE: ** ** BladeSmith will add and remove parameters from the function ** prototype, and will generate tracing calls. ONLY EDIT code ** in blocks marked Your_
. Any other modifications ** will require manual merging. ** ***************************************************************** */ UDREXPORT mi_integer MyBoxOverlap ( MyBox * Argument1, MyBox * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ) { MI_CONNECTION * Gen_Con; /* The connection handle. */ mi_integer Gen_RetVal; /* The return value. */ /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */ /* ------ }}Your_Declarations (#0000) END ------ */ /* Use the NULL connection. */ Gen_Con = NULL; /* ------ {{Your_Code (PreserveSection) BEGIN ------ */ Gen_RetVal = MyShapeOverlap( (MyShape *) Argument1, (MyShape *) Argument2 , Gen_fparam ); /* ------ }}Your_Code (#CAD2) END ------ */ /* Return the function's return value. */ return Gen_RetVal; } /* }}FUNCTION (#13PL) */ /* {{FUNCTION(9a83089d-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxContains ** ** Description: ** ** Special Comments: ** ** Entrypoint for the SQL routine Contains (MyBox,MyBox) returns boolean. ** ** Parameters: ** ** Return value: ** ** mi_integer ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** NOTE: ** ** BladeSmith will add and remove parameters from the function ** prototype, and will generate tracing calls. ONLY EDIT code ** in blocks marked Your_
. Any other modifications ** will require manual merging. ** ***************************************************************** */ UDREXPORT mi_integer MyBoxContains ( MyBox * Argument1, MyBox * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ) { MI_CONNECTION * Gen_Con; /* The connection handle. */ mi_integer Gen_RetVal; /* The return value. */ /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */ /* ------ }}Your_Declarations (#0000) END ------ */ /* Use the NULL connection. */ Gen_Con = NULL; /* ------ {{Your_Code (PreserveSection) BEGIN ------ */ Gen_RetVal = MyShapeContains( (MyShape *) Argument1, (MyShape *)Argument2 , Gen_fparam ); /* ------ }}Your_Code (#BD8C) END ------ */ /* Return the function's return value. */ return Gen_RetVal; } /* }}FUNCTION (#JPHE) */ /* {{FUNCTION(9a83089e-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxWithin ** ** Description: ** ** Special Comments: ** ** Entrypoint for the SQL routine Within (MyBox,MyBox) returns boolean. ** ** Parameters: ** ** Return value: ** ** mi_integer ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** NOTE: ** ** BladeSmith will add and remove parameters from the function ** prototype, and will generate tracing calls. ONLY EDIT code ** in blocks marked Your_
. Any other modifications ** will require manual merging. ** ***************************************************************** */ UDREXPORT mi_integer MyBoxWithin ( MyBox * Argument1, MyBox * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ) { MI_CONNECTION * Gen_Con; /* The connection handle. */ mi_integer Gen_RetVal; /* The return value. */ /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */ /* ------ }}Your_Declarations (#0000) END ------ */ /* Use the NULL connection. */ Gen_Con = NULL; /* ------ {{Your_Code (PreserveSection) BEGIN ------ */ Gen_RetVal = MyShapeWithin( (MyShape *) Argument1, (MyShape *) Argument2 , Gen_fparam ); /* ------ }}Your_Code (#0L2V) END ------ */ /* Return the function's return value. */ return Gen_RetVal; } /* }}FUNCTION (#4BOM) */ /* {{FUNCTION(9a83089f-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxUnion ** ** Description: ** ** Special Comments: ** ** Entrypoint for the SQL routine Union (MyBox,MyBox,MyBox) returns integer. ** ** Parameters: ** ** Return value: ** ** mi_integer ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** NOTE: ** ** BladeSmith will add and remove parameters from the function ** prototype, and will generate tracing calls. ONLY EDIT code ** in blocks marked Your_
. Any other modifications ** will require manual merging. ** ***************************************************************** */ UDREXPORT mi_integer MyBoxUnion ( MyBox * Argument1, MyBox * Argument2, MyBox * Argument3, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ) { MI_CONNECTION * Gen_Con; /* The connection handle. */ mi_integer Gen_RetVal; /* The return value. */ /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */ /* ------ }}Your_Declarations (#0000) END ------ */ /* Use the NULL connection. */ Gen_Con = NULL; /* ------ {{Your_Code (PreserveSection) BEGIN ------ */ Gen_RetVal = MyShapeUnion( (MyShape *) Argument1,(MyShape *) Argument2, (MyShape *)Argument3, Gen_fparam ); /* ------ }}Your_Code (#NJLJ) END ------ */ /* Return the function's return value. */ return Gen_RetVal; } /* }}FUNCTION (#RKLM) */ /* {{FUNCTION(9a8308a0-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxSize ** ** Description: ** ** Special Comments: ** ** Entrypoint for the SQL routine Size (MyBox,double precision) returns integer. ** ** Parameters: ** ** Return value: ** ** mi_integer ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** NOTE: ** ** BladeSmith will add and remove parameters from the function ** prototype, and will generate tracing calls. ONLY EDIT code ** in blocks marked Your_
. Any other modifications ** will require manual merging. ** ***************************************************************** */ UDREXPORT mi_integer MyBoxSize ( MyBox * Argument1, mi_double_precision * Argument2, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ) { MI_CONNECTION * Gen_Con; /* The connection handle. */ mi_integer Gen_RetVal; /* The return value. */ /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */ /* ------ }}Your_Declarations (#0000) END ------ */ /* Use the NULL connection. */ Gen_Con = NULL; /* ------ {{Your_Code (PreserveSection) BEGIN ------ */ Gen_RetVal = MyShapeSize( (MyShape *) Argument1, (mi_double_precision *) Argument2 , Gen_fparam ); /* ------ }}Your_Code (#ED32) END ------ */ /* Return the function's return value. */ return Gen_RetVal; } /* }}FUNCTION (#1DN6) */ /* {{FUNCTION(9a8308a1-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxInter ** ** Description: ** ** Special Comments: ** ** Entrypoint for the SQL routine Inter (MyBox,MyBox,MyBox) returns integer. ** ** Parameters: ** ** Return value: ** ** mi_integer ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** NOTE: ** ** BladeSmith will add and remove parameters from the function ** prototype, and will generate tracing calls. ONLY EDIT code ** in blocks marked Your_
. Any other modifications ** will require manual merging. ** ***************************************************************** */ UDREXPORT mi_integer MyBoxInter ( MyBox * Argument1, MyBox * Argument2, MyBox * Argument3, MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs.*/ ) { MI_CONNECTION * Gen_Con; /* The connection handle. */ mi_integer Gen_RetVal; /* The return value. */ /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */ /* ------ }}Your_Declarations (#0000) END ------ */ /* Use the NULL connection. */ Gen_Con = NULL; /* ------ {{Your_Code (PreserveSection) BEGIN ------ */ Gen_RetVal = MyShapeInter( (MyShape *) Argument1, (MyShape *) Argument2, (MyShape *)Argument3, Gen_fparam ); /* ------ }}Your_Code (#PJLJ) END ------ */ /* Return the function's return value. */ return Gen_RetVal; } /* }}FUNCTION (#4KLN) */ /* {{FUNCTION(9a83089a-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxInput ** ** Description: ** ** This function converts from the external representation of the ** UDT type MyBox to its internal representation. The external ** representation is a blank-separated list of values and the ** internal representation is a 'C' structure of type MyBox as ** defined in the header file. ** ** ** Data can be inserted into a table using an SQL insert statement: ** ** insert into tablename values ( 'value-list' ); ** ** value-list is a space-delimited list of values. ** ** Special Comments: ** ** Support routine for opaque type MyBox returns mi_lvarchar. ** ** Parameters: ** ** mi_lvarchar * Gen_param1; Pointer to the input text. ** MI_FPARAM * Gen_fparam; Standard info - see DBDK docs. ** ** Return value: ** ** mi_lvarchar * The constructed UDT value. ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** Warning: Do not remove or modify this comment: ** MyBoxInput FunctionId: 9a83089a-133b-11d1-80af-0800095a455b ** ***************************************************************** */ mi_lvarchar * MyBoxInput ( mi_lvarchar * Gen_param1, /* Pointer to the input text. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ) { MI_CONNECTION * Gen_Con; /* The current connection. */ mi_lvarchar * Gen_RetVal; /* The return value. */ /* Get the current connection handle. */ Gen_Con = mi_open( NULL, NULL, NULL ); /* Verify that the connection has been established. */ if( Gen_Con == 0 ) { /* ** Opening the current connection has failed ** so issue the following message and quit. ** ** "Connection has failed in MyBoxInput." */ DBDK_TRACE_ERROR( "MyBoxInput", ERRORMESG1, 10 ); /* not reached */ } /* ** Write to the trace file indicating ** that MyBoxInput has been called. */ DBDK_TRACE_ENTER( "MyBoxInput" ); Gen_RetVal = MyShapeInput( Gen_param1, Gen_fparam ); /* ** Write to the trace file indicating ** that MyBoxInput has successfully exited. */ DBDK_TRACE_EXIT( "MyBoxInput" ); /* Close the connection. */ mi_close( Gen_Con ); /* Return the UDT value. */ return Gen_RetVal; } /* }}FUNCTION (#UIAK) */ /* {{FUNCTION(9a83089b-133b-11d1-80af-0800095a455b) (MergeSection) */ /**************************************************************** ** ** Function name: ** ** MyBoxOutput ** ** Description: ** ** This function converts from the internal representation of the ** UDT type MyBox to its external representation. The external ** representation is a blank-separated list of values and the ** internal representation is a 'C' structure of type MyBox as ** defined in the header file. ** ** Data can be retrieved from a table using an SQL select statement: ** ** select * from tablename; ** ** Special Comments: ** ** Support routine for opaque type MyBox returns mi_lvarchar. ** ** Parameters: ** ** mi_lvarchar * Gen_param1; Pointer to the input text. ** MI_FPARAM * Gen_fparam; Standard info - see DBDK docs. ** ** Return value: ** ** mi_lvarchar * The constructed UDT value. ** ** History: ** ** 06/26/1998 - Generated by BladeSmith Version 3.60.626 . ** ** Identification: ** ** Warning: Do not remove or modify this comment: ** MyBoxOutput FunctionId: 9a83089b-133b-11d1-80af-0800095a455b ** ***************************************************************** */ mi_lvarchar * MyBoxOutput ( mi_lvarchar * Gen_param1, /* The UDT value. */ MI_FPARAM * Gen_fparam /* Standard info - see DBDK docs. */ ) { MI_CONNECTION * Gen_Con; /* The current connection. */ mi_lvarchar * Gen_RetVal; /* The return result. */ /* Get the current connection handle. */ Gen_Con = mi_open( NULL, NULL, NULL ); /* Verify that the connection has been established. */ if( Gen_Con == 0 ) { /* ** Opening the current connection has failed ** so issue the following message and quit. ** ** "Connection has failed in MyBoxOutput." */ DBDK_TRACE_ERROR( "MyBoxOutput", ERRORMESG1, 10 ); /* not reached */ } /* ** Write to the trace file indicating ** that MyBoxOutput has been called. */ DBDK_TRACE_ENTER( "MyBoxOutput" ); Gen_RetVal = MyShapeOutput( Gen_param1, Gen_fparam ); /* ** Write to the trace file indicating ** that MyBoxOutput has successfully exited. */ DBDK_TRACE_EXIT( "MyBoxOutput" ); /* Close the connection. */ mi_close( Gen_Con ); return Gen_RetVal; } /* }}FUNCTION (#DIM4) */ #ifdef __cplusplus } #endif