static void serializer_finalize (Serializer* obj) { Serializer * self; self = SERIALIZER (obj); _g_object_unref0 (self->priv->menubar); _g_string_free0 (self->priv->sb); _g_string_free0 (self->priv->label_sb); }
static gchar* g_file_stream_read_line (FILE* self) { gchar* result = NULL; gint c = 0; GString* ret; GString* _tmp7_; g_return_val_if_fail (self != NULL, NULL); ret = NULL; while (TRUE) { gint _tmp0_ = 0; gint _tmp1_; GString* _tmp2_; gint _tmp4_; GString* _tmp5_; gint _tmp6_; _tmp0_ = fgetc (self); c = _tmp0_; _tmp1_ = c; if (!(_tmp1_ != EOF)) { break; } _tmp2_ = ret; if (_tmp2_ == NULL) { GString* _tmp3_; _tmp3_ = g_string_new (""); _g_string_free0 (ret); ret = _tmp3_; } _tmp4_ = c; if (_tmp4_ == ((gint) '\n')) { break; } _tmp5_ = ret; _tmp6_ = c; g_string_append_c (_tmp5_, (gchar) _tmp6_); } _tmp7_ = ret; if (_tmp7_ == NULL) { result = NULL; _g_string_free0 (ret); return result; } else { GString* _tmp8_; const gchar* _tmp9_; gchar* _tmp10_; _tmp8_ = ret; _tmp9_ = _tmp8_->str; _tmp10_ = g_strdup (_tmp9_); result = _tmp10_; _g_string_free0 (ret); return result; } _g_string_free0 (ret); }
static GnomenuSerializer* gnomenu_serializer_construct (GType object_type) { GnomenuSerializer* self; GString* _tmp0_; self = (GnomenuSerializer*) g_type_create_instance (object_type); self->priv->sb = (_tmp0_ = g_string_new (""), _g_string_free0 (self->priv->sb), _tmp0_); return self; }
gchar* daemon_smtp_configuration_ToString (DaemonSmtpConfiguration* self) { gchar* result = NULL; GString* _tmp0_ = NULL; GString* builder; gchar* _tmp1_ = NULL; gchar* _tmp2_; gchar* _tmp3_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_string_new (""); builder = _tmp0_; g_string_append (builder, "{\n\t"); g_string_append (builder, "Host: "); g_string_append (builder, self->priv->_Host); g_string_append (builder, ",\n\t"); g_string_append (builder, "Port: "); _tmp1_ = g_strdup_printf ("%hu", self->priv->_Port); _tmp2_ = _tmp1_; g_string_append (builder, _tmp2_); _g_free0 (_tmp2_); g_string_append (builder, ",\n\t"); g_string_append (builder, "Sender: "); g_string_append (builder, self->priv->_Sender); g_string_append (builder, "\n}"); _tmp3_ = g_strdup (builder->str); result = _tmp3_; _g_string_free0 (builder); return result; }
char* serializer_to_string (Serializer* self, GtkMenuBar* menubar) { char* result = NULL; GTimer* timer; GtkMenuBar* _tmp0_; GString* _tmp1_; GString* _tmp2_; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (menubar != NULL, NULL); timer = g_timer_new (); self->priv->menubar = (_tmp0_ = _g_object_ref0 (menubar), _g_object_unref0 (self->priv->menubar), _tmp0_); self->priv->sb = (_tmp1_ = g_string_new (""), _g_string_free0 (self->priv->sb), _tmp1_); self->priv->label_sb = (_tmp2_ = g_string_new (""), _g_string_free0 (self->priv->label_sb), _tmp2_); serializer_visit (self, (GtkWidget*) menubar); g_debug ("serializer.vala:13: Serializer consumption = %lf", g_timer_elapsed (timer, NULL)); result = g_strdup (self->priv->sb->str); _g_timer_destroy0 (timer); return result; }
static char* matenu_menu_bar_overflown_path_to_path (MatenuMenuBar* self, const char* path) { char* result = NULL; gint slashes; GString* sb; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); slashes = 0; sb = g_string_new (""); { gint i; i = 0; { gboolean _tmp0_; _tmp0_ = TRUE; while (TRUE) { if (!_tmp0_) { i++; } _tmp0_ = FALSE; if (!(i < string_get_length (path))) { break; } if (g_utf8_get_char (g_utf8_offset_to_pointer (path, i)) == '/') { slashes++; } if (slashes != 1) { g_string_append_unichar (sb, g_utf8_get_char (g_utf8_offset_to_pointer (path, i))); } } } } if (slashes > 1) { result = g_strdup (sb->str); _g_string_free0 (sb); return result; } result = NULL; _g_string_free0 (sb); return result; }
char* gnomenu_item_get_item_path (GnomenuItem* self) { char* result; GString* sb; GnomenuItem* item; GnomenuShell* parent; char* _tmp0_; g_return_val_if_fail (self != NULL, NULL); sb = g_string_new (""); item = _g_object_ref0 (self); parent = _g_object_ref0 (gnomenu_item_get_shell (item)); g_string_append (sb, _tmp0_ = gnomenu_item_get_item_path_name (self)); _g_free0 (_tmp0_); while (TRUE) { GnomenuItem* _tmp2_; GnomenuItem* _tmp1_; char* _tmp3_; GnomenuShell* _tmp4_; if (!(parent != NULL)) { break; } item = (_tmp2_ = _g_object_ref0 ((_tmp1_ = gnomenu_shell_get_owner (parent), GNOMENU_IS_ITEM (_tmp1_) ? ((GnomenuItem*) _tmp1_) : NULL)), _g_object_unref0 (item), _tmp2_); if (item == NULL) { break; } g_string_prepend_unichar (sb, (gunichar) '/'); g_string_prepend (sb, _tmp3_ = gnomenu_item_get_item_path_name (item)); _g_free0 (_tmp3_); parent = (_tmp4_ = _g_object_ref0 (gnomenu_item_get_shell (item)), _g_object_unref0 (parent), _tmp4_); } g_string_prepend_unichar (sb, (gunichar) '/'); result = g_strdup (sb->str); _g_object_unref0 (parent); _g_object_unref0 (item); _g_string_free0 (sb); return result; }
static gchar* skk_encoding_converter_convert (SkkEncodingConverter* self, GCharsetConverter* converter, const gchar* str, GError** error) { gchar* result = NULL; const gchar* _tmp0_; guint8* _tmp1_; gint _tmp1__length1; guint8* _tmp2_; gint _tmp2__length1; guint8* _tmp3_; gint _tmp3__length1; guint8* inbuf; gint inbuf_length1; gint _inbuf_size_; guint8* _tmp4_ = NULL; guint8* outbuf; gint outbuf_length1; gint _outbuf_size_; GString* _tmp5_; GString* builder; gsize total_bytes_read; GString* _tmp26_; const gchar* _tmp27_; gchar* _tmp28_; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (converter != NULL, NULL); g_return_val_if_fail (str != NULL, NULL); _tmp0_ = str; _tmp1_ = string_get_data (_tmp0_, &_tmp1__length1); _tmp2_ = _tmp1_; _tmp2__length1 = _tmp1__length1; _tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup1 (_tmp2_, _tmp2__length1) : ((gpointer) _tmp2_); _tmp3__length1 = _tmp2__length1; inbuf = _tmp3_; inbuf_length1 = _tmp3__length1; _inbuf_size_ = inbuf_length1; _tmp4_ = g_new0 (guint8, SKK_ENCODING_CONVERTER_BUFSIZ); outbuf = _tmp4_; outbuf_length1 = SKK_ENCODING_CONVERTER_BUFSIZ; _outbuf_size_ = outbuf_length1; _tmp5_ = g_string_new (""); builder = _tmp5_; total_bytes_read = (gsize) 0; while (TRUE) { gsize _tmp6_; guint8* _tmp7_; gint _tmp7__length1; gsize bytes_read = 0UL; gsize bytes_written = 0UL; GCharsetConverter* _tmp8_; guint8* _tmp9_; gint _tmp9__length1; gsize _tmp10_; guint8* _tmp11_; gint _tmp11__length1; guint8* _tmp12_; gint _tmp12__length1; gsize _tmp13_ = 0UL; gsize _tmp14_ = 0UL; gsize _tmp24_; gsize _tmp25_; _tmp6_ = total_bytes_read; _tmp7_ = inbuf; _tmp7__length1 = inbuf_length1; if (!(_tmp6_ < ((gsize) _tmp7__length1))) { break; } _tmp8_ = converter; _tmp9_ = inbuf; _tmp9__length1 = inbuf_length1; _tmp10_ = total_bytes_read; _tmp11_ = inbuf; _tmp11__length1 = inbuf_length1; _tmp12_ = outbuf; _tmp12__length1 = outbuf_length1; g_converter_convert ((GConverter*) _tmp8_, _tmp9_ + _tmp10_, (gsize) (_tmp11__length1 - _tmp10_), _tmp12_, (gsize) _tmp12__length1, G_CONVERTER_INPUT_AT_END, &_tmp13_, &_tmp14_, &_inner_error_); bytes_read = _tmp13_; bytes_written = _tmp14_; if (_inner_error_ != NULL) { g_propagate_error (error, _inner_error_); _g_string_free0 (builder); outbuf = (g_free (outbuf), NULL); inbuf = (g_free (inbuf), NULL); return NULL; } { gint i; i = 0; { gboolean _tmp15_; _tmp15_ = TRUE; while (TRUE) { gboolean _tmp16_; gint _tmp18_; gsize _tmp19_; GString* _tmp20_; guint8* _tmp21_; gint _tmp21__length1; gint _tmp22_; guint8 _tmp23_; _tmp16_ = _tmp15_; if (!_tmp16_) { gint _tmp17_; _tmp17_ = i; i = _tmp17_ + 1; } _tmp15_ = FALSE; _tmp18_ = i; _tmp19_ = bytes_written; if (!(((gsize) _tmp18_) < _tmp19_)) { break; } _tmp20_ = builder; _tmp21_ = outbuf; _tmp21__length1 = outbuf_length1; _tmp22_ = i; _tmp23_ = _tmp21_[_tmp22_]; g_string_append_c (_tmp20_, (gchar) _tmp23_); } } } _tmp24_ = total_bytes_read; _tmp25_ = bytes_read; total_bytes_read = _tmp24_ + _tmp25_; } _tmp26_ = builder; _tmp27_ = _tmp26_->str; _tmp28_ = g_strdup (_tmp27_); result = _tmp28_; _g_string_free0 (builder); outbuf = (g_free (outbuf), NULL); inbuf = (g_free (inbuf), NULL); return result; }
gchar* daemon_configuration_server_configuration_ToString (DaemonConfigurationServerConfiguration* self) { gchar* result = NULL; GString* _tmp0_ = NULL; GString* builder; gchar* _tmp1_ = NULL; gchar* _tmp2_; gboolean _tmp3_ = FALSE; gchar** _tmp4_ = NULL; gint _tmp5_; gchar* _tmp15_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_string_new (""); builder = _tmp0_; g_string_append (builder, "{\n\t"); g_string_append (builder, "Host: "); g_string_append (builder, self->priv->_Host); g_string_append (builder, ",\n\t"); g_string_append (builder, "Port: "); _tmp1_ = g_strdup_printf ("%hu", self->priv->_Port); _tmp2_ = _tmp1_; g_string_append (builder, _tmp2_); _g_free0 (_tmp2_); _tmp4_ = daemon_configuration_server_configuration_get_Channels (self, &_tmp5_); if (_tmp4_ != NULL) { gchar** _tmp6_ = NULL; gint _tmp7_; _tmp6_ = daemon_configuration_server_configuration_get_Channels (self, &_tmp7_); _tmp3_ = _tmp7_ > 0; } else { _tmp3_ = FALSE; } if (_tmp3_) { g_string_append (builder, ",\n\tChannels:\n\t["); g_string_append (builder, "\n\t\t"); { gint i; i = 0; { gboolean _tmp8_; _tmp8_ = TRUE; while (TRUE) { gchar** _tmp9_ = NULL; gint _tmp10_; gchar** _tmp11_ = NULL; gint _tmp12_; gchar** _tmp13_ = NULL; gint _tmp14_; if (!_tmp8_) { i++; } _tmp8_ = FALSE; _tmp9_ = daemon_configuration_server_configuration_get_Channels (self, &_tmp10_); if (!(i < _tmp10_)) { break; } _tmp11_ = daemon_configuration_server_configuration_get_Channels (self, &_tmp12_); g_string_append (builder, _tmp11_[i]); _tmp13_ = daemon_configuration_server_configuration_get_Channels (self, &_tmp14_); if (i < (_tmp14_ - 1)) { g_string_append (builder, ",\n\t\t"); } } } } g_string_append (builder, "\n\t]"); } g_string_append (builder, "\n}"); _tmp15_ = g_strdup (builder->str); result = _tmp15_; _g_string_free0 (builder); return result; }
static void gnomenu_serializer_finalize (GnomenuSerializer* obj) { GnomenuSerializer * self; self = GNOMENU_SERIALIZER (obj); _g_string_free0 (self->priv->sb); }
static gchar* vala_markup_reader_text (ValaMarkupReader* self, gchar end_char, gboolean rm_trailing_whitespace) { gchar* result = NULL; GString* _tmp0_; GString* content; gchar* _tmp1_; gchar* text_begin; gchar* _tmp2_; gchar* last_linebreak; gchar* _tmp84_; gchar* _tmp85_; gint _tmp92_; gchar* _tmp93_; gchar* _tmp94_; gboolean _tmp95_; GString* _tmp116_; const gchar* _tmp117_; gchar* _tmp118_; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_string_new (""); content = _tmp0_; _tmp1_ = self->priv->current; text_begin = _tmp1_; _tmp2_ = self->priv->current; last_linebreak = _tmp2_; while (TRUE) { gboolean _tmp3_ = FALSE; gchar* _tmp4_; gchar* _tmp5_; gboolean _tmp9_; gchar* _tmp10_; gchar* _tmp11_; gchar* _tmp12_; gunichar _tmp13_ = 0U; gunichar u; gunichar _tmp14_; _tmp4_ = self->priv->current; _tmp5_ = self->priv->end; if (_tmp4_ < _tmp5_) { gchar* _tmp6_; gchar _tmp7_; gchar _tmp8_; _tmp6_ = self->priv->current; _tmp7_ = _tmp6_[0]; _tmp8_ = end_char; _tmp3_ = _tmp7_ != _tmp8_; } else { _tmp3_ = FALSE; } _tmp9_ = _tmp3_; if (!_tmp9_) { break; } _tmp10_ = self->priv->current; _tmp11_ = self->priv->end; _tmp12_ = self->priv->current; _tmp13_ = g_utf8_get_char_validated ((const gchar*) _tmp10_, (gssize) ((glong) (_tmp11_ - _tmp12_))); u = _tmp13_; _tmp14_ = u; if (_tmp14_ == ((gunichar) (-1))) { vala_report_error (NULL, "invalid UTF-8 character"); } else { gunichar _tmp15_; _tmp15_ = u; if (_tmp15_ == ((gunichar) '&')) { gchar* _tmp16_; gunichar _tmp17_; gint _tmp18_ = 0; gchar* next_pos; gchar* _tmp19_; gboolean _tmp20_ = FALSE; _tmp16_ = self->priv->current; _tmp17_ = u; _tmp18_ = g_unichar_to_utf8 (_tmp17_, NULL); next_pos = _tmp16_ + _tmp18_; _tmp19_ = next_pos; _tmp20_ = g_str_has_prefix ((const gchar*) _tmp19_, "amp;"); if (_tmp20_) { GString* _tmp21_; gchar* _tmp22_; gchar* _tmp23_; gchar* _tmp24_; gchar* _tmp25_ = NULL; gchar* _tmp26_; GString* _tmp27_; gchar* _tmp28_; gchar* _tmp29_; _tmp21_ = content; _tmp22_ = text_begin; _tmp23_ = self->priv->current; _tmp24_ = text_begin; _tmp25_ = string_substring ((const gchar*) _tmp22_, (glong) 0, (glong) ((gint) (_tmp23_ - _tmp24_))); _tmp26_ = _tmp25_; g_string_append (_tmp21_, _tmp26_); _g_free0 (_tmp26_); _tmp27_ = content; g_string_append_c (_tmp27_, '&'); _tmp28_ = self->priv->current; self->priv->current = _tmp28_ + 5; _tmp29_ = self->priv->current; text_begin = _tmp29_; } else { gchar* _tmp30_; gboolean _tmp31_ = FALSE; _tmp30_ = next_pos; _tmp31_ = g_str_has_prefix ((const gchar*) _tmp30_, "quot;"); if (_tmp31_) { GString* _tmp32_; gchar* _tmp33_; gchar* _tmp34_; gchar* _tmp35_; gchar* _tmp36_ = NULL; gchar* _tmp37_; GString* _tmp38_; gchar* _tmp39_; gchar* _tmp40_; _tmp32_ = content; _tmp33_ = text_begin; _tmp34_ = self->priv->current; _tmp35_ = text_begin; _tmp36_ = string_substring ((const gchar*) _tmp33_, (glong) 0, (glong) ((gint) (_tmp34_ - _tmp35_))); _tmp37_ = _tmp36_; g_string_append (_tmp32_, _tmp37_); _g_free0 (_tmp37_); _tmp38_ = content; g_string_append_c (_tmp38_, '"'); _tmp39_ = self->priv->current; self->priv->current = _tmp39_ + 6; _tmp40_ = self->priv->current; text_begin = _tmp40_; } else { gchar* _tmp41_; gboolean _tmp42_ = FALSE; _tmp41_ = next_pos; _tmp42_ = g_str_has_prefix ((const gchar*) _tmp41_, "apos;"); if (_tmp42_) { GString* _tmp43_; gchar* _tmp44_; gchar* _tmp45_; gchar* _tmp46_; gchar* _tmp47_ = NULL; gchar* _tmp48_; GString* _tmp49_; gchar* _tmp50_; gchar* _tmp51_; _tmp43_ = content; _tmp44_ = text_begin; _tmp45_ = self->priv->current; _tmp46_ = text_begin; _tmp47_ = string_substring ((const gchar*) _tmp44_, (glong) 0, (glong) ((gint) (_tmp45_ - _tmp46_))); _tmp48_ = _tmp47_; g_string_append (_tmp43_, _tmp48_); _g_free0 (_tmp48_); _tmp49_ = content; g_string_append_c (_tmp49_, '\''); _tmp50_ = self->priv->current; self->priv->current = _tmp50_ + 6; _tmp51_ = self->priv->current; text_begin = _tmp51_; } else { gchar* _tmp52_; gboolean _tmp53_ = FALSE; _tmp52_ = next_pos; _tmp53_ = g_str_has_prefix ((const gchar*) _tmp52_, "lt;"); if (_tmp53_) { GString* _tmp54_; gchar* _tmp55_; gchar* _tmp56_; gchar* _tmp57_; gchar* _tmp58_ = NULL; gchar* _tmp59_; GString* _tmp60_; gchar* _tmp61_; gchar* _tmp62_; _tmp54_ = content; _tmp55_ = text_begin; _tmp56_ = self->priv->current; _tmp57_ = text_begin; _tmp58_ = string_substring ((const gchar*) _tmp55_, (glong) 0, (glong) ((gint) (_tmp56_ - _tmp57_))); _tmp59_ = _tmp58_; g_string_append (_tmp54_, _tmp59_); _g_free0 (_tmp59_); _tmp60_ = content; g_string_append_c (_tmp60_, '<'); _tmp61_ = self->priv->current; self->priv->current = _tmp61_ + 4; _tmp62_ = self->priv->current; text_begin = _tmp62_; } else { gchar* _tmp63_; gboolean _tmp64_ = FALSE; _tmp63_ = next_pos; _tmp64_ = g_str_has_prefix ((const gchar*) _tmp63_, "gt;"); if (_tmp64_) { GString* _tmp65_; gchar* _tmp66_; gchar* _tmp67_; gchar* _tmp68_; gchar* _tmp69_ = NULL; gchar* _tmp70_; GString* _tmp71_; gchar* _tmp72_; gchar* _tmp73_; _tmp65_ = content; _tmp66_ = text_begin; _tmp67_ = self->priv->current; _tmp68_ = text_begin; _tmp69_ = string_substring ((const gchar*) _tmp66_, (glong) 0, (glong) ((gint) (_tmp67_ - _tmp68_))); _tmp70_ = _tmp69_; g_string_append (_tmp65_, _tmp70_); _g_free0 (_tmp70_); _tmp71_ = content; g_string_append_c (_tmp71_, '>'); _tmp72_ = self->priv->current; self->priv->current = _tmp72_ + 4; _tmp73_ = self->priv->current; text_begin = _tmp73_; } else { gchar* _tmp74_; gunichar _tmp75_; gint _tmp76_ = 0; _tmp74_ = self->priv->current; _tmp75_ = u; _tmp76_ = g_unichar_to_utf8 (_tmp75_, NULL); self->priv->current = _tmp74_ + _tmp76_; } } } } } } else { gunichar _tmp77_; gchar* _tmp80_; gunichar _tmp81_; gint _tmp82_ = 0; gint _tmp83_; _tmp77_ = u; if (_tmp77_ == ((gunichar) '\n')) { gint _tmp78_; gchar* _tmp79_; _tmp78_ = self->priv->line; self->priv->line = _tmp78_ + 1; self->priv->column = 0; _tmp79_ = self->priv->current; last_linebreak = _tmp79_; } _tmp80_ = self->priv->current; _tmp81_ = u; _tmp82_ = g_unichar_to_utf8 (_tmp81_, NULL); self->priv->current = _tmp80_ + _tmp82_; _tmp83_ = self->priv->column; self->priv->column = _tmp83_ + 1; } } } _tmp84_ = text_begin; _tmp85_ = self->priv->current; if (_tmp84_ != _tmp85_) { GString* _tmp86_; gchar* _tmp87_; gchar* _tmp88_; gchar* _tmp89_; gchar* _tmp90_ = NULL; gchar* _tmp91_; _tmp86_ = content; _tmp87_ = text_begin; _tmp88_ = self->priv->current; _tmp89_ = text_begin; _tmp90_ = string_substring ((const gchar*) _tmp87_, (glong) 0, (glong) ((gint) (_tmp88_ - _tmp89_))); _tmp91_ = _tmp90_; g_string_append (_tmp86_, _tmp91_); _g_free0 (_tmp91_); } _tmp92_ = self->priv->column; _tmp93_ = self->priv->current; _tmp94_ = last_linebreak; self->priv->column = _tmp92_ + ((gint) (_tmp93_ - _tmp94_)); _tmp95_ = rm_trailing_whitespace; if (_tmp95_) { GString* _tmp96_; const gchar* _tmp97_; GString* _tmp98_; gssize _tmp99_; gchar* str_pos; GString* _tmp112_; gchar* _tmp113_; GString* _tmp114_; const gchar* _tmp115_; _tmp96_ = content; _tmp97_ = _tmp96_->str; _tmp98_ = content; _tmp99_ = _tmp98_->len; str_pos = ((gchar*) _tmp97_) + _tmp99_; { gchar* _tmp100_; gboolean _tmp101_; _tmp100_ = str_pos; str_pos = _tmp100_ - 1; _tmp101_ = TRUE; while (TRUE) { gboolean _tmp102_; gboolean _tmp104_ = FALSE; gchar* _tmp105_; GString* _tmp106_; const gchar* _tmp107_; gboolean _tmp111_; _tmp102_ = _tmp101_; if (!_tmp102_) { gchar* _tmp103_; _tmp103_ = str_pos; str_pos = _tmp103_ - 1; } _tmp101_ = FALSE; _tmp105_ = str_pos; _tmp106_ = content; _tmp107_ = _tmp106_->str; if (_tmp105_ > ((gchar*) _tmp107_)) { gchar* _tmp108_; gchar _tmp109_; gboolean _tmp110_ = FALSE; _tmp108_ = str_pos; _tmp109_ = _tmp108_[0]; _tmp110_ = g_ascii_isspace (_tmp109_); _tmp104_ = _tmp110_; } else { _tmp104_ = FALSE; } _tmp111_ = _tmp104_; if (!_tmp111_) { break; } } } _tmp112_ = content; _tmp113_ = str_pos; _tmp114_ = content; _tmp115_ = _tmp114_->str; g_string_erase (_tmp112_, (gssize) ((_tmp113_ - ((gchar*) _tmp115_)) + 1), (gssize) (-1)); } _tmp116_ = content; _tmp117_ = _tmp116_->str; _tmp118_ = g_strdup (_tmp117_); result = _tmp118_; _g_string_free0 (content); return result; }
RygelHTTPItemURI* rygel_http_item_uri_construct_from_string (GType object_type, const char* uri, RygelHTTPServer* http_server, GError** error) { #line 233 "rygel-http-item-uri.c" GError * _inner_error_; RygelHTTPItemURI * self; char* _tmp0_; RygelHTTPServer* _tmp1_; char* request_uri; char** _tmp3_; gint _parts_size_; gint parts_length1; char** _tmp2_; char** parts; gboolean _tmp4_ = FALSE; #line 45 "rygel-http-item-uri.vala" g_return_val_if_fail (uri != NULL, NULL); #line 45 "rygel-http-item-uri.vala" g_return_val_if_fail (http_server != NULL, NULL); #line 249 "rygel-http-item-uri.c" _inner_error_ = NULL; #line 45 "rygel-http-item-uri.vala" self = (RygelHTTPItemURI*) g_object_new (object_type, NULL); #line 49 "rygel-http-item-uri.vala" self->thumbnail_index = -1; #line 50 "rygel-http-item-uri.vala" self->subtitle_index = -1; #line 51 "rygel-http-item-uri.vala" self->transcode_target = (_tmp0_ = NULL, _g_free0 (self->transcode_target), _tmp0_); #line 52 "rygel-http-item-uri.vala" self->http_server = (_tmp1_ = _g_object_ref0 (http_server), _g_object_unref0 (self->http_server), _tmp1_); #line 54 "rygel-http-item-uri.vala" request_uri = string_replace (uri, rygel_http_server_get_path_root (http_server), ""); #line 263 "rygel-http-item-uri.c" parts = (_tmp3_ = _tmp2_ = g_strsplit (request_uri, "/", 0), parts_length1 = _vala_array_length (_tmp2_), _parts_size_ = parts_length1, _tmp3_); #line 57 "rygel-http-item-uri.vala" if (parts_length1 < 2) { #line 57 "rygel-http-item-uri.vala" _tmp4_ = TRUE; #line 269 "rygel-http-item-uri.c" } else { #line 57 "rygel-http-item-uri.vala" _tmp4_ = (parts_length1 % 2) == 0; #line 273 "rygel-http-item-uri.c" } #line 57 "rygel-http-item-uri.vala" if (_tmp4_) { #line 277 "rygel-http-item-uri.c" _inner_error_ = g_error_new (RYGEL_HTTP_REQUEST_ERROR, RYGEL_HTTP_REQUEST_ERROR_BAD_REQUEST, _ ("Invalid URI '%s'"), request_uri); { if (_inner_error_->domain == RYGEL_HTTP_REQUEST_ERROR) { g_propagate_error (error, _inner_error_); _g_free0 (request_uri); parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); g_object_unref (self); return NULL; } else { _g_free0 (request_uri); parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } } { gint i; #line 62 "rygel-http-item-uri.vala" i = 1; #line 299 "rygel-http-item-uri.c" { gboolean _tmp5_; #line 62 "rygel-http-item-uri.vala" _tmp5_ = TRUE; #line 62 "rygel-http-item-uri.vala" while (TRUE) { #line 306 "rygel-http-item-uri.c" GQuark _tmp13_; const char* _tmp12_; static GQuark _tmp13__label0 = 0; static GQuark _tmp13__label1 = 0; static GQuark _tmp13__label2 = 0; static GQuark _tmp13__label3 = 0; #line 62 "rygel-http-item-uri.vala" if (!_tmp5_) { #line 62 "rygel-http-item-uri.vala" i = i + 2; #line 317 "rygel-http-item-uri.c" } #line 62 "rygel-http-item-uri.vala" _tmp5_ = FALSE; #line 62 "rygel-http-item-uri.vala" if (!(i < (parts_length1 - 1))) { #line 62 "rygel-http-item-uri.vala" break; #line 325 "rygel-http-item-uri.c" } _tmp12_ = parts[i]; _tmp13_ = (NULL == _tmp12_) ? 0 : g_quark_from_string (_tmp12_); if (_tmp13_ == ((0 != _tmp13__label0) ? _tmp13__label0 : (_tmp13__label0 = g_quark_from_static_string ("item")))) switch (0) { default: { guchar* _tmp9_; gint _data_size_; gint data_length1; size_t _tmp7_; char* _tmp6_; guchar* _tmp8_; guchar* data; GString* builder; char* _tmp10_; data = (_tmp9_ = (_tmp8_ = g_base64_decode (_tmp6_ = soup_uri_decode (parts[i + 1]), &_tmp7_), _g_free0 (_tmp6_), _tmp8_), data_length1 = _tmp7_, _data_size_ = data_length1, _tmp9_); #line 66 "rygel-http-item-uri.vala" builder = g_string_new (""); #line 67 "rygel-http-item-uri.vala" g_string_append (builder, (const char*) data); #line 68 "rygel-http-item-uri.vala" self->item_id = (_tmp10_ = g_strdup (builder->str), _g_free0 (self->item_id), _tmp10_); #line 349 "rygel-http-item-uri.c" data = (g_free (data), NULL); _g_string_free0 (builder); #line 70 "rygel-http-item-uri.vala" break; #line 354 "rygel-http-item-uri.c" } } else if (_tmp13_ == ((0 != _tmp13__label1) ? _tmp13__label1 : (_tmp13__label1 = g_quark_from_static_string ("transcoded")))) switch (0) { default: { char* _tmp11_; #line 72 "rygel-http-item-uri.vala" self->transcode_target = (_tmp11_ = soup_uri_decode (parts[i + 1]), _g_free0 (self->transcode_target), _tmp11_); #line 74 "rygel-http-item-uri.vala" break; #line 365 "rygel-http-item-uri.c" } } else if (_tmp13_ == ((0 != _tmp13__label2) ? _tmp13__label2 : (_tmp13__label2 = g_quark_from_static_string ("thumbnail")))) switch (0) { default: { #line 76 "rygel-http-item-uri.vala" self->thumbnail_index = atoi (parts[i + 1]); #line 78 "rygel-http-item-uri.vala" break; #line 375 "rygel-http-item-uri.c" } } else if (_tmp13_ == ((0 != _tmp13__label3) ? _tmp13__label3 : (_tmp13__label3 = g_quark_from_static_string ("subtitle")))) switch (0) { default: { #line 80 "rygel-http-item-uri.vala" self->subtitle_index = atoi (parts[i + 1]); #line 82 "rygel-http-item-uri.vala" break; #line 385 "rygel-http-item-uri.c" } } else switch (0) { default: { #line 84 "rygel-http-item-uri.vala" break; #line 393 "rygel-http-item-uri.c" } } } } } #line 88 "rygel-http-item-uri.vala" if (self->item_id == NULL) { #line 401 "rygel-http-item-uri.c" _inner_error_ = g_error_new_literal (RYGEL_HTTP_REQUEST_ERROR, RYGEL_HTTP_REQUEST_ERROR_NOT_FOUND, _ ("Not Found")); { if (_inner_error_->domain == RYGEL_HTTP_REQUEST_ERROR) { g_propagate_error (error, _inner_error_); _g_free0 (request_uri); parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); g_object_unref (self); return NULL; } else { _g_free0 (request_uri); parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } } _g_free0 (request_uri); parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL); return self; }
static gchar* vala_ccode_file_get_define_for_filename (const gchar* filename) { gchar* result = NULL; GString* _tmp0_; GString* define; const gchar* _tmp1_; gchar* _tmp2_; gchar* i; GString* _tmp20_; GString* _tmp21_; const gchar* _tmp22_; gchar* _tmp23_; g_return_val_if_fail (filename != NULL, NULL); _tmp0_ = g_string_new ("__"); define = _tmp0_; _tmp1_ = filename; _tmp2_ = g_strdup (_tmp1_); i = _tmp2_; while (TRUE) { const gchar* _tmp3_; gint _tmp4_; gint _tmp5_; const gchar* _tmp6_; gunichar _tmp7_ = 0U; gunichar c; gboolean _tmp8_ = FALSE; gunichar _tmp9_; gboolean _tmp10_ = FALSE; gboolean _tmp12_; const gchar* _tmp17_; const gchar* _tmp18_ = NULL; gchar* _tmp19_; _tmp3_ = i; _tmp4_ = strlen (_tmp3_); _tmp5_ = _tmp4_; if (!(_tmp5_ > 0)) { break; } _tmp6_ = i; _tmp7_ = string_get_char (_tmp6_, (glong) 0); c = _tmp7_; _tmp9_ = c; _tmp10_ = g_unichar_isalnum (_tmp9_); if (_tmp10_) { gunichar _tmp11_; _tmp11_ = c; _tmp8_ = _tmp11_ < ((gunichar) 0x80); } else { _tmp8_ = FALSE; } _tmp12_ = _tmp8_; if (_tmp12_) { GString* _tmp13_; gunichar _tmp14_; gunichar _tmp15_ = 0U; _tmp13_ = define; _tmp14_ = c; _tmp15_ = g_unichar_toupper (_tmp14_); g_string_append_unichar (_tmp13_, _tmp15_); } else { GString* _tmp16_; _tmp16_ = define; g_string_append_c (_tmp16_, '_'); } _tmp17_ = i; _tmp18_ = g_utf8_next_char (_tmp17_); _tmp19_ = g_strdup (_tmp18_); _g_free0 (i); i = _tmp19_; } _tmp20_ = define; g_string_append (_tmp20_, "__"); _tmp21_ = define; _tmp22_ = _tmp21_->str; _tmp23_ = g_strdup (_tmp22_); result = _tmp23_; _g_free0 (i); _g_string_free0 (define); return result; }
static gchar* skk_skk_serv_read_response (SkkSkkServ* self, GError** error) { gchar* result = NULL; GString* _tmp0_; GString* builder; GString* _tmp21_; const gchar* _tmp22_; gint _tmp23_ = 0; gint index; gint _tmp24_; GString* _tmp26_; const gchar* _tmp27_; gint _tmp28_; gchar* _tmp29_ = NULL; GError * _inner_error_ = NULL; g_return_val_if_fail (self != NULL, NULL); _tmp0_ = g_string_new (""); builder = _tmp0_; while (TRUE) { GString* _tmp1_; const gchar* _tmp2_; gint _tmp3_ = 0; GSocketConnection* _tmp4_; GInputStream* _tmp5_; GInputStream* _tmp6_; gssize _tmp7_ = 0L; gssize len; gssize _tmp8_; _tmp1_ = builder; _tmp2_ = _tmp1_->str; _tmp3_ = string_index_of_char (_tmp2_, (gunichar) '\n', 0); if (!(_tmp3_ < 0)) { break; } _tmp4_ = self->priv->connection; _tmp5_ = g_io_stream_get_input_stream ((GIOStream*) _tmp4_); _tmp6_ = _tmp5_; _tmp7_ = g_input_stream_read (_tmp6_, self->priv->buffer, (gsize) 4096, NULL, &_inner_error_); len = _tmp7_; if (_inner_error_ != NULL) { if ((_inner_error_->domain == SKK_SKK_SERV_ERROR) || (_inner_error_->domain == G_IO_ERROR)) { g_propagate_error (error, _inner_error_); _g_string_free0 (builder); return NULL; } else { _g_string_free0 (builder); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } _tmp8_ = len; if (_tmp8_ < ((gssize) 0)) { GError* _tmp9_; _tmp9_ = g_error_new_literal (SKK_SKK_SERV_ERROR, SKK_SKK_SERV_ERROR_NOT_READABLE, "read error"); _inner_error_ = _tmp9_; if ((_inner_error_->domain == SKK_SKK_SERV_ERROR) || (_inner_error_->domain == G_IO_ERROR)) { g_propagate_error (error, _inner_error_); _g_string_free0 (builder); return NULL; } else { _g_string_free0 (builder); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } else { gssize _tmp10_; _tmp10_ = len; if (_tmp10_ == ((gssize) 0)) { break; } else { gssize _tmp11_; _tmp11_ = len; if (_tmp11_ > ((gssize) 0)) { guint8 _tmp12_; gssize _tmp14_; gchar* _tmp15_ = NULL; gchar* data; gint data_length1; gint _data_size_; gchar* _tmp16_; gint _tmp16__length1; gssize _tmp17_; gint _tmp18_; GString* _tmp19_; gchar* _tmp20_; gint _tmp20__length1; _tmp12_ = self->priv->buffer[0]; if (_tmp12_ != ((guint8) '1')) { GError* _tmp13_; _tmp13_ = g_error_new_literal (SKK_SKK_SERV_ERROR, SKK_SKK_SERV_ERROR_INVALID_RESPONSE, "invalid response code"); _inner_error_ = _tmp13_; if ((_inner_error_->domain == SKK_SKK_SERV_ERROR) || (_inner_error_->domain == G_IO_ERROR)) { g_propagate_error (error, _inner_error_); _g_string_free0 (builder); return NULL; } else { _g_string_free0 (builder); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } _tmp14_ = len; _tmp15_ = g_new0 (gchar, _tmp14_ + 1); data = _tmp15_; data_length1 = _tmp14_ + 1; _data_size_ = data_length1; _tmp16_ = data; _tmp16__length1 = data_length1; _tmp17_ = len; memcpy (_tmp16_, self->priv->buffer, (gsize) _tmp17_); _tmp18_ = data_length1; data_length1 = _tmp18_ - 1; _tmp19_ = builder; _tmp20_ = data; _tmp20__length1 = data_length1; g_string_append (_tmp19_, (const gchar*) _tmp20_); data = (g_free (data), NULL); } } } } _tmp21_ = builder; _tmp22_ = _tmp21_->str; _tmp23_ = string_index_of_char (_tmp22_, (gunichar) '\n', 0); index = _tmp23_; _tmp24_ = index; if (_tmp24_ < 0) { GError* _tmp25_; _tmp25_ = g_error_new_literal (SKK_SKK_SERV_ERROR, SKK_SKK_SERV_ERROR_INVALID_RESPONSE, "missing newline"); _inner_error_ = _tmp25_; if ((_inner_error_->domain == SKK_SKK_SERV_ERROR) || (_inner_error_->domain == G_IO_ERROR)) { g_propagate_error (error, _inner_error_); _g_string_free0 (builder); return NULL; } else { _g_string_free0 (builder); g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); g_clear_error (&_inner_error_); return NULL; } } _tmp26_ = builder; _tmp27_ = _tmp26_->str; _tmp28_ = index; _tmp29_ = string_slice (_tmp27_, (glong) 0, (glong) _tmp28_); result = _tmp29_; _g_string_free0 (builder); return result; }
static void __lambda3_ (Block1Data* _data1_) { gchar* chararray = NULL; const gchar* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; gint _tmp2_ = 0; gchar* _tmp3_ = NULL; gint chararray_length1 = 0; gint _chararray_size_ = 0; GString* temp = NULL; GString* _tmp4_ = NULL; GString* _tmp15_ = NULL; const gchar* _tmp16_ = NULL; #line 44 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp0_ = gtk_button_get_label (_data1_->button); #line 44 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp1_ = _tmp0_; #line 44 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp3_ = string_to_utf8 (_tmp1_, &_tmp2_); #line 44 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" chararray = _tmp3_; #line 44 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" chararray_length1 = _tmp2_; #line 44 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _chararray_size_ = chararray_length1; #line 45 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp4_ = g_string_new (""); #line 45 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" temp = _tmp4_; #line 183 "gtk-testing.c" { gint i = 0; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" i = 0; #line 188 "gtk-testing.c" { gboolean _tmp5_ = FALSE; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp5_ = TRUE; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" while (TRUE) { #line 195 "gtk-testing.c" gint _tmp7_ = 0; gchar* _tmp8_ = NULL; gint _tmp8__length1 = 0; GString* _tmp9_ = NULL; gchar* _tmp10_ = NULL; gint _tmp10__length1 = 0; gint _tmp11_ = 0; gchar _tmp12_ = '\0'; gchar* _tmp13_ = NULL; gchar* _tmp14_ = NULL; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" if (!_tmp5_) { #line 208 "gtk-testing.c" gint _tmp6_ = 0; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp6_ = i; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" i = _tmp6_ + 1; #line 214 "gtk-testing.c" } #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp5_ = FALSE; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp7_ = i; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp8_ = chararray; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp8__length1 = chararray_length1; #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" if (!(_tmp7_ < _tmp8__length1)) { #line 46 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" break; #line 228 "gtk-testing.c" } #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp9_ = temp; #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp10_ = chararray; #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp10__length1 = chararray_length1; #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp11_ = i; #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp12_ = _tmp10_[_tmp11_]; #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp13_ = g_strdup_printf ("%c", _tmp12_); #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp14_ = _tmp13_; #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" g_string_prepend (_tmp9_, _tmp14_); #line 47 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _g_free0 (_tmp14_); #line 248 "gtk-testing.c" } } } #line 49 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp15_ = temp; #line 49 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _tmp16_ = _tmp15_->str; #line 49 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" gtk_button_set_label (_data1_->button, _tmp16_); #line 43 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" _g_string_free0 (temp); #line 43 "/home/riley/git/vala/gtk-testing/src/gtk-testing.vala" chararray = (g_free (chararray), NULL); #line 262 "gtk-testing.c" }