From: Chris B. <buc...@us...> - 2011-05-09 22:27:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcCommon - Common lib for SFCB/SFCC". The branch, master has been updated via 18eaba2dfca46f5d016b3a523481c5e840662933 (commit) via 8bf11802f4ef5702ba83912717e7afd67ca1a7d8 (commit) from 2c169c4e412011c958605cd61a99d05466721af7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 18eaba2dfca46f5d016b3a523481c5e840662933 Author: buccella <buc...@li...> Date: Mon May 9 18:27:53 2011 -0400 added genericlist commit 8bf11802f4ef5702ba83912717e7afd67ca1a7d8 Author: buccella <buc...@li...> Date: Mon May 9 18:25:35 2011 -0400 added genericlist ----------------------------------------------------------------------- Summary of changes: diff --git a/ChangeLog b/ChangeLog index 304584f..a110cca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-05-09 Chris Buccella <buc...@li...> + + * Makefile.am, configure.ac, sfcUtil/utilFactory.c, + sfcUtil/utilHashtable.c, sfcUtil/utilft.h, + genericlist.c, genericlist.c: + added genericlist.* and made newList() take arguments to + specify memory management functions + 2011-02-10 Michael Chase-Salerno <br...@li...> * All files diff --git a/Makefile.am b/Makefile.am index d943348..03eb97e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,6 +42,7 @@ sfcCommonlib_LTLIBRARIES = \ libsfcUtil.la libsfcUtil_la_SOURCES = \ + sfcUtil/genericlist.c \ sfcUtil/hashtable.c \ sfcUtil/utilFactory.c \ sfcUtil/utilHashtable.c \ @@ -49,7 +50,7 @@ libsfcUtil_la_SOURCES = \ sfcUtil/libsfcUtil.Versions libsfcUtil_la_LDFLAGS = -Wl,--version-script,$(srcdir)/sfcUtil/libsfcUtil.Versions -inst_HEADERS= sfcUtil/hashtable.h sfcUtil/utilft.h +inst_HEADERS= sfcUtil/hashtable.h sfcUtil/utilft.h sfcUtil/genericlist.h pretty: for i in `find $(srcdir) -name \*.[ch]`; do \ diff --git a/configure.ac b/configure.ac index bab122e..1e564c7 100644 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,6 @@ AC_PROG_LIBTOOL # Checks for libraries. # FIXME: Replace `main' with a function in `-ldl': AC_CHECK_LIB([dl], [main]) -# FIXME: Replace `main' with a function in `-lpthread': -AC_CHECK_LIB([pthread], [main]) # Checks for header files. AC_HEADER_STDC diff --git a/sfcUtil/genericlist.c b/sfcUtil/genericlist.c new file mode 100644 index 0000000..b56b9ca --- /dev/null +++ b/sfcUtil/genericlist.c @@ -0,0 +1,733 @@ + +/* + * genericList.c + * + * (C) Copyright IBM Corp. 2005 + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE + * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. + * + * You can obtain a current copy of the Eclipse Public License from + * http://www.opensource.org/licenses/eclipse-1.0.php + * + * Author: Keith Pomakis <po...@po...> + * Contributions: Adrian Schuur <sc...@de...> + * + * Description: + * + * list implementation. + * + */ + + /************************************************************************ + ************************************************************************* + ** ** + ** Generic List Library ** + ** ** + ** by Keith Pomakis ** + ** kpp...@je... ** + ** ** + ** Spring, 1994 ** + ** ** + ************************************************************************* + ************************************************************************/ + +#include <stdio.h> +#include <stdlib.h> +#include "genericlist.h" + +#ifdef THINK_C /* what is this? */ +#define malloc NewPtr +#endif + +#define NEW(x) ((x *) emalloc(sizeof(x))) + +static void initialize_list(Generic_list * list); +static void initialize_sorted_list(Generic_list * list, + int (*lt) (void *a, void *b)); +static void destroy_list(Generic_list * list); +static void add_to_beginning(Generic_list list, void *pointer); +static void add_to_end(Generic_list list, void *pointer); +// static void add_to_list(Generic_list list, void *pointer); +static void *remove_from_beginning(Generic_list list); +static void *remove_from_end(Generic_list list); +static void *remove_from_list(Generic_list list, void *pointer); +static void remove_all(Generic_list list); +// static void *peek_at_beginning(Generic_list list); +// static void *peek_at_end(Generic_list list); + +static void *first_in_list(Generic_list list); +static void *next_in_list(Generic_list list); +static void *current_in_list(Generic_list list); +static void *remove_current(Generic_list list); +static void *previous_in_list(Generic_list list); +static void *last_in_list(Generic_list list); +static void reset_to_beginning(Generic_list list); +// static void reset_to_end(Generic_list list); + +static int num_of_objects(const Generic_list list); +static int is_empty(const Generic_list list); +static int is_in_list(const Generic_list list, const void *pointer); +static Generic_list copy_list(Generic_list list); + +/* + * static void perform_on_list(Generic_list list, void (*fn) (void + * *pointer, void *args),void *args); static void *first_that(Generic_list + * list, int (*fn) (const void *pointer, const void *args), const void + * *args); static void *next_that(Generic_list list, int (*fn) (const void + * *pointer, const void *args), const void *args); static void + * *previous_that(Generic_list list, int (*fn) (const void *pointer, const + * void *args), const void *args); static void *last_that(Generic_list + * list, int (*fn) (const void *pointer, const void *args), const void + * *args); static Generic_list all_such_that(Generic_list list, int (*fn) + * (const void *pointer, const void *args), const void *args); static void + * remove_all_such_that(Generic_list list, int (*fn) (const void *pointer, + * const void *args), const void *args); + */ + +static char *module = "generic_list"; + +static void *emalloc(unsigned int n); + +/****************************************************************************/ + +static void +initialize_list(Generic_list * list) +{ + list->info = NEW(Generic_list_info); + + list->info->pre_element.pointer = NULL; + list->info->pre_element.previous = &list->info->pre_element; + list->info->pre_element.next = &list->info->post_element; + list->info->post_element.pointer = NULL; + list->info->post_element.previous = &list->info->pre_element; + list->info->post_element.next = &list->info->post_element; + + list->info->current = &list->info->pre_element; + list->info->deleted_element.pointer = NULL; + list->info->lt = NULL; + list->info->num_of_elements = 0; +} + +/****************************************************************************/ + +static void +initialize_sorted_list(Generic_list * list, int (*lt) (void *a, void *b)) +{ + initialize_list(list); + list->info->lt = lt; +} + +/****************************************************************************/ + +static void +destroy_list(Generic_list * list) +{ + remove_all(*list); + free((void *) list->info); +} + +/****************************************************************************/ + +static void +add_to_beginning(Generic_list list, void *pointer) +{ + Generic_list_element *element; + + if (!pointer) { + // mlogf(M_ERROR, M_SHOW, "%s: NULL pointer passed 1\n", module); + return; + exit(EXIT_FAILURE); + } + + element = NEW(Generic_list_element); + element->next = list.info->pre_element.next; + element->previous = &list.info->pre_element; + element->pointer = pointer; + + list.info->pre_element.next->previous = element; + list.info->pre_element.next = element; + + list.info->num_of_elements++; +} + +/****************************************************************************/ + +static void +add_to_end(Generic_list list, void *pointer) +{ + Generic_list_element *element; + + if (!pointer) { + // mlogf(M_ERROR, M_SHOW, "%s: NULL pointer passed 2\n", module); + // abort(); + return; + exit(EXIT_FAILURE); + } + + element = NEW(Generic_list_element); + element->next = &list.info->post_element; + element->previous = list.info->post_element.previous; + element->pointer = pointer; + + list.info->post_element.previous->next = element; + list.info->post_element.previous = element; + + list.info->num_of_elements++; +} + +/****************************************************************************/ +/* + * static void add_to_list(Generic_list list, void *pointer) { + * Generic_list_element *element, *new_element; + * + * if (list.info->lt) { if (!pointer) { mlogf(M_ERROR,M_SHOW, "%s: NULL + * pointer passed\n", module); exit(EXIT_FAILURE); } + * + * element = list.info->pre_element.next; while (element != + * &list.info->post_element && (*list.info->lt) (element->pointer, + * pointer)) element = element->next; + * + * new_element = NEW(Generic_list_element); new_element->next = element; + * new_element->previous = element->previous; new_element->pointer = + * pointer; + * + * element->previous->next = new_element; element->previous = new_element; + * + * list.info->num_of_elements++; } else add_to_end(list, pointer); } + */ +/****************************************************************************/ + +static void * +remove_from_list(Generic_list list, void *pointer) +{ + Generic_list_element *element; + + element = list.info->post_element.previous; + + while (element != &list.info->pre_element && element->pointer != pointer) + element = element->previous; + + if (element == &list.info->pre_element) + /* + * No such element was found. + */ + return NULL; + + if (element == list.info->current) { + list.info->deleted_element.previous = element->previous; + list.info->deleted_element.next = element->next; + list.info->current = &list.info->deleted_element; + } + + element->previous->next = element->next; + element->next->previous = element->previous; + + free(element); + list.info->num_of_elements--; + + return pointer; +} + +/****************************************************************************/ + +static void * +remove_from_beginning(Generic_list list) +{ + Generic_list_element *element; + void *pointer; + + if (list.info->num_of_elements == 0) + return NULL; + + element = list.info->pre_element.next; + if (element == list.info->current) + list.info->current = &list.info->pre_element; + + pointer = element->pointer; + list.info->pre_element.next = element->next; + element->next->previous = &list.info->pre_element; + + free(element); + list.info->num_of_elements--; + + return pointer; +} + +/****************************************************************************/ + +static void * +remove_from_end(Generic_list list) +{ + Generic_list_element *element; + void *pointer; + + if (list.info->num_of_elements == 0) + return NULL; + + element = list.info->post_element.previous; + if (element == list.info->current) + list.info->current = &list.info->post_element; + + pointer = element->pointer; + list.info->post_element.previous = element->previous; + element->previous->next = &list.info->post_element; + + free(element); + list.info->num_of_elements--; + + return pointer; +} + +/****************************************************************************/ + +static void * +remove_current(Generic_list list) +{ + Generic_list_element *element; + void *pointer; + + element = list.info->current; + if (element->pointer == NULL) + return NULL; + + list.info->deleted_element.previous = element->previous; + list.info->deleted_element.next = element->next; + list.info->current = &list.info->deleted_element; + + pointer = element->pointer; + element->next->previous = element->previous; + element->previous->next = element->next; + + free(element); + list.info->num_of_elements--; + + return pointer; +} + +/****************************************************************************/ + +static void +remove_all(Generic_list list) +{ + Generic_list_element *element; + + element = list.info->pre_element.next; + while (element && element != &list.info->post_element) { + element = element->next; + if (element) + free(element->previous); + } + + list.info->pre_element.next = &list.info->post_element; + list.info->post_element.previous = &list.info->pre_element; + list.info->num_of_elements = 0; +} + +/****************************************************************************/ +/* + * static void *peek_at_beginning(Generic_list list) { return + * list.info->pre_element.next->pointer; } + */ +/****************************************************************************/ +/* + * static void *peek_at_end(Generic_list list) { return + * list.info->post_element.previous->pointer; } + */ +/****************************************************************************/ + +static void * +first_in_list(Generic_list list) +{ + list.info->current = list.info->pre_element.next->next->previous; + return list.info->current->pointer; +} + +/****************************************************************************/ + +static void * +current_in_list(Generic_list list) +{ + return list.info->current->pointer; +} + +/****************************************************************************/ + +static void * +last_in_list(Generic_list list) +{ + list.info->current = list.info->post_element.previous->previous->next; + return list.info->current->pointer; +} + +/****************************************************************************/ + +static void * +next_in_list(Generic_list list) +{ + list.info->current = list.info->current->next; + return list.info->current->pointer; +} + +/****************************************************************************/ + +static void * +previous_in_list(Generic_list list) +{ + list.info->current = list.info->current->previous; + return list.info->current->pointer; +} + +/****************************************************************************/ + +static void +reset_to_beginning(Generic_list list) +{ + list.info->current = &list.info->pre_element; +} + +/****************************************************************************/ +/* + * static void reset_to_end(Generic_list list) { list.info->current = + * &list.info->post_element; } + */ +/****************************************************************************/ + +static int +num_of_objects(const Generic_list list) +{ + return list.info->num_of_elements; +} + +/****************************************************************************/ + +static int +is_empty(const Generic_list list) +{ + return (list.info->num_of_elements == 0); +} + +/****************************************************************************/ + +static int +is_in_list(const Generic_list list, const void *pointer) +{ + Generic_list_element *element; + + element = list.info->pre_element.next; + + while (element != &list.info->post_element + && element->pointer != pointer) + element = element->next; + + return (element != &list.info->post_element); +} + +/****************************************************************************/ + +static Generic_list +copy_list(Generic_list list) +{ + Generic_list list_copy; + Generic_list_element *element; + + initialize_sorted_list(&list_copy, list.info->lt); + element = list.info->pre_element.next; + while (element != &list.info->post_element) { + add_to_end(list_copy, element->pointer); + element = element->next; + } + + return list_copy; +} + +/****************************************************************************/ +/* + * static void perform_on_list(Generic_list list, void (*fn) (void + * *pointer, void *args), void *args) { Generic_list_element *element; + * + * element = list.info->pre_element.next; while (element != + * &list.info->post_element) { (*fn) (element->pointer, args); element = + * element->next; } } + */ +/****************************************************************************/ +/* + * static void *first_that(Generic_list list, int (*fn) (const void + * *pointer, const void *args), const void *args) { Generic_list_element + * *element; + * + * element = list.info->pre_element.next; while (element != + * &list.info->post_element && !(*fn) (element->pointer, args)) { element + * = element->next; } + * + * if (element->pointer) list.info->current = element; + * + * return element->pointer; } + */ +/****************************************************************************/ +/* + * static void *next_that(Generic_list list, int (*fn) (const void + * *pointer, const void *args), const void *args) { Generic_list_element + * *element; + * + * element = list.info->current->next; while (element != + * &list.info->post_element && !(*fn) (element->pointer, args)) { element + * = element->next; } + * + * if (element->pointer) list.info->current = element; + * + * return element->pointer; } + */ +/****************************************************************************/ +/* + * static void *previous_that(Generic_list list, int (*fn) (const void + * *pointer, const void *args), const void *args) { Generic_list_element + * *element; + * + * element = list.info->current->previous; while (element != + * &list.info->pre_element && !(*fn) (element->pointer, args)) { element = + * element->previous; } + * + * if (element->pointer) list.info->current = element; + * + * return element->pointer; } + */ +/****************************************************************************/ +/* + * static void *last_that(Generic_list list, int (*fn) (const void + * *pointer, const void *args), const void *args) { Generic_list_element + * *element; + * + * element = list.info->post_element.previous; while (element != + * &list.info->pre_element && !(*fn) (element->pointer, args)) { element = + * element->previous; } + * + * if (element->pointer) list.info->current = element; + * + * return element->pointer; } + */ +/****************************************************************************/ +/* + * static Generic_list all_such_that(Generic_list list, int (*fn) (const + * void *pointer, const void *args), const void *args) { Generic_list + * list_copy; Generic_list_element *element; + * + * initialize_sorted_list(&list_copy, list.info->lt); element = + * list.info->pre_element.next; while (element != + * &list.info->post_element) { if ((*fn) (element->pointer, args)) + * add_to_end(list_copy, element->pointer); element = element->next; } + * + * return list_copy; } + */ +/****************************************************************************/ +/* + * static void remove_all_such_that(Generic_list list, int (*fn) (const + * void *pointer, const void *args), const void *args) { void *obj; + * + * reset_to_beginning(list); while ((obj = next_in_list(list))) if ((*fn) + * (obj, args)) remove_current(list); } + */ + +/****************************************************************************/ +/****************************************************************************/ +/** **/ +/** Internal functions **/ +/** **/ +/****************************************************************************/ +/****************************************************************************/ + +static void * +emalloc(unsigned int n) +{ + void *ptr; + + ptr = (void *) malloc(n); + if (ptr == NULL) { + // mlogf(M_ERROR, M_SHOW, "%s: error allocating memory\n", module); + exit(EXIT_FAILURE); + } + return ptr; +} + +static void +listRelease(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + destroy_list(&l); + if (ul->ft->memUnlink) ul->ft->memUnlink(ul->mem_state); + free(ul); +} + +static UtilList * +listClone(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + UtilList *nul = NEW(UtilList); + *nul = *ul; + nul->hdl = copy_list(l).info; + return nul; +} + +static void +listClear(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + remove_all(l); +} + +static unsigned long +listSize(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return num_of_objects(l); +} + +static int +listIsEmpty(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return is_empty(l); +} + +static int +listContains(UtilList * ul, const void *elm) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return is_in_list(l, elm); +} + +static void +listAppend(UtilList * ul, const void *elm) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + add_to_end(l, (void *) elm); +} + +static void +listPrepend(UtilList * ul, const void *elm) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + add_to_beginning(l, (void *) elm); +} + +static void +listAdd(UtilList * ul, const void *elm) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + add_to_beginning(l, (void *) elm); +} + +static void * +listGetFirst(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + reset_to_beginning(l); + return first_in_list(l); +} + +static void * +listGetLast(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return last_in_list(l); +} + +static void * +listGetNext(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return next_in_list(l); +} + +static void * +listGetPrevious(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return previous_in_list(l); +} + +static void * +listGetCurrent(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return current_in_list(l); +} + +static void * +listRemoveFirst(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return remove_from_beginning(l); +} + +static void * +listRemoveLast(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return remove_from_end(l); +} + +static void * +listRemoveCurrent(UtilList * ul) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return remove_current(l); +} + +static void * +listRemoveThis(UtilList * ul, void *elm) +{ + Generic_list l = *(Generic_list *) & ul->hdl; + return remove_from_list(l, elm); +} + +Util_List_FT UtilList_ft = { + 2, + listRelease, + // listMemUnlink, /* should be set by SFCB */ + NULL, /* memUnlink (used in SFCB) */ + listClone, + listClear, + listSize, + listIsEmpty, + listContains, + listAppend, + listPrepend, + listAdd, + listGetFirst, + listGetLast, + listGetNext, + listGetPrevious, + listGetCurrent, + listRemoveFirst, + listRemoveLast, + listRemoveCurrent, + listRemoveThis +}; + +Util_List_FT *UtilListFT = &UtilList_ft; + +UtilList * +newList(void* memAddFunc, void* memReleaseFunc) +{ + UtilList ul; + + ul.ft = UtilListFT; + initialize_list((Generic_list *) & ul.hdl); + ul.ft->memUnlink = memReleaseFunc; + + if (memAddFunc) { /* SFCB does this */ + UtilList* (*memLink)(UtilList*); + memLink = memAddFunc; + return (*memLink)(&ul); + } + else { /* SFCC does this */ + return memcpy(malloc(sizeof(ul)),&ul,sizeof(ul)); + } +} +/* MODELINES */ +/* DO NOT EDIT BELOW THIS COMMENT */ +/* Modelines are added by 'make pretty' */ +/* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ +/* vi:set ts=2 sts=2 sw=2 expandtab: */ diff --git a/sfcUtil/genericlist.h b/sfcUtil/genericlist.h new file mode 100644 index 0000000..bb98c58 --- /dev/null +++ b/sfcUtil/genericlist.h @@ -0,0 +1,95 @@ + +/* + * genericList.h + * + * (C) Copyright IBM Corp. 2005 + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE + * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. + * + * You can obtain a current copy of the Eclipse Public License from + * http://www.opensource.org/licenses/eclipse-1.0.php + * + * Author: Keith Pomakis <po...@po...> + * Contributions: Adrian Schuur <sc...@de...> + * + * Description: + * + * list implementation. + * + */ + + /************************************************************************ + ************************************************************************* + ** ** + ** Generic List Library ** + ** ** + ** by Keith Pomakis ** + ** kpp...@je... ** + ** ** + ** Spring, 1994 ** + ** ** + ************************************************************************* + ************************************************************************/ + +#ifndef GENERIC_LIST_DEFINED +#define GENERIC_LIST_DEFINED + +#include "utilft.h" +#include <string.h> + +typedef struct GLE_struct { + void *pointer; + struct GLE_struct *previous; + struct GLE_struct *next; +} Generic_list_element; + +typedef struct { + Generic_list_element *current; + Generic_list_element pre_element, + post_element, + deleted_element; + int (*lt) (void *a, void *b); + unsigned int num_of_elements; +} Generic_list_info; + +typedef struct { + Generic_list_info *info; +} Generic_list; + +#define Generic_stack Generic_list +#define Generic_queue Generic_list + +/****************************************************************************/ + +/* + * Stack operations + */ + +#define initialize_stack initialize_list +#define destroy_stack destroy_list +#define push add_to_beginning +#define pop remove_from_beginning +#define peek_at_top peek_at_beginning +#define copy_stack copy_list + +/* + * Queue operations + */ + +#define initialize_queue initialize_list +#define destroy_queue destroy_list +#define enqueue add_to_end +#define dequeue remove_from_beginning +#define dequeue_all remove_all +#define peek_at_head peek_at_beginning +#define peek_at_tail peek_at_end +#define copy_queue copy_list + +#endif /* GENERIC_LIST_DEFINED */ +/* MODELINES */ +/* DO NOT EDIT BELOW THIS COMMENT */ +/* Modelines are added by 'make pretty' */ +/* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ +/* vi:set ts=2 sts=2 sw=2 expandtab: */ diff --git a/sfcUtil/utilFactory.c b/sfcUtil/utilFactory.c index e4b1dfb..044e9bd 100644 --- a/sfcUtil/utilFactory.c +++ b/sfcUtil/utilFactory.c @@ -24,10 +24,11 @@ #include <stdlib.h> #include <ctype.h> #include <string.h> +#include "genericlist.h" extern UtilHashTable *newHashTable(long buckets, long opt); extern UtilHashTable *newHashTableDefault(long buckets); -extern UtilList *newList(); +extern UtilList *newList(); /* coming from genericlist */ extern UtilStringBuffer *newStringBuffer(int s); static Util_Factory_FT ift = { diff --git a/sfcUtil/utilHashtable.c b/sfcUtil/utilHashtable.c index 4e1ed2d..d479938 100644 --- a/sfcUtil/utilHashtable.c +++ b/sfcUtil/utilHashtable.c @@ -112,7 +112,6 @@ newHashTableDefault(long buckets) { UtilHashTable *ht = (UtilHashTable *) malloc(sizeof(UtilHashTable)); void *t = HashTableCreate(buckets); -printf("MCS common\n"); ht->hdl = t; ht->ft = UtilHashTableFT; @@ -132,8 +131,6 @@ newHashTable(long buckets, long opt) void (*keyRelease) (void *key) = NULL; void (*valueRelease) (void *value) = NULL; -printf("MCS common\n"); - ht->hdl = t; ht->ft = UtilHashTableFT; diff --git a/sfcUtil/utilft.h b/sfcUtil/utilft.h index 54954d3..cf585b7 100644 --- a/sfcUtil/utilft.h +++ b/sfcUtil/utilft.h @@ -115,6 +115,8 @@ extern "C" { int version; void (*release) (UtilList * ul); + void (*memUnlink) + (int i); UtilList *(*clone) (UtilList * ul); void (*clear) hooks/post-receive -- sfcCommon - Common lib for SFCB/SFCC |