summaryrefslogtreecommitdiff
path: root/open.h
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2001-02-02 17:54:47 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2001-02-02 17:54:47 +0000
commit28486b8367175dfccf85664891067125c8db5569 (patch)
tree49427514e4ef4362a1e5af05ab41b48d775a4497 /open.h
downloadlibowfat-28486b8367175dfccf85664891067125c8db5569.tar.gz
libowfat-28486b8367175dfccf85664891067125c8db5569.zip
Initial revision
Diffstat (limited to 'open.h')
-rw-r--r--open.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/open.h b/open.h
new file mode 100644
index 0000000..6bd1358
--- /dev/null
+++ b/open.h
@@ -0,0 +1,29 @@
+#ifndef OPEN_H
+#define OPEN_H
+
+#include <sys/cdefs.h>
+
+/* open filename for reading and return the file handle or -1 on error */
+extern int open_read(const char *filename) __THROW;
+
+/* create filename for exclusive write only use (mode 0600) and return
+ * the file handle or -1 on error */
+extern int open_excl(const char *filename) __THROW;
+
+/* open filename for appending write only use (mode 0600)
+ * and return the file handle or -1 on error.
+ * All write operation will append after the last byte, regardless of
+ * seeking or other processes also appending to the file. The file will
+ * be created if it does not exist. */
+extern int open_append(const char *filename) __THROW;
+
+/* open filename for writing (mode 0644). Create the file if it does
+ * not exist, truncate it to zero length otherwise. Return the file
+ * handle or -1 on error. */
+extern int open_trunc(const char *filename) __THROW;
+
+/* open filename for writing. Create the file if it does not exist.
+ * Return the file handle or -1 on error. */
+extern int open_write(const char *filename) __THROW;
+
+#endif