got rid of avltree-stuff

FossilOrigin-Name: 41573b74d0d433b2e62feb78e580cbb351fee08b441e6735237cd3201a49a4e4
This commit is contained in:
tobias.herre@wikimedia.de
2018-03-06 17:28:31 +00:00
parent e50b8b29b0
commit cad0c6ab18
27 changed files with 60 additions and 147 deletions

View File

@ -32,24 +32,26 @@
* The memory allocated returned in data must be freed using free.
*
* Eexample:
* \code
* \code{.c}
#include "capwap/file.h"
size_t bytes;
char * data = cw_load_file("file.txt",&bytes);
if (data){
// Do something with data ...
@startcomment Do something with data ... @endcomment
free (data);
}
\endcode
*/
char *cw_load_file(const char *filename, size_t * size)
{
FILE *infile = fopen(filename, "rb");
char *buf;
FILE *infile;
infile = fopen(filename, "rb");
if (!infile)
return NULL;
fseek(infile, 0, SEEK_END);
*size = ftell(infile);
char *buf = malloc(*size);
buf = malloc(*size);
if (!buf)
goto errX;