1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 /**
4  *****************************************************************************
5  * @file sal_string_parse.h
6  *
7  * @defgroup SalStringParse
8  *
9  * @ingroup SalStringParse
10  *
11  * @description
12  *     This file contains string parsing functions
13  *
14  *****************************************************************************/
15 
16 #ifndef SAL_STRING_PARSE_H
17 #define SAL_STRING_PARSE_H
18 
19 /* Maximum size of the strings used by SAL */
20 #define SAL_CFG_MAX_VAL_LEN_IN_BYTES 64
21 
22 /**
23 *******************************************************************************
24  * @ingroup SalStringParse
25  *      Builds a string and store it in result
26  *
27  * @description
28  *      The result string will be the concatenation of string1, instanceNumber
29  *      and string2. The size of result has to be SAL_CFG_MAX_VAL_LEN_IN_BYTES.
30  *      We can't check this in this function, this is the user responsibility
31  *
32  * @param[in]  string1          First string to concatenate
33  * @param[in]  instanceNumber   Instance number
34  * @param[in]  string2          Second string to concatenate
35  * @param[out] result           Resulting string of concatenation
36  *
37  * @retval CPA_STATUS_SUCCESS   Function executed successfully
38  * @retval CPA_STATUS_FAIL      Function failed
39  *
40  *****************************************************************************/
41 CpaStatus Sal_StringParsing(char *string1,
42 			    Cpa32U instanceNumber,
43 			    char *string2,
44 			    char *result);
45 
46 /**
47 *******************************************************************************
48  * @ingroup SalStringParse
49  *      Convert a string to an unsigned long
50  *
51  * @description
52  *      Parses the string cp in the specified base, and returned it as an
53  *      unsigned long value.
54  *
55  * @param[in]  cp       String to be converted
56  * @param[in]  endp     Pointer to the end of the string. This parameter
57  *                      can also be NULL and will not be used in this case
58  * @param[in]  cfgBase  Base to convert the string
59  *
60  * @retval  The string converted to an unsigned long
61  *
62  *****************************************************************************/
63 Cpa64U Sal_Strtoul(const char *cp, char **endp, unsigned int cfgBase);
64 
65 #endif /* SAL_STRING_PARSE_H */
66