X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fconcord.git;a=blobdiff_plain;f=concord.c;h=617f6c5b527984082d6175194aa78eca61371dda;hp=83bb97fc0b22506f354d244cbab9b04ff5c00289;hb=9c7b9397c1bc47c31808b4fad512972a8fa202a2;hpb=b789ce503b76cde11d5b8d4539684ed95978eb74 diff --git a/concord.c b/concord.c index 83bb97f..617f6c5 100644 --- a/concord.c +++ b/concord.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003,2004,2005,2006,2011 MORIOKA Tomohiko +/* Copyright (C) 2003, 2004, 2005, 2006, 2011, 2013 MORIOKA Tomohiko This file is part of the CONCORD Library. The CONCORD Library is free software; you can redistribute it and/or @@ -25,6 +25,7 @@ #include "concord.h" #include "cos-i.h" #include "concord-name.h" +#include "cos-hash.h" #include "concord-bdb.h" @@ -69,7 +70,6 @@ struct COS_DS_ent CONCORD_Object object_nil; CONCORD_Object (*read_object) (const unsigned char* str, size_t length); - CONCORD_NAME_TABLE* symbol_names; }; CONCORD_Object @@ -88,22 +88,11 @@ CONCORD_DS concord_open_ds (CONCORD_Backend_Type type, const char* location, int subtype, int modemask) { -#if 0 - CONCORD_DS ds = (CONCORD_DS)malloc (sizeof (CONCORD_DS_ent)); - size_t len = strlen (location); - - if (ds == NULL) - return NULL; - - ds->header.prefix = 0xff; - ds->header.type = CONCORD_Object_Type_DS; -#else CONCORD_DS ds = COS_ALLOCATE_OBJECT (DS); size_t len = strlen (location); if (ds == NULL) return NULL; -#endif ds->type = type; ds->subtype = ( (subtype != 0) ? subtype : DB_HASH ); @@ -123,15 +112,6 @@ concord_open_ds (CONCORD_Backend_Type type, const char* location, return NULL; } - ds->symbol_names = concord_make_name_table (); - if (ds->symbol_names == NULL) - { - concord_destroy_name_table (ds->genre_names); - free (ds->location); - free (ds); - return NULL; - } - ds->object_nil = NULL; ds->read_object = &concord_default_read_object; @@ -145,8 +125,6 @@ concord_close_ds (CONCORD_DS ds) free (ds->location); if (ds->genre_names != NULL) concord_destroy_name_table (ds->genre_names); - if (ds->symbol_names != NULL) - concord_destroy_name_table (ds->symbol_names); free (ds); return 0; } @@ -303,18 +281,9 @@ concord_ds_open_genre (CONCORD_DS ds, const char* name) if (ds == NULL) return NULL; -#if 0 - genre = (CONCORD_Genre)malloc (sizeof (CONCORD_Genre_ent)); - if (genre == NULL) - return NULL; - - genre->header.prefix = 0xff; - genre->header.type = CONCORD_Object_Type_Genre; -#else genre = COS_ALLOCATE_OBJECT (Genre); if (genre == NULL) return NULL; -#endif genre->ds = ds; genre->name = (char*)malloc (len + 1); @@ -553,15 +522,6 @@ concord_genre_get_index (CONCORD_Genre genre, const char* name) } -struct COS_Feature_ent -{ - COS_Object_Header header; - CONCORD_Genre genre; - char* name; - DB* db; - u_int32_t access; -}; - CONCORD_Feature concord_genre_open_feature (CONCORD_Genre genre, const char* feature) { @@ -571,18 +531,9 @@ concord_genre_open_feature (CONCORD_Genre genre, const char* feature) if (genre == NULL) return NULL; -#if 0 - table = (CONCORD_Feature)malloc (sizeof (CONCORD_Feature_ent)); - if (table == NULL) - return NULL; - - table->header.prefix = 0xff; - table->header.type = CONCORD_Object_Type_Feature; -#else table = COS_ALLOCATE_OBJECT (Feature); if (table == NULL) return NULL; -#endif table->genre = genre; table->db = NULL; @@ -594,6 +545,7 @@ concord_genre_open_feature (CONCORD_Genre genre, const char* feature) return NULL; } strcpy (table->name, feature); + table->value_table = NULL; return table; } @@ -795,18 +747,9 @@ concord_genre_open_index (CONCORD_Genre genre, const char* index) if (genre == NULL) return NULL; -#if 0 - table = (CONCORD_INDEX)malloc (sizeof (CONCORD_INDEX_ent)); - if (table == NULL) - return NULL; - - table->header.prefix = 0xff; - table->header.type = CONCORD_Object_Type_INDEX; -#else table = COS_ALLOCATE_OBJECT (Feature_INDEX); if (table == NULL) return NULL; -#endif table->genre = genre; table->db = NULL;