2007-07-13 19:37:47 +00:00
|
|
|
#ifndef BRTTYPES_H
|
|
|
|
#define BRTTYPES_H
|
2007-11-29 14:18:54 +00:00
|
|
|
|
|
|
|
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
|
|
|
|
2007-11-14 17:58:38 +00:00
|
|
|
#include <sys/types.h>
|
2007-07-13 19:37:47 +00:00
|
|
|
#define _XOPEN_SOURCE 500
|
|
|
|
#define _FILE_OFFSET_BITS 64
|
2007-11-21 13:07:49 +00:00
|
|
|
|
|
|
|
typedef struct brt *BRT;
|
|
|
|
struct brt_header;
|
|
|
|
struct wbuf;
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
typedef unsigned int ITEMLEN;
|
|
|
|
typedef const void *bytevec;
|
|
|
|
//typedef const void *bytevec;
|
2007-09-28 17:11:22 +00:00
|
|
|
|
2007-11-14 17:58:38 +00:00
|
|
|
typedef long long DISKOFF; /* Offset in a disk. -1 is the NULL pointer. */
|
2007-11-22 20:30:38 +00:00
|
|
|
typedef u_int64_t TXNID;
|
2007-09-28 17:11:22 +00:00
|
|
|
|
2007-11-22 07:13:08 +00:00
|
|
|
typedef struct {
|
|
|
|
int len;
|
|
|
|
char *data;
|
2007-11-22 20:30:38 +00:00
|
|
|
} BYTESTRING;
|
2007-11-22 07:13:08 +00:00
|
|
|
|
2007-11-14 17:58:38 +00:00
|
|
|
/* Make the LSN be a struct instead of an integer so that we get better type checking. */
|
|
|
|
typedef struct __toku_lsn { u_int64_t lsn; } LSN;
|
|
|
|
#define ZERO_LSN ((LSN){0})
|
|
|
|
|
|
|
|
/* Make the FILEID a struct for the same reason. */
|
|
|
|
typedef struct __toku_fileid { u_int32_t fileid; } FILENUM;
|
|
|
|
|
|
|
|
typedef enum __toku_bool { FALSE=0, TRUE=1} BOOL;
|
|
|
|
|
|
|
|
typedef struct tokulogger *TOKULOGGER;
|
|
|
|
#define NULL_LOGGER ((TOKULOGGER)0)
|
|
|
|
typedef struct tokutxn *TOKUTXN;
|
2007-11-18 12:48:36 +00:00
|
|
|
#define NULL_TXN ((TOKUTXN)0)
|
2007-11-14 17:58:38 +00:00
|
|
|
|
2007-11-22 21:11:21 +00:00
|
|
|
// The data that appears in the log to encode a brtheader. */
|
|
|
|
typedef struct loggedbrtheader {
|
|
|
|
u_int32_t size;
|
|
|
|
u_int32_t flags;
|
|
|
|
u_int32_t nodesize;
|
|
|
|
DISKOFF freelist;
|
|
|
|
DISKOFF unused_memory;
|
|
|
|
u_int32_t n_named_roots;
|
2007-11-24 03:50:28 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char **names;
|
|
|
|
DISKOFF *roots;
|
|
|
|
} many;
|
|
|
|
struct {
|
|
|
|
DISKOFF root;
|
|
|
|
} one;
|
|
|
|
} u;
|
2007-11-22 21:11:21 +00:00
|
|
|
} LOGGEDBRTHEADER;
|
|
|
|
|
2007-12-04 10:02:59 +00:00
|
|
|
typedef struct intpairarray {
|
|
|
|
u_int32_t size;
|
|
|
|
struct intpair {
|
|
|
|
u_int32_t a,b;
|
|
|
|
} *array;
|
|
|
|
} INTPAIRARRAY;
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
#endif
|