From 78a52d970553803a00cbda13a1b417abb04f3757 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Sun, 15 Oct 2006 08:58:57 +0000 Subject: * src/hgs.c (main): add --sync option. --- ChangeLog | 2 ++ hieroglyph/version.h.in | 2 +- src/hgs.c | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ef8c80d..f3c3aef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-10-15 Akira TAGOH + * src/hgs.c (main): add --sync option. + * hieroglyph/hgfile.c (hg_file_io_synchronous): new function. (hg_file_object_write): call fsync after writing according to the current state of I/O synchronous. diff --git a/hieroglyph/version.h.in b/hieroglyph/version.h.in index 523a81b..2e456af 100644 --- a/hieroglyph/version.h.in +++ b/hieroglyph/version.h.in @@ -29,7 +29,7 @@ G_BEGIN_DECLS #define HIEROGLYPH_VERSION "@VERSION@" -#define HIEROGLYPH_UUID "377e7dd8-f13c-4bf9-9d0f-cbb07441ef3e" +#define HIEROGLYPH_UUID "45a86d12-925d-4972-a1c4-0818e0587d9b" const char *__hg_rcsid G_GNUC_UNUSED = "$Rev$"; diff --git a/src/hgs.c b/src/hgs.c index ce6f9c6..0031cb8 100644 --- a/src/hgs.c +++ b/src/hgs.c @@ -23,6 +23,7 @@ */ #include #include +#include #include #include #include @@ -76,6 +77,7 @@ main(int argc, char **argv) { gchar *device_name = NULL; + gboolean opt_io_sync = FALSE; HgVM *vm; HgDevice *device = NULL; GOptionContext *ctxt = g_option_context_new(""); @@ -83,6 +85,7 @@ main(int argc, GOptionEntry entries[] = { {"define", 'd', 0, G_OPTION_ARG_CALLBACK, _hgs_arg_define_cb, "Define a variable in systemdict.", "SYMBOL"}, {"load-plugin", 'l', 0, G_OPTION_ARG_CALLBACK, _hgs_arg_load_plugin_cb, "Load a plugin", "NAME"}, + {"sync", 0, 0, G_OPTION_ARG_NONE, &opt_io_sync, "Make I/O calls synchronous", NULL}, {"device", 0, 0, G_OPTION_ARG_STRING, &device_name, "Output device that the rendering goes to", "DEVICE"}, {NULL} }; @@ -104,6 +107,8 @@ main(int argc, return 1; } + if (opt_io_sync) + hg_file_io_synchronous(TRUE); if (device_name) { device = hg_device_new(device_name); if (device == NULL) { -- cgit v1.2.3