Files
RedBear-OS/recipes/shells/zsh/source/Src/Modules/errnames2.awk
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

43 lines
1.2 KiB
Awk

# Edited version of Src/signames2.awk.
#
# {g,n}awk script to generate errnames.c
# This version relies on the previous output of the preprocessor
# on sigtmp.c, sigtmp.out, which is in turn generated by errnames1.awk.
#
# NB: On SunOS 4.1.3 - user-functions don\'t work properly, also \" problems
# Without 0 + hacks some nawks compare numbers as strings
#
/^XXNAMES XXE[A-Z0-9]*[\t ][\t ]*[1-9][0-9]*/ {
eindex = index($0, "E")
etail = substr($0, 11, 80)
split(etail, tmp)
enam = tmp[1]
enum = tmp[2]
if (errname[enum] == "") {
errname[enum] = enam
if (0 + max < 0 + enum && enum < 1024)
max = enum
}
}
END {
ps = "%s"
printf "/** errnames.c **/\n"
printf "/** architecture-customized errnames.c for zsh **/\n"
printf "\n"
printf "#define ERRCOUNT\t%d\n", max
printf "\n"
printf "#include %csystem.mdh%c\n", 34, 34
printf "\n"
printf "/**/\n"
printf "const char *sys_errnames[ERRCOUNT+1] = {\n"
for (i = 1; i <= 0 + max; i++)
if (errname[i] == "")
printf("\t%cE%d%c,\n", 34, i, 34)
else
printf("\t%c%s%c,\n", 34, errname[i], 34)
print "\tNULL"
print "};"
}