Comments stuff.

FossilOrigin-Name: 7d81fc88819b4286912472223025e9afaccba0cd70b038aacecbfbb5806a366f
This commit is contained in:
7u83@mail.ru 2015-05-04 05:28:21 +00:00
parent d3119dfef5
commit c69570713e
2 changed files with 26 additions and 0 deletions

View File

@ -2,6 +2,26 @@
#include <stdint.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)
{
FILE * infile = fopen(filename,"rb");

View File

@ -1,9 +1,15 @@
#ifndef __CW_FILE_H
#define __CW_FILE_H
/**
*@defgroup FileFunctions File Functions
*@{
*/
char *cw_load_file(const char *filename,size_t *size);
int cw_save_file(const char *filename, char *data,int len);
/**@}*/
#endif