ini: Constify parameters to optimize execution

This commit is contained in:
RichardG867
2023-04-18 16:14:44 -03:00
parent c95424b8d9
commit fb8ef3e40c
5 changed files with 47 additions and 47 deletions

View File

@@ -30,26 +30,26 @@ typedef void *ini_t;
typedef void *ini_section_t;
extern ini_t ini_new(void);
extern ini_t ini_read(char *fn);
extern void ini_write(ini_t ini, char *fn);
extern ini_t ini_read(const char *fn);
extern void ini_write(ini_t ini, const char *fn);
extern void ini_dump(ini_t ini);
extern void ini_close(ini_t ini);
extern void ini_section_delete_var(ini_section_t section, char *name);
extern int ini_section_get_int(ini_section_t section, char *name, int def);
extern double ini_section_get_double(ini_section_t section, char *name, double def);
extern int ini_section_get_hex16(ini_section_t section, char *name, int def);
extern int ini_section_get_hex20(ini_section_t section, char *name, int def);
extern int ini_section_get_mac(ini_section_t section, char *name, int def);
extern char *ini_section_get_string(ini_section_t section, char *name, char *def);
extern wchar_t *ini_section_get_wstring(ini_section_t section, char *name, wchar_t *def);
extern void ini_section_set_int(ini_section_t section, char *name, int val);
extern void ini_section_set_double(ini_section_t section, char *name, double val);
extern void ini_section_set_hex16(ini_section_t section, char *name, int val);
extern void ini_section_set_hex20(ini_section_t section, char *name, int val);
extern void ini_section_set_mac(ini_section_t section, char *name, int val);
extern void ini_section_delete_var(ini_section_t section, const char *name);
extern int ini_section_get_int(ini_section_t section, const char *name, int def);
extern double ini_section_get_double(ini_section_t section, const char *name, double def);
extern int ini_section_get_hex16(ini_section_t section, const char *name, int def);
extern int ini_section_get_hex20(ini_section_t section, const char *name, int def);
extern int ini_section_get_mac(ini_section_t section, const char *name, int def);
extern char *ini_section_get_string(ini_section_t section, const char *name, char *def);
extern wchar_t *ini_section_get_wstring(ini_section_t section, const char *name, wchar_t *def);
extern void ini_section_set_int(ini_section_t section, const char *name, int val);
extern void ini_section_set_double(ini_section_t section, const char *name, double val);
extern void ini_section_set_hex16(ini_section_t section, const char *name, int val);
extern void ini_section_set_hex20(ini_section_t section, const char *name, int val);
extern void ini_section_set_mac(ini_section_t section, const char *name, int val);
extern void ini_section_set_string(ini_section_t section, const char *name, const char *val);
extern void ini_section_set_wstring(ini_section_t section, char *name, wchar_t *val);
extern void ini_section_set_wstring(ini_section_t section, const char *name, wchar_t *val);
#define ini_delete_var(ini, head, name) ini_section_delete_var(ini_find_section(ini, head), name)
@@ -69,13 +69,13 @@ extern void ini_section_set_wstring(ini_section_t section, char *name, wchar
#define ini_set_string(ini, head, name, val) ini_section_set_string(ini_find_or_create_section(ini, head), name, val)
#define ini_set_wstring(ini, head, name, val) ini_section_set_wstring(ini_find_or_create_section(ini, head), name, val)
extern ini_section_t ini_find_section(ini_t ini, char *name);
extern ini_section_t ini_find_or_create_section(ini_t ini, char *name);
extern void ini_rename_section(ini_section_t section, char *name);
extern ini_section_t ini_find_section(ini_t ini, const char *name);
extern ini_section_t ini_find_or_create_section(ini_t ini, const char *name);
extern void ini_rename_section(ini_section_t section, const char *name);
extern void ini_delete_section_if_empty(ini_t ini, ini_section_t section);
#ifdef __cplusplus
}
#endif
#endif
#endif

View File

@@ -62,7 +62,7 @@ extern const device_t *sound_card_getdevice(int card);
#endif
extern int sound_card_has_config(int card);
extern char *sound_card_get_internal_name(int card);
extern int sound_card_get_from_internal_name(char *s);
extern int sound_card_get_from_internal_name(const char *s);
extern void sound_card_init(void);
extern void sound_set_cd_volume(unsigned int vol_l, unsigned int vol_r);