?? simpserv.c
字號(hào):
/* (c) 2003 BEA Systems, Inc. All Rights Reserved. *//* Copyright (c) 1997 BEA Systems, Inc. All rights reserved THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF BEA Systems, Inc. The copyright notice above does not evidence any actual or intended publication of such source code.*//* #ident "@(#) samples/atmi/simpapp/simpserv.c $Revision: 1.5 $" */#include <stdio.h>#include <ctype.h>#include <atmi.h> /* TUXEDO Header File */#include <userlog.h> /* TUXEDO Header File *//* tpsvrinit is executed when a server is booted, before it begins processing requests. It is not necessary to have this function. Also available is tpsvrdone (not used in this example), which is called at server shutdown time.*/#if defined(__STDC__) || defined(__cplusplus)tpsvrinit(int argc, char *argv[])#elsetpsvrinit(argc, argv)int argc;char **argv;#endif{ /* Some compilers warn if argc and argv aren't used. */ argc = argc; argv = argv; /* userlog writes to the central TUXEDO message log */ userlog("Welcome to the simple server"); return(0);}/* This function performs the actual service requested by the client. Its argument is a structure containing among other things a pointer to the data buffer, and the length of the data buffer.*/#ifdef __cplusplusextern "C"#endifvoid#if defined(__STDC__) || defined(__cplusplus)TOUPPER(TPSVCINFO *rqst)#elseTOUPPER(rqst)TPSVCINFO *rqst;#endif{ char typ[30+1], subtyp[30+1];
int prio; int i;
prio=tpgprio();
fprintf(stdout,"\n name:%s cd:%i",rqst->name,rqst->cd);
if (tptypes((char *)rqst->data, typ, subtyp) == -1) {
fprintf(stdout,"\ntptypes error...");
}else{
fprintf(stdout,"\ntptypes type:%s ,subtype:%s",typ,subtyp);
}
for(i = 0; i < rqst->len-1; i++) rqst->data[i] = toupper(rqst->data[i]+1);
fprintf(stdout, "\nrun in server ..."); /* Return the transformed buffer to the requestor. */ tpreturn(TPSUCCESS, 0, rqst->data, 0L, 0);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -