search for: g_strconcat

Displaying 17 results from an estimated 17 matches for "g_strconcat".

Did you mean: t_strconcat
2005 May 25
1
[PATCH] Fix wrong use of g_strconcat
Hi, the patch below fixes the wrong use of g_strconcat. It must be a typo of g_strdup_printf. Also fixed the printf format, too. Takashi --- src/plugin_xmms/http.c-dist 2005-05-25 16:14:03.000000000 +0200 +++ src/plugin_xmms/http.c 2005-05-25 16:17:30.000000000 +0200 @@ -484,7 +484,7 @@ static int http_connect (gchar *url_, gb flac_c...
2007 Aug 02
0
4 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_file_loader.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h player/swfdec_slow_loader.c
...*file SwfdecBuffer *buf; SwfdecLoader *loader; GError *error = NULL; - char *url; + char *url_string; + SwfdecURL *url; g_return_val_if_fail (filename != NULL, NULL); buf = swfdec_buffer_new_from_file (filename, &error); if (g_path_is_absolute (filename)) { - url = g_strconcat ("file://", filename, NULL); + url_string = g_strconcat ("file://", filename, NULL); } else { char *abs, *cur; cur = g_get_current_dir (); abs = g_build_filename (cur, filename, NULL); g_free (cur); - url = g_strconcat ("file://", abs, NULL...
2007 Aug 02
1
player/swfplay.c
...player, const g_print ("%s\n", message); } +static char * +sanitize_url (const char *s) +{ + SwfdecURL *url; + + url = swfdec_url_new (s); + if (g_str_equal (swfdec_url_get_protocol (url), "error")) { + char *dir, *full; + if (g_path_is_absolute (s)) + return g_strconcat ("file://", s, NULL); + dir = g_get_current_dir (); + full = g_strconcat ("file://", dir, G_DIR_SEPARATOR_S, s, NULL); + g_free (dir); + return full; + } else { + swfdec_url_free (url); + return g_strdup (s); + } +} + int main (int argc, char *argv[]) { @...
2007 Aug 02
0
15 commits - configure.ac doc/swfdec-sections.txt libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_file_loader.c libswfdec/swfdec_file_loader.h
...ec_loader_error (loader, "Don't know how to handle other protocols than file"); + return; + } + if (swfdec_url_get_host (url)) { + swfdec_loader_error (loader, "filenames cannot have hostnames"); + return; + } + + /* FIXME: append query string here? */ + real = g_strconcat ("/", swfdec_url_get_path (url), NULL); + buffer = swfdec_buffer_new_from_file (real, &error); + if (buffer == NULL) { + swfdec_loader_error (loader, error->message); + g_error_free (error); + } else { + swfdec_loader_set_size (loader, buffer->length); + swfdec_lo...
2007 Jul 31
0
10 commits - doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_buffer.c libswfdec/swfdec_debugger.c libswfdec/swfdec.h
..., url, NULL); - buffer = swfdec_buffer_new_from_file (real_path, &error); - ret = g_object_new (SWFDEC_TYPE_FILE_LOADER, NULL); - ret->url = real_path; - SWFDEC_FILE_LOADER (ret)->dir = g_strdup (SWFDEC_FILE_LOADER (loader)->dir); + /* FIXME: append query string here? */ + real = g_strconcat ("/", swfdec_url_get_path (url), NULL); + buffer = swfdec_buffer_new_from_file (real, &error); if (buffer == NULL) { - swfdec_loader_error (ret, error->message); + swfdec_loader_error (loader, error->message); g_error_free (error); } else { - swfdec_loader_s...
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
...ds; fun->swf = script; + swfdec_script_add_to_player (script, JS_GetContextPrivate (cx)); /* attach the function */ if (*function_name == '\0') { if (cx->fp->sp >= cx->fp->spend) { @@ -2170,6 +2177,7 @@ swfdec_action_print_set_target (guint ac } return g_strconcat ("SetTarget ", data, NULL); } + static char * swfdec_action_print_define_function (guint action, const guint8 *data, guint len) { @@ -2664,10 +2672,8 @@ swfdec_script_new_for_player (SwfdecPlay g_return_val_if_fail (bits != NULL, NULL); script = swfdec_script_new (bits, name,...
2007 Jun 28
0
Branch 'as' - 4 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...lue to 0, it is a valid undefined value.</note> + */ + +/*** actual code ***/ + +/** + * swfdec_as_str_concat: + * @cx: a #SwfdecAsContext + * @s1: first string + * @s2: second string + * + * Convenience function to concatenate two garbage-collected strings. This + * function is equivalent to g_strconcat (). + * + * Returns: A new garbage-collected string + **/ const char * swfdec_as_str_concat (SwfdecAsContext *cx, const char * s1, const char *s2) { @@ -174,10 +235,13 @@ swfdec_as_double_to_string (SwfdecAsCont * @context: a #SwfdecAsContext * @value: value to be expressed as string * - *...
2004 Sep 10
0
http streaming in the xmms plugin
...n address; + struct timeval tv; + + url = g_strdup (url_); + + do + { + redirect=FALSE; + + g_strstrip(url); + + parse_url(url, &user, &pass, &host, &port, &filename); + + if ((!filename || !*filename) && url[strlen(url) - 1] != '/') + temp = g_strconcat(url, "/", NULL); + else + temp = g_strdup(url); + g_free(url); + url = temp; + + chost = flac_cfg.stream.use_proxy ? flac_cfg.stream.proxy_host : host; + cport = flac_cfg.stream.use_proxy ? flac_cfg.stream.proxy_port : port; + + sock = socket(AF_INET, SOCK_STREAM, 0); +...
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_resource.c
...{ SwfdecEvent event; char *name; + guint i; g_return_if_fail (list != NULL); g_return_if_fail (list->refcount == 1); @@ -202,8 +160,9 @@ swfdec_event_list_parse (SwfdecEventList *list, SwfdecBits *bits, int version, event.conditions = conditions; event.key = key; - name = g_strconcat (description, ".", - swfdec_event_list_condition_name (conditions), NULL); + i = g_bit_nth_lsf (conditions, -1); + name = g_strconcat (description, ".", i < N_CONDITIONS ? + swfdec_event_type_get_name (i) : "???", NULL); event.script = swfdec_script...
2007 Aug 09
0
Branch 'vivi' - 12 commits - libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/Makefile.am libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_debugger.c
...ude "swfdec_debug.h" #include "swfdec_player_internal.h" -#include "swfdec_script.h" +#include "swfdec_script_internal.h" typedef struct _SwfdecEvent SwfdecEvent; @@ -202,7 +202,7 @@ swfdec_event_list_parse (SwfdecEventList event.key = key; name = g_strconcat (description, ".", swfdec_event_list_condition_name (conditions), NULL); - event.script = swfdec_script_new (bits, name, version); + event.script = swfdec_script_new_from_bits (bits, name, version); g_free (name); if (event.script) g_array_append_val (list->events...
2007 Jan 26
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_event.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c
...r, GFunc func, gpointer data); diff --git a/libswfdec/swfdec_event.c b/libswfdec/swfdec_event.c index 7ed820b..d988ad3 100644 --- a/libswfdec/swfdec_event.c +++ b/libswfdec/swfdec_event.c @@ -146,7 +146,7 @@ swfdec_event_list_parse (SwfdecEventList event.key = key; name = g_strconcat (description, ".", swfdec_event_list_condition_name (conditions), NULL); - event.script = swfdec_script_new (bits, name, version); + event.script = swfdec_script_new_for_player (list->player, bits, name, version); g_free (name); if (event.script) g_array_append_va...
2007 Apr 12
0
Branch 'as' - 15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...%u", (guint) *data); } +#endif static char * swfdec_action_print_set_target (guint action, const guint8 *data, guint len) { if (!memchr (data, 0, len)) { SWFDEC_ERROR ("SetTarget action does not specify a string"); - return JS_FALSE; + return NULL; } return g_strconcat ("SetTarget ", data, NULL); } +#if 0 static char * swfdec_action_print_define_function (guint action, const guint8 *data, guint len) { @@ -2166,8 +2146,8 @@ const SwfdecActionSpec swfdec_as_actions #endif [SWFDEC_AS_ACTION_GET_VARIABLE] = { "GetVariable", NULL, 1, 1, {...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...n_target_path (JSContext *cx /*** PRINT FUNCTIONS ***/ static char * +swfdec_action_print_set_target (guint action, const guint8 *data, guint len) +{ + if (!memchr (data, 0, len)) { + SWFDEC_ERROR ("SetTarget action does not specify a string"); + return JS_FALSE; + } + return g_strconcat ("SetTarget ", data, NULL); +} +static char * swfdec_action_print_define_function (guint action, const guint8 *data, guint len) { SwfdecBits bits; @@ -1733,7 +1742,7 @@ static const SwfdecActionSpec actions[25 [0x88] = { "ConstantPool", swfdec_action_print_constant_pool,...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...rintf ("StoreRegister %u", (guint) *data); +} + +static char * +swfdec_action_print_set_target (guint action, const guint8 *data, guint len) +{ + if (!memchr (data, 0, len)) { + SWFDEC_ERROR ("SetTarget action does not specify a string"); + return JS_FALSE; + } + return g_strconcat ("SetTarget ", data, NULL); +} + +static char * +swfdec_action_print_define_function (guint action, const guint8 *data, guint len) +{ + SwfdecBits bits; + GString *string; + const char *function_name; + guint i, n_args, size; + gboolean v2 = (action == 0x8e); + + string = g_string_n...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...n_target_path (JSContext *cx /*** PRINT FUNCTIONS ***/ static char * +swfdec_action_print_set_target (guint action, const guint8 *data, guint len) +{ + if (!memchr (data, 0, len)) { + SWFDEC_ERROR ("SetTarget action does not specify a string"); + return JS_FALSE; + } + return g_strconcat ("SetTarget ", data, NULL); +} +static char * swfdec_action_print_define_function (guint action, const guint8 *data, guint len) { SwfdecBits bits; @@ -1733,7 +1742,7 @@ static const SwfdecActionSpec actions[25 [0x88] = { "ConstantPool", swfdec_action_print_constant_pool,...
2007 Nov 07
0
36 commits - doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h
...100644 --- a/player/swfplay.c +++ b/player/swfplay.c @@ -85,6 +85,7 @@ sanitize_url (const char *s) url = swfdec_url_new (s); if (g_str_equal (swfdec_url_get_protocol (url), "error")) { char *dir, *full; + swfdec_url_free (url); if (g_path_is_absolute (s)) return g_strconcat ("file://", s, NULL); dir = g_get_current_dir (); commit c4ddf2017031b94207835ed657b4eede130a6aa0 Author: Benjamin Otte <otte at gnome.org> Date: Sat Nov 3 19:50:05 2007 +0100 memleak diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c index b937850..bdf2c3...
2007 Aug 22
0
163 commits - autogen.sh configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c
...ude "swfdec_debug.h" #include "swfdec_player_internal.h" -#include "swfdec_script.h" +#include "swfdec_script_internal.h" typedef struct _SwfdecEvent SwfdecEvent; @@ -202,7 +202,7 @@ swfdec_event_list_parse (SwfdecEventList event.key = key; name = g_strconcat (description, ".", swfdec_event_list_condition_name (conditions), NULL); - event.script = swfdec_script_new (bits, name, version); + event.script = swfdec_script_new_from_bits (bits, name, version); g_free (name); if (event.script) g_array_append_val (list->events...