From 9a93cf6b1cd9a22b0b2fd1776ca0d1b480276002 Mon Sep 17 00:00:00 2001 From: asterix Date: Fri, 7 May 2010 16:02:18 +0000 Subject: [PATCH] Add wizard mark. Add configuration file. Move some conf to its file. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3631 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_hashtable.h | 52 ++++++++++++++++++++++++++++++++++++++ bertos/struct/hashtable.c | 3 ++- bertos/struct/hashtable.h | 16 +++++------- 3 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 bertos/cfg/cfg_hashtable.h diff --git a/bertos/cfg/cfg_hashtable.h b/bertos/cfg/cfg_hashtable.h new file mode 100644 index 00000000..7560617d --- /dev/null +++ b/bertos/cfg/cfg_hashtable.h @@ -0,0 +1,52 @@ +/** + * \file + * + * + * \brief Configuration file for hashtable module. + * + * \author Daniele Basile + */ + +#ifndef CFG_HASHTABLE_H +#define CFG_HASHTABLE_H + +/** + * Enable/disable support to declare special hash tables which maintain a copy of + * the key internally instead of relying on the hook to extract it from the data. + * + * $WIZ$ type = "boolean" + */ +#define CONFIG_HT_OPTIONAL_INTERNAL_KEY 1 + +#endif /* CFG_HASHTABLE_H */ + + + diff --git a/bertos/struct/hashtable.c b/bertos/struct/hashtable.c index 6f5471dd..5e4ee652 100644 --- a/bertos/struct/hashtable.c +++ b/bertos/struct/hashtable.c @@ -78,11 +78,12 @@ * the common case (external keys) both can be used. * * - * \version $Id$ * \author Giovanni Bajo */ #include "hashtable.h" + +#include "cfg/cfg_hashtable.h" #include #include #include //ROTL(), ROTR(); diff --git a/bertos/struct/hashtable.h b/bertos/struct/hashtable.h index 363241e3..9a102a8a 100644 --- a/bertos/struct/hashtable.h +++ b/bertos/struct/hashtable.h @@ -30,6 +30,8 @@ * Copyright 2004 Giovanni Bajo * --> * + * \author Giovanni Bajo + * * \brief Portable hash table * * This file implements a portable hash table, with the following features: @@ -48,23 +50,19 @@ * a marker for a free node, so it is invalid to store a NULL pointer in the table * with \c ht_insert(). * - * \version $Id$ - * \author Giovanni Bajo + * $WIZ$ module_name = "hashtable" + * $WIZ$ module_configuration = "bertos/cfg/cfg_hashtable.h" */ #ifndef STRUCT_HASHTABLE_H #define STRUCT_HASHTABLE_H +#include "cfg/cfg_hashtable.h" + #include #include #include -/** - * Enable/disable support to declare special hash tables which maintain a copy of - * the key internally instead of relying on the hook to extract it from the data. - */ -#define CONFIG_HT_OPTIONAL_INTERNAL_KEY 1 - /// Maximum length of the internal key (use (2^n)-1 for slight speedup) #define INTERNAL_KEY_MAX_LENGTH 15 @@ -151,7 +149,7 @@ typedef struct * \param ht Hash table declared with \c DECLARE_HASHTABLE * * \note This function must be called before using the hash table. Optionally, - * it can be called later in the program to clear the hash table, + * it can be called later in the program to clear the hash table, * removing all its elements. */ void ht_init(struct HashTable* ht); -- 2.25.1