~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fwd.[ch]: Expose the program status flags globally.
[fwd]
/
fwd.h
diff --git
a/fwd.h
b/fwd.h
index
5868fda
..
f10af74
100644
(file)
--- a/
fwd.h
+++ b/
fwd.h
@@
-87,6
+87,7
@@
#include <mLib/fdflags.h>
#include <mLib/fdpass.h>
#include <mLib/ident.h>
#include <mLib/fdflags.h>
#include <mLib/fdpass.h>
#include <mLib/ident.h>
+#include <mLib/macros.h>
#include <mLib/mdup.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/mdup.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
@@
-265,14
+266,26
@@
extern sel_state *sel;
extern sel_state *sel;
+/* --- Global state flags --- */
+
+extern unsigned flags;
+
+#define FW_SYSLOG 1u
+#define FW_QUIET 2u
+#define FW_SET 4u
+
/* --- Help text --- */
extern const char grammar_text[];
extern const char option_text[];
/* --- Help text --- */
extern const char grammar_text[];
extern const char option_text[];
+/* --- Generally useful magic constants --- */
+
+#define NOW ((time_t)-1)
+
/* --- @fw_log@ --- *
*
/* --- @fw_log@ --- *
*
- * Arguments: @time_t t@ = when the connection occurred or (@
-1
@)
+ * Arguments: @time_t t@ = when the connection occurred or (@
NOW
@)
* @const char *fmt@ = format string to fill in
* @...@ = other arguments
*
* @const char *fmt@ = format string to fill in
* @...@ = other arguments
*
@@
-281,7
+294,8
@@
extern const char option_text[];
* Use: Logs a connection.
*/
* Use: Logs a connection.
*/
-extern void fw_log(time_t /*t*/, const char */*fmt*/, ...);
+extern void PRINTF_LIKE(2, 3)
+ fw_log(time_t /*t*/, const char */*fmt*/, ...);
/* --- @fw_inc@, @fw_dec@ --- *
*
/* --- @fw_inc@, @fw_dec@ --- *
*
@@
-529,7
+543,8
@@
extern int token(scanner */*sc*/);
* Use: Reports an error at the current scanner location.
*/
* Use: Reports an error at the current scanner location.
*/
-extern void error(scanner */*sc*/, const char */*msg*/, ...);
+extern void PRINTF_LIKE(2, 3) NORETURN
+ error(scanner */*sc*/, const char */*msg*/, ...);
/* --- @pushback@ --- *
*
/* --- @pushback@ --- *
*