~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/strutil_xt.h

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2005 PrimeBase Technologies GmbH
 
2
 *
 
3
 * PrimeBase XT
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
18
 *
 
19
 * 2005-01-03   Paul McCullagh
 
20
 *
 
21
 * H&G2JCtL
 
22
 */
 
23
 
 
24
#ifndef __xt_strutil_h__
 
25
#define __xt_strutil_h__
 
26
 
 
27
#include <string.h>
 
28
 
 
29
#include "xt_defs.h"
 
30
 
 
31
#ifdef XT_WIN
 
32
#define XT_DIR_CHAR                                     '\\'
 
33
#define XT_IS_DIR_CHAR(c)                       ((c) == '/' || (c) == '\\')
 
34
#else
 
35
#define XT_DIR_CHAR                                     '/'
 
36
#define XT_IS_DIR_CHAR(c)                       ((c) == '/')
 
37
#endif
 
38
 
 
39
#define MAX_INT8_STRING_SIZE            100
 
40
 
 
41
void    xt_strcpy(size_t size, char *to, c_char *from);
 
42
void    xt_strncpy(size_t size, char *to, c_char *from, size_t len_from);
 
43
void    xt_strcat(size_t size, char *to, c_char *from);
 
44
void    xt_strcati(size_t size, char *to, int i);
 
45
void    xt_strcpy_term(size_t size, char *to, c_char *from, char term);
 
46
void    xt_strcat_term(size_t size, char *to, c_char *from, char term);
 
47
 
 
48
xtBool  xt_ends_with(c_char *str, c_char *sub);
 
49
xtBool  xt_starts_with(c_char *str, c_char *sub);
 
50
 
 
51
char    *xt_last_2_names_of_path(c_char *path);
 
52
char    *xt_last_name_of_path(c_char *path);
 
53
void    xt_2nd_last_name_of_path(size_t size, char *dest, c_char *path);
 
54
c_char  *xt_last_directory_of_path(c_char *path);
 
55
xtBool  xt_remove_dir_char(char *dir_name);
 
56
xtBool  xt_add_dir_char(size_t max, char *path);
 
57
void    xt_remove_last_name_of_path(char *path);
 
58
char    *xt_find_extension(c_char *file_name);
 
59
void    xt_remove_extension(char *file_name);
 
60
xtBool  xt_is_extension(c_char *file_name, c_char *ext);
 
61
 
 
62
xtInt8  xt_str_to_int8(c_char *ptr, xtBool *overflow);
 
63
void    xt_int8_to_str(xtInt8 value, char *string);
 
64
void    xt_double_to_str(double value, int scale, char *string);
 
65
 
 
66
xtInt8  xt_byte_size_to_int8(c_char *ptr);
 
67
void    xt_int8_to_byte_size(xtInt8 value, char *string);
 
68
 
 
69
c_char  *xt_get_version(void);
 
70
 
 
71
void xt_strcpy_url(size_t size, char *to, c_char *from);
 
72
void xt_strncpy_url(size_t size, char *to, c_char *from, size_t len_from);
 
73
 
 
74
const char              *xt_strchr(const char *str, char ch);
 
75
unsigned char   xt_hex_digit(char ch);
 
76
 
 
77
#define XT_STAT_TIME_CURRENT            0
 
78
#define XT_STAT_TIME_PASSED                     1
 
79
 
 
80
#define XT_STAT_COMMITS                         2
 
81
#define XT_STAT_ROLLBACKS                       3
 
82
#define XT_STAT_WAIT_FOR_XACT           4
 
83
#define XT_STAT_XACT_TO_CLEAN           5
 
84
 
 
85
#define XT_STAT_STAT_READS                      6
 
86
#define XT_STAT_STAT_WRITES                     7
 
87
 
 
88
#define XT_STAT_REC_BYTES_IN            8
 
89
#define XT_STAT_REC_BYTES_OUT           9
 
90
#define XT_STAT_REC_SYNC_COUNT          10
 
91
#define XT_STAT_REC_SYNC_TIME           11
 
92
#define XT_STAT_REC_CACHE_HIT           12
 
93
#define XT_STAT_REC_CACHE_MISS          13
 
94
#define XT_STAT_REC_CACHE_FREES         14
 
95
#define XT_STAT_REC_CACHE_USAGE         15
 
96
 
 
97
#define XT_STAT_IND_BYTES_IN            16
 
98
#define XT_STAT_IND_BYTES_OUT           17
 
99
#define XT_STAT_IND_SYNC_COUNT          18
 
100
#define XT_STAT_IND_SYNC_TIME           19
 
101
#define XT_STAT_IND_CACHE_HIT           20
 
102
#define XT_STAT_IND_CACHE_MISS          21
 
103
#define XT_STAT_IND_CACHE_USAGE         22
 
104
#define XT_STAT_ILOG_BYTES_IN           23
 
105
#define XT_STAT_ILOG_BYTES_OUT          24
 
106
#define XT_STAT_ILOG_SYNC_COUNT         25
 
107
#define XT_STAT_ILOG_SYNC_TIME          26
 
108
 
 
109
#define XT_STAT_XLOG_BYTES_IN           27
 
110
#define XT_STAT_XLOG_BYTES_OUT          28
 
111
#define XT_STAT_XLOG_SYNC_COUNT         29
 
112
#define XT_STAT_XLOG_SYNC_TIME          30
 
113
#define XT_STAT_XLOG_CACHE_HIT          31
 
114
#define XT_STAT_XLOG_CACHE_MISS         32
 
115
#define XT_STAT_XLOG_CACHE_USAGE        33
 
116
 
 
117
#define XT_STAT_DATA_BYTES_IN           34
 
118
#define XT_STAT_DATA_BYTES_OUT          35
 
119
#define XT_STAT_DATA_SYNC_COUNT         36
 
120
#define XT_STAT_DATA_SYNC_TIME          37
 
121
 
 
122
#define XT_STAT_BYTES_TO_CHKPNT         38
 
123
#define XT_STAT_LOG_BYTES_TO_WRITE      39
 
124
#define XT_STAT_BYTES_TO_SWEEP          40
 
125
#define XT_STAT_SWEEPER_WAITS           41
 
126
 
 
127
#define XT_STAT_SCAN_INDEX                      42
 
128
#define XT_STAT_SCAN_TABLE                      43
 
129
#define XT_STAT_ROW_SELECT                      44
 
130
#define XT_STAT_ROW_INSERT                      45
 
131
#define XT_STAT_ROW_UPDATE                      46
 
132
#define XT_STAT_ROW_DELETE                      47
 
133
 
 
134
#define XT_STAT_RETRY_INDEX_SCAN        48
 
135
#define XT_STAT_REREAD_REC_LIST         49
 
136
 
 
137
#define XT_STAT_IND_CACHE_DIRTY         50
 
138
 
 
139
#ifdef XT_TIME_DISK_WRITES
 
140
 
 
141
#define XT_STAT_REC_WRITE_TIME          51
 
142
#define XT_STAT_IND_WRITE_TIME          52
 
143
#define XT_STAT_ILOG_WRITE_TIME         53
 
144
#define XT_STAT_XLOG_WRITE_TIME         54
 
145
#define XT_STAT_DATA_WRITE_TIME         55
 
146
 
 
147
#ifdef XT_TIME_DISK_READS
 
148
#define XT_STAT_REC_READ_TIME           56
 
149
#define XT_STAT_IND_READ_TIME           57
 
150
#define XT_STAT_LOG_READ_TIME           58
 
151
 
 
152
#define XT_STAT_CURRENT_MAX                     59
 
153
#define XT_STAT_MAXIMUM                         59
 
154
#else // XT_TIME_DISK_READS
 
155
#define XT_STAT_CURRENT_MAX                     56
 
156
#define XT_STAT_MAXIMUM                         56
 
157
#endif // XT_TIME_DISK_READS
 
158
 
 
159
#else // XT_TIME_DISK_WRITES
 
160
 
 
161
#ifdef XT_TIME_DISK_READS
 
162
#define XT_STAT_REC_READ_TIME           51
 
163
#define XT_STAT_IND_READ_TIME           52
 
164
#define XT_STAT_LOG_READ_TIME           53
 
165
 
 
166
#define XT_STAT_CURRENT_MAX                     54
 
167
#define XT_STAT_MAXIMUM                         54
 
168
#else // XT_TIME_DISK_READS
 
169
#define XT_STAT_CURRENT_MAX                     51
 
170
#define XT_STAT_MAXIMUM                         51
 
171
#endif
 
172
 
 
173
#endif // XT_TIME_DISK_WRITES
 
174
 
 
175
#define XT_STAT_ACCUMULATIVE            1
 
176
#define XT_STAT_BYTE_COUNT                      2
 
177
#define XT_STAT_PERCENTAGE                      4
 
178
#define XT_STAT_COMBO_FIELD                     8                               /* Field is short, 2 chars instead of 5. */
 
179
#define XT_STAT_COMBO_FIELD_2           16                              /* Field is short, 2 chars instead of 5. */
 
180
#define XT_STAT_TIME_VALUE                      32
 
181
#define XT_STAT_DATE                            64
 
182
 
 
183
typedef struct XTStatMetaData {
 
184
        int                             sm_id;
 
185
        const char              *sm_name;
 
186
        const char              *sm_short_line_1;
 
187
        const char              *sm_short_line_2;
 
188
        int                             sm_flags;
 
189
        const char              *sm_description;
 
190
} XTStatMetaDataRec, *XTStatMetaDataPtr;
 
191
 
 
192
XTStatMetaDataPtr       xt_get_stat_meta_data(int i);
 
193
int                                     xt_get_stat_meta_order(int i);
 
194
void                            xt_set_time_unit(const char *u);
 
195
 
 
196
#ifdef XT_WIN
 
197
void    xt_win_dialog(char *message);
 
198
#endif
 
199
 
 
200
#endif