machinatrix
A very silly Matrix bot written in C
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
5#include <stdbool.h>
6#include <stddef.h>
7
12#define MAX_SERVER ((size_t)231U)
13
19#define MAX_USER ((size_t)256U)
20
25#define MAX_TOKEN ((size_t)512U)
26
31#define MAX_BATCH ((size_t)512U)
32
42
61
62static inline bool mtrix_config_verbose(const struct mtrix_config *c) {
63 return c->flags & MTRIX_CONFIG_VERBOSE;
64}
65
66static inline bool mtrix_config_dry(const struct mtrix_config *c) {
67 return c->flags & MTRIX_CONFIG_DRY;
68}
mtrix_config_flag
Configuration flags for mtrix_config.
Definition config.h:34
@ MTRIX_CONFIG_VERBOSE
Whether verbose logging was requested.
Definition config.h:38
@ MTRIX_CONFIG_DRY
Whether dry-run mode was requested.
Definition config.h:40
@ MTRIX_CONFIG_HELP
Whether the help command was requested.
Definition config.h:36
#define MAX_TOKEN
Maximum length for the access token (including null terminator).
Definition config.h:25
#define MAX_USER
Maximum length for the user name (including null terminator).
Definition config.h:19
#define MAX_BATCH
Maximum size for the batch identifier (including null terminator).
Definition config.h:31
#define MAX_SERVER
Maximum length for the server URL (including null terminator).
Definition config.h:12
Configuration structure used by all programs.
Definition config.h:47
char user[MAX_USER]
User name used to send messages, in the form @username:server.
Definition config.h:55
char server[MAX_SERVER]
Matrix server URL.
Definition config.h:51
char short_user[MAX_USER]
Short version of the user name, stripped of the @ sign and server.
Definition config.h:57
uint8_t flags
Configuration flags.
Definition config.h:49
char batch[MAX_BATCH]
Last batch received from the Matrix server.
Definition config.h:59
char token[MAX_TOKEN]
Matrix access token.
Definition config.h:53