config.h¶
The config.h module represents runtime configuration options as outlined in
Configuration. Refer to that document for more details on what each option
means.
Build Options¶
-
MN_CMDLINE_MAX_FLAGS¶
Defaults to
16. The maximum number of flags that can be parsed.
-
MN_CMDLINE_MAX_ARITY¶
Defaults to
8. The maximum number of values any one flag can have.
-
MN_REQUEST_MAX_PATH_LEN¶
Defaults to
2048. The maximum supported length of any incoming URI including a trailingNULterminator. Requests with longer URIs automatically receive an HTTP 414 URI Too Long response.
-
MN_REQUEST_MAX_CAPTURES¶
Defaults to
16. The maximum number of captures permitted in any route. Clients using a route with more captures than this value permits will automatically receive an HTTP 501 Not Implemented response.
-
MN_REQUEST_MAX_QUERY_PARAMS¶
Defaults to
24. The maximum number of query parameters permitted in any route. Clients specifying more query parameters than this value permits will automatically receive an HTTP 501 Not Implemented response.
API¶
-
typedef struct lua_State mn_lua_t¶
An alias to the
lua_Stateobject provided by Lua.
-
enum mn_event_loop¶
The event loop to use. Currently the only supported value is
MN_EVENT_LOOP_POLL.-
unsigned int MN_EVENT_LOOP_POLL = 0¶
-
unsigned int MN_EVENT_LOOP_POLL = 0¶
-
struct mn_config¶
Configuration options supplied to the
mn_serveron initialization.-
unsigned long long coro_pages¶
A reference to the COROUTINE_PAGES option.
-
enum mn_log_level log_level¶
A reference to the LOG_LEVEL option.
-
unsigned long long coro_pages¶
- struct mn_status mn_config_load(
- struct mn_config out[static const 1]
Loads the default configuration.
If successful, the out parameter must be cleaned up using
mn_config_unload().- Parameters:
out – The
mn_configreference to load.
- Returns:
- Aborts:
If space for
MN_REQUEST_MAX_CAPTUREScould not be allocated.
- struct mn_status mn_config_load_file( )¶
Loads the default configuration and then applies any overridden configuration options as defined in the file at
path.If successful, the out parameter must be cleaned up using
mn_config_unload().- Parameters:
path – The location of a lua file to execute.
out – The
mn_configreference to load.
- Returns:
- Aborts:
If space for
MN_REQUEST_MAX_CAPTUREScould not be allocated.
- struct mn_status mn_config_load_chunk(
- char const chunk[static const 1],
- struct mn_config out[static const 1]
Loads the default configuration and then applies any overridden configuration options as defined in
chunk.If successful, the out parameter must be cleaned up using
mn_config_unload().- Parameters:
path – A lua chunk to execute.
out – The
mn_configreference to load.
- Returns:
- Aborts:
If space for
MN_REQUEST_MAX_CAPTUREScould not be allocated.
-
void mn_config_unload(struct mn_config c[static const 1])¶
Unloads a configuration object.
Should be called once you are finished using a
mn_configobject that was successfully loaded by a call tomn_config_load(),mn_config_load_file()ormn_config_load_chunk().- Parameters:
c – The configuration to unload.