gint32 thrift_binary_protocol_write_set_end (ThriftProtocol *protocol, GError **error) { THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (error); return 0; }
/* implements thrift_transport_write_end * called when write is complete. nothing to do on our end. */ gboolean thrift_framed_transport_write_end(ThriftTransport *transport, GError **error) { /* satisfy -Wall */ THRIFT_UNUSED_VAR(transport); THRIFT_UNUSED_VAR(error); return TRUE; }
gboolean thrift_test_handler_test_list (TTestThriftTestIf *iface, GArray **_return, const GArray *thing, GError **error) { guint i; gboolean first = TRUE; THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testList({"); for (i = 0; i < thing->len; i += 1) { gint32 value; gint32 *new_value; if (first) first = FALSE; else printf (", "); value = g_array_index (thing, gint32, i); printf ("%d", value); new_value = g_malloc (sizeof *new_value); *new_value = value; g_array_append_val (*_return, *new_value); } printf ("})\n"); return TRUE; }
/* implements thrift_transport_close */ gboolean thrift_memory_buffer_close (ThriftTransport *transport, GError **error) { THRIFT_UNUSED_VAR (transport); THRIFT_UNUSED_VAR (error); return TRUE; }
gboolean thrift_test_handler_test_set (TTestThriftTestIf *iface, GHashTable **_return, const GHashTable *thing, GError **error) { GHashTableIter hash_table_iter; gpointer key; gboolean first = TRUE; THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testSet({"); g_hash_table_iter_init (&hash_table_iter, (GHashTable *)thing); while (g_hash_table_iter_next (&hash_table_iter, &key, NULL)) { gint32 *new_key; if (first) first = FALSE; else printf (", "); printf ("%d", *(gint32 *)key); new_key = g_malloc (sizeof *new_key); *new_key = *(gint32 *)key; g_hash_table_insert (*_return, new_key, NULL); } printf ("})\n"); return TRUE; }
gboolean thrift_test_handler_test_multi (TTestThriftTestIf *iface, TTestXtruct **_return, const gint8 arg0, const gint32 arg1, const gint64 arg2, const GHashTable *arg3, const TTestNumberz arg4, const TTestUserId arg5, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); THRIFT_UNUSED_VAR (arg3); THRIFT_UNUSED_VAR (arg4); THRIFT_UNUSED_VAR (arg5); printf ("testMulti()\n"); g_object_set (*_return, "string_thing", g_strdup ("Hello2"), "byte_thing", arg0, "i32_thing", arg1, "i64_thing", arg2, NULL); return TRUE; }
int32_t thrift_binary_protocol_read_set_end (ThriftProtocol *protocol , int *error ) { THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (error); return 0; }
/* implements thrift_transport_flush * flush pending data. since we are not buffered, this is a no-op */ gboolean thrift_socket_flush (ThriftTransport *transport, GError **error) { /* satisfy -Wall */ THRIFT_UNUSED_VAR (transport); THRIFT_UNUSED_VAR (error); return TRUE; }
gint32 thrift_binary_protocol_read_field_end (ThriftProtocol *protocol, GError **error) { THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (error); return 0; }
int32_t thrift_binary_protocol_write_sandesh_end (ThriftProtocol *protocol , int *error ) { THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (error); return 0; }
/* implements thrift_transport_read_end * called when read is complete. nothing to do on our end. */ gboolean thrift_memory_buffer_read_end (ThriftTransport *transport, GError **error) { /* satisfy -Wall */ THRIFT_UNUSED_VAR (transport); THRIFT_UNUSED_VAR (error); return TRUE; }
gint32 thrift_binary_protocol_write_message_end (ThriftProtocol *protocol, GError **error) { /* satisfy -Wall */ THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (error); return 0; }
int32_t thrift_binary_protocol_write_struct_begin (ThriftProtocol *protocol , const char *name , int *error ) { THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (name); THRIFT_UNUSED_VAR (error); return 0; }
gint32 thrift_binary_protocol_read_struct_begin (ThriftProtocol *protocol, gchar **name, GError **error) { THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (error); *name = NULL; return 0; }
gboolean thrift_test_handler_test_void (TTestThriftTestIf *iface, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testVoid()\n"); return TRUE; }
gboolean test_processor_process (ThriftProcessor *processor, ThriftProtocol *in, ThriftProtocol *out, GError **error) { THRIFT_UNUSED_VAR (processor); THRIFT_UNUSED_VAR (in); THRIFT_UNUSED_VAR (out); THRIFT_UNUSED_VAR (error); return FALSE; }
gint32 thrift_binary_protocol_write_struct_begin (ThriftProtocol *protocol, const gchar *name, GError **error) { /* satisfy -Wall */ THRIFT_UNUSED_VAR (protocol); THRIFT_UNUSED_VAR (name); THRIFT_UNUSED_VAR (error); return 0; }
/* A one-way method has the same signature as an equivalent, regular method that returns no value. */ static gboolean tutorial_calculator_handler_zip (CalculatorIf *iface, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); puts ("zip()"); return TRUE; }
gboolean thrift_test_handler_test_multi_exception (TTestThriftTestIf *iface, TTestXtruct **_return, const gchar *arg0, const gchar *arg1, TTestXception **err1, TTestXception2 **err2, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); TTestXtruct *struct_thing; gboolean result; printf ("testMultiException(%s, %s)\n", arg0, arg1); g_assert (*err1 == NULL); g_assert (*err2 == NULL); if (strncmp (arg0, "Xception", 9) == 0) { *err1 = g_object_new (T_TEST_TYPE_XCEPTION, "errorCode", 1001, "message", g_strdup ("This is an Xception"), NULL); result = FALSE; } else if (strncmp (arg0, "Xception2", 10) == 0) { *err2 = g_object_new (T_TEST_TYPE_XCEPTION2, "errorCode", 2002); g_object_get (*err2, "struct_thing", &struct_thing, NULL); g_object_set (struct_thing, "string_thing", g_strdup ("This is an Xception2"), NULL); g_object_set (*err2, "struct_thing", struct_thing, NULL); g_object_unref (struct_thing); result = FALSE; } else { g_object_set (*_return, "string_thing", g_strdup (arg1), NULL); result = TRUE; } return result; }
gboolean thrift_test_handler_test_i64 (TTestThriftTestIf *iface, gint64 *_return, const gint64 thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testI64(%" PRId64 ")\n", thing); *_return = thing; return TRUE; }
gboolean thrift_test_handler_test_string (TTestThriftTestIf *iface, gchar **_return, const gchar *thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testString(\"%s\")\n", thing); *_return = g_strdup (thing); return TRUE; }
gboolean thrift_test_handler_test_double (TTestThriftTestIf *iface, gdouble *_return, const gdouble thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testDouble(%f)\n", thing); *_return = thing; return TRUE; }
gboolean thrift_test_handler_test_map_map (TTestThriftTestIf *iface, GHashTable **_return, const gint32 hello, GError **error) { GHashTable *positive; GHashTable *negative; gint32 *key; gint32 *value; guint i; THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testMapMap(%d)\n", hello); positive = g_hash_table_new_full (g_int_hash, g_int_equal, g_free, g_free); negative = g_hash_table_new_full (g_int_hash, g_int_equal, g_free, g_free); for (i = 1; i < 5; i += 1) { key = g_malloc (sizeof *key); value = g_malloc (sizeof *value); *key = i; *value = i; g_hash_table_insert (positive, key, value); key = g_malloc (sizeof *key); value = g_malloc (sizeof *value); *key = -i; *value = -i; g_hash_table_insert (negative, key, value); } key = g_malloc (sizeof *key); *key = 4; g_hash_table_insert (*_return, key, positive); key = g_malloc (sizeof *key); *key = -4; g_hash_table_insert (*_return, key, negative); return TRUE; }
gboolean thrift_test_handler_test_oneway (TTestThriftTestIf *iface, const gint32 secondsToSleep, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testOneway(%d): Sleeping...\n", secondsToSleep); sleep (secondsToSleep); printf ("testOneway(%d): done sleeping!\n", secondsToSleep); return TRUE; }
gboolean thrift_test_handler_test_binary (TTestThriftTestIf *iface, GByteArray ** _return, const GByteArray * thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testBinary()\n"); // TODO: hex output g_byte_array_append( *_return, thing->data, thing->len); return TRUE; }
gboolean thrift_test_handler_test_byte (TTestThriftTestIf *iface, gint8 *_return, const gint8 thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testByte(%d)\n", (gint)thing); *_return = thing; return TRUE; }
gboolean thrift_test_handler_test_enum (TTestThriftTestIf *iface, TTestNumberz *_return, const TTestNumberz thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testEnum(%d)\n", thing); *_return = thing; return TRUE; }
gboolean thrift_test_handler_test_bool (TTestThriftTestIf *iface, gboolean *_return, const gboolean thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testByte(%s)\n", thing ? "true" : "false"); *_return = thing; return TRUE; }
gboolean thrift_test_handler_test_typedef (TTestThriftTestIf *iface, TTestUserId *_return, const TTestUserId thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testTypedef(%" PRId64 ")\n", thing); *_return = thing; return TRUE; }
gboolean thrift_test_handler_test_i32 (TTestThriftTestIf *iface, gint32 *_return, const gint32 thing, GError **error) { THRIFT_UNUSED_VAR (iface); THRIFT_UNUSED_VAR (error); printf ("testI32(%d)\n", thing); *_return = thing; return TRUE; }