Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
Loading...
Searching...
No Matches
native_dispatch_table.h
Go to the documentation of this file.
1/**
2 * @file
3 * @brief Declares dispatch-table request path helpers.
4 */
5
6#ifndef PHAROS_NATIVE_DISPATCH_TABLE_H
7#define PHAROS_NATIVE_DISPATCH_TABLE_H
8
9/** @name Dispatch table helpers
10 * @{
11 */
12/**
13 * @brief Tests whether a request path matches one dispatch-table route pattern.
14 * @param pattern Dispatch-table route pattern.
15 * @param path Normalized request path to test.
16 * @return Non-zero when the path matches the pattern, otherwise 0.
17 */
18int native_dispatch_route_pattern_matches(const char *pattern, const char *path);
19/**
20 * @brief Resolves the response artifact file for one request using the dispatch table.
21 * @param root Artifact root directory containing dispatch metadata.
22 * @param method HTTP method for the request.
23 * @param path Normalized request path.
24 * @return Newly allocated response file path, or NULL when no route matches.
25 */
26char *native_dispatch_response_file_for_request(const char *root, const char *method, const char *path);
27
28
29/** @} */
30#endif
char * native_dispatch_response_file_for_request(const char *root, const char *method, const char *path)
Resolves the response artifact file for one request using the dispatch table.
int native_dispatch_route_pattern_matches(const char *pattern, const char *path)
Tests whether a request path matches one dispatch-table route pattern.