diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-31 14:42:03 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-08 03:52:58 -0600 |
commit | 121994d85648469ea498b52cef83e4609496a7b7 (patch) | |
tree | a06d05b01afd2dab7c3d2734d041acff4db3f362 /libmisc/tests/test_obj_autobox.c.gen | |
parent | c3a0b37bf0229c89bd78b5ddf140188410aa3597 (diff) |
libmisc: obj.h: Use LM_DEFAPPEND() to implement magic LO_BOX()
Diffstat (limited to 'libmisc/tests/test_obj_autobox.c.gen')
-rwxr-xr-x | libmisc/tests/test_obj_autobox.c.gen | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libmisc/tests/test_obj_autobox.c.gen b/libmisc/tests/test_obj_autobox.c.gen new file mode 100755 index 0000000..3cfa3d4 --- /dev/null +++ b/libmisc/tests/test_obj_autobox.c.gen @@ -0,0 +1,17 @@ +#!/bin/sh +# libmisc/tests/test_obj_autobox.c.gen - Generate tests for LO_BOX() +# +# Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-License-Identifier: AGPL-3.0-or-later + +infile=$1 +outfile=$2 + +grep --quiet lo_box_ -- "$infile" + +{ + echo "/* ${outfile} - Generated by \`$*\`. DO NOT EDIT! */" + sed -E 's/lo_box_([a-z0-9_]+)_as_([a-z0-9_]+)\(/LO_BOX(\2, /g' <"$infile" +} >"$outfile" + +! grep -H lo_box_ -- "$outfile" |