-/* Open the file for reading */
-#define GNUNET_DISK_OPEN_READ 1
-/* Open the file for writing */
-#define GNUNET_DISK_OPEN_WRITE 2
-/* Open the file for both reading and writing */
-#define GNUNET_DISK_OPEN_READWRITE 3
-/* Fail if file already exists */
-#define GNUNET_DISK_OPEN_FAILIFEXISTS 4
-/* Truncate file if it exists */
-#define GNUNET_DISK_OPEN_TRUNCATE 8
-/* Create file if it doesn't exist */
-#define GNUNET_DISK_OPEN_CREATE 16
-/* Append to the file */
-#define GNUNET_DISK_OPEN_APPEND 32
-
-#define GNUNET_DISK_MAP_READ 1
-#define GNUNET_DISK_MAP_WRITE 2
-#define GNUNET_DISK_MAP_READWRITE 3
-
-#define GNUNET_DISK_PERM_USER_READ 1
-#define GNUNET_DISK_PERM_USER_WRITE 2
-#define GNUNET_DISK_PERM_USER_EXEC 4
-#define GNUNET_DISK_PERM_GROUP_READ 8
-#define GNUNET_DISK_PERM_GROUP_WRITE 16
-#define GNUNET_DISK_PERM_GROUP_EXEC 32
-#define GNUNET_DISK_PERM_OTHER_READ 64
-#define GNUNET_DISK_PERM_OTHER_WRITE 128
-#define GNUNET_DISK_PERM_OTHER_EXEC 256
+/**
+ * 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
+ };
+