#!/bin/sh - # $Id$ # # Build the CSharp stat structures msgcsharp="/*- * Automatically built by dist/s_java_csharp. * * See the file LICENSE for redistribution information. * * Copyright (c) 2002, 2012 Oracle and/or its affiliates. All rights reserved. */" f=../lang/csharp/src/Internal/StatStructs.cs t=AA_TEST #trap 'rm -f $t; exit 0' 0 1 2 3 13 15 # Script to convert DB C structure declarations in CSharp declarations # Pull out the structure we're concerned with, strip out ifdefs and defines # and finally convert from C to C# types csclass() { sed -n "/struct $1 {/,/^}/p" < ../src/dbinc/db.in | sed -e "/$1/d" \ -e '/^}/d' \ -e "/CONFIG_TEST/,/#endif/d" \ -e "/^#/d" \ -e 's:\tchar \*:\tinternal string :' \ -e 's:\tdb_pgno_t:\tinternal uint:' \ -e 's:\tdb_seq_t:\tinternal long:' \ -e 's:\tdb_size_t:\tinternal IntPtr:' \ -e 's:\tdb_threadid_t:\tinternal uint:' \ -e 's:\tdb_timeout_t:\tinternal uint:' \ -e 's:\tDB_LSN:\tinternal DB_LSN_STRUCT:' \ -e 's:\tDB_TXN_ACTIVE \*:\tinternal IntPtr :' \ -e 's:\tint\s:\tinternal int :' \ -e 's:\tint32_t:\tinternal int:' \ -e 's:\tpid_t:\tinternal int:' \ -e 's:\troff_t:\tinternal IntPtr:' \ -e 's:\tsize_t:\tinternal IntPtr:' \ -e 's:\ttime_t:\tinternal long:' \ -e 's:\tu_int32_t:\tinternal uint:' \ -e 's:\tuintmax_t:\tinternal ulong:' \ -e 's:\tdb_ssize_t:\tinternal IntPtr:' \ -e "s:/\*.*\*/::" \ -e "/\/\*/ { N /\/\*.*\*\// { s:/\*.*\*/:: P D } }" } stat_class() { c_struct=__db_$1 cs_struct=$2 (cat <> $t } txn_active() { (cat <> $t } cat > $t <>$t <> $t <> $t < /dev/null 2>&1 || (echo "Building $f" && rm -f $f && cp $t $f)