search for: gbytearray

Displaying 18 results from an estimated 18 matches for "gbytearray".

Did you mean: bytearray
2012 Jan 12
1
Libguestfs gobject bindings
I'm currently working on gobject bindings for libguestfs. I haven't got as far as compiling anything yet, but I've attached the C header for initial review. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490 -------------- next part -------------- An embedded and
2012 Mar 28
1
[PATCH] Split gobject sources into 1 file per class
This patch replaces patches 14 and 15 from my previous series. The gtk-doc output is now reasonable, and we can rely on an automatically generated guestfs-sections.txt. Matt
2012 Jan 20
2
GObject bindings overview
I've summarised how the GObject bindings work below, which should hopefully help reviewing the generator/generated code. There are a couple of points in here I'm still not 100% happy with. Specifically the handling of FBuffer and the Cancellable flag. Both are explained below. I'm interested in suggestions. Return values: ************** All functions which can return an error
2007 Jun 12
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c
...*object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +swfdec_as_string_fromCharCode_5 (SwfdecAsContext *cx, SwfdecAsObject *object, + guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { guint i, c; guint8 append; @@ -123,7 +126,7 @@ swfdec_as_string_fromCharCode_5 (SwfdecA GByteArray *array = g_byte_array_new (); for (i = 0; i < argc; i++) { - c = ((guint) swfdec_as_value_to_integer (object->context, &argv[i])) % 65536; + c = ((guint) swfdec_as_value_to_integer (cx, &argv[i])) % 65536; if (c > 255) { append = c / 256; g_byte_array_...
2007 Aug 02
0
10 commits - libswfdec/compiler.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_player.c NEWS test/trace
...data[i] != 0x40 || data[i + 1] != 0x00) - return FALSE; - /* trust the data */ - len = i; for (i = 0; i < len; i++) { switch (i % 16) { case 0: @@ -69,14 +38,6 @@ write_data (guint8 *data, gsize len) return TRUE; } -static void -output_array (guint8 b, void *data) -{ - GByteArray *array = data; - - g_byte_array_append (array, &b, 1); -} - static char * get_name (const char *filename) { @@ -95,12 +56,12 @@ get_name (const char *filename) int main (int argc, char **argv) { - SWFMovie movie; SWFAction action; - GByteArray *array; char *contents; GError...
2012 Apr 26
3
[PATCH 1/3] gobject: NFC generated code formatting fix
--- generator/generator_gobject.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/generator_gobject.ml b/generator/generator_gobject.ml index e4c175b..48ddbf0 100644 --- a/generator/generator_gobject.ml +++ b/generator/generator_gobject.ml @@ -391,7 +391,7 @@ let generate_gobject_optargs_source name optargs flags () = pr "G_DEFINE_TYPE(%s, guestfs_%s,
2007 Jan 24
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_script.c test/swfdec_out.c test/swfdec_out.h test/swfedit_tag.c test/swfedit_token.c test/swfedit_token.h
...) + byte += s[0] + 10 - 'a'; + else if (s[0] >= 'A' && s[0] <= 'F') + byte += s[0] + 10 - 'A'; + else + return FALSE; + *result = byte; + return TRUE; +} + +static gboolean swfedit_binary_from_string (const char *s, gpointer* result) { GByteArray *array = g_byte_array_new (); - guint8 byte; + guint byte; + guint8 add; while (g_ascii_isspace (*s)) s++; do { - if (s[0] >= '0' && s[0] <= '9') - byte = s[0] - '0'; - else if (s[0] >= 'a' && s[0] <= 'f') -...
2007 Aug 20
0
8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_load_object.c libswfdec/swfdec_loadvars_as.c test/trace
...ented here so the mad string functions share the same place */ -static void -swfdec_as_string_unescape_5 (SwfdecAsContext *cx, SwfdecAsObject *object, - guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +static char * +swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg) { GByteArray *array; - const char *msg; char cur = 0; /* currently decoded character */ char *out, *in, *s; guint decoding = 0; /* set if we're decoding a %XY string */ @@ -480,11 +478,10 @@ swfdec_as_string_unescape_5 (SwfdecAsCon g_byte_array_append (array, (guchar *) chr, 1); \ }G_STMT_END...
2007 Jul 26
0
17 commits - doc/swfdec-sections.txt libswfdec/compiler.c libswfdec/.gitignore libswfdec/Makefile.am libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
...[i]); + break; + case 4: + case 8: + case 12: + g_print (", 0x%02X", data[i]); + break; + default: + g_print (", 0x%02X", data[i]); + break; + } + } + g_print ("\n"); + return TRUE; +} + +static void +output_array (guint8 b, void *data) +{ + GByteArray *array = data; + + g_byte_array_append (array, &b, 1); +} + +static char * +get_name (const char *filename) +{ + char *end; + + end = strrchr (filename, '/'); + if (end) + filename = end + 1; + end = strchr (filename, '.'); + if (end) + return g_strndup (filename,...
2007 Nov 14
0
9 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c libswfdec/swfdec_interval.c test/image test/trace
...th no args diff --git a/libswfdec/swfdec_as_string.c b/libswfdec/swfdec_as_string.c index 3a642c7..2fad7cf 100644 --- a/libswfdec/swfdec_as_string.c +++ b/libswfdec/swfdec_as_string.c @@ -223,18 +223,23 @@ swfdec_as_string_fromCharCode_5 (SwfdecAsContext *cx, SwfdecAsObject *object, char *s; GByteArray *array = g_byte_array_new (); - for (i = 0; i < argc; i++) { - c = ((guint) swfdec_as_value_to_integer (cx, &argv[i])) % 65536; - if (c > 255) { - append = c / 256; + if (argc > 0) { + for (i = 0; i < argc; i++) { + c = ((guint) swfdec_as_value_to_integer (cx,...
2007 Jan 22
0
Branch 'interpreter' - 3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_swf_decoder.c test/Makefile.am test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_tag.c test/swfedit_tag.h test/swfedit_token.c test/swfedit_token.h
...def HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <gtk/gtk.h> +#include <libswfdec/swfdec_buffer.h> +#include "swfedit_token.h" + +/*** CONVERTERS ***/ + +static gboolean +swfedit_binary_read (const char *s, gpointer* result) +{ + GByteArray *array = g_byte_array_new (); + guint8 byte; + + while (g_ascii_isspace (*s)) s++; + do { + if (s[0] >= '0' && s[0] <= '9') + byte = s[0] - '0'; + else if (s[0] >= 'a' && s[0] <= 'f') + byte = s[0] + 10 - 'a&...
2012 Mar 27
16
[PATCH 01/16] generator: Fix unescaped '<' and '>' in api descriptions
--- generator/generator_actions.ml | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 68a7bf6..fcf363f 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -4664,7 +4664,7 @@ This creates an ext2/3/4 filesystem on C<device> with an external journal on
2007 Aug 27
0
7 commits - libswfdec/Makefile.am libswfdec/swfdec_as_string.c libswfdec/swfdec_as_string.h libswfdec/swfdec_as_strings.c libswfdec/swfdec.h libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_player.c
...@ -599,21 +599,18 @@ swfdec_as_string_unescape_5 (SwfdecAsCon #undef APPEND } -static void -swfdec_as_string_escape (SwfdecAsContext *cx, SwfdecAsObject *object, - guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +char * +swfdec_as_string_escape (SwfdecAsContext *cx, const char *s) { GByteArray *array; - const char *s; char *in = NULL; array = g_byte_array_new (); - s = swfdec_as_value_to_string (cx, &argv[0]); if (cx->version <= 5) { in = g_convert (s, -1, "LATIN1", "UTF-8", NULL, NULL, NULL); if (s == NULL) { SWFDEC_FIXME (&quo...
2007 Feb 06
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_edittext.c libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_pattern.c libswfdec/swfdec_sprite.c test/dump.c
...+= s[0] + 10 - 'a'; + else if (s[0] >= 'A' && s[0] <= 'F') + byte += s[0] + 10 - 'A'; + else + return FALSE; + *result = byte; + return TRUE; +} + +static gboolean +swfedit_binary_from_string (const char *s, gpointer* result) +{ + GByteArray *array = g_byte_array_new (); + guint byte; + guint8 add; + + while (g_ascii_isspace (*s)) s++; + do { + if (!swfedit_parse_hex (s, &byte)) + break; + s += 2; + add = byte; + g_byte_array_append (array, &add, 1); + while (g_ascii_isspace (*s)) s++; + } w...
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
...of bytes we've advancecd in the bytecode */ -} Offset; - -typedef struct { - JSContext * cx; /* JSContext from player */ - JSAtomList atoms; /* accumulated atoms */ - - SwfdecBits * bits; /* where to read the code from */ - int version; /* Flash version we're compiling for */ - GByteArray * bytecode; /* generated bytecode so far */ - char * error; /* error encountered while compiling */ - GArray * offsets; /* offsets of actions */ - GArray * jumps; /* accumulated jumps */ - GArray * trynotes; /* try/catch blocks */ - GPtrArray * pool; /* ConstantPool data */ - GArray...
2007 Jan 25
0
Branch 'interpreter' - 28 commits - configure.ac libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_player.c
...ing to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ @@ -29,7 +29,7 @@ /*** CONVERTERS ***/ static gboolean -swfedit_binary_read (const char *s, gpointer* result) +swfedit_binary_from_string (const char *s, gpointer* result) { GByteArray *array = g_byte_array_new (); guint8 byte; @@ -71,7 +71,7 @@ swfedit_binary_read (const char *s, gpoi } static char * -swfedit_binary_write (gconstpointer value) +swfedit_binary_to_string (gconstpointer value) { guint i; const SwfdecBuffer *buffer = value; @@ -86,7 +86,7 @@ swfedit_bi...
2007 Aug 20
0
Branch 'vivi' - 60 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c
...ented here so the mad string functions share the same place */ -static void -swfdec_as_string_unescape_5 (SwfdecAsContext *cx, SwfdecAsObject *object, - guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +static char * +swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg) { GByteArray *array; - const char *msg; char cur = 0; /* currently decoded character */ char *out, *in, *s; guint decoding = 0; /* set if we're decoding a %XY string */ @@ -480,11 +478,10 @@ swfdec_as_string_unescape_5 (SwfdecAsCon g_byte_array_append (array, (guchar *) chr, 1); \ }G_STMT_END...
2008 Jan 07
0
12 commits - configure.ac doc/swfdec.types Makefile.am test/crashfinder.c test/dump.c test/Makefile.am test/swfdec-extract.c test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_list.c test/swfedit_list.h
...; s[0] <= 'F') - byte += s[0] + 10 - 'A'; - else - return FALSE; - *result = byte; - return TRUE; -} - -static gpointer -swfedit_binary_new (void) -{ - return swfdec_buffer_new (); -} - -static gboolean -swfedit_binary_from_string (const char *s, gpointer* result) -{ - GByteArray *array = g_byte_array_new (); - guint byte; - guint8 add; - - while (g_ascii_isspace (*s)) s++; - do { - if (!swfedit_parse_hex (s, &byte)) - break; - s += 2; - add = byte; - g_byte_array_append (array, &add, 1); - while (g_ascii_isspace (*s)) s++; - } while (*s !=...