Files
wmaker/WINGs/proplist.c
T

31 lines
466 B
C
Raw Normal View History

2001-09-06 14:16:11 +00:00
#include <stdarg.h>
2010-03-17 22:46:19 +01:00
#include "WUtil.h"
/*
* This should be written in Rust whenever va_args support improves.
*/
2009-08-20 00:59:40 +02:00
WMPropList *WMCreatePLArray(WMPropList * elem, ...)
2001-09-06 14:16:11 +00:00
{
2009-08-20 00:59:40 +02:00
WMPropList *plist, *nelem;
va_list ap;
2001-09-06 14:16:11 +00:00
plist = WMCreateEmptyPLArray();
2001-09-06 14:16:11 +00:00
2009-08-20 00:59:40 +02:00
if (!elem)
return plist;
2001-09-06 14:16:11 +00:00
WMAddToPLArray(plist, elem);
2001-09-06 14:16:11 +00:00
2009-08-20 00:59:40 +02:00
va_start(ap, elem);
2001-09-06 14:16:11 +00:00
2009-08-20 00:59:40 +02:00
while (1) {
nelem = va_arg(ap, WMPropList *);
if (!nelem) {
va_end(ap);
return plist;
}
WMAddToPLArray(plist, elem);
2013-01-31 22:44:28 +01:00
}
2010-03-17 22:46:19 +01:00
}