Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

char_xhash.c

Go to the documentation of this file.
00001 /***************************************************************************
00002                                 char_xhash.c
00003                              -------------------
00004     begin                : Sat Dec 08 2001
00005     copyright            : (C) 2001-2002 by Christian Hoenig & Gunter Ohrner
00006     email                : pdepp@CustomCDROM.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00023 #include "common.h"
00024 
00025 #include <string.h>
00026 #include <ctype.h>
00027 
00028 #include "char_xhash.h"
00029 
00030 #undef XH_CALC_HASH_VAL
00031 
00032 #define XH_CALC_HASH_VAL(key, size) ( (size_t)tolower(key[0]) - (size_t)'a' )
00033 
00034 #undef XH_KEYS_EQUAL
00035 
00036 #define XH_KEYS_EQUAL(a, b) (strcmp(a, b) == 0)
00037 
00038 #undef XH_INVALID
00039 
00040 #define XH_INVALID NULL
00041 
00042 #undef XH_CREATE_KEY
00043 
00044 #undef XH_COPY_KEY
00045 
00046 #define XH_COPY_KEY(dest, source) { \
00047                                     dest = (XH_KEY) pd_malloc(strlen(source)+1);\
00048                                     strcpy(dest, source); \
00049                                   }
00050 
00051 #undef XH_FREE_KEY
00052 
00053 #define XH_FREE_KEY(a) pd_free(a)
00054 
00055 #undef XH_CREATE_CARGO
00056 
00057 #undef XH_COPY_CARGO
00058 
00059 #define XH_COPY_CARGO(dest, source) { \
00060                                       dest = (XH_CARGO) pd_malloc(strlen(source)+1);\
00061                                       strcpy(dest, source); \
00062                                     }
00063 
00064 #undef XH_FREE_CARGO
00065 
00066 #define XH_FREE_CARGO(a) pd_free(a)
00067 
00068 
00069 
00070 #include "xhash_tmpl_c.inc"

Generated on Fri Jan 25 22:40:30 2002 for PDepp Webserver by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001