| Linkexpress 利用者プログラム開発ガイド |
目次
索引
![]()
|
| 付録A サンプル | > A.1 転送APIのサンプル |
このサンプルプログラムは、以下のファイルに格納されています。
PCサーバ : インストールディレクトリ\sample\api\rspjob.c
UNIXサーバ : インストールディレクトリ/SAMPLE/api/rspjob.c
このサンプルプログラムは、完了復帰型のRSPJOBを使用して、ジョブを起動した相手システムに実行結果を送ります。プログラムの説明を以下に示します。

rspjob.cの内容を以下に示します。
/*
*
* All Rights Reserved Copyright (c) FUJITSU LIMITED 1997-2005
*
*/
/*
* API sample program (rspjob)
*/
/*
* include file
*/
#include <sys/types.h>
#include <string.h>
#include <stdio.h>
#include <lxapi.h>
int
main(int argc, char **argv)
{
unsigned char system_name[32];
dts_jobrsp_inf_t job_result;
dts_rspjob_dcb_t input_dcb;
dts_inf_transfer_comp_t output_dcb;
int ret = 0;
/*
* clear parameters
*/
memset( &job_result, 0, sizeof(job_result) );
memset( &input_dcb, 0, sizeof(dts_rspjob_dcb_t) );
memset( &output_dcb, 0, sizeof(dts_inf_transfer_comp_t) );
/*
* set parameters
*/
input_dcb.req_ident = 0;
input_dcb.req_type = DTS_API_COMP;
input_dcb.job_ident = atol( argv[4] );
strcpy( (char *)system_name, argv[2] );
input_dcb.system_name = system_name;
job_result.result_code = 0;
strcpy( (char *)job_result.detail, "Normal End" );
job_result.detail_len = strlen( (char *)job_result.detail );
input_dcb.job_result = &job_result;
/*
* rspjob
*/
ret = rspjob (&input_dcb,&output_dcb);
printf("ret =%d, diag %d,%d,%d\n", ret, output_dcb.diagnostic.category_code,
output_dcb.diagnostic.error_code,
output_dcb.diagnostic.detail_code );
printf("req_ident =%d\n", output_dcb.req_ident );
printf("system_name =%s\n", output_dcb.system_name );
printf("start_time =%s", ctime( (time_t *)&output_dcb.start_time ) );
printf("comp_time =%s", ctime( (time_t *)&output_dcb.comp_time ) );
printf("trn_comptype =%d\n", output_dcb.trn_comptype );
return(0);
}
参照
lxapi.h、dts_jobrsp_inf_t、dts_rspjob_dcb_t、、dts_inf_transfer_comp_t、rspjob
用語解説
目次
索引
![]()
|