chk.rpc

来自「关于Berkelay数据库的共享源码」· RPC 代码 · 共 83 行

RPC
83
字号
#!/bin/sh -## $Id: chk.rpc,v 1.2 2006/09/11 15:40:46 bostic Exp $## Check to make sure that the code samples in the documents build.r=../../rpc_server/rpc.srci=../../dbinc/db.int1=__1t2=__2[ -d ../../dbinc ] || {	echo 'FAIL: cannot find source distribution directory.'	exit 1}exitv=0# $1: handle name# $2: handle prefix# $3: method filecheck(){	echo "==== Checking $1/$2..."	# Build a list of DB_ENV handle methods from the include file.	sed -e "/$1 PUBLIC HANDLE LIST BEGIN/,/$1 PUBLIC HANDLE LIST END/p" \	    -e d < $i |	grep '[\* ](\*[a-z]' |	sed -e 's/).*$//' \	    -e 's/.*(\*//' \	    -e '/^$/d' > $t1	# Build a list of handle methods from the rpc.src file.	egrep '^BEGIN|^LOCAL|^NOFUNC' $r |	awk '{print $2}' |	egrep "^$2_" |	sed -e "/^$2_create/d" \	    -e "s/$2_//" > $t2	if cmp -s $t1 $t2 ; then		:	else		echo "FAIL: $1 handle methods do not match."		echo "<<< dbinc/db.in >>> rpc_server/rpc.src"		diff $t1 $t2		exit 1	fi	if [ -z "$3" ]; then		return	fi	# Build a list of handle methods from the env/env_method.c and	# db/db_method.c files.	sed -e "/$1 PUBLIC HANDLE LIST BEGIN/,/$1 PUBLIC HANDLE LIST END/p" \	    -e d < "$3" |	sed -e '/^#ifdef.HAVE_REPLICATION_THREADS/d' \	    -e '/^#else.*HAVE_REPLICATION_THREADS/,/^#endif/d' \	    -e '/PUBLIC/d' \	    -e 's/ = .*//' \	    -e 's/^.*->//' > $t2	if cmp -s $t1 $t2 ; then		:	else		echo "FAIL: $1 handle methods do not match."		echo "<<< dbinc/db.in >>> $3"		diff $t1 $t2		exit 1	fi}# We don't check the DB handle method limits from db/db_method.c, DB handle# methods are set in per-access method routines, they aren't consolidated.check DB dbcheck DBC dbccheck DB_ENV env ../../env/env_method.ccheck DB_TXN txnexit $exitv

⌨️ 快捷键说明

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