Created
April 2, 2013 13:29
-
-
Save sevki/5292205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opbeat-c.h" | |
#define _FIFO_FILE "/tmp/opbeat" | |
#define _fifo_open() op_beat_err_s = fopen(_FIFO_FILE, "w") | |
#define _fifo_close() fclose(op_beat_err_s) | |
void op_b_err(const char *msg, int level, const char *file, int line) | |
{ | |
OpFrame **frames; | |
frames = malloc (sizeof (OpFrame*)); | |
frames[0] = malloc(sizeof(OpFrame)); | |
op_frame__init(frames[0]); | |
frames[0]->line_no = line; | |
frames[0]->filename = file; | |
OpStackTrace st = OP_STACK_TRACE__INIT; | |
st.n_frames =1; | |
st.frames = frames; | |
OpMessage bug = OP_MESSAGE__INIT; | |
void *buf; | |
unsigned len; | |
bug.msg = msg; | |
bug.level = level; | |
uint64_t t = time(NULL); | |
bug.timestamp =t; | |
bug.has_timestamp = 1; | |
bug.stack_trace = &st; | |
len = op_message__get_packed_size(&bug); | |
buf = malloc(len); | |
op_message__pack(&bug,buf); | |
_fifo_open(); | |
fwrite(buf, 1, len, op_beat_err_s); | |
_fifo_close(); | |
puts(buf); | |
free(buf); | |
free(frames[0]); | |
free(frames); | |
} | |
#undef _fifo_open | |
#undef _fifo_close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _OPBEAT_C_H | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <time.h> | |
#include "opbt.pb-c.h" | |
#define OP_B_ERR_DBG OP_MESSAGE__MSG_LEVEL__ERROR | |
#define OP_B_ERR_INF OP_MESSAGE__MSG_LEVEL__INFO | |
#define OP_B_ERR_WRN OP_MESSAGE__MSG_LEVEL__WARN | |
#define OP_B_ERR_ERR OP_MESSAGE__MSG_LEVEL__ERROR | |
#define OP_B_ERR_CRT OP_MESSAGE__MSG_LEVEL__CRITICAL | |
#define op_error(msg) op_b_err(msg, (int)OP_B_ERR_ERR, __FILE__, __LINE__) | |
#define op_debug(msg) op_b_err(msg, (int)OP_B_ERR_DBG, __FILE__, __LINE__) | |
#define op_warning(msg) op_b_err(msg, (int)OP_B_ERR_WRN, __FILE__, __LINE__) | |
#define op_info(msg) op_b_err(msg, (int)OP_B_ERR_INF, __FILE__, __LINE__) | |
#define op_critical(msg) op_b_err(msg, (int)OP_B_ERR_CRT, __FILE__, __LINE__) | |
#define op_error_errno(num) op_b_err(strerror(num), OP_B_ERR_ERR, __FILE__, __LINE__) | |
#define _OPBEAT_C_H | |
FILE *op_beat_err_s; | |
void op_b_err(const char *msg, int level, const char *file, int line); | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Generated by the protocol buffer compiler. DO NOT EDIT! */ | |
/* Do not generate deprecated warnings for self */ | |
#ifndef PROTOBUF_C_NO_DEPRECATED | |
#define PROTOBUF_C_NO_DEPRECATED | |
#endif | |
#include "opbt.pb-c.h" | |
void key_value__init | |
(KeyValue *message) | |
{ | |
static KeyValue init_value = KEY_VALUE__INIT; | |
*message = init_value; | |
} | |
size_t key_value__get_packed_size | |
(const KeyValue *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &key_value__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t key_value__pack | |
(const KeyValue *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &key_value__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t key_value__pack_to_buffer | |
(const KeyValue *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &key_value__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
KeyValue * | |
key_value__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (KeyValue *) | |
protobuf_c_message_unpack (&key_value__descriptor, | |
allocator, len, data); | |
} | |
void key_value__free_unpacked | |
(KeyValue *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &key_value__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_param_message__init | |
(OpParamMessage *message) | |
{ | |
static OpParamMessage init_value = OP_PARAM_MESSAGE__INIT; | |
*message = init_value; | |
} | |
size_t op_param_message__get_packed_size | |
(const OpParamMessage *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_param_message__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_param_message__pack | |
(const OpParamMessage *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_param_message__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_param_message__pack_to_buffer | |
(const OpParamMessage *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_param_message__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpParamMessage * | |
op_param_message__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpParamMessage *) | |
protobuf_c_message_unpack (&op_param_message__descriptor, | |
allocator, len, data); | |
} | |
void op_param_message__free_unpacked | |
(OpParamMessage *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_param_message__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_exception__init | |
(OpException *message) | |
{ | |
static OpException init_value = OP_EXCEPTION__INIT; | |
*message = init_value; | |
} | |
size_t op_exception__get_packed_size | |
(const OpException *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_exception__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_exception__pack | |
(const OpException *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_exception__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_exception__pack_to_buffer | |
(const OpException *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_exception__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpException * | |
op_exception__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpException *) | |
protobuf_c_message_unpack (&op_exception__descriptor, | |
allocator, len, data); | |
} | |
void op_exception__free_unpacked | |
(OpException *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_exception__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_frame__init | |
(OpFrame *message) | |
{ | |
static OpFrame init_value = OP_FRAME__INIT; | |
*message = init_value; | |
} | |
size_t op_frame__get_packed_size | |
(const OpFrame *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_frame__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_frame__pack | |
(const OpFrame *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_frame__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_frame__pack_to_buffer | |
(const OpFrame *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_frame__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpFrame * | |
op_frame__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpFrame *) | |
protobuf_c_message_unpack (&op_frame__descriptor, | |
allocator, len, data); | |
} | |
void op_frame__free_unpacked | |
(OpFrame *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_frame__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_stack_trace__init | |
(OpStackTrace *message) | |
{ | |
static OpStackTrace init_value = OP_STACK_TRACE__INIT; | |
*message = init_value; | |
} | |
size_t op_stack_trace__get_packed_size | |
(const OpStackTrace *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_stack_trace__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_stack_trace__pack | |
(const OpStackTrace *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_stack_trace__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_stack_trace__pack_to_buffer | |
(const OpStackTrace *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_stack_trace__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpStackTrace * | |
op_stack_trace__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpStackTrace *) | |
protobuf_c_message_unpack (&op_stack_trace__descriptor, | |
allocator, len, data); | |
} | |
void op_stack_trace__free_unpacked | |
(OpStackTrace *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_stack_trace__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_http__init | |
(OpHttp *message) | |
{ | |
static OpHttp init_value = OP_HTTP__INIT; | |
*message = init_value; | |
} | |
size_t op_http__get_packed_size | |
(const OpHttp *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_http__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_http__pack | |
(const OpHttp *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_http__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_http__pack_to_buffer | |
(const OpHttp *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_http__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpHttp * | |
op_http__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpHttp *) | |
protobuf_c_message_unpack (&op_http__descriptor, | |
allocator, len, data); | |
} | |
void op_http__free_unpacked | |
(OpHttp *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_http__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_user__init | |
(OpUser *message) | |
{ | |
static OpUser init_value = OP_USER__INIT; | |
*message = init_value; | |
} | |
size_t op_user__get_packed_size | |
(const OpUser *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_user__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_user__pack | |
(const OpUser *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_user__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_user__pack_to_buffer | |
(const OpUser *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_user__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpUser * | |
op_user__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpUser *) | |
protobuf_c_message_unpack (&op_user__descriptor, | |
allocator, len, data); | |
} | |
void op_user__free_unpacked | |
(OpUser *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_user__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_query__init | |
(OpQuery *message) | |
{ | |
static OpQuery init_value = OP_QUERY__INIT; | |
*message = init_value; | |
} | |
size_t op_query__get_packed_size | |
(const OpQuery *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_query__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_query__pack | |
(const OpQuery *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_query__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_query__pack_to_buffer | |
(const OpQuery *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_query__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpQuery * | |
op_query__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpQuery *) | |
protobuf_c_message_unpack (&op_query__descriptor, | |
allocator, len, data); | |
} | |
void op_query__free_unpacked | |
(OpQuery *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_query__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
void op_message__init | |
(OpMessage *message) | |
{ | |
static OpMessage init_value = OP_MESSAGE__INIT; | |
*message = init_value; | |
} | |
size_t op_message__get_packed_size | |
(const OpMessage *message) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_message__descriptor); | |
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
} | |
size_t op_message__pack | |
(const OpMessage *message, | |
uint8_t *out) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_message__descriptor); | |
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
} | |
size_t op_message__pack_to_buffer | |
(const OpMessage *message, | |
ProtobufCBuffer *buffer) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_message__descriptor); | |
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); | |
} | |
OpMessage * | |
op_message__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data) | |
{ | |
return (OpMessage *) | |
protobuf_c_message_unpack (&op_message__descriptor, | |
allocator, len, data); | |
} | |
void op_message__free_unpacked | |
(OpMessage *message, | |
ProtobufCAllocator *allocator) | |
{ | |
PROTOBUF_C_ASSERT (message->base.descriptor == &op_message__descriptor); | |
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
} | |
static const ProtobufCFieldDescriptor key_value__field_descriptors[2] = | |
{ | |
{ | |
"key", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(KeyValue, key), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"value", | |
2, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_BYTES, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(KeyValue, value), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned key_value__field_indices_by_name[] = { | |
0, /* field[0] = key */ | |
1, /* field[1] = value */ | |
}; | |
static const ProtobufCIntRange key_value__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 2 } | |
}; | |
const ProtobufCMessageDescriptor key_value__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"KeyValue", | |
"KeyValue", | |
"KeyValue", | |
"", | |
sizeof(KeyValue), | |
2, | |
key_value__field_descriptors, | |
key_value__field_indices_by_name, | |
1, key_value__number_ranges, | |
(ProtobufCMessageInit) key_value__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_param_message__field_descriptors[2] = | |
{ | |
{ | |
"msg", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpParamMessage, msg), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"param", | |
2, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_MESSAGE, | |
PROTOBUF_C_OFFSETOF(OpParamMessage, n_param), | |
PROTOBUF_C_OFFSETOF(OpParamMessage, param), | |
&key_value__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_param_message__field_indices_by_name[] = { | |
0, /* field[0] = msg */ | |
1, /* field[1] = param */ | |
}; | |
static const ProtobufCIntRange op_param_message__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 2 } | |
}; | |
const ProtobufCMessageDescriptor op_param_message__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpParamMessage", | |
"OpParamMessage", | |
"OpParamMessage", | |
"", | |
sizeof(OpParamMessage), | |
2, | |
op_param_message__field_descriptors, | |
op_param_message__field_indices_by_name, | |
1, op_param_message__number_ranges, | |
(ProtobufCMessageInit) op_param_message__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_exception__field_descriptors[3] = | |
{ | |
{ | |
"type", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpException, type), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"value", | |
2, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpException, value), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"module", | |
3, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpException, module), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_exception__field_indices_by_name[] = { | |
2, /* field[2] = module */ | |
0, /* field[0] = type */ | |
1, /* field[1] = value */ | |
}; | |
static const ProtobufCIntRange op_exception__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 3 } | |
}; | |
const ProtobufCMessageDescriptor op_exception__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpException", | |
"OpException", | |
"OpException", | |
"", | |
sizeof(OpException), | |
3, | |
op_exception__field_descriptors, | |
op_exception__field_indices_by_name, | |
1, op_exception__number_ranges, | |
(ProtobufCMessageInit) op_exception__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_frame__field_descriptors[8] = | |
{ | |
{ | |
"line_no", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_INT32, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpFrame, line_no), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"filename", | |
2, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpFrame, filename), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"abs_path", | |
3, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpFrame, abs_path), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"function", | |
4, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpFrame, function), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"vars", | |
5, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_MESSAGE, | |
PROTOBUF_C_OFFSETOF(OpFrame, n_vars), | |
PROTOBUF_C_OFFSETOF(OpFrame, vars), | |
&key_value__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"pre_context", | |
6, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_STRING, | |
PROTOBUF_C_OFFSETOF(OpFrame, n_pre_context), | |
PROTOBUF_C_OFFSETOF(OpFrame, pre_context), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"context_line", | |
7, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpFrame, context_line), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"post_context", | |
8, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_STRING, | |
PROTOBUF_C_OFFSETOF(OpFrame, n_post_context), | |
PROTOBUF_C_OFFSETOF(OpFrame, post_context), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_frame__field_indices_by_name[] = { | |
2, /* field[2] = abs_path */ | |
6, /* field[6] = context_line */ | |
1, /* field[1] = filename */ | |
3, /* field[3] = function */ | |
0, /* field[0] = line_no */ | |
7, /* field[7] = post_context */ | |
5, /* field[5] = pre_context */ | |
4, /* field[4] = vars */ | |
}; | |
static const ProtobufCIntRange op_frame__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 8 } | |
}; | |
const ProtobufCMessageDescriptor op_frame__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpFrame", | |
"OpFrame", | |
"OpFrame", | |
"", | |
sizeof(OpFrame), | |
8, | |
op_frame__field_descriptors, | |
op_frame__field_indices_by_name, | |
1, op_frame__number_ranges, | |
(ProtobufCMessageInit) op_frame__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_stack_trace__field_descriptors[2] = | |
{ | |
{ | |
"trace", | |
1, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpStackTrace, trace), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"frames", | |
2, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_MESSAGE, | |
PROTOBUF_C_OFFSETOF(OpStackTrace, n_frames), | |
PROTOBUF_C_OFFSETOF(OpStackTrace, frames), | |
&op_frame__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_stack_trace__field_indices_by_name[] = { | |
1, /* field[1] = frames */ | |
0, /* field[0] = trace */ | |
}; | |
static const ProtobufCIntRange op_stack_trace__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 2 } | |
}; | |
const ProtobufCMessageDescriptor op_stack_trace__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpStackTrace", | |
"OpStackTrace", | |
"OpStackTrace", | |
"", | |
sizeof(OpStackTrace), | |
2, | |
op_stack_trace__field_descriptors, | |
op_stack_trace__field_indices_by_name, | |
1, op_stack_trace__number_ranges, | |
(ProtobufCMessageInit) op_stack_trace__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_http__field_descriptors[11] = | |
{ | |
{ | |
"url", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, url), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"method", | |
2, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, method), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"data", | |
3, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_BYTES, | |
PROTOBUF_C_OFFSETOF(OpHttp, has_data), | |
PROTOBUF_C_OFFSETOF(OpHttp, data), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"query_string", | |
4, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, query_string), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"cookies", | |
5, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, cookies), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"headers", | |
6, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_MESSAGE, | |
PROTOBUF_C_OFFSETOF(OpHttp, n_headers), | |
PROTOBUF_C_OFFSETOF(OpHttp, headers), | |
&key_value__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"remote_host", | |
7, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, remote_host), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"http_host", | |
8, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, http_host), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"user_agent", | |
9, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpHttp, user_agent), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"secure", | |
10, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_BOOL, | |
PROTOBUF_C_OFFSETOF(OpHttp, has_secure), | |
PROTOBUF_C_OFFSETOF(OpHttp, secure), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"env_vars", | |
11, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_MESSAGE, | |
PROTOBUF_C_OFFSETOF(OpHttp, n_env_vars), | |
PROTOBUF_C_OFFSETOF(OpHttp, env_vars), | |
&key_value__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_http__field_indices_by_name[] = { | |
4, /* field[4] = cookies */ | |
2, /* field[2] = data */ | |
10, /* field[10] = env_vars */ | |
5, /* field[5] = headers */ | |
7, /* field[7] = http_host */ | |
1, /* field[1] = method */ | |
3, /* field[3] = query_string */ | |
6, /* field[6] = remote_host */ | |
9, /* field[9] = secure */ | |
0, /* field[0] = url */ | |
8, /* field[8] = user_agent */ | |
}; | |
static const ProtobufCIntRange op_http__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 11 } | |
}; | |
const ProtobufCMessageDescriptor op_http__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpHttp", | |
"OpHttp", | |
"OpHttp", | |
"", | |
sizeof(OpHttp), | |
11, | |
op_http__field_descriptors, | |
op_http__field_indices_by_name, | |
1, op_http__number_ranges, | |
(ProtobufCMessageInit) op_http__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_user__field_descriptors[4] = | |
{ | |
{ | |
"is_authenticated", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_BOOL, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpUser, is_authenticated), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"user_id", | |
2, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_BOOL, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpUser, user_id), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"user_name", | |
3, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_BOOL, | |
PROTOBUF_C_OFFSETOF(OpUser, has_user_name), | |
PROTOBUF_C_OFFSETOF(OpUser, user_name), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"email", | |
4, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_BOOL, | |
PROTOBUF_C_OFFSETOF(OpUser, has_email), | |
PROTOBUF_C_OFFSETOF(OpUser, email), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_user__field_indices_by_name[] = { | |
3, /* field[3] = email */ | |
0, /* field[0] = is_authenticated */ | |
1, /* field[1] = user_id */ | |
2, /* field[2] = user_name */ | |
}; | |
static const ProtobufCIntRange op_user__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 4 } | |
}; | |
const ProtobufCMessageDescriptor op_user__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpUser", | |
"OpUser", | |
"OpUser", | |
"", | |
sizeof(OpUser), | |
4, | |
op_user__field_descriptors, | |
op_user__field_indices_by_name, | |
1, op_user__number_ranges, | |
(ProtobufCMessageInit) op_user__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
static const ProtobufCFieldDescriptor op_query__field_descriptors[2] = | |
{ | |
{ | |
"command", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpQuery, command), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"engine", | |
2, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpQuery, engine), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_query__field_indices_by_name[] = { | |
0, /* field[0] = command */ | |
1, /* field[1] = engine */ | |
}; | |
static const ProtobufCIntRange op_query__number_ranges[1 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 0, 2 } | |
}; | |
const ProtobufCMessageDescriptor op_query__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpQuery", | |
"OpQuery", | |
"OpQuery", | |
"", | |
sizeof(OpQuery), | |
2, | |
op_query__field_descriptors, | |
op_query__field_indices_by_name, | |
1, op_query__number_ranges, | |
(ProtobufCMessageInit) op_query__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; | |
const ProtobufCEnumValue op_message__msg_level__enum_values_by_number[5] = | |
{ | |
{ "DEBUG", "OP_MESSAGE__MSG_LEVEL__DEBUG", 0 }, | |
{ "INFO", "OP_MESSAGE__MSG_LEVEL__INFO", 1 }, | |
{ "WARN", "OP_MESSAGE__MSG_LEVEL__WARN", 2 }, | |
{ "ERROR", "OP_MESSAGE__MSG_LEVEL__ERROR", 3 }, | |
{ "CRITICAL", "OP_MESSAGE__MSG_LEVEL__CRITICAL", 4 }, | |
}; | |
static const ProtobufCIntRange op_message__msg_level__value_ranges[] = { | |
{0, 0},{0, 5} | |
}; | |
const ProtobufCEnumValueIndex op_message__msg_level__enum_values_by_name[5] = | |
{ | |
{ "CRITICAL", 4 }, | |
{ "DEBUG", 0 }, | |
{ "ERROR", 3 }, | |
{ "INFO", 1 }, | |
{ "WARN", 2 }, | |
}; | |
const ProtobufCEnumDescriptor op_message__msg_level__descriptor = | |
{ | |
PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC, | |
"OpMessage.MsgLevel", | |
"MsgLevel", | |
"OpMessage__MsgLevel", | |
"", | |
5, | |
op_message__msg_level__enum_values_by_number, | |
5, | |
op_message__msg_level__enum_values_by_name, | |
1, | |
op_message__msg_level__value_ranges, | |
NULL,NULL,NULL,NULL /* reserved[1234] */ | |
}; | |
static const ProtobufCFieldDescriptor op_message__field_descriptors[13] = | |
{ | |
{ | |
"msg", | |
1, | |
PROTOBUF_C_LABEL_REQUIRED, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, msg), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"timestamp", | |
2, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_INT64, | |
PROTOBUF_C_OFFSETOF(OpMessage, has_timestamp), | |
PROTOBUF_C_OFFSETOF(OpMessage, timestamp), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"level", | |
3, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_ENUM, | |
PROTOBUF_C_OFFSETOF(OpMessage, has_level), | |
PROTOBUF_C_OFFSETOF(OpMessage, level), | |
&op_message__msg_level__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"logger", | |
4, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, logger), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"client_supplied_id", | |
5, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, client_supplied_id), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"culprit", | |
6, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_STRING, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, culprit), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"extra", | |
7, | |
PROTOBUF_C_LABEL_REPEATED, | |
PROTOBUF_C_TYPE_STRING, | |
PROTOBUF_C_OFFSETOF(OpMessage, n_extra), | |
PROTOBUF_C_OFFSETOF(OpMessage, extra), | |
NULL, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"param_message", | |
9, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_MESSAGE, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, param_message), | |
&op_param_message__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"exception", | |
10, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_MESSAGE, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, exception), | |
&op_exception__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"stack_trace", | |
11, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_MESSAGE, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, stack_trace), | |
&op_stack_trace__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"http", | |
12, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_MESSAGE, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, http), | |
&op_http__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"user", | |
13, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_MESSAGE, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, user), | |
&op_user__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
{ | |
"query", | |
14, | |
PROTOBUF_C_LABEL_OPTIONAL, | |
PROTOBUF_C_TYPE_MESSAGE, | |
0, /* quantifier_offset */ | |
PROTOBUF_C_OFFSETOF(OpMessage, query), | |
&op_query__descriptor, | |
NULL, | |
0, /* packed */ | |
0,NULL,NULL /* reserved1,reserved2, etc */ | |
}, | |
}; | |
static const unsigned op_message__field_indices_by_name[] = { | |
4, /* field[4] = client_supplied_id */ | |
5, /* field[5] = culprit */ | |
8, /* field[8] = exception */ | |
6, /* field[6] = extra */ | |
10, /* field[10] = http */ | |
2, /* field[2] = level */ | |
3, /* field[3] = logger */ | |
0, /* field[0] = msg */ | |
7, /* field[7] = param_message */ | |
12, /* field[12] = query */ | |
9, /* field[9] = stack_trace */ | |
1, /* field[1] = timestamp */ | |
11, /* field[11] = user */ | |
}; | |
static const ProtobufCIntRange op_message__number_ranges[2 + 1] = | |
{ | |
{ 1, 0 }, | |
{ 9, 7 }, | |
{ 0, 13 } | |
}; | |
const ProtobufCMessageDescriptor op_message__descriptor = | |
{ | |
PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC, | |
"OpMessage", | |
"OpMessage", | |
"OpMessage", | |
"", | |
sizeof(OpMessage), | |
13, | |
op_message__field_descriptors, | |
op_message__field_indices_by_name, | |
2, op_message__number_ranges, | |
(ProtobufCMessageInit) op_message__init, | |
NULL,NULL,NULL /* reserved[123] */ | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Generated by the protocol buffer compiler. DO NOT EDIT! */ | |
#ifndef PROTOBUF_C_opbt_2eproto__INCLUDED | |
#define PROTOBUF_C_opbt_2eproto__INCLUDED | |
#include <google/protobuf-c/protobuf-c.h> | |
PROTOBUF_C_BEGIN_DECLS | |
typedef struct _KeyValue KeyValue; | |
typedef struct _OpParamMessage OpParamMessage; | |
typedef struct _OpException OpException; | |
typedef struct _OpFrame OpFrame; | |
typedef struct _OpStackTrace OpStackTrace; | |
typedef struct _OpHttp OpHttp; | |
typedef struct _OpUser OpUser; | |
typedef struct _OpQuery OpQuery; | |
typedef struct _OpMessage OpMessage; | |
/* --- enums --- */ | |
typedef enum _OpMessage__MsgLevel { | |
OP_MESSAGE__MSG_LEVEL__DEBUG = 0, | |
OP_MESSAGE__MSG_LEVEL__INFO = 1, | |
OP_MESSAGE__MSG_LEVEL__WARN = 2, | |
OP_MESSAGE__MSG_LEVEL__ERROR = 3, | |
OP_MESSAGE__MSG_LEVEL__CRITICAL = 4 | |
} OpMessage__MsgLevel; | |
/* --- messages --- */ | |
struct _KeyValue | |
{ | |
ProtobufCMessage base; | |
char *key; | |
ProtobufCBinaryData value; | |
}; | |
#define KEY_VALUE__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&key_value__descriptor) \ | |
, NULL, {0,NULL} } | |
struct _OpParamMessage | |
{ | |
ProtobufCMessage base; | |
char *msg; | |
size_t n_param; | |
KeyValue **param; | |
}; | |
#define OP_PARAM_MESSAGE__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_param_message__descriptor) \ | |
, NULL, 0,NULL } | |
struct _OpException | |
{ | |
ProtobufCMessage base; | |
char *type; | |
char *value; | |
char *module; | |
}; | |
#define OP_EXCEPTION__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_exception__descriptor) \ | |
, NULL, NULL, NULL } | |
struct _OpFrame | |
{ | |
ProtobufCMessage base; | |
int32_t line_no; | |
char *filename; | |
char *abs_path; | |
char *function; | |
size_t n_vars; | |
KeyValue **vars; | |
size_t n_pre_context; | |
char **pre_context; | |
char *context_line; | |
size_t n_post_context; | |
char **post_context; | |
}; | |
#define OP_FRAME__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_frame__descriptor) \ | |
, 0, NULL, NULL, NULL, 0,NULL, 0,NULL, NULL, 0,NULL } | |
struct _OpStackTrace | |
{ | |
ProtobufCMessage base; | |
char *trace; | |
size_t n_frames; | |
OpFrame **frames; | |
}; | |
#define OP_STACK_TRACE__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_stack_trace__descriptor) \ | |
, NULL, 0,NULL } | |
struct _OpHttp | |
{ | |
ProtobufCMessage base; | |
char *url; | |
char *method; | |
protobuf_c_boolean has_data; | |
ProtobufCBinaryData data; | |
char *query_string; | |
char *cookies; | |
size_t n_headers; | |
KeyValue **headers; | |
char *remote_host; | |
char *http_host; | |
char *user_agent; | |
protobuf_c_boolean has_secure; | |
protobuf_c_boolean secure; | |
size_t n_env_vars; | |
KeyValue **env_vars; | |
}; | |
#define OP_HTTP__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_http__descriptor) \ | |
, NULL, NULL, 0,{0,NULL}, NULL, NULL, 0,NULL, NULL, NULL, NULL, 0,0, 0,NULL } | |
struct _OpUser | |
{ | |
ProtobufCMessage base; | |
protobuf_c_boolean is_authenticated; | |
protobuf_c_boolean user_id; | |
protobuf_c_boolean has_user_name; | |
protobuf_c_boolean user_name; | |
protobuf_c_boolean has_email; | |
protobuf_c_boolean email; | |
}; | |
#define OP_USER__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_user__descriptor) \ | |
, 0, 0, 0,0, 0,0 } | |
struct _OpQuery | |
{ | |
ProtobufCMessage base; | |
char *command; | |
char *engine; | |
}; | |
#define OP_QUERY__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_query__descriptor) \ | |
, NULL, NULL } | |
struct _OpMessage | |
{ | |
ProtobufCMessage base; | |
char *msg; | |
protobuf_c_boolean has_timestamp; | |
int64_t timestamp; | |
protobuf_c_boolean has_level; | |
OpMessage__MsgLevel level; | |
char *logger; | |
char *client_supplied_id; | |
char *culprit; | |
size_t n_extra; | |
char **extra; | |
OpParamMessage *param_message; | |
OpException *exception; | |
OpStackTrace *stack_trace; | |
OpHttp *http; | |
OpUser *user; | |
OpQuery *query; | |
}; | |
#define OP_MESSAGE__INIT \ | |
{ PROTOBUF_C_MESSAGE_INIT (&op_message__descriptor) \ | |
, NULL, 0,0, 0,0, NULL, NULL, NULL, 0,NULL, NULL, NULL, NULL, NULL, NULL, NULL } | |
/* KeyValue methods */ | |
void key_value__init | |
(KeyValue *message); | |
size_t key_value__get_packed_size | |
(const KeyValue *message); | |
size_t key_value__pack | |
(const KeyValue *message, | |
uint8_t *out); | |
size_t key_value__pack_to_buffer | |
(const KeyValue *message, | |
ProtobufCBuffer *buffer); | |
KeyValue * | |
key_value__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void key_value__free_unpacked | |
(KeyValue *message, | |
ProtobufCAllocator *allocator); | |
/* OpParamMessage methods */ | |
void op_param_message__init | |
(OpParamMessage *message); | |
size_t op_param_message__get_packed_size | |
(const OpParamMessage *message); | |
size_t op_param_message__pack | |
(const OpParamMessage *message, | |
uint8_t *out); | |
size_t op_param_message__pack_to_buffer | |
(const OpParamMessage *message, | |
ProtobufCBuffer *buffer); | |
OpParamMessage * | |
op_param_message__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_param_message__free_unpacked | |
(OpParamMessage *message, | |
ProtobufCAllocator *allocator); | |
/* OpException methods */ | |
void op_exception__init | |
(OpException *message); | |
size_t op_exception__get_packed_size | |
(const OpException *message); | |
size_t op_exception__pack | |
(const OpException *message, | |
uint8_t *out); | |
size_t op_exception__pack_to_buffer | |
(const OpException *message, | |
ProtobufCBuffer *buffer); | |
OpException * | |
op_exception__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_exception__free_unpacked | |
(OpException *message, | |
ProtobufCAllocator *allocator); | |
/* OpFrame methods */ | |
void op_frame__init | |
(OpFrame *message); | |
size_t op_frame__get_packed_size | |
(const OpFrame *message); | |
size_t op_frame__pack | |
(const OpFrame *message, | |
uint8_t *out); | |
size_t op_frame__pack_to_buffer | |
(const OpFrame *message, | |
ProtobufCBuffer *buffer); | |
OpFrame * | |
op_frame__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_frame__free_unpacked | |
(OpFrame *message, | |
ProtobufCAllocator *allocator); | |
/* OpStackTrace methods */ | |
void op_stack_trace__init | |
(OpStackTrace *message); | |
size_t op_stack_trace__get_packed_size | |
(const OpStackTrace *message); | |
size_t op_stack_trace__pack | |
(const OpStackTrace *message, | |
uint8_t *out); | |
size_t op_stack_trace__pack_to_buffer | |
(const OpStackTrace *message, | |
ProtobufCBuffer *buffer); | |
OpStackTrace * | |
op_stack_trace__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_stack_trace__free_unpacked | |
(OpStackTrace *message, | |
ProtobufCAllocator *allocator); | |
/* OpHttp methods */ | |
void op_http__init | |
(OpHttp *message); | |
size_t op_http__get_packed_size | |
(const OpHttp *message); | |
size_t op_http__pack | |
(const OpHttp *message, | |
uint8_t *out); | |
size_t op_http__pack_to_buffer | |
(const OpHttp *message, | |
ProtobufCBuffer *buffer); | |
OpHttp * | |
op_http__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_http__free_unpacked | |
(OpHttp *message, | |
ProtobufCAllocator *allocator); | |
/* OpUser methods */ | |
void op_user__init | |
(OpUser *message); | |
size_t op_user__get_packed_size | |
(const OpUser *message); | |
size_t op_user__pack | |
(const OpUser *message, | |
uint8_t *out); | |
size_t op_user__pack_to_buffer | |
(const OpUser *message, | |
ProtobufCBuffer *buffer); | |
OpUser * | |
op_user__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_user__free_unpacked | |
(OpUser *message, | |
ProtobufCAllocator *allocator); | |
/* OpQuery methods */ | |
void op_query__init | |
(OpQuery *message); | |
size_t op_query__get_packed_size | |
(const OpQuery *message); | |
size_t op_query__pack | |
(const OpQuery *message, | |
uint8_t *out); | |
size_t op_query__pack_to_buffer | |
(const OpQuery *message, | |
ProtobufCBuffer *buffer); | |
OpQuery * | |
op_query__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_query__free_unpacked | |
(OpQuery *message, | |
ProtobufCAllocator *allocator); | |
/* OpMessage methods */ | |
void op_message__init | |
(OpMessage *message); | |
size_t op_message__get_packed_size | |
(const OpMessage *message); | |
size_t op_message__pack | |
(const OpMessage *message, | |
uint8_t *out); | |
size_t op_message__pack_to_buffer | |
(const OpMessage *message, | |
ProtobufCBuffer *buffer); | |
OpMessage * | |
op_message__unpack | |
(ProtobufCAllocator *allocator, | |
size_t len, | |
const uint8_t *data); | |
void op_message__free_unpacked | |
(OpMessage *message, | |
ProtobufCAllocator *allocator); | |
/* --- per-message closures --- */ | |
typedef void (*KeyValue_Closure) | |
(const KeyValue *message, | |
void *closure_data); | |
typedef void (*OpParamMessage_Closure) | |
(const OpParamMessage *message, | |
void *closure_data); | |
typedef void (*OpException_Closure) | |
(const OpException *message, | |
void *closure_data); | |
typedef void (*OpFrame_Closure) | |
(const OpFrame *message, | |
void *closure_data); | |
typedef void (*OpStackTrace_Closure) | |
(const OpStackTrace *message, | |
void *closure_data); | |
typedef void (*OpHttp_Closure) | |
(const OpHttp *message, | |
void *closure_data); | |
typedef void (*OpUser_Closure) | |
(const OpUser *message, | |
void *closure_data); | |
typedef void (*OpQuery_Closure) | |
(const OpQuery *message, | |
void *closure_data); | |
typedef void (*OpMessage_Closure) | |
(const OpMessage *message, | |
void *closure_data); | |
/* --- services --- */ | |
/* --- descriptors --- */ | |
extern const ProtobufCMessageDescriptor key_value__descriptor; | |
extern const ProtobufCMessageDescriptor op_param_message__descriptor; | |
extern const ProtobufCMessageDescriptor op_exception__descriptor; | |
extern const ProtobufCMessageDescriptor op_frame__descriptor; | |
extern const ProtobufCMessageDescriptor op_stack_trace__descriptor; | |
extern const ProtobufCMessageDescriptor op_http__descriptor; | |
extern const ProtobufCMessageDescriptor op_user__descriptor; | |
extern const ProtobufCMessageDescriptor op_query__descriptor; | |
extern const ProtobufCMessageDescriptor op_message__descriptor; | |
extern const ProtobufCEnumDescriptor op_message__msg_level__descriptor; | |
PROTOBUF_C_END_DECLS | |
#endif /* PROTOBUF_opbt_2eproto__INCLUDED */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment