#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 { Qwc_Rneta_Data_Rtnd_t neta_rtnd; int offset; char Data[256]; } NETA_RTND; NETA_RTND neta_rtnd; typedef struct { Qwc_Rneta_Attr_Table_t netattr; char data[256]; } NETATTR; NETATTR* netattr; int len, offset; char QSYSNAM[9], value[129]; printf("** TESTSYS3: システム名の検索 **\n"); getchar(); errcode.BYTESPRO = 160; errcode.BYTESAVL = 0; /*( ネットワーク属性の検索 )*/ QWCRNETA(&neta_rtnd, sizeof(NETA_RTND), 1, "SYSNAME ", &errcode); if(errcode.BYTESAVL != 0){/* APIERR */ printf("* APiErr\n"); getchar(); exit(-1); }/* APIERR */ offset = neta_rtnd.offset - 8; netattr = (NETATTR*)&(neta_rtnd.Data[offset]); memcpy(QSYSNAM, netattr->data, 8); QSYSNAM[8] = 0x00; printf("QSYSNAM = %s\n", QSYSNAM); getchar(); }