Function prototype

Use an enum type instead of a string to define the file opening mode.
This commit is contained in:
2024-09-19 22:40:20 +02:00
parent b30f2f2362
commit bd64536e89
4 changed files with 22 additions and 24 deletions

View File

@@ -19,9 +19,7 @@
#ifndef MBOX_H
# define MBOX_H 1
# include <config.h>
# include "message.h"
typedef struct
@@ -31,8 +29,14 @@ typedef struct
char *postmark_cache;
} mbox_t;
typedef enum
{
r,
w,
} mbox_mode_t;
mbox_t *mbox_open (const char *path, const char *mode);
mbox_t *mbox_open (const char *path, const mbox_mode_t mbox_mode);
void tmpmbox_create (const char *path);
void tmpfile_name (const char *path);
void tmpfile_mod_own (const int fd, const char *path);
@@ -40,6 +44,6 @@ int tmpfile_create (void);
void mbox_close (mbox_t * mbp);
message_t *mbox_read_message (mbox_t * mp);
void mbox_write_message (message_t * m, mbox_t * mbox);
void mbox_lock (int fd, const char *path, const char *mode);
void mbox_lock (int fd, const char *path, const mbox_mode_t mbox_mode);
#endif /* MBOX_H */