gettimecl.c
来自「电力与银行通讯的源码 1.应用tuxedo中间件. 2.与银行的前置机通讯.」· C语言 代码 · 共 42 行
C
42 行
#include <stdio.h> #include "atmi.h" #if defined(__STDC__) || defined(__cplusplus)main(int argc,char *argv[])#elsemain(argc,argv)int argc;char *argv[];#endif{ long reqlen=1024; char *reqbuf; /* Attach to System/T as a Client Process */ if (tpinit((TPINIT *) NULL) == -1) { (void) fprintf(stderr, "Tpinit failed\n"); exit(1); } /* Allocate STRING buffers for the request and the reply */ reqbuf = (char *)tpalloc("STRING",NULL,reqlen); if ( reqbuf == (char *)NULL) { printf("tpalloc failed\n"); tpterm(); } /*invoke tuxedo service MGETTIME*/ if (tpcall("MGETTIME", NULL, 0L,(char **)&reqbuf, (long *)&reqlen, (long)0 )) { printf("tpcall failed,tperrno=%ld,tperrtext=%s\n",tperrno,tpstrerror(tperrno)); tpfree(reqbuf); tpterm(); exit(1); } printf("Time=%s\n",reqbuf); tpfree(reqbuf); tpterm(); return(0); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?