summaryrefslogtreecommitdiffstats
path: root/libmariadb/include/ma_string.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
commita175314c3e5827eb193872241446f2f8f5c9d33c (patch)
treecd3d60ca99ae00829c52a6ca79150a5b6e62528b /libmariadb/include/ma_string.h
parentInitial commit. (diff)
downloadmariadb-10.5-upstream.tar.xz
mariadb-10.5-upstream.zip
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmariadb/include/ma_string.h')
-rw-r--r--libmariadb/include/ma_string.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/libmariadb/include/ma_string.h b/libmariadb/include/ma_string.h
new file mode 100644
index 00000000..10325387
--- /dev/null
+++ b/libmariadb/include/ma_string.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+ 2012 by MontyProgram AB
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02111-1301, USA */
+
+/* defines for the libmariadb library */
+
+#ifndef _ma_string_h_
+#define _ma_string_h_
+
+#include <string.h>
+
+typedef enum {
+ MY_GCVT_ARG_FLOAT,
+ MY_GCVT_ARG_DOUBLE
+} my_gcvt_arg_type;
+
+size_t ma_fcvt(double x, int precision, char *to, my_bool *error);
+size_t ma_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
+ my_bool *error);
+char *ma_ll2str(long long val,char *dst, int radix);
+
+#define MAX_ENV_SIZE 1024
+
+static inline my_bool ma_check_env_str(const char *env)
+{
+ unsigned int i;
+
+ if (!env)
+ return 1;
+
+ for (i=0; i < MAX_ENV_SIZE; i++)
+ {
+ if (env[i] == 0)
+ break;
+ }
+ if (i >= MAX_ENV_SIZE)
+ return 1;
+ return 0;
+}
+
+#endif