#include #include #include #include #define TRUE 0 #define FALSE -1 typedef struct { int BYTESPRO; int BYTESAVL; char MSGID[7]; char RESRVD; char EXCPDATA[100]; } ERRSTRUCTURE; /* Define the error return structure */ ERRSTRUCTURE errcode;/* Error Code Structure for RCVMSG */ void main(void){ typedef struct { int syssu; int offset; char value[128]; } SYSVAL; SYSVAL sysval; typedef struct { Qwc_Rsval_Sys_Value_Table_t table; char data[256]; } TABLE; TABLE* table; int len, offset; char QSRLNBR[9], value[129]; printf("** TESTSYS2: システム値の検索 **\n"); getchar(); errcode.BYTESPRO = 160; errcode.BYTESAVL = 0; /*( システム値 :QSRLNBR )*/ QWCRSVAL(&sysval, sizeof(SYSVAL), 1, "QSRLNBR ", &errcode); if(errcode.BYTESAVL != 0){/* APIERR */ printf("* APiErr\n"); getchar(); exit(-1); }/* APIERR */ offset = sysval.offset - 8; table = (TABLE*)&(sysval.value[offset]); memcpy(QSRLNBR, table->data, 8); QSRLNBR[8] = 0x00; printf("QSRLNBR = %s\n", QSRLNBR); getchar(); }