machinatrix
A very silly Matrix bot written in C
Loading...
Searching...
No Matches
config.h File Reference

Configuration structure used by all programs and associated functions. More...

#include <stdbool.h>
#include <stddef.h>
Include dependency graph for config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mtrix_config
 Configuration structure used by all programs. More...
 

Macros

#define MAX_SERVER   ((size_t)231U)
 Maximum length for the server URL (including null terminator).
 
#define MAX_USER   ((size_t)256U)
 Maximum length for the user name (including null terminator).
 
#define MAX_TOKEN   ((size_t)512U)
 Maximum length for the access token (including null terminator).
 
#define MAX_BATCH   ((size_t)512U)
 Maximum size for the batch identifier (including null terminator).
 

Enumerations

enum  mtrix_config_flag { MTRIX_CONFIG_HELP = 1 << 0 , MTRIX_CONFIG_VERBOSE = 1 << 1 , MTRIX_CONFIG_DRY = 1 << 2 }
 Configuration flags for mtrix_config. More...
 

Functions

static bool mtrix_config_verbose (const struct mtrix_config *c)
 
static bool mtrix_config_dry (const struct mtrix_config *c)
 

Detailed Description

Configuration structure used by all programs and associated functions.

Macro Definition Documentation

◆ MAX_BATCH

#define MAX_BATCH   ((size_t)512U)

Maximum size for the batch identifier (including null terminator).

Arbitrarily set, synapse currently generates ~50-byte identifiers.

◆ MAX_SERVER

#define MAX_SERVER   ((size_t)231U)

Maximum length for the server URL (including null terminator).

https://matrix.org/docs/spec/appendices#server-name

◆ MAX_TOKEN

#define MAX_TOKEN   ((size_t)512U)

Maximum length for the access token (including null terminator).

Arbitrarily set, synapse currently generates ~300-byte tokens.

◆ MAX_USER

#define MAX_USER   ((size_t)256U)

Maximum length for the user name (including null terminator).

https://matrix.org/docs/spec/appendices#user-identifiers

Enumeration Type Documentation

◆ mtrix_config_flag

Configuration flags for mtrix_config.

Enumerator
MTRIX_CONFIG_HELP 

Whether the help command was requested.

MTRIX_CONFIG_VERBOSE 

Whether verbose logging was requested.

MTRIX_CONFIG_DRY 

Whether dry-run mode was requested.