~ubuntu-branches/ubuntu/quantal/vala/quantal

« back to all changes in this revision

Viewing changes to codegen/valagasyncmodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-01-18 09:51:15 UTC
  • mfrom: (1.5.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20110118095115-r2jr7c63lr0jzj0y
Tags: 0.11.4-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
typedef struct _ValaGTypeModuleClass ValaGTypeModuleClass;
166
166
typedef struct _ValaGTypeModulePrivate ValaGTypeModulePrivate;
167
167
 
168
 
#define VALA_TYPE_TYPEREGISTER_FUNCTION (vala_typeregister_function_get_type ())
169
 
#define VALA_TYPEREGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunction))
170
 
#define VALA_TYPEREGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunctionClass))
171
 
#define VALA_IS_TYPEREGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION))
172
 
#define VALA_IS_TYPEREGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_TYPEREGISTER_FUNCTION))
173
 
#define VALA_TYPEREGISTER_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunctionClass))
174
 
 
175
 
typedef struct _ValaTypeRegisterFunction ValaTypeRegisterFunction;
176
 
typedef struct _ValaTypeRegisterFunctionClass ValaTypeRegisterFunctionClass;
177
 
 
178
168
#define VALA_TYPE_GOBJECT_MODULE (vala_gobject_module_get_type ())
179
169
#define VALA_GOBJECT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_GOBJECT_MODULE, ValaGObjectModule))
180
170
#define VALA_GOBJECT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_GOBJECT_MODULE, ValaGObjectModuleClass))
272
262
        ValaTypeSymbol* gbytearray_type;
273
263
        ValaTypeSymbol* gptrarray_type;
274
264
        ValaTypeSymbol* gthreadpool_type;
 
265
        ValaDataType* gdestroynotify_type;
275
266
        ValaDataType* gquark_type;
276
267
        ValaStruct* gvalue_type;
277
268
        ValaClass* gvariant_type;
301
292
        ValaCCodeExpression* (*get_dup_func_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaSourceReference* source_reference, gboolean is_chainup);
302
293
        gchar* (*append_struct_array_free) (ValaCCodeBaseModule* self, ValaStruct* st);
303
294
        ValaCCodeExpression* (*destroy_value) (ValaCCodeBaseModule* self, ValaTargetValue* value, gboolean is_macro_definition);
304
 
        void (*append_local_free) (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop);
 
295
        void (*append_local_free) (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
305
296
        gchar* (*get_delegate_target_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
306
297
        ValaCCodeExpression* (*get_delegate_target_cexpression) (ValaCCodeBaseModule* self, ValaExpression* delegate_expr, ValaCCodeExpression** delegate_target_destroy_notify);
307
298
        ValaCCodeExpression* (*get_delegate_target_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
312
303
        void (*generate_interface_declaration) (ValaCCodeBaseModule* self, ValaInterface* iface, ValaCCodeFile* decl_space);
313
304
        void (*generate_method_declaration) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space);
314
305
        void (*generate_error_domain_declaration) (ValaCCodeBaseModule* self, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
315
 
        ValaCCodeExpression* (*deserialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* variant_expr, ValaCCodeExpression* expr);
 
306
        ValaCCodeExpression* (*deserialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* variant_expr, ValaCCodeExpression* expr, ValaCCodeExpression* error_expr, gboolean* may_fail);
316
307
        ValaCCodeExpression* (*serialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* expr);
317
308
        ValaCCodeExpression* (*get_implicit_cast_expression) (ValaCCodeBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaExpression* expr);
318
309
        gboolean (*is_gobject_property) (ValaCCodeBaseModule* self, ValaProperty* prop);
321
312
        gboolean (*method_has_wrapper) (ValaCCodeBaseModule* self, ValaMethod* method);
322
313
        ValaCCodeFunctionCall* (*get_param_spec) (ValaCCodeBaseModule* self, ValaProperty* prop);
323
314
        ValaCCodeFunctionCall* (*get_signal_creation) (ValaCCodeBaseModule* self, ValaSignal* sig, ValaTypeSymbol* type);
324
 
        void (*register_dbus_info) (ValaCCodeBaseModule* self, ValaObjectTypeSymbol* bindable);
 
315
        void (*register_dbus_info) (ValaCCodeBaseModule* self, ValaCCodeBlock* block, ValaObjectTypeSymbol* bindable);
325
316
        gchar* (*get_dynamic_property_getter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
326
317
        gchar* (*get_dynamic_property_setter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
327
318
        gchar* (*get_dynamic_signal_cname) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
432
423
        ValaGErrorModuleClass parent_class;
433
424
        void (*generate_virtual_method_declaration) (ValaGTypeModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaCCodeStruct* type_struct);
434
425
        void (*generate_class_init) (ValaGTypeModule* self, ValaClass* cl);
435
 
        ValaTypeRegisterFunction* (*create_interface_register_function) (ValaGTypeModule* self, ValaInterface* iface);
436
426
};
437
427
 
438
428
struct _ValaGObjectModule {
484
474
GType vala_ccode_delegate_module_get_type (void) G_GNUC_CONST;
485
475
GType vala_gerror_module_get_type (void) G_GNUC_CONST;
486
476
GType vala_gtype_module_get_type (void) G_GNUC_CONST;
487
 
gpointer vala_typeregister_function_ref (gpointer instance);
488
 
void vala_typeregister_function_unref (gpointer instance);
489
 
GParamSpec* vala_param_spec_typeregister_function (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
490
 
void vala_value_set_typeregister_function (GValue* value, gpointer v_object);
491
 
void vala_value_take_typeregister_function (GValue* value, gpointer v_object);
492
 
gpointer vala_value_get_typeregister_function (const GValue* value);
493
 
GType vala_typeregister_function_get_type (void) G_GNUC_CONST;
494
477
GType vala_gobject_module_get_type (void) G_GNUC_CONST;
495
478
GType vala_gsignal_module_get_type (void) G_GNUC_CONST;
496
479
GType vala_gasync_module_get_type (void) G_GNUC_CONST;
540
523
ValaArrayList* vala_ccode_base_module_get_temp_ref_vars (ValaCCodeBaseModule* self);
541
524
static void vala_gasync_module_real_return_with_exception (ValaGErrorModule* base, ValaCCodeExpression* error_expr);
542
525
void vala_gerror_module_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr);
543
 
void vala_ccode_base_module_append_local_free (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop);
 
526
void vala_ccode_base_module_append_local_free (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
544
527
ValaSymbol* vala_ccode_base_module_get_current_symbol (ValaCCodeBaseModule* self);
545
528
void vala_ccode_method_module_complete_async (ValaCCodeMethodModule* self);
546
529
static void vala_gasync_module_real_visit_return_statement (ValaCodeVisitor* base, ValaReturnStatement* stmt);
1914
1897
}
1915
1898
 
1916
1899
 
1917
 
static const gchar* string_offset (const gchar* self, glong offset) {
1918
 
        const gchar* result = NULL;
1919
 
        g_return_val_if_fail (self != NULL, NULL);
1920
 
        result = (const gchar*) (((gchar*) self) + offset);
1921
 
        return result;
1922
 
}
1923
 
 
1924
 
 
1925
1900
static gchar* string_substring (const gchar* self, glong offset, glong len) {
1926
1901
        gchar* result = NULL;
1927
1902
        gint _tmp0_;
1928
1903
        glong string_length;
1929
 
        const gchar* _tmp1_ = NULL;
1930
 
        const gchar* start;
1931
 
        const gchar* _tmp2_ = NULL;
1932
 
        gchar* _tmp3_ = NULL;
 
1904
        gchar* _tmp1_ = NULL;
1933
1905
        g_return_val_if_fail (self != NULL, NULL);
1934
1906
        _tmp0_ = strlen (self);
1935
1907
        string_length = (glong) _tmp0_;
1943
1915
                len = string_length - offset;
1944
1916
        }
1945
1917
        g_return_val_if_fail ((offset + len) <= string_length, NULL);
1946
 
        _tmp1_ = string_offset (self, offset);
1947
 
        start = _tmp1_;
1948
 
        _tmp2_ = string_offset (start, len);
1949
 
        _tmp3_ = g_strndup (start, ((gchar*) _tmp2_) - ((gchar*) start));
1950
 
        result = _tmp3_;
 
1918
        _tmp1_ = g_strndup (((gchar*) self) + offset, (gsize) len);
 
1919
        result = _tmp1_;
1951
1920
        return result;
1952
1921
}
1953
1922
 
3238
3207
        _tmp15_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
3239
3208
        vala_ccode_function_add_expression (_tmp15_, (ValaCCodeExpression*) free_error);
3240
3209
        _tmp16_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
3241
 
        vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp16_, FALSE);
 
3210
        vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp16_, FALSE, NULL);
3242
3211
        vala_ccode_method_module_complete_async ((ValaCCodeMethodModule*) self);
3243
3212
        _vala_ccode_node_unref0 (free_error);
3244
3213
        _vala_ccode_node_unref0 (set_error);