diff options
author | Haru <haru@dotalux.com> | 2014-01-18 21:18:04 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-06-01 10:11:39 +0200 |
commit | 2e5e04c5b6e248cb05df4814dbe0d7eed2fe0293 (patch) | |
tree | a4533fa3136e43ab6f3a185019539bd0ae0c50b6 /src/common/db.h | |
parent | 41583070c88948264eee4e3683686606f88734eb (diff) | |
download | hercules-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.h | 22 |
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; /** |