+/**
+ * Specifies how a file should be opened.
+ */
+enum GNUNET_DISK_OpenFlags
+ {
+
+ /**
+ * Open the file for reading
+ */
+ GNUNET_DISK_OPEN_READ = 1,
+
+ /**
+ * Open the file for writing
+ */
+ GNUNET_DISK_OPEN_WRITE = 2,
+
+ /**
+ * Open the file for both reading and writing
+ */
+ GNUNET_DISK_OPEN_READWRITE = 3,
+
+ /**
+ * Fail if file already exists
+ */
+ GNUNET_DISK_OPEN_FAILIFEXISTS = 4,
+
+ /**
+ * Truncate file if it exists
+ */
+ GNUNET_DISK_OPEN_TRUNCATE = 8,
+
+ /**
+ * Create file if it doesn't exist
+ */
+ GNUNET_DISK_OPEN_CREATE = 16,
+
+ /**
+ * Append to the file
+ */
+ GNUNET_DISK_OPEN_APPEND = 32
+ };
+
+/**
+ * Specifies what type of memory map is desired.
+ */
+enum GNUNET_DISK_MapType
+ {
+ /**
+ * Read-only memory map.
+ */
+ GNUNET_DISK_MAP_TYPE_READ = 1,
+
+ /**
+ * Write-able memory map.
+ */
+ GNUNET_DISK_MAP_TYPE_WRITE = 2,
+ /**
+ * Read-write memory map.
+ */
+ GNUNET_DISK_MAP_TYPE_READWRITE = 3
+ };
+
+
+/**
+ * File access permissions, UNIX-style.
+ */
+enum GNUNET_DISK_AccessPermissions
+ {
+ /**
+ * Nobody is allowed to do anything to the file.
+ */
+ GNUNET_DISK_PERM_NONE = 0,
+
+ /**
+ * Owner can read.
+ */
+ GNUNET_DISK_PERM_USER_READ = 1,
+
+ /**
+ * Owner can write.
+ */
+ GNUNET_DISK_PERM_USER_WRITE = 2,
+
+ /**
+ * Owner can execute.
+ */
+ GNUNET_DISK_PERM_USER_EXEC = 4,
+
+ /**
+ * Group can read.
+ */
+ GNUNET_DISK_PERM_GROUP_READ = 8,
+
+ /**
+ * Group can write.
+ */
+ GNUNET_DISK_PERM_GROUP_WRITE = 16,
+
+ /**
+ * Group can execute.
+ */
+ GNUNET_DISK_PERM_GROUP_EXEC = 32,
+
+ /**
+ * Everybody can read.
+ */
+ GNUNET_DISK_PERM_OTHER_READ = 64,
+
+ /**
+ * Everybody can write.
+ */
+ GNUNET_DISK_PERM_OTHER_WRITE = 128,
+
+ /**
+ * Everybody can execute.
+ */
+ GNUNET_DISK_PERM_OTHER_EXEC = 256
+ };
+
+
+/**
+ * Constants for specifying how to seek.
+ */
+enum GNUNET_DISK_Seek
+ {
+ /**
+ * Seek an absolute position (from the start of the file).
+ */
+ GNUNET_DISK_SEEK_SET,
+
+ /**
+ * Seek a relative position (from the current offset).
+ */
+ GNUNET_DISK_SEEK_CUR,
+
+ /**
+ * Seek an absolute position from the end of the file.
+ */
+ GNUNET_DISK_SEEK_END
+ };
+
+
+/**
+ * Enumeration identifying the two ends of a pipe.
+ */
+enum GNUNET_DISK_PipeEnd
+ {
+ /**
+ * The reading-end of a pipe.
+ */
+ GNUNET_DISK_PIPE_END_READ = 0,
+
+ /**
+ * The writing-end of a pipe.
+ */
+ GNUNET_DISK_PIPE_END_WRITE = 1
+ };
+