~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/azio.h

  • Committer: Brian Aker
  • Date: 2010-02-10 18:04:24 UTC
  • mfrom: (1286.1.5 build)
  • Revision ID: brian@gaz-20100210180424-03ypoyifmlc2lgcp
Merge of Brian/Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
34
34
*/
35
35
 
36
 
#ifndef __AZIO_H__
37
 
#define __AZIO_H__
 
36
#ifndef PLUGIN_ARCHIVE_AZIO_H
 
37
#define PLUGIN_ARCHIVE_AZIO_H
38
38
 
39
39
/* We currently allow this on all platforms */
40
40
#define AZIO_AIO
41
41
 
42
 
#include <drizzled/global.h>
43
 
#include <mysys/my_sys.h>
 
42
#include <drizzled/common.h>
 
43
#include "drizzled/internal/my_sys.h"
44
44
 
45
45
#include <zlib.h>
46
46
 
57
57
#define WATCHPOINT_ERRNO(A) fprintf(stderr, "\nWATCHPOINT %s:%d (%s) %s\n", __FILE__, __LINE__,__func__, strerror(A));A= 0;fflush(stderr);
58
58
 
59
59
/*
60
 
  uint64_t + uint64_t + uint64_t + uint64_t + uchar
 
60
  uint64_t + uint64_t + uint64_t + uint64_t + unsigned char
61
61
*/
62
62
#define AZMETA_BUFFER_SIZE sizeof(uint64_t) \
63
63
  + sizeof(uint64_t) + sizeof(uint64_t) + sizeof(uint64_t) \
242
242
  z_stream stream;
243
243
  int      z_err;   /* error code for last stream operation */
244
244
  int      z_eof;   /* set if end of input file */
245
 
  File     file;   /* .gz file */
 
245
  int     file;   /* .gz file */
246
246
  Byte     *inbuf;  /* input buffer */
247
247
  Byte     buffer1[AZ_BUFSIZE_READ];  /* input buffer */
248
248
  Byte     buffer2[AZ_BUFSIZE_READ];  /* input buffer */
297
297
   can be checked to distinguish the two cases (if errno is zero, the
298
298
   zlib error is Z_MEM_ERROR).  */
299
299
 
300
 
int azdopen(azio_stream *s,File fd, int Flags); 
 
300
int azdopen(azio_stream *s,int fd, int Flags);
301
301
/*
302
302
     azdopen() associates a azio_stream with the file descriptor fd.  File
303
303
   descriptors are obtained from calls like open, dup, creat, pipe or
310
310
   the (de)compression state.
311
311
*/
312
312
 
313
 
 
314
 
unsigned int azread_internal( azio_stream *s, voidp buf, unsigned int len, int *error);
315
 
/*
316
 
   This function is legacy, do not use.
317
 
 
318
 
     Reads the given number of uncompressed bytes from the compressed file.
319
 
   If the input file was not in gzip format, gzread copies the given number
320
 
   of bytes into the buffer.
321
 
     gzread returns the number of uncompressed bytes actually read (0 for
322
 
   end of file, -1 for error). */
323
 
 
324
313
extern int azflush(azio_stream *file, int flush);
325
314
/*
326
315
     Flushes all pending output into the compressed file. The parameter
369
358
size_t azwrite_row(azio_stream *s, void *buf, unsigned int len);
370
359
size_t azread_row(azio_stream *s, int *error);
371
360
 
372
 
extern int azwrite_frm (azio_stream *s, char *blob, unsigned int length);
 
361
extern int azwrite_frm (azio_stream *s, const char *blob, unsigned int length);
373
362
extern int azread_frm (azio_stream *s, char *blob);
374
 
extern int azwrite_comment (azio_stream *s, char *blob, unsigned int length);
 
363
extern int azwrite_comment (azio_stream *s, const char *blob, unsigned int length);
375
364
extern int azread_comment (azio_stream *s, char *blob);
376
365
 
377
366
#ifdef  __cplusplus
378
367
}
379
368
#endif
380
369
 
381
 
#endif /* AZIO_H */
 
370
#endif /* PLUGIN_ARCHIVE_AZIO_H */