blob: 35790659eb3451a2ef58f82bb39e8ea1f6af86c5 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/**
2* @file cfg_api.h
3* @brief nv½Ó¿ÚÍ·Îļþ
4*
5* Copyright (C) 2017 Sanechips Technology Co., Ltd.
6*
7*/
8
9#ifndef _CFG_API_H
10#define _CFG_API_H
11
12/*******************************************************************************
13 * Include header files *
14 ******************************************************************************/
15
16/*******************************************************************************
17 * Macro definitions *
18 ******************************************************************************/
19
20
21/*******************************************************************************
22 * Type definitions *
23 ******************************************************************************/
24
25
26/*******************************************************************************
27 * Global variable declarations *
28 ******************************************************************************/
29
30
31/*******************************************************************************
32 * Global function declarations *
33 ******************************************************************************/
34/**
35* @brief »ñȡָ¶¨×ֶζÔÓ¦µÄÖµ
36* @param name Èë²Î£¬×Ö¶ÎÃû
37* @param buf ³ö²Î£¬´æ·Å×ֶζÔÓ¦Êý¾ÝµÄ»º³åÇøÖ¸Õë
38* @param len Èë²Î£¬»º³åÇøbuf³¤¶È
39* @return 0£º³É¹¦£¬-1£ºÊ§°Ü
40* @retval 0 ³É¹¦
41* @retval -1 ʧ°Ü
42* @note
43* @warning
44*/
45int cfg_get_item(char *name, char *buf, int bufLen);
46int sc_cfg_get(char *name, char *buf, int bufLen);
47
48/**
49 * @brief ÉèÖÃÖ¸¶¨×ֶζÔÓ¦µÄÖµ
50 * @param name Èë²Î£¬×Ö¶ÎÃû
51 * @param value Èë²Î£¬ÏëÒª´æ´¢µÄÊý¾Ý
52 * @return 0£º³É¹¦£¬-1£ºÊ§°Ü
53 * @retval 0 ³É¹¦
54 * @retval -1 ʧ°Ü
55 * @note cfg_set½öÉèÖõ½Äڴ棬µ÷ÓÃcfg_save²Å»á±£´æµ½Îļþ£¬²Å»áÖØÆôÉúЧ
56 * @warning ½öÔÚparameterÖеÄnv²Å»áµôµç±£´æ£¬ÆäËû½ÔÊÓΪÁÙʱnv
57 */
58int cfg_set(char *name, char *value);
59int sc_cfg_set(char *name, char *value);
60
61/**
62 * @brief ɾ³ýÖ¸¶¨×Ö¶Î
63 * @param name Èë²Î£¬×Ö¶ÎÃû
64 * @return 0£º³É¹¦£¬-1£ºÊ§°Ü
65 * @retval 0 ³É¹¦
66 * @retval -1 ʧ°Ü
67 * @note
68 * @warning
69 */
70int cfg_unset(char *name);
71int sc_cfg_unset(char *name);
72
73/**
74 * @brief Çå¿ÕÈ«²¿×ֶδ洢ÐÅÏ¢
75 * @param
76 * @return 0£º³É¹¦£¬-1£ºÊ§°Ü
77 * @retval 0 ³É¹¦
78 * @retval -1 ʧ°Ü
79 * @note
80 * @warning »Ö¸´³ö³§ÐÅϢʱµ÷ÓÃ
81 */
82int cfg_reset(void);
83int sc_cfg_reset(void);
84
85/**
86 * @brief ´òÓ¡ÏÔʾËùÓÐÅäÖÃÏîÐÅÏ¢µ½¿ØÖÆÌ¨
87 * @param
88 * @return 0£º³É¹¦£¬-1£ºÊ§°Ü
89 * @retval 0 ³É¹¦
90 * @retval -1 ʧ°Ü
91 * @note
92 * @warning
93 */
94int cfg_show(void);
95int sc_cfg_show(void);
96
97/**
98 * @brief ±£´æÈ«²¿ÅäÖÃÊý¾Ýµ½Îļþ
99 * @param
100 * @return 0£º³É¹¦£¬-1£ºÊ§°Ü
101 * @retval 0 ³É¹¦
102 * @retval -1 ʧ°Ü
103 * @note cfg_saveµ÷Óúó£¬ÅäÖõÄÊý¾ÝÖØÆôºó»¹ÄÜÉúЧ
104 * @warning
105 */
106int cfg_save(void);
107int sc_cfg_save(void);
108
109/**
110 * @brief systemϵͳµ÷Ó÷â×°½Ó¿Ú
111 * @param cmd Èë²Î ÃüÁî
112 * @return 0£º³É¹¦£¬-1£ºÊ§°Ü
113 * @retval 0 ³É¹¦
114 * @retval -1 ʧ°Ü
115 * @note
116 * @warning
117 */
118extern int zxic_system(const char *cmd);
119
120extern int zxic_system_outdata(const char *cmd, const char *outfile, char *out_data, int out_len);
121/*******************************************************************************
122 * Inline function implementations *
123 ******************************************************************************/
124
125#endif // #ifndef _CFG_API_H
126