convert for 3.0.0

This commit is contained in:
Roger Cole
1991-07-31 18:54:12 +00:00
parent fd0f957cd3
commit d1672f34cb
2 changed files with 48 additions and 23 deletions

View File

@@ -1,14 +1,40 @@
/****************************************************************************
GTA PROJECT AT division
Copyright, 1990, The Regents of the University of California
Los Alamos National Laboratory
FILE PATH: cmdClient.c
ENVIRONMENT: SunOS, VxWorks
MAKE OPTIONS:
SCCS VERSION: $Id$
*+/mod***********************************************************************
/* $Id$
* Author: Roger A. Cole
* Date: 11-26-90
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
* .01 11-26-90 rac initial version
* .02 07-30-91 rac installed in SCCS
*
* make options
* -DvxWorks makes a version for VxWorks
* -DNDEBUG don't compile assert() checking
* -DDEBUG compile various debug code, including checks on
* malloc'd memory
*/
/*+/mod***********************************************************************
* TITLE cmdClient.c - general purpose client for command-based servers
*
* DESCRIPTION
@@ -32,13 +58,7 @@
* o this program should use tasks.h to establish priorities, stack
* sizes, etc.
* o not all signals are caught
*-
* Modification History
* version date programmer comments
* ------- -------- ------------ -----------------------------------
* 1.1 11/26/90 R. Cole initial version
*
*****************************************************************************/
*-***************************************************************************/
#include <genDefs.h>
#include <genTasks.h>
#include <cmdDefs.h>

View File

@@ -26,7 +26,7 @@
* Modification Log:
* -----------------
* .01 10-24-90 rac initial version
* .02 mm-dd-yy rac version 1.0, installed in SCCS
* .02 07-30-91 rac installed in SCCS; changed to use EPICS_ENV..
*
* make options
* -DvxWorks makes a version for VxWorks
@@ -78,7 +78,7 @@
* any commands needing an individual help topic, then a
* specific HELP_TOPIC will have to be defined.
* If you're using sockets, assign a port number in <ports.h>, and
* change IPPORT_CMD_PROTO to the IPPORT_xxx you've chosen.
* change glZzzIPPort to the IPPORT_xxx you've chosen.
*
* SunOS
* o link with genLib.a
@@ -103,8 +103,8 @@
#include <genDefs.h>
#include <genTasks.h>
#include <cmdDefs.h>
#include <envDefs.h>
#include <ezsSockSubr.h>
#include <ports.h>
#include <cadef.h>
#ifdef vxWorks
@@ -193,6 +193,7 @@ static CX_CMD *pglZzzCxCmd=NULL;
static ZZZ_CTX glZzzCtx;
static ZZZ_CTX *pglZzzCtx=NULL;
static char *glZzzId="zzz 11/27/90";
static int glZzzIPPort;
#ifndef vxWorks
@@ -269,7 +270,11 @@ char *option; /* I NULL, "hostName", or "server" */
(void)printf("can't operate as client under VxWorks\n");
#else
char portText[10];
(void)sprintf(portText, "%d", IPPORT_CMD_PROTO);
if (envGetConfigParam(&EPICS_CMD_PROTO_PORT, 10, portText) == NULL) {
printf("error getting %s\n", EPICS_CMD_PROTO_PORT.name);
return ERROR;
}
sscanf(portText, "%d", &glZzzIPPort);
execl("cmdClient", "cmdClient", option, portText, (char *)0);
(void)printf("couldn't exec to cmdClient\n");
#endif
@@ -763,7 +768,7 @@ CX_CMD **ppCxCmd; /* IO ptr to pointer to command context */
/*-----------------------------------------------------------------------------
* establish a socket to use to listen for potential clients to connect
*----------------------------------------------------------------------------*/
if (ezsCreateListenSocket(&pglZzzCtx->listenSock, IPPORT_CMD_PROTO) != 0) {
if (ezsCreateListenSocket(&pglZzzCtx->listenSock, glZzzIPPort) != 0) {
perror("create listen socket");
goto zzzListenTaskWrapup;
}