2015-07-22 20:32:54 +02:00
|
|
|
#ifndef INCLUDE_LIBINI_H
|
|
|
|
#define INCLUDE_LIBINI_H
|
|
|
|
|
|
|
|
#ifndef INCLUDE_KOLIBRI_H
|
|
|
|
#include "../lib/kolibri.h"
|
|
|
|
#endif
|
|
|
|
|
2022-02-08 10:05:27 +01:00
|
|
|
#ifdef __COFF__
|
|
|
|
extern dword ini_enum_sections;
|
|
|
|
extern dword ini_enum_keys;
|
|
|
|
extern dword ini_get_str;
|
|
|
|
extern dword ini_get_int;
|
|
|
|
extern dword ini_get_color;
|
|
|
|
extern dword ini_set_str;
|
|
|
|
extern dword ini_set_int;
|
|
|
|
//extern dword ini_set_color;
|
|
|
|
//extern dword ini_get_shortcut;
|
|
|
|
#else
|
2015-07-22 20:32:54 +02:00
|
|
|
#ifndef INCLUDE_DLL_H
|
|
|
|
#include "../lib/dll.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-31 00:35:25 +01:00
|
|
|
dword libini = #alibini;
|
|
|
|
char alibini[] = "/sys/lib/libini.obj";
|
|
|
|
|
|
|
|
dword lib_init = #alib_init;
|
|
|
|
dword ini_enum_sections = #aini_enum_sections;
|
|
|
|
dword ini_enum_keys = #aini_enum_keys;
|
|
|
|
dword ini_get_str = #aini_get_str;
|
|
|
|
dword ini_get_int = #aini_get_int;
|
2015-02-13 23:20:25 +01:00
|
|
|
dword ini_get_color = #aini_get_color;
|
2014-10-31 00:35:25 +01:00
|
|
|
dword ini_set_str = #aini_set_str;
|
|
|
|
dword ini_set_int = #aini_set_int;
|
2015-02-17 17:46:38 +01:00
|
|
|
//dword ini_set_color = #aini_set_color;
|
|
|
|
//dword ini_get_shortcut = #aini_get_shortcut;
|
2014-10-31 00:35:25 +01:00
|
|
|
$DD 2 dup 0
|
|
|
|
|
|
|
|
char alib_init[] = "lib_init";
|
|
|
|
char aini_enum_sections[] = "ini_enum_sections";
|
|
|
|
char aini_enum_keys[] = "ini_enum_keys";
|
|
|
|
char aini_get_str[] = "ini_get_str";
|
|
|
|
char aini_get_int[] = "ini_get_int";
|
|
|
|
char aini_set_str[] = "ini_set_str";
|
|
|
|
char aini_set_int[] = "ini_set_int";
|
2015-02-17 17:46:38 +01:00
|
|
|
//char aini_get_shortcut[] = "ini_get_shortcut";
|
2015-02-13 23:20:25 +01:00
|
|
|
char aini_get_color[] = "ini_get_color";
|
2015-02-17 17:46:38 +01:00
|
|
|
//char aini_set_color[] = "ini_set_color";
|
2022-02-08 10:05:27 +01:00
|
|
|
#endif
|
2015-07-22 20:32:54 +02:00
|
|
|
|
2017-10-05 11:37:50 +02:00
|
|
|
//===================================================//
|
|
|
|
// //
|
|
|
|
// FUCTIONS //
|
|
|
|
// //
|
|
|
|
//===================================================//
|
|
|
|
|
2018-09-15 12:48:42 +02:00
|
|
|
:struct _ini
|
2017-10-05 11:37:50 +02:00
|
|
|
{
|
|
|
|
dword path;
|
|
|
|
dword section;
|
|
|
|
void SetPath();
|
|
|
|
void SetSection();
|
|
|
|
int GetInt();
|
|
|
|
void SetInt();
|
|
|
|
void GetString();
|
|
|
|
void SetString();
|
|
|
|
};
|
|
|
|
|
2018-09-15 12:48:42 +02:00
|
|
|
:int _ini::GetInt(dword key, default_value)
|
2017-10-05 11:37:50 +02:00
|
|
|
{
|
|
|
|
ini_get_int stdcall (path, section, key, default_value);
|
|
|
|
return EAX;
|
|
|
|
}
|
|
|
|
|
2018-09-15 12:48:42 +02:00
|
|
|
:void _ini::SetInt(dword key, value)
|
2017-10-05 11:37:50 +02:00
|
|
|
{
|
|
|
|
ini_set_int stdcall (path, section, key, value);
|
|
|
|
}
|
|
|
|
|
2018-09-15 12:48:42 +02:00
|
|
|
:void _ini::GetString(dword key, dst, len, default_value)
|
2017-10-05 11:37:50 +02:00
|
|
|
{
|
|
|
|
ini_get_str stdcall (path, section, key, dst, len, default_value);
|
|
|
|
}
|
|
|
|
|
2018-09-15 12:48:42 +02:00
|
|
|
:void _ini::SetString(dword key, value, len)
|
2017-10-05 11:37:50 +02:00
|
|
|
{
|
2018-03-07 12:18:19 +01:00
|
|
|
ini_set_str stdcall (path, section, key, value, len);
|
2017-10-05 11:37:50 +02:00
|
|
|
}
|
|
|
|
|
2015-07-22 20:32:54 +02:00
|
|
|
#endif
|