File module implementation file. More...
#include "mcl_connectivity/mcl_file.h"
#include "mcl_core/mcl_file_util.h"
#include "mcl_core/mcl_memory.h"
#include "mcl_core/mcl_string_util.h"
#include "file.h"
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" } |
File module implementation file.
Definition in file file.c.
|
static |
Definition at line 172 of file file.c.
References MCL_ASSERT_OK, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FILE_CANNOT_BE_OPENED, mcl_file_util_check_if_regular_file(), mcl_file_util_fclose(), mcl_file_util_fopen(), mcl_file_util_get_file_size(), mcl_file_util_get_time_of_last_status_change(), MCL_FREE, MCL_FUNCTION_LEAVE_LABEL, MCL_MALLOC, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, mcl_string_util_reset(), mcl_time_util_convert_to_iso_8601_format(), MCL_TIMESTAMP_LENGTH, and MCL_TRUE.
Referenced by mcl_file_set_parameter().
mcl_error_t file_validate | ( | file_t * | file | ) |
This function checks whether all mandatory parameters of a file are set or not.
[in] | file | File to validate. |
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().
void mcl_file_destroy | ( | mcl_file_t ** | file | ) |
This function destroys file data structure.
[in] | file | File 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().
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.
[in] | version | One of the versions listed in E_MCL_FILE_VERSION. |
[out] | file | File handle which is going to be initialized. |
file
is null. 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.
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.
[in] | file | File to set its parameter. |
[in] | parameter | One of the parameters listed in E_MCL_FILE_PARAMETER. |
[in] | value | New value of the parameter . |
file
or value
is NULL. parameter
is invalid. 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().
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().