I'm making a simple C chat-server chat. I need to pass two different arguments to a function called by a thread. I know that the only way to do this is to create a struct that contains both arguments but i have a simple int variable and a hashtable i created myself and i don't know how to copy the hashtable (already filled) in the struct. Here's the code of the hashtable:
hash_t CREATEHASH () {
hash_t H;
int i;
H = (hash_t) malloc(HL*sizeof(list));
for ( i=0; i < HL; i++ ) {
H[i] = CREATELIST();
}
return H;
}
list CREATELIST () {
list L;
L = (list) malloc(sizeof (struct cell) );
L->succ = L;
L->pred = L;
return L;
}
Someone can help me?