~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mystrings/m_string.h

  • Committer: Monty Taylor
  • Date: 2009-03-06 03:33:24 UTC
  • mfrom: (916.1.2 merge)
  • Revision ID: mordred@inaugust.com-20090306033324-dcedf80g9qzywbvu
Merged Brian's merge... re-rotate the tree.

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? */
19
19
/*  This is needed for the definitions of strchr... on solaris */
20
20
 
21
21
 
22
 
#ifndef DRIZZLED_INTERNAL_M_STRING_H
23
 
#define DRIZZLED_INTERNAL_M_STRING_H
24
 
 
 
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
25
30
#if defined(HAVE_STRINGS_H)
26
31
#include <strings.h>
27
32
#endif
31
36
 
32
37
#include <stdlib.h>
33
38
#include <stddef.h>
34
 
#include <cassert>
 
39
#include <assert.h>
35
40
#include <limits.h>
36
41
#include <ctype.h>
37
42
 
40
45
#include <memory.h>
41
46
#endif
42
47
 
43
 
namespace drizzled
44
 
{
45
 
namespace internal
46
 
{
 
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)
47
54
 
48
55
extern void bmove_upp(unsigned char *dst,const unsigned char *src,size_t len);
49
56
 
54
61
extern  char *strfill(char * s,size_t len,char fill);
55
62
extern  char *strkey(char *dst,char *head,char *tail,char *flags);
56
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
57
67
 
58
68
extern  char *strsuff(const char *src,const char *suffix);
59
69
extern  char *strxcat(char *dst,const char *src, ...);
62
72
extern  char *strxncat(char *dst,size_t len, const char *src, ...);
63
73
extern  char *strxncpy(char *dst,size_t len, const char *src, ...);
64
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
#if !defined(__cplusplus)
 
85
#ifndef HAVE_STRPBRK
 
86
extern char *strpbrk(const char *, const char *);
 
87
#endif
 
88
#endif
 
89
extern int is_prefix(const char *, const char *);
 
90
 
65
91
/* Conversion routines */
66
92
typedef enum {
67
93
  MY_GCVT_ARG_FLOAT,
74
100
size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
75
101
               bool *error);
76
102
 
77
 
#define NOT_FIXED_DEC (uint8_t)31
 
103
#define NOT_FIXED_DEC 31
78
104
 
79
105
/*
80
106
  The longest string my_fcvt can return is 311 + "precision" bytes.
106
132
 
107
133
extern char *int2str(int32_t val, char *dst, int radix, int upcase);
108
134
extern char *int10_to_str(int32_t val,char *dst,int radix);
 
135
extern char *str2int(const char *src,int radix,long lower,long upper,
 
136
                     long *val);
109
137
int64_t my_strtoll10(const char *nptr, char **endptr, int *error);
110
138
extern char *int64_t2str(int64_t val,char *dst,int radix);
111
139
extern char *int64_t10_to_str(int64_t val,char *dst,int radix);
112
140
 
113
141
 
 
142
#if defined(__cplusplus)
 
143
}
 
144
#endif
 
145
 
 
146
 
114
147
/**
115
148
  Skip trailing space.
116
149
 
129
162
  return end+1;
130
163
}
131
164
 
132
 
} /* namespace internal */
133
 
} /* namespace drizzled */
134
 
 
135
 
#endif /* DRIZZLED_INTERNAL_M_STRING_H */
 
165
#endif