Пример #1
0
Файл: ui.c Проект: 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;
}
Пример #2
0
PyObject *py_ped_file_system_type_get_next(PyObject *s, PyObject *args) {
    PyObject *in_fstype = NULL;
    PedFileSystemType *cur = NULL, *next = NULL;
    _ped_FileSystemType *ret = NULL;

    if (!PyArg_ParseTuple(args, "|O!", &_ped_FileSystemType_Type_obj, &in_fstype)) {
        return NULL;
    }

    if (in_fstype) {
        cur = _ped_FileSystemType2PedFileSystemType(in_fstype);
        if (!cur) {
            return NULL;
        }
    }

    next = ped_file_system_type_get_next(cur);
    if (next) {
        ret = PedFileSystemType2_ped_FileSystemType(next);
        return (PyObject *) ret;
    } else {
        PyErr_SetNone(PyExc_IndexError);
        return NULL;
    }
}