Example #1
0
void
gcd_api_term( PTR ehndl )
{
    IIAPI_TERMPARM	term;

    if( ehndl )
    {
	IIAPI_RELENVPARM	rel;

	rel.re_envHandle = ehndl;
	IIapi_releaseEnv( &rel );

	if ( rel.re_status != IIAPI_ST_SUCCESS  &&
	     GCD_global.gcd_trace_level >= 1 )
	    TRdisplay( "%4d    GCD Error releasing API environment: %d\n", 
		       -1, rel.re_status );
    }

    IIapi_terminate( &term );

    if ( term.tm_status != IIAPI_ST_SUCCESS && 
	 GCD_global.gcd_trace_level >= 1 &&
	 term.tm_status != IIAPI_ST_WARNING )
	TRdisplay( "%4d    GCD Error shutting down API: %d\n", 
		   -1, term.tm_status );

    return;
}
Example #2
0
static void
IIdemo_term()
{
    IIAPI_TERMPARM  termParm;

    printf( "IIdemo_term: shutting down API\n" );
    IIapi_terminate( &termParm );

    return;
}
Example #3
0
static void
IIdemo_term( II_PTR *envHandle )
{
    IIAPI_RELENVPARM	relEnvParm;
    IIAPI_TERMPARM	termParm;

    printf( "IIdemo_term: releasing environment resources\n" );
    relEnvParm.re_envHandle = *envHandle;
    IIapi_releaseEnv(&relEnvParm);

    printf( "IIdemo_term: shutting down API\n" );
    IIapi_terminate( &termParm );

    *envHandle = NULL;
    return;
}
Example #4
0
int
main( int argc, char** argv ) 
{
    II_PTR		envHandle = (II_PTR)NULL;
    IIAPI_INITPARM	initParm;
    IIAPI_SETENVPRMPARM	setEnvPrmParm;
    IIAPI_RELENVPARM	relEnvParm;
    IIAPI_TERMPARM	termParm;
    II_LONG		longvalue; 

    /*
    **  Initialize API at level 1 
    */
    printf( "apisinit: initializing API at level 1 \n" );
    initParm.in_version = IIAPI_VERSION_1;
    initParm.in_timeout = -1;

    IIapi_initialize( &initParm );

    /*
    **  Terminate API 
    */
    printf( "apisinit: shutting down API\n" );

    IIapi_terminate( &termParm );

    /*
    **  Initialize API at level 2.  Save environment handle.
    */
    printf( "apisinit: initializing API at level 2 \n" );
    initParm.in_version = IIAPI_VERSION_2;
    initParm.in_timeout = -1;

    IIapi_initialize( &initParm );

    envHandle = initParm.in_envHandle; 
    
    /*
    **  Set an environment parameter
    */
    printf( "apisinit: set environment parameter\n" );
    setEnvPrmParm.se_envHandle = envHandle;
    setEnvPrmParm.se_paramID = IIAPI_EP_DATE_FORMAT;
    setEnvPrmParm.se_paramValue = (II_PTR)&longvalue;
    longvalue = IIAPI_EPV_DFRMT_YMD;

    IIapi_setEnvParam( &setEnvPrmParm );

    /*
    **  Release environment resources.
    */
    printf( "apisinit: releasing environment handle\n" );
    relEnvParm.re_envHandle = envHandle;

    IIapi_releaseEnv(&relEnvParm);

    /*
    **  Terminate API.
    */
    printf( "apisinit: shutting down API\n" );

    IIapi_terminate( &termParm );

    return( 0 );
}