qulogic/libgnt
Clone
Summary
Browse
Changes
Graph
propagate from branch 'im.pidgin.pidgin' (head 06be913b2c7df4feaa75837ba472e6be1c39c89d)
next.minor
2007-11-28, Sadrul Habib Chowdhury
5ba25929683e
propagate from branch 'im.pidgin.pidgin' (head 06be913b2c7df4feaa75837ba472e6be1c39c89d)
to branch 'im.pidgin.pidgin.next.minor' (head 6175a275ef50d5cad497e8b7f43845293b26f091)
#include
"common.h"
PyObject
*
create_pyobject_from_string_list
(
GList
*
list
)
{
PyObject
*
py_list
;
if
(
list
==
NULL
)
{
Py_INCREF
(
Py_None
);
return
Py_None
;
}
if
((
py_list
=
PyList_New
(
0
))
==
NULL
)
{
g_list_foreach
(
list
,
(
GFunc
)
g_free
,
NULL
);
g_list_free
(
list
);
return
NULL
;
}
while
(
list
)
{
PyObject
*
obj
=
PyString_FromString
(
list
->
data
);
PyList_Append
(
py_list
,
obj
);
Py_DECREF
(
obj
);
g_free
(
list
->
data
);
list
=
g_list_delete_link
(
list
,
list
);
}
return
py_list
;
}