#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
return ft;
}
-CHISE_CCS_Table*
+CHISE_CCS
chise_ds_get_ccs (CHISE_DS *ds, const unsigned char *ccs)
{
CHISE_CCS_Table* ct;
}
int
+chise_feature_sync (CHISE_Feature feature)
+{
+ int status;
+
+ if (feature->db == NULL)
+ status = 0;
+ else
+ status = CHISE_Attribute_Table_close (feature->db);
+ feature->db = NULL;
+ feature->access = 0;
+ return status;
+}
+
+int
+chise_char_set_feature_value (CHISE_Char_ID cid,
+ CHISE_Feature feature,
+ unsigned char *value)
+{
+ unsigned char key_buf[8];
+
+ if (feature == NULL)
+ return -1;
+ if (chise_feature_setup_db (feature, 1))
+ return -1;
+ chise_format_char_id (cid, key_buf, 8);
+ return chise_attribute_table_put (feature->db, key_buf, value);
+}
+
+int
chise_char_load_feature_value (CHISE_Char_ID cid,
CHISE_Feature_Table *table,
CHISE_Value *valdatum)
int status = 0;
char key_buf[16];
+ if (ccs == NULL)
+ return -1;
+
if (ccs->db == NULL)
{
CHISE_DS *ds = ccs->ds;
{
char key_buf[16], val_buf[8];
+ if (ccs == NULL)
+ return -1;
+
if ((ccs->access & DB_CREATE) == 0)
{
if (ccs->db != NULL)
int len, flen, i;
int size;
char *db_file_name, *sp;
+ struct stat statbuf;
status = db_create (&dbase, NULL, 0);
if (status)
return NULL;
+ if ( (accessmask & DB_CREATE) && stat (db_dir, &statbuf) )
+ mkdir (db_dir, modemask);
+
len = strlen (db_dir);
flen = strlen (feature);
size = len + strlen (encoding) + flen * 3 + 4;
db_file_name[len] = '\0';
}
strcat (db_file_name, encoding);
+
+ if ( (accessmask & DB_CREATE) && stat (db_file_name, &statbuf) )
+ mkdir (db_file_name, modemask);
+
strcat (db_file_name, "/");
/* strcat (db_file_name, feature); */
sp = &db_file_name[strlen (db_file_name)];