Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Vladishev <aleksander.vladishev@zabbix.com>2008-12-01 11:53:24 +0300
committerAlexander Vladishev <aleksander.vladishev@zabbix.com>2008-12-01 11:53:24 +0300
commit4de0b023cfa7285d4be8ea3b62eeb95065dfb7d4 (patch)
treec929cf169c2ba2713c837e40d7590e7070fbf200 /include/zbxtypes.h
parent0f57fd2f3cae756c5e0e2860035fb0ec4dbd4095 (diff)
- [DEV-266] added support of octal and hexadecimal data
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r--include/zbxtypes.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index dbca091ea99..6021487db04 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -31,6 +31,8 @@
# define zbx_uint64_t __int64
# define ZBX_FS_UI64 "%I64u"
+# define ZBX_FS_UO64 "%I64o"
+# define ZBX_FS_UX64 "%I64x"
# define ZBX_FS_UI64_NO(n) "%"#n"$I64u"
# define zbx_pid_t int
@@ -58,14 +60,20 @@
# define zbx_uint64_t uint64_t
# if __WORDSIZE == 64
# define ZBX_FS_UI64 "%lu"
+# define ZBX_FS_UO64 "%lo"
+# define ZBX_FS_UX64 "%lx"
# define ZBX_FS_UI64_NO(n) "%"#n"$lu"
# define ZBX_OFFSET 10000000000000000UL
# else /* __WORDSIZE == 64 */
# ifdef HAVE_LONG_LONG_QU
# define ZBX_FS_UI64 "%qu"
+# define ZBX_FS_UO64 "%qo"
+# define ZBX_FS_UX64 "%qx"
# define ZBX_FS_UI64_NO(n) "%"#n"$qu"
# else
# define ZBX_FS_UI64 "%llu"
+# define ZBX_FS_UO64 "%llo"
+# define ZBX_FS_UX64 "%llx"
# define ZBX_FS_UI64_NO(n) "%"#n"$llu"
# endif
# define ZBX_OFFSET 10000000000000000ULL
@@ -80,6 +88,8 @@
#endif
#define ZBX_STR2UINT64(uint,string) sscanf(string ,ZBX_FS_UI64 ,&uint);
+#define ZBX_OCT2UINT64(uint,string) sscanf(string ,ZBX_FS_UO64 ,&uint);
+#define ZBX_HEX2UINT64(uint,string) sscanf(string ,ZBX_FS_UX64 ,&uint);
#define ZBX_CONST_STRING(str) ""str