static char sccsid[] = "@(#) $Id: //bas/46D/src/krn/rfc/sapinfo.c#1 $ SAP"; /* Usage : */ /* ./sap-banner ashost=10.0.0.2 sysnr=0 */ /* */ /* Compiling : */ /* ROOT=/home/nicob/SAP/rfcsdk-linux */ /* INCLUDE=$ROOT/include/ */ /* LIB=$ROOT/lib/ */ /* gcc -I$INCLUDE -L$LIB sap-banner.c -o sapbnr -lrfc -ldl -lm */ #include #include #include #include #include "saprfc.h" #include "rfcsi.h" void DLL_CALL_BACK_FUNCTION rfc_error( char * operation ); static void display_rfcsi( RFCSI * rfcsi ); static void help( void ); RFC_ERROR_INFO_EX error_info; main( int argc, char ** argv ) { RFC_ENV new_env; RFC_HANDLE handle; RFC_RC rfc_rc; RFC_PARAMETER exporting[32]; RFC_PARAMETER importing[32]; RFC_TABLE tables[32]; RFCSI rfcsi; char * exception_ptr = NULL, VersionBuffer[256], * ptr, * pa, * pb, pm_buf[257], connect_param[1024]; int i, j, len, client_found = 0, user_found = 0, passwd_found = 0, language_found = 0; char std_client[4] = "360", std_user[13] = "Unknown", std_pass[9] = "Useless", std_lang[3] = "EN"; if (argc < 2) { help(); return 1; } /* ----------------------------------------------- * Install error handler * ---------------------------------------------*/ new_env.allocate = NULL; new_env.errorhandler = rfc_error; RfcEnvironment( &new_env ); /* ----------------------------------------------- * Put parameters from command to RfcOpenEx-Param. * ---------------------------------------------*/ memset(connect_param, 0, sizeof(connect_param)); ptr = connect_param; for (i=1; irfcdayst[0] != ' ' ? "(Daylight saving time)" : "" ); NLINE; NLINE; } /* display_rfcsi */ void DLL_CALL_BACK_FUNCTION rfc_error( char * operation ) { printf("RFC Call/Exception: %s\n", operation ); RfcLastErrorEx(&error_info); printf("\nGroup Error group %d", error_info.group); printf("\nKey %s", error_info.key); printf("\nMessage %s\n", error_info.message); exit(1); } /* rfc_error */ static void help( void ) { #define NL "\n" printf( NL"Syntax: ./sap-banner ashost=10.0.0.2 sysnr=0"NL ); return; }
<span id="7ztzv"></span>
<sub id="7ztzv"></sub>

<span id="7ztzv"></span><form id="7ztzv"></form>

<span id="7ztzv"></span>

        <address id="7ztzv"></address>

            ÑÇÖÞÅ·ÃÀÔÚÏß