Cleanups, copyright headers and name changing for PRing

This commit is contained in:
Cacodemon345
2025-03-10 20:54:25 +06:00
parent 1ed579a0fc
commit 81461f677d
17 changed files with 136 additions and 1453 deletions

View File

@@ -126,7 +126,6 @@ extern int video_filter_method; /* (C) video */
extern int video_vsync; /* (C) video */
extern int video_framerate; /* (C) video */
extern int gfxcard[GFXCARD_MAX]; /* (C) graphics/video card */
extern char video_shader[512]; /* (C) video */
extern int bugger_enabled; /* (C) enable ISAbugger */
extern int novell_keycard_enabled; /* (C) enable Novell NetWare 2.x key card emulation. */
extern int postcard_enabled; /* (C) enable POST card */

View File

@@ -92,36 +92,6 @@ 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);
static inline void *wx_config_load(const char *path) { ini_t ini = ini_read(path); if (ini) ini_strip_quotes(ini); return (void*)ini; }
static inline int wx_config_get_string(void *config, const char *name, char *dst, int size, const char *defVal) {
int res = ini_has_entry(ini_find_or_create_section((ini_t)config, ""), name);
char* str = ini_get_string((ini_t)config, "", name, (char*)defVal);
if (size == 0)
return res;
if (str != NULL)
strncpy(dst, str, size - 1);
else
dst[0] = 0;
return res;
}
static inline int wx_config_get_int(void *config, const char *name, int *dst, int defVal) {
int res = ini_has_entry(ini_find_or_create_section((ini_t)config, ""), name);
*dst = ini_get_int((ini_t)config, "", name, defVal);
return res;
}
static inline int wx_config_get_float(void *config, const char *name, float *dst, float defVal) {
int res = ini_has_entry(ini_find_or_create_section((ini_t)config, ""), name);
*dst = (float)ini_get_double((ini_t)config, "", name, defVal);
return res;
}
static inline int wx_config_get_bool(void *config, const char *name, int *dst, int defVal) {
int res = ini_has_entry(ini_find_or_create_section((ini_t)config, ""), name);
*dst = !!ini_get_int((ini_t)config, "", name, defVal);
return res;
}
static inline int wx_config_has_entry(void *config, const char *name) { return ini_has_entry(ini_find_or_create_section((ini_t)config, ""), name); }
static inline void wx_config_free(void *config) { ini_close(config); };
#ifdef __cplusplus
}
#endif