Updated Developer documentation (markdown)

This commit is contained in:
Bendegúz Gyönki 2020-11-29 17:15:49 +01:00
parent 34d283a498
commit 363d39b56e

View File

@ -28,6 +28,19 @@ Each error type must have a status code that is unique in the whole program. The
- First 4 bits: identifies a certain module of the previewer - First 4 bits: identifies a certain module of the previewer
- Last 4 bits: identifies the exact problem - Last 4 bits: identifies the exact problem
## Memory allocation
The module provides its own memory allocation library called **MagicMemory**. The library can be used to create MagicMemory contexts. All memory allocation calls must be performed through this library. If a function allocates memory, it has to take a MagicMemory context (that has the type `mm_ctx`) as its first parameter and perform the memory allocation inside that context. Before the program exits, all of the contexts must be freed up.
## Data validation
There are two different kinds of functions that perform data validation:
- **Validator**: A validator only validates data according to its format specification.
- **Parser**: A parser validates data and then extracts some fields from the data.
It is not unusual for a parser function to call a validator function to validate its whole input before extracting the fields.
# CAFF previewer wrapper # CAFF previewer wrapper
This module makes communication between the previewer and the web client possible. This module makes communication between the previewer and the web client possible.