#include "libComAPI.h"
#include "ellLib.h"
Go to the source code of this file.
|
LIBCOM_API void epicsStdCall | gphInitPvt (struct gphPvt **ppvt, int tableSize) |
|
LIBCOM_API GPHENTRY *epicsStdCall | gphFind (struct gphPvt *pvt, const char *name, void *pvtid) |
|
LIBCOM_API GPHENTRY *epicsStdCall | gphFindParse (struct gphPvt *pvt, const char *name, size_t len, void *pvtid) |
|
LIBCOM_API GPHENTRY *epicsStdCall | gphAdd (struct gphPvt *pvt, const char *name, void *pvtid) |
|
LIBCOM_API void epicsStdCall | gphDelete (struct gphPvt *pvt, const char *name, void *pvtid) |
|
LIBCOM_API void epicsStdCall | gphFreeMem (struct gphPvt *pvt) |
|
LIBCOM_API void epicsStdCall | gphDump (struct gphPvt *pvt) |
|
LIBCOM_API void epicsStdCall | gphDumpFP (FILE *fp, struct gphPvt *pvt) |
|
LIBCOM_API GPHENTRY* epicsStdCall gphAdd |
( |
struct gphPvt * |
pvt, |
|
|
const char * |
name, |
|
|
void * |
pvtid |
|
) |
| |
Definition at line 97 of file gpHashLib.c.
105 paplist = pgphPvt->paplist;
110 plist = paplist[hash];
112 plist = calloc(1,
sizeof(
ELLLIST));
118 paplist[hash] = plist;
123 if (pvtid == pgphNode->
pvtid &&
124 strcmp(
name, pgphNode->
name) == 0) {
131 pgphNode = calloc(1,
sizeof(
GPHENTRY));
134 pgphNode->
pvtid = pvtid;
unsigned int epicsStrHash(const char *str, unsigned int seed)
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
#define ellNext(PNODE)
Find the next node in list.
unsigned int epicsMemHash(const char *str, size_t length, unsigned int seed)
#define ellInit(PLIST)
Initialize a list type.
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API void epicsStdCall gphDelete |
( |
struct gphPvt * |
pvt, |
|
|
const char * |
name, |
|
|
void * |
pvtid |
|
) |
| |
Definition at line 142 of file gpHashLib.c.
149 if (pgphPvt ==
NULL)
return;
150 paplist = pgphPvt->paplist;
155 if (paplist[hash] ==
NULL) {
158 plist = paplist[hash];
163 if (pvtid == pgphNode->
pvtid &&
164 strcmp(
name, pgphNode->
name) == 0) {
166 free((
void *)pgphNode);
unsigned int epicsStrHash(const char *str, unsigned int seed)
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
#define ellNext(PNODE)
Find the next node in list.
unsigned int epicsMemHash(const char *str, size_t length, unsigned int seed)
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API void epicsStdCall gphDump |
( |
struct gphPvt * |
pvt | ) |
|
Definition at line 206 of file gpHashLib.c.
void epicsStdCall gphDumpFP(FILE *fp, gphPvt *pgphPvt)
LIBCOM_API void epicsStdCall gphDumpFP |
( |
FILE * |
fp, |
|
|
struct gphPvt * |
pvt |
|
) |
| |
Definition at line 211 of file gpHashLib.c.
213 unsigned int empty = 0;
220 fprintf(fp,
"Hash table has %d buckets", pgphPvt->size);
222 paplist = pgphPvt->paplist;
223 for (h = 0; h < pgphPvt->size; h++) {
234 fprintf(fp,
"\n [%3d] %3d ", h,
ellCount(plist));
238 fprintf(fp,
" %s %p", pgphNode->
name, pgphNode->
pvtid);
242 fprintf(fp,
"\n%u buckets empty.\n", empty);
epics::pvData::BitSetPtr empty
#define ellCount(PLIST)
Report the number of nodes in a list.
#define ellNext(PNODE)
Find the next node in list.
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API GPHENTRY* epicsStdCall gphFind |
( |
struct gphPvt * |
pvt, |
|
|
const char * |
name, |
|
|
void * |
pvtid |
|
) |
| |
Definition at line 92 of file gpHashLib.c.
GPHENTRY *epicsStdCall gphFindParse(gphPvt *pgphPvt, const char *name, size_t len, void *pvtid)
LIBCOM_API GPHENTRY* epicsStdCall gphFindParse |
( |
struct gphPvt * |
pvt, |
|
|
const char * |
name, |
|
|
size_t |
len, |
|
|
void * |
pvtid |
|
) |
| |
Definition at line 61 of file gpHashLib.c.
69 paplist = pgphPvt->paplist;
74 gphlist = paplist[hash];
75 if (gphlist ==
NULL) {
82 if (pvtid == pgphNode->
pvtid &&
83 strlen(pgphNode->
name) == len &&
84 strncmp(
name, pgphNode->
name, len) == 0)
break;
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
#define ellNext(PNODE)
Find the next node in list.
unsigned int epicsMemHash(const char *str, size_t length, unsigned int seed)
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API void epicsStdCall gphFreeMem |
( |
struct gphPvt * |
pvt | ) |
|
Definition at line 176 of file gpHashLib.c.
182 if (pgphPvt ==
NULL)
return;
184 paplist = pgphPvt->paplist;
185 for (h = 0; h < pgphPvt->size; h++) {
190 if (plist ==
NULL)
continue;
void epicsStdCall epicsMutexDestroy(epicsMutexId pmutexNode)
Destroy an epicsMutex semaphore.
#define ellNext(PNODE)
Find the next node in list.
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API void epicsStdCall gphInitPvt |
( |
struct gphPvt ** |
ppvt, |
|
|
int |
tableSize |
|
) |
| |
Definition at line 37 of file gpHashLib.c.
41 if (size & (size - 1)) {
42 fprintf(
stderr,
"gphInitPvt: %d is not a power of 2\n", size);
54 pgphPvt->
mask = size - 1;
#define epicsMutexMustCreate()
Create an epicsMutex semaphore for use from C code.
LIBCOM_API void * callocMustSucceed(size_t count, size_t size, const char *msg)
A calloc() that never returns NULL.