1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _COMMON_UTIL_FILES_H
8 #define _COMMON_UTIL_FILES_H
9 
10 
11 #include <stdint.h>
12 
13 #ifdef WIN32
14 #define UTILEXPORT_C __declspec(dllexport)
15 #else
16 #define UTILEXPORT_C
17 #endif
18 
19 #define UTIL_MAX_FILE_NAME  256
20 
21 /**
22  * @brief This function
23  *
24  * @param[in]
25  *
26  * @param[out]
27  *
28  * @return uint8_t -
29 
30  */
31 UTILEXPORT_C int32_t CC_CommonUtilCopyDataFromRawTextFile (uint8_t *fileName, uint8_t *outBuff, uint32_t *outBuffLen);
32 
33 /**
34  * @brief This function
35  *
36  * @param[in]
37  *
38  * @param[out]
39  *
40  * @return uint8_t -
41 
42  */
43 UTILEXPORT_C int32_t CC_CommonUtilCopyDataFromTextFile (uint8_t *fileName, uint8_t *outBuff, uint32_t *outBuffLen);
44 
45 /**
46  * @brief This function
47  *
48  * @param[in]
49  *
50  * @param[out]
51  *
52  * @return uint8_t -
53 
54  */
55 UTILEXPORT_C int32_t CC_CommonUtilCopyDataFromBinFile (uint8_t *fileName, uint8_t *outBuff, uint32_t *outBuffLen);
56 
57 /**
58  * @brief This function copies a buffer to a file
59  *
60  * @param[in]
61  *
62  * @param[out]
63  *
64  * @return uint8_t -
65 
66  */
67 UTILEXPORT_C int32_t CC_CommonUtilCopyBuffToBinFile (uint8_t *fileName, uint8_t *inBuff, uint32_t inBuffLen);
68 
69 
70 /**
71  * @brief The function reads the pwd file name gets the pwd and returns it
72  *
73  * @param[in] pPwdFileName - file name of the password
74  * @param[out] pwd - passphrase data
75  *
76  */
77 /*********************************************************/
78 int32_t CC_CommonGetPassphrase(int8_t *pPwdFileName, uint8_t **pwd);
79 
80 #endif
81