150276Speter#! /bin/sh
250276Speter##############################################################################
3166124Srafan# Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.                #
450276Speter#                                                                            #
550276Speter# Permission is hereby granted, free of charge, to any person obtaining a    #
650276Speter# copy of this software and associated documentation files (the "Software"), #
750276Speter# to deal in the Software without restriction, including without limitation  #
850276Speter# the rights to use, copy, modify, merge, publish, distribute, distribute    #
950276Speter# with modifications, sublicense, and/or sell copies of the Software, and to #
1050276Speter# permit persons to whom the Software is furnished to do so, subject to the  #
1150276Speter# following conditions:                                                      #
1250276Speter#                                                                            #
1350276Speter# The above copyright notice and this permission notice shall be included in #
1450276Speter# all copies or substantial portions of the Software.                        #
1550276Speter#                                                                            #
1650276Speter# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
1750276Speter# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
1850276Speter# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
1950276Speter# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
2050276Speter# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
2150276Speter# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
2250276Speter# DEALINGS IN THE SOFTWARE.                                                  #
2350276Speter#                                                                            #
2450276Speter# Except as contained in this notice, the name(s) of the above copyright     #
2550276Speter# holders shall not be used in advertising or otherwise to promote the sale, #
2650276Speter# use or other dealings in this Software without prior written               #
2750276Speter# authorization.                                                             #
2850276Speter##############################################################################
2950276Speter#
3050276Speter# Author: Thomas E. Dickey <dickey@clark.net> 1997
3150276Speter#
32166124Srafan# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $
3350276Speter#
3450276Speter# Script to generate 'expanded.c', a dummy source that contains functions
3550276Speter# corresponding to complex macros used in this library.  By making functions,
3650276Speter# we simplify analysis and debugging.
3750276Speter
3850276Speterif test $# != 0; then
3950276Speterpreprocessor="$1"
4050276Speterelse
4150276Speterpreprocessor="cc -E"
4250276Speterfi
4350276Spetershift
4450276Speterif test $# != 0 ; then
4550276Speter	preprocessor="$preprocessor $*"
4650276Speterelse
4750276Speter	preprocessor="$preprocessor -DHAVE_CONFIG_H -I. -I../include"
4850276Speterfi
4950276Speter
5050276SpeterTMP=gen$$.c
5150276Spetertrap "rm -f $TMP" 0 1 2 5 15
5250276Speter
5350276Spetercat <<EOF
5450276Speter/* generated by MKexpanded.sh */
5550276Speter#include <curses.priv.h>
5650276Speter#include <term.h>
5766963Speter#if NCURSES_EXPANDED
5850276SpeterEOF
5950276Speter
6050276Spetercat >$TMP <<EOF
6150276Speter#include <ncurses_cfg.h>
6250276Speter#undef NCURSES_EXPANDED /* this probably is set in ncurses_cfg.h */
6350276Speter#include <curses.priv.h>
6450276Speter/* these are names we'd like to see */
6550276Speter#undef ALL_BUT_COLOR
6650276Speter#undef PAIR_NUMBER
6750276Speter#undef TRUE
6850276Speter#undef FALSE
6950276Speter/* this is a marker */
7050276SpeterIGNORE
7176726SpeterNCURSES_EXPORT(void) _nc_toggle_attr_on (attr_t *S, attr_t at)
7250276Speter{
7350276Speter	toggle_attr_on(*S,at);
7450276Speter}
7576726SpeterNCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *S, attr_t at) 
7650276Speter{
7750276Speter	toggle_attr_off(*S,at);
7850276Speter}
7976726SpeterNCURSES_EXPORT(int) _nc_DelCharCost (int count)
8050276Speter{
8150276Speter	return DelCharCost(count);
8250276Speter}
8376726SpeterNCURSES_EXPORT(int) _nc_InsCharCost (int count)
8450276Speter{
8550276Speter	return InsCharCost(count);
8650276Speter}
87166124SrafanNCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T c)
8850276Speter{
8950276Speter	UpdateAttrs(c);
9050276Speter}
9150276SpeterEOF
9250276Speter
9350276Speter$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d'
9450276Speter
9550276Spetercat <<EOF
9650276Speter#else /* ! NCURSES_EXPANDED */
9776726SpeterNCURSES_EXPORT(void) _nc_expanded (void) { }
9850276Speter#endif /* NCURSES_EXPANDED */
9950276SpeterEOF
100