https://github.com/mbaraa/ctemplate
A revived fork of the one and only ctemplate with extra functionalities.
https://github.com/mbaraa/ctemplate
c html template
Last synced: 11 months ago
JSON representation
A revived fork of the one and only ctemplate with extra functionalities.
- Host: GitHub
- URL: https://github.com/mbaraa/ctemplate
- Owner: mbaraa
- License: gpl-3.0
- Created: 2024-10-27T05:40:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T20:29:18.000Z (over 1 year ago)
- Last Synced: 2025-02-09T04:17:02.679Z (over 1 year ago)
- Topics: c, html, template
- Language: C
- Homepage: https://ctemplate.mbaraa.xyz/
- Size: 98.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ctemplate
A revived fork of the one and only [ctemplate](https://libctemplate.sourceforge.net) with extra functionalities.
# Installation:
```bash
git clone https://github.com/mbaraa/ctemplate
cd ctemplate
make
sudo make install
```
# Usage:
1. Include the header
```c
#include
```
2. Go nuts.
# Available functions:
- Old
- `TMPL_write()` expands and outputs a template.
- `TMPL_add_var()` adds simple variables to a variable list.
- `TMPL_add_varlist()` adds a variable list to a loop variable.
- `TMPL_add_loop()` adds a loop variable to a variable list.
- `TMPL_add_fmt()` adds a function to a format function list.
- `TMPL_free_varlist()` frees memory used by a variable list.
- `TMPL_free_fmtlist()` frees memory used by a format function list.
- New
- `TMPL_make_var_list()` returns a TMPL_varlist from the given char\* arguments.
- `TMPL_write_to_buffer()` same as `TMPL_write` but using a bytes buffer instead of a file.