-/* 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
CONCORD_Object object_nil;
CONCORD_Object (*read_object) (const unsigned char* str, size_t length);
- CONCORD_NAME_TABLE* symbol_names;
};
CONCORD_Object
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 );
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;
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;
}
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);
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;
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;