~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_sys.h

  • Committer: Brian Aker
  • Date: 2008-12-06 23:57:32 UTC
  • mfrom: (656.1.10 devel)
  • Revision ID: brian@tangent.org-20081206235732-jx228bczpvmxu8ww
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
/* Sun Studio does not inject this into main namespace yet */
37
37
#if defined(__cplusplus)
38
38
  using std::FILE;
39
 
#endif 
 
39
#endif
40
40
 
41
41
#define MY_INIT(name);          { my_progname= name; my_init(); }
42
42
 
150
150
                                   myf MyFlags);
151
151
#define TRASH(A,B) /* nothing */
152
152
 
153
 
#ifdef HAVE_ALLOCA
154
 
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
155
 
#define alloca __builtin_alloca
156
 
#endif /* GNUC */
157
 
#define my_alloca(SZ) malloc((size_t) (SZ))
158
 
#define my_afree(PTR) free((PTR))
159
 
#else
160
 
#define my_alloca(SZ) malloc((SZ))
161
 
#define my_afree(PTR) free((PTR))
162
 
#endif /* HAVE_ALLOCA */
163
 
 
164
153
#ifndef errno                           /* did we already get it? */
165
154
#ifdef HAVE_ERRNO_AS_DEFINE
166
155
#include <errno.h>                      /* errno is a define */
269
258
typedef struct st_dynamic_array
270
259
{
271
260
  unsigned char *buffer;
272
 
  uint32_t elements,max_element;
 
261
  size_t elements,max_element;
273
262
  uint32_t alloc_increment;
274
263
  uint32_t size_of_element;
275
264
} DYNAMIC_ARRAY;
321
310
#define my_b_tell(info) ((info)->pos_in_file + \
322
311
                         (size_t) (*(info)->current_pos - (info)->request_pos))
323
312
 
324
 
#define my_b_get_buffer_start(info) (info)->request_pos 
 
313
#define my_b_get_buffer_start(info) (info)->request_pos
325
314
#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end -   \
326
315
  (char*) my_b_get_buffer_start(info)
327
316
#define my_b_get_pos_in_file(info) (info)->pos_in_file
493
482
#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
494
483
#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E)
495
484
extern bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint32_t element_size,
496
 
                                   void *init_buffer, uint32_t init_alloc, 
 
485
                                   void *init_buffer, uint32_t init_alloc,
497
486
                                   uint32_t alloc_increment);
498
487
/* init_dynamic_array() function is deprecated */
499
488
extern bool init_dynamic_array(DYNAMIC_ARRAY *array,uint32_t element_size,