Commit 0083c904 by Bruce Korb

These files are being moved from the contrib/fixinc directory.

They have been modified somewhat to work in the new environment.

From-SVN: r23125
parent 162bc98d
# Makefile for GNU C++ compiler.
# Copyright (C) 1987, 88, 90-5, 1998 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#GNU CC is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with GNU CC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston, MA 02111-1307, USA.
# The makefile built from this file lives in the fixinc subdirectory.
# Its purpose is to build the any-platforms fixinc.sh script.
CFLAGS = -g
CC = @CC@
SHELL = /bin/sh
target=@target@
# Directory where sources are, from where we are.
srcdir = @srcdir@
VPATH = @srcdir@
# End of variables for you to override.
default : gen
# Now figure out from those variables how to compile and link.
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order.
INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
# The only suffixes we want for implicit rules are .c and .o.
.SUFFIXES:
.SUFFIXES: .c .o
#
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
##
## Makefile for constructing the "best" include fixer we can
##
## $Id: Makefile.in,v 1.2 1998/12/16 21:18:54 law Exp $
##
## # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
OBJ = fixincl.o server.o regex.o
HDR = server.h regex.h
SH_TARGET = inclhack.sh fixincl.sh
BIN_TARGET = fixincl
AG_TEXT = $(SH_TARGET) fixincl.x \
inclhack.def inclhack.tpl hackshell.tpl fixincl.tpl
TARGETS = $(SH_TARGET) $(BIN_TARGET)
all : $(TARGETS)
sh : $(SH_TARGET)
gen : $(SH_TARGET) fixincl.x
$(OBJ): $(HDR)
fixincl: $(OBJ)
@echo $(CC) -o $@ $(OBJ) $(LIB) ; \
if $(CC) -o $@ $(OBJ) $(LIB) ; then : ; else \
rm -f $@ ; (echo "#! /bin/sh" ; echo exit 1 ) > $@ ; \
chmod 777 $@ ; fi
regex.o: regex.c
-$(CC) $(CFLAGS) -DSTDC_HEADERS=1 -c regex.c
fixincl.o : fixincl.x fixincl.c
server.o : server.c server.h
fixincl.x: fixincl.tpl inclhack.def
@if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen -T fixincl.tpl -b fixincl inclhack.def ; \
autogen -T $(srcdir)/fixincl.tpl -b fixincl \
$(srcdir)/inclhack.def ; \
else echo You need to install autogen ; \
$(CP) $(srcdir)/$@ . ; fi
inclhack.sh: inclhack.def inclhack.tpl hackshell.tpl
@if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen inclhack.def ; \
autogen inclhack.def ; \
else echo You need to install autogen ; \
$(CP) $(srcdir)/$@ . ; fi
fixincl.sh: inclhack.def inclhack.tpl
@if ( autogen --help > /dev/null 2>&1 ) ; then \
echo autogen -DPROGRAM=1 -b fixincl inclhack.def ; \
autogen -DPROGRAM=1 -b fixincl inclhack.def ; touch $@ ; \
else echo You need to install autogen ; \
$(CP) $(srcdir)/$@ . ; fi
clean:
rm -f *.o $(TARGETS) fixincl.x
# Ensure all the targets are built. If the program "fixincl"
# failed to compile, link or load, then we install the
# "inclhack.sh" script. Otherwise, we install that program
# plus the wrapper script, "fixincl.sh".
#
install: $(TARGETS)
@rm -f ../fixinc.sh ; \
if ( ./fixincl -v > /dev/null 2>&1 ) ; then \
echo cp fixincl.sh ../fixinc.sh ; \
cp fixincl.sh ../fixinc.sh ; \
chmod 555 ../fixinc.sh ; \
rm -f ../fixincl ; \
echo cp fixincl .. ; \
cp fixincl .. ; \
chmod 555 ../fixincl ; \
else \
echo cp inclhack.sh ../fixinc.sh ; \
cp inclhack.sh ../fixinc.sh ; \
fi
#!/bin/sh
#
# modified for dgux by hassey@dg-rtp.dg.com based on
#
# fixinc.svr4 written by Ron Guilmette (rfg@ncd.com).
#
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#
# See README-fixinc for more information.
# Directory containing the original header files.
INPUT=${2-${INPUT-/usr/include}}
# Fail if no arg to specify a directory for the output.
if [ x$1 = x ]
then echo fixincludes: no output directory specified
exit 1
fi
# Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
ORIG_DIR=`pwd`
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case $LIB in
/*)
;;
*)
cd $LIB; LIB=`${PWDCMD-pwd}`
;;
esac
echo 'Building fixincludes in ' ${LIB}
# Determine whether this filesystem has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>/dev/null; then
rm -f $LIB/ShouldNotExist
LINKS=true
else
LINKS=false
fi
echo 'Making directories:'
cd ${INPUT}
if $LINKS; then
files=`ls -LR | sed -n s/:$//p`
else
files=`find . -type d -print | sed '/^.$/d'`
fi
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
then mkdir $LIB/$file
fi
done
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="${INPUT} ${LIB}"
if $LINKS; then
echo 'Making internal symbolic directory links'
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if [ "$dest" ]; then
cwd=`pwd`
# In case $dest is relative, get to $file's dir first.
cd ${INPUT}
cd `echo ./$file | sed -n 's&[^/]*$&&p'`
# Check that the target directory exists.
# Redirections changed to avoid bug in sh on Ultrix.
(cd $dest) > /dev/null 2>&1
if [ $? = 0 ]; then
cd $dest
# X gets the dir that the link actually leads to.
x=`pwd`
# If link leads back into ${INPUT},
# make a similar link here.
if expr $x : "${INPUT}/.*" > /dev/null; then
# Y gets the actual target dir name, relative to ${INPUT}.
y=`echo $x | sed -n "s&${INPUT}/&&p"`
# DOTS is the relative path from ${LIB}/$file's dir back to ${LIB}.
dots=`echo "$file" |
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
echo $file '->' $dots$y ': Making link'
rm -fr ${LIB}/$file > /dev/null 2>&1
ln -s $dots$y ${LIB}/$file > /dev/null 2>&1
else
# If the link is to outside ${INPUT},
# treat this directory as if it actually contained the files.
# This line used to have $dest instead of $x.
# $dest seemed to be wrong for links found in subdirectories
# of ${INPUT}. Does this change break anything?
treetops="$treetops $x ${LIB}/$file"
fi
fi
cd $cwd
fi
done
fi
# Completely replace <_int_varargs.h> with a file that defines
# va_list and gnuc_va_list
file=_int_varargs.h
if [ -r ${INPUT}/$file ]; then
echo Replacing $file
cat > ${LIB}/$file << EOF
/* This file was generated by fixinc.dgux. */
#ifndef __INT_VARARGS_H
#define __INT_VARARGS_H
#if defined(__m88k__) && defined (__DGUX__)
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
typedef struct
{
int __va_arg; /* argument number */
int *__va_stk; /* start of args passed on stack */
int *__va_reg; /* start of args passed in regs */
} __gnuc_va_list;
#endif /* not __GNUC_VA_LIST */
#endif /* 88k && dgux */
#ifndef _VA_LIST_
#define _VA_LIST_
typedef __gnuc_va_list va_list;
#endif /* _VA_LIST_ */
#endif /* __INT_VARARGS_H */
EOF
chmod a+r ${LIB}/$file
fi
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
rmdir $LIB/$file > /dev/null 2>&1
done
if $LINKS; then
echo 'Making internal symbolic non-directory links'
cd ${INPUT}
files=`find . -type l -print`
for file in $files; do
dest=`ls -ld $file | sed -n 's/.*-> //p'`
if expr "$dest" : '[^/].*' > /dev/null; then
target=${LIB}/`echo file | sed "s|[^/]*\$|$dest|"`
if [ -f $target ]; then
ln -s $dest ${LIB}/$file >/dev/null 2>&1
fi
fi
done
fi
cd ${ORIG_DIR}
exit 0
#! /bin/sh
# Install modified versions of certain problematic Irix include files.
# If possible, create a wrapper (see fixinc.wrap) instead of copying files.
#
# Copyright (C) 1997 Free Software Foundation, Inc.
# Contributed by Brendan Kehoe (brendan@cygnus.com).
#
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# See README-fixinc for more information.
# Directory containing the original header files.
INPUT=${2-${INPUT-/usr/include}}
# Fail if no arg to specify a directory for the output.
if [ x$1 = x ]
then echo fixincludes: no output directory specified
exit 1
fi
# Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
ORIG_DIR=`pwd`
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case $LIB in
/*)
;;
*)
LIB=$ORIG_DIR/$LIB
;;
esac
echo 'Building fixincludes in ' ${LIB}
#
# Note: For Irix, we deliberately don't try to create the directory trees,
# since we only modify math.h, limits.h and unistd.h. If we
# ADD ANY OTHERS, the "Making directories:" and symlinks code from
# fixinc.svr4 may have to go back in.
# This math.h fix is copied from fixinc.wrap. We want to avoid copying
# math.h because both math.h and stdlib.h have a declaration for initstate,
# and this declaration changed between Irix 6.2 and Irix 6.3. If we copy this
# file, then the same toolchain can't be shared between 6.2 and 6.3+.
# Some math.h files define struct exception, which conflicts with
# the class exception defined in the C++ file std/stdexcept.h. We
# redefine it to __math_exception. This is not a great fix, but I
# haven't been able to think of anything better.
file=math.h
if [ -r $INPUT/$file ]; then
echo Checking $INPUT/$file
if grep 'struct exception' $INPUT/$file >/dev/null
then
echo Fixed $file
rm -f $LIB/$file
cat <<'__EOF__' >$LIB/$file
#ifndef _MATH_H_WRAPPER
#ifdef __cplusplus
# define exception __math_exception
#endif
#include_next <math.h>
#ifdef __cplusplus
# undef exception
#endif
#define _MATH_H_WRAPPER
#endif /* _MATH_H_WRAPPER */
__EOF__
# Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
# so that if #include_next gets another instance of the wrapper,
# this will follow the #include_next chain until we arrive at
# the real <math.h>.
chmod a+r $LIB/$file
fi
fi
# Avoid the definition of the bool type in curses.h when using
# g++, since it's now an official type in the C++ language.
# This is also from fixinc.wrap.
file=curses.h
if [ -r $INPUT/$file ]; then
echo Checking $INPUT/$file
w='[ ]'
if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
then
echo Fixed $file
rm -f $LIB/$file
cat <<'__EOF__' >$LIB/$file
#ifndef _CURSES_H_WRAPPER
#ifdef __cplusplus
# define bool __curses_bool_t
#endif
#include_next <curses.h>
#ifdef __cplusplus
# undef bool
#endif
#define _CURSES_H_WRAPPER
#endif /* _CURSES_H_WRAPPER */
__EOF__
# Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
# so that if #include_next gets another instance of the wrapper,
# this will follow the #include_next chain until we arrive at
# the real <curses.h>.
chmod a+r $LIB/$file
fi
fi
# In limits.h, put #ifndefs around things that are supposed to be defined
# in float.h to avoid redefinition errors if float.h is included first.
file=limits.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
sed -e '/[ ]FLT_MIN[ ]/i\
#ifndef FLT_MIN
'\
-e '/[ ]FLT_MIN[ ]/a\
#endif
'\
-e '/[ ]FLT_MAX[ ]/i\
#ifndef FLT_MAX
'\
-e '/[ ]FLT_MAX[ ]/a\
#endif
'\
-e '/[ ]FLT_DIG[ ]/i\
#ifndef FLT_DIG
'\
-e '/[ ]FLT_DIG[ ]/a\
#endif
'\
-e '/[ ]DBL_MIN[ ]/i\
#ifndef DBL_MIN
'\
-e '/[ ]DBL_MIN[ ]/a\
#endif
'\
-e '/[ ]DBL_MAX[ ]/i\
#ifndef DBL_MAX
'\
-e '/[ ]DBL_MAX[ ]/a\
#endif
'\
-e '/[ ]DBL_DIG[ ]/i\
#ifndef DBL_DIG
'\
-e '/[ ]DBL_DIG[ ]/a\
#endif
' $file_to_fix > /tmp/$base
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
true
else
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
fi
rm -f /tmp/$base
fi
# The Irix unistd.h will introduce a call to __vfork in its libc, but the
# function is never actually prototyped.
file=unistd.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
sed -e '/__vfork/i\
extern pid_t __vfork(void);'\
$file_to_fix > /tmp/$base
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
true
else
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
fi
rm -f /tmp/$base
fi
exit 0
#! /bin/sh
# Install modified versions of certain ANSI-incompatible
# native Sequent DYNIX/ptx System V Release 3.2 system include files.
# Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
# Contributed by Bill Burton <billb@progress.com>
# Portions adapted from fixinc.svr4 and fixincludes.
#
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# This script munges the native include files provided with DYNIX/ptx
# so as to remove things which are violations of the ANSI C standard.
# This is done by first running fixinc.svr4 which does most of the
# work. A few includes have fixes made to them afterwards by this
# script. Once munged, the resulting new system include files are
# placed in a directory that GNU C will search *before* searching the
# /usr/include directory. This script should work properly for most
# DYNIX/ptx systems. For other types of systems, you should use the
# `fixincludes' script instead.
#
# See README-fixinc for more information.
# Directory containing the original header files.
INPUT=${2-${INPUT-/usr/include}}
# Fail if no arg to specify a directory for the output.
if [ x$1 = x ]
then echo fixincludes: no output directory specified
exit 1
fi
# Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
ORIG_DIR=`pwd`
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case $LIB in
/*)
;;
*)
LIB=$ORIG_DIR/$LIB
;;
esac
echo 'Running fixinc.svr4'
# DYNIX/ptx has dirname so this is no problem
`dirname $0`/fixinc.svr4 $*
echo 'Finished fixinc.svr4'
echo 'Building fixincludes in ' ${LIB}
# Copied from fixincludes.
# Don't use or define the name va_list in stdio.h.
# This is for ANSI and also to interoperate properly with gcc's varargs.h.
file=stdio.h
if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
chmod +w ${LIB}/$file 2>/dev/null
chmod a+r ${LIB}/$file 2>/dev/null
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, use of va_list
# Arrange for stdio.h to use stdarg.h to define __gnuc_va_list
(echo "#define __need___va_list"
echo "#include <stdarg.h>") > ${LIB}/${file}.sed
# Use __gnuc_va_list in arg types in place of va_list.
# On 386BSD use __gnuc_va_list instead of _VA_LIST_. We're hoping the
# trailing parentheses and semicolon save all other systems from this.
# Define __va_list__ (something harmless and unused) instead of va_list.
# Don't claim to have defined va_list.
sed -e 's@ va_list @ __gnuc_va_list @' \
-e 's@ va_list)@ __gnuc_va_list)@' \
-e 's@ _VA_LIST_));@ __gnuc_va_list));@' \
-e 's@ va_list@ __va_list__@' \
-e 's@\*va_list@*__va_list__@' \
-e 's@ __va_list)@ __gnuc_va_list)@' \
-e 's@_NEED___VA_LIST@_NEED___Va_LIST@' \
-e 's@VA_LIST@DUMMY_VA_LIST@' \
-e 's@_NEED___Va_LIST@_NEED___VA_LIST@' \
${LIB}/$file >> ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
rm -f ${LIB}/$file
fi
fi
# In pwd.h, PTX 1.x needs stdio.h included since FILE * was added in a
# prototype later on in the file.
file=pwd.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep stdio $file_to_fix > /dev/null; then
true
else
sed -e '/#include <sys\/types\.h>/a\
\
#if defined(__STDC__) || defined(__cplusplus)\
#include <stdio.h>\
#endif /* __STDC__ */
' \
$file_to_fix > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
echo Fixed $file_to_fix
fi
fi
# Copied from fixincludes.
# math.h puts the declaration of matherr before the definition
# of struct exception, so the prototype (added by fixproto) causes havoc.
file=math.h
if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
chmod +w ${LIB}/$file 2>/dev/null
chmod a+r ${LIB}/$file 2>/dev/null
fi
if [ -r ${LIB}/$file ]; then
echo Fixing $file, matherr declaration
sed -e '/^struct exception/,$b' \
-e '/matherr/i\
struct exception;
'\
${LIB}/$file > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
rm -f ${LIB}/$file
fi
fi
# In netinet/in.h, the network byte swapping asm functions supported by the
# native cc compiler on PTX 1.x and 2.x is not supported in gcc. Instead,
# include <sys/byteorder.h> written out by the fixinc.svr4 script which has
# these same routines written in an asm format supported by gcc.
file=netinet/in.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep __GNUC__ $file_to_fix > /dev/null; then
true
else
sed -e '/#define NETSWAP/a\
\
#if defined (__GNUC__) || defined (__GNUG__)\
#include <sys/byteorder.h>\
#else /* not __GNUC__ */
' \
-e '/#endif[ ]*\/\* NETSWAP \*\//i\
#endif /* not __GNUC__ */
' \
$file_to_fix > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
echo Fixed $file_to_fix
fi
fi
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction
# on the P5. This is not used by anything else so we ifdef it out.
file=sys/mc_param.h
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep __GNUC__ $file_to_fix > /dev/null; then
true
else
sed -e '/__asm/,/}/{
/__asm/i\
#if !defined (__GNUC__) && !defined (__GNUG__)
/}/a\
#endif
}' \
$file_to_fix > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
echo Fixed $file_to_fix
fi
fi
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction
# on the P5. This is not used by anything else so we ifdef it out.
file=sys/mc_param.h
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
if grep __GNUC__ $file_to_fix > /dev/null; then
true
else
sed -e '/__asm/,/}/{
/__asm/i\
#if !defined (__GNUC__) && !defined (__GNUG__)
/}/a\
#endif
}' \
$file_to_fix > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
echo Fixed $file_to_fix
fi
fi
exit 0
#! sh
#
# fixinc.winnt -- Install modified versions of Windows NT system include
# files.
#
# Based on fixinc.sco script by Ian Lance Taylor (ian@airs.com)).
# Modifications by Douglas Rupp (drupp@cs.washington.edu)
#
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# This script munges the native include files provided with Windows NT
# 3.5 SDK systems so as to provide a reasonable namespace when
# compiling with gcc. The header files by default do not
# provide many essential definitions and declarations if
# __STDC__ is 1. This script modifies the header files to check
# for __STRICT_ANSI__ being defined instead. Once munged, the
# resulting new system include files are placed in a directory
# that GNU C will search *before* searching the Include
# directory.
#
# See README-fixinc for more information.
ORIG_DIR=`pwd`
# Directory containing the original header files.
cd $2; SEDFILE=`${PWDCMD-pwd}`/fixinc-nt.sed
echo $SEDFILE
if [ ! -f $SEDFILE ]
then echo fixincludes: sed script 'fixinc-nt.sed' not found
exit 1
fi
echo 'Using sed script: ' ${SEDFILE}
cd $ORIG_DIR
INPUT=${INCLUDE}
echo 'Using the Include environment variable to find header files to fix'
# Fail if no arg to specify a directory for the output.
if [ x$1 = x ]
then echo fixincludes: no output directory specified
exit 1
fi
# Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
ORIG_DIR=`pwd`
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case $LIB in
/*)
;;
*)
cd $LIB; LIB=`${PWDCMD-pwd}`
;;
esac
echo 'Building fixincludes in ' ${LIB}
# Determine whether this filesystem has symbolic links.
if ln -s X $LIB/ShouldNotExist 2>NUL; then
rm -f $LIB/ShouldNotExist
LINKS=true
else
LINKS=false
fi
echo 'Making directories:'
cd ${INPUT}
if $LINKS; then
files=`ls -LR | sed -n s/:$//p`
else
files=`find . -type d -print | sed '/^.$/d'`
fi
for file in $files; do
rm -rf $LIB/$file
if [ ! -d $LIB/$file ]
then mkdir $LIB/$file
fi
done
# treetops gets an alternating list
# of old directories to copy
# and the new directories to copy to.
treetops="${INPUT} ${LIB}"
set - $treetops
while [ $# != 0 ]; do
# $1 is an old directory to copy, and $2 is the new directory to copy to.
echo "Finding header files in $1:"
cd ${INPUT}
cd $1
files=`find . -name '*.[hH]' -type f -print`
echo 'Checking header files:'
for file in $files; do
echo $file
if egrep "!__STDC__" $file >NUL; then
if [ -r $file ]; then
cp $file $2/$file >NUL 2>&1 || echo "Can't copy $file"
chmod +w,a+r $2/$file
# The following have been removed from the sed command below
# because it is more useful to leave these things in.
# The only reason to remove them was for -pedantic,
# which isn't much of a reason. -- rms.
# /^[ ]*#[ ]*ident/d
sed -e '
s/!__STDC__/!defined (__STRICT_ANSI__)/g
' $2/$file > $2/$file.sed
mv $2/$file.sed $2/$file
if cmp $file $2/$file >NUL 2>&1; then
rm $2/$file
else
echo Fixed $file
fi
fi
fi
done
shift; shift
done
# Fix first broken decl of getcwd present on some svr4 systems.
file=direct.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
sed -e 's/getcwd(char \*, int)/getcwd(char *, size_t)/' $file_to_fix > /tmp/$base
if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \
true
else
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
fi
rm -f /tmp/$base
fi
file=rpcndr.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
sed -e 's/Format\[\]/Format\[1\]/' $file_to_fix > /tmp/$base
if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \
true
else
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
fi
rm -f /tmp/$base
fi
file=winnt.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
file_to_fix=${LIB}/$file
else
if [ -r ${INPUT}/$file ]; then
file_to_fix=${INPUT}/$file
else
file_to_fix=""
fi
fi
if [ \! -z "$file_to_fix" ]; then
echo Checking $file_to_fix
sed -e '
s/^#if !defined (__cplusplus)/#if 0/
s/^#define DECLSPEC_IMPORT __declspec(dllimport)/#define DECLSPEC_IMPORT/
' $file_to_fix > /tmp/$base
if cmp $file_to_fix /tmp/$base >NUL 2>&1; then \
true
else
echo Fixed $file_to_fix
rm -f ${LIB}/$file
cp /tmp/$base ${LIB}/$file
chmod a+r ${LIB}/$file
fi
rm -f /tmp/$base
fi
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
for file in $files; do
rmdir $LIB/$file > NUL 2>&1
done
exit 0
#! /bin/sh
# Create wrappers for include files instead of replacing them.
#
# This script is designed for systems whose include files can be fixed
# by creating small wrappers around them.
# An advantage of this method is that if the system include files are changed
# (e.g. by OS upgrade), you need not re-run fixincludes.
#
# See README-fixinc for more information.
# Directory containing the original header files.
# (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
INPUT=${2-${INPUT-/usr/include}}
# Directory in which to store the results.
LIB=${1?"fixincludes: output directory not specified"}
# Make sure it exists.
if [ ! -d $LIB ]; then
mkdir $LIB || exit 1
fi
echo Building fixed headers in ${LIB}
# Some math.h files define struct exception, which conflicts with
# the class exception defined in the C++ file std/stdexcept.h. We
# redefine it to __math_exception. This is not a great fix, but I
# haven't been able to think of anything better.
file=math.h
if [ -r $INPUT/$file ]; then
echo Checking $INPUT/$file
if grep 'struct exception' $INPUT/$file >/dev/null
then
echo Fixed $file
rm -f $LIB/$file
cat <<'__EOF__' >$LIB/$file
#ifndef _MATH_H_WRAPPER
#ifdef __cplusplus
# define exception __math_exception
#endif
#include_next <math.h>
#ifdef __cplusplus
# undef exception
#endif
#define _MATH_H_WRAPPER
#endif /* _MATH_H_WRAPPER */
__EOF__
# Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
# so that if #include_next gets another instance of the wrapper,
# this will follow the #include_next chain until we arrive at
# the real <math.h>.
chmod a+r $LIB/$file
fi
fi
# Avoid the definition of the bool type in the Solaris 2.x curses.h when using
# g++, since it's now an official type in the C++ language.
file=curses.h
if [ -r $INPUT/$file ]; then
echo Checking $INPUT/$file
w='[ ]'
if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
then
echo Fixed $file
rm -f $LIB/$file
cat <<'__EOF__' >$LIB/$file
#ifndef _CURSES_H_WRAPPER
#ifdef __cplusplus
# define bool __curses_bool_t
#endif
#include_next <curses.h>
#ifdef __cplusplus
# undef bool
#endif
#define _CURSES_H_WRAPPER
#endif /* _CURSES_H_WRAPPER */
__EOF__
# Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
# so that if #include_next gets another instance of the wrapper,
# this will follow the #include_next chain until we arrive at
# the real <curses.h>.
chmod a+r $LIB/$file
fi
fi
exit 0
[= autogen template -*- Mode: C -*-
x =]
/*
[= _eval "# * " _DNE =]
*
* Install modified versions of certain ANSI-incompatible system header
* files which are fixed to work correctly with ANSI C and placed in a
* directory that GNU C will search.
*
* This script contains [=_eval fix _hilim 1 +=] fixup scripts.
*
* See README-fixinc for more information.
*
[=_eval inclhack "# * " _gpl=]
*[=
_FOR fix =]
*
* Description [=_eval _index 1 + "#%3d -" _printf=] [=hackname _Cap=] fix
*/
tSCC z[=hackname _cap=]Name[] =
[=hackname _cap _str=];
/*
* File name selection pattern
*/[=
_IF files _exist=]
tSCC z[=hackname _cap=]List[] =[=
_FOR files=]
"|" [=files _str=][=
/files=] "|";[=
_ELSE =]
#define z[=hackname _cap=]List (char*)NULL[=
_ENDIF "files _exist" =]
/*
* Machine/OS name selection pattern
*/[=
_IF mach _exist=]
tSCC* apz[=hackname _cap=]Machs[] = {[=
_FOR mach =]
[=mach _str=],[=
/mach=]
(const char*)NULL };[=
_ELSE =]
#define apz[=hackname _cap=]Machs (const char**)NULL[=
_ENDIF "files _exist" =][=
_IF exesel _exist=]
/*
* content selection pattern
*/[=
_FOR exesel =]
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
[=exesel _str=];[=
/exesel =][=
_ELIF select _exist=]
/*
* content selection pattern
*/[=
_FOR select =]
tSCC z[=hackname _cap=]Select[=_eval _index=][] =
[=select _str=];[=
/select =][=
_ENDIF =][=
_IF bypass _exist=]
/*
* content bypass pattern
*/[=
_FOR bypass =]
tSCC z[=hackname _cap=]Bypass[=_eval _index=][] =
[=bypass _str=];[=
/bypass =][=
_ENDIF =][=
_IF test _exist=]
/*
* content test pattern. A shell will deal with it later.
*/[=
_FOR test =]
tSCC z[=hackname _cap=]Test[=_eval _index=][] =
[=test _str=];[=
/test =][=
_ENDIF =][=
_IF exesel _exist select _exist bypass _exist test _exist | | |
=]
#define [=hackname _up =]_TEST_CT [=
_IF exesel _exist =][=
_eval test _count bypass _count exesel _count + + =][=
_ELSE =][=
_eval test _count bypass _count select _count + + =][=
_ENDIF =]
tTestDesc a[=hackname _cap=]Tests[] = {[=
_IF test _exist =][=
_FOR test=]
{ TT_TEST, z[=hackname _cap=]Test[=_eval _index=], 0 /* unused */ },[=
/test =][=
_ENDIF =][=
_IF bypass _exist =][=
_FOR bypass=]
{ TT_NEGREP, z[=hackname _cap=]Bypass[=_eval _index=], (regex_t*)NULL },[=
/bypass =][=
_ENDIF =][=
_IF exesel _exist =][=
_FOR exesel ,=]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL }[=
/exesel =][=
_ELIF select _exist =][=
_FOR select ,=]
{ TT_EGREP, z[=hackname _cap=]Select[=_eval _index=], (regex_t*)NULL }[=
/select =][=
_ENDIF =] };[=
_ELSE =]
#define [=hackname _up=]_TEST_CT 0
#define a[=hackname _cap=]Tests (tTestDesc*)NULL[=
_ENDIF =]
/*
* Fix Command Arguments for [=hackname _cap=]
*/
const char* apz[=hackname _cap=]Patch[] = {[=
_IF sed _exist =] "sed"[=_FOR sed=],
"-e" [=sed _str=][=/sed=][=
_ELIF replacement _exist =] "sed",
"s@[=select[]=]@[=replacement=]@"[=
_ELIF shell _exist =] "sh", "-c",
[=shell _str=][=
_ELSE =][=_ERROR hackname _get "Error: %s has two fixup specifications"
_printf =][=
_ENDIF=],
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *[=
/fix=]
*
* List of all fixes
*/
#define REGEX_COUNT [=_eval fix.select _count
fix.bypass _count + =]
#define FIX_COUNT [=_eval fix _count =]
tFixDesc fixDescList[ [=_eval fix _count =] ] = {[=
_FOR fix ",\n" =]
{ z[=hackname _cap=]Name, z[=hackname _cap=]List,
apz[=hackname _cap=]Machs, (regex_t*)NULL,
[=hackname _up=]_TEST_CT, [=
_IF not_machine _exist =]FD_MACH_IFNOT[=
_ELSE =]FD_MACH_ONLY[=
_ENDIF =],
a[=hackname _cap=]Tests, apz[=hackname _cap=]Patch }[=
/fix=]
};
[= autogen template include =]
[=
# $Id: hackshell.tpl,v 1.2 1998/12/16 21:19:08 law Exp $
#
# This file contanes the shell template replacement for the
# fixincl program. It is the repetitive guts of the fixincludes logic.
#
=]
if $LINKS; then
files=`find . -name '*.h' \( -type f -o -type l \) -print`
else
files=`find . -name '*.h' -type f -print`
fi
echo Checking header files
for file in $files; do
if ( test ! -r $file -o \
-n "`fgrep 'This file is part of the GNU C Library' $file`" )
then continue ; fi
fixlist=""
[=
#
# FOR every fix description,
# DO: emit the shell text to apply the fix to the current file
#
# =][=
_FOR fix "\n\n" =]
#
# Fix [=_eval _index 1 + #%3d _printf=]: [=hackname _Cap=]
#[=
_IF files _exist=]
case "$file" in [=_FOR files " | \\\n\t"=]./[=files=][=/files=] )[=
_ENDIF=][=
_IF mach _exist=]
case "$target_canonical" in [=
_FOR mach " | \\\n\t" =][=
mach =][=
/mach =] )[=
_IF mach_unmatched _exist =] : ;;
* )[=
_ENDIF =][=
_ENDIF=][=
# There are three conditional tests: select, bypass and test.
They may appear as often as desired. They must all pass for
the fix to be applied. "select" and "bypass" are egrep expressions
that must each appear (or not appear) in the target file.
"test" is an arbitrary test program expression that must yield
true or false. It is enclosed in parenthesis to avoid
precedence problems. The output looks like this:
if ( test -n "`egrep 'find-expr' $file`" -a
-z "`egrep 'not-find' $file`" -a
'(' <some-test-expression> ')'
) > /dev/null 2>&1 ; then
# =][=
_IF select _exist =]
if ( test [=
_FOR select " -a \\\n "
=]-n [=select _shrstr "#`egrep %s $file`"
_printf _shstr =][=
/select=][=
_IF bypass _exist =][=
_FOR bypass=] -a \
-z [=bypass _shrstr "#`egrep %s $file`"
_printf _shstr =][=
/bypass=][=
_ENDIF=][=
_IF test _exist=][=
_FOR test=] -a \
'(' [=test=] ')'[=
/test=][=
_ENDIF=]
) > /dev/null 2>&1 ; then[=
_ELIF test _exist =]
if ( test [=
_FOR test " -a \\\n "
=]'(' [=test=] ')'[=
/test=][=
_IF bypass _exist=][=
_FOR bypass=] -a \
-z [=bypass _shrstr "#`egrep %s $file`"
_printf _shstr=][=
/bypass=][=
_ENDIF=]
) > /dev/null 2>&1 ; then[=
_ELIF bypass _exist =]
if ( test [=_FOR bypass " -a \\\n "
=]-z [=bypass _shrstr "#`egrep %s $file`"
_printf _shstr=][=/bypass=]
) > /dev/null 2>&1 ; then[=
_ENDIF=]
fixlist="${fixlist}
[=hackname=]"
if [ ! -r ${DESTDIR}/$file ]
then infile=$file
else infile=${DESTDIR}/$file ; fi [=
_IF sed _exist=][=
_IF shell _exist =][=
_ERROR hackname _get
"fixincludes Error: %s fix has multiple fixups" _printf=][=
_ENDIF=]
sed [=
_FOR sed =]-e [=sed _shrstr=] \
[=
/sed=] < $infile > ${DESTDIR}/$file.[=
_ELIF shell _exist =]
( [=shell=] ) < $infile > ${DESTDIR}/$file.
# Shell scripts have the potential of removing the output
# We interpret that to mean the file is not to be altered
#
if test ! -f ${DESTDIR}/$file.
then continue ; fi [=
_ELSE=][=
_ERROR hackname _get "ERROR: %s has no fixup" _printf=][=
_ENDIF=]
mv -f ${DESTDIR}/$file. ${DESTDIR}/$file[=
# Close off any opened "if" or "case" statements in reverse order
# =][=
_IF select _exist test _exist | bypass _exist | =]
fi # end of selection 'if'[=
_ENDIF =][=
_IF mach _exist=]
;; # case end for machine type test
esac[=
_ENDIF =][=
_IF files _exist=]
;; # case end for file name test
esac[=
_ENDIF =][=
/fix =][=
#
# DONE with every fix for the current file
#
#=]
# IF the output has been removed OR it is unchanged,
# THEN ensure the output is gone
# ELSE look for local directory include syntax
#
if ( test ! -f ${DESTDIR}/$file || \
cmp $file ${DESTDIR}/$file ) > /dev/null 2>&1
then
rm -f ${DESTDIR}/$file
else
echo "Fixed $file:${fixlist}"
# Find any include directives that use "file".
#
for include in `
egrep '^[ ]*#[ ]*include[ ]*"[^/]' ${DESTDIR}/$file |
sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
do
dir=`echo $file | sed -e s'|/[^/]*$||'`
required="$required ${SRCDIR} $dir/$include ${DESTDIR}/$dir/$include"
done
fi
done # for file in $files
#! /bin/sh
machine=$1
if [ -z "$machine" ]
then
echo No machine name given
exit 1
fi
echo constructing fixinc.sh for $machine
fixincludes="../fixinc.sh"
case $machine in
*-*-gnu*)
fixincludes=
;;
*-*-sysv4*)
fixincludes=fixinc.svr4
;;
mips-dec-bsd*)
:
;;
i[34567]86-*-sysv5* | \
i[34567]86-*-udk* | \
i[34567]86-*-solaris2.[0-4] | \
powerpcle-*-solaris2.[0-4] | \
sparc-*-solaris2.[0-4] )
fixincludes=fixinc.svr4
;;
*-*-netbsd* | \
alpha*-*-linux-gnulibc1* | \
i[34567]86-*-freebsd* | \
i[34567]86-*-netbsd* | i[34567]86-*-openbsd* | \
i[34567]86-*-solaris2* | \
sparcv9-*-solaris2* | \
powerpcle-*-solaris2* | \
sparc-*-solaris2* )
fixincludes=fixinc.wrap
;;
alpha*-*-winnt* | \
i[34567]86-*-winnt3*)
fixincludes=fixinc.winnt
;;
i[34567]86-sequent-ptx* | i[34567]86-sequent-sysv[34]*)
fixincludes=fixinc.ptx
;;
i[34567]86-dg-dgux* | \
m88k-dg-dgux*)
fixincludes=fixinc.dgux
;;
i[34567]86-*-sco3.2v5* | \
i[34567]86-*-sco3.2v4*)
fixincludes=fixinc.sco
;;
alpha*-*-linux-gnu* | \
alpha*-dec-vms* | \
arm-semi-aout | armel-semi-aout | \
arm-semi-aof | armel-semi-aof | \
arm-*-linux-gnuaout* | \
c*-convex-* | \
hppa1.1-*-osf* | \
hppa1.0-*-osf* | \
hppa1.1-*-bsd* | \
hppa1.0-*-bsd* | \
hppa*-*-lites* | \
*-*-linux-gnu* | \
i[34567]86-moss-msdos* | i[34567]86-*-moss* | \
i[34567]86-*-osf1* | \
i[34567]86-*-win32 | \
i[34567]86-*-pe | i[34567]86-*-cygwin32 | \
i[34567]86-*-mingw32* | \
mips-sgi-irix5cross64 | \
powerpc-*-eabiaix* | \
powerpc-*-eabisim* | \
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
powerpcle-*-eabi* | \
powerpcle-*-winnt* | \
powerpcle-*-pe | powerpcle-*-cygwin32 | \
thumb-*-coff* | thumbel-*-coff* )
fixincludes=
;;
*-sgi-irix*)
fixincludes=fixinc.irix
;;
esac
if test -z "$fixincludes"
then
cat > ../fixinc.sh <<- _EOF_
#! /bin/sh
exit 0
_EOF_
exit 0
fi
if test -f "$fixincludes"
then
echo copying $fixincludes to $dest
cp $fixincludes $dest
exit 0
fi
echo $MAKE install
$MAKE install || cp inclhack.sh ..
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* $Id: server.h,v 1.2 1998/12/16 21:19:17 law Exp $
*
* Server Handling copyright 1992-1998 Bruce Korb
*
* Server Handling is free software.
* You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software
* Foundation; either version 2, or (at your option) any later version.
*
* Server Handling is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Server Handling. See the file "COPYING". If not,
* write to: The Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* As a special exception, Bruce Korb gives permission for additional
* uses of the text contained in his release of ServerHandler.
*
* The exception is that, if you link the ServerHandler library with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the ServerHandler library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by Bruce Korb under
* the name ServerHandler. If you copy code from other sources under the
* General Public License into a copy of ServerHandler, as the General Public
* License permits, the exception does not apply to the code that you add
* in this way. To avoid misleading anyone as to the status of such
* modified files, you must delete this exception notice from them.
*
* If you write modifications of your own for ServerHandler, it is your
* choice whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*/
#ifndef FIXINC_SERVER_H
#define FIXINC_SERVER_H
#include <stdio.h>
#include <unistd.h>
/*
* Dual pipe opening of a child process
*/
typedef struct
{
int readFd;
int writeFd;
}
tFdPair;
typedef struct
{
FILE *pfRead; /* parent read fp */
FILE *pfWrite; /* parent write fp */
}
tpfPair;
typedef char *tpChar;
#define NOPROCESS ((pid_t)-1)
#define NULLPROCESS ((pid_t)0)
#define EXIT_PANIC 99
typedef enum
{
BOOL_FALSE, BOOL_TRUE
}
bool;
#define _P_(p) ()
char *runShell _P_ ((const char *pzCmd));
pid_t p2fopen _P_ ((tpfPair * pfPair, tpChar * ppArgs));
pid_t p2open _P_ ((tFdPair * pPair, tpChar * ppArgs));
int
chainOpen _P_ ((int stdinFd,
tpChar * ppArgs,
pid_t * pChild));
#endif /* FIXINC_SERVER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment