|
|
|
@ -16,14 +16,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
#define DesktopPath "/usr/share/applications/"
|
|
|
|
#define DesktopPath "/usr/share/applications/"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**for_dictionaries(element, stack)
|
|
|
|
* @brief Works like for, but is used to enumerate dictionary elements.
|
|
|
|
* [EN]
|
|
|
|
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Работает как for, но нужен для перечисления элементов словаря.
|
|
|
|
* Работает как for, но нужен для перечисления элементов словаря типа dictioary [stack]. Каждый цикл текущий элемент попадает в [element]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* @param iterator Type: dictionary*
|
|
|
|
#define for_dictionaries(element, stack) for (element = stack->first; element != NULL; element = element->next)
|
|
|
|
*
|
|
|
|
|
|
|
|
* dictionary element iterator.
|
|
|
|
|
|
|
|
* @param stack Type: dictinoary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* dictionary pointer.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define for_dictionaries(iterator, stack) for (iterator = stack->first; iterator != NULL; iterator = iterator->next)
|
|
|
|
|
|
|
|
|
|
|
|
#define new(type) malloc(sizeof(type))
|
|
|
|
#define new(type) malloc(sizeof(type))
|
|
|
|
#define new_arr(type,size) malloc(sizeof(type)*size)
|
|
|
|
#define new_arr(type,size) malloc(sizeof(type)*size)
|
|
|
|
@ -48,15 +53,30 @@ typedef enum
|
|
|
|
struct type_name *prev;\
|
|
|
|
struct type_name *prev;\
|
|
|
|
struct type_name *first;\
|
|
|
|
struct type_name *first;\
|
|
|
|
DICT_TYPE data_type;
|
|
|
|
DICT_TYPE data_type;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Named dictionary structure.
|
|
|
|
|
|
|
|
*
|
|
|
|
* Структура именованого списка.
|
|
|
|
* Структура именованого списка.
|
|
|
|
* [key] - ключ элемента
|
|
|
|
* @param key dictionary element key.
|
|
|
|
* [data] - хранимое значение
|
|
|
|
*
|
|
|
|
* [next] - следующий элемент списка
|
|
|
|
* Ключ элемента словаря.
|
|
|
|
* [prev] - предыдущий элемент списка
|
|
|
|
* @param data dictionary element value.
|
|
|
|
* [first] - первый элемент списка
|
|
|
|
*
|
|
|
|
* [data_type] - Тип значения в словаре
|
|
|
|
* Значение элемента словаря.
|
|
|
|
*/
|
|
|
|
* @param next next dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Следующий элемент словаря.
|
|
|
|
|
|
|
|
* @param prev previous dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Предыдущий элемент словаря.
|
|
|
|
|
|
|
|
* @param first first dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Следующий элемент словаря.
|
|
|
|
|
|
|
|
* @param data_type value type.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Тип значения.
|
|
|
|
|
|
|
|
*/
|
|
|
|
typedef struct dictionary
|
|
|
|
typedef struct dictionary
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char *key;
|
|
|
|
char *key;
|
|
|
|
@ -67,299 +87,663 @@ typedef struct dictionary
|
|
|
|
DICT_TYPE data_type;
|
|
|
|
DICT_TYPE data_type;
|
|
|
|
} dictionary;
|
|
|
|
} dictionary;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct apps
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
char *Name;
|
|
|
|
|
|
|
|
int Type;
|
|
|
|
|
|
|
|
char *Categories;
|
|
|
|
|
|
|
|
char *Exec;
|
|
|
|
|
|
|
|
char *Icon;
|
|
|
|
|
|
|
|
int Pluggable;
|
|
|
|
|
|
|
|
int DualPluggable;
|
|
|
|
|
|
|
|
} apps;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef char** config_str;
|
|
|
|
typedef char** config_str;
|
|
|
|
|
|
|
|
|
|
|
|
/**config(key)
|
|
|
|
/**
|
|
|
|
* Возвращает элемент конфигурации ubconfig с ключом [key] или NULL если такого нет
|
|
|
|
* @brief Get configuration parameter value.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Получение значения параметра конфигурации.
|
|
|
|
|
|
|
|
* @param key Key of configuration parameter.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Ключ параметра конфигурации.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Value of configuration parameter or NULL.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Значение парамерта конфигурации или NULL.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define config(key) yon_config_get_by_key(key)
|
|
|
|
#define config(key) yon_config_get_by_key(key)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Allocates or reallocates memory.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Выделение или перевыделение памяти.
|
|
|
|
|
|
|
|
* @param pointer If NULL, uses malloc(), otherwise uses realloc().
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Если NULL, используется malloc(), иначе realloc().
|
|
|
|
|
|
|
|
* @param size Size of memory allocation.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Размер выделенной памяти.
|
|
|
|
|
|
|
|
* @return Type: void*
|
|
|
|
|
|
|
|
* Newly allocated memory.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новая выделенная память.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define yon_remalloc(pointer, size) (!pointer) ? malloc(size) : realloc(pointer, size)
|
|
|
|
#define yon_remalloc(pointer, size) (!pointer) ? malloc(size) : realloc(pointer, size)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// dictionary functions
|
|
|
|
// dictionary functions
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_get_data(dictionary, type)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Gets data from dictionary element.
|
|
|
|
* Gets data from dictionary.
|
|
|
|
*
|
|
|
|
* [dictionary] is dictionary, from which data should be extracted;
|
|
|
|
* Получение значения элемента словаря.
|
|
|
|
* [type] is type of data, [dictionary] contains.
|
|
|
|
* @param dictionary dictionary element.
|
|
|
|
* [RU]
|
|
|
|
*
|
|
|
|
* Возвращает данные из словаря.
|
|
|
|
* Элемент словаря.
|
|
|
|
* [dictionary] - словарь из которого достаются данные.
|
|
|
|
* @param type type of value, dictionary element contains.
|
|
|
|
* [type] - тип данных, хранящихся в словаре [dictionary].
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* Тип значения, содержащегося в элементе словаря.
|
|
|
|
|
|
|
|
* @return Type: void*
|
|
|
|
|
|
|
|
* Value, dictionary element contains.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Значение, которое содержит элемент словаря.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define yon_dictionary_get_data(dictionary, type) ((type)dictionary->data)
|
|
|
|
#define yon_dictionary_get_data(dictionary, type) ((type)dictionary->data)
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_add_or_create_if_exists_with_data(dict,key,data)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Creates new or appends new element to dictionary.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Создаёт новый элемент словаря.
|
|
|
|
* Добавляет элемент словаря в конец словаря [dict] c ключом [key] и данными [data].
|
|
|
|
*
|
|
|
|
* Если словарь не существует, создаёт его
|
|
|
|
* ---
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param dict dictionary*, where new element will be added to.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Словарь в который будет добавлен новый элемент.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param key char*, new allocated element's key.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Ключ нового элемента.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param data void*, data of any type.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Данные любого типа
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define yon_dictionary_add_or_create_if_exists_with_data(dict,key,data) {if (!dict) dict=yon_dictionary_new_with_data(key,data); \
|
|
|
|
#define yon_dictionary_add_or_create_if_exists_with_data(dict,key,data) {if (!dict) dict=yon_dictionary_new_with_data(key,data); \
|
|
|
|
else dict=yon_dictionary_append_with_data(dict,key,data);}
|
|
|
|
else dict=yon_dictionary_append_with_data(dict,key,data);}
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_new():
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Creates and returns empty dictionary.
|
|
|
|
* Creates and returns empty dictionary
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
|
|
|
|
* Создаёт и возвращает пустой словарь.
|
|
|
|
* Создаёт и возвращает пустой словарь.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return A newly allocated dictionary.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The caller of the method takes ownership of the returned data, and is responsible for freeing it.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый выделенный dictionary*.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Вызывающий метод берёт на себя ответственность за возвращаемые данные и отвечает за их освобождение.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_new();
|
|
|
|
dictionary *yon_dictionary_new();
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_copy(dictionary *dict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief copies dictionary.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Копирует словарь.
|
|
|
|
* Создаёт и возвращает копию элемента словаря [dict]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param dict dictionary to copy.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* словарь для копирования.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @return A new allocated dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The caller of the method takes ownership of the returned data, and is responsible for freeing it.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый выделенный dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Вызывающий метод берёт на себя ответственность за возвращаемые данные и отвечает за их освобождение.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictinoary_copy(dictionary *dict);
|
|
|
|
dictionary *yon_dictinoary_copy(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_copy_deep(dictionary *dict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Creates a deep copy of the dictionary and returns the first element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Создаёт полную копию словаря и возвращает первый элемент.
|
|
|
|
* Создаёт полную копию словаря [dict] и возвращает первый элемент
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param dict first element of dictionary to copy.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Первый элемент копируемого словаря.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @return A new allocated dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The caller of the method takes ownership of the returned data, and is responsible for freeing it.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый выделенный dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Вызывающий метод берёт на себя ответственность за возвращаемые данные и отвечает за их освобождение.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_copy_deep(dictionary *dict);
|
|
|
|
dictionary *yon_dictionary_copy_deep(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**int yon_dictionary_set_data(dictionary *dict, void *data)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Set a data to dictionary element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Установить элементу словаря значение.
|
|
|
|
* Установить элементу словаря [dict] значение [data]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param dict dictionary element to set data.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Элемент словаря в который устанавливается новое значение.
|
|
|
|
|
|
|
|
* @param data new value for dictionaty
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новое значение словаря.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @return 0 if failed, 1 if succeeded.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 при провале, 1 при успехе
|
|
|
|
|
|
|
|
*/
|
|
|
|
int yon_dictionary_set_data(dictionary *dict, void *data);
|
|
|
|
int yon_dictionary_set_data(dictionary *dict, void *data);
|
|
|
|
|
|
|
|
|
|
|
|
/**int yon_dictionary_set_key(dictionary *dict, char *key)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Change dioctionary element's key.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Изменяет ключ элемента словаря.
|
|
|
|
* Изменяет ключ элемента словаря [dict] на [key]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param dict dictionary element for key change.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Элемент словаря для изменения ключа.
|
|
|
|
|
|
|
|
* @param key
|
|
|
|
|
|
|
|
* @return 0 if failed, 1 if succeeded.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 при провале, 1 при успехе
|
|
|
|
|
|
|
|
*/
|
|
|
|
int yon_dictionary_set_key(dictionary *dict, char *key);
|
|
|
|
int yon_dictionary_set_key(dictionary *dict, char *key);
|
|
|
|
|
|
|
|
|
|
|
|
/** int yon_dictionary_set(dictionary *dict, char *key, void *data)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Sets dictionary element's key and data
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Устанавливает значение ключа элемента словаря и его данные
|
|
|
|
* Устанавливает значение ключа элемента словаря [dict] на [key] и его данные на [data]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param dict dictionary element for change.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Элемент словаря для изменения.
|
|
|
|
|
|
|
|
* @param key new key for dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый ключ для элемента словаря.
|
|
|
|
|
|
|
|
* @param data new value for dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новое значение элемента словаря.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @return 0 if failed, 1 if succeeded.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 при провале, 1 при успехе.
|
|
|
|
|
|
|
|
*/
|
|
|
|
int yon_dictionary_set(dictionary *dict, char *key, void *data);
|
|
|
|
int yon_dictionary_set(dictionary *dict, char *key, void *data);
|
|
|
|
|
|
|
|
|
|
|
|
/**int yon_dictionary_empty(dictionary *dict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Cleans dictionary element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Очищает элемент словаря.
|
|
|
|
* Очищает элемент словаря [dict] от данных
|
|
|
|
* @param dict target dictionary element.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Очищаемый элемент словаря.
|
|
|
|
|
|
|
|
* @return 0 if failed, 1 if succeeded.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 при провале, 1 при успехе.
|
|
|
|
|
|
|
|
*/
|
|
|
|
int yon_dictionary_empty(dictionary *dict);
|
|
|
|
int yon_dictionary_empty(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_switch_to_last(dictionary **dict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Switch dictionary to last element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Переключает словарь на последний элемент.
|
|
|
|
* Переключает словарь [dict] на последний элемент.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param dict Dictionary to pointer.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Указатель на словарь.
|
|
|
|
|
|
|
|
*/
|
|
|
|
void yon_dictionary_switch_to_last(dictionary **dict);
|
|
|
|
void yon_dictionary_switch_to_last(dictionary **dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_create_conneced(dictionary *targetdict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Appends dictionary with new element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Дополнить словарь новым элементом.
|
|
|
|
* Создаёт новый элемент словаря [targetdict]
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* ---
|
|
|
|
|
|
|
|
* @param targetdict dictionary to append.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Словарь для дополнения.
|
|
|
|
|
|
|
|
* @return A new allocated dictionary*, element of dictionary.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый выделенный dictionary*, элемент словаря.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_append(dictionary *targetdict);
|
|
|
|
dictionary *yon_dictionary_append(dictionary *targetdict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_get_last(dictionary *dict)
|
|
|
|
|
|
|
|
* [EN]
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Returns the last element of the dictionary.
|
|
|
|
|
|
|
|
* Unlike yon_dictionary_switch_to_last()
|
|
|
|
|
|
|
|
* the dictionary remains at its previous element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Возвращает последний элемент словаря.
|
|
|
|
* Возвращает последний элемент словаря [dict].
|
|
|
|
|
|
|
|
* В отличае от yon_dictionary_switch_to_last()
|
|
|
|
* В отличае от yon_dictionary_switch_to_last()
|
|
|
|
* словарь [dict] остаётся на прежнем элементе.
|
|
|
|
* словарь остаётся на прежнем элементе.
|
|
|
|
*/
|
|
|
|
* @param dict The dictionary whose last element will be retrieved.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Словарь, последний элемент которого будет получен.
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The last element of dictionary.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_get_last(dictionary *dict);
|
|
|
|
dictionary *yon_dictionary_get_last(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_switch_places(dictionary *dict, int aim)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief iterate dictionary element position.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Меняет элемент словаря местами с другим элементом.
|
|
|
|
* Меняет элемент словаря [dict] местами с другим элементом.
|
|
|
|
* @param dict The moving dictionary element.
|
|
|
|
* если [aim]<0 элемент меняется местами с левым элементом;
|
|
|
|
*
|
|
|
|
* если [aim]>0 элемент меняется местами с правым элементом;
|
|
|
|
* Перемещаемый элемент словаря.
|
|
|
|
*/
|
|
|
|
* @param aim if <0, element switches with left element;
|
|
|
|
|
|
|
|
* if >0, element switches with right element;
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* если <0 элемент меняется местами с левым элементом;
|
|
|
|
|
|
|
|
* если >0 элемент меняется местами с правым элементом;
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* dictionary element, swapped with current.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Элемент словаря с которым текущий поменялся местами.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_swap(dictionary *dict, int aim);
|
|
|
|
dictionary *yon_dictionary_swap(dictionary *dict, int aim);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_make_first(dictionary *dict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Sets the first element pointer of the dictionary
|
|
|
|
|
|
|
|
* to the current element. Do not use
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Устанавливает указатель первого элемента словаря
|
|
|
|
* Устанавливает указатель первого элемента словаря [dict]
|
|
|
|
* на текущий элемент. Не использовать
|
|
|
|
* на текущий элемент. Не использовать.
|
|
|
|
* @param dict
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void yon_dictionary_make_first(dictionary *dict);
|
|
|
|
void yon_dictionary_make_first(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_make_nth(dictionary *dict, int nth)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Moves dictionary element to new position.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Перемещает элемент словаря на новую позицию.
|
|
|
|
* Перемещает элемент словаря [dict] на позицию [nth].
|
|
|
|
* @param dict dictionary element to move.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Перемещаемый элемент словаря.
|
|
|
|
|
|
|
|
* @param nth new position for dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* новоя позиция для элемента словаря.
|
|
|
|
|
|
|
|
*/
|
|
|
|
void yon_dictionary_make_nth(dictionary *dict, int nth);
|
|
|
|
void yon_dictionary_make_nth(dictionary *dict, int nth);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_create_with_data(char *key, void *data)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Create new dictionary element with key and value.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Создать новый элемент словаря с ключом и значением.
|
|
|
|
* Создаёт новый словарь с ключом [key] и указателем на данные [data]
|
|
|
|
* @param key new dictionary element's key.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Ключ нового элемента словаря.
|
|
|
|
|
|
|
|
* @param data new dictionary element's value.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Значение нового элемента словаря.
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* New dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый элемент словаря.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_new_with_data(char *key, void *data);
|
|
|
|
dictionary *yon_dictionary_new_with_data(char *key, void *data);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_create_with_data_connected(dictionary *dict, char *key, void *data)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Create and append dictionary element to dictionary with key and value.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Создать новый элемент словаря, присоединяемый в конец словаря
|
|
|
|
* Создаёт новый элемент словаря, присоединяемый в конец словаря [dict]
|
|
|
|
* с ключом и значением.
|
|
|
|
* с ключом [key] и указателем на данные [data]
|
|
|
|
* @param dict dictionary to append with new element.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Словарь к которому добавляется элемент.
|
|
|
|
|
|
|
|
* @param key new dictionary element's key;
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Ключ нового элемента словаря.
|
|
|
|
|
|
|
|
* @param data New dictionary element's value.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Значение нового элемента словаря.
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* New allocated dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый выделенный элемент словаря.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_append_with_data(dictionary *dict, char *key, void *data);
|
|
|
|
dictionary *yon_dictionary_append_with_data(dictionary *dict, char *key, void *data);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_connect(dictionary *old, dictionary *toconnect)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Connect dictionary element to the end of dictionary.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Присоединение элемента словаря в конец словаря.
|
|
|
|
* Присоединяет словарь [toconnect] в конец словаря [old].
|
|
|
|
* @param target Dictionary to connect element.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
dictionary *yon_dictionary_connect(dictionary *old, dictionary *toconnect);
|
|
|
|
* Словарь для присоединения элемента.
|
|
|
|
|
|
|
|
* @param append An appendable dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Присоединяемый элемент словаря.
|
|
|
|
|
|
|
|
* @return Type: int.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 if failed, 1 if success.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 при провале, 1 при успехе.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int yon_dictionary_connect(dictionary *target, dictionary *append);
|
|
|
|
|
|
|
|
|
|
|
|
dictionary *yon_dictionary_merge(dictionary *dict1,dictionary *dict2);
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Merge second dictionary into first.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Объединить два словаря в один.
|
|
|
|
|
|
|
|
* @param dict1 Dictionary which other dictionary connects to.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Словарь с которым объединяется другой словарь.
|
|
|
|
|
|
|
|
* @param dict2 Dictionary to connect.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Присоединяемый словарь.
|
|
|
|
|
|
|
|
* @return Type: int
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 if failed, 1 if success.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* 0 при провале, 1 при успехе.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
int yon_dictionary_merge(dictionary *dict1,dictionary *dict2);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_get(dictionary **dict, char *key)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Get dictionary element by key.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Возвращает элемент словаря с ключом.
|
|
|
|
* Возвращает элемент словаря [dict] с ключом [key].
|
|
|
|
* @param dict dictionary link.
|
|
|
|
* Если такого элемента не было обнаружено, возвращается NULL
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* Ссылка на словарь.
|
|
|
|
|
|
|
|
* @param key key of requested dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Ключ запрашиваемого элемента словаря.
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Dictionary element with requested key or NULL.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* "Элемент словаря с разыскиваемым ключом или NULL."
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_get(dictionary **dict, char *key);
|
|
|
|
dictionary *yon_dictionary_get(dictionary **dict, char *key);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_rip(dictionary *dict)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Free dictionary element.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Освобождает элемент словаря.
|
|
|
|
* Вырезает элемент из словаря и возвращает ближайший элемент.
|
|
|
|
* @param dict Dictionary element to free.
|
|
|
|
*/
|
|
|
|
* Освобождаемый элемент списка.
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Closest valid dictionary element.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Ближайший валидный элемент словаря.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_rip(dictionary *dict);
|
|
|
|
dictionary *yon_dictionary_rip(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_dictionary_get_nth(dictionary *dict, int place)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Get dictionary element of specific position.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Получить элемент списка на конкретной позиции.
|
|
|
|
* Возвращает [place]-й элемент словаря [dict]
|
|
|
|
* @param dict First dictionary element.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Первый элемент словаря.
|
|
|
|
|
|
|
|
* @param place Desired dictionary element position.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Желаемая позиция элемента словаря.
|
|
|
|
|
|
|
|
* @return Type: dictionary*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Dictionary element on desired position or NULL.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Элемент словаря на желаемой позиции или NULL.
|
|
|
|
|
|
|
|
*/
|
|
|
|
dictionary *yon_dictionary_get_nth(dictionary *dict, int place);
|
|
|
|
dictionary *yon_dictionary_get_nth(dictionary *dict, int place);
|
|
|
|
|
|
|
|
|
|
|
|
/** void *yon_dictionary_free_all(dictionary *dictionary,void *data_manipulation)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Frees memory of dictionary element.
|
|
|
|
* Frees memory of dictionary [dictionary_to_free].
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Освобождает память элемента словаря.
|
|
|
|
* Освобождает память элемента словаря [dictionary_to_free].
|
|
|
|
* @param dictionary_to_free
|
|
|
|
*/
|
|
|
|
* @return Type: void*
|
|
|
|
|
|
|
|
* Value, freed dictionary element was containing.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Значение, которое содержалось в освобождённом словаре.
|
|
|
|
|
|
|
|
*/
|
|
|
|
void *yon_dictionary_free(dictionary *dictionary_to_free);
|
|
|
|
void *yon_dictionary_free(dictionary *dictionary_to_free);
|
|
|
|
|
|
|
|
|
|
|
|
/** void *yon_dictionary_free_all(dictionary *dictionary,void *data_manipulation)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Frees whole dictionary.
|
|
|
|
* Frees whole [dictionary] and activates [data_manipulation] function if not NULL with [dictionary]->data argument for each dictionary.
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Освобождает память для всех элементов словаря.
|
|
|
|
* Освобождает память для всех элементов словаря [dictionary] и активирует функцию [data_manipulation], если она была передана, с аргументом [dictionary]->data на каждый элемент словаря.
|
|
|
|
* @param dictionary
|
|
|
|
*/
|
|
|
|
* @param data_manipulation Function, activated, if not NULL, for every dictionary element in dictionary.
|
|
|
|
void *yon_dictionary_free_all(dictionary *dictionary,void (data_manipulation)(void*));
|
|
|
|
*
|
|
|
|
|
|
|
|
* Функция, активируемая, если не NULL, для каждого элемента словаря в словаре.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void yon_dictionary_free_all(dictionary *dictionary,void (data_manipulation)(void*));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [[ deprecated ]]
|
|
|
|
|
|
|
|
// dictionary *yon_dictionary_sort(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
[[ deprecated ]]
|
|
|
|
|
|
|
|
dictionary *yon_dictionary_sort(dictionary *dict);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [[__warnattr("Function is yon_dictionary_check_loops() is untested")]];
|
|
|
|
dictionary *yon_dictionary_check_loops(dictionary *target);
|
|
|
|
dictionary *yon_dictionary_check_loops(dictionary *target);
|
|
|
|
|
|
|
|
|
|
|
|
// char functions
|
|
|
|
// char functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Macros for yon_char_divide_search function to get right part from string, freeing left part.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Макросы для функции yon_char_divide_search для извлечения правой части из строки, освобождая левую часть.
|
|
|
|
|
|
|
|
* @param str string
|
|
|
|
|
|
|
|
* @param find string to find
|
|
|
|
|
|
|
|
* @param delete_divider
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define yon_char_divide_search_self(str,find,delete_divider) {char *temp = str; str = yon_char_divide_search(str,find,delete_divider); free(temp);}
|
|
|
|
#define yon_char_divide_search_self(str,find,delete_divider) {char *temp = str; str = yon_char_divide_search(str,find,delete_divider); free(temp);}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief check if string is empty.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Проверить пустая ли строка.
|
|
|
|
|
|
|
|
* @param string
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define yon_char_is_empty(string) !(string&&strcmp(string,""))
|
|
|
|
#define yon_char_is_empty(string) !(string&&strcmp(string,""))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Macros. If string is not empty, returns string, otherwise returns other string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param string String to check. If string is empty, returns other string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param opposite If main shring is empty, returns this string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
*/
|
|
|
|
#define yon_char_return_if_exist(string,opposite) string&&strcmp(string,"")?string:opposite
|
|
|
|
#define yon_char_return_if_exist(string,opposite) string&&strcmp(string,"")?string:opposite
|
|
|
|
|
|
|
|
|
|
|
|
#define yon_char_remove_last_symbol(target,symbol) {if (target[strlen(target)-1]==symbol) target[strlen(target)-1]='\0';}
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Macros. Removes last string symbol.
|
|
|
|
char *yon_char_conenct_if_true();
|
|
|
|
*
|
|
|
|
|
|
|
|
* Макрос. Удаление последнего символа строки.
|
|
|
|
|
|
|
|
* @param string
|
|
|
|
|
|
|
|
* @param symbol If last string symbol is same, removes it, otherwise does nothing.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Если последний символ строки совпадает, он удаляется, иначе ничего не происходит
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define yon_char_remove_last_symbol(string,symbol) {if (string[strlen(string)-1]==symbol) string[strlen(string)-1]='\0';}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Find last symbol in sting.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Найти последний символ в строке.
|
|
|
|
|
|
|
|
* @param find Symbol to find.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Искомый символ.
|
|
|
|
|
|
|
|
* @return Type: int
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The location of the last character being searched for.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Местоположение последнего искомого символа.
|
|
|
|
|
|
|
|
*/
|
|
|
|
int yon_char_find_last(char *source, char find);
|
|
|
|
int yon_char_find_last(char *source, char find);
|
|
|
|
|
|
|
|
|
|
|
|
/**[EN]
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Create new string by combining two strings.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Creates new char string by combining two char strings.
|
|
|
|
* Создать новую строку, состоящую из двух входящих.
|
|
|
|
* [RU]
|
|
|
|
* @param append Appending string.
|
|
|
|
* Создаёт новую строку, состоящую из двух входящих.
|
|
|
|
*
|
|
|
|
|
|
|
|
* Присоединяемая строка.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
* A new allocated string, containing both input strings.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новая выделенная строка, состоящая из обеих входящих строк.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
char *yon_char_append(const char *source, const char *append);
|
|
|
|
char *yon_char_append(const char *source, const char *append);
|
|
|
|
|
|
|
|
|
|
|
|
/**[EN]
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Create new string by appending string with symbol.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Creates new char string by combining two char strings.
|
|
|
|
* Создать новую строку соединением строки и символа
|
|
|
|
* [RU]
|
|
|
|
* @param append Appending symbol.
|
|
|
|
* Создаёт новую строку, состоящую из строки [source]
|
|
|
|
*
|
|
|
|
* с добавлением символа [append] в конец.
|
|
|
|
* Прибавляемый символ.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* A new allocated string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новая выделенная строка.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
char *yon_char_append_c(const char *source, char append);
|
|
|
|
char *yon_char_append_c(const char *source, char append);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Append string with another string, inserting another string between
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Добавляет к строке другую строку, добавляя между ними разделитель.
|
|
|
|
|
|
|
|
* @param target Appending string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Добавляемая строка.
|
|
|
|
|
|
|
|
* @param divider Divider. A string, which divides source string into substrings.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Разделитель. Строка, разделяющая основную строку на подстроки.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* A newly allocated string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новая выделенная строка.
|
|
|
|
|
|
|
|
*/
|
|
|
|
char *yon_char_append_element(char *source,char *target, char *divider);
|
|
|
|
char *yon_char_append_element(char *source,char *target, char *divider);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Remove substring from string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Удалить подстроку из строки.
|
|
|
|
|
|
|
|
* @param target Substring to remove.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Удаляемая подстрока.
|
|
|
|
|
|
|
|
* @param divider Divider. Main string divides into substrings to compare.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* A newly allocated string with reniver substing.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новая выделенная строка с удалённой подстрокой.
|
|
|
|
|
|
|
|
*/
|
|
|
|
char *yon_char_remove_element(char *source,char *target, char *divider);
|
|
|
|
char *yon_char_remove_element(char *source,char *target, char *divider);
|
|
|
|
|
|
|
|
|
|
|
|
/**[EN]
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Copy string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Копировать строку.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* A newly allocated string.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* creates new char string by copying another char.
|
|
|
|
* Новая выделенная строка.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
char *yon_char_new(const char *chr);
|
|
|
|
char *yon_char_new(const char *chr);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_char_unite(const char *source, ...)
|
|
|
|
/**
|
|
|
|
* [En]
|
|
|
|
* @brief Unite multiple strings.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Объединить несколько строк.
|
|
|
|
* Объединяет строку [source] со всеми строками, написанными в [...]. Последний элемент должен быть NULL
|
|
|
|
* @param source First string to unite.
|
|
|
|
*/
|
|
|
|
*
|
|
|
|
|
|
|
|
* Первая объединяемая строка.
|
|
|
|
|
|
|
|
* @param ... Multiple strings, edning with NULL.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Произвольное количество строк, заканчивающееся NULL.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* A newly allocated string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новая выделенная строка.
|
|
|
|
|
|
|
|
*/
|
|
|
|
char *yon_char_unite(const char *source, ...);
|
|
|
|
char *yon_char_unite(const char *source, ...);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_cut(char *source, int size, int startpos)
|
|
|
|
|
|
|
|
* [EN]
|
|
|
|
|
|
|
|
* cuts source string by size length from startpos position.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
char *yon_cut(char *source, int size, int startpos);
|
|
|
|
char *yon_cut(char *source, int size, int startpos);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Check if string begins with substring.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Проверить начинается ли строка с подстроки.
|
|
|
|
|
|
|
|
* @param haystack String to check.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Проверяемая строка.
|
|
|
|
|
|
|
|
* @param needle Substring searched in the beginning of main string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Подстрока, искомая в начале основной строки.
|
|
|
|
|
|
|
|
* @return Type: boolean
|
|
|
|
|
|
|
|
*/
|
|
|
|
int yon_char_check_begins_with(char *haystack, char *needle);
|
|
|
|
int yon_char_check_begins_with(char *haystack, char *needle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Check if string array has string, beginning with substring.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Проверить есть ли в массиве строк строка, начинающаяся с подстроки.
|
|
|
|
|
|
|
|
* @param target String array to check.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Проверяемый массив строк.
|
|
|
|
|
|
|
|
* @param size Pointer to size of string array.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Указатель на размер массива строк
|
|
|
|
|
|
|
|
* @param compare String to search in string array.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Искомая строка.
|
|
|
|
|
|
|
|
* @return Type: char*
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* If substring was found, full string is returned, otherwise, NULL.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Если подстрока была найдена возвращается полная строка, иначе NULL.
|
|
|
|
|
|
|
|
*/
|
|
|
|
char *yon_char_parsed_check_exist_begins_with(char **target, int size, char *compare);
|
|
|
|
char *yon_char_parsed_check_exist_begins_with(char **target, int size, char *compare);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_char_wrap_to_lines(char *target, unsigned int line_count, unsigned int *final_size)
|
|
|
|
/**
|
|
|
|
* [EN]
|
|
|
|
* @brief Split a string into a given number of lines.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* [RU]
|
|
|
|
* Разделить строку на заданное количество строк.
|
|
|
|
* Делит строку [target] на [line_count] частей по пробелу и
|
|
|
|
* @param line_count Number of lines.
|
|
|
|
* возвращает массив строк длиной [final_size]
|
|
|
|
*
|
|
|
|
|
|
|
|
* Количество строк.
|
|
|
|
|
|
|
|
* @param final_size Pointer to return the size of the string array.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Указатель для возврата размера массива строк.
|
|
|
|
|
|
|
|
* @return Type: config_str
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Newly allocated string array with splitted input string.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Новый выделенный массив строк с разделённой входной строкой.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
config_str yon_char_wrap_to_lines(char *target, unsigned int line_count, unsigned int *final_size);
|
|
|
|
config_str yon_char_wrap_to_lines(char *target, unsigned int line_count, unsigned int *final_size);
|
|
|
|
|
|
|
|
|
|
|
|
@ -369,6 +753,14 @@ config_str yon_char_wrap_to_lines(char *target, unsigned int line_count, unsigne
|
|
|
|
* returning left part of divided string and
|
|
|
|
* returning left part of divided string and
|
|
|
|
* inserting right part to source string.
|
|
|
|
* inserting right part to source string.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @brief Divide a sting at position.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param source
|
|
|
|
|
|
|
|
* @param dividepos
|
|
|
|
|
|
|
|
* @return char*
|
|
|
|
|
|
|
|
*/
|
|
|
|
char *yon_char_divide(char *source, int dividepos);
|
|
|
|
char *yon_char_divide(char *source, int dividepos);
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_char_divide_search(char *source, char *dividepos, int delete_divider)
|
|
|
|
/**yon_char_divide_search(char *source, char *dividepos, int delete_divider)
|
|
|
|
@ -672,12 +1064,6 @@ int yon_get_size_get_from_letter(char size);
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
char *yon_size_get_mod(int size);
|
|
|
|
char *yon_size_get_mod(int size);
|
|
|
|
|
|
|
|
|
|
|
|
apps *yon_apps_scan_and_parse_desktops(int *sizef);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void yon_apps_sort(apps *applist, int size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
apps *yon_apps_get_by_name(apps *applist, char *name, int size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**yon_file_path_proceed_spaces(char *path)
|
|
|
|
/**yon_file_path_proceed_spaces(char *path)
|
|
|
|
* [EN]
|
|
|
|
* [EN]
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|