summaryrefslogtreecommitdiff
path: root/src/common/db.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-01-18 21:18:04 +0100
committerHaru <haru@dotalux.com>2015-06-01 10:11:39 +0200
commit2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293 (patch)
treea4533fa3136e43ab6f3a185019539bd0ae0c50b6 /src/common/db.h
parent41583070c88948264eee4e3683686606f88734eb (diff)
downloadhercules-2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293.tar.gz
hercules-2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293.tar.bz2
hercules-2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293.tar.xz
hercules-2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293.zip
Replaced some of the hardcoded values with constants (misc)
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/db.h')
-rw-r--r--src/common/db.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/common/db.h b/src/common/db.h
index cd61e1543..4883489d7 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -71,10 +71,10 @@
* @see #db_custom_release(DBRelease)
*/
typedef enum DBRelease {
- DB_RELEASE_NOTHING = 0,
- DB_RELEASE_KEY = 1,
- DB_RELEASE_DATA = 2,
- DB_RELEASE_BOTH = 3
+ DB_RELEASE_NOTHING = 0x0,
+ DB_RELEASE_KEY = 0x1,
+ DB_RELEASE_DATA = 0x2,
+ DB_RELEASE_BOTH = DB_RELEASE_KEY|DB_RELEASE_DATA,
} DBRelease;
/**
@@ -127,13 +127,13 @@ typedef enum DBType {
* @see #db_alloc(const char *,int,DBType,DBOptions,unsigned short)
*/
typedef enum DBOptions {
- DB_OPT_BASE = 0,
- DB_OPT_DUP_KEY = 1,
- DB_OPT_RELEASE_KEY = 2,
- DB_OPT_RELEASE_DATA = 4,
- DB_OPT_RELEASE_BOTH = 6,
- DB_OPT_ALLOW_NULL_KEY = 8,
- DB_OPT_ALLOW_NULL_DATA = 16,
+ DB_OPT_BASE = 0x00,
+ DB_OPT_DUP_KEY = 0x01,
+ DB_OPT_RELEASE_KEY = 0x02,
+ DB_OPT_RELEASE_DATA = 0x04,
+ DB_OPT_RELEASE_BOTH = DB_OPT_RELEASE_KEY|DB_OPT_RELEASE_DATA,
+ DB_OPT_ALLOW_NULL_KEY = 0x08,
+ DB_OPT_ALLOW_NULL_DATA = 0x10,
} DBOptions;
/**