#
# MKlib_gen.sh -- generate sources from curses.h macro definitions
#
-# ($Id: MKlib_gen.sh,v 1.56 2017/01/07 16:02:47 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.62 2018/06/09 19:27:00 tom Exp $)
#
##############################################################################
-# Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2017,2018 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"), #
AW1=awk1_${PID}.awk
AW2=awk2_${PID}.awk
TMP=gen__${PID}.c
-trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 5 15
+trap "rm -f $ED1 $ED2 $ED3 $ED4 $AW1 $AW2 $TMP" 0 1 2 3 15
ALL=$USE
if test "$USE" = implemented ; then
cat >$ED1 <<EOF1
/^extern.*implemented/{
h
+ s/GCC_DEPRECATED([^)]*)//
s/NCURSES_SP_NAME(\([^)]*\))/NCURSES_SP_NAME___\1/
h
s/^.*implemented:\([^ *]*\).*/P_POUNDCif_USE_\1_SUPPORT/p
break;
}
}
+ if (using == "implemented") {
+ printf "#undef %s\n", $myfunc;
+ }
print $0;
print "{";
argcount = 1;
dotrace = 0;
}
+ do_getstr = 0;
+ if ($myfunc ~ /get[n]?str/) {
+ do_getstr = 1;
+ }
+
call = "@@T((T_CALLED(\""
args = ""
comma = ""
call = call "%s"
} else if (pointer) {
if ( argtype == "char" ) {
- call = call "%s"
+ if (do_getstr) {
+ call = call "%p"
+ } else {
+ call = call "%s"
+ }
comma = comma "_nc_visbuf2(" num ","
pointer = 0;
} else {
call = call ")); "
if (dotrace)
- printf "%s", call
+ printf "%s\n\t@@", call
if (match($0, "^void")) {
call = ""
cat >$AW2 <<EOF1
BEGIN {
- printf "/* This file was generated by $0 */\n"
+ printf "/* This file was generated by $0 $USE */\n"
print ""
print "/*"
print " * DO NOT EDIT THIS FILE BY HAND!"
print ""
print "#include <curses.priv.h>"
print ""
- print "#undef vw_scanw"
- print "#undef vwscanw"
- print ""
- print "#undef vw_printw"
- print "#undef vwprintw"
}
/^DECLARATIONS/ {start = 1; next;}
{