| Linkexpress 利用者プログラム開発ガイド |
目次
索引
![]()
|
| 付録A サンプル | > A.1 転送APIのサンプル |
このサンプルプログラムは、以下のファイルに格納されています。
PCサーバ : インストールディレクトリ\sample\api\respapl3.c
UNIXサーバ : インストールディレクトリ/SAMPLE/api/respapl3.c
このサンプルプログラムは、相手システムからのメッセージの受信を行うものです。プログラムの説明を以下に示します。

GETINFでメッセージを受け取り、TRANCOMPでその旨をLinkexpressに通知しています。
respapl3.cの内容を以下に示します。
/*
*
* All Rights Reserved Copyright (c) FUJITSU LIMITED 1997-2005
*
*/
/*
* API sample program (resp no.3)
*/
/*
* include file
*/
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <lxapi.h>
int
main()
{
unsigned long req_ident;
FILE *ofp;
/*
* getinf
*/
{
dts_getinf_dcb_t input_dcb;
dts_get_information_t output_dcb;
/*
* clear parameters
*/
memset( &input_dcb, 0, sizeof(dts_getinf_dcb_t) );
memset( &output_dcb, 0, sizeof(dts_get_information_t) );
input_dcb.appl_name = "@_USRAPL";
input_dcb.req_kind = DTS_API_RESP;
input_dcb.info_kind = DTS_API_START_INFO;
input_dcb.timer = 0;
input_dcb.path_name = 0;
getinf( &input_dcb, &output_dcb );
ofp = fopen("C:\\test\\api\\resp1.txt", "a");
(void)fprintf(ofp, "message_len = %d\n",
output_dcb.getinf_data.message.message_len);
(void)fprintf(ofp, "message_text = %s\n",
output_dcb.getinf_data.message.message_text);
(void)fprintf(ofp, "\n");
(void)fflush(ofp);
(void)fclose(ofp);
req_ident = output_dcb.getinf_data.tstart.req_ident;
}
/*
* trancomp
*/
{
dts_trancomp_dcb_t input_dcb;
dts_diagnostic_t output_dcb;
/*
* clear parameters
*/
memset( &input_dcb, 0, sizeof(dts_trancomp_dcb_t) );
memset( &output_dcb, 0, sizeof(dts_diagnostic_t) );
input_dcb.req_ident = req_ident;
input_dcb.appl_name = "@_USRAPL";
input_dcb.req_kind = DTS_API_RESP;
input_dcb.appl_cont = DTS_API_APLCUT;
trancomp( &input_dcb, &output_dcb );
}
fclose(ofp);
return( 1 );
}
参照
lxapi.h、dts_getinf_dcb_t、dts_get_information_t、dts_trancomp_dcb_t、dts_diagnostic_t
用語解説
目次
索引
![]()
|