Added new functions

pull/96/head
parent 5269d3a165
commit a1ce64b9ea

@ -170,3 +170,16 @@ void yon_launch(char *command)
{
int ansver = system(command);
}
#define os_name_get_command "sed -En 's/^PRETTY_NAME=[\"]*([^\"]+)[\"]*/\\1/p' /etc/os-release"
char *yon_ubl_get_os_name(){
char *os_name = NULL;
int size;
config_str ret = yon_config_load(os_name_get_command,&size);
if (size){
yon_char_remove_last_symbol(ret[0],'\n');
os_name = yon_char_new(ret[0]);
yon_char_parsed_free(ret,size);
}
return os_name;
}

@ -1693,6 +1693,10 @@ int yon_launch_app_with_arguments(char *command, char *args);
/// @param command Command to execute
void yon_launch(char *command);
/// @brief Get cuurent OS name
/// @return Newly allocated string or NULL
char *yon_ubl_get_os_name();
// // Trash collector functions
// int yon_trash_collector_append(void *pointer, char group_key);

Loading…
Cancel
Save