Initial commit but not compiling yet

This commit is contained in:
Xavier Stevens
2014-09-18 17:33:49 -07:00
parent 8c554c0b6f
commit 0241c144fc
6 changed files with 924 additions and 6 deletions

View File

@@ -0,0 +1,370 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: proto/pg_logicaldec.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "proto/pg_logicaldec.pb-c.h"
void decoderbufs__datum_message__init
(Decoderbufs__DatumMessage *message)
{
static Decoderbufs__DatumMessage init_value = DECODERBUFS__DATUM_MESSAGE__INIT;
*message = init_value;
}
size_t decoderbufs__datum_message__get_packed_size
(const Decoderbufs__DatumMessage *message)
{
assert(message->base.descriptor == &decoderbufs__datum_message__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t decoderbufs__datum_message__pack
(const Decoderbufs__DatumMessage *message,
uint8_t *out)
{
assert(message->base.descriptor == &decoderbufs__datum_message__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t decoderbufs__datum_message__pack_to_buffer
(const Decoderbufs__DatumMessage *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &decoderbufs__datum_message__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Decoderbufs__DatumMessage *
decoderbufs__datum_message__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Decoderbufs__DatumMessage *)
protobuf_c_message_unpack (&decoderbufs__datum_message__descriptor,
allocator, len, data);
}
void decoderbufs__datum_message__free_unpacked
(Decoderbufs__DatumMessage *message,
ProtobufCAllocator *allocator)
{
assert(message->base.descriptor == &decoderbufs__datum_message__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void decoderbufs__txn_message__init
(Decoderbufs__TxnMessage *message)
{
static Decoderbufs__TxnMessage init_value = DECODERBUFS__TXN_MESSAGE__INIT;
*message = init_value;
}
size_t decoderbufs__txn_message__get_packed_size
(const Decoderbufs__TxnMessage *message)
{
assert(message->base.descriptor == &decoderbufs__txn_message__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t decoderbufs__txn_message__pack
(const Decoderbufs__TxnMessage *message,
uint8_t *out)
{
assert(message->base.descriptor == &decoderbufs__txn_message__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t decoderbufs__txn_message__pack_to_buffer
(const Decoderbufs__TxnMessage *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &decoderbufs__txn_message__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Decoderbufs__TxnMessage *
decoderbufs__txn_message__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Decoderbufs__TxnMessage *)
protobuf_c_message_unpack (&decoderbufs__txn_message__descriptor,
allocator, len, data);
}
void decoderbufs__txn_message__free_unpacked
(Decoderbufs__TxnMessage *message,
ProtobufCAllocator *allocator)
{
assert(message->base.descriptor == &decoderbufs__txn_message__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descriptors[9] =
{
{
"column_name",
1,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Decoderbufs__DatumMessage, column_name),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"column_type",
2,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT64,
offsetof(Decoderbufs__DatumMessage, has_column_type),
offsetof(Decoderbufs__DatumMessage, column_type),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_int32",
3,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(Decoderbufs__DatumMessage, has_datum_int32),
offsetof(Decoderbufs__DatumMessage, datum_int32),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_int64",
4,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT64,
offsetof(Decoderbufs__DatumMessage, has_datum_int64),
offsetof(Decoderbufs__DatumMessage, datum_int64),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_float",
5,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_FLOAT,
offsetof(Decoderbufs__DatumMessage, has_datum_float),
offsetof(Decoderbufs__DatumMessage, datum_float),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_double",
6,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_DOUBLE,
offsetof(Decoderbufs__DatumMessage, has_datum_double),
offsetof(Decoderbufs__DatumMessage, datum_double),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_bool",
7,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_BOOL,
offsetof(Decoderbufs__DatumMessage, has_datum_bool),
offsetof(Decoderbufs__DatumMessage, datum_bool),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_string",
8,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Decoderbufs__DatumMessage, datum_string),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"datum_bytes",
9,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_BYTES,
offsetof(Decoderbufs__DatumMessage, has_datum_bytes),
offsetof(Decoderbufs__DatumMessage, datum_bytes),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned decoderbufs__datum_message__field_indices_by_name[] = {
0, /* field[0] = column_name */
1, /* field[1] = column_type */
6, /* field[6] = datum_bool */
8, /* field[8] = datum_bytes */
5, /* field[5] = datum_double */
4, /* field[4] = datum_float */
2, /* field[2] = datum_int32 */
3, /* field[3] = datum_int64 */
7, /* field[7] = datum_string */
};
static const ProtobufCIntRange decoderbufs__datum_message__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 9 }
};
const ProtobufCMessageDescriptor decoderbufs__datum_message__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"decoderbufs.DatumMessage",
"DatumMessage",
"Decoderbufs__DatumMessage",
"decoderbufs",
sizeof(Decoderbufs__DatumMessage),
9,
decoderbufs__datum_message__field_descriptors,
decoderbufs__datum_message__field_indices_by_name,
1, decoderbufs__datum_message__number_ranges,
(ProtobufCMessageInit) decoderbufs__datum_message__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor decoderbufs__txn_message__field_descriptors[6] =
{
{
"timestamp",
1,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_SINT64,
offsetof(Decoderbufs__TxnMessage, has_timestamp),
offsetof(Decoderbufs__TxnMessage, timestamp),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"xid",
2,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT64,
offsetof(Decoderbufs__TxnMessage, has_xid),
offsetof(Decoderbufs__TxnMessage, xid),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"table",
3,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Decoderbufs__TxnMessage, table),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"op",
4,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_ENUM,
offsetof(Decoderbufs__TxnMessage, has_op),
offsetof(Decoderbufs__TxnMessage, op),
&decoderbufs__op__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"new_datum",
5,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Decoderbufs__TxnMessage, new_datum),
&decoderbufs__datum_message__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"old_datum",
6,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Decoderbufs__TxnMessage, old_datum),
&decoderbufs__datum_message__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned decoderbufs__txn_message__field_indices_by_name[] = {
4, /* field[4] = new_datum */
5, /* field[5] = old_datum */
3, /* field[3] = op */
2, /* field[2] = table */
0, /* field[0] = timestamp */
1, /* field[1] = xid */
};
static const ProtobufCIntRange decoderbufs__txn_message__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 6 }
};
const ProtobufCMessageDescriptor decoderbufs__txn_message__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"decoderbufs.TxnMessage",
"TxnMessage",
"Decoderbufs__TxnMessage",
"decoderbufs",
sizeof(Decoderbufs__TxnMessage),
6,
decoderbufs__txn_message__field_descriptors,
decoderbufs__txn_message__field_indices_by_name,
1, decoderbufs__txn_message__number_ranges,
(ProtobufCMessageInit) decoderbufs__txn_message__init,
NULL,NULL,NULL /* reserved[123] */
};
const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[3] =
{
{ "INSERT", "DECODERBUFS__OP__INSERT", 0 },
{ "UPDATE", "DECODERBUFS__OP__UPDATE", 1 },
{ "DELETE", "DECODERBUFS__OP__DELETE", 2 },
};
static const ProtobufCIntRange decoderbufs__op__value_ranges[] = {
{0, 0},{0, 3}
};
const ProtobufCEnumValueIndex decoderbufs__op__enum_values_by_name[3] =
{
{ "DELETE", 2 },
{ "INSERT", 0 },
{ "UPDATE", 1 },
};
const ProtobufCEnumDescriptor decoderbufs__op__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"decoderbufs.Op",
"Op",
"Decoderbufs__Op",
"decoderbufs",
3,
decoderbufs__op__enum_values_by_number,
3,
decoderbufs__op__enum_values_by_name,
1,
decoderbufs__op__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};

View File

@@ -0,0 +1,135 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: proto/pg_logicaldec.proto */
#ifndef PROTOBUF_C_proto_2fpg_5flogicaldec_2eproto__INCLUDED
#define PROTOBUF_C_proto_2fpg_5flogicaldec_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1000001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
typedef struct _Decoderbufs__DatumMessage Decoderbufs__DatumMessage;
typedef struct _Decoderbufs__TxnMessage Decoderbufs__TxnMessage;
/* --- enums --- */
typedef enum _Decoderbufs__Op {
DECODERBUFS__OP__INSERT = 0,
DECODERBUFS__OP__UPDATE = 1,
DECODERBUFS__OP__DELETE = 2
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(DECODERBUFS__OP)
} Decoderbufs__Op;
/* --- messages --- */
struct _Decoderbufs__DatumMessage
{
ProtobufCMessage base;
char *column_name;
protobuf_c_boolean has_column_type;
int64_t column_type;
protobuf_c_boolean has_datum_int32;
int32_t datum_int32;
protobuf_c_boolean has_datum_int64;
int64_t datum_int64;
protobuf_c_boolean has_datum_float;
float datum_float;
protobuf_c_boolean has_datum_double;
double datum_double;
protobuf_c_boolean has_datum_bool;
protobuf_c_boolean datum_bool;
char *datum_string;
protobuf_c_boolean has_datum_bytes;
ProtobufCBinaryData datum_bytes;
};
#define DECODERBUFS__DATUM_MESSAGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&decoderbufs__datum_message__descriptor) \
, NULL, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, NULL, 0,{0,NULL} }
struct _Decoderbufs__TxnMessage
{
ProtobufCMessage base;
protobuf_c_boolean has_timestamp;
int64_t timestamp;
protobuf_c_boolean has_xid;
int64_t xid;
char *table;
protobuf_c_boolean has_op;
Decoderbufs__Op op;
Decoderbufs__DatumMessage *new_datum;
Decoderbufs__DatumMessage *old_datum;
};
#define DECODERBUFS__TXN_MESSAGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&decoderbufs__txn_message__descriptor) \
, 0,0, 0,0, NULL, 0,0, NULL, NULL }
/* Decoderbufs__DatumMessage methods */
void decoderbufs__datum_message__init
(Decoderbufs__DatumMessage *message);
size_t decoderbufs__datum_message__get_packed_size
(const Decoderbufs__DatumMessage *message);
size_t decoderbufs__datum_message__pack
(const Decoderbufs__DatumMessage *message,
uint8_t *out);
size_t decoderbufs__datum_message__pack_to_buffer
(const Decoderbufs__DatumMessage *message,
ProtobufCBuffer *buffer);
Decoderbufs__DatumMessage *
decoderbufs__datum_message__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void decoderbufs__datum_message__free_unpacked
(Decoderbufs__DatumMessage *message,
ProtobufCAllocator *allocator);
/* Decoderbufs__TxnMessage methods */
void decoderbufs__txn_message__init
(Decoderbufs__TxnMessage *message);
size_t decoderbufs__txn_message__get_packed_size
(const Decoderbufs__TxnMessage *message);
size_t decoderbufs__txn_message__pack
(const Decoderbufs__TxnMessage *message,
uint8_t *out);
size_t decoderbufs__txn_message__pack_to_buffer
(const Decoderbufs__TxnMessage *message,
ProtobufCBuffer *buffer);
Decoderbufs__TxnMessage *
decoderbufs__txn_message__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void decoderbufs__txn_message__free_unpacked
(Decoderbufs__TxnMessage *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Decoderbufs__DatumMessage_Closure)
(const Decoderbufs__DatumMessage *message,
void *closure_data);
typedef void (*Decoderbufs__TxnMessage_Closure)
(const Decoderbufs__TxnMessage *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor decoderbufs__op__descriptor;
extern const ProtobufCMessageDescriptor decoderbufs__datum_message__descriptor;
extern const ProtobufCMessageDescriptor decoderbufs__txn_message__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_proto_2fpg_5flogicaldec_2eproto__INCLUDED */