(SIZEOF_INT): New macro.
[chise/concord.git] / concord-bdb.c
index deec042..d68eefe 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2005 MORIOKA Tomohiko
+/* Copyright (C) 2003,2004,2005,2006 MORIOKA Tomohiko
    This file is part of the CONCORD Library.
 
    The CONCORD Library is free software; you can redistribute it and/or
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
 #include "sysdep.h"
 #include "concord.h"
 #include "concord-bdb.h"
 
 DB*
-CONCORD_BDB_open (const unsigned char* db_dir,
-                 const unsigned char* genre,
-                 const unsigned char* key_type,
-                 const unsigned char* name,
+CONCORD_BDB_open (const char* db_dir,
+                 const char* genre,
+                 const char* key_type,
+                 const char* name,
                  DBTYPE real_subtype,
                  u_int32_t accessmask, int modemask)
 {
@@ -115,7 +112,7 @@ CONCORD_BDB_close (DB* db)
 }
 
 int
-CONCORD_BDB_get (DB* db, const unsigned char* key, DBT* valdatum)
+CONCORD_BDB_get (DB* db, const char* key, DBT* valdatum)
 {
   DBT keydatum;
   int status = 0;
@@ -132,7 +129,7 @@ CONCORD_BDB_get (DB* db, const unsigned char* key, DBT* valdatum)
 }
 
 int
-CONCORD_BDB_put (DB* db, const unsigned char* key, unsigned char* value)
+CONCORD_BDB_put (DB* db, const char* key, unsigned char* value)
 {
   DBT keydatum, valdatum;
   int status = 0;
@@ -145,7 +142,7 @@ CONCORD_BDB_put (DB* db, const unsigned char* key, unsigned char* value)
   keydatum.size = strlen (key);
 
   valdatum.data = value;
-  valdatum.size = strlen (value);
+  valdatum.size = strlen ((char*)value);
 
   status = db->put (db, NULL, &keydatum, &valdatum, 0);
   return status;