Exemplo n.º 1
0
HASH_TABLE_PTR x_ipc_hashTableCreate(int32 size, HASH_FN hashFunc, EQ_HASH_FN eqFunc)
#endif
{
  int32 i;
  HASH_ELEM_PTR *table;
  HASH_TABLE_PTR hashTable;
  
#if defined(DBMALLOC)
  hashTable = NEW_DB(file,line,HASH_TABLE_TYPE);
  table = (HASH_ELEM_PTR *)x_ipcDBMalloc(file,line,
				       sizeof(HASH_ELEM_PTR)*(unsigned)size);
#else
  hashTable = NEW(HASH_TABLE_TYPE);
  table = (HASH_ELEM_PTR *)x_ipcMalloc(sizeof(HASH_ELEM_PTR)*(unsigned)size);
#endif
  
  for(i=0;i < size;i++)
    table[i] = NULL;
  
  hashTable->size = size;
  hashTable->hashFunc = hashFunc;
  hashTable->eqFunc = eqFunc;
  hashTable->table = table;
  
  return hashTable;
}
Exemplo n.º 2
0
STR_LIST_PTR x_ipc_strListDBCreate(const char* file, int line)
{
  STR_LIST_PTR newList;
  
  newList = x_ipcDBMalloc(file,line,sizeof(STR_LIST_TYPE));
  newList->length = newList->size = 0;
  newList->strings = NULL;

  return newList;
}
Exemplo n.º 3
0
void *x_ipcMalloc(unsigned long amount)
{
  return x_ipcDBMalloc("Unknown", 9999, amount);
}