-/* Copyright (C) 2003,2004,2005,2006 MORIOKA Tomohiko
+/* Copyright (C) 2003,2004,2005,2006,2011 MORIOKA Tomohiko
This file is part of the CONCORD Library.
The CONCORD Library is free software; you can redistribute it and/or
concord_default_read_object (const unsigned char* string, size_t length);
+typedef struct CONCORD_Object_Header
+{
+ unsigned char prefix;
+ unsigned char type;
+} CONCORD_Object_Header;
+
+#define CONCORD_OBJECT_TYPE_NULL 0
+#define CONCORD_OBJECT_TYPE_C_STRING 1
+#define CONCORD_OBJECT_TYPE_INT 2
+#define CONCORD_OBJECT_TYPE_DS 16
+#define CONCORD_OBJECT_TYPE_GENRE 17
+#define CONCORD_OBJECT_TYPE_FEATURE 18
+#define CONCORD_OBJECT_TYPE_INDEX 19
+#define CONCORD_OBJECT_TYPE_OBJECT 128
+
+
struct CONCORD_DS_Table
{
+ CONCORD_Object_Header header;
CONCORD_Backend_Type type;
char *location;
CONCORD_NAME_TABLE* genre_names;
if (ds == NULL)
return NULL;
+ ds->header.prefix = 0xff;
+ ds->header.type = CONCORD_OBJECT_TYPE_DS;
ds->type = type;
ds->subtype = ( (subtype != 0) ? subtype : DB_HASH );
ds->modemask = modemask;
struct CONCORD_Genre_Table
{
+ CONCORD_Object_Header header;
CONCORD_DS ds;
char *name;
CONCORD_NAME_TABLE* feature_names;
if (genre == NULL)
return NULL;
+ genre->header.prefix = 0xff;
+ genre->header.type = CONCORD_OBJECT_TYPE_GENRE;
genre->ds = ds;
genre->name = (char*)malloc (len + 1);
if (genre->name == NULL)
struct CONCORD_Feature_Table
{
+ CONCORD_Object_Header header;
CONCORD_Genre genre;
char* name;
DB* db;
if (table == NULL)
return NULL;
+ table->header.prefix = 0xff;
+ table->header.type = CONCORD_OBJECT_TYPE_FEATURE;
table->genre = genre;
table->db = NULL;
table->access = 0;
struct CONCORD_INDEX_Table
{
+ CONCORD_Object_Header header;
CONCORD_Genre genre;
char *name;
DB* db;
if (table == NULL)
return NULL;
+ table->header.prefix = 0xff;
+ table->header.type = CONCORD_OBJECT_TYPE_INDEX;
table->genre = genre;
table->db = NULL;
table->access = 0;