Beispiel #1
0
Datei: ui.c Projekt: bcl/parted
static int
init_fs_type_str ()
{
        PedFileSystemType*    walk;
        PedFileSystemAlias*   alias_walk;

        fs_type_list = NULL;

        for (walk = ped_file_system_type_get_next (NULL); walk;
             walk = ped_file_system_type_get_next (walk))
        {
                fs_type_list = str_list_insert (fs_type_list, walk->name);
                if (!fs_type_list)
                        return 0;
        }
        for (alias_walk = ped_file_system_alias_get_next (NULL); alias_walk;
             alias_walk = ped_file_system_alias_get_next (alias_walk))
        {
                fs_type_list = str_list_insert (fs_type_list,
                                                alias_walk->alias);
                if (!fs_type_list)
                        return 0;
        }

        return 1;
}
Beispiel #2
0
char* strListInsert(str_list_t* list, const char* str, size_t index)
{
	char* buf;

	if(str==NULL)
		return(NULL);

	if((buf=strdup(str))==NULL)
		return(NULL);

	return(str_list_insert(list,buf,index));
}
Beispiel #3
0
Datei: ui.c Projekt: bcl/parted
static int
init_disk_type_str ()
{
        PedDiskType*    walk;

        disk_type_list = NULL;

        for (walk = ped_disk_type_get_next (NULL); walk;
             walk = ped_disk_type_get_next (walk))
        {
                disk_type_list = str_list_insert (disk_type_list, walk->name);
                if (!disk_type_list)
                        return 0;
        }

        return 1;
}