~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/archive/azio.h

  • Committer: Monty Taylor
  • Date: 2008-08-02 00:06:32 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802000632-jsse0zdd9r6ic5ku
Actually turn gettext on...

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 PLUGIN_ARCHIVE_AZIO_H
37
 
#define PLUGIN_ARCHIVE_AZIO_H
 
36
#ifndef __AZIO_H__
 
37
#define __AZIO_H__
38
38
 
39
39
/* We currently allow this on all platforms */
40
40
#define AZIO_AIO
41
41
 
42
 
#include <drizzled/common.h>
43
 
#include "drizzled/internal/my_sys.h"
 
42
#include <drizzled/global.h>
 
43
#include <mysys/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 + unsigned char
 
60
  uint64_t + uint64_t + uint64_t + uint64_t + uchar
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
 
  int     file;   /* .gz file */
 
245
  File     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,int fd, int Flags);
 
300
int azdopen(azio_stream *s,File 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
 
313
324
extern int azflush(azio_stream *file, int flush);
314
325
/*
315
326
     Flushes all pending output into the compressed file. The parameter
358
369
size_t azwrite_row(azio_stream *s, void *buf, unsigned int len);
359
370
size_t azread_row(azio_stream *s, int *error);
360
371
 
361
 
extern int azwrite_frm (azio_stream *s, const char *blob, unsigned int length);
 
372
extern int azwrite_frm (azio_stream *s, char *blob, unsigned int length);
362
373
extern int azread_frm (azio_stream *s, char *blob);
363
 
extern int azwrite_comment (azio_stream *s, const char *blob, unsigned int length);
 
374
extern int azwrite_comment (azio_stream *s, char *blob, unsigned int length);
364
375
extern int azread_comment (azio_stream *s, char *blob);
365
376
 
366
377
#ifdef  __cplusplus
367
378
}
368
379
#endif
369
380
 
370
 
#endif /* PLUGIN_ARCHIVE_AZIO_H */
 
381
#endif /* AZIO_H */