file: constify data/name args

pull/1886/merge
Victor Julien 10 years ago
parent 8631b73852
commit e3703ee126

@ -291,7 +291,7 @@ void FileContainerFree(FileContainer *ffc)
*
* \retval new FileData object
*/
static FileData *FileDataAlloc(uint8_t *data, uint32_t data_len)
static FileData *FileDataAlloc(const uint8_t *data, uint32_t data_len)
{
FileData *new = SCMalloc(sizeof(FileData));
if (unlikely(new == NULL)) {
@ -339,7 +339,7 @@ static void FileDataFree(FileData *ffd)
*
* \retval new File object or NULL on error
*/
static File *FileAlloc(uint8_t *name, uint16_t name_len)
static File *FileAlloc(const uint8_t *name, uint16_t name_len)
{
File *new = SCMalloc(sizeof(File));
if (unlikely(new == NULL)) {
@ -465,7 +465,7 @@ static int FileStoreNoStoreCheck(File *ff)
* \retval -1 error
* \retval -2 no store for this file
*/
int FileAppendData(FileContainer *ffc, uint8_t *data, uint32_t data_len)
int FileAppendData(FileContainer *ffc, const uint8_t *data, uint32_t data_len)
{
SCEnter();
@ -537,8 +537,8 @@ int FileAppendData(FileContainer *ffc, uint8_t *data, uint32_t data_len)
*
* \note filename is not a string, so it's not nul terminated.
*/
File *FileOpenFile(FileContainer *ffc, uint8_t *name,
uint16_t name_len, uint8_t *data, uint32_t data_len, uint8_t flags)
File *FileOpenFile(FileContainer *ffc, const uint8_t *name, uint16_t name_len,
const uint8_t *data, uint32_t data_len, uint8_t flags)
{
SCEnter();
@ -600,7 +600,7 @@ File *FileOpenFile(FileContainer *ffc, uint8_t *name,
SCReturnPtr(ff, "File");
}
static int FileCloseFilePtr(File *ff, uint8_t *data,
static int FileCloseFilePtr(File *ff, const uint8_t *data,
uint32_t data_len, uint8_t flags)
{
SCEnter();
@ -676,7 +676,7 @@ static int FileCloseFilePtr(File *ff, uint8_t *data,
* \retval 0 ok
* \retval -1 error
*/
int FileCloseFile(FileContainer *ffc, uint8_t *data,
int FileCloseFile(FileContainer *ffc, const uint8_t *data,
uint32_t data_len, uint8_t flags)
{
SCEnter();

@ -109,8 +109,8 @@ void FileContainerAdd(FileContainer *, File *);
*
* \note filename is not a string, so it's not nul terminated.
*/
File *FileOpenFile(FileContainer *, uint8_t *name, uint16_t name_len,
uint8_t *data, uint32_t data_len, uint8_t flags);
File *FileOpenFile(FileContainer *, const uint8_t *name, uint16_t name_len,
const uint8_t *data, uint32_t data_len, uint8_t flags);
/**
* \brief Close a File
*
@ -122,7 +122,8 @@ File *FileOpenFile(FileContainer *, uint8_t *name, uint16_t name_len,
* \retval 0 ok
* \retval -1 error
*/
int FileCloseFile(FileContainer *, uint8_t *data, uint32_t data_len, uint8_t flags);
int FileCloseFile(FileContainer *, const uint8_t *data, uint32_t data_len,
uint8_t flags);
/**
* \brief Store a chunk of file data in the flow. The open "flowfile"
@ -135,7 +136,7 @@ int FileCloseFile(FileContainer *, uint8_t *data, uint32_t data_len, uint8_t fla
* \retval 0 ok
* \retval -1 error
*/
int FileAppendData(FileContainer *, uint8_t *data, uint32_t data_len);
int FileAppendData(FileContainer *, const uint8_t *data, uint32_t data_len);
/**
* \brief Tag a file for storing

Loading…
Cancel
Save