Changeset: 671c618dfd2b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=671c618dfd2b
Added Files:
common/stream/mapi_pb-c.c
common/stream/mapi_pb-c.h
common/stream/mapi_pb.proto
common/stream/pbstream.c
common/stream/pbstream.h
Modified Files:
clients/mapilib/mapi.c
Branch: Protobuf
Log Message:
Resurrected some files... one to go.
Unterschiede (gekürzt von 1072 auf 300 Zeilen):
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -4426,7 +4426,7 @@ mapi_fetch_field(MapiHdl hdl, int fnr)
break;
case MAPI_REPLY__QUERY_RESULT__COLUMN__TYPE__INTEGER:
intbuf = malloc(15);
- sprintf(intbuf, "%ld",
col->intvalues[result->tuple_count]);
+ sprintf(intbuf, "%lld",
col->intvalues[result->tuple_count]);
return intbuf;
break;
case MAPI_REPLY__QUERY_RESULT__COLUMN__TYPE__FLOAT:
diff --git a/common/stream/mapi_pb-c.c b/common/stream/mapi_pb-c.c
new file mode 100644
--- /dev/null
+++ b/common/stream/mapi_pb-c.c
@@ -0,0 +1,701 @@
+/* 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 "mapi_pb-c.h"
+void mapi_command__init
+ (MapiCommand *message)
+{
+ static MapiCommand init_value = MAPI_COMMAND__INIT;
+ *message = init_value;
+}
+size_t mapi_command__get_packed_size
+ (const MapiCommand *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_command__descriptor);
+ return protobuf_c_message_get_packed_size ((const
ProtobufCMessage*)(message));
+}
+size_t mapi_command__pack
+ (const MapiCommand *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_command__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t mapi_command__pack_to_buffer
+ (const MapiCommand *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_command__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message,
buffer);
+}
+MapiCommand *
+ mapi_command__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (MapiCommand *)
+ protobuf_c_message_unpack (&mapi_command__descriptor,
+ allocator, len, data);
+}
+void mapi_command__free_unpacked
+ (MapiCommand *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_command__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void mapi_reply__query_result__column__init
+ (MapiReply__QueryResult__Column *message)
+{
+ static MapiReply__QueryResult__Column init_value =
MAPI_REPLY__QUERY_RESULT__COLUMN__INIT;
+ *message = init_value;
+}
+void mapi_reply__query_result__init
+ (MapiReply__QueryResult *message)
+{
+ static MapiReply__QueryResult init_value = MAPI_REPLY__QUERY_RESULT__INIT;
+ *message = init_value;
+}
+void mapi_reply__init
+ (MapiReply *message)
+{
+ static MapiReply init_value = MAPI_REPLY__INIT;
+ *message = init_value;
+}
+size_t mapi_reply__get_packed_size
+ (const MapiReply *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_reply__descriptor);
+ return protobuf_c_message_get_packed_size ((const
ProtobufCMessage*)(message));
+}
+size_t mapi_reply__pack
+ (const MapiReply *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_reply__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t mapi_reply__pack_to_buffer
+ (const MapiReply *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_reply__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message,
buffer);
+}
+MapiReply *
+ mapi_reply__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (MapiReply *)
+ protobuf_c_message_unpack (&mapi_reply__descriptor,
+ allocator, len, data);
+}
+void mapi_reply__free_unpacked
+ (MapiReply *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor == &mapi_reply__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void mapi_auth_challenge__init
+ (MapiAuthChallenge *message)
+{
+ static MapiAuthChallenge init_value = MAPI_AUTH_CHALLENGE__INIT;
+ *message = init_value;
+}
+size_t mapi_auth_challenge__get_packed_size
+ (const MapiAuthChallenge *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_challenge__descriptor);
+ return protobuf_c_message_get_packed_size ((const
ProtobufCMessage*)(message));
+}
+size_t mapi_auth_challenge__pack
+ (const MapiAuthChallenge *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_challenge__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t mapi_auth_challenge__pack_to_buffer
+ (const MapiAuthChallenge *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_challenge__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message,
buffer);
+}
+MapiAuthChallenge *
+ mapi_auth_challenge__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (MapiAuthChallenge *)
+ protobuf_c_message_unpack (&mapi_auth_challenge__descriptor,
+ allocator, len, data);
+}
+void mapi_auth_challenge__free_unpacked
+ (MapiAuthChallenge *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_challenge__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+void mapi_auth_response__init
+ (MapiAuthResponse *message)
+{
+ static MapiAuthResponse init_value = MAPI_AUTH_RESPONSE__INIT;
+ *message = init_value;
+}
+size_t mapi_auth_response__get_packed_size
+ (const MapiAuthResponse *message)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_response__descriptor);
+ return protobuf_c_message_get_packed_size ((const
ProtobufCMessage*)(message));
+}
+size_t mapi_auth_response__pack
+ (const MapiAuthResponse *message,
+ uint8_t *out)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_response__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t mapi_auth_response__pack_to_buffer
+ (const MapiAuthResponse *message,
+ ProtobufCBuffer *buffer)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_response__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message,
buffer);
+}
+MapiAuthResponse *
+ mapi_auth_response__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (MapiAuthResponse *)
+ protobuf_c_message_unpack (&mapi_auth_response__descriptor,
+ allocator, len, data);
+}
+void mapi_auth_response__free_unpacked
+ (MapiAuthResponse *message,
+ ProtobufCAllocator *allocator)
+{
+ PROTOBUF_C_ASSERT (message->base.descriptor ==
&mapi_auth_response__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+const ProtobufCEnumValue mapi_command__command__enum_values_by_number[2] =
+{
+ { "X", "MAPI_COMMAND__COMMAND__X", 0 },
+ { "s", "MAPI_COMMAND__COMMAND__S", 1 },
+};
+static const ProtobufCIntRange mapi_command__command__value_ranges[] = {
+{0, 0},{0, 2}
+};
+const ProtobufCEnumValueIndex mapi_command__command__enum_values_by_name[2] =
+{
+ { "X", 0 },
+ { "s", 1 },
+};
+const ProtobufCEnumDescriptor mapi_command__command__descriptor =
+{
+ PROTOBUF_C_ENUM_DESCRIPTOR_MAGIC,
+ "MapiCommand.Command",
+ "Command",
+ "MapiCommand__Command",
+ "",
+ 2,
+ mapi_command__command__enum_values_by_number,
+ 2,
+ mapi_command__command__enum_values_by_name,
+ 1,
+ mapi_command__command__value_ranges,
+ NULL,NULL,NULL,NULL /* reserved[1234] */
+};
+static const ProtobufCFieldDescriptor mapi_command__field_descriptors[2] =
+{
+ {
+ "cmd",
+ 1,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(MapiCommand, cmd),
+ NULL,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "cmd_type",
+ 2,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_ENUM,
+ 0, /* quantifier_offset */
+ PROTOBUF_C_OFFSETOF(MapiCommand, cmd_type),
+ &mapi_command__command__descriptor,
+ NULL,
+ 0, /* packed */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned mapi_command__field_indices_by_name[] = {
+ 0, /* field[0] = cmd */
+ 1, /* field[1] = cmd_type */
+};
+static const ProtobufCIntRange mapi_command__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 2 }
+};
+const ProtobufCMessageDescriptor mapi_command__descriptor =
+{
+ PROTOBUF_C_MESSAGE_DESCRIPTOR_MAGIC,
+ "MapiCommand",
+ "MapiCommand",
+ "MapiCommand",
+ "",
+ sizeof(MapiCommand),
+ 2,
+ mapi_command__field_descriptors,
+ mapi_command__field_indices_by_name,
+ 1, mapi_command__number_ranges,
+ (ProtobufCMessageInit) mapi_command__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
+const ProtobufCEnumValue
mapi_reply__query_result__column__type__enum_values_by_number[3] =
+{
+ { "STRING", "MAPI_REPLY__QUERY_RESULT__COLUMN__TYPE__STRING", 1 },
+ { "INTEGER", "MAPI_REPLY__QUERY_RESULT__COLUMN__TYPE__INTEGER", 2 },
+ { "FLOAT", "MAPI_REPLY__QUERY_RESULT__COLUMN__TYPE__FLOAT", 3 },
+};
+static const ProtobufCIntRange
mapi_reply__query_result__column__type__value_ranges[] = {
+{1, 0},{0, 3}
+};
+const ProtobufCEnumValueIndex
mapi_reply__query_result__column__type__enum_values_by_name[3] =
+{
+ { "FLOAT", 2 },
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list