You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2013/01/11 11:43:25 UTC
[3/6] THRIFT-1826 update c_glib source header paths Patch: Simon South
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/protocol/thrift_protocol.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/protocol/thrift_protocol.c b/lib/c_glib/src/thrift/protocol/thrift_protocol.c
deleted file mode 100644
index a322fef..0000000
--- a/lib/c_glib/src/thrift/protocol/thrift_protocol.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift.h>
-#include <thrift/protocol/thrift_protocol.h>
-#include <thrift/transport/thrift_transport.h>
-
-/* define the GError domain string */
-#define THRIFT_PROTOCOL_ERROR_DOMAIN "thrift-protocol-error-quark"
-
-/* object properties */
-enum _ThriftProtocolProperties
-{
- PROP_0,
- PROP_THRIFT_PROTOCOL_TRANSPORT
-};
-
-G_DEFINE_ABSTRACT_TYPE(ThriftProtocol, thrift_protocol, G_TYPE_OBJECT)
-
-void
-thrift_protocol_get_property (GObject *object, guint property_id,
- GValue *value, GParamSpec *pspec)
-{
- ThriftProtocol *protocol = THRIFT_PROTOCOL (object);
-
- THRIFT_UNUSED_VAR (pspec);
-
- switch (property_id)
- {
- case PROP_THRIFT_PROTOCOL_TRANSPORT:
- g_value_set_object (value, protocol->transport);
- break;
- }
-}
-
-void
-thrift_protocol_set_property (GObject *object, guint property_id,
- const GValue *value, GParamSpec *pspec)
-{
-
- ThriftProtocol *protocol = THRIFT_PROTOCOL (object);
-
- THRIFT_UNUSED_VAR (pspec);
-
- switch (property_id)
- {
- case PROP_THRIFT_PROTOCOL_TRANSPORT:
- protocol->transport = g_value_get_object (value);
- break;
- }
-}
-
-
-gint32
-thrift_protocol_write_message_begin (ThriftProtocol *protocol,
- const gchar *name,
- const ThriftMessageType message_type,
- const gint32 seqid, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_message_begin
- (protocol, name,
- message_type, seqid,
- error);
-}
-
-gint32
-thrift_protocol_write_message_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_message_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_struct_begin (ThriftProtocol *protocol, const gchar *name,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_struct_begin (protocol,
- name, error);
-}
-
-gint32
-thrift_protocol_write_struct_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_struct_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_field_begin (ThriftProtocol *protocol,
- const gchar *name,
- const ThriftType field_type,
- const gint16 field_id,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_field_begin (protocol,
- name, field_type,
- field_id, error);
-}
-
-gint32
-thrift_protocol_write_field_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_field_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_field_stop (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_field_stop (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_map_begin (ThriftProtocol *protocol,
- const ThriftType key_type,
- const ThriftType value_type,
- const guint32 size, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_map_begin (protocol,
- key_type, value_type,
- size, error);
-}
-
-gint32
-thrift_protocol_write_map_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_map_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_list_begin (ThriftProtocol *protocol,
- const ThriftType element_type,
- const guint32 size, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_list_begin (protocol,
- element_type, size,
- error);
-}
-
-gint32
-thrift_protocol_write_list_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_list_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_set_begin (ThriftProtocol *protocol,
- const ThriftType element_type,
- const guint32 size, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_set_begin (protocol,
- element_type, size,
- error);
-}
-
-gint32
-thrift_protocol_write_set_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_set_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_write_bool (ThriftProtocol *protocol,
- const gboolean value, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_bool (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_write_byte (ThriftProtocol *protocol, const gint8 value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_byte (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_write_i16 (ThriftProtocol *protocol, const gint16 value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_i16 (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_write_i32 (ThriftProtocol *protocol, const gint32 value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_i32 (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_write_i64 (ThriftProtocol *protocol, const gint64 value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_i64 (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_write_double (ThriftProtocol *protocol,
- const gdouble value, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_double (protocol,
- value, error);
-}
-
-gint32
-thrift_protocol_write_string (ThriftProtocol *protocol,
- const gchar *str, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_string (protocol, str,
- error);
-}
-
-gint32
-thrift_protocol_write_binary (ThriftProtocol *protocol, const gpointer buf,
- const guint32 len, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_binary (protocol, buf,
- len, error);
-}
-
-gint32
-thrift_protocol_read_message_begin (ThriftProtocol *protocol,
- gchar **name,
- ThriftMessageType *message_type,
- gint32 *seqid, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_message_begin (protocol,
- name, message_type,
- seqid, error);
-}
-
-gint32
-thrift_protocol_read_message_end (ThriftProtocol *protocol,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_message_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_read_struct_begin (ThriftProtocol *protocol,
- gchar **name,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_struct_begin (protocol,
- name,
- error);
-}
-
-gint32
-thrift_protocol_read_struct_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_struct_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_read_field_begin (ThriftProtocol *protocol,
- gchar **name,
- ThriftType *field_type,
- gint16 *field_id,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_field_begin (protocol,
- name,
- field_type,
- field_id,
- error);
-}
-
-gint32
-thrift_protocol_read_field_end (ThriftProtocol *protocol,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_field_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_read_map_begin (ThriftProtocol *protocol,
- ThriftType *key_type,
- ThriftType *value_type, guint32 *size,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_map_begin (protocol,
- key_type,
- value_type,
- size,
- error);
-}
-
-gint32
-thrift_protocol_read_map_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_map_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_read_list_begin (ThriftProtocol *protocol,
- ThriftType *element_type,
- guint32 *size, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_list_begin (protocol,
- element_type,
- size, error);
-}
-
-gint32
-thrift_protocol_read_list_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_list_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_read_set_begin (ThriftProtocol *protocol,
- ThriftType *element_type,
- guint32 *size, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_set_begin (protocol,
- element_type,
- size, error);
-}
-
-gint32
-thrift_protocol_read_set_end (ThriftProtocol *protocol, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_set_end (protocol,
- error);
-}
-
-gint32
-thrift_protocol_read_bool (ThriftProtocol *protocol, gboolean *value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_bool (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_read_byte (ThriftProtocol *protocol, gint8 *value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_byte (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_read_i16 (ThriftProtocol *protocol, gint16 *value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_i16 (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_read_i32 (ThriftProtocol *protocol, gint32 *value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_i32 (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_read_i64 (ThriftProtocol *protocol, gint64 *value,
- GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_i64 (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_read_double (ThriftProtocol *protocol,
- gdouble *value, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_double (protocol, value,
- error);
-}
-
-gint32
-thrift_protocol_read_string (ThriftProtocol *protocol,
- gchar **str, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_string (protocol, str,
- error);
-}
-
-gint32
-thrift_protocol_read_binary (ThriftProtocol *protocol, gpointer *buf,
- guint32 *len, GError **error)
-{
- return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_binary (protocol, buf,
- len, error);
-}
-
-gint32
-thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error)
-{
- switch (type)
- {
- case T_BOOL:
- {
- gboolean boolv;
- return thrift_protocol_read_bool (protocol, &boolv, error);
- }
- case T_BYTE:
- {
- gint8 bytev;
- return thrift_protocol_read_byte (protocol, &bytev, error);
- }
-
- case T_I16:
- {
- gint16 i16;
- return thrift_protocol_read_i16 (protocol, &i16, error);
- }
- case T_I32:
- {
- gint32 i32;
- return thrift_protocol_read_i32 (protocol, &i32, error);
- }
- case T_I64:
- {
- gint64 i64;
- return thrift_protocol_read_i64 (protocol, &i64, error);
- }
- case T_DOUBLE:
- {
- gdouble dub;
- return thrift_protocol_read_double (protocol, &dub, error);
- }
- case T_STRING:
- {
- gpointer data;
- guint32 len;
- gint32 ret = thrift_protocol_read_binary (protocol, &data, &len, error);
- g_free (data);
- return ret;
- }
- case T_STRUCT:
- {
- guint32 result = 0;
- gchar *name;
- gint16 fid;
- ThriftType ftype;
- result += thrift_protocol_read_struct_begin (protocol, &name, error);
-
- while (1)
- {
- result += thrift_protocol_read_field_begin (protocol, &name, &ftype,
- &fid, error);
- if (ftype == T_STOP)
- {
- break;
- }
- result += thrift_protocol_skip (protocol, ftype, error);
- result += thrift_protocol_read_field_end (protocol, error);
- }
- result += thrift_protocol_read_struct_end (protocol, error);
- return result;
- }
- case T_MAP:
- {
- guint32 result = 0;
- ThriftType elem_type;
- guint32 i, size;
- result += thrift_protocol_read_set_begin (protocol, &elem_type, &size,
- error);
- for (i = 0; i < size; i++)
- {
- result += thrift_protocol_skip (protocol, elem_type, error);
- }
- result += thrift_protocol_read_set_end (protocol, error);
- return result;
- }
- case T_LIST:
- {
- guint32 result = 0;
- ThriftType elem_type;
- guint32 i, size;
- result += thrift_protocol_read_list_begin (protocol, &elem_type, &size,
- error);
- for (i = 0; i < size; i++)
- {
- result += thrift_protocol_skip (protocol, elem_type, error);
- }
- result += thrift_protocol_read_list_end (protocol, error);
- return result;
- }
- default:
- return 0;
- }
-}
-
-/* define the GError domain for Thrift protocols */
-GQuark
-thrift_protocol_error_quark (void)
-{
- return g_quark_from_static_string (THRIFT_PROTOCOL_ERROR_DOMAIN);
-}
-
-
-static void
-thrift_protocol_init (ThriftProtocol *protocol)
-{
- protocol->transport = NULL;
-}
-
-static void
-thrift_protocol_class_init (ThriftProtocolClass *cls)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-
- gobject_class->get_property = thrift_protocol_get_property;
- gobject_class->set_property = thrift_protocol_set_property;
-
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_PROTOCOL_TRANSPORT,
- g_param_spec_object ("transport", "Transport", "Thrift Transport",
- THRIFT_TYPE_TRANSPORT,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- cls->write_message_begin = thrift_protocol_write_message_begin;
- cls->write_message_end = thrift_protocol_write_message_end;
- cls->write_struct_begin = thrift_protocol_write_struct_begin;
- cls->write_struct_end = thrift_protocol_write_struct_end;
- cls->write_field_begin = thrift_protocol_write_field_begin;
- cls->write_field_end = thrift_protocol_write_field_end;
- cls->write_field_stop = thrift_protocol_write_field_stop;
- cls->write_map_begin = thrift_protocol_write_map_begin;
- cls->write_map_end = thrift_protocol_write_map_end;
- cls->write_list_begin = thrift_protocol_write_list_begin;
- cls->write_list_end = thrift_protocol_write_list_end;
- cls->write_set_begin = thrift_protocol_write_set_begin;
- cls->write_set_end = thrift_protocol_write_set_end;
- cls->write_bool = thrift_protocol_write_bool;
- cls->write_byte = thrift_protocol_write_byte;
- cls->write_i16 = thrift_protocol_write_i16;
- cls->write_i32 = thrift_protocol_write_i32;
- cls->write_i64 = thrift_protocol_write_i64;
- cls->write_double = thrift_protocol_write_double;
- cls->write_string = thrift_protocol_write_string;
- cls->write_binary = thrift_protocol_write_binary;
- cls->read_message_begin = thrift_protocol_read_message_begin;
- cls->read_message_end = thrift_protocol_read_message_end;
- cls->read_struct_begin = thrift_protocol_read_struct_begin;
- cls->read_struct_end = thrift_protocol_read_struct_end;
- cls->read_field_begin = thrift_protocol_read_field_begin;
- cls->read_field_end = thrift_protocol_read_field_end;
- cls->read_map_begin = thrift_protocol_read_map_begin;
- cls->read_map_end = thrift_protocol_read_map_end;
- cls->read_list_begin = thrift_protocol_read_list_begin;
- cls->read_set_begin = thrift_protocol_read_set_begin;
- cls->read_set_end = thrift_protocol_read_set_end;
- cls->read_bool = thrift_protocol_read_bool;
- cls->read_byte = thrift_protocol_read_byte;
- cls->read_i16 = thrift_protocol_read_i16;
- cls->read_i32 = thrift_protocol_read_i32;
- cls->read_i64 = thrift_protocol_read_i64;
- cls->read_double = thrift_protocol_read_double;
- cls->read_string = thrift_protocol_read_string;
- cls->read_binary = thrift_protocol_read_binary;
-}
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/protocol/thrift_protocol.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/protocol/thrift_protocol.h b/lib/c_glib/src/thrift/protocol/thrift_protocol.h
deleted file mode 100644
index 5dd562d..0000000
--- a/lib/c_glib/src/thrift/protocol/thrift_protocol.h
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_H
-#define _THRIFT_PROTOCOL_H
-
-#include <glib-object.h>
-
-#include <thrift/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_protocol.h
- * \brief Abstract class for Thrift protocol implementations.
- */
-
-/**
- * Enumerated definition of the types that the Thrift protocol supports.
- * Take special note of the T_END type which is used specifically to mark
- * the end of a sequence of fields.
- */
-typedef enum {
- T_STOP = 0,
- T_VOID = 1,
- T_BOOL = 2,
- T_BYTE = 3,
- T_I08 = 3,
- T_I16 = 6,
- T_I32 = 8,
- T_U64 = 9,
- T_I64 = 10,
- T_DOUBLE = 4,
- T_STRING = 11,
- T_UTF7 = 11,
- T_STRUCT = 12,
- T_MAP = 13,
- T_SET = 14,
- T_LIST = 15,
- T_UTF8 = 16,
- T_UTF16 = 17
-} ThriftType;
-
-/**
- * Enumerated definition of the message types that the Thrift protocol
- * supports.
- */
-typedef enum {
- T_CALL = 1,
- T_REPLY = 2,
- T_EXCEPTION = 3,
- T_ONEWAY = 4
-} ThriftMessageType;
-
-/* type macros */
-#define THRIFT_TYPE_PROTOCOL (thrift_protocol_get_type ())
-#define THRIFT_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_PROTOCOL, ThriftProtocol))
-#define THRIFT_IS_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_PROTOCOL))
-#define THRIFT_PROTOCOL_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_PROTOCOL, ThriftProtocolClass))
-#define THRIFT_IS_PROTOCOL_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_PROTOCOL))
-#define THRIFT_PROTOCOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_PROTOCOL, ThriftProtocolClass))
-
-/*!
- * Thrift Protocol object
- */
-struct _ThriftProtocol
-{
- GObject parent;
-
- /* protected */
- ThriftTransport *transport;
-};
-typedef struct _ThriftProtocol ThriftProtocol;
-
-/*!
- * Thrift Protocol class
- */
-struct _ThriftProtocolClass
-{
- GObjectClass parent;
-
- gint32 (*write_message_begin) (ThriftProtocol *protocol, const gchar *name,
- const ThriftMessageType message_type,
- const gint32 seqid, GError **error);
- gint32 (*write_message_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_struct_begin) (ThriftProtocol *protocol, const gchar *name,
- GError **error);
- gint32 (*write_struct_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_field_begin) (ThriftProtocol *protocol, const gchar *name,
- const ThriftType field_type,
- const gint16 field_id, GError **error);
- gint32 (*write_field_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_field_stop) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_map_begin) (ThriftProtocol *protocol,
- const ThriftType key_type,
- const ThriftType value_type,
- const guint32 size, GError **error);
- gint32 (*write_map_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_list_begin) (ThriftProtocol *protocol,
- const ThriftType element_type,
- const guint32 size, GError **error);
- gint32 (*write_list_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_set_begin) (ThriftProtocol *protocol,
- const ThriftType element_type,
- const guint32 size, GError **error);
- gint32 (*write_set_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*write_bool) (ThriftProtocol *protocol, const gboolean value,
- GError **error);
- gint32 (*write_byte) (ThriftProtocol *protocol, const gint8 value,
- GError **error);
- gint32 (*write_i16) (ThriftProtocol *protocol, const gint16 value,
- GError **error);
- gint32 (*write_i32) (ThriftProtocol *protocol, const gint32 value,
- GError **error);
- gint32 (*write_i64) (ThriftProtocol *protocol, const gint64 value,
- GError **error);
- gint32 (*write_double) (ThriftProtocol *protocol, const gdouble value,
- GError **error);
- gint32 (*write_string) (ThriftProtocol *protocol, const gchar *str,
- GError **error);
- gint32 (*write_binary) (ThriftProtocol *protocol, const gpointer buf,
- const guint32 len, GError **error);
-
- gint32 (*read_message_begin) (ThriftProtocol *thrift_protocol, gchar **name,
- ThriftMessageType *message_type,
- gint32 *seqid, GError **error);
- gint32 (*read_message_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*read_struct_begin) (ThriftProtocol *protocol, gchar **name,
- GError **error);
- gint32 (*read_struct_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*read_field_begin) (ThriftProtocol *protocol, gchar **name,
- ThriftType *field_type, gint16 *field_id,
- GError **error);
- gint32 (*read_field_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*read_map_begin) (ThriftProtocol *protocol, ThriftType *key_type,
- ThriftType *value_type, guint32 *size,
- GError **error);
- gint32 (*read_map_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*read_list_begin) (ThriftProtocol *protocol, ThriftType *element_type,
- guint32 *size, GError **error);
- gint32 (*read_list_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*read_set_begin) (ThriftProtocol *protocol, ThriftType *element_type,
- guint32 *size, GError **error);
- gint32 (*read_set_end) (ThriftProtocol *protocol, GError **error);
- gint32 (*read_bool) (ThriftProtocol *protocol, gboolean *value,
- GError **error);
- gint32 (*read_byte) (ThriftProtocol *protocol, gint8 *value, GError **error);
- gint32 (*read_i16) (ThriftProtocol *protocol, gint16 *value, GError **error);
- gint32 (*read_i32) (ThriftProtocol *protocol, gint32 *value, GError **error);
- gint32 (*read_i64) (ThriftProtocol *protocol, gint64 *value, GError **error);
- gint32 (*read_double) (ThriftProtocol *protocol, gdouble *value,
- GError **error);
- gint32 (*read_string) (ThriftProtocol *protocol, gchar **str, GError **error);
- gint32 (*read_binary) (ThriftProtocol *protocol, gpointer *buf,
- guint32 *len, GError **error);
-};
-typedef struct _ThriftProtocolClass ThriftProtocolClass;
-
-/* used by THRIFT_TYPE_PROTOCOL */
-GType thrift_protocol_get_type (void);
-
-/* virtual public methods */
-gint32 thrift_protocol_write_message_begin (ThriftProtocol *protocol,
- const gchar *name, const ThriftMessageType message_type,
- const gint32 seqid, GError **error);
-
-gint32 thrift_protocol_write_message_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_write_struct_begin (ThriftProtocol *protocol,
- const gchar *name,
- GError **error);
-
-gint32 thrift_protocol_write_struct_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_write_field_begin (ThriftProtocol *protocol,
- const gchar *name,
- const ThriftType field_type,
- const gint16 field_id,
- GError **error);
-
-gint32 thrift_protocol_write_field_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_write_field_stop (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_write_map_begin (ThriftProtocol *protocol,
- const ThriftType key_type,
- const ThriftType value_type,
- const guint32 size, GError **error);
-
-gint32 thrift_protocol_write_map_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_write_list_begin (ThriftProtocol *protocol,
- const ThriftType element_type,
- const guint32 size, GError **error);
-
-gint32 thrift_protocol_write_list_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_write_set_begin (ThriftProtocol *protocol,
- const ThriftType element_type,
- const guint32 size, GError **error);
-
-gint32 thrift_protocol_write_set_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_write_bool (ThriftProtocol *protocol,
- const gboolean value, GError **error);
-
-gint32 thrift_protocol_write_byte (ThriftProtocol *protocol, const gint8 value,
- GError **error);
-
-gint32 thrift_protocol_write_i16 (ThriftProtocol *protocol, const gint16 value,
- GError **error);
-
-gint32 thrift_protocol_write_i32 (ThriftProtocol *protocol, const gint32 value,
- GError **error);
-
-gint32 thrift_protocol_write_i64 (ThriftProtocol *protocol, const gint64 value,
- GError **error);
-
-gint32 thrift_protocol_write_double (ThriftProtocol *protocol,
- const gdouble value, GError **error);
-
-gint32 thrift_protocol_write_string (ThriftProtocol *protocol,
- const gchar *str, GError **error);
-
-gint32 thrift_protocol_write_binary (ThriftProtocol *protocol,
- const gpointer buf,
- const guint32 len, GError **error);
-
-gint32 thrift_protocol_read_message_begin (ThriftProtocol *thrift_protocol,
- gchar **name,
- ThriftMessageType *message_type,
- gint32 *seqid, GError **error);
-
-gint32 thrift_protocol_read_message_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_read_struct_begin (ThriftProtocol *protocol,
- gchar **name,
- GError **error);
-
-gint32 thrift_protocol_read_struct_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_read_field_begin (ThriftProtocol *protocol,
- gchar **name,
- ThriftType *field_type,
- gint16 *field_id,
- GError **error);
-
-gint32 thrift_protocol_read_field_end (ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_protocol_read_map_begin (ThriftProtocol *protocol,
- ThriftType *key_type,
- ThriftType *value_type, guint32 *size,
- GError **error);
-
-gint32 thrift_protocol_read_map_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_read_list_begin (ThriftProtocol *protocol,
- ThriftType *element_type,
- guint32 *size, GError **error);
-
-gint32 thrift_protocol_read_list_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_read_set_begin (ThriftProtocol *protocol,
- ThriftType *element_type,
- guint32 *size, GError **error);
-
-gint32 thrift_protocol_read_set_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_read_bool (ThriftProtocol *protocol, gboolean *value,
- GError **error);
-
-gint32 thrift_protocol_read_byte (ThriftProtocol *protocol, gint8 *value,
- GError **error);
-
-gint32 thrift_protocol_read_i16 (ThriftProtocol *protocol, gint16 *value,
- GError **error);
-
-gint32 thrift_protocol_read_i32 (ThriftProtocol *protocol, gint32 *value,
- GError **error);
-
-gint32 thrift_protocol_read_i64 (ThriftProtocol *protocol, gint64 *value,
- GError **error);
-
-gint32 thrift_protocol_read_double (ThriftProtocol *protocol,
- gdouble *value, GError **error);
-
-gint32 thrift_protocol_read_string (ThriftProtocol *protocol,
- gchar **str, GError **error);
-
-gint32 thrift_protocol_read_binary (ThriftProtocol *protocol,
- gpointer *buf, guint32 *len,
- GError **error);
-
-gint32 thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type,
- GError **error);
-
-/* define error types */
-typedef enum
-{
- THRIFT_PROTOCOL_ERROR_UNKNOWN,
- THRIFT_PROTOCOL_ERROR_INVALID_DATA,
- THRIFT_PROTOCOL_ERROR_NEGATIVE_SIZE,
- THRIFT_PROTOCOL_ERROR_SIZE_LIMIT,
- THRIFT_PROTOCOL_ERROR_BAD_VERSION,
- THRIFT_PROTOCOL_ERROR_NOT_IMPLEMENTED
-} ThriftProtocolError;
-
-/* define an error domain for GError to use */
-GQuark thrift_protocol_error_quark (void);
-#define THRIFT_PROTOCOL_ERROR (thrift_protocol_error_quark ())
-
-G_END_DECLS
-
-#endif /* _THRIFT_PROTOCOL_H */
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c b/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c
deleted file mode 100644
index e4c7c12..0000000
--- a/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift.h>
-#include <thrift/protocol/thrift_protocol_factory.h>
-
-G_DEFINE_ABSTRACT_TYPE(ThriftProtocolFactory, thrift_protocol_factory, G_TYPE_OBJECT)
-
-ThriftProtocol *
-thrift_protocol_factory_get_protocol(ThriftProtocolFactory *factory,
- ThriftTransport *transport)
-{
- return THRIFT_PROTOCOL_FACTORY_GET_CLASS (factory)->get_protocol (factory,
- transport);
-}
-
-static void
-thrift_protocol_factory_init (ThriftProtocolFactory *factory)
-{
- THRIFT_UNUSED_VAR (factory);
-}
-
-static void
-thrift_protocol_factory_class_init (ThriftProtocolFactoryClass *cls)
-{
- cls->get_protocol = thrift_protocol_factory_get_protocol;
-}
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h b/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h
deleted file mode 100644
index 5975e31..0000000
--- a/lib/c_glib/src/thrift/protocol/thrift_protocol_factory.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_FACTORY_H
-#define _THRIFT_PROTOCOL_FACTORY_H
-
-#include <glib-object.h>
-
-#include <thrift/transport/thrift_transport.h>
-#include <thrift/protocol/thrift_protocol.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_protocol_factory.h
- * \brief Abstract class for Thrift protocol factory implementations.
- */
-
-/* type macros */
-#define THRIFT_TYPE_PROTOCOL_FACTORY (thrift_protocol_factory_get_type ())
-#define THRIFT_PROTOCOL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_PROTOCOL_FACTORY, ThriftProtocolFactory))
-#define THRIFT_IS_PROTOCOL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_PROTOCOL_FACTORY))
-#define THRIFT_PROTOCOL_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_PROTOCOL_FACTORY, ThriftProtocolFactoryClass))
-#define THRIFT_IS_PROTOCOL_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_PROTOCOL_FACTORY))
-#define THRIFT_PROTOCOL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_PROTOCOL_FACTORY, ThriftProtocolFactoryClass))
-
-/*!
- * Thrift Protocol Factory object
- */
-struct _ThriftProtocolFactory
-{
- GObject parent;
-};
-typedef struct _ThriftProtocolFactory ThriftProtocolFactory;
-
-/*!
- * Thrift Protocol Factory class
- */
-struct _ThriftProtocolFactoryClass
-{
- GObjectClass parent;
-
- ThriftProtocol *(*get_protocol) (ThriftProtocolFactory *factory,
- ThriftTransport *transport);
-};
-typedef struct _ThriftProtocolFactoryClass ThriftProtocolFactoryClass;
-
-/* used by THRIFT_TYPE_PROTOCOL_FACTORY */
-GType thrift_protocol_factory_get_type (void);
-
-/* virtual public methods */
-ThriftProtocol *thrift_protocol_factory_get_protocol(ThriftProtocolFactory *factory, ThriftTransport *transport);
-
-G_END_DECLS
-
-#endif /* _THRIFT_PROTOCOL_FACTORY_H */
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/server/thrift_server.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/server/thrift_server.c b/lib/c_glib/src/thrift/server/thrift_server.c
deleted file mode 100644
index cef5a01..0000000
--- a/lib/c_glib/src/thrift/server/thrift_server.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift.h>
-#include "thrift_server.h"
-
-/* object properties */
-enum _ThriftServerProperties
-{
- PROP_0,
- PROP_THRIFT_SERVER_PROCESSOR,
- PROP_THRIFT_SERVER_SERVER_TRANSPORT,
- PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY,
- PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY,
- PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY,
- PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY
-};
-
-G_DEFINE_ABSTRACT_TYPE(ThriftServer, thrift_server, G_TYPE_OBJECT)
-
-void
-thrift_server_get_property (GObject *object, guint property_id,
- GValue *value, GParamSpec *pspec)
-{
- ThriftServer *server = THRIFT_SERVER (object);
-
- THRIFT_UNUSED_VAR (pspec);
-
- switch (property_id)
- {
- case PROP_THRIFT_SERVER_PROCESSOR:
- g_value_set_object (value, server->processor);
- break;
- case PROP_THRIFT_SERVER_SERVER_TRANSPORT:
- g_value_set_object (value, server->server_transport);
- break;
- case PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY:
- g_value_set_object (value, server->input_transport_factory);
- break;
- case PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY:
- g_value_set_object (value, server->output_transport_factory);
- break;
- case PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY:
- g_value_set_object (value, server->input_protocol_factory);
- break;
- case PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY:
- g_value_set_object (value, server->output_protocol_factory);
- break;
- }
-}
-
-void
-thrift_server_set_property (GObject *object, guint property_id,
- const GValue *value, GParamSpec *pspec)
-{
- ThriftServer *server = THRIFT_SERVER (object);
-
- THRIFT_UNUSED_VAR (pspec);
-
- switch (property_id)
- {
- case PROP_THRIFT_SERVER_PROCESSOR:
- server->processor = g_value_get_object (value);
- break;
- case PROP_THRIFT_SERVER_SERVER_TRANSPORT:
- server->server_transport = g_value_get_object (value);
- break;
- case PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY:
- server->input_transport_factory = g_value_get_object (value);
- break;
- case PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY:
- server->output_transport_factory = g_value_get_object (value);
- break;
- case PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY:
- server->input_protocol_factory = g_value_get_object (value);
- break;
- case PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY:
- server->output_protocol_factory = g_value_get_object (value);
- break;
- }
-}
-
-void
-thrift_server_serve (ThriftServer *server)
-{
- THRIFT_SERVER_GET_CLASS (server)->serve (server);
-}
-
-void
-thrift_server_stop (ThriftServer *server)
-{
- THRIFT_SERVER_GET_CLASS (server)->stop (server);
-}
-
-/* instance initializer for Thrift Server */
-static void
-thrift_server_init (ThriftServer *server)
-{
- server->processor = NULL;
- server->server_transport = NULL;
- server->input_transport_factory = NULL;
- server->output_transport_factory = NULL;
- server->input_protocol_factory = NULL;
- server->output_protocol_factory = NULL;
-}
-
-/* class initializer for ThriftServer
- * TODO: implement ServerEventHandler as a GClosure
- */
-static void
-thrift_server_class_init (ThriftServerClass *cls)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-
- gobject_class->get_property = thrift_server_get_property;
- gobject_class->set_property = thrift_server_set_property;
-
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_SERVER_PROCESSOR,
- g_param_spec_object ("processor", "Processor", "Thrift Processor",
- THRIFT_TYPE_PROCESSOR,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_SERVER_SERVER_TRANSPORT,
- g_param_spec_object ("server_transport", "Server Transport",
- "Thrift Server Transport",
- THRIFT_TYPE_SERVER_TRANSPORT,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY,
- g_param_spec_object ("input_transport_factory", "Input Transport Factory",
- "Thrift Server Input Transport Factory",
- THRIFT_TYPE_TRANSPORT_FACTORY,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY,
- g_param_spec_object ("output_transport_factory",
- "Output Transport Factory",
- "Thrift Server Output Transport Factory",
- THRIFT_TYPE_TRANSPORT_FACTORY,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY,
- g_param_spec_object ("input_protocol_factory", "Input Protocol Factory",
- "Thrift Server Input Protocol Factory",
- THRIFT_TYPE_PROTOCOL_FACTORY,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (gobject_class,
- PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY,
- g_param_spec_object ("output_protocol_factory", "Output Protocol Factory",
- "Thrift Server Output Protocol Factory",
- THRIFT_TYPE_PROTOCOL_FACTORY,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
- /* set these as virtual methods to be implemented by a subclass */
- cls->serve = thrift_server_serve;
- cls->stop = thrift_server_stop;
-}
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/server/thrift_server.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/server/thrift_server.h b/lib/c_glib/src/thrift/server/thrift_server.h
deleted file mode 100644
index a091a20..0000000
--- a/lib/c_glib/src/thrift/server/thrift_server.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SERVER_H
-#define _THRIFT_SERVER_H
-
-#include <glib-object.h>
-
-#include <thrift/processor/thrift_processor.h>
-#include <thrift/transport/thrift_server_transport.h>
-#include <thrift/transport/thrift_transport_factory.h>
-#include <thrift/protocol/thrift_protocol_factory.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_server.h
- * \brief Abstract class for Thrift servers.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SERVER (thrift_server_get_type ())
-#define THRIFT_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SERVER, ThriftServer))
-#define THRIFT_IS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SERVER))
-#define THRIFT_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SERVER, ThriftServerClass))
-#define THRIFT_IS_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SERVER))
-#define THRIFT_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SERVER, ThriftServerClass))
-
-/*!
- * Thrift Server object
- */
-struct _ThriftServer
-{
- GObject parent;
-
- /* protected */
- ThriftProcessor *processor;
- ThriftServerTransport *server_transport;
- ThriftTransportFactory *input_transport_factory;
- ThriftTransportFactory *output_transport_factory;
- ThriftProtocolFactory *input_protocol_factory;
- ThriftProtocolFactory *output_protocol_factory;
-};
-typedef struct _ThriftServer ThriftServer;
-
-/*!
- * Thrift Server class
- */
-struct _ThriftServerClass
-{
- GObjectClass parent;
-
- /* vtable */
- void (*serve) (ThriftServer *server);
- void (*stop) (ThriftServer *server);
-};
-typedef struct _ThriftServerClass ThriftServerClass;
-
-/* used by THRIFT_TYPE_SERVER */
-GType thrift_server_get_type (void);
-
-/*!
- * Processes the request.
- * \public \memberof ThriftServerClass
- */
-void thrift_server_serve (ThriftServer *server);
-
-/*!
- * Stop handling requests.
- */
-void thrift_server_stop (ThriftServer *server);
-
-G_END_DECLS
-
-#endif /* _THRIFT_SERVER_H */
-
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/server/thrift_simple_server.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/server/thrift_simple_server.c b/lib/c_glib/src/thrift/server/thrift_simple_server.c
deleted file mode 100644
index c39a58d..0000000
--- a/lib/c_glib/src/thrift/server/thrift_simple_server.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/server/thrift_simple_server.h>
-#include <thrift/transport/thrift_transport_factory.h>
-#include <thrift/protocol/thrift_protocol_factory.h>
-#include <thrift/protocol/thrift_binary_protocol_factory.h>
-
-G_DEFINE_TYPE(ThriftSimpleServer, thrift_simple_server, THRIFT_TYPE_SERVER)
-
-void
-thrift_simple_server_serve (ThriftServer *server)
-{
- g_return_if_fail (THRIFT_IS_SIMPLE_SERVER (server));
-
- ThriftTransport *t = NULL;
- ThriftTransport *input_transport = NULL, *output_transport = NULL;
- ThriftProtocol *input_protocol = NULL, *output_protocol = NULL;
- ThriftSimpleServer *tss = THRIFT_SIMPLE_SERVER(server);
-
- THRIFT_SERVER_TRANSPORT_GET_CLASS (server->server_transport)
- ->listen (server->server_transport, NULL);
-
- tss->running = TRUE;
- while (tss->running == TRUE)
- {
- t = thrift_server_transport_accept (server->server_transport, NULL);
- input_transport =
- THRIFT_TRANSPORT_FACTORY_GET_CLASS (server->input_transport_factory)
- ->get_transport (server->input_transport_factory, t);
- output_transport =
- THRIFT_TRANSPORT_FACTORY_GET_CLASS (server->output_transport_factory)
- ->get_transport (server->output_transport_factory, t);
- input_protocol =
- THRIFT_PROTOCOL_FACTORY_GET_CLASS (server->input_protocol_factory)
- ->get_protocol (server->input_protocol_factory, t);
- output_protocol =
- THRIFT_PROTOCOL_FACTORY_GET_CLASS (server->output_protocol_factory)
- ->get_protocol (server->output_protocol_factory, t);
-
- while (THRIFT_PROCESSOR_GET_CLASS (server->processor)
- ->process (server->processor, input_protocol, output_protocol))
- {
- // TODO: implement transport peek ()
- }
-
- // TODO: handle exceptions
- THRIFT_TRANSPORT_GET_CLASS (input_transport)->close (input_transport, NULL);
- THRIFT_TRANSPORT_GET_CLASS (output_transport)->close (output_transport,
- NULL);
- }
-
- // attempt to shutdown
- THRIFT_SERVER_TRANSPORT_GET_CLASS (server->server_transport)
- ->close (server->server_transport, NULL);
-}
-
-void
-thrift_simple_server_stop (ThriftServer *server)
-{
- g_return_if_fail (THRIFT_IS_SIMPLE_SERVER (server));
- (THRIFT_SIMPLE_SERVER (server))->running = FALSE;
-}
-
-static void
-thrift_simple_server_init (ThriftSimpleServer *tss)
-{
- tss->running = FALSE;
-
- ThriftServer *server = THRIFT_SERVER(tss);
-
- if (server->input_transport_factory == NULL)
- {
- server->input_transport_factory =
- g_object_new (THRIFT_TYPE_TRANSPORT_FACTORY, NULL);
- }
- if (server->output_transport_factory == NULL)
- {
- server->output_transport_factory =
- g_object_new (THRIFT_TYPE_TRANSPORT_FACTORY, NULL);
- }
- if (server->input_protocol_factory == NULL)
- {
- server->input_protocol_factory =
- g_object_new (THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, NULL);
- }
- if (server->output_protocol_factory == NULL)
- {
- server->output_protocol_factory =
- g_object_new (THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, NULL);
- }
-}
-
-/* initialize the class */
-static void
-thrift_simple_server_class_init (ThriftSimpleServerClass *class)
-{
- ThriftServerClass *cls = THRIFT_SERVER_CLASS(class);
-
- cls->serve = thrift_simple_server_serve;
- cls->stop = thrift_simple_server_stop;
-}
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/server/thrift_simple_server.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/server/thrift_simple_server.h b/lib/c_glib/src/thrift/server/thrift_simple_server.h
deleted file mode 100644
index 3547982..0000000
--- a/lib/c_glib/src/thrift/server/thrift_simple_server.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SIMPLE_SERVER_H
-#define _THRIFT_SIMPLE_SERVER_H
-
-#include <glib-object.h>
-
-#include <thrift/server/thrift_server.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_simple_server.h
- * \brief A simple Thrift server, single-threaded.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SIMPLE_SERVER (thrift_simple_server_get_type ())
-#define THRIFT_SIMPLE_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServer))
-#define THRIFT_IS_SIMPLE_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SIMPLE_SERVER))
-#define THRIFT_SIMPLE_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c) THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServerClass))
-#define THRIFT_IS_SIMPLE_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SIMPLE_SERVER))
-#define THRIFT_SIMPLE_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServerClass))
-
-/**
- * Thrift Simple Server instance.
- */
-struct _ThriftSimpleServer
-{
- ThriftServer parent;
-
- /* private */
- volatile gboolean running;
-};
-typedef struct _ThriftSimpleServer ThriftSimpleServer;
-
-/**
- * Thrift Simple Server class.
- */
-struct _ThriftSimpleServerClass
-{
- ThriftServerClass parent;
-};
-typedef struct _ThriftSimpleServerClass ThriftSimpleServerClass;
-
-/* used by THRIFT_TYPE_SIMPLE_SERVER */
-GType thrift_simple_server_get_type (void);
-
-G_END_DECLS
-
-#endif /* _THRIFT_SIMPLE_SERVER_H */
-
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/thrift.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/thrift.c b/lib/c_glib/src/thrift/thrift.c
deleted file mode 100644
index 34cadd4..0000000
--- a/lib/c_glib/src/thrift/thrift.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift.h>
-
-/**
- * GHashTable callback to add keys to a GList.
- */
-void
-thrift_hash_table_get_keys (gpointer key, gpointer value, gpointer user_data)
-{
- THRIFT_UNUSED_VAR (value);
- GList **list = (GList **) user_data;
- *list = g_list_append (*list, key);
-}
-
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/thrift.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/thrift.h b/lib/c_glib/src/thrift/thrift.h
deleted file mode 100644
index 0636a2f..0000000
--- a/lib/c_glib/src/thrift/thrift.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_H
-#define _THRIFT_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <glib.h>
-
-/* this macro is called to satisfy -Wall hardcore compilation */
-#ifndef THRIFT_UNUSED_VAR
-# define THRIFT_UNUSED_VAR(x) ((void) x)
-#endif
-
-void thrift_hash_table_get_keys (gpointer key, gpointer value,
- gpointer user_data);
-
-#endif // #ifndef _THRIFT_THRIFT_H
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/thrift_application_exception.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/thrift_application_exception.c b/lib/c_glib/src/thrift/thrift_application_exception.c
deleted file mode 100644
index c10a95e..0000000
--- a/lib/c_glib/src/thrift/thrift_application_exception.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "thrift_application_exception.h"
-#include <thrift/protocol/thrift_protocol.h>
-
-G_DEFINE_TYPE(ThriftApplicationException, thrift_application_exception, THRIFT_TYPE_STRUCT)
-
-gint32
-thrift_application_exception_read (ThriftStruct *object,
- ThriftProtocol *protocol, GError **error)
-{
- gint32 ret;
- gint32 xfer = 0;
- gchar *name;
- ThriftType ftype;
- gint16 fid;
- ThriftApplicationException *this = THRIFT_APPLICATION_EXCEPTION (object);
-
- /* read the struct begin marker */
- if ((ret = thrift_protocol_read_struct_begin (protocol, &name, error)) < 0)
- {
- if (name) g_free (name);
- return -1;
- }
- xfer += ret;
- if (name) g_free (name);
-
- while (1)
- {
- if ((ret = thrift_protocol_read_field_begin (protocol, &name, &ftype,
- &fid, error)) < 0)
- {
- if (name) g_free (name);
- return -1;
- }
- xfer += ret;
- if (name) g_free (name);
-
- /* break if we get a STOP field */
- if (ftype == T_STOP)
- {
- break;
- }
-
- switch (fid)
- {
- case 1:
- if (ftype == T_STRING)
- {
- if ((ret = thrift_protocol_read_string (protocol, &this->message,
- error)) < 0)
- return -1;
- xfer += ret;
- this->__isset_message = TRUE;
- } else {
- if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)
- return -1;
- xfer += ret;
- }
- break;
- case 2:
- if (ftype == T_I32)
- {
- if ((ret = thrift_protocol_read_i32 (protocol, &this->type,
- error)) < 0)
- return -1;
- xfer += ret;
- this->__isset_type = TRUE;
- } else {
- if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)
- return -1;
- xfer += ret;
- }
- break;
- default:
- if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)
- return -1;
- xfer += ret;
- break;
- }
- if ((ret = thrift_protocol_read_field_end (protocol, error)) < 0)
- return -1;
- xfer += ret;
- }
-
- if ((ret = thrift_protocol_read_struct_end (protocol, error)) < 0)
- return -1;
- xfer += ret;
-
- return xfer;
-}
-
-gint32
-thrift_application_exception_write (ThriftStruct *object,
- ThriftProtocol *protocol, GError **error)
-{
- gint32 ret;
- gint32 xfer = 0;
-
- ThriftApplicationException *this = THRIFT_APPLICATION_EXCEPTION (object);
-
- if ((ret = thrift_protocol_write_struct_begin (protocol,
- "TApplicationException",
- error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_field_begin (protocol, "message",
- T_STRING, 1, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_string (protocol, this->message, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_field_begin (protocol, "type",
- T_I32, 2, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_i32 (protocol, this->type, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
- return -1;
- xfer += ret;
- if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
- return -1;
- xfer += ret;
-
- return xfer;
-}
-
-
-/* GError domain */
-#define THRIFT_APPLICATION_EXCEPTION_ERROR_DOMAIN "thrift-application-exception-error-quark"
-
-GQuark
-thrift_application_exception_error_quark (void)
-{
- return g_quark_from_static_string (THRIFT_APPLICATION_EXCEPTION_ERROR_DOMAIN);
-}
-
-void
-thrift_application_exception_init (ThriftApplicationException *object)
-{
- object->type = 0;
- object->__isset_type = FALSE;
- object->message = NULL;
- object->__isset_message = FALSE;
-}
-
-void
-thrift_application_exception_class_init (ThriftApplicationExceptionClass *class)
-{
- ThriftStructClass *cls = THRIFT_STRUCT_CLASS(class);
- cls->read = thrift_application_exception_read;
- cls->write = thrift_application_exception_write;
-}
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/thrift_application_exception.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/thrift_application_exception.h b/lib/c_glib/src/thrift/thrift_application_exception.h
deleted file mode 100644
index 580f4fc..0000000
--- a/lib/c_glib/src/thrift/thrift_application_exception.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_APPLICATION_EXCEPTION_H
-#define _THRIFT_APPLICATION_EXCEPTION_H
-
-#include <glib-object.h>
-#include "thrift_struct.h"
-
-G_BEGIN_DECLS
-
-/*! \file thrift_application_exception.h
- * \brief C Implementation of a TApplicationException.
- */
-
-/* type macros */
-#define THRIFT_TYPE_APPLICATION_EXCEPTION (thrift_application_exception_get_type ())
-#define THRIFT_APPLICATION_EXCEPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationException))
-#define THRIFT_IS_APPLICATION_EXCEPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION))
-#define THRIFT_APPLICATION_EXCEPTION_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationExceptionClass))
-#define THRIFT_IS_APPLICATION_EXCEPTION_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_APPLICATION_EXCEPTION))
-#define THRIFT_APPLICATION_EXCEPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationExceptionClass))
-
-struct _ThriftApplicationException
-{
- ThriftStruct parent;
-
- /* public */
- gint32 type;
- gboolean __isset_type;
- gchar *message;
- gboolean __isset_message;
-};
-typedef struct _ThriftApplicationException ThriftApplicationException;
-
-struct _ThriftApplicationExceptionClass
-{
- ThriftStructClass parent;
-};
-typedef struct _ThriftApplicationExceptionClass ThriftApplicationExceptionClass;
-
-GType thrift_application_exception_get_type (void);
-
-/* gerror codes */
-typedef enum
-{
- THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN,
- THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN_METHOD,
- THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE,
- THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME,
- THRIFT_APPLICATION_EXCEPTION_ERROR_BAD_SEQUENCE_ID,
- THRIFT_APPLICATION_EXCEPTION_ERROR_MISSING_RESULT,
- THRIFT_APPLICATION_EXCEPTION_ERROR_INTERNAL_ERROR,
- THRIFT_APPLICATION_EXCEPTION_ERROR_PROTOCOL_ERROR,
- THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_TRANSFORM,
- THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_PROTOCOL,
- THRIFT_APPLICATION_EXCEPTION_ERROR_UNSUPPORTED_CLIENT_TYPE
-} ThriftApplicationExceptionError;
-
-/* define error domain for GError */
-GQuark thrift_application_exception_error_quark (void);
-#define THRIFT_APPLICATION_EXCEPTION_ERROR (thrift_application_exception_error_quark ())
-
-G_END_DECLS
-
-#endif /* _THRIFT_APPLICATION_EXCEPTION_H */
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/thrift_struct.c
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/thrift_struct.c b/lib/c_glib/src/thrift/thrift_struct.c
deleted file mode 100644
index 233d622..0000000
--- a/lib/c_glib/src/thrift/thrift_struct.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift.h>
-#include "thrift_struct.h"
-
-G_DEFINE_ABSTRACT_TYPE(ThriftStruct, thrift_struct, G_TYPE_OBJECT)
-
-gint32
-thrift_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
- GError **error)
-{
- g_return_val_if_fail (THRIFT_IS_STRUCT (object), -1);
- return THRIFT_STRUCT_GET_CLASS (object)->read (object, protocol, error);
-}
-
-gint32
-thrift_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
- GError **error)
-{
- g_return_val_if_fail (THRIFT_IS_STRUCT (object), -1);
- return THRIFT_STRUCT_GET_CLASS (object)->write (object, protocol, error);
-}
-
-static void
-thrift_struct_class_init (ThriftStructClass *cls)
-{
- cls->read = thrift_struct_read;
- cls->write = thrift_struct_write;
-}
-
-static void
-thrift_struct_init (ThriftStruct *structure)
-{
- THRIFT_UNUSED_VAR (structure);
-}
http://git-wip-us.apache.org/repos/asf/thrift/blob/e3da7683/lib/c_glib/src/thrift/thrift_struct.h
----------------------------------------------------------------------
diff --git a/lib/c_glib/src/thrift/thrift_struct.h b/lib/c_glib/src/thrift/thrift_struct.h
deleted file mode 100644
index 7542c05..0000000
--- a/lib/c_glib/src/thrift/thrift_struct.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef THRIFT_STRUCT_H
-#define THRIFT_STRUCT_H
-
-#include <glib-object.h>
-
-#include <thrift/protocol/thrift_protocol.h>
-
-G_BEGIN_DECLS
-
-#define THRIFT_TYPE_STRUCT (thrift_struct_get_type ())
-#define THRIFT_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_STRUCT, ThriftStruct))
-#define THRIFT_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_STRUCT, ThriftStructClass))
-#define THRIFT_IS_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_STRUCT))
-#define THRIFT_IS_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_STRUCT))
-#define THRIFT_STRUCT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_STRUCT, ThriftStructClass))
-
-/* struct */
-struct _ThriftStruct
-{
- GObject parent;
-
- /* private */
-};
-typedef struct _ThriftStruct ThriftStruct;
-
-struct _ThriftStructClass
-{
- GObjectClass parent;
-
- /* public */
- gint32 (*read) (ThriftStruct *object, ThriftProtocol *protocol,
- GError **error);
- gint32 (*write) (ThriftStruct *object, ThriftProtocol *protocol,
- GError **error);
-};
-typedef struct _ThriftStructClass ThriftStructClass;
-
-GType thrift_struct_get_type (void);
-
-gint32 thrift_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
- GError **error);
-
-gint32 thrift_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
- GError **error);
-G_END_DECLS
-
-#endif