Compare commits

...

21 Commits

Author SHA1 Message Date
Janet B. Anderson
297f0b8c31 Added *COPYRIGHT* files to release tar file. 1995-10-03 15:42:26 +00:00
Jeff Hill
cc20412693 added locking for previous change 1995-09-29 22:53:38 +00:00
Jeff Hill
7021cd3589 use unsigned short for port 1995-09-29 22:18:53 +00:00
Jeff Hill
b7acf453c2 added arch independent type 1995-09-29 22:17:57 +00:00
Jeff Hill
c9abc2c82e ms windows changes 1995-09-29 22:17:13 +00:00
Jeff Hill
a7484494c4 changes from LBL 1995-09-29 22:15:26 +00:00
Jeff Hill
52cfbe92bf check for nill dbr pointer 1995-09-29 22:13:59 +00:00
Jeff Hill
75f0fb2b0c allow server to refuse to create a channel without a client disconnect 1995-09-29 22:13:05 +00:00
Jeff Hill
ed36723d6c ms windows changes 1995-09-29 21:58:16 +00:00
Jeff Hill
f7a5da9139 added minor version 6 which allows the server to refuse to create a channel
without disconnecting the client
1995-09-29 21:57:11 +00:00
Jeff Hill
254c5b1620 added func proto for cacDisconnectChannel() 1995-09-29 21:55:38 +00:00
Jeff Hill
c6aab85d79 MS windows changes and added cacDisconnectChannel() 1995-09-29 21:54:40 +00:00
Jeff Hill
d54724fce1 MS windows changes 1995-09-29 21:48:33 +00:00
Jeff Hill
60c0acab3c MS windows changes 1995-09-29 21:47:58 +00:00
Jeff Hill
69f33b9e23 alignment fix for SPARC IOC client and changes to prevent running of
access rights or connection handlers when the connection is lost just
after deleting a channel
1995-09-29 21:47:33 +00:00
Janet B. Anderson
9191863094 Added test for Linux. 1995-09-27 22:09:43 +00:00
Marty Kraimer
1beb157ab0 new database access has units as 16 char null terminated. old has 8 char null 1995-09-27 19:54:50 +00:00
Marty Kraimer
41ae285075 copy units string using DB_UNITS_SIZE 1995-09-27 19:52:45 +00:00
John Winans
222063ac53 Added code to send last byte of a RAC_RESET in pepTxTask(). It was left
out in a previous mod that modes the last byte transmission into a locked
region in order to prevent a TxTask/RxTask race condition.
1995-09-26 14:50:31 +00:00
Janet B. Anderson
3342ca120f Specified return type of functions. 1995-09-21 19:48:26 +00:00
cvs2svn
13b785e594 This commit was manufactured by cvs2svn to create tag 'R3.12.1.2'. 1995-09-13 18:27:49 +00:00
43 changed files with 340 additions and 222 deletions

View File

@@ -10,6 +10,9 @@
# [-b] - For fully built release
#
# $Log$
# Revision 1.2 1995/08/28 15:49:54 jba
# Added startup directory to release tar file
#
# Revision 1.1 1995/08/17 20:14:56 jba
# Added base/tools scripts functionality to base/Makefile, removed scripts
# Moved base/tools/MakeRelease to base dir.
@@ -104,6 +107,8 @@ ls base/README* | xargs tar cvf ${RELS}.Tar
ls base/Makefile* > /tmp/make_release.out.$$;
ls base/*COPYRIGHT* >> /tmp/make_release.out.$$;
if [ -d startup ];
then
find startup -name CVS -prune -o ! -type d -print \

View File

@@ -99,6 +99,9 @@
/************************************************************************/
/*
* $Log$
* Revision 1.77 1995/09/01 14:31:32 mrk
* Fixed bug causing memory problem
*
* Revision 1.76 1995/08/23 00:34:06 jhill
* fixed vxWorks specific SPARC data alignment problem
*
@@ -976,14 +979,14 @@ int epicsShareAPI ca_search_and_connect
* also allocate enough for the channel name & paddr
* block
*/
size = sizeof(*chix) + strcnt + sizeof(struct db_addr)
+CA_MESSAGE_ALIGN(1);
size = CA_MESSAGE_ALIGN(sizeof(*chix) + strcnt) +
sizeof(struct db_addr);
*chixptr = chix = (chid) calloc(1,size);
if (!chix){
return ECA_ALLOCMEM;
}
chix->id.paddr = (struct db_addr *)
CA_MESSAGE_ALIGN(strcnt+(char *)(chix+1));
(CA_MESSAGE_ALIGN(sizeof(*chix)+strcnt) + (char *)chix);
*chix->id.paddr = tmp_paddr;
chix->puser = puser;
chix->pConnFunc = conn_func;
@@ -1972,7 +1975,7 @@ void (*pfunc)(struct access_rights_handler_args))
/*
* make certain that it runs at least once
*/
if(chan->state == cs_conn){
if(chan->state == cs_conn && chan->pAccessRightsFunc){
args.chid = chan;
args.ar = chan->ar;
(*chan->pAccessRightsFunc)(args);
@@ -2531,6 +2534,8 @@ int epicsShareAPI ca_clear_channel (chid chix)
chix->type = TYPENOTINUSE;
old_chan_state = chix->state;
chix->state = cs_closed;
chix->pAccessRightsFunc = NULL;
chix->pConnFunc = NULL;
/* the while is only so I can break to the lock exit */
LOCK;

View File

@@ -7,6 +7,9 @@ static char *sccsId = "@(#) $Id$";
/*
* $Log$
* Revision 1.29 1995/08/22 00:16:34 jhill
* Added test of the duration of ca_pend_event()
*
*/
#ifdef VMS
@@ -103,13 +106,13 @@ int doacctst(char *pname)
chid chix4;
struct dbr_gr_float *ptr = NULL;
struct dbr_gr_float *pgrfloat = NULL;
float *pfloat = NULL;
double *pdouble = NULL;
dbr_float_t *pfloat = NULL;
dbr_double_t *pdouble = NULL;
long status;
long i, j;
evid monix;
char pstring[NUM][MAX_STRING_SIZE];
unsigned size;
SEVCHK(ca_task_initialize(), "Unable to initialize");
@@ -123,9 +126,9 @@ int doacctst(char *pname)
{
TS_STAMP end_time;
TS_STAMP start_time;
double delay;
double request = 0.5;
double accuracy;
dbr_double_t delay;
dbr_double_t request = 0.5;
dbr_double_t accuracy;
tsLocalTime(&start_time);
status = ca_pend_event(request);
@@ -140,8 +143,8 @@ int doacctst(char *pname)
assert (abs(accuracy) < 10.0);
}
ptr = (struct dbr_gr_float *)
malloc(dbr_size_n(DBR_GR_FLOAT, NUM));
size = dbr_size_n(DBR_GR_FLOAT, NUM);
ptr = (struct dbr_gr_float *) malloc(size);
for (i = 0; i < 10; i++) {
@@ -264,9 +267,9 @@ int doacctst(char *pname)
ca_read_access(chix1) &&
ca_write_access(chix1)){
double incr;
double epsil;
double base;
dbr_double_t incr;
dbr_double_t epsil;
dbr_double_t base;
unsigned long iter;
printf ("float test ...");
@@ -328,7 +331,7 @@ int doacctst(char *pname)
* solicitations
*/
if(ca_read_access(chix4)){
float temp;
dbr_float_t temp;
printf("Performing multiple get test...");
fflush(stdout);
@@ -349,7 +352,7 @@ int doacctst(char *pname)
printf("Performing multiple put test...");
fflush(stdout);
for(i=0; i<10000; i++){
double fval = 3.3;
dbr_double_t fval = 3.3;
status = ca_put(DBR_DOUBLE, chix4, &fval);
SEVCHK(status, NULL);
}
@@ -396,7 +399,7 @@ int doacctst(char *pname)
printf("Performing multiple put callback test...");
fflush(stdout);
for(i=0; i<10000; i++){
float fval = 3.3;
dbr_float_t fval = 3.3F;
status = ca_array_put_callback(
DBR_FLOAT,
1,
@@ -420,8 +423,8 @@ int doacctst(char *pname)
printf("Performing multiple monitor test...");
fflush(stdout);
{
evid mid[1000];
float temp;
evid mid[1000];
dbr_float_t temp;
for(i=0; i<NELEMENTS(mid); i++){
SEVCHK(ca_add_event(DBR_GR_FLOAT, chix4, null_event,
@@ -499,8 +502,8 @@ int doacctst(char *pname)
SEVCHK(status, NULL);
}
pfloat = (float *) calloc(sizeof(float),NUM);
pdouble = (double *) calloc(sizeof(double),NUM);
pfloat = (dbr_float_t *) calloc(sizeof(*pfloat),NUM);
pdouble = (dbr_double_t *) calloc(sizeof(*pdouble),NUM);
pgrfloat = (struct dbr_gr_float *) calloc(sizeof(*pgrfloat),NUM);
if (VALID_DB_REQ(chix1->type))
@@ -654,9 +657,15 @@ void null_event(struct event_handler_args args)
void write_event(struct event_handler_args args)
{
int status;
float a = *(float *) args.dbr;
dbr_float_t *pFloat = (dbr_float_t *) args.dbr;
dbr_float_t a;
a += 10.1;
if (!args.dbr) {
return;
}
a = *pFloat;
a += 10.1F;
status = ca_array_put(
DBR_FLOAT,
@@ -745,10 +754,10 @@ void test_sync_groups(chid chix)
*/
void multiple_sg_requests(chid chix, CA_SYNC_GID gid)
{
int status;
unsigned i;
static float fvalput = 3.3;
static float fvalget;
int status;
unsigned i;
static dbr_float_t fvalput = 3.3F;
static dbr_float_t fvalget;
for(i=0; i<1000; i++){
if(ca_write_access(chix)){

View File

@@ -19,7 +19,7 @@ void caAddConfiguredAddr(
int port);
int local_addr(SOCKET socket, struct sockaddr_in *plcladdr);
int caFetchPortConfig(ENV_PARAM *pEnv, int defaultPort);
unsigned short caFetchPortConfig(ENV_PARAM *pEnv, unsigned short defaultPort);
union caAddr{
struct sockaddr_in inetAddr;

View File

@@ -757,7 +757,7 @@ LOCAL void cac_tcp_send_msg_piiu(struct ioc_in_use *piiu)
CAC_RING_BUFFER_READ_ADVANCE(&piiu->send, status);
if (status != sendCnt) {
if (((unsigned long)status) != sendCnt) {
UNLOCK;
return;
}
@@ -928,7 +928,7 @@ LOCAL void tcp_recv_msg(struct ioc_in_use *piiu)
break;
}
assert (status<=writeSpace);
assert (((unsigned long)status)<=writeSpace);
CAC_RING_BUFFER_WRITE_ADVANCE(&piiu->recv, status);
@@ -938,7 +938,7 @@ LOCAL void tcp_recv_msg(struct ioc_in_use *piiu)
*/
piiu->timeAtLastRecv = ca_static->currentTime;
if (status != writeSpace) {
if (((unsigned long)status) != writeSpace) {
break;
}
}
@@ -1196,6 +1196,8 @@ void close_ioc (struct ioc_in_use *piiu)
piiuCast = NULL;
}
else {
chid *pNext;
/*
* remove IOC from the hash table
*/
@@ -1209,73 +1211,20 @@ void close_ioc (struct ioc_in_use *piiu)
* handler tries to use a channel before
* I mark it disconnected.
*/
chix = (chid) &piiu->chidlist.node.next;
while (chix = (chid) chix->node.next) {
chix->type = TYPENOTCONN;
chix->count = 0U;
chix = (chid) ellFirst(&piiu->chidlist);
while (chix) {
chix->state = cs_prev_conn;
chix->id.sid = ~0U;
chix->ar.read_access = FALSE;
chix->ar.write_access = FALSE;
/*
* try to reconnect
*/
chix->retry = 0U;
chix = (chid) ellNext(&chix->node);
}
if (piiu->chidlist.count) {
ca_signal (ECA_DISCONN,piiu->host_name_str);
chix = (chid) ellFirst(&piiu->chidlist);
while (chix) {
pNext = (chid) ellNext(&chix->node);
cacDisconnectChannel(chix, TRUE);
chix = pNext;
}
/*
* clear outstanding get call backs
*/
caIOBlockListFree (&pend_read_list, chix, TRUE, ECA_DISCONN);
/*
* clear outstanding put call backs
*/
caIOBlockListFree (&pend_write_list, chix, TRUE, ECA_DISCONN);
/*
* call their connection handler as required
*/
chix = (chid) &piiu->chidlist.node.next;
while (chix = (chid) chix->node.next) {
LOCKEVENTS;
if (chix->pConnFunc) {
struct connection_handler_args args;
args.chid = chix;
args.op = CA_OP_CONN_DOWN;
(*chix->pConnFunc) (args);
}
if (chix->pAccessRightsFunc) {
struct access_rights_handler_args args;
args.chid = chix;
args.ar = chix->ar;
(*chix->pAccessRightsFunc) (args);
}
UNLOCKEVENTS;
chix->piiu = piiuCast;
}
/*
* move all channels to the broadcast IIU
*
* if we loose the broadcast IIU its a severe error
*/
assert (piiuCast);
ellConcat (&piiuCast->chidlist, &piiu->chidlist);
assert (piiu->chidlist.count==0);
}
/*
* Try to reconnect
*/
ca_static->ca_search_retry = 0;
if (fd_register_func) {
LOCKEVENTS;
(*fd_register_func) (fd_register_arg, piiu->sock_chan, FALSE);
@@ -1298,11 +1247,78 @@ void close_ioc (struct ioc_in_use *piiu)
ellFree (&piiu->destAddr);
ca_signal (ECA_DISCONN,piiu->host_name_str);
free (piiu);
UNLOCK;
}
/*
* cacDisconnectChannel()
*/
void cacDisconnectChannel(chid chix, int fullDisconnect)
{
struct ioc_in_use *piiu;
chix->type = TYPENOTCONN;
chix->count = 0U;
chix->id.sid = ~0U;
chix->ar.read_access = FALSE;
chix->ar.write_access = FALSE;
/*
* try to reconnect
*/
chix->retry = 0U;
/*
* call their connection handler as required
*/
if (fullDisconnect) {
chix->state = cs_prev_conn;
/*
* clear outstanding get call backs
*/
caIOBlockListFree (&pend_read_list, chix,
TRUE, ECA_DISCONN);
/*
* clear outstanding put call backs
*/
caIOBlockListFree (&pend_write_list, chix,
TRUE, ECA_DISCONN);
LOCKEVENTS;
if (chix->pConnFunc) {
struct connection_handler_args args;
args.chid = chix;
args.op = CA_OP_CONN_DOWN;
(*chix->pConnFunc) (args);
}
if (chix->pAccessRightsFunc) {
struct access_rights_handler_args args;
args.chid = chix;
args.ar = chix->ar;
(*chix->pAccessRightsFunc) (args);
}
UNLOCKEVENTS;
}
piiu = (struct ioc_in_use *)chix->piiu;
ellDelete(&piiu->chidlist, &chix->node);
assert (piiuCast);
chix->piiu = piiuCast;
ellAdd(&piiuCast->chidlist, &chix->node);
/*
* Try to reconnect this channel
*/
ca_static->ca_search_retry = 0;
}
/*
@@ -1705,7 +1721,7 @@ void caPrintAddrList(ELLLIST *pList)
/*
* caFetchPortConfig()
*/
int caFetchPortConfig(ENV_PARAM *pEnv, int defaultPort)
unsigned short caFetchPortConfig(ENV_PARAM *pEnv, unsigned short defaultPort)
{
long longStatus;
long epicsParam;
@@ -1713,29 +1729,29 @@ int caFetchPortConfig(ENV_PARAM *pEnv, int defaultPort)
longStatus = envGetLongConfigParam(pEnv, &epicsParam);
if (longStatus!=0) {
epicsParam = defaultPort;
epicsParam = (long) defaultPort;
ca_printf ("EPICS \"%s\" integer fetch failed\n", pEnv->name);
ca_printf ("setting \"%s\" = %ld\n", pEnv->name, epicsParam);
}
/*
* This must be a server port that will fit in a signed
* This must be a server port that will fit in an unsigned
* short
*/
if (epicsParam<=IPPORT_USERRESERVED || epicsParam>SHRT_MAX) {
if (epicsParam<=IPPORT_USERRESERVED || epicsParam>USHRT_MAX) {
ca_printf ("EPICS \"%s\" out of range\n", pEnv->name);
/*
* Quit if the port is wrong due CA coding error
*/
assert (epicsParam != defaultPort);
epicsParam = defaultPort;
assert (epicsParam != (long) defaultPort);
epicsParam = (long) defaultPort;
ca_printf ("Setting \"%s\" = %ld\n", pEnv->name, epicsParam);
}
/*
* ok to clip to int here because we checked the range
*/
port = (int) epicsParam;
port = (unsigned short) epicsParam;
return port;
}

View File

@@ -29,7 +29,10 @@
/* .17 121892 joh added TCP send buf size var */
/* .18 122192 joh added outstanding ack var */
/* .19 012094 joh added minor version (for each server) */
/* $Log$ */
/* $Log$
* Revision 1.47 1995/08/22 00:20:27 jhill
* added KLUDGE def of S_db_Pending
* */
/* */
/*_begin */
/************************************************************************/
@@ -412,9 +415,11 @@ struct ca_static{
void (*ca_exception_func)
(struct exception_handler_args);
void *ca_exception_arg;
#if 0
void (*ca_connection_func)
(struct connection_handler_args);
void *ca_connection_arg;
#endif
int (*ca_printf_func)(const char *pformat, va_list args);
void (*ca_fd_register_func)
(void *, SOCKET, int);
@@ -608,7 +613,7 @@ ca_time cac_time_sum(ca_time *pTVA, ca_time *pTVB);
void caIOBlockFree(evid pIOBlock);
void clearChannelResources(unsigned id);
void caSetDefaultPrintfHandler ();
void cacDisconnectChannel(chid chix, int fullDisconnect);
/*
* !!KLUDGE!!
*

View File

@@ -25,6 +25,9 @@
*
* .10 050594 joh New command added for CA V4.3 - wakeup the server
* $Log$
* Revision 1.23 1995/08/23 00:35:17 jhill
* added log entries
*
*/
#define __IOCMSG__
@@ -33,7 +36,7 @@ HDRVERSIONID(iocmsgh, "@(#) $Id$ CA version 4.4")
/* TCP/UDP port number (bumped each protocol change) */
#define CA_PROTOCOL_VERSION 4
#define CA_MINOR_VERSION 5
#define CA_MINOR_VERSION 6
#define CA_UKN_MINOR_VERSION 0 /* unknown minor version */
#if CA_PROTOCOL_VERSION == 4
#define CA_V41(MAJOR,MINOR) ((MINOR)>=1)
@@ -41,18 +44,21 @@ HDRVERSIONID(iocmsgh, "@(#) $Id$ CA version 4.4")
#define CA_V43(MAJOR,MINOR) ((MINOR)>=3)
#define CA_V44(MAJOR,MINOR) ((MINOR)>=4)
#define CA_V45(MAJOR,MINOR) ((MINOR)>=5)
#define CA_V46(MAJOR,MINOR) ((MINOR)>=6)
#elif CA_PROTOCOL_VERSION > 4
#define CA_V41(MAJOR,MINOR) ( 1 )
#define CA_V42(MAJOR,MINOR) ( 1 )
#define CA_V43(MAJOR,MINOR) ( 1 )
#define CA_V44(MAJOR,MINOR) ( 1 )
#define CA_V45(MAJOR,MINOR) ( 1 )
#define CA_V46(MAJOR,MINOR) ( 1 )
#else
#define CA_V41(MAJOR,MINOR) ( 0 )
#define CA_V42(MAJOR,MINOR) ( 0 )
#define CA_V43(MAJOR,MINOR) ( 0 )
#define CA_V44(MAJOR,MINOR) ( 0 )
#define CA_V45(MAJOR,MINOR) ( 0 )
#define CA_V46(MAJOR,MINOR) ( 0 )
#endif
/*
@@ -61,7 +67,7 @@ HDRVERSIONID(iocmsgh, "@(#) $Id$ CA version 4.4")
* environment variables "EPICS_CA_REPEATER_PORT" and
* "EPICS_CA_SERVER_PORT"
*/
#define CA_PORT_BASE IPPORT_USERRESERVED + 56
#define CA_PORT_BASE IPPORT_USERRESERVED + 56U
#define CA_SERVER_PORT (CA_PORT_BASE+CA_PROTOCOL_VERSION*2)
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_PROTOCOL_VERSION*2+1)
@@ -106,6 +112,7 @@ typedef ca_uint32_t caResId;
#define IOC_ECHO 23 /* CA V4.3 connection verify */
#define REPEATER_REGISTER 24 /* registr for repeater fan out */
#define IOC_SIGNAL 25 /* knock the server out of select */
#define IOC_CLAIM_CIU_FAILED 26 /* unable to create chan resource in server */
/*
* for use with search and not_found (if search fails and

View File

@@ -307,12 +307,13 @@ static char *os_depenhSccsId = "$Id$";
# define UNLOCKEVENTS
# define EVENTLOCKTEST (post_msg_active)
# define MAXHOSTNAMELEN 75
# define IPPORT_USERRESERVED 5000
# define IPPORT_USERRESERVED 5000U
# define EWOULDBLOCK WSAEWOULDBLOCK
# define ENOBUFS WSAENOBUFS
# define ECONNRESET WSAECONNRESET
# define ETIMEDOUT WSAETIMEDOUT
# define EADDRINUSE WSAEADDRINUSE
# define ECONNREFUSED WSAECONNREFUSED
# define socket_close(S) closesocket(S)
# define socket_ioctl(A,B,C) ioctlsocket(A,B,C)
# define MYERRNO WSAGetLastError()

View File

@@ -85,8 +85,8 @@ static char buf[MAX_UDP];
LOCAL void register_new_client(struct sockaddr_in *pLocal,
struct sockaddr_in *pFrom);
#define PORT_ANY 0
LOCAL int makeSocket(int port);
#define PORT_ANY 0U
LOCAL SOCKET makeSocket(unsigned short port);
LOCAL void fanOut(struct sockaddr_in *pFrom, const char *pMsg, unsigned msgSize);
@@ -104,7 +104,7 @@ void ca_repeater()
struct sockaddr_in from;
struct sockaddr_in local;
int from_size = sizeof from;
short port;
unsigned short port;
port = caFetchPortConfig(
&EPICS_CA_REPEATER_PORT,
@@ -241,11 +241,11 @@ LOCAL void fanOut(struct sockaddr_in *pFrom, const char *pMsg, unsigned msgSize)
/*
* makeSocket()
*/
LOCAL int makeSocket(int port)
LOCAL SOCKET makeSocket(unsigned short port)
{
int status;
struct sockaddr_in bd;
int sock;
SOCKET sock;
int true = 1;
sock = socket( AF_INET, /* domain */

View File

@@ -263,8 +263,6 @@ const struct in_addr *pnet_addr
&piiu->curMsg.m_available);
UNLOCK;
if(!monix){
ca_signal(ECA_INTERNAL,
"bad client write io id from server");
break;
}
@@ -313,8 +311,6 @@ const struct in_addr *pnet_addr
&piiu->curMsg.m_available);
UNLOCK;
if(!monix){
ca_signal(ECA_INTERNAL,
"bad client read notify io id from server");
break;
}
@@ -384,8 +380,6 @@ const struct in_addr *pnet_addr
&piiu->curMsg.m_available);
UNLOCK;
if(!monix){
ca_signal(ECA_INTERNAL,
"bad client event id from server");
break;
}
@@ -465,8 +459,6 @@ const struct in_addr *pnet_addr
&piiu->curMsg.m_available);
UNLOCK;
if(!pIOBlock){
ca_signal(ECA_INTERNAL,
"bad client read io id from server");
break;
}
@@ -640,9 +632,6 @@ const struct in_addr *pnet_addr
if (pList) {
ellDelete(pList, &monix->node);
}
else {
printf ("CAC - Protocol err - no list for IO blk\n");
}
caIOBlockFree(monix);
}
@@ -712,6 +701,31 @@ const struct in_addr *pnet_addr
reconnect_channel(piiu, chan);
break;
}
case IOC_CLAIM_CIU_FAILED:
{
chid chan;
LOCK;
chan = bucketLookupItemUnsignedId(
pSlowBucket, &piiu->curMsg.m_cid);
UNLOCK;
if(!chan){
/*
* end up here if they delete the channel
* prior to this response
*/
break;
}
/*
* need to move the channel back to the cast IIU
* (so we will be able to reconnect)
*/
LOCK;
cacDisconnectChannel(chan, FALSE);
UNLOCK;
break;
}
default:
ca_printf("CAC: post_msg(): Corrupt cmd in msg %x\n",
piiu->curMsg.m_cmmd);
@@ -828,7 +842,7 @@ const struct in_addr *pnet_addr
case ECA_DISCONN:
/*
* This indicates that the connection is tagged
* is tagged for shutdown and we are waiting for
* for shutdown and we are waiting for
* it to go away. Search replies are ignored
* in the interim.
*/
@@ -979,9 +993,6 @@ chid chan
/* decrement the outstanding IO count */
CLRPENDRECV(TRUE);
}
UNLOCK;
}

View File

@@ -29,6 +29,9 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.16 1995/08/22 00:27:55 jhill
* added cvs style mod log
*
*
* NOTES:
* 1) Need to fix if the OP is on a FD that
@@ -520,7 +523,7 @@ LOCAL void io_complete(struct event_handler_args args)
* Update the user's variable
* (if its a get)
*/
if(pcasgop->pValue){
if(pcasgop->pValue && args.dbr){
size = dbr_size_n(args.type, args.count);
memcpy(pcasgop->pValue, args.dbr, size);
}

View File

@@ -13,7 +13,6 @@
*
* 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)
@@ -27,9 +26,10 @@
* Advanced Photon Source
* Argonne National Laboratory
*
* Lawrence Berkley National Laboratory
*
* Modification Log:
* -----------------
* $Log$
*
*/
@@ -58,8 +58,7 @@ void cac_gettimeval(struct timeval *pt)
SYSTEMTIME st;
GetSystemTime(&st);
pt->tv_sec = (long)st.wSecond + (long)st.wMinute*60 +
(long)st.wHour*360;
pt->tv_sec = time(NULL);
pt->tv_usec = st.wMilliseconds*1000;
}
@@ -80,11 +79,6 @@ void cac_mux_io(struct timeval *ptimeout)
cac_clean_iiu_list();
/*
* manage search timers and detect disconnects
*/
manage_conn(TRUE);
timeout = *ptimeout;
do{
count = cac_select_io(
@@ -93,6 +87,11 @@ void cac_mux_io(struct timeval *ptimeout)
ca_process_input_queue();
/*
* manage search timers and detect disconnects
*/
manage_conn(TRUE);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
}
@@ -291,11 +290,8 @@ int local_addr (SOCKET s, struct sockaddr_in *plcladdr)
*/
void caDiscoverInterfaces(ELLLIST *pList, SOCKET socket, int port)
{
struct sockaddr_in localAddr;
struct sockaddr_in InetAddr;
struct in_addr bcast_addr;
caAddrNode *pNode;
int status;
pNode = (caAddrNode *) calloc(1,sizeof(*pNode));
if(!pNode){
@@ -353,6 +349,13 @@ static int get_subnet_mask ( char SubNetMaskStr[256])
return RegTcpParams (localadr, SubNetMaskStr);
}
/* For NT 3.51, enumerates network interfaces returns the ip address */
/* and subnet mask for the LAST interface found. This needs to be changed */
/* to work in conjuction with caDiscoverInterfaces to add all the */
/* add all the interfaces to the elist. Also could be more efficient in
calling */
/* RegKeyOpen */
static int RegTcpParams (char IpAddrStr[256], char SubNetMaskStr[256])
{
#define MAX_VALUE_NAME 128
@@ -361,37 +364,65 @@ static int RegTcpParams (char IpAddrStr[256], char SubNetMaskStr[256])
DWORD cbDataLen;
CHAR cbData[256];
DWORD dwType;
int status;
int status, i, card_cnt;
char *pNetCard[16], *pData;
static char IpAddr[256], SubNetMask[256];
cbDataLen = sizeof(cbData);
strcpy(RegPath,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards\\1");
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "ServiceName", &dwType, cbData, &cbDataLen);
/****
strcpy(RegPath,"SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\NetworkCards\\1");
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "ServiceName", &dwType,
cbData, &cbDataLen);
if (status) {
strcpy(RegPath,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards\\01");
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "ServiceName", &dwType, cbData, &cbDataLen);
strcpy(RegPath,"SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\NetworkCards\\01");
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "ServiceName", &dwType,
cbData, &cbDataLen);
if (status)
return status;
}
****/
strcpy(RegPath,"SYSTEM\\CurrentControlSet\\Services\\");
strcat(RegPath,cbData);
strcat(RegPath,"\\Parameters\\Tcpip");
strcpy(RegPath,"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Linkage");
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "Route", &dwType, cbData,
&cbDataLen);
if (status) {
return status;
}
i=0; card_cnt = 0; pData = cbData; /* enumerate network interfaces */
while( i < 16 && (pNetCard[i]=strtok(pData,"\"")) ) {
strcpy(RegPath,"SYSTEM\\CurrentControlSet\\Services\\");
strcat(RegPath,pNetCard[i]);
strcat(RegPath,"\\Parameters\\Tcpip");
cbDataLen = sizeof(IpAddr);
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "IPAddress", &dwType,
IpAddr, &cbDataLen);
if (status == 0) {
cbDataLen = sizeof(SubNetMask);
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "SubnetMask",
&dwType, SubNetMask, &cbDataLen);
if (status)
return status;
card_cnt++;
}
pData += strlen(pNetCard[i])+3;
i++;
}
if (card_cnt == 0)
return 1;
cbDataLen = sizeof(IpAddr);
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "IPAddress", &dwType, IpAddr, &cbDataLen);
if (status)
return status;
strcpy(IpAddrStr,IpAddr);
cbDataLen = sizeof(SubNetMask);
status = RegKeyData (RegPath, HKEY_LOCAL_MACHINE, "SubnetMask", &dwType, SubNetMask, &cbDataLen);
if (status)
return status;
strcpy(SubNetMaskStr,SubNetMask);
return 0;
return 0;
}
@@ -418,7 +449,8 @@ static int RegKeyData (CHAR *RegPath, HANDLE hKeyRoot, LPSTR lpzValueName,
}
retCode = RegQueryValueEx (hKey, // Key handle returned from RegOpenKeyEx.
retCode = RegQueryValueEx (hKey, // Key handle returned from
RegOpenKeyEx.
lpzValueName, // Name of value.
NULL, // Reserved, dword = NULL.
lpdwType, // Type of data.
@@ -462,11 +494,15 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
break;
case DLL_THREAD_ATTACH:
#if _DEBUG
fprintf(stderr, "Thread attached to ca.dll R12\n");
#endif
break;
case DLL_THREAD_DETACH:
#if _DEBUG
fprintf(stderr, "Thread detached from ca.dll R12\n");
#endif
break;
default:
@@ -476,3 +512,5 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
return TRUE;
}

View File

@@ -2785,7 +2785,6 @@ void *pflin
long (*pconvert_routine)();
struct dbCommon *pcommon;
long status;
long *perr_status=NULL;
prset=GET_PRSET(pdbBase->precSup,paddr->record_type);
@@ -2804,11 +2803,13 @@ void *pflin
}
*((unsigned short *)pbuffer)++ = pcommon->acks;
*((unsigned short *)pbuffer)++ = pcommon->ackt;
*perr_status = 0;
}
if( (*options) & DBR_UNITS ) {
if( prset && prset->get_units ){
(*prset->get_units)(paddr,pbuffer);
char * pchr = (char *)pbuffer;
(*prset->get_units)(paddr,pchr);
pchr[DB_UNITS_SIZE-1] = '\0';
} else {
memset(pbuffer,'\0',dbr_units_size);
*options = (*options) ^ DBR_UNITS; /*Turn off DBR_UNITS*/
@@ -2855,7 +2856,6 @@ GET_DATA:
sprintf(message,"dbGet - database request type is %d",dbrType);
recGblDbaddrError(S_db_badDbrtype,paddr,message);
if(perr_status) *perr_status = S_db_badDbrtype;
return(S_db_badDbrtype);
}
@@ -2870,7 +2870,6 @@ GET_DATA:
sprintf(message,"dbGet - database request type is %d",dbrType);
recGblDbaddrError(S_db_badDbrtype,paddr,message);
if(perr_status) *perr_status = S_db_badDbrtype;
return(S_db_badDbrtype);
}
/* convert database field to buffer type and place it in the buffer */
@@ -2886,7 +2885,6 @@ GET_DATA:
status=(*pconvert_routine)(paddr,pbuffer,*nRequest,
no_elements,offset);
}
if(perr_status) *perr_status = status;
return(status);
}

View File

@@ -129,6 +129,9 @@
#define MAX_STRING_SIZE 40
#endif
#ifndef MAX_UNITS_SIZE
#define MAX_UNITS_SIZE 8
#endif
/* VALUES WITH STATUS STRUCTURES */
@@ -269,7 +272,7 @@ struct dbr_time_double{
struct dbr_gr_int{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
short upper_disp_limit; /* upper limit of graph */
short lower_disp_limit; /* lower limit of graph */
short upper_alarm_limit;
@@ -281,7 +284,7 @@ struct dbr_gr_int{
struct dbr_gr_short{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
short upper_disp_limit; /* upper limit of graph */
short lower_disp_limit; /* lower limit of graph */
short upper_alarm_limit;
@@ -297,7 +300,7 @@ struct dbr_gr_float{
short severity; /* severity of alarm */
short precision; /* number of decimal places */
short RISC_pad0; /* RISC alignment */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
float upper_disp_limit; /* upper limit of graph */
float lower_disp_limit; /* lower limit of graph */
float upper_alarm_limit;
@@ -320,7 +323,7 @@ struct dbr_gr_enum{
struct dbr_gr_char{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
unsigned char upper_disp_limit; /* upper limit of graph */
unsigned char lower_disp_limit; /* lower limit of graph */
unsigned char upper_alarm_limit;
@@ -335,7 +338,7 @@ struct dbr_gr_char{
struct dbr_gr_long{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
long upper_disp_limit; /* upper limit of graph */
long lower_disp_limit; /* lower limit of graph */
long upper_alarm_limit;
@@ -351,7 +354,7 @@ struct dbr_gr_double{
short severity; /* severity of alarm */
short precision; /* number of decimal places */
short RISC_pad0; /* RISC alignment */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
double upper_disp_limit; /* upper limit of graph */
double lower_disp_limit; /* lower limit of graph */
double upper_alarm_limit;
@@ -370,7 +373,7 @@ struct dbr_gr_double{
struct dbr_ctrl_int{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
short upper_disp_limit; /* upper limit of graph */
short lower_disp_limit; /* lower limit of graph */
short upper_alarm_limit;
@@ -384,7 +387,7 @@ struct dbr_ctrl_int{
struct dbr_ctrl_short{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
short upper_disp_limit; /* upper limit of graph */
short lower_disp_limit; /* lower limit of graph */
short upper_alarm_limit;
@@ -402,7 +405,7 @@ struct dbr_ctrl_float{
short severity; /* severity of alarm */
short precision; /* number of decimal places */
short RISC_pad; /* RISC alignment */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
float upper_disp_limit; /* upper limit of graph */
float lower_disp_limit; /* lower limit of graph */
float upper_alarm_limit;
@@ -427,7 +430,7 @@ struct dbr_ctrl_enum{
struct dbr_ctrl_char{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
unsigned char upper_disp_limit; /* upper limit of graph */
unsigned char lower_disp_limit; /* lower limit of graph */
unsigned char upper_alarm_limit;
@@ -444,7 +447,7 @@ struct dbr_ctrl_char{
struct dbr_ctrl_long{
short status; /* status of value */
short severity; /* severity of alarm */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
long upper_disp_limit; /* upper limit of graph */
long lower_disp_limit; /* lower limit of graph */
long upper_alarm_limit;
@@ -462,7 +465,7 @@ struct dbr_ctrl_double{
short severity; /* severity of alarm */
short precision; /* number of decimal places */
short RISC_pad0; /* RISC alignment */
char units[8]; /* units of value */
char units[MAX_UNITS_SIZE]; /* units of value */
double upper_disp_limit; /* upper limit of graph */
double lower_disp_limit; /* lower limit of graph */
double upper_alarm_limit;
@@ -1017,7 +1020,8 @@ void *pfl;
pfl);
pold->status = new.status;
pold->severity = new.severity;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1051,7 +1055,8 @@ void *pfl;
pold->status = new.status;
pold->severity = new.severity;
pold->precision = new.precision;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1083,7 +1088,8 @@ void *pfl;
pfl);
pold->status = new.status;
pold->severity = new.severity;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1114,7 +1120,8 @@ void *pfl;
pfl);
pold->status = new.status;
pold->severity = new.severity;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1148,7 +1155,8 @@ void *pfl;
pold->status = new.status;
pold->severity = new.severity;
pold->precision = new.precision;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1182,7 +1190,8 @@ void *pfl;
pfl);
pold->status = new.status;
pold->severity = new.severity;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1219,7 +1228,8 @@ void *pfl;
pold->status = new.status;
pold->severity = new.severity;
pold->precision = new.precision;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1286,7 +1296,8 @@ void *pfl;
pfl);
pold->status = new.status;
pold->severity = new.severity;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1320,7 +1331,8 @@ void *pfl;
status = dbGetField(paddr,DBR_LONG,&new,&options,&nRequest,pfl);
pold->status = new.status;
pold->severity = new.severity;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;
@@ -1357,7 +1369,8 @@ void *pfl;
pold->status = new.status;
pold->severity = new.severity;
pold->precision = new.precision;
strncpy(pold->units,new.units,8);
strncpy(pold->units,new.units,MAX_UNITS_SIZE);
pold->units[MAX_UNITS_SIZE-1] = '\0';
pold->upper_disp_limit = new.upper_disp_limit;
pold->lower_disp_limit = new.lower_disp_limit;
pold->upper_alarm_limit = new.upper_alarm_limit;

View File

@@ -65,6 +65,9 @@
* This driver currently needs work on error message generation.
*
* $Log$
* Revision 1.1 1995/03/30 19:34:56 jba
* Seperated drv files into ansi and old dirs. Added combine dir.
*
* Revision 1.37 1995/03/24 21:24:25 winans
* Probable race condition in PEP TX task. Moved the final transmission
* byte assignment into the point where the busy list is locked. This
@@ -2532,6 +2535,11 @@ STATIC int pepTxTask(int link)
if (bbDebug)
printf("pepTxTask(%d): RAC_RESET_SLAVE sent\n", link);
pBBLink[link]->l.PepLink.bbRegs->stat_ctl = *txMsg;
if (bbDebug>30)
printf("pepTxTask(%d): outputting last byte %2.2X\n",
link,*txMsg);
pnode->status = BB_OK;
if (pnode->finishProc != NULL) {

View File

@@ -7,6 +7,9 @@
# Experimental Physics and Industrial Control System (EPICS)
#
# $Log$
# Revision 1.1 1995/08/17 20:22:09 jba
# Moved bldEnvData,blderrSymTbl, makeStatTbl to libCom dir
#
# Revision 1.3 1995/08/14 19:27:24 jhill
# extern => epicsShareExtern
#
@@ -34,7 +37,7 @@ TOOL=`basename $0`
# Start by creating a list of the ENV_PARAM declarations
PARAMS=`sed -n -e 's/;//' \
-e 's/^[ ]*epicsShareExtern[ ][ ]*ENV_PARAM[ ][ ]*//p' \
-e 's/^[ ]*epicsShareExtern[ ][ ]*ENV_PARAM[ ][ ]*//p' \
${SRC}`
# Create a new header file
@@ -85,7 +88,7 @@ done
# Now create an array pointing to all parameters
cat >>${OBJ} <<!EOF
ENV_PARAM* env_param_list[] = {
ENV_PARAM* env_param_list[EPICS_ENV_VARIABLE_COUNT+1] = {
!EOF
# Contents are the addresses of each parameter

View File

@@ -53,7 +53,7 @@ HOST_ARCH=$2
MAKE=$3
case $HOST_ARCH in
alpha | hp700)
alpha | hp700 | Linux)
# Use gcc if it can be found, or makedepend
GCC=`which gcc`

View File

@@ -73,6 +73,7 @@
#else
# include <sys/types.h>
# include <netinet/in.h>
# include <arpa/inet.h>
#endif
#ifdef vxWorks
@@ -84,10 +85,6 @@
#include <envDefs.h>
#include <errMdef.h>
/*
* for VMS
*/
unsigned long inet_addr (char *);
/*+/subr**********************************************************************

View File

@@ -73,6 +73,7 @@
#else
# include <sys/types.h>
# include <netinet/in.h>
# include <arpa/inet.h>
#endif
#ifdef vxWorks
@@ -84,10 +85,6 @@
#include <envDefs.h>
#include <errMdef.h>
/*
* for VMS
*/
unsigned long inet_addr (char *);
/*+/subr**********************************************************************

View File

@@ -51,6 +51,7 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
* .01 04-07-94 mrk Initial Implementation
*/
#include <stdio.h>
#ifdef vxWorks
#include <vxWorks.h>
#endif

View File

@@ -51,6 +51,7 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
* .01 04-07-94 mrk Initial Implementation
*/
#include <stdio.h>
#ifdef vxWorks
#include <vxWorks.h>
#endif

View File

@@ -257,7 +257,7 @@ static long get_units(paddr,units)
{
struct aaiRecord *paai=(struct aaiRecord *)paddr->precord;
strncpy(units,paai->egu,sizeof(paai->egu));
strncpy(units,paai->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -254,7 +254,7 @@ static long get_units(paddr,units)
{
struct aaoRecord *paao=(struct aaoRecord *)paddr->precord;
strncpy(units,paao->egu,sizeof(paao->egu));
strncpy(units,paao->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -280,7 +280,7 @@ static long get_units(paddr,units)
{
struct aiRecord *pai=(struct aiRecord *)paddr->precord;
strncpy(units,pai->egu,sizeof(pai->egu));
strncpy(units,pai->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -334,7 +334,7 @@ static long get_units(paddr,units)
{
struct aoRecord *pao=(struct aoRecord *)paddr->precord;
strncpy(units,pao->egu,sizeof(pao->egu));
strncpy(units,pao->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -237,7 +237,7 @@ static long get_units(paddr,units)
{
struct calcRecord *pcalc=(struct calcRecord *)paddr->precord;
strncpy(units,pcalc->egu,sizeof(pcalc->egu));
strncpy(units,pcalc->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -274,7 +274,7 @@ static long get_units(paddr,units)
{
struct compressRecord *pcompress=(struct compressRecord *)paddr->precord;
strncpy(units,pcompress->egu,sizeof(pcompress->egu));
strncpy(units,pcompress->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -161,7 +161,7 @@ static long get_units(paddr,units)
{
struct dfanoutRecord *pdfanout=(struct dfanoutRecord *)paddr->precord;
strncpy(units,pdfanout->egu,sizeof(pdfanout->egu));
strncpy(units,pdfanout->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -201,7 +201,7 @@ static long get_units(paddr,units)
{
struct gsubRecord *psub=(struct gsubRecord *)paddr->precord;
strncpy(units,psub->egu,sizeof(psub->egu));
strncpy(units,psub->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -203,7 +203,7 @@ static long get_units(paddr,units)
{
struct longinRecord *plongin=(struct longinRecord *)paddr->precord;
strncpy(units,plongin->egu,sizeof(plongin->egu));
strncpy(units,plongin->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -241,7 +241,7 @@ static long get_units(paddr,units)
{
struct longoutRecord *plongout=(struct longoutRecord *)paddr->precord;
strncpy(units,plongout->egu,sizeof(plongout->egu));
strncpy(units,plongout->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -173,7 +173,7 @@ static long get_units(paddr,units)
{
struct palRecord *ppal=(struct palRecord *)paddr->precord;
strncpy(units,ppal->egu,sizeof(ppal->egu));
strncpy(units,ppal->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -177,7 +177,7 @@ static long get_units(paddr,units)
{
struct pidRecord *ppid=(struct pidRecord *)paddr->precord;
strncpy(units,ppid->egu,sizeof(ppid->egu));
strncpy(units,ppid->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -199,7 +199,7 @@ static long get_units(paddr,units)
{
struct selRecord *psel=(struct selRecord *)paddr->precord;
strncpy(units,psel->egu,sizeof(psel->egu));
strncpy(units,psel->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -295,7 +295,7 @@ static long get_units(paddr,units)
{
struct steppermotorRecord *psm=(struct steppermotorRecord *)paddr->precord;
strncpy(units,psm->egu,sizeof(psm->egu));
strncpy(units,psm->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -219,7 +219,7 @@ static long get_units(paddr,units)
{
struct subRecord *psub=(struct subRecord *)paddr->precord;
strncpy(units,psub->egu,sizeof(psub->egu));
strncpy(units,psub->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -248,7 +248,7 @@ static long get_units(paddr,units)
{
struct subArrayRecord *psa=(struct subArrayRecord *)paddr->precord;
strncpy(units,psa->egu,sizeof(psa->egu));
strncpy(units,psa->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -303,7 +303,7 @@ static long get_units(paddr,units)
{
struct waveformRecord *pwf=(struct waveformRecord *)paddr->precord;
strncpy(units,pwf->egu,sizeof(pwf->egu));
strncpy(units,pwf->egu,DB_UNITS_SIZE);
return(0);
}

View File

@@ -1580,7 +1580,7 @@ struct client *client
int status;
unsigned sid;
unsigned long count;
int type;
ca_uint16_t type;
/* Exit quickly if channel not on this node */
status = db_name_to_addr(
@@ -1643,7 +1643,7 @@ struct client *client
}
sid = pchannel->sid;
count = tmp_addr.no_elements;
type = tmp_addr.field_type;
type = (ca_uint16_t) tmp_addr.field_type;
}
SEND_LOCK(client);

View File

@@ -100,7 +100,7 @@ int cast_server(void)
struct sockaddr_in new_recv_addr;
int recv_addr_size;
unsigned nchars;
short port;
unsigned short port;
taskwdInsert((int)taskIdCurrent,NULL,NULL);

View File

@@ -80,7 +80,7 @@ int rsrv_online_notify_task()
int status;
int sock;
int true = TRUE;
short port;
unsigned short port;
taskwdInsert(taskIdSelf(),NULL,NULL);

View File

@@ -174,7 +174,7 @@ char get; /* T: get F: monitor */
GLBLTYPE int CASDEBUG;
GLBLTYPE int IOC_sock;
GLBLTYPE int IOC_cast_sock;
GLBLTYPE int ca_server_port;
GLBLTYPE unsigned short ca_server_port;
GLBLTYPE ELLLIST clientQ; /* locked by clientQlock */
GLBLTYPE ELLLIST rsrv_free_clientQ; /* locked by clientQlock */
GLBLTYPE ELLLIST rsrv_free_addrq;

View File

@@ -82,7 +82,7 @@ Expr *ssp; /* Parent state set */
printf("\n/* Action function for state \"%s\" in state set \"%s\" */\n",
sp->value, ssp->value);
/* action function declaration with ss_ptr as parameter */
printf("static A_%s_%s(sprog, ss_ptr, var_ptr)\n", ssp->value, sp->value);
printf("static void A_%s_%s(sprog, ss_ptr, var_ptr)\n", ssp->value, sp->value);
printf("SPROG\t*sprog;\n");
printf("SSCB\t*ss_ptr;\n");
printf("struct UserVar\t*var_ptr;\n{\n");
@@ -122,7 +122,7 @@ Expr *ssp;
printf("\n/* Event function for state \"%s\" in state set \"%s\" */\n",
sp->value, ssp->value);
printf("static E_%s_%s(sprog, ss_ptr, var_ptr)\n", ssp->value, sp->value);
printf("static int E_%s_%s(sprog, ss_ptr, var_ptr)\n", ssp->value, sp->value);
printf("SPROG\t*sprog;\n");
printf("SSCB\t*ss_ptr;\n");
printf("struct UserVar\t*var_ptr;\n{\n");
@@ -184,7 +184,7 @@ Expr *ssp;
printf("\n/* Delay function for state \"%s\" in state set \"%s\" */\n",
sp->value, ssp->value);
printf("static D_%s_%s(sprog, ss_ptr, var_ptr)\n", ssp->value, sp->value);
printf("static void D_%s_%s(sprog, ss_ptr, var_ptr)\n", ssp->value, sp->value);
printf("SPROG\t*sprog;\n");
printf("SSCB\t*ss_ptr;\n");
printf("struct UserVar\t*var_ptr;\n{\n");
@@ -507,7 +507,7 @@ gen_exit_handler()
Expr *ep;
printf("/* Exit handler */\n");
printf("static exit_handler(sprog, var_ptr)\n");
printf("static void exit_handler(sprog, var_ptr)\n");
printf("SPROG\t*sprog;\n");
printf("struct UserVar\t*var_ptr;\n{\n");
for (ep = exit_code_list; ep != 0; ep = ep->next)