Files
wmaker/WINGs/proplist.c
T
trurl 4f4dcf551b Restore proplist.c, which was clobbered by mistake during a rebase.
Lessons learned: don't rebase so freely, review commits properly.
2025-10-23 15:40:50 -04:00

31 lines
466 B
C

#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);
}
}