⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pgrminclude

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻
字号:
:# remove extra #include'strap "rm -f /tmp/$$.c /tmp/$$.o /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15find . \( -name CVS -a -prune \) -o -type f -print | grep -v '\./postgres.h' |grep -v '\./pg_config.h' |grep -v '\./c.h' |while read FILEdo	if [ "`echo $FILE | sed -n 's/^.*\.\([^\.]*\)$/\1/p'`" = "h" ]	then	IS_INCLUDE="Y"	else	IS_INCLUDE="N"	fi		# remove defines	if [ "$IS_INCLUDE" = "Y" ]	then	cat "$FILE" | grep -v "^#if" | grep -v "^#else" | 		grep -v "^#endif" | sed 's/->[a-zA-Z0-9_\.]*//g' >/tmp/$$a	else	cat "$FILE" >/tmp/$$a	fi	# loop through all includes	cat /tmp/$$a | grep "^#include" |	sed 's/^#include[ 	]*[<"]\([^>"]*\).*$/\1/g' |	while read INCLUDE	do		[ -s /usr/include/$INCLUDE ] && continue		[ "$INCLUDE" = postgres.h ] && continue		[ "$INCLUDE" = config.h ] && continue		[ "$INCLUDE" = c.h ] && continue		# preserve configure-specific includes		# these includes are surrounded by #ifdef's		grep -B1 '^#include[ 	][ 	]*[<"]'"$INCLUDE"'[>"]' "$FILE" |		     egrep -q '^#if|^#else' && continue				grep -A1 '^#include[ 	][ 	]*[<"]'"$INCLUDE"'[>"]' "$FILE" |		     egrep -q '^#else|^#endif' && continue				cat /tmp/$$a |		grep -v '^#include[ 	]*[<"]'"$INCLUDE"'[>"]' >/tmp/$$b		if [ "$IS_INCLUDE" = "Y" ]		then	echo "#include \"postgres.h\"" >/tmp/$$.c		else	>/tmp/$$.c		fi		echo "#include \"/tmp/$$b\"" >>/tmp/$$.c		echo "void include_test(void);" >>/tmp/$$.c		echo "void include_test() {" >>/tmp/$$.c		if [ "$IS_INCLUDE" = "Y" ]		then	pgdefine "$FILE" >>/tmp/$$.c		fi		echo "}" >>/tmp/$$.c		cc -fsyntax-only -Werror -Wall -Wmissing-prototypes -Wmissing-declarations -I/pg/include -I/pg/backend -c /tmp/$$.c -o /tmp/$$.o >/tmp/$$ 2>&1		if [ "$?" -eq 0 ]		then	echo "$FILE $INCLUDE"			if [ "$IS_INCLUDE" = "N" ]			then	grep -v '^#include[ 	][ 	]*[<"]'"$INCLUDE"'[>"]' "$FILE" >/tmp/$$b				mv /tmp/$$b "$FILE"			fi			if [ "$1" = "-v" ]			then	cat /tmp/$$				cat /tmp/$$.c			fi		fi	donedone

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -