#
# MKlib_gen.sh -- generate sources from curses.h macro definitions
#
-# ($Id: MKlib_gen.sh,v 1.24 2005/06/11 19:26:05 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.30 2008/01/05 23:21:10 tom Exp $)
#
##############################################################################
-# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi
-preprocessor="$1 -I../include"
+preprocessor="$1 -DNCURSES_INTERNALS -I../include"
AWK="$2"
USE="$3"
print " * pull most of the rest of the library into your link image."
}
print " */"
+ print "#define NCURSES_ATTR_T int"
print "#include <curses.priv.h>"
print ""
}
cat >$TMP <<EOF
#include <ncurses_cfg.h>
+#undef NCURSES_NOMACROS
#include <curses.h>
DECLARATIONS
| sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \
| sed -f $ED2 \
| $AWK -f $AW1 using=$USE \
-| sed -e 's/^\([a-z_][a-z_]*[ *]*\)/\1 gen_/' -e 's/ / /g' >>$TMP
+| sed \
+ -e 's/ [ ]*$//g' \
+ -e 's/^\([a-zA-Z_][a-zA-Z_]*[ *]*\)/\1 gen_/' \
+ -e 's/gen_$//' \
+ -e 's/ / /g' >>$TMP
$preprocessor $TMP 2>/dev/null \
-| sed -e 's/ / /g' -e 's/^ //' \
+| sed \
+ -e 's/ / /g' \
+ -e 's/^ //' \
+ -e 's/^_Bool/bool/' \
| $AWK -f $AW2 \
| sed -f $ED3 \
| sed \
-e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \
-e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' \
+ -e 's/gen_//' \
| sed -f $ED4