file.c File Reference

File module implementation file. More...

Include dependency graph for file.c:

Go to the source code of this file.

Functions

static mcl_error_t _set_file_local_path (mcl_file_t *file, const char *path)
 
mcl_error_t mcl_file_initialize (E_MCL_FILE_VERSION version, mcl_file_t **file)
 
mcl_error_t mcl_file_set_parameter (mcl_file_t *file, E_MCL_FILE_PARAMETER parameter, const void *value)
 
mcl_error_t file_validate (file_t *file)
 
void mcl_file_destroy (mcl_file_t **file)
 

Variables

const char * mcl_file_versions [MCL_FILE_VERSION_END] = { "1.0" }
 

Detailed Description

File module implementation file.

Definition in file file.c.

Function Documentation

mcl_error_t file_validate ( file_t file)

This function checks whether all mandatory parameters of a file are set or not.

Parameters
[in]fileFile to validate.
Returns

Definition at line 121 of file file.c.

References file_payload_t::local_path, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_INVALID_PARAMETER, MCL_NO_FILE_SUPPORT, MCL_NULL, MCL_OK, file_t::payload, and file_payload_t::remote_name.

Referenced by _store_add_data(), and connectivity_processor_exchange().

Here is the caller graph for this function:

void mcl_file_destroy ( mcl_file_t **  file)

This function destroys file data structure.

Parameters
[in]fileFile handle which is going to be destroyed.

Definition at line 148 of file file.c.

References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_file_util_fclose(), MCL_FREE, and MCL_NULL.

Referenced by _item_destroy(), and mcl_file_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

mcl_error_t mcl_file_initialize ( E_MCL_FILE_VERSION  version,
mcl_file_t **  file 
)

This function creates and initializes a data struct of mcl_file_t.

Parameters
[in]versionOne of the versions listed in E_MCL_FILE_VERSION.
[out]fileFile handle which is going to be initialized.
Returns

Definition at line 20 of file file.c.

References MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_file_destroy(), MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, MCL_ITEM_PREAMBLE, MCL_ITEM_TYPE_FILE, MCL_NEW, MCL_NO_FILE_SUPPORT, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.

Here is the call graph for this function:

mcl_error_t mcl_file_set_parameter ( mcl_file_t file,
E_MCL_FILE_PARAMETER  parameter,
const void *  value 
)

This function is used to set a parameter of a file.

Parameters
[in]fileFile to set its parameter.
[in]parameterOne of the parameters listed in E_MCL_FILE_PARAMETER.
[in]valueNew value of the parameter.
Returns

Definition at line 76 of file file.c.

References _set_file_local_path(), MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FILE_PARAMETER_LOCAL_PATH, MCL_FILE_PARAMETER_REMOTE_NAME, MCL_FILE_PARAMETER_TYPE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, MCL_NO_FILE_SUPPORT, and mcl_string_util_reset().

Here is the call graph for this function:

Variable Documentation

const char* mcl_file_versions[MCL_FILE_VERSION_END] = { "1.0" }

Definition at line 15 of file file.c.

Referenced by _add_item_meta_payload(), and _item_meta_size().