summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2019-11-21 10:06:15 +0100
committerGitHub <noreply@github.com>2019-11-21 10:06:15 +0100
commit64c2508ee3e7ab86f1cc03d214061305a1a410fb (patch)
tree82900519c72a729bac321ae732b4866eea45d6fd /src/util.h
parent04233097688ee35d451c6f5cd64c28e57ca81b53 (diff)
parentf1f259de5bc1785f22b663b8af78b887ddea5c6c (diff)
downloadredis-64c2508ee3e7ab86f1cc03d214061305a1a410fb.tar.gz
Merge branch 'unstable' into rm_get_server_info
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 7e162686e..e9ad0ee4d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -38,6 +38,13 @@
* This should be the size of the buffer given to ld2string */
#define MAX_LONG_DOUBLE_CHARS 5*1024
+/* long double to string convertion options */
+typedef enum {
+ LD_STR_AUTO, /* %.17Lg */
+ LD_STR_HUMAN, /* %.17Lf + Trimming of trailing zeros */
+ LD_STR_HEX /* %La */
+} ld2string_mode;
+
int stringmatchlen(const char *p, int plen, const char *s, int slen, int nocase);
int stringmatch(const char *p, const char *s, int nocase);
int stringmatchlen_fuzz_test(void);
@@ -51,7 +58,7 @@ int string2l(const char *s, size_t slen, long *value);
int string2ld(const char *s, size_t slen, long double *dp);
int string2d(const char *s, size_t slen, double *dp);
int d2string(char *buf, size_t len, double value);
-int ld2string(char *buf, size_t len, long double value, int humanfriendly);
+int ld2string(char *buf, size_t len, long double value, ld2string_mode mode);
sds getAbsolutePath(char *filename);
unsigned long getTimeZone(void);
int pathIsBaseName(char *path);