git » libjio » commit 0ad0d99

[API BREAK] Make jopen() jflags unsigned

author Alberto Bertogli
2009-07-10 20:31:15 UTC
committer Alberto Bertogli
2009-07-11 03:34:13 UTC
parent 8b4e3ed1d6fc1dc2ac0617e8d55e263870557d68

[API BREAK] Make jopen() jflags unsigned

It's more correct and tidy to make them unsigned, so better make this
minor change now while we still can. Note that flags is still signed to
match open().

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

UPGRADING +1 -0
bindings/python/libjio.c +4 -2
libjio/libjio.3 +1 -1
libjio/libjio.h +1 -1
libjio/trans.c +1 -1

diff --git a/UPGRADING b/UPGRADING
index e4ea26d..18d69a9 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -11,6 +11,7 @@ take much effort. When it's mandatory, it will be noted.
     you jfsck all your files before upgrading. Hopefully this will be the last
     backwards-incompatible format change before 1.0.
   - jtrans_new() now takes an additional flags parameter.
+  - jopen() jflags parameter is now unsigned.
 
 -> 0.50 (Big API change)
   - Structures are now opaque types:
diff --git a/bindings/python/libjio.c b/bindings/python/libjio.c
index ffb2014..45a9c0b 100644
--- a/bindings/python/libjio.c
+++ b/bindings/python/libjio.c
@@ -601,14 +601,16 @@ It's a wrapper to jopen().\n");
 static PyObject *jf_open(PyObject *self, PyObject *args)
 {
 	char *file;
-	int flags, mode, jflags;
+	int flags = O_RDONLY;
+	int mode = 0600;
+	unsigned int jflags = 0;
 	jfile_object *fp;
 
 	flags = O_RDWR;
 	mode = 0600;
 	jflags = 0;
 
-	if (!PyArg_ParseTuple(args, "s|iii:open", &file, &flags, &mode,
+	if (!PyArg_ParseTuple(args, "s|iiI:open", &file, &flags, &mode,
 				&jflags))
 		return NULL;
 
diff --git a/libjio/libjio.3 b/libjio/libjio.3
index 3fc369d..b996839 100644
--- a/libjio/libjio.3
+++ b/libjio/libjio.3
@@ -6,7 +6,7 @@ libjio - A library for Journaled I/O
 .B #include <libjio.h>
 
 .BI "jfs_t *jopen(const char *" name ", int " flags ", int " mode ",
-.BI "           int " jflags ");"
+.BI "           unsigned int " jflags ");"
 .BI "ssize_t jread(jfs_t *" fs ", void *" buf ", size_t " count ");"
 .BI "ssize_t jpread(jfs_t *" fs ", void *" buf ", size_t " count ","
 .BI "		off_t " offset ");"
diff --git a/libjio/libjio.h b/libjio/libjio.h
index 9fba9ba..36cb299 100644
--- a/libjio/libjio.h
+++ b/libjio/libjio.h
@@ -111,7 +111,7 @@ enum jfsck_return {
  * @see jclose(), open()
  * @ingroup basic
  */
-jfs_t *jopen(const char *name, int flags, int mode, int jflags);
+jfs_t *jopen(const char *name, int flags, int mode, unsigned int jflags);
 
 /** Close a file opened with jopen().
  *
diff --git a/libjio/trans.c b/libjio/trans.c
index c42bc9f..33ac37d 100644
--- a/libjio/trans.c
+++ b/libjio/trans.c
@@ -393,7 +393,7 @@ exit:
  */
 
 /* Open a file */
-struct jfs *jopen(const char *name, int flags, int mode, int jflags)
+struct jfs *jopen(const char *name, int flags, int mode, unsigned int jflags)
 {
 	int jfd, rv;
 	unsigned int t;