From 87c032e8ef2e9aa7e1ceb62a28be5ae8c3a5cbac Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Mon, 26 Jul 1993 16:35:16 +0000 Subject: [PATCH] changed from dll to ell --- src/ca/access.c | 64 +++++++++++----------- src/ca/iocinf.h | 18 +++---- src/ca/repeater.c | 12 ++--- src/ca/service.c | 30 +++++------ src/db/dbEvent.c | 10 ++-- src/db/dbScan.c | 60 ++++++++++----------- src/db/dbStaticLib.c | 112 +++++++++++++++++++-------------------- src/db/dbTest.c | 10 ++-- src/db/iocInit.c | 30 +++++------ src/db/taskwd.c | 36 ++++++------- src/drv/drvGpib.c | 22 ++++---- src/libCom/fdmgr.c | 46 ++++++++-------- src/sequencer/seq_prog.c | 14 ++--- 13 files changed, 232 insertions(+), 232 deletions(-) diff --git a/src/ca/access.c b/src/ca/access.c index b15ebbb6f..5a77017ab 100644 --- a/src/ca/access.c +++ b/src/ca/access.c @@ -768,7 +768,7 @@ ca_process_exit() # ifdef vxWorks chix = (chid) & ca_temp->ca_local_chidlist; while (chix = (chid) chix->node.next){ - while (monix = (evid) dllGet(&chix->eventq)) { + while (monix = (evid) ellGet(&chix->eventq)) { status = db_cancel_event(monix + 1); if (status == ERROR) abort(); @@ -790,7 +790,7 @@ ca_process_exit() "could not close event facility by id"); } - dllFree(&ca_temp->ca_lcl_buff_list); + ellFree(&ca_temp->ca_lcl_buff_list); # endif /* @@ -814,8 +814,8 @@ ca_process_exit() * remove remote chid blocks and event blocks */ for (i = 0; i < ca_temp->ca_nxtiiu; i++) { - while (chix = (chid) dllGet(&ca_temp->ca_iiu[i].chidlist)) { - while (monix = (evid) dllGet(&chix->eventq)) { + while (chix = (chid) ellGet(&ca_temp->ca_iiu[i].chidlist)) { + while (monix = (evid) ellGet(&chix->eventq)) { free((char *)monix); } free((char *)chix); @@ -826,15 +826,15 @@ ca_process_exit() * remove local chid blocks, paddr blocks, waiting ev blocks */ # ifdef vxWorks - while (chix = (chid) dllGet(&ca_temp->ca_local_chidlist)) + while (chix = (chid) ellGet(&ca_temp->ca_local_chidlist)) free((char *)chix); - dllFree(&ca_temp->ca_dbfree_ev_list); + ellFree(&ca_temp->ca_dbfree_ev_list); # endif /* remove remote waiting ev blocks */ - dllFree(&ca_temp->ca_free_event_list); + ellFree(&ca_temp->ca_free_event_list); /* remove any pending read blocks */ - dllFree(&ca_temp->ca_pend_read_list); + ellFree(&ca_temp->ca_pend_read_list); /* * force this macro to use ca_temp @@ -977,7 +977,7 @@ int ca_build_and_connect chix->paddr)->no_elements; chix->iocix = LOCAL_IIU; chix->state = cs_conn; - dllInit(&chix->eventq); + ellInit(&chix->eventq); strncpy(chix + 1, name_str, strcnt); /* check for just a search */ @@ -995,7 +995,7 @@ int ca_build_and_connect } } LOCK; - dllAdd(&local_chidlist, chix); + ellAdd(&local_chidlist, chix); UNLOCK; if (chix->connection_func) { @@ -1044,12 +1044,12 @@ int ca_build_and_connect chix->build_value = (void *) pvalue; chix->name_length = strcnt; chix->state = cs_never_conn; - dllInit(&chix->eventq); + ellInit(&chix->eventq); /* Save this channels name for retry if required */ strncpy(chix + 1, name_str, strcnt); - dllAdd(&iiu[BROADCAST_IIU].chidlist, (DLLNODE *)chix); + ellAdd(&iiu[BROADCAST_IIU].chidlist, (ELLNODE *)chix); /* * set the conn tries back to zero so this channel's location * can be found @@ -1273,7 +1273,7 @@ int ca_array_get_callback #endif LOCK; - if (!(monix = (evid) dllGet(&free_event_list))) + if (!(monix = (evid) ellGet(&free_event_list))) monix = (evid) malloc(sizeof *monix); if (monix) { @@ -1284,7 +1284,7 @@ int ca_array_get_callback monix->type = type; monix->count = count; - dllAdd(&pend_read_list, (DLLNODE *)monix); + ellAdd(&pend_read_list, (ELLNODE *)monix); issue_get_callback(monix); @@ -1627,7 +1627,7 @@ void *astarg; return ECA_ALLOCMEM; pioe->io_done_arg = astarg; pioe->io_done_sub = ast; - dllAdd(&ioeventlist,(DLLNODE *)pioe); + ellAdd(&ioeventlist,(ELLNODE *)pioe); UNLOCK; } @@ -1697,15 +1697,15 @@ unsigned mask; dbevsize = db_sizeof_event_block(); - if(!(monix = (evid)dllGet(&dbfree_ev_list))) + if(!(monix = (evid)ellGet(&dbfree_ev_list))) monix = (evid)malloc(sizeof(*monix)+dbevsize); } else - if(!(monix = (evid)dllGet(&free_event_list))) + if(!(monix = (evid)ellGet(&free_event_list))) monix = (evid)malloc(sizeof *monix); } # else - if(!(monix = (evid)dllGet(&free_event_list))) + if(!(monix = (evid)ellGet(&free_event_list))) monix = (evid) malloc(sizeof *monix); # endif @@ -1750,7 +1750,7 @@ unsigned mask; is no chance that it will be deleted at exit before it is completely created */ - dllAdd(&chix->eventq, monix); + ellAdd(&chix->eventq, monix); /* force event to be called at least once @@ -1771,7 +1771,7 @@ unsigned mask; /* It can be added to the list any place if it is remote */ /* Place in the channel list */ - dllAdd(&chix->eventq, (DLLNODE *)monix); + ellAdd(&chix->eventq, (ELLNODE *)monix); ca_request_event(monix); @@ -1867,7 +1867,7 @@ void *pfl; void *pval; register unsigned size; struct tmp_buff{ - DLLNODE node; + ELLNODE node; unsigned size; }; struct tmp_buff *pbuf = NULL; @@ -1906,7 +1906,7 @@ void *pfl; pbuf = (struct tmp_buff *) lcl_buff_list.node.next; if(pbuf->size >= size){ - dllDelete( + ellDelete( &lcl_buff_list, pbuf); }else @@ -1986,7 +1986,7 @@ void *pfl; if(ptbuf) ptbuf = (struct tmp_buff *) ptbuf->node.previous; - dllInsert( + ellInsert( &lcl_buff_list, ptbuf, pbuf); @@ -2038,16 +2038,16 @@ ca_clear_event * dont allow two threads to delete the same moniitor at once */ LOCK; - status = dllFind(&chix->eventq, monix); + status = ellFind(&chix->eventq, monix); if (status != ERROR) { - dllDelete(&chix->eventq, monix); + ellDelete(&chix->eventq, monix); status = db_cancel_event(monix + 1); } UNLOCK; if (status == ERROR) return ECA_BADMONID; - dllAdd(&dbfree_ev_list, monix); + ellAdd(&dbfree_ev_list, monix); return ECA_NORMAL; } @@ -2091,7 +2091,7 @@ ca_clear_event piiu->outstanding_ack_count++; } else{ - dllDelete(&monix->chan->eventq, (DLLNODE *)monix); + ellDelete(&monix->chan->eventq, (ELLNODE *)monix); } UNLOCK; @@ -2155,17 +2155,17 @@ ca_clear_channel /* * clear out the events for this channel */ - while (monix = (evid) dllGet(&chix->eventq)) { + while (monix = (evid) ellGet(&chix->eventq)) { status = db_cancel_event(monix + 1); if (status == ERROR) abort(); - dllAdd(&dbfree_ev_list, monix); + ellAdd(&dbfree_ev_list, monix); } /* * clear out this channel */ - dllDelete(&local_chidlist, chix); + ellDelete(&local_chidlist, chix); free((char *) chix); break; /* to unlock exit */ @@ -2179,8 +2179,8 @@ ca_clear_channel * check for conn state while locked to avoid a race */ if(old_chan_state != cs_conn){ - dllConcat(&free_event_list, &chix->eventq); - dllDelete(&piiu->chidlist, (DLLNODE *)chix); + ellConcat(&free_event_list, &chix->eventq); + ellDelete(&piiu->chidlist, (ELLNODE *)chix); if (chix->iocix != BROADCAST_IIU && !piiu->chidlist.count){ close_ioc(piiu); diff --git a/src/ca/iocinf.h b/src/ca/iocinf.h index fda0f0b3f..ea71ef246 100644 --- a/src/ca/iocinf.h +++ b/src/ca/iocinf.h @@ -78,7 +78,7 @@ static char *iocinfhSccsId = "$Id$\t$Date$"; # endif #endif -# include +# include #ifndef INCos_depenh # include @@ -116,7 +116,7 @@ struct buffer{ #define BROADCAST_IIU 0 struct pending_io_event{ - DLLNODE node; + ELLNODE node; void (*io_done_sub)(); void *io_done_arg; }; @@ -177,7 +177,7 @@ typedef unsigned long ca_time; struct ca_static{ unsigned short ca_nxtiiu; long ca_pndrecvcnt; - DLLLIST ca_ioeventlist; + ELLLIST ca_ioeventlist; void (*ca_exception_func)(); void *ca_exception_arg; void (*ca_connection_func)(); @@ -186,8 +186,8 @@ struct ca_static{ void *ca_fd_register_arg; short ca_exit_in_progress; unsigned short ca_post_msg_active; - DLLLIST ca_free_event_list; - DLLLIST ca_pend_read_list; + ELLLIST ca_free_event_list; + ELLLIST ca_pend_read_list; short ca_repeater_contacted; unsigned short ca_send_msg_active; short ca_cast_available; @@ -208,9 +208,9 @@ struct ca_static{ FAST_LOCK ca_client_lock; FAST_LOCK ca_event_lock; /* dont allow events to preempt */ int ca_tid; - DLLLIST ca_local_chidlist; - DLLLIST ca_dbfree_ev_list; - DLLLIST ca_lcl_buff_list; + ELLLIST ca_local_chidlist; + ELLLIST ca_dbfree_ev_list; + ELLLIST ca_lcl_buff_list; int ca_event_tid; unsigned ca_local_ticks; # else @@ -233,7 +233,7 @@ struct ca_static{ struct buffer *recv; unsigned read_seq; unsigned cur_read_seq; - DLLLIST chidlist; /* chans on this connection */ + ELLLIST chidlist; /* chans on this connection */ short conn_up; /* boolean: T-conn /F-disconn */ short send_needed; /* CA needs a send */ char host_name_str[32]; diff --git a/src/ca/repeater.c b/src/ca/repeater.c index e6dd759e0..6b6a990df 100644 --- a/src/ca/repeater.c +++ b/src/ca/repeater.c @@ -86,7 +86,7 @@ static char *sccsId = "$Id$\t$Date$"; # endif #endif -#include +#include #include #include @@ -95,12 +95,12 @@ static char *sccsId = "$Id$\t$Date$"; * per machine so we dont care about reentrancy */ struct one_client{ - DLLNODE node; + ELLNODE node; struct sockaddr_in from; }; static -DLLLIST client_list; +ELLLIST client_list; static char buf[MAX_UDP]; @@ -176,7 +176,7 @@ ca_repeater() struct one_client *pclient; struct one_client *pnxtclient; - dllInit(&client_list); + ellInit(&client_list); /* allocate a socket */ sock = socket( AF_INET, /* domain */ @@ -274,7 +274,7 @@ ca_repeater() malloc(sizeof *pclient); if(pclient){ pclient->from = from; - dllAdd(&client_list, (DLLNODE *)pclient); + ellAdd(&client_list, (ELLNODE *)pclient); #ifdef DEBUG ca_printf("Added %x %d\n", from.sin_port, size); #endif @@ -356,7 +356,7 @@ struct one_client *pclient; socket_close(sock); if(!present){ - dllDelete(&client_list, (DLLNODE *)pclient); + ellDelete(&client_list, (ELLNODE *)pclient); free(pclient); #ifdef DEBUG ca_printf("Deleted\n"); diff --git a/src/ca/service.c b/src/ca/service.c index 19293545f..52fc283f2 100644 --- a/src/ca/service.c +++ b/src/ca/service.c @@ -204,8 +204,8 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu) UNLOCKEVENTS; } LOCK; - dllDelete(&pend_read_list, (DLLNODE *)monix); - dllAdd(&free_event_list, (DLLNODE *)monix); + ellDelete(&pend_read_list, (ELLNODE *)monix); + ellAdd(&free_event_list, (ELLNODE *)monix); UNLOCK; piiu->outstanding_ack_count--; @@ -229,8 +229,8 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu) */ if (!t_postsize) { LOCK; - dllDelete(&monix->chan->eventq, (DLLNODE *)monix); - dllAdd(&free_event_list, (DLLNODE *)monix); + ellDelete(&monix->chan->eventq, (ELLNODE *)monix); + ellAdd(&free_event_list, (ELLNODE *)monix); UNLOCK; piiu->outstanding_ack_count--; @@ -442,8 +442,8 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu) struct ioc_in_use *piiu = &iiu[chix->iocix]; LOCK; - dllDelete(&piiu->chidlist, (DLLNODE *)chix); - dllAdd(&iiu[BROADCAST_IIU].chidlist, (DLLNODE *)chix); + ellDelete(&piiu->chidlist, (ELLNODE *)chix); + ellAdd(&iiu[BROADCAST_IIU].chidlist, (ELLNODE *)chix); chix->iocix = BROADCAST_IIU; if (!piiu->chidlist.count) close_ioc(piiu); @@ -475,11 +475,11 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu) monix; monix = (evid) monix->node.next) if (monix->chan == chix) { - dllDelete(&pend_read_list, (DLLNODE *)monix); - dllAdd(&free_event_list, (DLLNODE *)monix); + ellDelete(&pend_read_list, (ELLNODE *)monix); + ellAdd(&free_event_list, (ELLNODE *)monix); } - dllConcat(&free_event_list, &chix->eventq); - dllDelete(&piiu->chidlist, (DLLNODE *)chix); + ellConcat(&free_event_list, &chix->eventq); + ellDelete(&piiu->chidlist, (ELLNODE *)chix); free(chix); piiu->outstanding_ack_count--; if (!piiu->chidlist.count) @@ -629,9 +629,9 @@ struct in_addr *pnet_addr; if(chan->iocix != BROADCAST_IIU) ca_signal(ECA_NEWADDR, (char *)(chan+1)); chpiiu = &iiu[chan->iocix]; - dllDelete(&chpiiu->chidlist, (DLLNODE *)chan); + ellDelete(&chpiiu->chidlist, (ELLNODE *)chan); chan->iocix = newiocix; - dllAdd(&iiu[newiocix].chidlist, (DLLNODE *)chan); + ellAdd(&iiu[newiocix].chidlist, (ELLNODE *)chan); } /* @@ -712,7 +712,7 @@ int lock; LOCK; } - while(pioe = (struct pending_io_event *) dllGet(&ioeventlist)){ + while(pioe = (struct pending_io_event *) ellGet(&ioeventlist)){ (*pioe->io_done_sub)(pioe->io_done_arg); free(pioe); } @@ -744,9 +744,9 @@ client_channel_exists(chan) for (piiu = iiu; piiu < pnext_iiu; piiu++) { /* - * dllFind returns the node number or ERROR + * ellFind returns the node number or ERROR */ - status = dllFind(&piiu->chidlist, (DLLNODE *)chan); + status = ellFind(&piiu->chidlist, (ELLNODE *)chan); if (status != ERROR) { return TRUE; } diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index 19e4ffd8e..b1d355de0 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -62,7 +62,7 @@ #include #include #include -#include +#include #include #include @@ -119,7 +119,7 @@ typedef struct{ #define abort taskSuspend; struct event_block{ - DLLNODE node; + ELLNODE node; struct db_addr *paddr; void (*user_sub)(); void *user_arg; @@ -403,7 +403,7 @@ register struct event_block *pevent; /* ptr to event blk (not required) */ pevent->valque = FALSE; LOCKREC(precord); - dllAdd((DLLLIST*)&precord->mlis, (DLLNODE*)pevent); + ellAdd((ELLLIST*)&precord->mlis, (ELLNODE*)pevent); UNLOCKREC(precord); return OK; @@ -434,9 +434,9 @@ register struct event_block *pevent; LOCKREC(precord); /* dont let a misplaced event corrupt the queue */ - status = dllFind((DLLLIST*)&precord->mlis, (DLLNODE*)pevent); + status = ellFind((ELLLIST*)&precord->mlis, (ELLNODE*)pevent); if(status!=ERROR) - dllDelete((DLLLIST*)&precord->mlis, (DLLNODE*)pevent); + ellDelete((ELLLIST*)&precord->mlis, (ELLNODE*)pevent); UNLOCKREC(precord); if(status == ERROR) return ERROR; diff --git a/src/db/dbScan.c b/src/db/dbScan.c index 49d89bf32..4b240b5af 100644 --- a/src/db/dbScan.c +++ b/src/db/dbScan.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include @@ -67,13 +67,13 @@ extern volatile int interruptAccept; struct scan_list{ FAST_LOCK lock; - DLLLIST list; + ELLLIST list; short modified;/*has list been modified?*/ long ticks; /*ticks per period for periodic*/ }; /*scan_elements are allocated and the address stored in dbCommon.spvt*/ struct scan_element{ - DLLNODE node; + ELLNODE node; struct scan_list *pscan_list; struct dbCommon *precord; }; @@ -177,7 +177,7 @@ void scanAdd(struct dbCommon *precord) psl = dbCalloc(1,sizeof(struct scan_list)); papEvent[precord->evnt] = psl; FASTLOCKINIT(&psl->lock); - dllInit(&psl->list); + ellInit(&psl->list); } addToList(precord,psl); } else if(scan==SCAN_IO_EVENT) { @@ -338,7 +338,7 @@ void scanIoInit(IOSCANPVT *ppioscanpvt) prioritycallback.callback = ioeventCallback; piosl->callback.priority = priority; - dllInit(&piosl->scan_list.list); + ellInit(&piosl->scan_list.list); FASTLOCKINIT(&piosl->scan_list.lock); piosl->next=iosl_head[priority]; iosl_head[priority]=piosl; @@ -355,7 +355,7 @@ void scanIoRequest(IOSCANPVT pioscanpvt) if(!interruptAccept) return; for(priority=0, piosl=pioscanpvt; priorityscan_list.list)>0) callbackRequest((void *)piosl); + if(ellCount(&piosl->scan_list.list)>0) callbackRequest((void *)piosl); } } @@ -401,8 +401,8 @@ static void initPeriodic() /* look for first record */ for (i=0; inumber; i++) { if((precLoc=precHeader->papRecLoc[i])==NULL) continue; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; if(precord->name[0]!=0) goto got_record; } @@ -432,7 +432,7 @@ got_record: psl = dbCalloc(1,sizeof(struct scan_list)); papPeriodic[i] = psl; FASTLOCKINIT(&psl->lock); - dllInit(&psl->list); + ellInit(&psl->list); sscanf(scanChoices.strs[i+SCAN_1ST_PERIODIC],"%f",&temp); psl->ticks = temp * vxTicksPerSecond; } @@ -537,7 +537,7 @@ static void printList(struct scan_list *psl,char *message) struct scan_element *pse; FASTLOCK(&psl->lock); - (void *)pse = dllFirst(&psl->list); + (void *)pse = ellFirst(&psl->list); FASTUNLOCK(&psl->lock); if(pse==NULL) return; printf("%s\n",message); @@ -549,7 +549,7 @@ static void printList(struct scan_list *psl,char *message) printf("Returning because list changed while processing."); return; } - (void *)pse = dllNext((void *)pse); + (void *)pse = ellNext((void *)pse); FASTUNLOCK(&psl->lock); } } @@ -563,9 +563,9 @@ static void scanList(struct scan_list *psl) FASTLOCK(&psl->lock); psl->modified = FALSE; - (void *)pse = dllFirst(&psl->list); + (void *)pse = ellFirst(&psl->list); prev = NULL; - (void *)next = dllNext((void *)pse); + (void *)next = ellNext((void *)pse); FASTUNLOCK(&psl->lock); while(pse!=NULL) { struct dbCommon *precord = pse->precord; @@ -576,27 +576,27 @@ static void scanList(struct scan_list *psl) FASTLOCK(&psl->lock); if(!psl->modified) { prev = pse; - (void *)pse = dllNext((void *)pse); - if(pse!=NULL) (void *)next = dllNext((void *)pse); + (void *)pse = ellNext((void *)pse); + if(pse!=NULL) (void *)next = ellNext((void *)pse); } else if (pse->pscan_list==psl) { /*This scan element is still in same scan list*/ prev = pse; - (void *)pse = dllNext((void *)pse); - if(pse!=NULL) (void *)next = dllNext((void *)pse); + (void *)pse = ellNext((void *)pse); + if(pse!=NULL) (void *)next = ellNext((void *)pse); psl->modified = FALSE; } else if (prev!=NULL && prev->pscan_list==psl) { /*Previous scan element is still in same scan list*/ - (void *)pse = dllNext((void *)prev); + (void *)pse = ellNext((void *)prev); if(pse!=NULL) { - (void *)prev = dllPrevious((void *)pse); - (void *)next = dllNext((void *)pse); + (void *)prev = ellPrevious((void *)pse); + (void *)next = ellNext((void *)pse); } psl->modified = FALSE; } else if (next!=NULL && next->pscan_list==psl) { /*Next scan element is still in same scan list*/ pse = next; - (void *)prev = dllPrevious((void *)pse); - (void *)next = dllNext((void *)pse); + (void *)prev = ellPrevious((void *)pse); + (void *)next = ellNext((void *)pse); psl->modified = FALSE; } else { /*Too many changes. Just wait till next period*/ @@ -623,8 +623,8 @@ static void buildScanLists(void) /* look through all of the database records and place them on lists */ for (i=0; inumber; i++) { if((precLoc=precHeader->papRecLoc[i])==NULL) continue; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; if(precord->name[0]==0) continue; scanAdd(precord); @@ -644,16 +644,16 @@ static void addToList(struct dbCommon *precord,struct scan_list *psl) (void *)pse->precord = precord; } pse ->pscan_list = psl; - (void *)ptemp = dllFirst(&psl->list); + (void *)ptemp = ellFirst(&psl->list); while(ptemp!=NULL) { if(ptemp->precord->phas>precord->phas) { - dllInsert(&psl->list, - dllPrevious((void *)ptemp),(void *)pse); + ellInsert(&psl->list, + ellPrevious((void *)ptemp),(void *)pse); break; } - (void *)ptemp = dllNext((void *)ptemp); + (void *)ptemp = ellNext((void *)ptemp); } - if(ptemp==NULL) dllAdd(&psl->list,(void *)pse); + if(ptemp==NULL) ellAdd(&psl->list,(void *)pse); psl->modified = TRUE; FASTUNLOCK(&psl->lock); return; @@ -675,7 +675,7 @@ static void deleteFromList(struct dbCommon *precord,struct scan_list *psl) return; } pse->pscan_list = NULL; - dllDelete(&psl->list,(void *)pse); + ellDelete(&psl->list,(void *)pse); psl->modified = TRUE; FASTUNLOCK(&psl->lock); return; diff --git a/src/db/dbStaticLib.c b/src/db/dbStaticLib.c index c80aeb120..7df529326 100644 --- a/src/db/dbStaticLib.c +++ b/src/db/dbStaticLib.c @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include @@ -389,13 +389,13 @@ void dbFreeBase(pdbbase) DBBASE *pdbbase; #endif /*__STDC__*/ { - DLLLIST **ppvd = (DLLLIST **) pdbbase->ppvd; + ELLLIST **ppvd = (ELLLIST **) pdbbase->ppvd; struct recType *precType = (struct recType *) pdbbase->precType; struct recLoc *precLoc; struct recHeader *precHeader = (struct recHeader *) pdbbase->precHeader; RECNODE *precnode; RECNODE *pnext; - DLLLIST *preclist; + ELLLIST *preclist; int recType; if (!pdbbase || !ppvd || !precType) return; dbPvdFreeMem(pdbbase); @@ -407,11 +407,11 @@ DBBASE *pdbbase; free((void *) precLoc); continue; } - precnode = (RECNODE *) dllFirst(preclist); + precnode = (RECNODE *) ellFirst(preclist); while(precnode) { - pnext = (RECNODE *) dllNext((DLLNODE *) precnode); + pnext = (RECNODE *) ellNext((ELLNODE *) precnode); free(precnode->precord); - dllDelete(preclist, (DLLNODE*)precnode); + ellDelete(preclist, (ELLNODE*)precnode); dbPvdDelete(pdbbase,precnode); free((void *)precnode); precnode = pnext; @@ -687,7 +687,7 @@ char *precordName; DBBASE *pdbbase = pdbentry->pdbbase; int record_type = pdbentry->record_type; PVDENTRY *ppvd; - DLLLIST *preclist = NULL; + ELLLIST *preclist = NULL; RECNODE *precnode = NULL; RECNODE *pNewRecNode = NULL; void *pNewRecord = NULL; @@ -707,8 +707,8 @@ char *precordName; precLoc = precHeader->papRecLoc[record_type]; if ((precLoc->preclist) == NULL) { /* allocate new list for this record type */ - precLoc->preclist = dbCalloc(1,sizeof(DLLLIST)); - dllInit(precLoc->preclist); + precLoc->preclist = dbCalloc(1,sizeof(ELLLIST)); + ellInit(precLoc->preclist); } preclist = precLoc->preclist; rec_size = precTypDes->rec_size; @@ -721,13 +721,13 @@ char *precordName; init_record(pdbbase, pNewRecord, record_type); pNewRecNode->precord = pNewRecord; /* install record node in list in sorted postion */ - precnode = (RECNODE *)dllFirst(preclist); + precnode = (RECNODE *)ellFirst(preclist); while(precnode && strcmp(precordName,(char*)precnode->precord) > 0) - precnode = (RECNODE *)dllNext((DLLNODE*)precnode); + precnode = (RECNODE *)ellNext((ELLNODE*)precnode); if(precnode) - dllInsert(preclist, dllPrevious((DLLNODE*)precnode) ,(DLLNODE *)pNewRecNode); + ellInsert(preclist, ellPrevious((ELLNODE*)precnode) ,(ELLNODE *)pNewRecNode); else - dllAdd(preclist, (DLLNODE*)pNewRecNode); + ellAdd(preclist, (ELLNODE*)pNewRecNode); ppvd = dbPvdAdd(pdbbase,record_type,pNewRecNode); if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);} pdbentry->precnode = pNewRecNode; @@ -745,13 +745,13 @@ DBENTRY *pdbentry; DBBASE *pdbbase = pdbentry->pdbbase; int record_type = pdbentry->record_type; RECNODE *precnode = pdbentry->precnode; - DLLLIST *preclist; + ELLLIST *preclist; if (!precnode) return (-1); preclist = pdbbase->precHeader->papRecLoc[record_type]->preclist; free(precnode->precord); - dllDelete(preclist, (DLLNODE*)precnode); + ellDelete(preclist, (ELLNODE*)precnode); dbPvdDelete(pdbbase,precnode); free((void *)precnode); pdbentry->precnode = NULL; @@ -807,7 +807,7 @@ DBENTRY *pdbentry; pdbentry->record_type = record_type; if(!(precLoc=GET_PRECLOC(precHeader,record_type))) return(S_dbLib_recNotFound); if(!precLoc->preclist) return(S_dbLib_recNotFound); - precnode = (RECNODE *)dllFirst(precLoc->preclist); + precnode = (RECNODE *)ellFirst(precLoc->preclist); if(!precnode) return(S_dbLib_recNotFound); pdbentry->precnode = precnode; return(0); @@ -824,7 +824,7 @@ DBENTRY *pdbentry; long status=0; if(!precnode) return(S_dbLib_recNotFound); - precnode = (RECNODE *)dllNext((DLLNODE *)precnode); + precnode = (RECNODE *)ellNext((ELLNODE *)precnode); if(!precnode) status = S_dbLib_recNotFound; pdbentry->precnode = precnode; pdbentry->pfield = NULL; @@ -847,7 +847,7 @@ DBENTRY *pdbentry; if(!(precLoc=GET_PRECLOC(precHeader,record_type))) return(0); if(!precLoc->preclist) return(0); - return(dllCount(precLoc->preclist)); + return(ellCount(precLoc->preclist)); } #ifdef __STDC__ @@ -889,7 +889,7 @@ char *newName; struct recHeader *precHeader = (struct recHeader *) pdbbase->precHeader; char *precord; PVDENTRY *ppvd; - DLLLIST *preclist; + ELLLIST *preclist; RECNODE *plistnode; if(!precnode) return(S_dbLib_recNotFound); @@ -900,14 +900,14 @@ char *newName; if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);} /*remove from record list and reinstall in sorted order*/ preclist = precHeader->papRecLoc[record_type]->preclist; - dllDelete(preclist, (DLLNODE*)precnode); - plistnode = (RECNODE *)dllFirst(preclist); + ellDelete(preclist, (ELLNODE*)precnode); + plistnode = (RECNODE *)ellFirst(preclist); while(plistnode && strcmp(newName,(char*)plistnode->precord) < 0) - plistnode = (RECNODE *)dllNext((DLLNODE*)plistnode); + plistnode = (RECNODE *)ellNext((ELLNODE*)plistnode); if(plistnode) - dllInsert(preclist, dllPrevious((DLLNODE*)plistnode) ,(DLLNODE *)precnode); + ellInsert(preclist, ellPrevious((ELLNODE*)plistnode) ,(ELLNODE *)precnode); else - dllAdd(preclist, (DLLNODE*)precnode); + ellAdd(preclist, (ELLNODE*)precnode); return(0); } @@ -3768,7 +3768,7 @@ FILE *fp; #endif /*__STDC__*/ { RECNODE *precnode; - DLLLIST *preclist; + ELLLIST *preclist; int no_entries; unsigned rec_size; /* set to record size */ struct sdrHeader sdrHeader; @@ -3796,7 +3796,7 @@ FILE *fp; if ((precLoc = GET_PRECLOC(precHeader, recType)) == NULL) continue; if((preclist = precLoc->preclist) == NULL) continue; /* set up and write the SDR_DB_RECORDS sdrHeader */ - no_entries = dllCount(preclist); + no_entries = ellCount(preclist); rec_size = pRecTypDes->rec_size; memset((char *) &sdrHeader, '\0', sizeof(struct sdrHeader)); sdrHeader.magic = DBMAGIC; @@ -3812,9 +3812,9 @@ FILE *fp; errMessage(-1,"dbWrite: incomplete write"); return (-1); } - for (precnode = (RECNODE *) dllFirst(preclist); + for (precnode = (RECNODE *) ellFirst(preclist); precnode != NULL; - precnode = (RECNODE *) dllNext((DLLNODE*)precnode)) { + precnode = (RECNODE *) ellNext((ELLNODE*)precnode)) { /* write each record of this type contiguous */ if ((fwrite(precnode->precord, (int) rec_size, 1, fp)) != 1) { errMessage(-1,"dbWrite: incomplete write"); @@ -3902,9 +3902,9 @@ void dbPvdInitPvt(pdbbase) DBBASE *pdbbase; #endif /*__STDC__*/ { - DLLLIST **ppvd; + ELLLIST **ppvd; - ppvd = dbCalloc(HASH_NO, sizeof(DLLLIST *)); + ppvd = dbCalloc(HASH_NO, sizeof(ELLLIST *)); pdbbase->ppvd = (void *) ppvd; return; } @@ -3919,17 +3919,17 @@ int lenName; #endif /*__STDC__*/ { unsigned short hashInd; - DLLLIST **ppvd = (DLLLIST **) pdbbase->ppvd; - DLLLIST *pvdlist; + ELLLIST **ppvd = (ELLLIST **) pdbbase->ppvd; + ELLLIST *pvdlist; PVDENTRY *ppvdNode; hashInd = hash(name, lenName); if ((pvdlist=ppvd[hashInd]) == NULL) return (NULL); - ppvdNode = (PVDENTRY *) dllFirst(pvdlist); + ppvdNode = (PVDENTRY *) ellFirst(pvdlist); while(ppvdNode) { if(strcmp(name,(char *)ppvdNode->precnode->precord) == 0) return(ppvdNode); - ppvdNode = (PVDENTRY *) dllNext((DLLNODE*)ppvdNode); + ppvdNode = (PVDENTRY *) ellNext((ELLNODE*)ppvdNode); } return (NULL); } @@ -3944,8 +3944,8 @@ RECNODE *precnode; #endif /*__STDC__*/ { unsigned short hashInd; - DLLLIST **ppvd = (DLLLIST **) pdbbase->ppvd; - DLLLIST *ppvdlist; + ELLLIST **ppvd = (ELLLIST **) pdbbase->ppvd; + ELLLIST *ppvdlist; PVDENTRY *ppvdNode; int lenName; char *name=(char *)precnode->precord; @@ -3953,17 +3953,17 @@ RECNODE *precnode; lenName=strlen(name); hashInd = hash(name, lenName); if (ppvd[hashInd] == NULL) { - ppvd[hashInd] = dbCalloc(1, sizeof(DLLLIST)); - dllInit(ppvd[hashInd]); + ppvd[hashInd] = dbCalloc(1, sizeof(ELLLIST)); + ellInit(ppvd[hashInd]); } ppvdlist=ppvd[hashInd]; - ppvdNode = (PVDENTRY *) dllFirst(ppvdlist); + ppvdNode = (PVDENTRY *) ellFirst(ppvdlist); while(ppvdNode) { if(strcmp(name,(char *)ppvdNode->precnode->precord) == 0) return(NULL); - ppvdNode = (PVDENTRY *) dllNext((DLLNODE*)ppvdNode); + ppvdNode = (PVDENTRY *) ellNext((ELLNODE*)ppvdNode); } ppvdNode = dbCalloc(1, sizeof(PVDENTRY)); - dllAdd(ppvdlist, (DLLNODE*)ppvdNode); + ellAdd(ppvdlist, (ELLNODE*)ppvdNode); ppvdNode->record_type = record_type; ppvdNode->precnode = precnode; return (ppvdNode); @@ -3979,8 +3979,8 @@ RECNODE *precnode; { char *name=(char *)precnode->precord; unsigned short hashInd; - DLLLIST **ppvd = (DLLLIST **) pdbbase->ppvd; - DLLLIST *ppvdlist; + ELLLIST **ppvd = (ELLLIST **) pdbbase->ppvd; + ELLLIST *ppvdlist; PVDENTRY *ppvdNode; int lenName; @@ -3988,14 +3988,14 @@ RECNODE *precnode; hashInd = hash(name, lenName); if (ppvd[hashInd] == NULL)return; ppvdlist=ppvd[hashInd]; - ppvdNode = (PVDENTRY *) dllFirst(ppvdlist); + ppvdNode = (PVDENTRY *) ellFirst(ppvdlist); while(ppvdNode) { if(strcmp(name,(char *)ppvdNode->precnode->precord) == 0) { - dllDelete(ppvdlist, (DLLNODE*)ppvdNode); + ellDelete(ppvdlist, (ELLNODE*)ppvdNode); free((void *)ppvdNode); return; } - ppvdNode = (PVDENTRY *) dllNext((DLLNODE*)ppvdNode); + ppvdNode = (PVDENTRY *) ellNext((ELLNODE*)ppvdNode); } return; } @@ -4008,8 +4008,8 @@ DBBASE *pdbbase; #endif /*__STDC__*/ { unsigned short hashInd; - DLLLIST **ppvd = (DLLLIST **) pdbbase->ppvd; - DLLLIST *ppvdlist; + ELLLIST **ppvd = (ELLLIST **) pdbbase->ppvd; + ELLLIST *ppvdlist; PVDENTRY *ppvdNode; PVDENTRY *next; @@ -4017,10 +4017,10 @@ DBBASE *pdbbase; for (hashInd=0; hashIndppvd; - DLLLIST *ppvdlist; + ELLLIST **ppvd = (ELLLIST **) pdbbase->ppvd; + ELLLIST *ppvdlist; PVDENTRY *ppvdNode; int number; @@ -4047,13 +4047,13 @@ DBBASE *pdbbase; for (hashInd=0; hashIndprecnode->precord); if(number++ ==2) {number=0;printf("\n ");} - ppvdNode = (PVDENTRY *) dllNext((DLLNODE*)ppvdNode); + ppvdNode = (PVDENTRY *) ellNext((ELLNODE*)ppvdNode); } } printf("\nEnd of Process Variable Directory\n"); diff --git a/src/db/dbTest.c b/src/db/dbTest.c index c6f12825e..4d3211066 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -81,7 +81,7 @@ #include #include -#include +#include #include #include #include @@ -188,8 +188,8 @@ long dbl(char *ptypeName) got_it: for(rectype=beg; rectype<=end; rectype++) { if(!(precLoc=GET_PRECLOC(precHeader,rectype))) continue; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; if(precord->name[0] == 0) continue; /*deleted record*/ strncpy(name,precord->name,PVNAME_SZ); @@ -629,8 +629,8 @@ long dblls(int lockset) printf(" lset lcnt disv disa pact\n"); for(rectype=beg; rectype<=end; rectype++) { if(!(precLoc=GET_PRECLOC(precHeader,rectype))) continue; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; if(precord->name[0] == 0) continue; /*deleted record*/ if(lockset>0 && lockset!=precord->lset) continue; diff --git a/src/db/iocInit.c b/src/db/iocInit.c index a651cb476..2f025a93b 100644 --- a/src/db/iocInit.c +++ b/src/db/iocInit.c @@ -61,7 +61,7 @@ #include #include #include -#include +#include #include #include #include /* for sysSymTbl*/ @@ -394,8 +394,8 @@ static long initDatabase(void) } precTypDes = precDes->papRecTypDes[i]; pdevSup = GET_PDEVSUP(pdbBase->precDevSup,i); - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; /* If NAME is null then skip this record*/ if(!(precord->name[0])) continue; @@ -403,7 +403,7 @@ static long initDatabase(void) (struct rset *)(precord->rset) = prset; /* initialize mlok and mlis*/ FASTLOCKINIT(&precord->mlok); - dllInit(&(precord->mlis)); + ellInit(&(precord->mlis)); precord->pact=FALSE; /* set lset=0 See determine lock set below*/ precord->lset = 0; @@ -420,8 +420,8 @@ static long initDatabase(void) for(i=0; i< (precHeader->number); i++) { if(!(precLoc = precHeader->papRecLoc[i]))continue; precTypDes = precDes->papRecTypDes[i]; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; /* If NAME is null then skip this record*/ if(!(precord->name[0])) continue; @@ -479,8 +479,8 @@ static long initDatabase(void) if(!(precLoc = precHeader->papRecLoc[i]))continue; if(!(prset=GET_PRSET(precSup,i))) continue; precTypDes = precDes->papRecTypDes[i]; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; /* If NAME is null then skip this record*/ if(!(precord->name[0])) continue; @@ -504,8 +504,8 @@ static long initDatabase(void) for(i=0; inumber; i++) { if(!(precLoc = precHeader->papRecLoc[i]))continue; precTypDes = precDes->papRecTypDes[i]; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; /* If NAME is null then skip this record*/ if(!(precord->name[0])) continue; @@ -576,14 +576,14 @@ static long addToSet( /* unless (!process_passive && !maximize_sevr) or no_elements>1*/ /* remember that all earlier records already have lock set determined*/ if(!lookAhead) return(0); - precNode = (RECNODE *)dllNext(&prootNode->node); + precNode = (RECNODE *)ellNext(&prootNode->node); if(!(precHeader = pdbBase->precHeader)) return(0); for(in=i; innumber; in++) { struct dbCommon *pn; if(!(precLoc = precHeader->papRecLoc[in])) continue; precTypDes = precDes->papRecTypDes[in]; - if(!precNode) precNode = (RECNODE *)dllFirst(precLoc->preclist); + if(!precNode) precNode = (RECNODE *)ellFirst(precLoc->preclist); while(precNode) { pn = precNode->precord; /* If NAME is null then skip this record*/ @@ -611,7 +611,7 @@ static long addToSet( status = addToSet(pn,in,TRUE,i,prootNode,lset); if(status) return(status); } - precNode = (RECNODE *)dllNext(&precNode->node); + precNode = (RECNODE *)ellNext(&precNode->node); } precNode = NULL; } @@ -629,8 +629,8 @@ static long initialProcess(void) if(!(precHeader = pdbBase->precHeader)) return(0); for(i=0; i< (precHeader->number); i++) { if(!(precLoc = precHeader->papRecLoc[i]))continue; - for(precNode=(RECNODE *)dllFirst(precLoc->preclist); - precNode; precNode = (RECNODE *)dllNext(&precNode->node)) { + for(precNode=(RECNODE *)ellFirst(precLoc->preclist); + precNode; precNode = (RECNODE *)ellNext(&precNode->node)) { precord = precNode->precord; /* If NAME is null then skip this record*/ if(!(precord->name[0])) continue; diff --git a/src/db/taskwd.c b/src/db/taskwd.c index dd9896ab4..f44f2adb8 100644 --- a/src/db/taskwd.c +++ b/src/db/taskwd.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -46,15 +46,15 @@ #include struct task_list { - DLLNODE node; + ELLNODE node; VOIDFUNCPTR callback; void *arg; int tid; int suspended; }; -static DLLLIST list; -static DLLLIST anylist; +static ELLLIST list; +static ELLLIST anylist; static FAST_LOCK lock; static int taskwdid=0; volatile int taskwdOn=TRUE; @@ -71,8 +71,8 @@ static void freeList(struct task_list *pt); void taskwdInit() { FASTLOCKINIT(&lock); - dllInit(&list); - dllInit(&anylist); + ellInit(&list); + ellInit(&anylist); taskwdid = taskSpawn(TASKWD_NAME,TASKWD_PRI, TASKWD_OPT,TASKWD_STACK,(FUNCPTR )taskwdTask, 0,0,0,0,0,0,0,0,0,0); @@ -84,7 +84,7 @@ void taskwdInsert(int tid,VOIDFUNCPTR callback,void *arg) FASTLOCK(&lock); pt = allocList(); - dllAdd(&list,(void *)pt); + ellAdd(&list,(void *)pt); pt->suspended = FALSE; pt->tid = tid; pt->callback = callback; @@ -98,7 +98,7 @@ void taskwdAnyInsert(int tid,VOIDFUNCPTR callback,void *arg) FASTLOCK(&lock); pt = allocList(); - dllAdd(&anylist,(void *)pt); + ellAdd(&anylist,(void *)pt); pt->tid = tid; pt->callback = callback; pt->arg = arg; @@ -110,15 +110,15 @@ void taskwdRemove(int tid) struct task_list *pt; FASTLOCK(&lock); - pt = (struct task_list *)dllFirst(&list); + pt = (struct task_list *)ellFirst(&list); while(pt!=NULL) { if (tid == pt->tid) { - dllDelete(&list,(void *)pt); + ellDelete(&list,(void *)pt); freeList(pt); FASTUNLOCK(&lock); return; } - pt = (struct task_list *)dllNext((DLLNODE *)pt); + pt = (struct task_list *)ellNext((ELLNODE *)pt); } FASTUNLOCK(&lock); errMessage(-1,"taskwdRemove failed"); @@ -129,15 +129,15 @@ void taskwdAnyRemove(int tid) struct task_list *pt; FASTLOCK(&lock); - pt = (struct task_list *)dllFirst(&anylist); + pt = (struct task_list *)ellFirst(&anylist); while(pt!=NULL) { if (tid == pt->tid) { - dllDelete(&anylist,(void *)pt); + ellDelete(&anylist,(void *)pt); freeList(pt); FASTUNLOCK(&lock); return; } - pt = (struct task_list *)dllNext((void *)pt); + pt = (struct task_list *)ellNext((void *)pt); } FASTUNLOCK(&lock); errMessage(-1,"taskwdanyRemove failed"); @@ -150,9 +150,9 @@ static void taskwdTask(void) while(TRUE) { if(taskwdOn) { FASTLOCK(&lock); - pt = (struct task_list *)dllFirst(&list); + pt = (struct task_list *)ellFirst(&list); while(pt) { - next = (struct task_list *)dllNext((void *)pt); + next = (struct task_list *)ellNext((void *)pt); if(taskIsSuspended(pt->tid)) { char *pname; char message[100]; @@ -164,10 +164,10 @@ static void taskwdTask(void) sprintf(message,"task %x %s suspended",pt->tid,pname); errMessage(-1,message); if(pt->callback) (pt->callback)(pt->arg); - ptany = (struct task_list *)dllFirst(&anylist); + ptany = (struct task_list *)ellFirst(&anylist); while(ptany) { if(ptany->callback) (ptany->callback)(ptany->arg,pt->tid); - ptany = (struct task_list *)dllNext((DLLNODE *)ptany); + ptany = (struct task_list *)ellNext((ELLNODE *)ptany); } } pt->suspended = TRUE; diff --git a/src/drv/drvGpib.c b/src/drv/drvGpib.c index 0b96d0a98..bb8c1aa9f 100644 --- a/src/drv/drvGpib.c +++ b/src/drv/drvGpib.c @@ -64,7 +64,7 @@ #include #include -#include +#include #include #include #include @@ -1152,10 +1152,10 @@ struct ibLink *plink; plink->srqIntFlag = 0; /* no srq ints set now */ plink->linkEventSem = semBCreate(SEM_EMPTY, SEM_Q_PRIORITY); - dllInit(&(plink->hiPriList)); /* init the list as empty */ + ellInit(&(plink->hiPriList)); /* init the list as empty */ plink->hiPriSem = semBCreate(SEM_FULL, SEM_Q_PRIORITY); - dllInit(&(plink->loPriList)); /* init the list as empty */ + ellInit(&(plink->loPriList)); /* init the list as empty */ plink->loPriSem = semBCreate(SEM_FULL, SEM_Q_PRIORITY); plink->srqRing = rngCreate(SRQRINGSIZE * sizeof(struct srqStatus)); @@ -1349,14 +1349,14 @@ struct ibLink *plink; /* a reference to the link structures covered */ */ semTake(plink->hiPriSem, WAIT_FOREVER); - if ((pnode = (struct dpvtGpibHead *)dllFirst(&(plink->hiPriList))) != NULL) + if ((pnode = (struct dpvtGpibHead *)ellFirst(&(plink->hiPriList))) != NULL) { while (plink->deviceStatus[pnode->device] == BUSY) - if ((pnode = (struct dpvtGpibHead *)dllNext(pnode)) == NULL) + if ((pnode = (struct dpvtGpibHead *)ellNext(pnode)) == NULL) break; } if (pnode != NULL) - dllDelete(&(plink->hiPriList), pnode); + ellDelete(&(plink->hiPriList), pnode); semGive(plink->hiPriSem); @@ -1371,14 +1371,14 @@ struct ibLink *plink; /* a reference to the link structures covered */ else { semTake(plink->loPriSem, WAIT_FOREVER); - if ((pnode = (struct dpvtGpibHead *)dllFirst(&(plink->loPriList))) != NULL) + if ((pnode = (struct dpvtGpibHead *)ellFirst(&(plink->loPriList))) != NULL) { while (plink->deviceStatus[pnode->device] == BUSY) - if ((pnode = (struct dpvtGpibHead *)dllNext(pnode)) == NULL) + if ((pnode = (struct dpvtGpibHead *)ellNext(pnode)) == NULL) break; } if (pnode != NULL) - dllDelete(&(plink->loPriList), pnode); + ellDelete(&(plink->loPriList), pnode); semGive(plink->loPriSem); @@ -1665,13 +1665,13 @@ int prio; switch (prio) { case IB_Q_LOW: /* low priority transaction request */ semTake(pdpvt->pibLink->loPriSem, WAIT_FOREVER); - dllAdd(&(pdpvt->pibLink->loPriList), pdpvt); + ellAdd(&(pdpvt->pibLink->loPriList), pdpvt); semGive(pdpvt->pibLink->loPriSem); semGive(pdpvt->pibLink->linkEventSem); break; case IB_Q_HIGH: /* high priority transaction request */ semTake(pdpvt->pibLink->hiPriSem, WAIT_FOREVER); - dllAdd(&(pdpvt->pibLink->hiPriList), pdpvt); + ellAdd(&(pdpvt->pibLink->hiPriList), pdpvt); semGive(pdpvt->pibLink->hiPriSem); semGive(pdpvt->pibLink->linkEventSem); break; diff --git a/src/libCom/fdmgr.c b/src/libCom/fdmgr.c index d2aa92322..f195df157 100644 --- a/src/libCom/fdmgr.c +++ b/src/libCom/fdmgr.c @@ -117,7 +117,7 @@ static char *pSccsId = "$Id$\t$Date$"; #endif typedef struct{ - DLLNODE node; + ELLNODE node; int fd; enum fdi_type fdi; /* the type of fd interest */ fd_set *pfds; @@ -234,12 +234,12 @@ fdctx *fdmgr_init() pfdctx->clk_rate = sysClkRateGet(); pfdctx->last_tick_count = tickGet(); # endif - dllInit(&pfdctx->fdentry_list); - dllInit(&pfdctx->fdentry_in_use_list); - dllInit(&pfdctx->fdentry_free_list); - dllInit(&pfdctx->alarm_list); - dllInit(&pfdctx->expired_alarm_list); - dllInit(&pfdctx->free_alarm_list); + ellInit(&pfdctx->fdentry_list); + ellInit(&pfdctx->fdentry_in_use_list); + ellInit(&pfdctx->fdentry_free_list); + ellInit(&pfdctx->alarm_list); + ellInit(&pfdctx->expired_alarm_list); + ellInit(&pfdctx->free_alarm_list); /* * returns NULL if unsuccessfull @@ -283,7 +283,7 @@ void *param; return NULL; LOCK(pfdctx); - palarm = (alarm *) dllGet(&pfdctx->free_alarm_list); + palarm = (alarm *) ellGet(&pfdctx->free_alarm_list); UNLOCK(pfdctx); if(!palarm){ palarm = (alarm *) malloc(sizeof(alarm)); @@ -325,10 +325,10 @@ void *param; } } if(pa){ - dllInsert(&pfdctx->alarm_list, pa->node.previous, (DLLNODE*)palarm); + ellInsert(&pfdctx->alarm_list, pa->node.previous, (ELLNODE*)palarm); } else{ - dllAdd(&pfdctx->alarm_list,(DLLNODE*) palarm); + ellAdd(&pfdctx->alarm_list,(ELLNODE*) palarm); } palarm->alt = alt_alarm; UNLOCK(pfdctx); @@ -361,8 +361,8 @@ alarm *palarm; LOCK(pfdctx); alt = palarm->alt; if(alt == alt_alarm){ - dllDelete(&pfdctx->alarm_list, (DLLNODE*)palarm); - dllAdd(&pfdctx->free_alarm_list, (DLLNODE*)palarm); + ellDelete(&pfdctx->alarm_list, (ELLNODE*)palarm); + ellAdd(&pfdctx->free_alarm_list, (ELLNODE*)palarm); palarm->alt = alt_free; status = OK; } @@ -490,7 +490,7 @@ void *param; pfdctx->maxfd = max(pfdctx->maxfd, fd+1); LOCK(pfdctx); - pfdentry = (fdentry *) dllGet(&pfdctx->fdentry_free_list); + pfdentry = (fdentry *) ellGet(&pfdctx->fdentry_free_list); UNLOCK(pfdctx); if(!pfdentry){ @@ -513,7 +513,7 @@ void *param; pfdentry->delete_pending = FALSE; LOCK(pfdctx); - dllAdd(&pfdctx->fdentry_list, (DLLNODE*)pfdentry); + ellAdd(&pfdctx->fdentry_list, (ELLNODE*)pfdentry); UNLOCK(pfdctx); return OK; @@ -573,7 +573,7 @@ enum fdi_type fdi; pfdentry = (fdentry *) pfdentry->node.next){ if(pfdentry->fd == fd && pfdentry->fdi == fdi){ - dllDelete(&pfdctx->fdentry_list, (DLLNODE*)pfdentry); + ellDelete(&pfdctx->fdentry_list, (ELLNODE*)pfdentry); fdmgr_finish_off_fdentry(pfdctx, pfdentry); status = OK; break; @@ -639,7 +639,7 @@ register fdentry *pfdentry; #endif { FD_CLR(pfdentry->fd, pfdentry->pfds); - dllAdd(&pfdctx->fdentry_free_list, (DLLNODE*)pfdentry); + ellAdd(&pfdctx->fdentry_free_list, (ELLNODE*)pfdentry); } @@ -804,14 +804,14 @@ struct timeval *ptimeout; LOCK(pfdctx) pfdentry = (fdentry *) pfdentry->node.next; if(pfdentry){ - dllDelete(&pfdctx->fdentry_list, (DLLNODE*)pfdentry); + ellDelete(&pfdctx->fdentry_list, (ELLNODE*)pfdentry); /* * * holding place where it can be marked * pending delete but not deleted * */ - dllAdd(&pfdctx->fdentry_in_use_list, (DLLNODE*)pfdentry); + ellAdd(&pfdctx->fdentry_in_use_list, (ELLNODE*)pfdentry); } UNLOCK(pfdctx) @@ -842,7 +842,7 @@ struct timeval *ptimeout; } LOCK(pfdctx) - dllDelete(&pfdctx->fdentry_in_use_list, (DLLNODE*)pfdentry); + ellDelete(&pfdctx->fdentry_in_use_list, (ELLNODE*)pfdentry); /* * if it is marked pending delete @@ -855,7 +855,7 @@ struct timeval *ptimeout; fdmgr_finish_off_fdentry(pfdctx, pfdentry); } else{ - dllAdd(&pfdctx->fdentry_list, (DLLNODE*)pfdentry); + ellAdd(&pfdctx->fdentry_list, (ELLNODE*)pfdentry); } UNLOCK(pfdctx) @@ -903,8 +903,8 @@ struct timeval *poffset; break; nextpa = (alarm*)pa->node.next; - dllDelete(&pfdctx->alarm_list, (DLLNODE*)pa); - dllAdd(&pfdctx->expired_alarm_list, (DLLNODE*)pa); + ellDelete(&pfdctx->alarm_list, (ELLNODE*)pa); + ellAdd(&pfdctx->expired_alarm_list, (ELLNODE*)pa); pa->alt = alt_expired; } UNLOCK(pfdctx); @@ -958,7 +958,7 @@ struct timeval *poffset; pa->alt = alt_free; pa = (alarm *) pa->node.next; } - dllConcat(&pfdctx->free_alarm_list, &pfdctx->expired_alarm_list); + ellConcat(&pfdctx->free_alarm_list, &pfdctx->expired_alarm_list); pa = (alarm *)pfdctx->alarm_list.node.next; if(pa){ diff --git a/src/sequencer/seq_prog.c b/src/sequencer/seq_prog.c index f67fb1cea..56e9cfdc5 100644 --- a/src/sequencer/seq_prog.c +++ b/src/sequencer/seq_prog.c @@ -21,18 +21,18 @@ LOCAL SEM_ID seqProgListSemId; LOCAL int seqProgListInited = FALSE; -LOCAL LIST seqProgList; +LOCAL ELLLIST seqProgList; LOCAL VOID seqProgListInit(); typedef struct prog_node { - NODE node; + ELLNODE node; SPROG *pSP; } PROG_NODE; -#define seqListFirst(pList) (PROG_NODE *)lstFirst((LIST *)pList) +#define seqListFirst(pList) (PROG_NODE *)ellFirst((ELLLIST *)pList) -#define seqListNext(pNode) (PROG_NODE *)lstNext((NODE *)pNode) +#define seqListNext(pNode) (PROG_NODE *)ellNext((ELLNODE *)pNode) /* * seqFindProg() - find a program in the state program list from task id. @@ -137,7 +137,7 @@ SPROG *pSP; } pNode->pSP = pSP; - lstAdd((LIST *)&seqProgList, (NODE *)pNode); + ellAdd((ELLLIST *)&seqProgList, (ELLNODE *)pNode); semGive(seqProgListSemId); #ifdef DEBUG printf("Added task %d to list.\n", pSP->task_id); @@ -164,7 +164,7 @@ SPROG *pSP; { if (pNode->pSP == pSP) { - lstDelete((LIST *)&seqProgList, (NODE *)pNode); + ellDelete((ELLLIST *)&seqProgList, (ELLNODE *)pNode); semGive(seqProgListSemId); #ifdef DEBUG @@ -184,7 +184,7 @@ SPROG *pSP; LOCAL VOID seqProgListInit() { /* Init linked list */ - lstInit(&seqProgList); + ellInit(&seqProgList); /* Create a semaphore for mutual exclusion */ seqProgListSemId = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);