Commit f95d349c authored by Robert Izzard's avatar Robert Izzard
Browse files

update to V1.29

improved API unit tests and fixed many small related issues

changes to improve memory freeing

removed deprecated functions

changed error_handler function type from void to int
parent 5c13a5f0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14,3 +14,5 @@

29/04/2022 : V1.27 Rebranded as libcdict, added some build options,
             released under the GPL.

26/07/2022 : V1.29 Many (mostly small) bug fixes, improved much code, new set of unit tests for the API functions (macro and non-macro calls).
+9 −0
Original line number Diff line number Diff line
@@ -74,5 +74,14 @@ ninja install

~~~

To build a version suitable for use with valgrind (this disables some gcc features that are incompatible with the current latest valgrind).

~~~bash

meson --prefix=$HOME --libdir=lib --buildtype=debug -Dvalgrind=TRUE builddir
cd builddir
ninja install

~~~

Further meson instructions can be found at https://mesonbuild.com/
 No newline at end of file
+17 −3
Original line number Diff line number Diff line
@@ -527,10 +527,22 @@ If you wish to compress the output so it uses less memory, use this call to `CDi

```

10. Delete a single cdict entry with
10. Delete a cdict entry and its value's contents, if appropriate (e.g. if they are a pointer) with the following.

```c
    CDict_del(cdict,key);
    CDict_del_and_contents(cdict,entry,TRUE);
```

Delete a cdict entry but do not delete its contents with this.

```c
    CDict_del_and_contents(cdict,entry,TRUE);
```

Delete a reference to a cdict entry with a call like this, but beware this does *not* delete the entry contents so will, unless you free the entry manually, lead to memory leaks. 

```c
    CDict_del(cdict,entry);
```

11. Append to a cdict entry, with given key, by value, with the following code. As with `CDict_set()` the key and value types are guessed automatically.
@@ -762,8 +774,10 @@ In case of an error, you can set a function pointer as an error handler and set

The error handler function will be sent the data pointer, error number and a format statement and subsequent arguments so you can recreate the error string that *libcdict* uses by default.

If the error handler function returns non-zero, *libcdict* exits on error. if the error handler returns 0, *libcdict* does not exit on error.

```c
    void cdict_error_handler_function(void * p,
    int cdict_error_handler_function(void * p,
                                     const int error_number,
                                     char * format,
                                     va_list args)
+10 −0
Original line number Diff line number Diff line
@@ -213,6 +213,16 @@ if get_option('buildtype').startswith('debug')
endif


###########################
# valgrind (header files) #
#
if compiler.has_header('valgrind/valgrind.h',
                       args: cflags,
                       include_directories: include_directories(incdirs))
    cflags += '-D__HAVE_VALGRIND__'
endif


if get_option('valgrind') == true
    # Some new instruction sets are not compatible with
    # Valgrind. Disable these.
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#include "cdict_prototypes.h"
#include "cdict_API.h"

#define CDICT_VERSION "1.28"
#define CDICT_VERSION "1.29"

/*
 * Global variables - very bad, I know, but these
Loading