Comments stuff.
FossilOrigin-Name: 7d81fc88819b4286912472223025e9afaccba0cd70b038aacecbfbb5806a366f
This commit is contained in:
parent
d3119dfef5
commit
c69570713e
@ -2,6 +2,26 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a file from disk to memory
|
||||||
|
* @param filename name of file to load
|
||||||
|
* @param size variable which receives the size of the file in bytes
|
||||||
|
* @return a pointer to the memory where the file was loaded in \n
|
||||||
|
* The memory must be freed using free.
|
||||||
|
*
|
||||||
|
* Eexample:
|
||||||
|
* \code
|
||||||
|
#include "capwap/file.h"
|
||||||
|
size_t bytes;
|
||||||
|
char * data = cw_load_file("file.txt",&bytes);
|
||||||
|
if (data)
|
||||||
|
free (data);
|
||||||
|
\endcode
|
||||||
|
*/
|
||||||
char *cw_load_file(const char *filename,size_t *size)
|
char *cw_load_file(const char *filename,size_t *size)
|
||||||
{
|
{
|
||||||
FILE * infile = fopen(filename,"rb");
|
FILE * infile = fopen(filename,"rb");
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
#ifndef __CW_FILE_H
|
#ifndef __CW_FILE_H
|
||||||
#define __CW_FILE_H
|
#define __CW_FILE_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@defgroup FileFunctions File Functions
|
||||||
|
*@{
|
||||||
|
*/
|
||||||
|
|
||||||
char *cw_load_file(const char *filename,size_t *size);
|
char *cw_load_file(const char *filename,size_t *size);
|
||||||
int cw_save_file(const char *filename, char *data,int len);
|
int cw_save_file(const char *filename, char *data,int len);
|
||||||
|
|
||||||
|
/**@}*/
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user