/* arrays_resize.c generated by valac, the Vala compiler * generated from arrays_resize.vala, do not modify */ #include #include #include #if !defined(VALA_EXTERN) #if defined(_WIN32) || defined(__CYGWIN__) #define VALA_EXTERN __declspec(dllexport) extern #elif __GNUC__ >= 4 #define VALA_EXTERN __attribute__((visibility("default"))) extern #else #define VALA_EXTERN extern #endif #endif VALA_EXTERN gchar** boo; VALA_EXTERN gint boo_length1; gchar** boo = NULL; gint boo_length1 = 0; static gint _boo_size_ = 0; VALA_EXTERN void bar (gchar*** foo, gint* foo_length1); VALA_EXTERN void manam (gchar*** foo, gint* foo_length1); static void _vala_main (void); static void _vala_array_destroy (gpointer array, gssize array_length, GDestroyNotify destroy_func); static void _vala_array_free (gpointer array, gssize array_length, GDestroyNotify destroy_func); void bar (gchar*** foo, gint* foo_length1) { gint _tmp0_; _tmp0_ = 42; *foo = g_renew (gchar*, *foo, 42); (_tmp0_ > (*foo_length1)) ? memset ((*foo) + (*foo_length1), 0, sizeof (gchar*) * (_tmp0_ - (*foo_length1))) : NULL; *foo_length1 = _tmp0_; } void manam (gchar*** foo, gint* foo_length1) { gchar** _vala_foo = NULL; gint _vala_foo_length1 = 0; gchar** _tmp0_; gint _tmp1_; _tmp0_ = g_new0 (gchar*, 23 + 1); _vala_foo = (_vala_array_free (_vala_foo, _vala_foo_length1, (GDestroyNotify) g_free), NULL); _vala_foo = _tmp0_; _vala_foo_length1 = 23; _tmp1_ = 42; _vala_foo = g_renew (gchar*, _vala_foo, 42); (_tmp1_ > _vala_foo_length1) ? memset (_vala_foo + _vala_foo_length1, 0, sizeof (gchar*) * (_tmp1_ - _vala_foo_length1)) : NULL; _vala_foo_length1 = _tmp1_; if (foo) { *foo = _vala_foo; } else { _vala_foo = (_vala_array_free (_vala_foo, _vala_foo_length1, (GDestroyNotify) g_free), NULL); } if (foo_length1) { *foo_length1 = _vala_foo_length1; } } static void _vala_main (void) { { gchar** foo = NULL; gchar** _tmp0_; gint foo_length1; gint _foo_size_; gint _tmp1_; _tmp0_ = g_new0 (gchar*, 23 + 1); foo = _tmp0_; foo_length1 = 23; _foo_size_ = foo_length1; _tmp1_ = 42; foo = g_renew (gchar*, foo, 42); (_tmp1_ > foo_length1) ? memset (foo + foo_length1, 0, sizeof (gchar*) * (_tmp1_ - foo_length1)) : NULL; foo_length1 = _tmp1_; _foo_size_ = _tmp1_; foo = (_vala_array_free (foo, foo_length1, (GDestroyNotify) g_free), NULL); } { gchar** foo = NULL; gchar** _tmp2_; gint foo_length1; gint _foo_size_; _tmp2_ = g_new0 (gchar*, 23 + 1); foo = _tmp2_; foo_length1 = 23; _foo_size_ = foo_length1; bar (&foo, (gint*) (&foo_length1)); _foo_size_ = foo_length1; foo = (_vala_array_free (foo, foo_length1, (GDestroyNotify) g_free), NULL); } { gchar** foo = NULL; gint foo_length1 = 0; gint _foo_size_ = 0; gchar** _tmp3_ = NULL; gint _tmp4_ = 0; manam (&_tmp3_, &_tmp4_); foo = (_vala_array_free (foo, foo_length1, (GDestroyNotify) g_free), NULL); foo = _tmp3_; foo_length1 = _tmp4_; _foo_size_ = foo_length1; foo = (_vala_array_free (foo, foo_length1, (GDestroyNotify) g_free), NULL); } { gchar** _tmp5_; gint _tmp6_; _tmp5_ = g_new0 (gchar*, 23 + 1); boo = (_vala_array_free (boo, boo_length1, (GDestroyNotify) g_free), NULL); boo = _tmp5_; boo_length1 = 23; _boo_size_ = boo_length1; _tmp6_ = 42; boo = g_renew (gchar*, boo, 42); (_tmp6_ > boo_length1) ? memset (boo + boo_length1, 0, sizeof (gchar*) * (_tmp6_ - boo_length1)) : NULL; boo_length1 = _tmp6_; _boo_size_ = _tmp6_; } } int main (int argc, char ** argv) { _vala_main (); return 0; } static void _vala_array_destroy (gpointer array, gssize array_length, GDestroyNotify destroy_func) { if ((array != NULL) && (destroy_func != NULL)) { gssize i; for (i = 0; i < array_length; i = i + 1) { if (((gpointer*) array)[i] != NULL) { destroy_func (((gpointer*) array)[i]); } } } } static void _vala_array_free (gpointer array, gssize array_length, GDestroyNotify destroy_func) { _vala_array_destroy (array, array_length, destroy_func); g_free (array); }