summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2006-10-15 08:58:57 +0000
committerAkira TAGOH <akira@tagoh.org>2006-10-15 08:58:57 +0000
commit78a52d970553803a00cbda13a1b417abb04f3757 (patch)
tree516022585135f22f80c072dfedbcf29e93175930
parent5985b791d04f2ae7e699f719d29c7594540bb2dd (diff)
* src/hgs.c (main): add --sync option.
-rw-r--r--ChangeLog2
-rw-r--r--hieroglyph/version.h.in2
-rw-r--r--src/hgs.c5
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ef8c80d..f3c3aef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2006-10-15 Akira TAGOH <at@gclab.org>
+ * 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 <hieroglyph/hgdevice.h>
#include <hieroglyph/hgdict.h>
+#include <hieroglyph/hgfile.h>
#include <hieroglyph/hgmem.h>
#include <hieroglyph/hgvaluenode.h>
#include <hieroglyph/vm.h>
@@ -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("<PostScript file>");
@@ -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) {