~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/m_string.h

  • Committer: Mark Atwood
  • Date: 2011-08-09 01:21:52 UTC
  • mfrom: (2380.1.2 drizzle-autoconf)
  • Revision ID: me@mark.atwood.name-20110809012152-zxq2dgan8e6nsvse
mergeĀ lp:~brianaker/drizzle/autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 
24
 
#if defined(HAVE_STRINGS_H)
 
19
#pragma once
 
20
 
25
21
#include <strings.h>
26
 
#endif
27
 
#if defined(HAVE_STRING_H)
28
22
#include <string.h>
29
 
#endif
30
 
 
31
23
#include <stdlib.h>
32
24
#include <stddef.h>
33
25
#include <cassert>
34
26
#include <limits.h>
35
27
#include <ctype.h>
36
28
 
37
 
/*  This is needed for the definitions of memcpy... on solaris */
38
 
#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
39
 
#include <memory.h>
40
 
#endif
41
 
 
42
 
 
43
 
#include "drizzled/visibility.h"
44
 
 
45
 
namespace drizzled
46
 
{
47
 
namespace internal
48
 
{
 
29
#include <drizzled/visibility.h>
 
30
 
 
31
namespace drizzled {
 
32
namespace internal {
49
33
 
50
34
extern void bmove_upp(unsigned char *dst,const unsigned char *src,size_t len);
51
35
 
52
 
extern  void bchange(unsigned char *dst,size_t old_len,const unsigned char *src,
53
 
                     size_t new_len,size_t tot_len);
54
 
extern  char *strfield(char *src,int fields,int chars,int blanks,
55
 
                           int tabch);
56
 
extern  char *strfill(char * s,size_t len,char fill);
57
 
extern  char *strkey(char *dst,char *head,char *tail,char *flags);
58
 
extern  char *strmake(char *dst,const char *src,size_t length);
59
 
 
60
 
extern  char *strsuff(const char *src,const char *suffix);
61
 
extern  char *strxcat(char *dst,const char *src, ...);
62
 
extern  char *strxmov(char *dst,const char *src, ...);
63
 
extern  char *strxcpy(char *dst,const char *src, ...);
64
 
extern  char *strxncat(char *dst,size_t len, const char *src, ...);
65
 
extern  char *strxncpy(char *dst,size_t len, const char *src, ...);
66
 
 
67
36
/* Conversion routines */
68
 
typedef enum {
 
37
enum my_gcvt_arg_type
 
38
{
69
39
  MY_GCVT_ARG_FLOAT,
70
40
  MY_GCVT_ARG_DOUBLE
71
 
} my_gcvt_arg_type;
 
41
};
72
42
 
73
43
DRIZZLED_API double my_strtod(const char *str, char **end, int *error);
74
44
DRIZZLED_API double my_atof(const char *nptr);
75
45
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);
 
46
DRIZZLED_API size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, bool *error);
78
47
 
79
48
#define NOT_FIXED_DEC (uint8_t)31
80
49
 
95
64
*/
96
65
#define MAX_DECPT_FOR_F_FORMAT DBL_DIG
97
66
 
98
 
/*
99
 
  The maximum possible field width for my_gcvt() conversion.
100
 
  (DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or
101
 
  MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used).
102
 
*/
103
 
#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + cmax(5, MAX_DECPT_FOR_F_FORMAT))
104
 
 
105
 
 
106
67
extern char *llstr(int64_t value,char *buff);
107
68
extern char *ullstr(int64_t value,char *buff);
108
69
 
134
95
} /* namespace internal */
135
96
} /* namespace drizzled */
136
97
 
137
 
#endif /* DRIZZLED_INTERNAL_M_STRING_H */