00001 /* 00002 ** Copyright (C) 2002 by Kevin L. Mitchell <klmitch@mit.edu> 00003 ** 00004 ** This library is free software; you can redistribute it and/or 00005 ** modify it under the terms of the GNU Library General Public 00006 ** License as published by the Free Software Foundation; either 00007 ** version 2 of the License, or (at your option) any later version. 00008 ** 00009 ** This library is distributed in the hope that it will be useful, 00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 ** Library General Public License for more details. 00013 ** 00014 ** You should have received a copy of the GNU Library General Public 00015 ** License along with this library; if not, write to the Free 00016 ** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00017 ** MA 02111-1307, USA 00018 ** 00019 ** @(#)$Id: st_init.c,v 1.7 2006/07/15 18:06:18 klmitch Exp $ 00020 */ 00028 #include "dbprim.h" 00029 #include "dbprim_int.h" 00030 00031 RCSTAG("@(#)$Id: st_init.c,v 1.7 2006/07/15 18:06:18 klmitch Exp $"); 00032 00033 unsigned long 00034 st_init(smat_table_t *table, unsigned long flags, smat_resize_t resize, 00035 void *extra, unsigned long init_mod) 00036 { 00037 unsigned long retval; 00038 00039 initialize_dbpr_error_table(); /* set up error tables */ 00040 00041 if (!table) /* verify arguments */ 00042 return DB_ERR_BADARGS; 00043 00044 table->st_extra = extra; 00045 table->st_resize = resize; 00046 00047 /* initialize the hash table */ 00048 if ((retval = ht_init(&table->st_table, flags, hash_fnv1a, hash_comp, 00049 _smat_resize, table, init_mod))) 00050 return retval; 00051 00052 table->st_magic = SMAT_TABLE_MAGIC; /* initialize the rest of the table */ 00053 00054 return 0; 00055 }