Commit Graph

7 Commits

Author SHA1 Message Date
c55c2707ca
Add Meson build file 2020-10-26 22:10:12 +01:00
988420a27c
Add attributes to functions, remove inline functions
For some reasons, I cannot compile correctly this library with inline
functions using Meson and Ninja (commit adding Meson build file
incoming).

Some attributes are also added, such as an attribute for all functions
receiving pointers as arguments telling these arguments cannot be null.
2020-10-26 21:35:37 +01:00
fbed1b21d6
Better error handling, inline functions, new PERR
Functions that end up calling a `malloc' or `realloc' return the new
struct `Result' which indicates if the memory allocation or reallocation
worked or not. If not, it holds a message, otherwise it holds the value
the function is meant to return (can be a null pointer if the function
returned a `void' before). The library will no longer forcibly exit the
program on such error in case it can be recovered by the code calling
it.

The modifications described above lead to vector-creating functions
returning a pointer to the newly created vector, and the function for
deleting vectors also frees the vector.

This commit also inlines some functions to make the compiled code a bit
lighter and calls to these functions possibly a bit faster.

`PDEB' is redefined following the new `PCOMMON' macro that is also used
by `PERR' for desplaying debug error messages.

Some lines are also modified to avoid potential memory leaks in case of
a memory (re)allocation.
2020-10-26 20:48:00 +01:00
193bf1d75f
Const all the things! 2020-10-08 11:11:28 +02:00
ff59b301cc
Remove unused defines, done TODO 2020-10-07 18:58:46 +02:00
8e29343f3e
Huge refactor, documentation incoming 2020-10-07 17:14:23 +02:00
1e86a8736f
Initial commit
The code has not yet been tested, the only “test” is the static code
analysis from within Emacs with LSP with clangd as its backend
2020-10-03 16:07:26 +02:00