forked from vitrine/wmaker
Restore proplist.c, which was clobbered by mistake during a rebase.
Lessons learned: don't rebase so freely, review commits properly.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "WUtil.h"
|
||||
|
||||
/*
|
||||
* This should be written in Rust whenever va_args support improves.
|
||||
*/
|
||||
WMPropList *WMCreatePLArray(WMPropList * elem, ...)
|
||||
{
|
||||
WMPropList *plist, *nelem;
|
||||
va_list ap;
|
||||
|
||||
plist = WMCreateEmptyPLArray();
|
||||
|
||||
if (!elem)
|
||||
return plist;
|
||||
|
||||
WMAddToPLArray(plist, elem);
|
||||
|
||||
va_start(ap, elem);
|
||||
|
||||
while (1) {
|
||||
nelem = va_arg(ap, WMPropList *);
|
||||
if (!nelem) {
|
||||
va_end(ap);
|
||||
return plist;
|
||||
}
|
||||
WMAddToPLArray(plist, elem);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user