This source file implements the functions in file.h. More...
#include "file.h"
#include "definitions.h"
#include "memory.h"
#include "log_util.h"
#include "file_util.h"
#include "time_util.h"
Go to the source code of this file.
Functions | |
E_MCL_ERROR_CODE | file_initialize (const char *version, const char *file_path, const char *file_name, const char *file_type, const char *routing, file_t **file) |
void | file_destroy (file_t **file) |
This source file implements the functions in file.h.
Definition in file file.c.
void file_destroy | ( | file_t ** | file | ) |
This function closes the file file_t data structure refers to and destroys the file_t data structure.
[in] | file | Data structure file_t to destroy. |
Definition at line 163 of file file.c.
References DEBUG_ENTRY, DEBUG_LEAVE, file_util_fclose(), MCL_FREE, MCL_NULL, and string_destroy().
Referenced by _store_list_destroy_callback(), file_initialize(), http_processor_get_access_token(), and mcl_store_new_file().
E_MCL_ERROR_CODE file_initialize | ( | const char * | version, |
const char * | file_path, | ||
const char * | file_name, | ||
const char * | file_type, | ||
const char * | routing, | ||
file_t ** | file | ||
) |
This function creates and initializes a data structure file_t for a given file and opens it for reading.
[in] | version | Version of the file item meta. |
[in] | file_path | Absolute path of the file to transfer. |
[in] | file_name | Name of the file. This name will be assigned to the file that is being uploaded. |
[in] | file_type | Type of the file. |
[in] | routing | Routing information of file_t. |
[out] | file | Data structure file_t. |
Definition at line 22 of file file.c.
References ASSERT_CODE_MESSAGE, ASSERT_NOT_NULL, ASSERT_STATEMENT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, file_destroy(), file_util_check_if_regular_file(), file_util_fopen(), file_util_fstat(), MCL_FILE_CANNOT_BE_OPENED, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_TRUE, META_FIELD_PAYLOAD_TYPE_FILE, META_FIELD_TYPE_ITEM, meta_field_values, META_FIELD_VERSION_CURRENT, string_initialize_new(), string_initialize_static(), time_util_convert_to_iso_8601_format(), and string_t::type.
Referenced by http_processor_get_access_token(), and mcl_store_new_file().