MKlib_gen.sh (66963) | MKlib_gen.sh (76726) |
---|---|
1#!/bin/sh 2# 3# MKlib_gen.sh -- generate sources from curses.h macro definitions 4# | 1#!/bin/sh 2# 3# MKlib_gen.sh -- generate sources from curses.h macro definitions 4# |
5# ($Id: MKlib_gen.sh,v 1.12 2000/07/29 16:30:11 tom Exp $) | 5# ($Id: MKlib_gen.sh,v 1.13 2000/12/10 00:30:25 tom Exp $) |
6# 7# The XSI Curses standard requires all curses entry points to exist as 8# functions, even though many definitions would normally be shadowed 9# by macros. Rather than hand-hack all that code, we actually 10# generate functions from the macros. 11# 12# This script accepts a file of prototypes on standard input. It discards 13# any that don't have a `generated' comment attached. It then parses each --- 207 unchanged lines hidden (view full) --- 221 print call ";" 222 223 if (match($0, "^void")) 224 print "%%returnVoid;" 225 print "}"; 226} 227EOF1 228 | 6# 7# The XSI Curses standard requires all curses entry points to exist as 8# functions, even though many definitions would normally be shadowed 9# by macros. Rather than hand-hack all that code, we actually 10# generate functions from the macros. 11# 12# This script accepts a file of prototypes on standard input. It discards 13# any that don't have a `generated' comment attached. It then parses each --- 207 unchanged lines hidden (view full) --- 221 print call ";" 222 223 if (match($0, "^void")) 224 print "%%returnVoid;" 225 print "}"; 226} 227EOF1 228 |
229sed -n -f $ED1 | sed -f $ED2 \ | 229sed -n -f $ED1 \ 230| sed -e 's/NCURSES_EXPORT(\(.*\)) \(.*\) (\(.*\))/\1 \2(\3)/' \ 231| sed -f $ED2 \ |
230| $AWK -f $AW1 ) \ 231| sed \ 232 -e '/^\([a-z_][a-z_]*\) /s//\1 gen_/' >$TMP 233 $preprocessor $TMP 2>/dev/null \ 234| $AWK ' 235BEGIN { 236 print "/*" 237 print " * DO NOT EDIT THIS FILE BY HAND!" --- 12 unchanged lines hidden (view full) --- 250 print "" 251 } 252/^DECLARATIONS/ {start = 1; next;} 253 {if (start) print $0;} 254' \ 255| sed -f $ED3 \ 256| sed \ 257 -e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \ | 232| $AWK -f $AW1 ) \ 233| sed \ 234 -e '/^\([a-z_][a-z_]*\) /s//\1 gen_/' >$TMP 235 $preprocessor $TMP 2>/dev/null \ 236| $AWK ' 237BEGIN { 238 print "/*" 239 print " * DO NOT EDIT THIS FILE BY HAND!" --- 12 unchanged lines hidden (view full) --- 252 print "" 253 } 254/^DECLARATIONS/ {start = 1; next;} 255 {if (start) print $0;} 256' \ 257| sed -f $ED3 \ 258| sed \ 259 -e 's/^.*T_CALLED.*returnCode( \([a-z].*) \));/ return \1;/' \ |
258 -e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' | 260 -e 's/^.*T_CALLED.*returnCode( \((wmove.*) \));/ return \1;/' \ 261| sed \ 262 -e 's/^\(.*\) \(.*\) (\(.*\))$/NCURSES_EXPORT(\1) \2 (\3)/' |
259 | 263 |