From: MORIOKA Tomohiko Date: Mon, 1 Apr 2013 06:03:17 +0000 (+0900) Subject: (struct COS_DS_ent): Delete member `symbol_names'. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=73da1f9f0b127b2c480bb02d4c8efe8a156fa37b;p=chise%2Fconcord.git (struct COS_DS_ent): Delete member `symbol_names'. (concord_open_ds): Delete code to initialize `ds->symbol_names'. (concord_close_ds): Delete code to destroy `ds->symbol_names'. --- diff --git a/concord.c b/concord.c index 83bb97f..71d5d4d 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 @@ -69,7 +69,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 +87,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 +111,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 +124,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 +280,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); @@ -571,18 +539,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; @@ -795,18 +754,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;