From 4f4dcf551bb78fcecc89b68f1d95588f8bd718cf Mon Sep 17 00:00:00 2001 From: Stu Black Date: Thu, 23 Oct 2025 15:40:50 -0400 Subject: [PATCH] Restore proplist.c, which was clobbered by mistake during a rebase. Lessons learned: don't rebase so freely, review commits properly. --- WINGs/proplist.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 WINGs/proplist.c diff --git a/WINGs/proplist.c b/WINGs/proplist.c new file mode 100644 index 00000000..4a574cd6 --- /dev/null +++ b/WINGs/proplist.c @@ -0,0 +1,30 @@ +#include + +#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); + } +}