diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-10-04 13:20:39 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-10-04 13:20:39 +0200 |
commit | 85b030a13a3c802c2d8e9d064e7c8665c2a0c54a (patch) | |
tree | d79e021b78f2370c66e5f729bf073a9ad6da925a /FICS | |
parent | 846d9b7da075604306e08936a1a625880eab03c0 (diff) |
Added more open flags
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/ficsmain.c | 8 | ||||
-rw-r--r-- | FICS/ficsmain.h | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/FICS/ficsmain.c b/FICS/ficsmain.c index 664874f..7c477cb 100644 --- a/FICS/ficsmain.c +++ b/FICS/ficsmain.c @@ -59,9 +59,11 @@ #include <bsd/string.h> #endif -PUBLIC const int g_open_flags[2] = { - (O_WRONLY|O_CREAT|O_APPEND), - (O_WRONLY|O_CREAT|O_TRUNC), +PUBLIC const int g_open_flags[4] = { + [OPFL_APPEND] = (O_WRONLY|O_CREAT|O_APPEND), + [OPFL_WRITE] = (O_WRONLY|O_CREAT|O_TRUNC), + [OPFL_APLUS] = (O_RDWR|O_CREAT|O_APPEND), + [OPFL_WPLUS] = (O_RDWR|O_CREAT|O_TRUNC), }; PUBLIC const mode_t g_open_modes = (S_IWUSR | S_IRUSR); diff --git a/FICS/ficsmain.h b/FICS/ficsmain.h index 08ea466..071ce2f 100644 --- a/FICS/ficsmain.h +++ b/FICS/ficsmain.h @@ -65,8 +65,15 @@ #define STATS_GAMES "games" #define STATS_JOURNAL "journal" +enum { + OPFL_APPEND, + OPFL_WRITE, + OPFL_APLUS, + OPFL_WPLUS +}; + __FICS_BEGIN_DECLS -extern const int g_open_flags[2]; +extern const int g_open_flags[4]; extern const mode_t g_open_modes; /* Arguments */ |