#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "zlib.h"
#include "gzlog.h"
Go to the source code of this file.
|
typedef unsigned int | uint |
|
typedef unsigned long | ulong |
|
|
static int | log_lock (struct log *log) |
|
static void | log_touch (struct log *log) |
|
static int | log_check (struct log *log) |
|
static void | log_unlock (struct log *log) |
|
static int | log_head (struct log *log) |
|
static int | log_mark (struct log *log, int op) |
|
static int | log_last (struct log *log, int last) |
|
static int | log_append (struct log *log, unsigned char *data, size_t len) |
|
static int | log_replace (struct log *log) |
|
static int | log_compress (struct log *log, unsigned char *data, size_t len) |
|
static void | log_log (struct log *log, int op, char *record) |
|
static int | log_recover (struct log *log, int op) |
|
static void | log_close (struct log *log) |
|
static int | log_open (struct log *log) |
|
gzlog * | gzlog_open (char *path) |
|
int | gzlog_compress (gzlog *logd) |
|
int | gzlog_write (gzlog *logd, void *data, size_t len) |
|
int | gzlog_close (gzlog *logd) |
|
Definition at line 289 of file gzlog.c.
Class Members |
int |
back |
|
ulong |
ccrc |
|
ulong |
clen |
|
char * |
end |
|
int |
fd |
|
off_t |
first |
|
char |
id[4] |
|
off_t |
last |
|
time_t |
lock |
|
char * |
path |
|
uint |
stored |
|
ulong |
tcrc |
|
ulong |
tlen |
|
#define EXTRA sizeof(log_gzext) /* should be 35 */ |
#define HEAD sizeof(log_gzhead) /* should be 16 */ |
#define LOGID "\106\035\172" /* should be three non-zero characters */ |
#define PULL2 |
( |
|
p | ) |
((p)[0]+((uint)((p)[1])<<8)) |
#define PULL8 |
( |
|
p | ) |
(PULL4(p)+((off_t)PULL4(p+4)<<32)) |
#define PUT2 |
( |
|
p, |
|
|
|
a |
|
) |
| do {(p)[0]=a;(p)[1]=(a)>>8;} while(0) |
#define PUT4 |
( |
|
p, |
|
|
|
a |
|
) |
| do {PUT2(p,a);PUT2(p+2,a>>16);} while(0) |
#define PUT8 |
( |
|
p, |
|
|
|
a |
|
) |
| do {PUT4(p,a);PUT4(p+4,a>>32);} while(0) |
typedef unsigned int uint |
typedef unsigned long ulong |
int gzlog_close |
( |
gzlog * |
logd | ) |
|
int gzlog_compress |
( |
gzlog * |
logd | ) |
|
gzlog* gzlog_open |
( |
char * |
path | ) |
|
int gzlog_write |
( |
gzlog * |
logd, |
|
|
void * |
data, |
|
|
size_t |
len |
|
) |
| |
static int log_append |
( |
struct log * |
log, |
|
|
unsigned char * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
static int log_check |
( |
struct log * |
log | ) |
|
|
static |
static void log_close |
( |
struct log * |
log | ) |
|
|
static |
static int log_compress |
( |
struct log * |
log, |
|
|
unsigned char * |
data, |
|
|
size_t |
len |
|
) |
| |
|
static |
static int log_head |
( |
struct log * |
log | ) |
|
|
static |
static int log_last |
( |
struct log * |
log, |
|
|
int |
last |
|
) |
| |
|
static |
static int log_lock |
( |
struct log * |
log | ) |
|
|
static |
static void log_log |
( |
struct log * |
log, |
|
|
int |
op, |
|
|
char * |
record |
|
) |
| |
|
static |
static int log_mark |
( |
struct log * |
log, |
|
|
int |
op |
|
) |
| |
|
static |
static int log_open |
( |
struct log * |
log | ) |
|
|
static |
static int log_recover |
( |
struct log * |
log, |
|
|
int |
op |
|
) |
| |
|
static |
static int log_replace |
( |
struct log * |
log | ) |
|
|
static |
static void log_touch |
( |
struct log * |
log | ) |
|
|
static |
static void log_unlock |
( |
struct log * |
log | ) |
|
|
static |
unsigned char log_gzbody[] |
|
static |
Initial value:= {
1, 0, 0, 0xff, 0xff,
0, 0, 0, 0,
0, 0, 0, 0
}
Definition at line 331 of file gzlog.c.
unsigned char log_gzext[] |
|
static |
Initial value:= {
52, 0, 0, 0, 0, 0, 0, 0,
52, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
5
}
Definition at line 319 of file gzlog.c.
unsigned char log_gzhead[] |
|
static |
Initial value:= {
0x1f, 0x8b,
8,
4,
0, 0, 0, 0,
0, 0xff,
39, 0, 'a', 'p', 35, 0
}
Definition at line 306 of file gzlog.c.