search for: g_file_get_contents

Displaying 11 results from an estimated 11 matches for "g_file_get_contents".

2007 Oct 29
0
libswfdec/swfdec_buffer.c
...s returned and @error is set. The error can be - * any of the errors that are valid from g_mapped_file_new(). + * Creates a buffer containing the contents of the given file. If loading the + * file fails, %NULL is returned and @error is set. The error can be + * any of the errors that are valid for g_file_get_contents(). * * Returns: a new #SwfdecBuffer or %NULL on failure **/ @@ -250,22 +250,25 @@ SwfdecBuffer * swfdec_buffer_new_from_file (const char *filename, GError **error) { GMappedFile *file; - SwfdecBuffer *buffer; + char *data; + gsize length; g_return_val_if_fail (filename != NULL, N...
2019 Dec 03
0
[p2v PATCH 6/6] Remove whole-file.c
The only function in it, read_whole_file(), is not used anymore. (And anyway, the GLib function g_file_get_contents() can be used instead.) --- Makefile.am | 3 +- p2v.h | 3 -- whole-file.c | 94 ---------------------------------------------------- 3 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 whole-file.c diff --git a/Makefile.am b/Makefile.am index 02e3288..7649511 100644 --...
2007 Nov 15
0
6 commits - libswfdec/compiler.c libswfdec/swfdec_as_date.h libswfdec/swfdec_text_format.c libswfdec/swfdec_xml.c test/dump.c test/render.c test/render-fast.c
...g_free (buffer->data); -} - -int main (int argc, char *argv[]) -{ - gsize length; - int ret; - char *fn = "it.swf"; - SwfdecDecoder *s; - int i; - char *contents; - SwfdecBuffer *buffer; - int n_frames; - - swfdec_init (); - - if(argc>=2){ - fn = argv[1]; - } - - ret = g_file_get_contents (fn, &contents, &length, NULL); - if (!ret) { - exit(1); - } - - s = swfdec_decoder_new(); - - buffer = swfdec_buffer_new_with_data (contents, length); - buffer->free = buffer_free; - ret = swfdec_decoder_add_buffer(s, buffer); - - while (ret != SWF_EOF) { - ret = swfdec_dec...
2019 Dec 03
7
[p2v PATCH 0/6] Use GLib a bit more
In an effort to reduce the code, start to use few bits of GLib: - replace the gnulib c-type module - replace the gnulib getprogname module - use g_spawn_sync to launch curl, and drop a file reading function Pino Toscano (6): Include glib.h in p2v.h Use g_ascii_isspace instead of c_isspace from gnulib Use g_get_prgname instead of getprogname from gnulib build: remove no more used gnulib
2008 Jan 08
0
4 commits - configure.ac test/compiler.c test/.gitignore test/Makefile.am test/swfdec_test.c test/swfdec_test_function.c test/swfdec_test_function.h test/swfdec_test_global.c test/swfdec_test_initialize.as test/swfdec_test_initialize.h
...t;Swfdec Test Script\0\1" + +int +main (int argc, char **argv) +{ + SWFAction action; + char *contents; + GError *error = NULL; + int len; + byte *data; + + if (argc != 3) { + g_print ("usage: %s INFILE OUTFILE\n\n", argv[0]); + return 1; + } + + Ming_init (); + + if (!g_file_get_contents (argv[1], &contents, NULL, &error)) { + g_printerr ("%s\n", error->message); + g_error_free (error); + error = NULL; + return 1; + } + action = newSWFAction (contents); + if (SWFAction_compile (action, 8, &len) != 0) { + g_printerr ("compilation faile...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...ress", - config->interfaces[i]) == -1) { - perror ("asprintf"); - exit (EXIT_FAILURE); - } + config->interfaces[i]) == -1) + error (EXIT_FAILURE, errno, "asprintf"); if (g_file_get_contents (mac_filename, &mac, NULL, NULL)) { size_t len = strlen (mac); diff --git a/p2v/gui.c b/p2v/gui.c index 8835793..c5fbc99 100644 --- a/p2v/gui.c +++ b/p2v/gui.c @@ -26,6 +26,7 @@ #include <unistd.h> #include <fcntl.h> #include <errno.h> +#include <error.h&g...
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
...= NULL; + guint i; + + if (argc < 2) { + g_print ("usage: %s FILE ...\n\n", argv[0]); + return 1; + } + + Ming_init (); + Ming_setSWFCompression (-1); + + g_print ("/* This file is autogenerated, do not edit! */\n\n"); + for (i = 1; i < argc; i++) { + if (!g_file_get_contents (argv[1], &contents, NULL, &error)) { + g_printerr ("%s\n", error->message); + g_error_free (error); + error = NULL; + return 1; + } + movie = newSWFMovie (); + action = newSWFAction (contents); + SWFMovie_add (movie, (SWFBlock) action); + g_f...
2020 Sep 25
20
[RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)
Hi, This is an initial implementation of a vhost-user backend for the VirtIO RPMB device. The device is currently in the draft of the next VirtIO specification and describes block device which uses combination of a key, nonce, hashing and a persistent write counter to prevent replay attacks (hence Replay Protected Memory Block). It is implemented as a vhost-user device because we want to
2008 Jan 08
0
9 commits - configure.ac test/custom test/Makefile.am test/swfdec_test_initialize.as test/swfdec_test_initialize.h test/swfdec_test_test.c test/trace
...nteraction_free (inter); - g_scanner_destroy (scanner); - return NULL; -} - -SwfdecInteraction * -swfdec_interaction_new_from_file (const char *filename, GError **error) -{ - char *contents; - gsize length; - SwfdecInteraction *ret; - - g_return_val_if_fail (filename != NULL, NULL); - - if (!g_file_get_contents (filename, &contents, &length, error)) - return NULL; - - ret = swfdec_interaction_new (contents, length, error); - g_free (contents); - return ret; -} - -/* returns time until next event in msecs or -1 if none */ -int -swfdec_interaction_get_next_event (SwfdecInteraction *inter) -{ -...
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
...Swfdec Test Script\0\1" + +int +main (int argc, char **argv) +{ + SWFAction action; + char *contents; + GError *error = NULL; + gsize len; + byte *data; + + if (argc != 3) { + g_print ("usage: %s INFILE OUTFILE\n\n", argv[0]); + return 1; + } + + Ming_init (); + + if (!g_file_get_contents (argv[1], &contents, NULL, &error)) { + g_printerr ("%s\n", error->message); + g_error_free (error); + error = NULL; + return 1; + } + action = newSWFAction (contents); + data = SWFAction_getByteCode (action, &len); + contents = g_malloc (len + sizeof (HEADE...
2019 Sep 10
3
[PATCH 0/2] Remove virt-p2v from libguestfs
Now that virt-p2v has its own repository [1] and releases [2], it is time to remove it from libguestfs. [1] https://github.com/libguestfs/virt-p2v [2] http://download.libguestfs.org/virt-p2v/ Pino Toscano (2): Remove virt-p2v Remove remaining virt-p2v bits .gitignore | 4 - Makefile.am | 7 +- bash/Makefile.am