1 | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB |
2 | 2012 by MontyProgram AB |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. |
8 | |
9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Library General Public |
15 | License along with this library; if not, write to the Free |
16 | Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
17 | MA 02111-1301, USA */ |
18 | |
19 | /* defines for the libmariadb library */ |
20 | |
21 | #ifndef _ma_string_h_ |
22 | #define _ma_string_h_ |
23 | |
24 | #include <string.h> |
25 | |
26 | typedef enum { |
27 | MY_GCVT_ARG_FLOAT, |
28 | MY_GCVT_ARG_DOUBLE |
29 | } my_gcvt_arg_type; |
30 | |
31 | size_t ma_fcvt(double x, int precision, char *to, my_bool *error); |
32 | size_t ma_gcvt(double x, my_gcvt_arg_type type, int width, char *to, |
33 | my_bool *error); |
34 | char *ma_ll2str(long long val,char *dst, int radix); |
35 | |
36 | #define MAX_ENV_SIZE 1024 |
37 | |
38 | static inline my_bool ma_check_env_str(const char *env) |
39 | { |
40 | unsigned int i; |
41 | |
42 | if (!env) |
43 | return 1; |
44 | |
45 | for (i=0; i < MAX_ENV_SIZE; i++) |
46 | { |
47 | if (env[i] == 0) |
48 | break; |
49 | } |
50 | if (i >= MAX_ENV_SIZE) |
51 | return 1; |
52 | return 0; |
53 | } |
54 | |
55 | #endif |
56 | |