Visualization Library 2.0.0-b5
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
#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.
Macros | |
#define | local static |
#define | BAIL(n) |
#define | PATIENCE 300 |
#define | MAX_STORE 16 |
#define | TRIGGER 1024 |
#define | DICT 32768U |
#define | NO_OP 0 |
#define | APPEND_OP 1 |
#define | COMPRESS_OP 2 |
#define | REPLACE_OP 3 |
#define | PULL2(p) ((p)[0]+((uint)((p)[1])<<8)) |
#define | PULL4(p) (PULL2(p)+((ulong)PULL2(p+2)<<16)) |
#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) |
#define | LOGID "\106\035\172" /* should be three non-zero characters */ |
#define | HEAD sizeof(log_gzhead) /* should be 16 */ |
#define | EXTRA sizeof(log_gzext) /* should be 35 */ |
#define | BODY sizeof(log_gzbody) |
Typedefs | |
typedef unsigned int | uint |
typedef unsigned long | ulong |
Functions | |
local int | log_lock (struct log *log) |
local void | log_touch (struct log *log) |
local int | log_check (struct log *log) |
local void | log_unlock (struct log *log) |
local int | log_head (struct log *log) |
local int | log_mark (struct log *log, int op) |
local int | log_last (struct log *log, int last) |
local int | log_append (struct log *log, unsigned char *data, size_t len) |
local int | log_replace (struct log *log) |
local int | log_compress (struct log *log, unsigned char *data, size_t len) |
local void | log_log (struct log *log, int op, char *record) |
local int | log_recover (struct log *log, int op) |
local void | log_close (struct log *log) |
local 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) |
Variables | |
local unsigned char | log_gzhead [] |
local unsigned char | log_gzext [] |
local unsigned char | log_gzbody [] |
#define APPEND_OP 1 |
Definition at line 273 of file gzlog.c.
Referenced by gzlog_write(), log_log(), and log_recover().
#define BAIL | ( | n | ) |
Definition at line 254 of file gzlog.c.
Referenced by gzlog_compress(), gzlog_write(), log_append(), log_compress(), and log_replace().
#define BODY sizeof(log_gzbody) |
Definition at line 337 of file gzlog.c.
Referenced by log_open().
#define COMPRESS_OP 2 |
Definition at line 274 of file gzlog.c.
Referenced by gzlog_compress(), log_log(), and log_recover().
#define DICT 32768U |
Definition at line 269 of file gzlog.c.
Referenced by gzlog_compress(), and log_compress().
Definition at line 328 of file gzlog.c.
Referenced by log_head(), log_mark(), and log_open().
#define HEAD sizeof(log_gzhead) /* should be 16 */ |
Definition at line 316 of file gzlog.c.
Referenced by log_head(), log_mark(), and log_open().
#define LOGID "\106\035\172" /* should be three non-zero characters */ |
Definition at line 288 of file gzlog.c.
Referenced by gzlog_close(), gzlog_compress(), gzlog_open(), and gzlog_write().
#define MAX_STORE 16 |
Definition at line 261 of file gzlog.c.
Referenced by log_append().
#define NO_OP 0 |
Definition at line 272 of file gzlog.c.
Referenced by log_append(), log_open(), and log_replace().
#define PATIENCE 300 |
Definition at line 258 of file gzlog.c.
Referenced by log_lock().
Definition at line 278 of file gzlog.c.
Referenced by gzlog_compress(), and log_head().
Definition at line 279 of file gzlog.c.
Referenced by log_head().
Definition at line 280 of file gzlog.c.
Referenced by log_head().
Definition at line 283 of file gzlog.c.
Referenced by log_last(), and log_mark().
Definition at line 284 of file gzlog.c.
Referenced by log_append(), log_compress(), and log_mark().
Definition at line 285 of file gzlog.c.
Referenced by log_mark().
#define REPLACE_OP 3 |
Definition at line 275 of file gzlog.c.
Referenced by log_compress(), and log_recover().
#define TRIGGER 1024 |
Definition at line 266 of file gzlog.c.
Referenced by gzlog_write().
Definition at line 908 of file gzlog.c.
References BAIL, close(), COMPRESS_OP, DICT, free(), vl::log(), log_check(), log_compress(), log_mark(), log_open(), log_touch(), LOGID, lseek(), malloc(), NULL, open(), PULL2, read(), SEEK_CUR, SEEK_SET, and write().
Referenced by gzlog_write().
gzlog* gzlog_open | ( | char * | path | ) |
Definition at line 995 of file gzlog.c.
References APPEND_OP, BAIL, close(), gzlog_compress(), vl::log(), log_append(), log_check(), log_mark(), log_open(), log_touch(), LOGID, NULL, open(), TRIGGER, and write().
Definition at line 501 of file gzlog.c.
References BAIL, crc32(), if(), log_last(), log_mark(), lseek(), MAX_STORE, NO_OP, PUT4, SEEK_CUR, and write().
Referenced by gzlog_write(), and log_recover().
Definition at line 384 of file gzlog.c.
References log_touch().
Referenced by gzlog_compress(), gzlog_write(), and log_unlock().
Definition at line 796 of file gzlog.c.
References close(), and log_unlock().
Referenced by gzlog_close(), and log_open().
Definition at line 608 of file gzlog.c.
References z_stream_s::avail_in, z_stream_s::avail_out, BAIL, close(), deflate(), deflateEnd(), deflateInit2, deflatePrime(), deflateSetDictionary(), DICT, log_last(), log_mark(), log_replace(), log_touch(), lseek(), max, z_stream_s::next_in, z_stream_s::next_out, z_stream_s::opaque, open(), PUT4, read(), REPLACE_OP, SEEK_CUR, SEEK_SET, write(), Z_DEFAULT_COMPRESSION, Z_DEFAULT_STRATEGY, Z_DEFLATED, Z_NO_FLUSH, Z_NULL, Z_OK, Z_PARTIAL_FLUSH, z_stream_s::zalloc, and z_stream_s::zfree.
Referenced by gzlog_compress(), and log_recover().
Definition at line 462 of file gzlog.c.
References lseek(), PUT2, read(), SEEK_CUR, SEEK_SET, and write().
Referenced by log_append(), and log_compress().
Definition at line 718 of file gzlog.c.
References APPEND_OP, COMPRESS_OP, and NULL.
Referenced by log_recover().
Definition at line 437 of file gzlog.c.
References EXTRA, HEAD, lseek(), PUT2, PUT4, PUT8, SEEK_SET, and write().
Referenced by gzlog_compress(), gzlog_write(), log_append(), log_compress(), and log_replace().
Definition at line 813 of file gzlog.c.
References BODY, close(), EXTRA, HEAD, log_close(), log_gzbody, log_gzext, log_gzhead, log_head(), log_lock(), log_recover(), log_touch(), lseek(), NO_OP, open(), SEEK_END, and write().
Referenced by gzlog_compress(), gzlog_open(), and gzlog_write().
Definition at line 738 of file gzlog.c.
References APPEND_OP, close(), COMPRESS_OP, free(), log_append(), log_compress(), log_log(), log_replace(), malloc(), NULL, open(), read(), and REPLACE_OP.
Referenced by log_open().
Definition at line 571 of file gzlog.c.
References BAIL, free(), log_mark(), malloc(), NO_OP, and NULL.
Referenced by log_compress(), and log_recover().
Definition at line 372 of file gzlog.c.
References NULL.
Referenced by gzlog_compress(), gzlog_write(), log_check(), log_compress(), and log_open().
local unsigned char log_gzbody[] |
Definition at line 331 of file gzlog.c.
Referenced by log_open().
local unsigned char log_gzext[] |
Definition at line 319 of file gzlog.c.
Referenced by log_open().
local unsigned char log_gzhead[] |
Definition at line 306 of file gzlog.c.
Referenced by log_head(), and log_open().
Visualization Library 2.0.0-b5 Reference Documentation
Updated on Mon Feb 10 2020 02:44:58.
© Copyright Michele Bosi. All rights reserved.