webc v0.0.11
Write and deploy websites using the C Programming Language.
|
Go to the source code of this file.
Data Structures | |
struct | WebcAction |
struct | Route |
struct | Tree |
Functions | |
WEBCAPI Route * | WEBC_MakeRoute (Cstr path, char *buffer) |
WEBCAPI Tree | WEBC_MakeTree (Cstr root, Route *first,...) |
WEBCAPI Tree | WEBC_AllocTree (Cstr root, size_t capacity) |
WEBCAPI void | WEBC_AddRoute (Tree *tree, Route *route) |
WEBCAPI void | WEBC_CleanRoute (Route *route) |
WEBCAPI void | WEBC_CleanTree (Tree tree) |
WEBCAPI WebcAction | WEBC_ParseCliArgs (int argc, char **argv) |
WEBCAPI void | WEBC_HandleAction (WebcAction action, Tree tree) |
WEBCAPI void | WEBC_Export (char *buffer, Cstr path) |
WEBCAPI void | WEBC_ExportRoute (Route route) |
WEBCAPI void | WEBC_ExportTree (Tree tree) |
MIT License
Copyright (c) 2024 Konstantinos Despoinidis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WEBCAPI Tree WEBC_AllocTree | ( | Cstr | root, |
size_t | capacity ) |
WEBCAPI void WEBC_CleanRoute | ( | Route * | route | ) |
Frees the memory allocated by a Route
route | The Route* to free |
WEBCAPI void WEBC_CleanTree | ( | Tree | tree | ) |
Frees the memory allocated by a Tree
tree | The virtual tree contating the Routes |
WEBCAPI void WEBC_Export | ( | char * | buffer, |
Cstr | path ) |
Exports the contents of the buffer to an html file, while also creating the path that is being passed. Finally the buffer is freed
buffer | The contents of the buffer |
path | The path to export the html file to |
WEBCAPI void WEBC_ExportRoute | ( | Route | route | ) |
WEBCAPI void WEBC_ExportTree | ( | Tree | tree | ) |
Exports every Route in the tree
tree | The virtual tree created by the user |
WEBCAPI void WEBC_HandleAction | ( | WebcAction | action, |
Tree | tree ) |
Depending on the action the method exports / serves the tree (physical or virtual)
action | the WebcAction returned from the ParseCliArgs method |
tree | The virtual tree created by the user |
WEBCAPI Route * WEBC_MakeRoute | ( | Cstr | path, |
char * | buffer ) |
Creates a Route struct pointer
path | The path of the route (physical or virtual) |
buffer | The html to serve or export |
WEBCAPI WebcAction WEBC_ParseCliArgs | ( | int | argc, |
char ** | argv ) |