~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/m_string.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-26 04:24:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: osullivan.padraig@gmail.com-20090826042402-ryh95r58b7godtbj
Made all data members of the KeyField class private and provided accessors
when necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/* There may be prolems include all of theese. Try to test in
17
17
   configure with ones are needed? */
18
18
 
19
 
 
20
 
 
21
 
#ifndef DRIZZLED_INTERNAL_M_STRING_H
22
 
#define DRIZZLED_INTERNAL_M_STRING_H
23
 
 
 
19
/*  This is needed for the definitions of strchr... on solaris */
 
20
 
 
21
 
 
22
#ifndef _m_string_h
 
23
#define _m_string_h
 
24
 
 
25
#include <drizzled/global.h>
 
26
 
 
27
#ifndef __USE_GNU
 
28
#define __USE_GNU                               /* We want to use my_stpcpy */
 
29
#endif
24
30
#if defined(HAVE_STRINGS_H)
25
31
#include <strings.h>
26
32
#endif
30
36
 
31
37
#include <stdlib.h>
32
38
#include <stddef.h>
33
 
#include <cassert>
 
39
#include <assert.h>
34
40
#include <limits.h>
35
41
#include <ctype.h>
36
42
 
39
45
#include <memory.h>
40
46
#endif
41
47
 
42
 
 
43
 
#include "drizzled/visibility.h"
44
 
 
45
 
namespace drizzled
46
 
{
47
 
namespace internal
48
 
{
 
48
#if defined(__cplusplus)
 
49
extern "C" {
 
50
#endif
 
51
 
 
52
#define strmov_overlapp(A,B) my_stpcpy(A,B)
 
53
#define strmake_overlapp(A,B,C) strmake(A,B,C)
49
54
 
50
55
extern void bmove_upp(unsigned char *dst,const unsigned char *src,size_t len);
51
56
 
56
61
extern  char *strfill(char * s,size_t len,char fill);
57
62
extern  char *strkey(char *dst,char *head,char *tail,char *flags);
58
63
extern  char *strmake(char *dst,const char *src,size_t length);
 
64
#ifndef strmake_overlapp
 
65
extern  char *strmake_overlapp(char *dst,const char *src, size_t length);
 
66
#endif
59
67
 
60
68
extern  char *strsuff(const char *src,const char *suffix);
61
69
extern  char *strxcat(char *dst,const char *src, ...);
64
72
extern  char *strxncat(char *dst,size_t len, const char *src, ...);
65
73
extern  char *strxncpy(char *dst,size_t len, const char *src, ...);
66
74
 
 
75
/* Prototypes of normal stringfunctions (with may ours) */
 
76
 
 
77
#ifdef WANT_STRING_PROTOTYPES
 
78
extern char *strcat(char *, const char *);
 
79
extern char *strchr(const char *, char);
 
80
extern char *strrchr(const char *, char);
 
81
extern char *strcpy(char *, const char *);
 
82
#endif
 
83
 
 
84
extern int is_prefix(const char *, const char *);
 
85
 
67
86
/* Conversion routines */
68
87
typedef enum {
69
88
  MY_GCVT_ARG_FLOAT,
70
89
  MY_GCVT_ARG_DOUBLE
71
90
} my_gcvt_arg_type;
72
91
 
73
 
DRIZZLED_API double my_strtod(const char *str, char **end, int *error);
74
 
DRIZZLED_API double my_atof(const char *nptr);
75
 
DRIZZLED_API size_t my_fcvt(double x, int precision, char *to, bool *error);
76
 
DRIZZLED_API size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
77
 
                            bool *error);
 
92
double my_strtod(const char *str, char **end, int *error);
 
93
double my_atof(const char *nptr);
 
94
size_t my_fcvt(double x, int precision, char *to, bool *error);
 
95
size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
 
96
               bool *error);
78
97
 
79
98
#define NOT_FIXED_DEC (uint8_t)31
80
99
 
108
127
 
109
128
extern char *int2str(int32_t val, char *dst, int radix, int upcase);
110
129
extern char *int10_to_str(int32_t val,char *dst,int radix);
111
 
DRIZZLED_API int64_t my_strtoll10(const char *nptr, char **endptr, int *error);
112
 
DRIZZLED_API char *int64_t2str(int64_t val,char *dst,int radix);
113
 
DRIZZLED_API char *int64_t10_to_str(int64_t val,char *dst,int radix);
 
130
int64_t my_strtoll10(const char *nptr, char **endptr, int *error);
 
131
extern char *int64_t2str(int64_t val,char *dst,int radix);
 
132
extern char *int64_t10_to_str(int64_t val,char *dst,int radix);
 
133
 
 
134
 
 
135
#if defined(__cplusplus)
 
136
}
 
137
#endif
114
138
 
115
139
 
116
140
/**
131
155
  return end+1;
132
156
}
133
157
 
134
 
} /* namespace internal */
135
 
} /* namespace drizzled */
136
 
 
137
 
#endif /* DRIZZLED_INTERNAL_M_STRING_H */
 
158
#endif