+static int insert_item(jsw_head_t **table, jsw_node_t *item, unsigned int chain) {
+ /* Create a chain if the bucket is empty */
+ if ( table[chain] == NULL ) {
+ table[chain] = new_chain();
+ }
+
+ if ( table[chain] == NULL ) {
+ return 0;
+ }
+
+ /* Insert at the front of the chain */
+ item->next = table[chain]->first;
+ table[chain]->first = item;
+
+ ++table[chain]->size;
+
+ return 1;
+}
+