Added external interface to sort a list.
This commit is contained in:
parent
726749cc5b
commit
84c76f52af
|
@ -453,6 +453,21 @@ listsort(self, args)
|
|||
return None;
|
||||
}
|
||||
|
||||
int
|
||||
sortlist(v)
|
||||
object *v;
|
||||
{
|
||||
if (v == NULL || !is_listobject(v)) {
|
||||
err_badcall();
|
||||
return -1;
|
||||
}
|
||||
v = listsort((listobject *)v, (object *)NULL);
|
||||
if (v == NULL)
|
||||
return -1;
|
||||
DECREF(v);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct methodlist list_methods[] = {
|
||||
{"append", listappend},
|
||||
{"insert", listinsert},
|
||||
|
|
Loading…
Reference in New Issue