226 #include <sys/types.h>
235 #include <sys/stat.h>
236 #include <sys/time.h>
250 int gzlog_count = -1;
251 # define BAIL(n) do { if (n == gzlog_bail && gzlog_count-- == 0) \
252 longjmp(gzlog_jump, gzlog_bail); } while (0)
274 #define COMPRESS_OP 2
278 #define PULL2(p) ((p)[0]+((uint)((p)[1])<<8))
279 #define PULL4(p) (PULL2(p)+((ulong)PULL2(p+2)<<16))
280 #define PULL8(p) (PULL4(p)+((off_t)PULL4(p+4)<<32))
283 #define PUT2(p,a) do {(p)[0]=a;(p)[1]=(a)>>8;} while(0)
284 #define PUT4(p,a) do {PUT2(p,a);PUT2(p+2,a>>16);} while(0)
285 #define PUT8(p,a) do {PUT4(p,a);PUT4(p+4,a>>32);} while(0)
288 #define LOGID "\106\035\172"
312 39, 0,
'a',
'p', 35, 0
316 #define HEAD sizeof(log_gzhead)
320 52, 0, 0, 0, 0, 0, 0, 0,
321 52, 0, 0, 0, 0, 0, 0, 0,
322 0, 0, 0, 0, 0, 0, 0, 0,
323 0, 0, 0, 0, 0, 0, 0, 0,
328 #define EXTRA sizeof(log_gzext)
337 #define BODY sizeof(log_gzbody)
353 strcpy(
log->
end,
".lock");
376 strcpy(
log->
end,
".lock");
388 strcpy(
log->
end,
".lock");
400 strcpy(
log->
end,
".lock");
465 unsigned char buf[6];
469 len = back > 8 ? 2 : 1;
470 mask = 0x80 >> ((back - 1) & 7);
505 unsigned char buf[8];
582 strcpy(
log->
end,
".dict");
587 strcpy(
log->
end,
".temp");
590 if (ret && errno !=
ENOENT)
628 strcpy(
log->
end,
".dict");
654 max = (((
uint)0 - 1) >> 1) + 1;
724 strcpy(
log->
end,
".repairs");
728 fprintf(rec,
"%.24s %s recovery: %s\n", ctime(&now),
op ==
APPEND_OP ?
741 unsigned char *data =
NULL;
845 strcpy(
log->
end,
".dict");
915 unsigned char *data,
buf[5];
944 if (next + block >
len ||
945 read(
log->
fd, (
char *)data + next, block) != block)
964 strcpy(
log->
end,
".temp");
1015 strcpy(
log->
end,
".add");
1058 strcpy(
log->
id,
"bad");
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence ftruncate
static static fork const void static count close
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg fsync
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep lseek
int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
int ZEXPORT deflatePrime(z_streamp strm, int bits, int value)
int ZEXPORT deflateEnd(z_streamp strm)
int ZEXPORT deflate(z_streamp strm, int flush)
int log_last(struct log *log, int last)
void log_unlock(struct log *log)
int log_mark(struct log *log, int op)
int gzlog_compress(gzlog *logd)
int gzlog_write(gzlog *logd, void *data, size_t len)
int gzlog_close(gzlog *logd)
int log_append(struct log *log, unsigned char *data, size_t len)
int log_head(struct log *log)
void log_close(struct log *log)
unsigned char log_gzhead[]
int log_check(struct log *log)
unsigned char log_gzbody[]
int log_replace(struct log *log)
unsigned char log_gzext[]
gzlog * gzlog_open(char *path)
void log_touch(struct log *log)
void log_log(struct log *log, int op, char *record)
int log_recover(struct log *log, int op)
int log_open(struct log *log)
int log_compress(struct log *log, unsigned char *data, size_t len)
int log_lock(struct log *log)
RZ_API void Ht_() free(HtName_(Ht) *ht)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time
static static fork const void static count static fd const char static mode unlink
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync rename
if(dbg->bits==RZ_SYS_BITS_64)
static const z80_opcode fd[]
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
#define Z_DEFAULT_STRATEGY
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy)
#define Z_DEFAULT_COMPRESSION
int read(izstream &zs, T *x, Items items)