X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2FMKlib_gen.sh;h=3171ed3fa8a5eedc485185c7ae4825f70eb47f58;hp=d22f40024cc2b549ea35e32be44e2edaaeefed3a;hb=9fab8ab6b69130169a6880e63585d83efb1c1722;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8;ds=sidebyside diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh index d22f4002..3171ed3f 100755 --- a/ncurses/base/MKlib_gen.sh +++ b/ncurses/base/MKlib_gen.sh @@ -2,10 +2,10 @@ # # 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.35 2008/11/16 00:19:59 juergen 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"), # @@ -62,7 +62,7 @@ if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi 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" @@ -152,7 +152,7 @@ cat >$ED3 <" print "" } @@ -394,6 +395,7 @@ EOF1 cat >$TMP < +#undef NCURSES_NOMACROS #include DECLARATIONS @@ -404,13 +406,24 @@ sed -n -f $ED1 \ | 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/NCURSES_BOOL/g' \ | $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_//' \ + -e 's/^[ ]*#/#/' \ + -e '/#ident/d' \ + -e '/#line/d' \ | sed -f $ED4