diff -Nru omniorb-dfsg-4.1.6/acinclude.m4 omniorb-dfsg-4.2.2/acinclude.m4 --- omniorb-dfsg-4.1.6/acinclude.m4 2010-11-22 23:00:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/acinclude.m4 2016-04-24 21:29:07.000000000 +0000 @@ -133,7 +133,7 @@ } ], omni_cv_cxx_catch_by_base=yes, omni_cv_cxx_catch_by_base=no, - omni_cv_cxx_catch_by_base=no) + omni_cv_cxx_catch_by_base=yes) AC_LANG_POP(C++) ]) if test "$omni_cv_cxx_catch_by_base" = yes; then @@ -369,12 +369,7 @@ ]) -dnl This defaults to enabled, and is appropriate for development -dnl For the release, the obvious chunk below should be replaced with: -dnl AC_HELP_STRING([--enable-thread-tracing], -dnl [enable thread and mutex tracing (default disable-thread-tracing)]), -dnl omni_cv_enable_thread_tracing=$enableval) -dnl omni_cv_enable_thread_tracing=no) +dnl Lock tracing AC_DEFUN([OMNI_DISABLE_THREAD_TRACING], [AC_CACHE_CHECK(whether to trace threads and locking, omni_cv_enable_thread_tracing, @@ -436,6 +431,50 @@ AC_SUBST(ENABLE_LONGDOUBLE, $omni_cv_enable_longdouble) ]) +dnl Enable ZIOP +AC_DEFUN([OMNI_ENABLE_ZIOP], +[AC_CHECK_LIB(z,compress2,omni_cv_enable_ziop=yes,omni_cv_enable_ziop=no) +AC_SUBST(ENABLE_ZIOP, $omni_cv_enable_ziop)]) + +dnl Atomic operations + +AC_DEFUN([OMNI_SYNC_ADD_SUB_FETCH], +[AC_CACHE_CHECK(whether __sync_add_and_fetch and __sync_sub_and_fetch are present, +omni_cv_sync_add_and_fetch, +[AC_LANG_PUSH(C++) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[ +int a = 1; +int b = __sync_add_and_fetch(&a, 1); +int c = __sync_sub_and_fetch(&b, 1); +]])], + [omni_cv_sync_add_and_fetch=yes], + [omni_cv_sync_add_and_fetch=no]) + AC_LANG_POP(C++) +]) +if test "$omni_cv_sync_add_and_fetch" = yes; then + AC_DEFINE(OMNI_HAVE_SYNC_ADD_AND_FETCH,, + [define if __sync_add_and_fetch and __sync_sub_and_fetch are available]) +fi +]) + + +dnl Disable support for atomic operations even if they look like they +dnl are available + +AC_DEFUN([OMNI_DISABLE_ATOMIC], +[AC_CACHE_CHECK(whether to use atomic operations when possible, +omni_cv_enable_atomic, +[AC_ARG_ENABLE(atomic, + AC_HELP_STRING([--disable-atomic], + [disable atomic operations (default enable-atomic)]), + omni_cv_enable_atomic=$enableval, + omni_cv_enable_atomic=yes) +]) +if test "$omni_cv_enable_atomic" = "no"; then + AC_DEFINE(OMNI_DISABLE_ATOMIC_OPS,,[define if you want to disable atomic operations]) +fi +]) + dnl diff -Nru omniorb-dfsg-4.1.6/aclocal.m4 omniorb-dfsg-4.2.2/aclocal.m4 --- omniorb-dfsg-4.1.6/aclocal.m4 2010-11-22 23:00:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/aclocal.m4 2017-02-20 22:45:59.000000000 +0000 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,35 +11,70 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# This program 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 of the License, or -# (at your option) any later version. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see http://www.gnu.org/licenses/ +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi @@ -52,46 +87,49 @@ AC_MSG_RESULT([no]) PKG_CONFIG="" fi - fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) + m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -99,19 +137,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -128,16 +164,17 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - ifelse([$4], , [AC_MSG_ERROR(dnl + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -145,35 +182,117 @@ Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) +_PKG_TEXT])[]dnl + ]) elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT -To get pkg-config, see .])], - [$4]) +To get pkg-config, see .])[]dnl + ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) + $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 -# Free Software Foundation, Inc. +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. + # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To @@ -201,8 +320,10 @@ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl -python2.1 python2.0]) +[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl + python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) + + AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. @@ -215,10 +336,11 @@ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. - AC_MSG_CHECKING([whether $PYTHON version >= $1]) + AC_MSG_CHECKING([whether $PYTHON version is >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], - [AC_MSG_RESULT(yes)], - [AC_MSG_ERROR(too old)]) + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Python interpreter is too old])]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies @@ -267,6 +389,25 @@ [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + # Just factor out some code duplication. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" dnl Set up 4 directories: @@ -274,9 +415,7 @@ dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. + dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE @@ -285,8 +424,14 @@ else am_py_prefix=$prefix fi - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` @@ -312,9 +457,7 @@ dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) - dnl Query distutils for this directory. distutils does not exist in - dnl Python 1.5, so we fall back to the hardcoded directory if it - dnl doesn't work. + dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE @@ -323,8 +466,14 @@ else am_py_exec_prefix=$exec_prefix fi - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || - echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` diff -Nru omniorb-dfsg-4.1.6/bin/scripts/distdate.py omniorb-dfsg-4.2.2/bin/scripts/distdate.py --- omniorb-dfsg-4.1.6/bin/scripts/distdate.py 2008-12-03 10:53:58.000000000 +0000 +++ omniorb-dfsg-4.2.2/bin/scripts/distdate.py 2014-04-28 16:52:44.000000000 +0000 @@ -2,7 +2,7 @@ # Script to extract the distribution date from update.log -import sys, string +import sys if len(sys.argv) > 1: package = sys.argv[1] @@ -14,11 +14,7 @@ while line == "\n": line = sys.stdin.readline() -try: - line = string.strip(line) -except NameError: - # Python 3 has no string.strip() - line = line.strip() +line = line.strip() output = """\ // distdate.hh -- Automatically generated file diff -Nru omniorb-dfsg-4.1.6/bin/scripts/process_invocations.py omniorb-dfsg-4.2.2/bin/scripts/process_invocations.py --- omniorb-dfsg-4.1.6/bin/scripts/process_invocations.py 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/bin/scripts/process_invocations.py 2014-01-17 15:06:40.000000000 +0000 @@ -0,0 +1,122 @@ +#!/usr/bin/env python + +""" +process_invocations.py + +This processes omniORB invocation logs obtained when the following +omniORB trace options are enabled: + + traceInvocations 1 + traceInvocationReturns 1 + traceThreadId 1 + traceTime 1 +""" +import sys, re, itertools +from time import mktime, strptime +from collections import defaultdict + + + +def output(call_counts, call_times, call_max): + print + + print ("%-30s %8s : %9s : %9s : %9s" % + ("Operation", "Count", "Total", "Mean", "Max")) + + print ("%-30s %8s : %9s : %9s : %9s" % + ("---------", "-----", "-----", "----", "---")) + + for operation, count in sorted(call_counts.items()): + total = call_times[operation] + + print ("%-30s %8d : %9.3f : %9.3f : %9.3f" % + (operation, count, total, total / count, call_max[operation])) + + call_counts.clear() + call_times.clear() + call_max.clear() + + + +def process(input): + exp = re.compile(r"omniORB: \(([^)]+)\) (....-..-.. ..:..:..)(\.......): (Dispatching|Return from) (remote|in process) call '([^']+)' to: ([^ ]+) \(([^)]+)\)\n") + in_progress = {} + call_counts = defaultdict(int) + call_times = defaultdict(float) + call_max = defaultdict(float) + + # *** This should be an option... + midpoint = "2012-05-24 18:05:00" + midpoint = mktime(strptime(midpoint, "%Y-%m-%d %H:%M:%S")) + + out_time = False + + try: + for lcount, line in enumerate(input): + + if lcount % 100000 == 0: + print lcount, + out_time = True + + match = exp.match(line) + if match: + thread = match.group(1) + time = (mktime(strptime(match.group(2), + "%Y-%m-%d %H:%M:%S")) + + float(match.group(3))) + dispatch = match.group(4) == "Dispatching" + remote = match.group(5) == "remote" + operation = match.group(6) + #key = match.group(7) + + if not remote: + continue + + if out_time: + print match.group(2), + out_time = False + sys.stdout.flush() + + if midpoint and time > midpoint: + output(call_counts, call_times, call_max) + print "\n\n********\n\n" + midpoint = None + + if dispatch: + in_progress[thread] = time, operation + else: + try: + ip_time, ip_op = in_progress.pop(thread) + + if ip_op == operation: + duration = time - ip_time + + call_counts[operation] += 1 + call_times[operation] += duration + call_max[operation] = max(call_max[operation], + duration) + + #print operation, "\t", duration + + except KeyError: + # Missing dispatch log + pass + + except KeyboardInterrupt: + pass + + output(call_counts, call_times, call_max) + + + +def main(): + args = sys.argv[1:] + if args: + process(itertools.chain.from_iterable( open(f) for f in args )) + else: + process(sys.stdin) + + + +if __name__ == "__main__": + main() diff -Nru omniorb-dfsg-4.1.6/bugfixes-410.xml omniorb-dfsg-4.2.2/bugfixes-410.xml --- omniorb-dfsg-4.1.6/bugfixes-410.xml 2007-10-07 15:42:21.000000000 +0000 +++ omniorb-dfsg-4.2.2/bugfixes-410.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ - - - - - - - - - - - - Duplicated member in vxWorks omnithread - - Compiler error due to a member being declared twice. - - - - - Segfault on shutdown with some type definitions - - When releasing children of a struct, union or value TypeCode, a - reference to the parent must be held to prevent its premature - deletion. - - - - - Segfault in connection scavenger - - Scavenger did not cope with client strands with no connection. This - can happen if a Python client uses invalid argument types, for - example. - - - - - Infinite poll() timeout - Richard Hirst - - A rounding error in calculating the poll() timeout could lead to - infinite timeout. - - - - - - Assertion failure trying to marshal an Any containing a nil - objref. - - Objref pointer is null when the object reference is nil. - - - - - MARSHAL exception trying to create a union TypeCode with an - enum discriminator - Peter S. Housel - - Code attempted to extract a enum from an Any as a ULong. - - - - - - Incorrect compiler flags for static libraries on VC++ 7 and 8 - - DLL link options were used when building static libraries. - - - - - Failure on start-up linking with SSL transport on Windows - - A change to the link forcing mechanism did not work on Windows due - to the non-uniform DLL memory model. - - - - - Infinite loop after handling CancelRequest - - A CancelRequest received for a finished call would lead to an - infinite loop. - - - - - Invalid code generated for fixed point values in unions - - Fixed point values cannot go inside the C++ union in an IDL union. - - - - - Failure in Identity downcasting on VC++ 8 - - VC++ 8's optimiser optimises away some functions that were critical - to the operation of the downcasting mechanism used on Identity - objects. - - - - - Compilation errors on 64 bit Windows - - VC++ on Windows 64 has no standard integer type that is as large as - its pointers. - - - - - Hang in POA destruction after POAManager deactivate() - - POAManager deactivate would not meet its detached object if all - objects were busy, leading to a hang in POA destruction. - - - - - Incorrect return from TypeCode::member_label - - Enum discriminators were returned as ulongs from - TypeCode::member_label, rather than as the proper enums. - - - - - omniNames failure with -errlog on Windows - - Windows doesn't support line buffering, and fails with a zero buffer - length. - - - - - Condition variables leaked - - The condition variables created when multiple threads peek a - connection simultaneously were leaked. - - - - - Value chunk reading error - - When reading bulk data from value chunks, the reader could get out - of synchronisation with the chunk boundaries, leading to - unmarshalling of invalid data. - - - - - Avoid namespace clashes if IDL defines modules named CORBA - - IDL that defined nested modules named CORBA would generate invalid C++. - - - - diff -Nru omniorb-dfsg-4.1.6/bugfixes-411.xml omniorb-dfsg-4.2.2/bugfixes-411.xml --- omniorb-dfsg-4.1.6/bugfixes-411.xml 2008-07-15 11:04:32.000000000 +0000 +++ omniorb-dfsg-4.2.2/bugfixes-411.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ - - - - - - - - - - - - Assertion falure in Any unmarshalling - Jian Wu, Clemens Fischer - - - Enum TypeCodes were not marked as complete, meaning that receiving a - struct containing an enum would trigger an assertion failure. - - - - - Escaped identifiers in unions cause incorrect errors - Will Denissen - - - omniidl would incorrectly report errors for union members clashing - with keywords, but escaped with a leading underscore. - - - - - localhost server transport rule does not work for IPv4 in IPv6 - Joe Lee - - The localhost server transport rule failed to cope with IPv4 - addresses encapsulated in IPv6, meaning connections were incorrectly - denied. - - - - - Connections closed during upcalls could be leaked - Emmanuel Taurel - - In thread pool mode, connections closed by a client while the server - was in an up-call could be leaked. - - - - - Assertion failure in Any marshalling with nil objref - Peter S. Housel - - - - - Segfault on exit of omniidl - Juergen Weber - - omniidl would segfault on exit if given a forward declaration to a - previously fully-declared valuetype. - - - - - - Incorrect generated code - Juergen Weber - - Incorrect generated code for ::CORBA::AbstractBase. - - - - - - Race condition between Peek and select thread when data in buffer. - Dirk Siebnich - - A race between the select thread and a thread doing peek when there - was data already in the connection buffer could lead to a lock-up. - - - - - diff -Nru omniorb-dfsg-4.1.6/bugfixes-412.xml omniorb-dfsg-4.2.2/bugfixes-412.xml --- omniorb-dfsg-4.1.6/bugfixes-412.xml 2008-09-23 09:44:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/bugfixes-412.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ - - - - - - - - - - - - omniNames service failed if no registry entries present - - If the omniNames Windows service was set up using an external tool, - meaning it had none of its expected registry entries present, - startup failed. - - - - - Incorrect behaviour handling exceptions on VC++ 7.1 - Werner Mausshardt - - A bug in Visual C++ 7.1 meant it generated incorrect exception - handling code, leading to strange errors and crashes if exceptions - occurred in remote calls. - - - - - Incorrect enum name in IR IDL - - The dk_ValueMember enum member was misnamed dk_Member in ir.idl. - - - - - Failure if openening a connection fails with EAGAIN - Dirk Siebnich - - If opening a connection failed with EAGAIN, an incorrect while loop - meant that the connection attempt was not properly retried. - - - - - Crash constructing DynAny containing null TypeCodes - - tk_null was not properly handled, and the resulting exception caused - corruption of DynAny state, leading to a crash. - - - - - - Failure with long computer name on Windows - Luke Deller - - Off-by-one error in name handling. - - - - - diff -Nru omniorb-dfsg-4.1.6/bugfixes-413.xml omniorb-dfsg-4.2.2/bugfixes-413.xml --- omniorb-dfsg-4.1.6/bugfixes-413.xml 2009-07-16 13:11:17.000000000 +0000 +++ omniorb-dfsg-4.2.2/bugfixes-413.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ - - - - - - - - - - - - Delays in servicing calls with thread pool and no connection watching - Serguei Kolos - - The set of sockets to poll could be malformed, causing a socket to - be ignored for a while. - - - - - - Undeclared user exceptions in local calls are not caught - - If an operation implementation raised a CORBA user exception that - was not declared in the operation's raises clause, local callers - received the user exception, rather than CORBA::UNKNOWN as they - should. - - - - - Internal CommFailure exception escapes after - failed-on-forward call that is not retried. - - When a call on an object reference that has been location-forwarded - fails, the transient exception handler is called. If the handler - returns false, in some circumstances an internal exception can be - thrown, rather than the proper CORBA system exception. - - Jacob Feisley - - - - Incorrect generated code for some float constants - - Very small float constants led to invalid generated code. - - Will Denissen - - - - - Scoping problem in code generated for struct marshalling - - Ambiguous generated code with awkward nested type names. - - Will Denissen - - - - - Infinite loop on socket error - - On platforms with recv() that cannot be interrupted, a socket error - would lead to an infinite loop. - - Masaaki Sekiya - - - - - Memory leaks in DynAny - - Memory leaks setting members / elements with DynAnys. - - Sampo Ahokas - - - - - Assertion failure with empty valuetype in omniORBpy - - ORB core chunked encoding did not support empty chunks. - - Stephane Bonniez - - - - - Crash with unix transport when using transport rules - - An object reference with just a unix endpoint would cause a crash if - using transport rules. - - Serguei Kolos - - - - - diff -Nru omniorb-dfsg-4.1.6/bugfixes-414.xml omniorb-dfsg-4.2.2/bugfixes-414.xml --- omniorb-dfsg-4.1.6/bugfixes-414.xml 2010-12-20 22:08:33.000000000 +0000 +++ omniorb-dfsg-4.2.2/bugfixes-414.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,92 +0,0 @@ - - - - - - - - - - - - Error in element self-assignment - Felix Nawothnig - - Element classes did not cope properly with self-assignment. - - - - - - Missing generated code - Jean-Louis Gilbert - - Combinations of multiple files opening the same module multiple - times could cause IDL definitions to be skipped. - - - - - - Assertion failure in SocketCollection - Richard Pitts - - A race condition led to an assertion failure. - - - - - - Chunked encoding error - - Valuetype chunked encoding could create an empty chunk, leading to - an assertion failure. - - - - - Inconsistent retry handling between locate request and normal request - Peter Klotz - - Connection errors during locate requests were not handled correctly. - - - - - - Uninitialised variable in call to getpeername - - The length field passed to getpeername() was not initialised, - leading to incorrect results or crashes. - - - - - Invalid chunked encoding of UTF-8 strings - - UTF-8 string length and string body could be split across - chunks. omniORB accepts that but other ORBs do not. - - - - - Bug in omniidl back-end with nested scopes with clashing names - Kovex - - C++ back-end would crash with IDL that had nested scopes with clashing names - - - - - - Invalid generated code for anonymous sequence in valuetype - hydrargentum - - C++ back-end used the wrong name for the internally-generated type - corresponding to an anonymous sequence. - - - - - - diff -Nru omniorb-dfsg-4.1.6/bugfixes-415.xml omniorb-dfsg-4.2.2/bugfixes-415.xml --- omniorb-dfsg-4.1.6/bugfixes-415.xml 2011-07-01 13:35:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/bugfixes-415.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ - - - - - - - - - - - - Stall in incoming call handling - - The select() based implementation of SocketCollection could miss out - watching the pipe it uses for signalling, meaning new sockets were - not watched. - - - - - Static TypeCode error - - Construction of static TypeCodes for complex recursive valuetypes - could throw BAD_TYPECODE. - - - - - TypeCode released early - - A TypeCode with no alias expansion could be released unintentionally - if multiple threads attempted to alias-expand it simultaneously. - - - - diff -Nru omniorb-dfsg-4.1.6/config/config.mk omniorb-dfsg-4.2.2/config/config.mk --- omniorb-dfsg-4.1.6/config/config.mk 2010-10-28 23:05:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/config/config.mk 2017-05-11 13:01:56.000000000 +0000 @@ -6,17 +6,43 @@ # Uncomment one of the following platform lines to build for the # target platform # -# x86_win32_vs_6 x86 Windows, MS VC++ 6.0 or 5.0 -# x86_win32_vs_7 x86 Windows, MS VC++ 7.x (.NET) -# x86_win32_vs_8 x86 Windows, MS VC++ 8.x (.NET) -# x86_win32_vs_9 x86 Windows, MS VC++ 9.x (2008) +# x86_win32_vs_15 x86 Windows, MS VC++ 15.x (2017) +# x86_win32_vs_14 x86 Windows, MS VC++ 14.x (2015) +# x86_win32_vs_12 x86 Windows, MS VC++ 12.x (2013) +# x86_win32_vs_11 x86 Windows, MS VC++ 11.x (2012) # x86_win32_vs_10 x86 Windows, MS VC++ 10.x (2010) +# x86_win32_vs_9 x86 Windows, MS VC++ 9.x (2008) +# x86_win32_vs_8 x86 Windows, MS VC++ 8.x (.NET) +# x86_win32_vs_7 x86 Windows, MS VC++ 7.x (.NET) +# x86_win32_vs_6 x86 Windows, MS VC++ 6.0 or 5.0 # x86_win32_mingw x86 Windows, mingw/g++ build # x86_win32_dmc x86 Win32, Digital Mars C++ (>= 8.32.14) # x86_ets Phar Lap Realtime ETS-kernel # x86_LynxOS_4.0 x86, LynxOS 4.0, gcc 2.95.3 # pc486_rtems_4.5.0 x86, RTEMS, gcc 2.95.2 + +# You should also look at /mk/platforms/$(platform).mk and if necessary +# edit the make variables, such as CC and CXX, in the file. + +#platform = x86_win32_vs_15 +#platform = x86_win32_vs_14 +#platform = x86_win32_vs_12 +#platform = x86_win32_vs_11 +#platform = x86_win32_vs_10 +#platform = x86_win32_vs_9 +#platform = x86_win32_vs_8 +#platform = x86_win32_vs_7 +#platform = x86_win32_vs_6 +#platform = x86_win32_mingw +#platform = x86_win32_dmc +#platform = powerpc_LynxOS_4.0 +#platform = x86_ets +#platform = x86_LynxOS_4.0 +#platform = pc486_rtems_4.5.0 +#platform = arm_linux_mvl_3.1 + + # These platforms are mostly of historical interest. The configure # script is usually the best starting point. # @@ -52,22 +78,6 @@ # x86_freebsd_3.2 x86 FreeBSD 3.2, egcs 1.1.2 # x86_freebsd_4.0 x86 FreeBSD 4.0, gcc 2.95 -# You should also look at /mk/platforms/$(platform).mk and if necessary -# edit the make variables, such as CC and CXX, in the file. - -#platform = x86_win32_vs_6 -#platform = x86_win32_vs_7 -#platform = x86_win32_vs_8 -#platform = x86_win32_vs_9 -#platform = x86_win32_vs_10 -#platform = x86_win32_mingw -#platform = x86_win32_dmc -#platform = powerpc_LynxOS_4.0 -#platform = x86_ets -#platform = x86_LynxOS_4.0 -#platform = pc486_rtems_4.5.0 -#platform = arm_linux_mvl_3.1 - #platform = sun4_sosV_5.5 #platform = sun4_sosV_5.6 #platform = sun4_sosV_5.7 diff -Nru omniorb-dfsg-4.1.6/configure omniorb-dfsg-4.2.2/configure --- omniorb-dfsg-4.1.6/configure 2011-06-24 21:37:28.000000000 +0000 +++ omniorb-dfsg-4.2.2/configure 2017-05-10 23:52:28.000000000 +0000 @@ -1,20 +1,22 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for omniORB 4.1.6. +# Generated by GNU Autoconf 2.69 for omniORB 4.2.2. # # Report bugs to . # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -22,23 +24,15 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -46,7 +40,13 @@ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -57,7 +57,7 @@ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -80,13 +80,6 @@ } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -96,15 +89,16 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -116,12 +110,16 @@ fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -133,330 +131,345 @@ LANGUAGE=C export LANGUAGE -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - # CDPATH. -$as_unset CDPATH - +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST else - as_have_required=no + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes else - exitcode=1 - echo positional parameters were not saved. + as_have_required=no fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + as_found=: + case $as_dir in #( /*) for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi done;; esac + as_found=false done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } IFS=$as_save_IFS - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: bugs@omniorb-support.com about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi +} # as_fn_mkdir_p -if as_func_ret_success; then - : +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append -if ( set x; as_func_ret_success y && test x = "$1" ); then - : +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error -exitcode=0 -if as_func_success; then - : +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. + as_expr=false fi -if as_func_ret_success; then - : +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. + as_basename=false fi -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname else - exitcode=1 - echo positional parameters were not saved. + as_dirname=false fi -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -473,9 +486,12 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -484,29 +500,18 @@ exit } - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -521,49 +526,29 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -572,11 +557,11 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -591,14 +576,14 @@ subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='omniORB' PACKAGE_TARNAME='omniorb' -PACKAGE_VERSION='4.1.6' -PACKAGE_STRING='omniORB 4.1.6' +PACKAGE_VERSION='4.2.2' +PACKAGE_STRING='omniORB 4.2.2' PACKAGE_BUGREPORT='bugs@omniorb-support.com' +PACKAGE_URL='' ac_unique_file="bin/scripts/omkdirhier" # Factoring default headers for most tests. @@ -645,6 +630,7 @@ PLATFORM_DEFINE PLATFORM_NAME COMPILER_NAME +ENABLE_ZIOP ENABLE_LONGDOUBLE ENABLE_STATIC OMNINAMES_LOGDIR @@ -658,7 +644,12 @@ OPEN_SSL_ROOT OPENSSL_LIBS OPENSSL_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH EXTRA_GCC_CXXFLAGS +CROSS_COMPILING +OMKDEPEND +OMNIIDL PKG_CONFIG pkgpyexecdir pyexecdir @@ -723,6 +714,7 @@ program_transform_name prefix exec_prefix +PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -741,6 +733,7 @@ enable_ipv6 enable_alloca enable_longdouble +enable_atomic ' ac_precious_vars='build_alias host_alias @@ -754,7 +747,10 @@ CXXFLAGS CCC CPP +PYTHON PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR OPENSSL_CFLAGS OPENSSL_LIBS CXXCPP' @@ -820,8 +816,9 @@ fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -866,8 +863,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -893,8 +889,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1098,8 +1093,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1115,8 +1109,7 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1146,17 +1139,17 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1165,7 +1158,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1173,15 +1166,13 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1204,8 +1195,7 @@ [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1219,8 +1209,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1235,11 +1223,9 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1278,13 +1264,11 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1310,7 +1294,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures omniORB 4.1.6 to adapt to many kinds of systems. +\`configure' configures omniORB 4.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1324,7 +1308,7 @@ --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1375,7 +1359,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of omniORB 4.1.6:";; + short | recursive ) echo "Configuration of omniORB 4.2.2:";; esac cat <<\_ACEOF @@ -1392,6 +1376,7 @@ enable-alloca) --disable-longdouble disable long double support (default enable-longdouble) + --disable-atomic disable atomic operations (default enable-atomic) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1408,12 +1393,17 @@ LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor + PYTHON the Python interpreter PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path OPENSSL_CFLAGS C compiler flags for OPENSSL, overriding pkg-config OPENSSL_LIBS @@ -1486,454 +1476,1290 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -omniORB configure 4.1.6 -generated by GNU Autoconf 2.63 +omniORB configure 4.2.2 +generated by GNU Autoconf 2.69 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -It was created by omniORB $as_me 4.1.6, which was -generated by GNU Autoconf 2.63. Invocation command line was +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval - $ $0 $@ +} # ac_fn_c_try_compile -_ACEOF -exec 5>>config.log +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +} # ac_fn_cxx_try_compile -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -_ASUNAME + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS +} # ac_fn_c_try_cpp -} >&5 +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >&5 <<_ACEOF + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval +} # ac_fn_cxx_try_cpp -## ----------- ## -## Core tests. ## -## ----------- ## +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> _ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------------- ## +## Report this to bugs@omniorb-support.com ## +## --------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +} # ac_fn_cxx_check_header_mongrel -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo +} # ac_fn_cxx_try_run - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h +} # ac_fn_cxx_check_header_compile -# Predefined preprocessor variables. +# ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES +# ---------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_cxx_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" + ; + return 0; +} _ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" + ; + return 0; +} _ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" + ; + return 0; +} _ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" + ; + return 0; +} _ACEOF +if ac_fn_cxx_try_run "$LINENO"; then : + echo >>conftest.val; read $3 >confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +} # ac_fn_cxx_compute_int + +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_cxx_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} _ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site +} # ac_fn_cxx_check_type + +# ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES +# ------------------------------------------------------ +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_cxx_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac +} # ac_fn_cxx_check_member + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac +} # ac_fn_cxx_try_link + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval +} # ac_fn_c_try_link +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +} # ac_fn_c_check_func +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +} # ac_fn_c_check_type +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval +} # ac_fn_c_try_run +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +It was created by omniORB $as_me 4.2.2, which was +generated by GNU Autoconf 2.69. Invocation command line was + $ $0 $@ +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +_ASUNAME +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS +} >&5 -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +cat >&5 <<_ACEOF +## ----------- ## +## Core tests. ## +## ----------- ## +_ACEOF -ac_aux_dir= -for ac_dir in bin/scripts "$srcdir"/bin/scripts; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done done -if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in bin/scripts \"$srcdir\"/bin/scripts" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in bin/scripts \"$srcdir\"/bin/scripts" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + +ac_aux_dir= +for ac_dir in bin/scripts "$srcdir"/bin/scripts; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in bin/scripts \"$srcdir\"/bin/scripts" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -1949,28 +2775,24 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2011,9 +2833,9 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2024,24 +2846,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2051,9 +2873,9 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2064,24 +2886,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2090,7 +2912,7 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2104,9 +2926,9 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2117,24 +2939,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2144,9 +2966,9 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2158,18 +2980,18 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -2188,10 +3010,10 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2203,9 +3025,9 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2216,24 +3038,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2247,9 +3069,9 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2260,24 +3082,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2290,7 +3112,7 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2301,57 +3123,37 @@ fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2367,8 +3169,8 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -2384,17 +3186,17 @@ done rm -f $ac_rmfiles -if { (ac_try="$ac_link_default" +if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2411,7 +3213,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2430,84 +3232,41 @@ else ac_file='' fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" +if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2522,32 +3281,83 @@ esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2559,17 +3369,17 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" +if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2582,31 +3392,23 @@ $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2620,37 +3422,16 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -2659,20 +3440,16 @@ fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2683,35 +3460,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2722,36 +3475,12 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_compile "$LINENO"; then : - ac_c_werror_flag=$ac_save_c_werror_flag +else + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -2762,42 +3491,17 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -2814,23 +3518,18 @@ CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -2882,32 +3581,9 @@ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -2918,17 +3594,19 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2950,9 +3628,9 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -2963,24 +3641,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:$LINENO: result: $CXX" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -2994,9 +3672,9 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3007,24 +3685,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3037,7 +3715,7 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3048,53 +3726,36 @@ fi fi # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3108,37 +3769,16 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no + ac_compiler_gnu=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes @@ -3147,20 +3787,16 @@ fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3171,35 +3807,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3210,36 +3822,12 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cxx_werror_flag=$ac_save_cxx_werror_flag +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3250,42 +3838,17 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS @@ -3313,14 +3876,14 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3335,11 +3898,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3348,78 +3907,34 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -3431,7 +3946,7 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -3442,11 +3957,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3455,87 +3966,40 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : +if ac_fn_c_try_cpp "$LINENO"; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3547,9 +4011,9 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -3560,24 +4024,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3587,9 +4051,9 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -3600,24 +4064,24 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3626,7 +4090,7 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3650,10 +4114,10 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3661,11 +4125,11 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -3673,7 +4137,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -3702,7 +4166,7 @@ ;; esac -done + done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir @@ -3718,7 +4182,7 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -3729,11 +4193,11 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3741,7 +4205,7 @@ all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -3751,11 +4215,11 @@ rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3765,15 +4229,17 @@ + + # Find any Python interpreter. if test -z "$PYTHON"; then - for ac_prog in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 + for ac_prog in python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then +if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -3786,14 +4252,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -3801,10 +4267,10 @@ fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then - { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -3818,20 +4284,18 @@ if test "$PYTHON" = :; then - { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 -$as_echo "$as_me: error: no suitable Python interpreter found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if test "${am_cv_python_version+set}" = set; then +if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version @@ -3843,23 +4307,42 @@ - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if test "${am_cv_python_platform+set}" = set; then +if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform + # Just factor out some code duplication. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version[:3] == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if test "${am_cv_python_pythondir+set}" = set; then +if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE @@ -3868,8 +4351,14 @@ else am_py_prefix=$prefix fi - am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null || - echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` @@ -3886,7 +4375,7 @@ esac fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir @@ -3895,9 +4384,9 @@ pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if test "${am_cv_python_pyexecdir+set}" = set; then +if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE @@ -3906,8 +4395,14 @@ else am_py_exec_prefix=$exec_prefix fi - am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null || - echo "$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages"` + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` @@ -3924,7 +4419,7 @@ esac fi -{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir @@ -3940,9 +4435,9 @@ # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -3955,14 +4450,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" @@ -3971,14 +4466,112 @@ fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test "$cross_compiling" = yes; then + # Extract the first word of "omniidl", so it can be a program name with args. +set dummy omniidl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OMNIIDL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OMNIIDL in + [\\/]* | ?:[\\/]*) + ac_cv_path_OMNIIDL="$OMNIIDL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OMNIIDL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OMNIIDL" && ac_cv_path_OMNIIDL="no" + ;; +esac +fi +OMNIIDL=$ac_cv_path_OMNIIDL +if test -n "$OMNIIDL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OMNIIDL" >&5 +$as_echo "$OMNIIDL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$ac_cv_path_OMNIIDL" = "xno"; then + as_fn_error $? "cannot find omniidl on the path" "$LINENO" 5 + fi + + # Extract the first word of "omkdepend", so it can be a program name with args. +set dummy omkdepend; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OMKDEPEND+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OMKDEPEND in + [\\/]* | ?:[\\/]*) + ac_cv_path_OMKDEPEND="$OMKDEPEND" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OMKDEPEND="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_OMKDEPEND" && ac_cv_path_OMKDEPEND="no" + ;; +esac +fi +OMKDEPEND=$ac_cv_path_OMKDEPEND +if test -n "$OMKDEPEND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OMKDEPEND" >&5 +$as_echo "$OMKDEPEND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "x$ac_cv_path_OMKDEPEND" = "xno"; then + as_fn_error $? "cannot find omkdepend on the path" "$LINENO" 5 + fi +fi + +CROSS_COMPILING=$cross_compiling + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -3992,13 +4585,18 @@ + + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then +if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in @@ -4011,14 +4609,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -4026,10 +4624,10 @@ fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4039,9 +4637,9 @@ ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in @@ -4054,14 +4652,14 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done IFS=$as_save_IFS ;; @@ -4069,10 +4667,10 @@ fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi @@ -4081,7 +4679,7 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -4094,26 +4692,25 @@ fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 - { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi - fi -{ $as_echo "$as_me:$LINENO: checking for OpenSSL root" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL root" >&5 $as_echo_n "checking for OpenSSL root... " >&6; } -if test "${omni_cv_openssl_root+set}" = set; then +if ${omni_cv_openssl_root+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then +if test "${with_openssl+set}" = set; then : withval=$with_openssl; omni_cv_openssl_root=$withval else omni_cv_openssl_root=no @@ -4121,7 +4718,7 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_openssl_root" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_openssl_root" >&5 $as_echo "$omni_cv_openssl_root" >&6; } @@ -4150,19 +4747,20 @@ if test "$do_pkg_config" = "yes"; then pkg_failed=no -{ $as_echo "$as_me:$LINENO: checking for OPENSSL" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL" >&5 $as_echo_n "checking for OPENSSL... " >&6; } if test -n "$OPENSSL_CFLAGS"; then pkg_cv_OPENSSL_CFLAGS="$OPENSSL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"openssl\"") >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then pkg_cv_OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -4173,12 +4771,13 @@ pkg_cv_OPENSSL_LIBS="$OPENSSL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"openssl\"") >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openssl\""; } >&5 ($PKG_CONFIG --exists --print-errors "openssl") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then pkg_cv_OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi @@ -4189,6 +4788,8 @@ if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -4196,22 +4797,22 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "openssl" 2>&1` + OPENSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openssl" 2>&1` else - OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors "openssl" 2>&1` + OPENSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openssl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$OPENSSL_PKG_ERRORS" >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - open_ssl_pkgconfig="no" + open_ssl_pkgconfig="no" elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } open_ssl_pkgconfig="no" else OPENSSL_CFLAGS=$pkg_cv_OPENSSL_CFLAGS OPENSSL_LIBS=$pkg_cv_OPENSSL_LIBS - { $as_echo "$as_me:$LINENO: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } open_ssl_root=`$PKG_CONFIG --variable=prefix openssl` open_ssl_cppflags="$OPENSSL_CFLAGS" @@ -4248,9 +4849,7 @@ elif test -d $omni_cv_openssl_root/lib; then : else - { { $as_echo "$as_me:$LINENO: error: Can't find OpenSSL in '$omni_cv_openssl_root'. Please give me the full path or leave out --with-openssl." >&5 -$as_echo "$as_me: error: Can't find OpenSSL in '$omni_cv_openssl_root'. Please give me the full path or leave out --with-openssl." >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "Can't find OpenSSL in '$omni_cv_openssl_root'. Please give me the full path or leave out --with-openssl." "$LINENO" 5 omni_cv_openssl_root=no fi fi @@ -4284,10 +4883,10 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded @@ -4302,11 +4901,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -4315,78 +4910,34 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : break fi @@ -4398,7 +4949,7 @@ else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes @@ -4409,11 +4960,7 @@ # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -4422,87 +4969,40 @@ #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then +if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break fi - -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp @@ -4512,9 +5012,9 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4525,10 +5025,10 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4545,7 +5045,7 @@ $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -4560,26 +5060,24 @@ $ac_path_GREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4593,10 +5091,10 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4613,7 +5111,7 @@ $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` + as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -4628,12 +5126,10 @@ $ac_path_EGREP_found && break 3 done done -done + done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4641,6052 +5137,898 @@ fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - -for ac_header in errno.h fcntl.h netdb.h signal.h stdlib.h string.h strings.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## --------------------------------------- ## -## Report this to bugs@omniorb-support.com ## -## --------------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - -for ac_header in unistd.h nan.h sys/if.h sys/ioctl.h sys/param.h sys/time.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## --------------------------------------- ## -## Report this to bugs@omniorb-support.com ## -## --------------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in sys/poll.h ifaddrs.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## --------------------------------------- ## -## Report this to bugs@omniorb-support.com ## -## --------------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - -fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_time=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - - - - - - { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then - # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF -;; #( - no) - ;; #( - universal) - -cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 -_ACEOF - - ;; #( - *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; - esac - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of char" >&5 -$as_echo_n "checking size of char... " >&6; } -if test "${ac_cv_sizeof_char+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (char))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_char=$ac_lo;; -'') if test "$ac_cv_type_char" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (char) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_char=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (char)); } -static unsigned long int ulongval () { return (long int) (sizeof (char)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (char))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (char)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (char)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_char=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_char" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (char) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_char=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 -$as_echo "$ac_cv_sizeof_char" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR $ac_cv_sizeof_char -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of unsigned char" >&5 -$as_echo_n "checking size of unsigned char... " >&6; } -if test "${ac_cv_sizeof_unsigned_char+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (unsigned char))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (unsigned char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (unsigned char))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (unsigned char))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (unsigned char))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_unsigned_char=$ac_lo;; -'') if test "$ac_cv_type_unsigned_char" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (unsigned char) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_unsigned_char=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (unsigned char)); } -static unsigned long int ulongval () { return (long int) (sizeof (unsigned char)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (unsigned char))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (unsigned char)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (unsigned char)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_unsigned_char=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_unsigned_char" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (unsigned char) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_unsigned_char=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5 -$as_echo "$ac_cv_sizeof_unsigned_char" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of bool" >&5 -$as_echo_n "checking size of bool... " >&6; } -if test "${ac_cv_sizeof_bool+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (bool))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (bool))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (bool))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (bool))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (bool))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_bool=$ac_lo;; -'') if test "$ac_cv_type_bool" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (bool) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (bool) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_bool=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (bool)); } -static unsigned long int ulongval () { return (long int) (sizeof (bool)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (bool))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (bool)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (bool)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_bool=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_bool" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (bool) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (bool) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_bool=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_bool" >&5 -$as_echo "$ac_cv_sizeof_bool" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_BOOL $ac_cv_sizeof_bool -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if test "${ac_cv_sizeof_short+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_short=$ac_lo;; -'') if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (short) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_short=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (short)); } -static unsigned long int ulongval () { return (long int) (sizeof (short)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (short))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (short)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (short)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_short=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (short) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_short=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_int=$ac_lo;; -'') if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (int) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_int=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (int)); } -static unsigned long int ulongval () { return (long int) (sizeof (int)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (int))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (int)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (int)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_int=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (int) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_int=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long=$ac_lo;; -'') if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_long=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (long)); } -static unsigned long int ulongval () { return (long int) (sizeof (long)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (long))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (long)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_long=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if test "${ac_cv_sizeof_long_long+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long_long=$ac_lo;; -'') if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_long_long=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (long long)); } -static unsigned long int ulongval () { return (long int) (sizeof (long long)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (long long))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (long long)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long long)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long_long=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_long_long=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of float" >&5 -$as_echo_n "checking size of float... " >&6; } -if test "${ac_cv_sizeof_float+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_float=$ac_lo;; -'') if test "$ac_cv_type_float" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (float) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_float=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (float)); } -static unsigned long int ulongval () { return (long int) (sizeof (float)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (float))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (float)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (float)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_float=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_float" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (float) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_float=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -$as_echo "$ac_cv_sizeof_float" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of double" >&5 -$as_echo_n "checking size of double... " >&6; } -if test "${ac_cv_sizeof_double+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_double=$ac_lo;; -'') if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (double) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_double=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (double)); } -static unsigned long int ulongval () { return (long int) (sizeof (double)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (double))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (double)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (double)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_double=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (double) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_double=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -$as_echo "$ac_cv_sizeof_double" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_DOUBLE $ac_cv_sizeof_double -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 -$as_echo_n "checking size of long double... " >&6; } -if test "${ac_cv_sizeof_long_double+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include +#include +#include +#include + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; -test_array [0] = 0 ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_cv_header_stdc=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no fi +rm -f conftest* -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; -test_array [0] = 0 +#include - ; - return 0; -} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest* - ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long_double=$ac_lo;; -'') if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long double) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_long_double=0 - fi ;; -esac +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (long double)); } -static unsigned long int ulongval () { return (long int) (sizeof (long double)); } -#include +#include #include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (long double))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (long double)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long double)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long_double=`cat conftest.val` -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_run "$LINENO"; then : -( exit $ac_status ) -if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long double) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_long_double=0 - fi +else + ac_cv_header_stdc=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest.val + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -$as_echo "$ac_cv_sizeof_long_double" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then +$as_echo "#define STDC_HEADERS 1" >>confdefs.h +fi -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF +fi -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 -$as_echo_n "checking size of wchar_t... " >&6; } -if test "${ac_cv_sizeof_wchar_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; -test_array [0] = 0 +done - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} +for ac_header in errno.h fcntl.h netdb.h signal.h stdlib.h string.h strings.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +done - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +for ac_header in unistd.h nan.h sys/if.h sys/ioctl.h sys/param.h sys/time.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +fi + +done + +for ac_header in sys/poll.h ifaddrs.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include +#include +#include + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; -test_array [0] = 0 - +if ((struct tm *) 0) +return 0; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_header_time=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; - ac_lo= ac_hi= -fi +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + #include + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; -test_array [0] = 0 +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_wchar_t=$ac_lo;; -'') if test "$ac_cv_type_wchar_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (wchar_t) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_wchar_t=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (wchar_t)); } -static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } -#include -#include +#include + #include + int main () { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (wchar_t))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (wchar_t)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (wchar_t)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_wchar_t=`cat conftest.val` +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_wchar_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (wchar_t) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } - else - ac_cv_sizeof_wchar_t=0 - fi -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + ac_cv_c_bigendian=no fi -rm -f conftest.val +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -$as_echo "$ac_cv_sizeof_wchar_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of void*" >&5 -$as_echo_n "checking size of void*... " >&6; } -if test "${ac_cv_sizeof_voidp+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) >= 0)]; -test_array [0] = 0 +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) <= $ac_mid)]; -test_array [0] = 0 +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_cv_c_bigendian=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) < 0)]; -test_array [0] = 0 - +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) >= $ac_mid)]; -test_array [0] = 0 + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break +if ac_fn_cxx_try_run "$LINENO"; then : + ac_cv_c_bigendian=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 +$as_echo_n "checking size of char... " >&6; } +if ${ac_cv_sizeof_char+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : - ac_lo= ac_hi= +else + if test "$ac_cv_type_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (char) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_char=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 +$as_echo "$ac_cv_sizeof_char" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (void*))) <= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_voidp=$ac_lo;; -'') if test "$ac_cv_type_voidp" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned char" >&5 +$as_echo_n "checking size of unsigned char... " >&6; } +if ${ac_cv_sizeof_unsigned_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (unsigned char))" "ac_cv_sizeof_unsigned_char" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_unsigned_char" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +as_fn_error 77 "cannot compute sizeof (unsigned char) +See \`config.log' for more details" "$LINENO" 5; } else - ac_cv_sizeof_voidp=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -static long int longval () { return (long int) (sizeof (void*)); } -static unsigned long int ulongval () { return (long int) (sizeof (void*)); } -#include -#include -int -main () -{ + ac_cv_sizeof_unsigned_char=0 + fi +fi - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (void*))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (void*)))) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (void*)))) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_char" >&5 +$as_echo "$ac_cv_sizeof_unsigned_char" >&6; } - ; - return 0; -} + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_voidp=`cat conftest.val` + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of bool" >&5 +$as_echo_n "checking size of bool... " >&6; } +if ${ac_cv_sizeof_bool+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (bool))" "ac_cv_sizeof_bool" "$ac_includes_default"; then : -( exit $ac_status ) -if test "$ac_cv_type_voidp" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +else + if test "$ac_cv_type_bool" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void*) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } +as_fn_error 77 "cannot compute sizeof (bool) +See \`config.log' for more details" "$LINENO" 5; } else - ac_cv_sizeof_voidp=0 + ac_cv_sizeof_bool=0 fi fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5 -$as_echo "$ac_cv_sizeof_voidp" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_bool" >&5 +$as_echo "$ac_cv_sizeof_bool" >&6; } cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOIDP $ac_cv_sizeof_voidp +#define SIZEOF_BOOL $ac_cv_sizeof_bool _ACEOF +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : +else + if test "$ac_cv_type_short" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_short=0 + fi +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } -{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 -$as_echo_n "checking for struct sockaddr_in6... " >&6; } -if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_struct_sockaddr_in6=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ -if (sizeof (struct sockaddr_in6)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ -if (sizeof ((struct sockaddr_in6))) - return 0; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_int" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_int=0 + fi +fi - ac_cv_type_struct_sockaddr_in6=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 -$as_echo "$ac_cv_type_struct_sockaddr_in6" >&6; } -if test "x$ac_cv_type_struct_sockaddr_in6" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKADDR_IN6 1 +#define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF -fi -{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5 -$as_echo_n "checking for struct sockaddr_storage... " >&6; } -if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_type_struct_sockaddr_storage=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ -if (sizeof (struct sockaddr_storage)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : -int -main () -{ -if (sizeof ((struct sockaddr_storage))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi - ac_cv_type_struct_sockaddr_storage=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } +if ${ac_cv_sizeof_float+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_float" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_float=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5 -$as_echo "$ac_cv_type_struct_sockaddr_storage" >&6; } -if test "x$ac_cv_type_struct_sockaddr_storage" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } + + cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +#define SIZEOF_FLOAT $ac_cv_sizeof_float _ACEOF -fi -{ $as_echo "$as_me:$LINENO: checking for struct lifconf" >&5 -$as_echo_n "checking for struct lifconf... " >&6; } -if test "${ac_cv_type_struct_lifconf+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } +if ${ac_cv_sizeof_double+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_type_struct_lifconf=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ -if (sizeof (struct lifconf)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : -int -main () -{ -if (sizeof ((struct lifconf))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_double=0 + fi +fi - ac_cv_type_struct_lifconf=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } +if ${ac_cv_sizeof_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_double" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long double) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_double=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_lifconf" >&5 -$as_echo "$ac_cv_type_struct_lifconf" >&6; } -if test "x$ac_cv_type_struct_lifconf" = x""yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_LIFCONF 1 -_ACEOF -fi +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +_ACEOF -{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_in.sin_len" >&5 -$as_echo_n "checking for struct sockaddr_in.sin_len... " >&6; } -if test "${ac_cv_member_struct_sockaddr_in_sin_len+set}" = set; then +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } +if ${ac_cv_sizeof_wchar_t+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default"; then : -int -main () -{ -static struct sockaddr_in ac_aggr; -if (ac_aggr.sin_len) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sockaddr_in_sin_len=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if test "$ac_cv_type_wchar_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (wchar_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_wchar_t=0 + fi +fi - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } -int -main () -{ -static struct sockaddr_in ac_aggr; -if (sizeof ac_aggr.sin_len) -return 0; - ; - return 0; -} + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sockaddr_in_sin_len=yes + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 +$as_echo_n "checking size of void*... " >&6; } +if ${ac_cv_sizeof_voidp+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : - ac_cv_member_struct_sockaddr_in_sin_len=no +else + if test "$ac_cv_type_voidp" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void*) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_voidp=0 + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 +$as_echo "$ac_cv_sizeof_voidp" >&6; } + -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in_sin_len" >&5 -$as_echo "$ac_cv_member_struct_sockaddr_in_sin_len" >&6; } -if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 +#define SIZEOF_VOIDP $ac_cv_sizeof_voidp _ACEOF -fi -{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_in.sin_zero" >&5 -$as_echo_n "checking for struct sockaddr_in.sin_zero... " >&6; } -if test "${ac_cv_member_struct_sockaddr_in_sin_zero+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + + + +ac_fn_cxx_check_type "$LINENO" "struct sockaddr_in6" "ac_cv_type_struct_sockaddr_in6" "#include #include +#include #include +" +if test "x$ac_cv_type_struct_sockaddr_in6" = xyes; then : -int -main () -{ -static struct sockaddr_in ac_aggr; -if (ac_aggr.sin_zero) -return 0; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_IN6 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sockaddr_in_sin_zero=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include + +fi +ac_fn_cxx_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include #include +#include #include +" +if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then : -int -main () -{ -static struct sockaddr_in ac_aggr; -if (sizeof ac_aggr.sin_zero) -return 0; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_member_struct_sockaddr_in_sin_zero=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_member_struct_sockaddr_in_sin_zero=no + fi +ac_fn_cxx_check_type "$LINENO" "struct lifconf" "ac_cv_type_struct_lifconf" "#include +#include +#include +#include +" +if test "x$ac_cv_type_struct_lifconf" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_LIFCONF 1 +_ACEOF + -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +ac_fn_cxx_check_member "$LINENO" "struct sockaddr_in" "sin_len" "ac_cv_member_struct_sockaddr_in_sin_len" "#include +#include +#include +" +if test "x$ac_cv_member_struct_sockaddr_in_sin_len" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1 +_ACEOF + + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in_sin_zero" >&5 -$as_echo "$ac_cv_member_struct_sockaddr_in_sin_zero" >&6; } -if test "x$ac_cv_member_struct_sockaddr_in_sin_zero" = x""yes; then +ac_fn_cxx_check_member "$LINENO" "struct sockaddr_in" "sin_zero" "ac_cv_member_struct_sockaddr_in_sin_zero" "#include +#include +#include +" +if test "x$ac_cv_member_struct_sockaddr_in_sin_zero" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SOCKADDR_IN_SIN_ZERO 1 @@ -10698,9 +6040,9 @@ -{ $as_echo "$as_me:$LINENO: checking whether the compiler recognizes bool as a built-in type" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler recognizes bool as a built-in type" >&5 $as_echo_n "checking whether the compiler recognizes bool as a built-in type... " >&6; } -if test "${ac_cv_cxx_bool+set}" = set; then +if ${ac_cv_cxx_bool+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10710,11 +6052,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int f(int x){return 1;} @@ -10729,32 +6067,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_bool=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_bool=no + ac_cv_cxx_bool=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -10764,19 +6081,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_bool" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_bool" >&5 $as_echo "$ac_cv_cxx_bool" >&6; } if test "$ac_cv_cxx_bool" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_BOOL /**/ -_ACEOF +$as_echo "#define HAVE_BOOL /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports const_cast<>" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports const_cast<>" >&5 $as_echo_n "checking whether the compiler supports const_cast<>... " >&6; } -if test "${ac_cv_cxx_const_cast+set}" = set; then +if ${ac_cv_cxx_const_cast+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10786,11 +6101,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10801,32 +6112,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_const_cast=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_const_cast=no + ac_cv_cxx_const_cast=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -10836,19 +6126,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_const_cast" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_const_cast" >&5 $as_echo "$ac_cv_cxx_const_cast" >&6; } if test "$ac_cv_cxx_const_cast" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CONST_CAST /**/ -_ACEOF +$as_echo "#define HAVE_CONST_CAST /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports dynamic_cast<>" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports dynamic_cast<>" >&5 $as_echo_n "checking whether the compiler supports dynamic_cast<>... " >&6; } -if test "${ac_cv_cxx_dynamic_cast+set}" = set; then +if ${ac_cv_cxx_dynamic_cast+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10858,11 +6146,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include class Base { public : Base () {} virtual void f () = 0;}; @@ -10876,32 +6160,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_dynamic_cast=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_dynamic_cast=no + ac_cv_cxx_dynamic_cast=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -10911,19 +6174,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_dynamic_cast" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_dynamic_cast" >&5 $as_echo "$ac_cv_cxx_dynamic_cast" >&6; } if test "$ac_cv_cxx_dynamic_cast" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_DYNAMIC_CAST /**/ -_ACEOF +$as_echo "#define HAVE_DYNAMIC_CAST /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports reinterpret_cast<>" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports reinterpret_cast<>" >&5 $as_echo_n "checking whether the compiler supports reinterpret_cast<>... " >&6; } -if test "${ac_cv_cxx_reinterpret_cast+set}" = set; then +if ${ac_cv_cxx_reinterpret_cast+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10933,11 +6194,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include class Base { public : Base () {} virtual void f () = 0;}; @@ -10953,32 +6210,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_reinterpret_cast=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_reinterpret_cast=no + ac_cv_cxx_reinterpret_cast=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -10988,19 +6224,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_reinterpret_cast" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_reinterpret_cast" >&5 $as_echo "$ac_cv_cxx_reinterpret_cast" >&6; } if test "$ac_cv_cxx_reinterpret_cast" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_REINTERPRET_CAST /**/ -_ACEOF +$as_echo "#define HAVE_REINTERPRET_CAST /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler implements namespaces" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler implements namespaces" >&5 $as_echo_n "checking whether the compiler implements namespaces... " >&6; } -if test "${ac_cv_cxx_namespaces+set}" = set; then +if ${ac_cv_cxx_namespaces+:} false; then : $as_echo_n "(cached) " >&6 else @@ -11010,11 +6244,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ namespace Outer { namespace Inner { int i = 0; }} int @@ -11025,32 +6255,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_namespaces=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_namespaces=no + ac_cv_cxx_namespaces=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11060,19 +6269,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_namespaces" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_namespaces" >&5 $as_echo "$ac_cv_cxx_namespaces" >&6; } if test "$ac_cv_cxx_namespaces" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_NAMESPACES /**/ -_ACEOF +$as_echo "#define HAVE_NAMESPACES /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports ISO C++ standard library" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports ISO C++ standard library" >&5 $as_echo_n "checking whether the compiler supports ISO C++ standard library... " >&6; } -if test "${ac_cv_cxx_have_std+set}" = set; then +if ${ac_cv_cxx_have_std+:} false; then : $as_echo_n "(cached) " >&6 else @@ -11083,11 +6290,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -11104,32 +6307,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_std=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_have_std=no + ac_cv_cxx_have_std=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11139,19 +6321,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_have_std" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_std" >&5 $as_echo "$ac_cv_cxx_have_std" >&6; } if test "$ac_cv_cxx_have_std" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD /**/ -_ACEOF +$as_echo "#define HAVE_STD /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports member constants" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports member constants" >&5 $as_echo_n "checking whether the compiler supports member constants... " >&6; } -if test "${ac_cv_cxx_member_constants+set}" = set; then +if ${ac_cv_cxx_member_constants+:} false; then : $as_echo_n "(cached) " >&6 else @@ -11161,11 +6341,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ class C {public: static const int i = 0;}; const int C::i; int @@ -11176,32 +6352,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_member_constants=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_member_constants=no + ac_cv_cxx_member_constants=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11211,20 +6366,18 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_member_constants" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_member_constants" >&5 $as_echo "$ac_cv_cxx_member_constants" >&6; } if test "$ac_cv_cxx_member_constants" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_MEMBER_CONSTANTS /**/ -_ACEOF +$as_echo "#define HAVE_MEMBER_CONSTANTS /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports exceptions" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports exceptions" >&5 $as_echo_n "checking whether the compiler supports exceptions... " >&6; } -if test "${ac_cv_cxx_exceptions+set}" = set; then +if ${ac_cv_cxx_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else @@ -11234,11 +6387,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11249,32 +6398,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_exceptions=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_cxx_exceptions=no + ac_cv_cxx_exceptions=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11284,19 +6412,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_exceptions" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_exceptions" >&5 $as_echo "$ac_cv_cxx_exceptions" >&6; } if test "$ac_cv_cxx_exceptions" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_EXCEPTIONS /**/ -_ACEOF +$as_echo "#define HAVE_EXCEPTIONS /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether exceptions can be caught by base class" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether exceptions can be caught by base class" >&5 $as_echo_n "checking whether exceptions can be caught by base class... " >&6; } -if test "${omni_cv_cxx_catch_by_base+set}" = set; then +if ${omni_cv_cxx_catch_by_base+:} false; then : $as_echo_n "(cached) " >&6 else @@ -11306,14 +6432,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "$cross_compiling" = yes; then - omni_cv_cxx_catch_by_base=no + if test "$cross_compiling" = yes; then : + omni_cv_cxx_catch_by_base=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ class A { @@ -11338,42 +6460,15 @@ } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_run "$LINENO"; then : omni_cv_cxx_catch_by_base=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -omni_cv_cxx_catch_by_base=no + omni_cv_cxx_catch_by_base=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11382,19 +6477,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_cxx_catch_by_base" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_cxx_catch_by_base" >&5 $as_echo "$omni_cv_cxx_catch_by_base" >&6; } if test "$omni_cv_cxx_catch_by_base" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_CATCH_BY_BASE /**/ -_ACEOF +$as_echo "#define HAVE_CATCH_BY_BASE /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether base constructors have to be fully-qualified" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether base constructors have to be fully-qualified" >&5 $as_echo_n "checking whether base constructors have to be fully-qualified... " >&6; } -if test "${omni_cv_cxx_need_fq_base_ctor+set}" = set; then +if ${omni_cv_cxx_need_fq_base_ctor+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -11403,11 +6496,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test sub-classes */ @@ -11438,32 +6527,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_cxx_need_fq_base_ctor=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_cxx_need_fq_base_ctor=yes + omni_cv_cxx_need_fq_base_ctor=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11473,19 +6541,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_cxx_need_fq_base_ctor" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_cxx_need_fq_base_ctor" >&5 $as_echo "$omni_cv_cxx_need_fq_base_ctor" >&6; } if test "$omni_cv_cxx_need_fq_base_ctor" = yes; then -cat >>confdefs.h <<\_ACEOF -#define OMNI_REQUIRES_FQ_BASE_CTOR /**/ -_ACEOF +$as_echo "#define OMNI_REQUIRES_FQ_BASE_CTOR /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether the compiler supports covariant return types" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports covariant return types" >&5 $as_echo_n "checking whether the compiler supports covariant return types... " >&6; } -if test "${omni_cv_cxx_covariant_returns+set}" = set; then +if ${omni_cv_cxx_covariant_returns+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -11494,11 +6560,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ class A {}; @@ -11520,32 +6582,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_cxx_covariant_returns=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_cxx_covariant_returns=no + omni_cv_cxx_covariant_returns=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11555,19 +6596,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_cxx_covariant_returns" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_cxx_covariant_returns" >&5 $as_echo "$omni_cv_cxx_covariant_returns" >&6; } if test "$omni_cv_cxx_covariant_returns" = yes; then -cat >>confdefs.h <<\_ACEOF -#define OMNI_HAVE_COVARIANT_RETURNS /**/ -_ACEOF +$as_echo "#define OMNI_HAVE_COVARIANT_RETURNS /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether long is the same type as int" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long is the same type as int" >&5 $as_echo_n "checking whether long is the same type as int... " >&6; } -if test "${omni_cv_cxx_long_is_int+set}" = set; then +if ${omni_cv_cxx_long_is_int+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -11576,11 +6615,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int f(int x){return 1;} @@ -11594,32 +6629,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_cxx_long_is_int=no else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_cxx_long_is_int=yes + omni_cv_cxx_long_is_int=yes fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -11629,30 +6643,24 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_cxx_long_is_int" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_cxx_long_is_int" >&5 $as_echo "$omni_cv_cxx_long_is_int" >&6; } if test "$omni_cv_cxx_long_is_int" = yes; then -cat >>confdefs.h <<\_ACEOF -#define OMNI_LONG_IS_INT /**/ -_ACEOF +$as_echo "#define OMNI_LONG_IS_INT /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 $as_echo_n "checking for library containing getaddrinfo... " >&6; } -if test "${ac_cv_search_getaddrinfo+set}" = set; then +if ${ac_cv_search_getaddrinfo+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -11677,54 +6685,27 @@ ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_getaddrinfo=$ac_res -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_getaddrinfo+set}" = set; then +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_getaddrinfo+:} false; then : break fi done -if test "${ac_cv_search_getaddrinfo+set}" = set; then - : +if ${ac_cv_search_getaddrinfo+:} false; then : + else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 $as_echo "$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo -if test "$ac_res" != no; then +if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -11739,104 +6720,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - for ac_func in getaddrinfo gethostname getopt getpid gettimeofday -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -11844,101 +6732,11 @@ fi done - - for ac_func in getnameinfo inet_ntop -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -11946,106 +6744,11 @@ fi done - - - - - - - -for ac_func in isinf insinff isinfl localtime nanosleep poll sigaction -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +for ac_func in isinf insinff isinfl localtime nanosleep poll rand_r sigaction +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -12053,106 +6756,11 @@ fi done - - - - - - - for ac_func in sigvec snprintf strcasecmp strdup strerror strftime stricmp -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -12160,126 +6768,38 @@ fi done - - - - - - - for ac_func in strncasecmp strtoul strtoull strtouq uname vprintf vsnprintf -do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func +fi +done -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _ACEOF fi -done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then +if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -12291,59 +6811,28 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA_H 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking for alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then +if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca @@ -12359,7 +6848,7 @@ #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); +void *alloca (size_t); # endif # endif # endif @@ -12375,47 +6864,20 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ALLOCA 1 -_ACEOF +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -12425,21 +6887,15 @@ ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -cat >>confdefs.h <<\_ACEOF -#define C_ALLOCA 1 -_ACEOF +$as_echo "#define C_ALLOCA 1" >>confdefs.h -{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if test "${ac_cv_os_cray+set}" = set; then +if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray @@ -12449,7 +6905,7 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then + $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no @@ -12457,101 +6913,13 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - eval "$as_ac_var=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -12563,81 +6931,46 @@ done fi -{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then +if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -find_stack_direction () +find_stack_direction (int *addr, int depth) { - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; } int -main () +main (int argc, char **argv) { - return find_stack_direction () < 0; + return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_stack_direction=-1 + ac_cv_c_stack_direction=-1 fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } - cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF @@ -12652,9 +6985,9 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for IsNANorINF" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IsNANorINF" >&5 $as_echo_n "checking for IsNANorINF... " >&6; } -if test "${omni_cv_have_isnanorinf+set}" = set; then +if ${omni_cv_have_isnanorinf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -12663,11 +6996,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -12684,32 +7013,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_have_isnanorinf=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_have_isnanorinf=no + omni_cv_have_isnanorinf=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -12719,19 +7027,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_have_isnanorinf" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_have_isnanorinf" >&5 $as_echo "$omni_cv_have_isnanorinf" >&6; } if test "$omni_cv_have_isnanorinf" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNANORINF /**/ -_ACEOF +$as_echo "#define HAVE_ISNANORINF /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether SIG_IGN is available" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SIG_IGN is available" >&5 $as_echo_n "checking whether SIG_IGN is available... " >&6; } -if test "${omni_cv_sig_ign_available+set}" = set; then +if ${omni_cv_sig_ign_available+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -12740,11 +7046,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SIGNAL_H @@ -12768,32 +7070,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_sig_ign_available=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_sig_ign_available=no + omni_cv_sig_ign_available=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -12803,19 +7084,17 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_sig_ign_available" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_sig_ign_available" >&5 $as_echo "$omni_cv_sig_ign_available" >&6; } if test "$omni_cv_sig_ign_available" = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_SIG_IGN /**/ -_ACEOF +$as_echo "#define HAVE_SIG_IGN /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether gettimeofday() takes a timezone argument" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday() takes a timezone argument" >&5 $as_echo_n "checking whether gettimeofday() takes a timezone argument... " >&6; } -if test "${omni_cv_gettimeofday_timezone+set}" = set; then +if ${omni_cv_gettimeofday_timezone+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -12824,11 +7103,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_GETTIMEOFDAY @@ -12848,32 +7123,11 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_gettimeofday_timezone=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_gettimeofday_timezone=no + omni_cv_gettimeofday_timezone=no fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -12883,17 +7137,15 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_gettimeofday_timezone" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_gettimeofday_timezone" >&5 $as_echo "$omni_cv_gettimeofday_timezone" >&6; } if test "$omni_cv_gettimeofday_timezone" = yes; then -cat >>confdefs.h <<\_ACEOF -#define GETTIMEOFDAY_TIMEZONE /**/ -_ACEOF +$as_echo "#define GETTIMEOFDAY_TIMEZONE /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking third argument of getsockname" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking third argument of getsockname" >&5 $as_echo_n "checking third argument of getsockname... " >&6; } omni_cv_sockname_size_t=no ac_ext=cpp @@ -12902,11 +7154,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -12926,39 +7174,12 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ac_fn_cxx_try_compile "$LINENO"; then : omni_cv_sockname_size_t=socklen_t -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$omni_cv_sockname_size_t" = no; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -12971,60 +7192,87 @@ main () { - size_t l; - getsockname(0, 0, &l); + size_t l; + getsockname(0, 0, &l); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + omni_cv_sockname_size_t=size_t +else + omni_cv_sockname_size_t=int +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +cat >>confdefs.h <<_ACEOF +#define OMNI_SOCKNAME_SIZE_T $omni_cv_sockname_size_t +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_sockname_size_t" >&5 +$as_echo "$omni_cv_sockname_size_t" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __sync_add_and_fetch and __sync_sub_and_fetch are present" >&5 +$as_echo_n "checking whether __sync_add_and_fetch and __sync_sub_and_fetch are present... " >&6; } +if ${omni_cv_sync_add_and_fetch+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +int a = 1; +int b = __sync_add_and_fetch(&a, 1); +int c = __sync_sub_and_fetch(&b, 1); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - omni_cv_sockname_size_t=size_t +if ac_fn_cxx_try_link "$LINENO"; then : + omni_cv_sync_add_and_fetch=yes else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - omni_cv_sockname_size_t=int + omni_cv_sync_add_and_fetch=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi -cat >>confdefs.h <<_ACEOF -#define OMNI_SOCKNAME_SIZE_T $omni_cv_sockname_size_t -_ACEOF +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_sync_add_and_fetch" >&5 +$as_echo "$omni_cv_sync_add_and_fetch" >&6; } +if test "$omni_cv_sync_add_and_fetch" = yes; then - { $as_echo "$as_me:$LINENO: result: $omni_cv_sockname_size_t" >&5 -$as_echo "$omni_cv_sockname_size_t" >&6; } +$as_echo "#define OMNI_HAVE_SYNC_ADD_AND_FETCH /**/" >>confdefs.h +fi -{ $as_echo "$as_me:$LINENO: checking omniORB config file location" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking omniORB config file location" >&5 $as_echo_n "checking omniORB config file location... " >&6; } -if test "${omni_cv_omniorb_config+set}" = set; then +if ${omni_cv_omniorb_config+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --with-omniORB-config was given. -if test "${with_omniORB_config+set}" = set; then +if test "${with_omniORB_config+set}" = set; then : withval=$with_omniORB_config; omni_cv_omniorb_config=$withval else omni_cv_omniorb_config="/etc/omniORB.cfg" @@ -13032,7 +7280,7 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_omniorb_config" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_omniorb_config" >&5 $as_echo "$omni_cv_omniorb_config" >&6; } if test "$omni_cv_omniorb_config" = "no" || test "$omni_cv_omniorb_config" = "yes"; then echo "*** invalid omniORB config file '$omni_cv_omniorb_config'; using '/etc/omniORB.cfg'" @@ -13041,14 +7289,14 @@ OMNIORB_CONFIG=$omni_cv_omniorb_config -{ $as_echo "$as_me:$LINENO: checking omniNames log directory" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking omniNames log directory" >&5 $as_echo_n "checking omniNames log directory... " >&6; } -if test "${omni_cv_omninames_logdir+set}" = set; then +if ${omni_cv_omninames_logdir+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --with-omniNames-logdir was given. -if test "${with_omniNames_logdir+set}" = set; then +if test "${with_omniNames_logdir+set}" = set; then : withval=$with_omniNames_logdir; omni_cv_omninames_logdir=$withval else omni_cv_omninames_logdir="/var/omninames" @@ -13056,7 +7304,7 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_omninames_logdir" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_omninames_logdir" >&5 $as_echo "$omni_cv_omninames_logdir" >&6; } if test "$omni_cv_omninames_logdir" = "no" || test "$omni_cv_omninames_logdir" = "yes"; then echo "*** invalid omniNames log directory '$omni_cv_omninames_logdir'; using '/var/omninames'" @@ -13065,13 +7313,13 @@ OMNINAMES_LOGDIR=$omni_cv_omninames_logdir -{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } -if test "${omni_cv_enable_static+set}" = set; then +if ${omni_cv_enable_static+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then +if test "${enable_static+set}" = set; then : enableval=$enable_static; omni_cv_enable_static=$enableval else omni_cv_enable_static=yes @@ -13079,18 +7327,18 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_enable_static" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_enable_static" >&5 $as_echo "$omni_cv_enable_static" >&6; } ENABLE_STATIC=$omni_cv_enable_static -{ $as_echo "$as_me:$LINENO: checking whether to trace threads and locking" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to trace threads and locking" >&5 $as_echo_n "checking whether to trace threads and locking... " >&6; } -if test "${omni_cv_enable_thread_tracing+set}" = set; then +if ${omni_cv_enable_thread_tracing+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --enable-thread-tracing was given. -if test "${enable_thread_tracing+set}" = set; then +if test "${enable_thread_tracing+set}" = set; then : enableval=$enable_thread_tracing; omni_cv_enable_thread_tracing=$enableval else omni_cv_enable_thread_tracing=no @@ -13098,23 +7346,21 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_enable_thread_tracing" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_enable_thread_tracing" >&5 $as_echo "$omni_cv_enable_thread_tracing" >&6; } if test "$omni_cv_enable_thread_tracing" = "yes"; then -cat >>confdefs.h <<\_ACEOF -#define OMNIORB_ENABLE_LOCK_TRACES /**/ -_ACEOF +$as_echo "#define OMNIORB_ENABLE_LOCK_TRACES /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether to support IPv6" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support IPv6" >&5 $as_echo_n "checking whether to support IPv6... " >&6; } -if test "${omni_cv_enable_ipv6+set}" = set; then +if ${omni_cv_enable_ipv6+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then +if test "${enable_ipv6+set}" = set; then : enableval=$enable_ipv6; omni_cv_enable_ipv6=$enableval else omni_cv_enable_ipv6=yes @@ -13122,23 +7368,21 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_enable_ipv6" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_enable_ipv6" >&5 $as_echo "$omni_cv_enable_ipv6" >&6; } if test "$omni_cv_enable_ipv6" = "no"; then -cat >>confdefs.h <<\_ACEOF -#define OMNI_DISABLE_IPV6 /**/ -_ACEOF +$as_echo "#define OMNI_DISABLE_IPV6 /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether alloca should be used in omnicpp" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether alloca should be used in omnicpp" >&5 $as_echo_n "checking whether alloca should be used in omnicpp... " >&6; } -if test "${omni_cv_enable_alloca+set}" = set; then +if ${omni_cv_enable_alloca+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --enable-alloca was given. -if test "${enable_alloca+set}" = set; then +if test "${enable_alloca+set}" = set; then : enableval=$enable_alloca; omni_cv_enable_alloca=$enableval else omni_cv_enable_alloca=yes @@ -13146,23 +7390,21 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_enable_alloca" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_enable_alloca" >&5 $as_echo "$omni_cv_enable_alloca" >&6; } if test "$omni_cv_enable_alloca" = "no"; then -cat >>confdefs.h <<\_ACEOF -#define OMNIORB_DISABLE_ALLOCA /**/ -_ACEOF +$as_echo "#define OMNIORB_DISABLE_ALLOCA /**/" >>confdefs.h fi -{ $as_echo "$as_me:$LINENO: checking whether to support long double" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support long double" >&5 $as_echo_n "checking whether to support long double... " >&6; } -if test "${omni_cv_enable_longdouble+set}" = set; then +if ${omni_cv_enable_longdouble+:} false; then : $as_echo_n "(cached) " >&6 else # Check whether --enable-longdouble was given. -if test "${enable_longdouble+set}" = set; then +if test "${enable_longdouble+set}" = set; then : enableval=$enable_longdouble; omni_cv_enable_longdouble=$enableval else omni_cv_enable_longdouble=yes @@ -13170,18 +7412,82 @@ fi -{ $as_echo "$as_me:$LINENO: result: $omni_cv_enable_longdouble" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_enable_longdouble" >&5 $as_echo "$omni_cv_enable_longdouble" >&6; } if test "$omni_cv_enable_longdouble" = "no"; then -cat >>confdefs.h <<\_ACEOF -#define OMNIORB_DISABLE_LONGDOUBLE /**/ -_ACEOF +$as_echo "#define OMNIORB_DISABLE_LONGDOUBLE /**/" >>confdefs.h fi ENABLE_LONGDOUBLE=$omni_cv_enable_longdouble +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use atomic operations when possible" >&5 +$as_echo_n "checking whether to use atomic operations when possible... " >&6; } +if ${omni_cv_enable_atomic+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Check whether --enable-atomic was given. +if test "${enable_atomic+set}" = set; then : + enableval=$enable_atomic; omni_cv_enable_atomic=$enableval +else + omni_cv_enable_atomic=yes +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $omni_cv_enable_atomic" >&5 +$as_echo "$omni_cv_enable_atomic" >&6; } +if test "$omni_cv_enable_atomic" = "no"; then + +$as_echo "#define OMNI_DISABLE_ATOMIC_OPS /**/" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 +$as_echo_n "checking for compress2 in -lz... " >&6; } +if ${ac_cv_lib_z_compress2+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char compress2 (); +int +main () +{ +return compress2 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_z_compress2=yes +else + ac_cv_lib_z_compress2=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress2" >&5 +$as_echo "$ac_cv_lib_z_compress2" >&6; } +if test "x$ac_cv_lib_z_compress2" = xyes; then : + omni_cv_enable_ziop=yes +else + omni_cv_enable_ziop=no +fi + +ENABLE_ZIOP=$omni_cv_enable_ziop + @@ -13227,6 +7533,7 @@ case "$host" in *-*-linux-*) plat_name="Linux"; plat_def="__linux__"; os_v="2";; + *-*-uclinux-*) plat_name="Linux"; plat_def="__linux__"; os_v="2";; *-*-cygwin*) plat_name="Cygwin"; plat_def="__cygwin__"; os_v="1";; *-*-solaris*) plat_name="SunOS"; plat_def="__sunos__"; os_v="5";; *-*-osf3*) plat_name="OSF1"; plat_def="__osf1__"; os_v="3";; @@ -13244,10 +7551,12 @@ *-*-freebsd5*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="5";; *-*-freebsd6*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="6";; *-*-freebsd7*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="7";; + *-*-freebsd8*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="8";; *-*-kfreebsd*) plat_name="kFreeBSD"; plat_def="__FreeBSD_kernel__"; os_v="6";; *-*-netbsd*) plat_name="NetBSD"; plat_def="__netbsd__"; os_v="1";; *-*-openbsd*) plat_name="OpenBSD"; plat_def="__openbsd__"; os_v="3";; *-*-sco*) plat_name="OSR5"; plat_def="__osr5__"; os_v="5";; + *-*-gnu*) plat_name="GNU"; plat_def="__hurd__" ; os_v="0";; esac PLATFORM_NAME=$plat_name @@ -13286,7 +7595,9 @@ ac_config_files="$ac_config_files src/tool/omniidl/python/scripts/omniidl" -ac_config_files="$ac_config_files src/appl/GNUmakefile src/appl/omniMapper/GNUmakefile src/appl/omniNames/GNUmakefile src/appl/utils/catior/GNUmakefile src/appl/utils/convertior/GNUmakefile src/appl/utils/GNUmakefile src/appl/utils/genior/GNUmakefile src/appl/utils/nameclt/GNUmakefile src/GNUmakefile src/examples/anyExample/GNUmakefile src/examples/bidir/GNUmakefile src/examples/boa/GNUmakefile src/examples/call_back/GNUmakefile src/examples/dii/GNUmakefile src/examples/GNUmakefile src/examples/dsi/GNUmakefile src/examples/echo/GNUmakefile src/examples/poa/GNUmakefile src/examples/poa/implicit_activation/GNUmakefile src/examples/poa/persistent_objref/GNUmakefile src/examples/poa/servant_manager/GNUmakefile src/examples/poa/threading/GNUmakefile src/examples/ssl_echo/GNUmakefile src/examples/thread/GNUmakefile src/examples/valuetype/GNUmakefile src/examples/valuetype/simple/GNUmakefile src/lib/GNUmakefile src/lib/omniORB/codesets/GNUmakefile src/lib/omniORB/GNUmakefile src/lib/omniORB/dynamic/GNUmakefile src/lib/omniORB/omniidl_be/cxx/GNUmakefile src/lib/omniORB/omniidl_be/cxx/dynskel/GNUmakefile src/lib/omniORB/omniidl_be/cxx/header/GNUmakefile src/lib/omniORB/omniidl_be/cxx/impl/GNUmakefile src/lib/omniORB/omniidl_be/cxx/skel/GNUmakefile src/lib/omniORB/omniidl_be/GNUmakefile src/lib/omniORB/orbcore/GNUmakefile src/lib/omniORB/orbcore/ssl/GNUmakefile src/lib/omniORB/connections/GNUmakefile src/lib/omnithread/GNUmakefile src/services/GNUmakefile src/services/mklib/GNUmakefile src/services/mklib/stublib/GNUmakefile src/services/mklib/dynstublib/GNUmakefile src/services/mklib/mkBOAlib/GNUmakefile src/tool/GNUmakefile src/tool/omkdepend/GNUmakefile src/tool/omniidl/cxx/cccp/GNUmakefile src/tool/omniidl/cxx/GNUmakefile src/tool/omniidl/GNUmakefile src/tool/omniidl/python/GNUmakefile src/tool/omniidl/python/omniidl_be/GNUmakefile src/tool/omniidl/python/omniidl/GNUmakefile src/tool/omniidl/python/scripts/GNUmakefile" +ac_config_files="$ac_config_files src/tool/omniidl/python3/scripts/omniidl" + +ac_config_files="$ac_config_files src/appl/GNUmakefile src/appl/omniMapper/GNUmakefile src/appl/omniNames/GNUmakefile src/appl/utils/catior/GNUmakefile src/appl/utils/convertior/GNUmakefile src/appl/utils/GNUmakefile src/appl/utils/genior/GNUmakefile src/appl/utils/nameclt/GNUmakefile src/GNUmakefile src/examples/ami/GNUmakefile src/examples/anyExample/GNUmakefile src/examples/bidir/GNUmakefile src/examples/boa/GNUmakefile src/examples/call_back/GNUmakefile src/examples/dii/GNUmakefile src/examples/GNUmakefile src/examples/dsi/GNUmakefile src/examples/echo/GNUmakefile src/examples/poa/GNUmakefile src/examples/poa/implicit_activation/GNUmakefile src/examples/poa/persistent_objref/GNUmakefile src/examples/poa/servant_manager/GNUmakefile src/examples/poa/threading/GNUmakefile src/examples/poa/shortcut/GNUmakefile src/examples/ssl_echo/GNUmakefile src/examples/thread/GNUmakefile src/examples/valuetype/GNUmakefile src/examples/valuetype/simple/GNUmakefile src/examples/ziop/GNUmakefile src/lib/GNUmakefile src/lib/omniORB/codesets/GNUmakefile src/lib/omniORB/GNUmakefile src/lib/omniORB/dynamic/GNUmakefile src/lib/omniORB/python/omniidl_be/cxx/GNUmakefile src/lib/omniORB/python/omniidl_be/cxx/dynskel/GNUmakefile src/lib/omniORB/python/omniidl_be/cxx/header/GNUmakefile src/lib/omniORB/python/omniidl_be/cxx/impl/GNUmakefile src/lib/omniORB/python/omniidl_be/cxx/skel/GNUmakefile src/lib/omniORB/python/omniidl_be/GNUmakefile src/lib/omniORB/python/GNUmakefile src/lib/omniORB/python3/omniidl_be/cxx/GNUmakefile src/lib/omniORB/python3/omniidl_be/cxx/dynskel/GNUmakefile src/lib/omniORB/python3/omniidl_be/cxx/header/GNUmakefile src/lib/omniORB/python3/omniidl_be/cxx/impl/GNUmakefile src/lib/omniORB/python3/omniidl_be/cxx/skel/GNUmakefile src/lib/omniORB/python3/omniidl_be/GNUmakefile src/lib/omniORB/python3/GNUmakefile src/lib/omniORB/orbcore/GNUmakefile src/lib/omniORB/orbcore/ssl/GNUmakefile src/lib/omniORB/connections/GNUmakefile src/lib/omniORB/ziop/GNUmakefile src/lib/omniORB/ziopdynamic/GNUmakefile src/lib/omnithread/GNUmakefile src/services/GNUmakefile src/services/mklib/GNUmakefile src/services/mklib/stublib/GNUmakefile src/services/mklib/dynstublib/GNUmakefile src/services/mklib/mkBOAlib/GNUmakefile src/tool/GNUmakefile src/tool/omkdepend/GNUmakefile src/tool/omniidl/cxx/cccp/GNUmakefile src/tool/omniidl/cxx/GNUmakefile src/tool/omniidl/GNUmakefile src/tool/omniidl/python/GNUmakefile src/tool/omniidl/python/omniidl_be/GNUmakefile src/tool/omniidl/python/omniidl/GNUmakefile src/tool/omniidl/python/scripts/GNUmakefile src/tool/omniidl/python3/GNUmakefile src/tool/omniidl/python3/omniidl_be/GNUmakefile src/tool/omniidl/python3/omniidl/GNUmakefile src/tool/omniidl/python3/scripts/GNUmakefile" ac_config_files="$ac_config_files include/GNUmakefile include/omniconfig.h include/omnithread/GNUmakefile include/omniORB4/GNUmakefile include/omniORB4/internal/GNUmakefile" @@ -13301,7 +7612,7 @@ ac_config_files="$ac_config_files contrib/GNUmakefile contrib/pkgconfig/GNUmakefile" -ac_config_files="$ac_config_files contrib/pkgconfig/omnithread3.pc contrib/pkgconfig/omniORB4.pc contrib/pkgconfig/omniDynamic4.pc contrib/pkgconfig/omniCOS4.pc contrib/pkgconfig/omniCOSDynamic4.pc contrib/pkgconfig/omniConnectionMgmt4.pc" +ac_config_files="$ac_config_files contrib/pkgconfig/omnithread3.pc contrib/pkgconfig/omniORB4.pc contrib/pkgconfig/omniDynamic4.pc contrib/pkgconfig/omniCOS4.pc contrib/pkgconfig/omniCOSDynamic4.pc contrib/pkgconfig/omniConnectionMgmt4.pc contrib/pkgconfig/omniZIOP4.pc contrib/pkgconfig/omniZIOPDynamic4.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13330,13 +7641,13 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; + *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done @@ -13344,8 +7655,8 @@ (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -13367,12 +7678,23 @@ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -13386,14 +7708,15 @@ ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -13402,13 +7725,14 @@ -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -13418,17 +7742,18 @@ debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -13436,23 +7761,15 @@ alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -13460,7 +7777,13 @@ as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -13471,7 +7794,7 @@ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -13494,13 +7817,6 @@ } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -13510,15 +7826,16 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +as_myself= +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; @@ -13530,12 +7847,16 @@ fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } + exit 1 fi -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' @@ -13547,7 +7868,89 @@ LANGUAGE=C export LANGUAGE -# Required to use basename. +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -13561,8 +7964,12 @@ as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -13582,76 +7989,25 @@ } s/.*/./; q'` -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in +case `echo -n x` in #((((( -n*) - case `echo 'x\c'` in + case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -13666,49 +8022,85 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -13718,13 +8110,19 @@ exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -# Save the log message, to keep $[0] and so on meaningful, and to +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by omniORB $as_me 4.1.6, which was -generated by GNU Autoconf 2.63. Invocation command line was +This file was extended by omniORB $as_me 4.2.2, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -13755,13 +8153,15 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -13777,16 +8177,17 @@ Configuration headers: $config_headers -Report bugs to ." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -omniORB config.status 4.1.6 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +omniORB config.status 4.2.2 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -13802,11 +8203,16 @@ while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -13820,27 +8226,29 @@ ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -13848,11 +8256,10 @@ ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" + *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac @@ -13869,7 +8276,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -13903,6 +8310,7 @@ "mk/afterauto.mk") CONFIG_FILES="$CONFIG_FILES mk/afterauto.mk" ;; "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;; "src/tool/omniidl/python/scripts/omniidl") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python/scripts/omniidl" ;; + "src/tool/omniidl/python3/scripts/omniidl") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python3/scripts/omniidl" ;; "src/appl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/appl/GNUmakefile" ;; "src/appl/omniMapper/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/appl/omniMapper/GNUmakefile" ;; "src/appl/omniNames/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/appl/omniNames/GNUmakefile" ;; @@ -13912,6 +8320,7 @@ "src/appl/utils/genior/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/appl/utils/genior/GNUmakefile" ;; "src/appl/utils/nameclt/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/appl/utils/nameclt/GNUmakefile" ;; "src/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/GNUmakefile" ;; + "src/examples/ami/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/ami/GNUmakefile" ;; "src/examples/anyExample/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/anyExample/GNUmakefile" ;; "src/examples/bidir/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/bidir/GNUmakefile" ;; "src/examples/boa/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/boa/GNUmakefile" ;; @@ -13925,23 +8334,35 @@ "src/examples/poa/persistent_objref/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/poa/persistent_objref/GNUmakefile" ;; "src/examples/poa/servant_manager/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/poa/servant_manager/GNUmakefile" ;; "src/examples/poa/threading/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/poa/threading/GNUmakefile" ;; + "src/examples/poa/shortcut/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/poa/shortcut/GNUmakefile" ;; "src/examples/ssl_echo/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/ssl_echo/GNUmakefile" ;; "src/examples/thread/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/thread/GNUmakefile" ;; "src/examples/valuetype/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/valuetype/GNUmakefile" ;; "src/examples/valuetype/simple/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/valuetype/simple/GNUmakefile" ;; + "src/examples/ziop/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/examples/ziop/GNUmakefile" ;; "src/lib/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/GNUmakefile" ;; "src/lib/omniORB/codesets/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/codesets/GNUmakefile" ;; "src/lib/omniORB/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/GNUmakefile" ;; "src/lib/omniORB/dynamic/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/dynamic/GNUmakefile" ;; - "src/lib/omniORB/omniidl_be/cxx/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/cxx/GNUmakefile" ;; - "src/lib/omniORB/omniidl_be/cxx/dynskel/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/cxx/dynskel/GNUmakefile" ;; - "src/lib/omniORB/omniidl_be/cxx/header/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/cxx/header/GNUmakefile" ;; - "src/lib/omniORB/omniidl_be/cxx/impl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/cxx/impl/GNUmakefile" ;; - "src/lib/omniORB/omniidl_be/cxx/skel/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/cxx/skel/GNUmakefile" ;; - "src/lib/omniORB/omniidl_be/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/GNUmakefile" ;; + "src/lib/omniORB/python/omniidl_be/cxx/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/omniidl_be/cxx/GNUmakefile" ;; + "src/lib/omniORB/python/omniidl_be/cxx/dynskel/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/omniidl_be/cxx/dynskel/GNUmakefile" ;; + "src/lib/omniORB/python/omniidl_be/cxx/header/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/omniidl_be/cxx/header/GNUmakefile" ;; + "src/lib/omniORB/python/omniidl_be/cxx/impl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/omniidl_be/cxx/impl/GNUmakefile" ;; + "src/lib/omniORB/python/omniidl_be/cxx/skel/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/omniidl_be/cxx/skel/GNUmakefile" ;; + "src/lib/omniORB/python/omniidl_be/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/omniidl_be/GNUmakefile" ;; + "src/lib/omniORB/python/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python/GNUmakefile" ;; + "src/lib/omniORB/python3/omniidl_be/cxx/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/omniidl_be/cxx/GNUmakefile" ;; + "src/lib/omniORB/python3/omniidl_be/cxx/dynskel/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/omniidl_be/cxx/dynskel/GNUmakefile" ;; + "src/lib/omniORB/python3/omniidl_be/cxx/header/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/omniidl_be/cxx/header/GNUmakefile" ;; + "src/lib/omniORB/python3/omniidl_be/cxx/impl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/omniidl_be/cxx/impl/GNUmakefile" ;; + "src/lib/omniORB/python3/omniidl_be/cxx/skel/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/omniidl_be/cxx/skel/GNUmakefile" ;; + "src/lib/omniORB/python3/omniidl_be/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/omniidl_be/GNUmakefile" ;; + "src/lib/omniORB/python3/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/python3/GNUmakefile" ;; "src/lib/omniORB/orbcore/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/orbcore/GNUmakefile" ;; "src/lib/omniORB/orbcore/ssl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/orbcore/ssl/GNUmakefile" ;; "src/lib/omniORB/connections/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/connections/GNUmakefile" ;; + "src/lib/omniORB/ziop/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/ziop/GNUmakefile" ;; + "src/lib/omniORB/ziopdynamic/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/ziopdynamic/GNUmakefile" ;; "src/lib/omnithread/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/lib/omnithread/GNUmakefile" ;; "src/services/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/services/GNUmakefile" ;; "src/services/mklib/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/services/mklib/GNUmakefile" ;; @@ -13957,6 +8378,10 @@ "src/tool/omniidl/python/omniidl_be/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python/omniidl_be/GNUmakefile" ;; "src/tool/omniidl/python/omniidl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python/omniidl/GNUmakefile" ;; "src/tool/omniidl/python/scripts/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python/scripts/GNUmakefile" ;; + "src/tool/omniidl/python3/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python3/GNUmakefile" ;; + "src/tool/omniidl/python3/omniidl_be/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python3/omniidl_be/GNUmakefile" ;; + "src/tool/omniidl/python3/omniidl/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python3/omniidl/GNUmakefile" ;; + "src/tool/omniidl/python3/scripts/GNUmakefile") CONFIG_FILES="$CONFIG_FILES src/tool/omniidl/python3/scripts/GNUmakefile" ;; "include/GNUmakefile") CONFIG_FILES="$CONFIG_FILES include/GNUmakefile" ;; "include/omniconfig.h") CONFIG_FILES="$CONFIG_FILES include/omniconfig.h" ;; "include/omnithread/GNUmakefile") CONFIG_FILES="$CONFIG_FILES include/omnithread/GNUmakefile" ;; @@ -13973,10 +8398,10 @@ "contrib/pkgconfig/omniCOS4.pc") CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniCOS4.pc" ;; "contrib/pkgconfig/omniCOSDynamic4.pc") CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniCOSDynamic4.pc" ;; "contrib/pkgconfig/omniConnectionMgmt4.pc") CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniConnectionMgmt4.pc" ;; + "contrib/pkgconfig/omniZIOP4.pc") CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniZIOP4.pc" ;; + "contrib/pkgconfig/omniZIOPDynamic4.pc") CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniZIOPDynamic4.pc" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -13998,26 +8423,24 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -14025,8 +8448,13 @@ if test -n "$CONFIG_FILES"; then -ac_cr=' -' +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -14034,7 +8462,7 @@ ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -14043,24 +8471,18 @@ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -14068,7 +8490,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -14082,7 +8504,7 @@ t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -14096,7 +8518,7 @@ t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -14116,7 +8538,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -14148,23 +8570,29 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -14176,7 +8604,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -14188,13 +8616,11 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -14279,9 +8705,7 @@ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -14294,9 +8718,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -14315,7 +8737,7 @@ for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -14324,12 +8746,10 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -14340,7 +8760,7 @@ `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -14352,10 +8772,8 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -14383,47 +8801,7 @@ q } s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in @@ -14475,7 +8853,6 @@ # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= - ac_sed_dataroot=' /datarootdir/ { p @@ -14485,12 +8862,11 @@ /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p -' +/@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -14500,7 +8876,7 @@ s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -14527,27 +8903,24 @@ s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -14556,27 +8929,21 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -14586,15 +8953,12 @@ done # for ac_tag -{ (exit 0); exit 0; } +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -14615,10 +8979,10 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff -Nru omniorb-dfsg-4.1.6/configure.ac omniorb-dfsg-4.2.2/configure.ac --- omniorb-dfsg-4.1.6/configure.ac 2011-06-24 21:37:28.000000000 +0000 +++ omniorb-dfsg-4.2.2/configure.ac 2017-05-10 23:52:28.000000000 +0000 @@ -1,5 +1,5 @@ dnl -*- M4 -*- -AC_INIT(omniORB, 4.1.6, bugs@omniorb-support.com) +AC_INIT(omniORB, 4.2.2, bugs@omniorb-support.com) AC_PREREQ(2.52) AC_CONFIG_SRCDIR(bin/scripts/omkdirhier) @@ -37,6 +37,24 @@ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + +dnl ** Cross compilation + +if test "$cross_compiling" = yes; then + AC_PATH_PROG(OMNIIDL, omniidl, no) + if test "x$ac_cv_path_OMNIIDL" = "xno"; then + AC_MSG_ERROR(cannot find omniidl on the path) + fi + + AC_PATH_PROG(OMKDEPEND, omkdepend, no) + if test "x$ac_cv_path_OMKDEPEND" = "xno"; then + AC_MSG_ERROR(cannot find omkdepend on the path) + fi +fi + +AC_SUBST(CROSS_COMPILING, $cross_compiling) + + AC_LANG(C++) dnl OMNI_CHECK_NO_UNIT_AT_A_TIME @@ -116,7 +134,7 @@ AC_LANG(C) AC_CHECK_FUNCS(getaddrinfo gethostname getopt getpid gettimeofday) AC_CHECK_FUNCS(getnameinfo inet_ntop) -AC_CHECK_FUNCS(isinf insinff isinfl localtime nanosleep poll sigaction) +AC_CHECK_FUNCS(isinf insinff isinfl localtime nanosleep poll rand_r sigaction) AC_CHECK_FUNCS(sigvec snprintf strcasecmp strdup strerror strftime stricmp) AC_CHECK_FUNCS(strncasecmp strtoul strtoull strtouq uname vprintf vsnprintf) AC_FUNC_ALLOCA @@ -126,7 +144,7 @@ OMNI_HAVE_SIG_IGN OMNI_GETTIMEOFDAY_TIMEZONE OMNI_SOCKNAME_ARG - +OMNI_SYNC_ADD_SUB_FETCH dnl ** omniORB config @@ -137,6 +155,8 @@ OMNI_DISABLE_IPV6_CHECK OMNI_DISABLE_ALLOCA OMNI_DISABLE_LONGDOUBLE +OMNI_DISABLE_ATOMIC +OMNI_ENABLE_ZIOP dnl ** Compiler name @@ -183,6 +203,7 @@ case "$host" in *-*-linux-*) plat_name="Linux"; plat_def="__linux__"; os_v="2";; + *-*-uclinux-*) plat_name="Linux"; plat_def="__linux__"; os_v="2";; *-*-cygwin*) plat_name="Cygwin"; plat_def="__cygwin__"; os_v="1";; *-*-solaris*) plat_name="SunOS"; plat_def="__sunos__"; os_v="5";; *-*-osf3*) plat_name="OSF1"; plat_def="__osf1__"; os_v="3";; @@ -200,10 +221,12 @@ *-*-freebsd5*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="5";; *-*-freebsd6*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="6";; *-*-freebsd7*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="7";; + *-*-freebsd8*) plat_name="FreeBSD"; plat_def="__freebsd__"; os_v="8";; *-*-kfreebsd*) plat_name="kFreeBSD"; plat_def="__FreeBSD_kernel__"; os_v="6";; *-*-netbsd*) plat_name="NetBSD"; plat_def="__netbsd__"; os_v="1";; *-*-openbsd*) plat_name="OpenBSD"; plat_def="__openbsd__"; os_v="3";; *-*-sco*) plat_name="OSR5"; plat_def="__osr5__"; os_v="5";; + *-*-gnu*) plat_name="GNU"; plat_def="__hurd__" ; os_v="0";; esac AC_SUBST(PLATFORM_NAME, $plat_name) @@ -237,6 +260,7 @@ AC_CONFIG_FILES(mk/beforeauto.mk mk/afterauto.mk GNUmakefile) AC_CONFIG_FILES(src/tool/omniidl/python/scripts/omniidl) +AC_CONFIG_FILES(src/tool/omniidl/python3/scripts/omniidl) AC_CONFIG_FILES(src/appl/GNUmakefile src/appl/omniMapper/GNUmakefile src/appl/omniNames/GNUmakefile @@ -246,6 +270,7 @@ src/appl/utils/genior/GNUmakefile src/appl/utils/nameclt/GNUmakefile src/GNUmakefile + src/examples/ami/GNUmakefile src/examples/anyExample/GNUmakefile src/examples/bidir/GNUmakefile src/examples/boa/GNUmakefile @@ -259,23 +284,35 @@ src/examples/poa/persistent_objref/GNUmakefile src/examples/poa/servant_manager/GNUmakefile src/examples/poa/threading/GNUmakefile + src/examples/poa/shortcut/GNUmakefile src/examples/ssl_echo/GNUmakefile src/examples/thread/GNUmakefile src/examples/valuetype/GNUmakefile src/examples/valuetype/simple/GNUmakefile + src/examples/ziop/GNUmakefile src/lib/GNUmakefile src/lib/omniORB/codesets/GNUmakefile src/lib/omniORB/GNUmakefile src/lib/omniORB/dynamic/GNUmakefile - src/lib/omniORB/omniidl_be/cxx/GNUmakefile - src/lib/omniORB/omniidl_be/cxx/dynskel/GNUmakefile - src/lib/omniORB/omniidl_be/cxx/header/GNUmakefile - src/lib/omniORB/omniidl_be/cxx/impl/GNUmakefile - src/lib/omniORB/omniidl_be/cxx/skel/GNUmakefile - src/lib/omniORB/omniidl_be/GNUmakefile + src/lib/omniORB/python/omniidl_be/cxx/GNUmakefile + src/lib/omniORB/python/omniidl_be/cxx/dynskel/GNUmakefile + src/lib/omniORB/python/omniidl_be/cxx/header/GNUmakefile + src/lib/omniORB/python/omniidl_be/cxx/impl/GNUmakefile + src/lib/omniORB/python/omniidl_be/cxx/skel/GNUmakefile + src/lib/omniORB/python/omniidl_be/GNUmakefile + src/lib/omniORB/python/GNUmakefile + src/lib/omniORB/python3/omniidl_be/cxx/GNUmakefile + src/lib/omniORB/python3/omniidl_be/cxx/dynskel/GNUmakefile + src/lib/omniORB/python3/omniidl_be/cxx/header/GNUmakefile + src/lib/omniORB/python3/omniidl_be/cxx/impl/GNUmakefile + src/lib/omniORB/python3/omniidl_be/cxx/skel/GNUmakefile + src/lib/omniORB/python3/omniidl_be/GNUmakefile + src/lib/omniORB/python3/GNUmakefile src/lib/omniORB/orbcore/GNUmakefile src/lib/omniORB/orbcore/ssl/GNUmakefile src/lib/omniORB/connections/GNUmakefile + src/lib/omniORB/ziop/GNUmakefile + src/lib/omniORB/ziopdynamic/GNUmakefile src/lib/omnithread/GNUmakefile src/services/GNUmakefile src/services/mklib/GNUmakefile @@ -291,6 +328,10 @@ src/tool/omniidl/python/omniidl_be/GNUmakefile src/tool/omniidl/python/omniidl/GNUmakefile src/tool/omniidl/python/scripts/GNUmakefile + src/tool/omniidl/python3/GNUmakefile + src/tool/omniidl/python3/omniidl_be/GNUmakefile + src/tool/omniidl/python3/omniidl/GNUmakefile + src/tool/omniidl/python3/scripts/GNUmakefile ) AC_CONFIG_FILES(include/GNUmakefile @@ -314,4 +355,6 @@ contrib/pkgconfig/omniCOS4.pc contrib/pkgconfig/omniCOSDynamic4.pc contrib/pkgconfig/omniConnectionMgmt4.pc +contrib/pkgconfig/omniZIOP4.pc +contrib/pkgconfig/omniZIOPDynamic4.pc ]) diff -Nru omniorb-dfsg-4.1.6/contrib/pkgconfig/GNUmakefile.in omniorb-dfsg-4.2.2/contrib/pkgconfig/GNUmakefile.in --- omniorb-dfsg-4.1.6/contrib/pkgconfig/GNUmakefile.in 2006-08-23 10:13:05.000000000 +0000 +++ omniorb-dfsg-4.2.2/contrib/pkgconfig/GNUmakefile.in 2014-03-25 15:18:18.000000000 +0000 @@ -7,7 +7,8 @@ INSTALLDIR = $(INSTALLLIBDIR)/pkgconfig PKGFILES = omnithread3.pc omniORB4.pc omniDynamic4.pc \ - omniCOS4.pc omniCOSDynamic4.pc omniConnectionMgmt4.pc + omniCOS4.pc omniCOSDynamic4.pc omniConnectionMgmt4.pc \ + omniZIOP4.pc omniZIOPDynamic4.pc include $(TOP)/mk/beforeauto.mk diff -Nru omniorb-dfsg-4.1.6/contrib/pkgconfig/omniZIOP4.pc.in omniorb-dfsg-4.2.2/contrib/pkgconfig/omniZIOP4.pc.in --- omniorb-dfsg-4.1.6/contrib/pkgconfig/omniZIOP4.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/contrib/pkgconfig/omniZIOP4.pc.in 2014-03-25 15:18:18.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: omniZIOP4 +Description: CORBA Object Request Broker - ZIOP library +Version: @PACKAGE_VERSION@ +Requires: omniORB4 +Libs: -L${libdir} -lomniZIOP4 +Cflags: diff -Nru omniorb-dfsg-4.1.6/contrib/pkgconfig/omniZIOPDynamic4.pc.in omniorb-dfsg-4.2.2/contrib/pkgconfig/omniZIOPDynamic4.pc.in --- omniorb-dfsg-4.1.6/contrib/pkgconfig/omniZIOPDynamic4.pc.in 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/contrib/pkgconfig/omniZIOPDynamic4.pc.in 2014-03-25 15:18:18.000000000 +0000 @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: omniZIOPDynamic4 +Description: CORBA Object Request Broker - ZIOP Dynamic library +Version: @PACKAGE_VERSION@ +Requires: omniZIOP4 +Libs: -L${libdir} -lomniZIOPDynamic4 +Cflags: diff -Nru omniorb-dfsg-4.1.6/contrib/RPMs/omniORB_new.spec omniorb-dfsg-4.2.2/contrib/RPMs/omniORB_new.spec --- omniorb-dfsg-4.1.6/contrib/RPMs/omniORB_new.spec 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/contrib/RPMs/omniORB_new.spec 2017-05-10 23:52:28.000000000 +0000 @@ -0,0 +1,372 @@ +# defined empty to enable automatic uid/gid selection. +# set values to select specific user/group ids. +%define omniuid -1 +%define omnigid -1 + +%define _name omniORB + +%define lib_name %{?mklibname:%mklibname %{_name} 4.2}%{!?mklibname:lib%{_name}4.2} + +%{!?py_ver: %define py_ver %(python -c "import sys;print(sys.version[0:3])")} +%{!?py_sitedir: %define py_sitedir %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0,0,'%{_prefix}')")} +%{!?py_sitearch: %define py_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1,0,'%{_prefix}')")} + +Summary: Object Request Broker (ORB) +Name: %{_name} +Version: 4.2.2 +Release: 1 +License: GPL / LGPL +Group: System/Libraries +Source0: %{_name}-%{version}.tar.gz +Prefix: /usr +URL: http://omniorb.sourceforge.net/ +BuildRequires: gcc-c++ +BuildRequires: glibc-devel openssl-devel +BuildRequires: python python-devel +%if "%{_vendor}" == "suse" +BuildRequires: klogd syslog-ng +%endif +%if "%{_vendor}" == "mandriva" +BuildRequires: sysklogd +%endif +Buildroot: %{_tmppath}/%{name}-%{version}-root + +%description +%{_name} is an Object Request Broker (ORB) which implements +specification 2.6 of the Common Object Request Broker Architecture +(CORBA). +This package contains the libraries needed to run programs dynamically +linked with %{_name}. + +%package -n %{lib_name} +Summary: Object Request Broker (ORB) +Group: System/Libraries +Prereq: /sbin/ldconfig +#Provides: corba +Provides: libomniorb = %{version}-%{release} %{_name} = %{version}-%{release} +Obsoletes: omniORB + +%description -n %{lib_name} +%{_name} is an Object Request Broker (ORB) which implements +specification 2.6 of the Common Object Request Broker Architecture +(CORBA). +This package contains the libraries needed to run programs dynamically +linked with %{_name}. + +# servers + +%package servers +Summary: Utility programs +Group: Development/C++ +Prereq: /usr/sbin/groupadd /usr/sbin/groupdel +Prereq: /usr/sbin/useradd /usr/sbin/userdel +Requires: %{lib_name} = %{version}-%{release} +Provides: libomniorb-servers = %{version}-%{release} +Obsoletes: omniORB-servers omniorb + +%description servers +%{_name} CORBA services including a Naming Service. + +%package bootscripts +Summary: Utility programs +Group: Development/C++ +%if "%{_vendor}" == "suse" +Prereq: /sbin/insserv +%else +Prereq: /sbin/service /sbin/chkconfig +%endif +Requires: %{name}-servers = %{version}-%{release} %{name}-utils = %{version}-%{release} +%if "%{_vendor}" == "mandriva" +Prereq: sysklogd +%else +Prereq: syslog +%endif +Provides: %{_name}-bootscripts = %{version}-%{release} +Obsoletes: omniORB-bootscripts omniorb + +%description bootscripts +Automatic starting of the %{_name} CORBA Naming Service. + +# utilities + +%package utils +Summary: Utility programs +Group: Development/C++ +Requires: %{lib_name} = %{version}-%{release} +Provides: libomniorb-utils = %{version}-%{release} +Obsoletes: omniORB-utils omniorb + +%description utils +%{_name} utility programs which may be useful at runtime. + +# devel part of the bundle + +%package -n %{lib_name}-devel +Summary: Header files and libraries needed for %{_name} development +Group: Development/C++ +Requires: %{lib_name} = %{version}-%{release} +Provides: libomniorb-devel = %{version}-%{release} +Conflicts: libomniorb-devel < %{version}-%{release} +Obsoletes: omniORB-devel + +%description -n %{lib_name}-devel +The header files and libraries needed for developing programs using +%{_name}. + +# docs and examples are in a separate package + +%package doc +Summary: Documentation and examples for %{_name} +Group: Development/C++ +Obsoletes: omniORB-doc libomniorb-doc +Provides: libomniorb-doc = %{version}-%{release} +#Requires: %{lib_name} = %{version}-%{release} + +%description doc +Developer documentation and examples. + +%prep +%setup -n %{_name} #-%{version} + +%if "%{_vendor}" == "suse" +# Replace the init script with something appropriate for SUSE. +# Note that we hardcode a relative path here, since we are replacing +# a file in the source distribution tree. +cp -f etc/init.d/omniNames.SuSE.in etc/init.d/omniNames.in +%endif + +%{?configure:%configure}%{!?configure:./configure --prefix=%{_prefix} --libdir=%{_libdir}} --with-openssl=%{_prefix} --with-omniNames-logdir=%{_localstatedir}/lib/omniNames + + +%build +# We abuse the CPPFLAGS to pass optimisation options through. +%{?make:%make}%{!?make:make IMPORT_CPPFLAGS+="$RPM_OPT_FLAGS"} all + + +%install +[ -z %{buildroot} ] || rm -rf %{buildroot} +mkdir %{buildroot} + +%if "%{_vendor}" == "suse" +%{?makeinstall:%makeinstall}%{!?makeinstall:make DESTDIR=%{buildroot} install} +%else +%{?make:%make}%{!?make:make} install DESTDIR=%{buildroot} +%endif + +mkdir -p %{buildroot}%{_initrddir} +mkdir -p %{buildroot}%{_sysconfdir} +cp sample.cfg %{buildroot}%{_sysconfdir}/omniORB.cfg +cp etc/init.d/omniNames %{buildroot}%{_initrddir} + +mkdir -p %{buildroot}%{_mandir}/man{1,5} +cp -r man/* %{buildroot}%{_mandir} + +mkdir -p %{buildroot}%{_localstatedir}/lib/omniNames +mkdir -p %{buildroot}%{_localstatedir}/lib/omniMapper + +# Rename catior to avoid naming conflict with TAO +mv %{buildroot}%{_bindir}/catior %{buildroot}%{_bindir}/catior.omni +mv %{buildroot}%{_mandir}/man1/catior.1 %{buildroot}%{_mandir}/man1/catior.omni.1 + +%if "%{_vendor}" == "suse" + # Most SUSE service scripts have a corresponding link into /usr/sbin + mkdir -p %{buildroot}%{_sbindir} + ln -sf %{_initrddir}/omniNames %{buildroot}%{_sbindir}/rcomniNames +%endif + +%{?multiarch_includes:%multiarch_includes %{buildroot}%{_includedir}/omniORB4/acconfig.h} +%{?multiarch_includes:%multiarch_includes %{buildroot}%{_includedir}/omniORB4/CORBA_sysdep_trad.h} + + +%clean +[ -z %{buildroot} ] || rm -rf %{buildroot} + + +%pre -n %{lib_name} + +%post -n %{lib_name} +/sbin/ldconfig + +%pre servers +%if "%{omnigid}" == "-1" +OMNIGIDOPT="-r" +%else +OMNIGIDOPT="-g %{omnigid}" +%endif +%if "%{omniuid}" == "-1" +OMNIUIDOPT="-r" +%else +OMNIUIDOPT="-u %{omniuid}" +%endif +/usr/sbin/groupadd ${OMNIGIDOPT} omni >/dev/null 2>&1 || : +/usr/sbin/useradd ${OMNIUIDOPT} -M -g omni -d %{_localstatedir}/lib/omniNames \ + -s /bin/bash -c "omniORB servers" omni >/dev/null 2>&1 || : + +%pre bootscripts +# A previous version is already installed? +if [ $1 -ge 2 ]; then +%if "%{_vendor}" == "suse" + %{_sbindir}/rcomniNames stop >/dev/null 2>&1 +%else + /sbin/service omniNames stop >/dev/null 2>&1 +%endif +fi + +%post bootscripts +%if "%{_vendor}" == "suse" +/sbin/insserv omniNames +%{_sbindir}/rcomniNames restart >/dev/null 2>&1 +%else +/sbin/chkconfig --add omniNames +/sbin/service omniNames restart >/dev/null 2>&1 +%endif + +%preun bootscripts +# Are we removing the package completely? +if [ $1 -eq 0 ]; then +%if "%{_vendor}" == "suse" + %{_sbindir}/rcomniNames stop >/dev/null 2>&1 + /sbin/insserv -r omniNames +%else + /sbin/service omniNames stop >/dev/null 2>&1 + /sbin/chkconfig --del omniNames +%endif + rm -rf %{_localstatedir}/lib/omniNames/* + rm -rf %{_localstatedir}/lib/omniMapper/* +fi + +%postun -n %{lib_name} +/sbin/ldconfig + +%postun servers +# uninstalling all versions? +if [ $1 -eq 0 ] ; then + /usr/sbin/userdel omni >/dev/null 2>&1 || : + /usr/sbin/groupdel omni >/dev/null 2>&1 || : +fi + + +%files -n %{lib_name} +%defattr (-,root,root) +%doc CREDITS COPYING COPYING.LIB +%config(noreplace) %{_sysconfdir}/*.cfg +%{_libdir}/*.so.* + + +%files servers +%defattr (-,root,root) +%dir %attr(700,omni,omni) %{_localstatedir}/lib/omniNames +%dir %attr(700,omni,omni) %{_localstatedir}/lib/omniMapper +%attr(644,root,man) %{_mandir}/man8/omniMapper* +%attr(644,root,man) %{_mandir}/man8/omniNames* +%attr(755,root,root) %{_bindir}/omniMapper +%attr(755,root,root) %{_bindir}/omniNames +# Thin substitute for standard Linux init script + + +%files bootscripts +%defattr (-,root,root) +%config(noreplace) %attr(755,root,root) %{_initrddir}/* +%if "%{_vendor}" == "suse" +%{_sbindir}/rcomniNames +%endif + + +%files utils +%defattr (-,root,root) +%attr(644,root,man) %{_mandir}/man1/catior* +%attr(644,root,man) %{_mandir}/man1/convertior* +%attr(644,root,man) %{_mandir}/man1/genior* +%attr(644,root,man) %{_mandir}/man1/nameclt* +%{_bindir}/catior.omni +%{_bindir}/convertior +%{_bindir}/genior +%{_bindir}/nameclt + + +%files -n %{lib_name}-devel +%defattr(-,root,root) +%doc readmes/* +%attr(644,root,man) %{_mandir}/man1/omnicpp* +%attr(644,root,man) %{_mandir}/man1/omniidl* +%{_bindir}/omnicpp +%{_bindir}/omniidl +%{_bindir}/omniidlrun.py* +%{_bindir}/omkdepend +%{_libdir}/*.a +%{_libdir}/*.so +%{_includedir}/* +%{_datadir}/idl +%{py_sitedir}/omniidl +%dir %{py_sitedir}/omniidl_be +%{py_sitedir}/omniidl_be/*.py* +%dir %{py_sitedir}/omniidl_be/cxx +%{py_sitedir}/omniidl_be/cxx/*.py* +%{py_sitedir}/omniidl_be/cxx/header +%{py_sitedir}/omniidl_be/cxx/skel +%{py_sitedir}/omniidl_be/cxx/dynskel +%{py_sitedir}/omniidl_be/cxx/impl +%{py_sitearch}/_omniidlmodule.so* +%{_libdir}/pkgconfig/*.pc + + +%files doc +%defattr(-,root,root) +%doc doc/* + + +%changelog +* Mon Sep 07 2009 Dirk Kaar 4.2.0-1 +- Use 4.2 sources from SVN + +* Thu May 05 2005 Dirk Kaar 4.1.0-1 +- rework package names to support x86_64, co-existance of 4.0 + and 4.1 libraries + +* Mon Jul 26 2004 Duncan Grisby 4.0.4-1 +- Bump version number; integrate SUSE changes. Don't automatically + start omniNames upon RPM install. + +* Thu Jul 22 2004 Thomas Lockhart 4.0.3-7 +- Incorporate additional SUSE features per Dirk O. Kaar +- Use additional standard RPM substitution parameters rather than + hardcoded paths + +* Wed Dec 24 2003 Thomas Lockhart 4.0.3 +- Fix ownership of boot scripts per Bastiann Bakker +- Clean up pre- and post-install actions to support servers + +* Tue Dec 08 2003 Thomas Lockhart 4.0.3 +- Include additional build dependencies for redhat per Bastiann Bakker +- Put man pages for all distros into %{prefix}/share/man per FHS conventions +- Run omniNames under user "omni" per Jan Holst Jensen + +* Mon Dec 01 2003 Thomas Lockhart 4.0.3 +- Merge SuSE spec contributions from Johan Cronje + +* Wed Nov 19 2003 Duncan Grisby 4.0.3 +- Merge contributed updates, bump version number. + +* Fri Aug 08 2003 Thomas Lockhart 4.0.2 +- Rename catior man page to match catior.omni binary name + +* Wed Aug 6 2003 Duncan Grisby 4.0.2 +- Bump version number. + +* Tue Jun 10 2003 Duncan Grisby 4.0.2pre1 +- Fix some text, bump version number, add init script, minor tweaks. + +* Wed Feb 12 2003 Thomas Lockhart 4.0.0 +- Rename catior to catior.omni to avoid name conflict with TAO + +* Tue Oct 01 2002 Thomas Lockhart 4.0.0 +- Track down changes in documentation for 4.0.0 +- Omit patches required to build the previous beta + +* Mon Jul 29 2002 Thomas Lockhart 4.0.0beta +- Separate out utility programs to manage name conflict for catior with TAO + +* Wed Jul 03 2002 Thomas Lockhart 4.0.0beta +- Start from 3.04 spec files +- Strip workarounds from the spec file since 4.0 builds more cleanly + diff -Nru omniorb-dfsg-4.1.6/contrib/RPMs/omniORB.spec omniorb-dfsg-4.2.2/contrib/RPMs/omniORB.spec --- omniorb-dfsg-4.1.6/contrib/RPMs/omniORB.spec 2011-06-24 21:37:28.000000000 +0000 +++ omniorb-dfsg-4.2.2/contrib/RPMs/omniORB.spec 2017-05-10 23:52:28.000000000 +0000 @@ -4,8 +4,8 @@ %define omnigid -1 %define version_major 4 -%define version_minor 1 -%define version_micro 6 +%define version_minor 2 +%define version_micro 2 %define version_full %{version_major}.%{version_minor}.%{version_micro} %define version_brief %{version_major}.%{version_minor} @@ -21,7 +21,7 @@ Release: 1%{?dist} License: GPL / LGPL Group: System/Libraries -Source0: %{name}-%{version}.tar.gz +Source0: %{name}-%{version}.tar.bz2 Prefix: /usr URL: http://omniorb.sourceforge.net/ BuildRequires: gcc-c++ @@ -48,6 +48,14 @@ #Provides: corba Provides: lib%{name} = %{version}-%{release} %{name} = %{version}-%{release} Provides: libomniorb = %{version}-%{release} omniorb = %{version}-%{release} +Provides: libCOS%{version_major}.so.%{version_minor} +Provides: libCOSDynamic%{version_major}.so.%{version_minor} +Provides: libomniCodeSets%{version_major}.so.%{version_minor} +Provides: libomniConnectionMgmt%{version_major}.so.%{version_minor} +Provides: libomniDynamic%{version_major}.so.%{version_minor} +Provides: libomniORB%{version_major}.so.%{version_minor} +Provides: libomnisslTP%{version_major}.so.%{version_minor} +Provides: libomnithread.so.3 %description -n %{lib_name} %{name} is an Object Request Broker (ORB) which implements @@ -125,7 +133,7 @@ Developer documentation and examples. %prep -%setup -n %{name} #-%{version} +%setup -n %{name}-%{version} %if "%{_vendor}" == "suse" # Replace the init script with something appropriate for SUSE. @@ -173,8 +181,8 @@ ln -sf %{_initrddir}/omniNames %{buildroot}%{_sbindir}/rcomniNames %endif -%{?multiarch_includes:%multiarch_includes %{buildroot}%{_includedir}/omniORB4/acconfig.h} -%{?multiarch_includes:%multiarch_includes %{buildroot}%{_includedir}/omniORB4/CORBA_sysdep_trad.h} +%{?multiarch_includes:%multiarch_includes %{buildroot}%{_includedir}/omniORB%{version_major}/acconfig.h} +%{?multiarch_includes:%multiarch_includes %{buildroot}%{_includedir}/omniORB%{version_major}/CORBA_sysdep_trad.h} %clean @@ -252,7 +260,6 @@ %config(noreplace) %{_sysconfdir}/*.cfg %{_libdir}/*.so.* - %files servers %defattr (-,root,root) %attr(644,root,man) %{_mandir}/man8/omniNames* @@ -265,7 +272,7 @@ %files bootscripts %defattr (-,root,root) -%config(noreplace) %attr(775,root,root) %{_initrddir}/* +%config(noreplace) %attr(755,root,root) %{_initrddir}/* %if "%{_vendor}" == "suse" %{_sbindir}/rcomniNames %endif @@ -315,11 +322,16 @@ %changelog -* Wed Nov 24 2010 Dirk O. Kaar 4.2.0-2 +* Sun Aug 07 2011 Thomas Lockhart 4.1.6-1 +- Use .bz2 source tarball rather than .gz +- Parameterize version numbers for dependencies + +* Wed Nov 24 2010 Dirk O. Kaar 4.1.5-1 - Merge in improvements for current RPM from Thomas Lockhart -* Mon Sep 07 2009 Dirk O. Kaar 4.2.0-1 -- Use 4.2 sources from SVN +* Tue Nov 23 2010 Thomas Lockhart 4.1.5-1 +- Support python library locations for 64-bit installations +- Integrate additional features from omniORB_new.spec from Dirk Kaar * Thu May 05 2005 Dirk Siebnich 4.1.0-1 - rework package names to support x86_64, co-existance of 4.0 @@ -330,7 +342,7 @@ start omniNames upon RPM install. * Thu Jul 22 2004 Thomas Lockhart 4.0.3-7 -- Incorporate additional SUSE features per Dirk O. Siebnich +- Incorporate additional SUSE features per Dirk O. Kaar - Use additional standard RPM substitution parameters rather than hardcoded paths diff -Nru omniorb-dfsg-4.1.6/COPYING omniorb-dfsg-4.2.2/COPYING --- omniorb-dfsg-4.1.6/COPYING 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/COPYING 2017-02-20 22:45:59.000000000 +0000 @@ -1,8 +1,8 @@ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -15,7 +15,7 @@ General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -277,9 +277,9 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -291,7 +291,7 @@ the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -303,17 +303,16 @@ 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -336,5 +335,5 @@ This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff -Nru omniorb-dfsg-4.1.6/COPYING.LIB omniorb-dfsg-4.2.2/COPYING.LIB --- omniorb-dfsg-4.1.6/COPYING.LIB 2007-11-20 23:32:10.000000000 +0000 +++ omniorb-dfsg-4.2.2/COPYING.LIB 2017-02-20 22:45:59.000000000 +0000 @@ -2,7 +2,7 @@ Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -484,8 +484,9 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. diff -Nru omniorb-dfsg-4.1.6/debian/changelog omniorb-dfsg-4.2.2/debian/changelog --- omniorb-dfsg-4.1.6/debian/changelog 2017-11-13 13:35:53.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/changelog 2018-02-07 16:12:52.000000000 +0000 @@ -1,3 +1,53 @@ +omniorb-dfsg (4.2.2-0.8) experimental; urgency=medium + + * Non-maintainer upload. + * omniidl: Fix detection of private python3 directory. + + -- Matthias Klose Wed, 07 Feb 2018 17:12:52 +0100 + +omniorb-dfsg (4.2.2-0.6) experimental; urgency=medium + + * Non-maintainer upload. + * Fix passing the --build/--host configure options. + * Multiarchify the library packages. + * Build using Python3. + * Configure --with-openssl instead of --with-openssl=yes. + * Build-depend on zlib1g-dev. + + -- Matthias Klose Tue, 14 Nov 2017 23:56:41 +0100 + +omniorb-dfsg (4.2.2-0.1) experimental; urgency=medium + + * Non-maintainer upload. + * New upstream bug fix release. + - Supports openssl 1.1. CLoses: #859367. + * Apply 4.1.6-2.2 changes to 4.2.0-1. + * Add Breaks/Replaces for the -dev packages. Closes: #781650. + + -- Matthias Klose Tue, 14 Nov 2017 00:25:30 +0100 + +omniorb-dfsg (4.2.0-1) experimental; urgency=low + + [ Floris Bruynooghe ] + * New upstream release (Closes: #737948) + * Update debian/watch and debian/README.source for .bz2 filenames. + * Update svn-bp:origUrl for new version. + * Remove obsolete DM-Upload-Allowed field from debian/control. + + [ Thomas Girard ] + * d/p/revert_abi_breakage: remove, no longer needed since the ABI has + changed again. + * d/rules: change dh_makeshlibs invocation accordingly. + * d/p/hurd: remove, applied upstream. + * d/p/pkgconfig: fix omnithread pkgconfig file. + * d/p/formatstring: fix FTBFS when building with hardening flags. + * d/control: + - bump standards-version to 3.9.6. + - rename packages to reflect new 4.2 ABI. + - add appropriate Conflicts: Replaces: wherever needed. + + -- Thomas Girard Tue, 28 Oct 2014 18:00:53 +0100 + omniorb-dfsg (4.1.6-2.2) unstable; urgency=medium * Non-maintainer upload. @@ -11,13 +61,6 @@ -- Matthias Klose Mon, 13 Nov 2017 14:35:53 +0100 -omniorb-dfsg (4.1.6-2.1) unstable; urgency=medium - - * Non-maintainer upload. - * Fix FTBFS by using OpenSSL 1.0.2. (Closes: #828464) - - -- Adrian Bunk Sat, 14 Jan 2017 01:38:25 +0200 - omniorb-dfsg (4.1.6-2) unstable; urgency=low * Fix the GNU/hurd patch, mention it's upstream inclusion (Closes: #641571) diff -Nru omniorb-dfsg-4.1.6/debian/control omniorb-dfsg-4.2.2/debian/control --- omniorb-dfsg-4.1.6/debian/control 2017-11-13 13:35:53.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/control 2017-11-14 22:56:21.000000000 +0000 @@ -3,8 +3,14 @@ Priority: optional Maintainer: Debian CORBA Team Uploaders: Floris Bruynooghe , Thomas Girard -DM-Upload-Allowed: yes -Build-Depends: debhelper (>= 9), dh-python, python-dev, libssl1.0-dev | libssl-dev (<< 1.1.0~), autotools-dev, pkg-config +Build-Depends: debhelper (>= 9), + python3-dev, + libssl-dev, + zlib1g-dev, + pkg-config, + dh-python, + autotools-dev, + dh-autoreconf Standards-Version: 4.1.1 Vcs-Svn: svn://svn.debian.org/svn/pkg-corba/trunk/omniorb Vcs-Browser: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb @@ -46,6 +52,7 @@ Package: omniorb-doc Architecture: all +Multi-Arch: foreign Depends: ${misc:Depends} Section: doc Description: omniORB documentation @@ -57,10 +64,13 @@ . This includes the documentation. -Package: libcos4-1 +Package: libcos4-2 Architecture: any +Multi-Arch: same Section: libs Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libcos4-1 +Replaces: libcos4-1 Description: omniORB CORBA services stubs omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -70,11 +80,12 @@ . This includes libcos4 and libcosdynamic4. -Package: libcos4-1-dbg +Package: libcos4-2-dbg Architecture: any +Multi-Arch: same Section: debug Priority: optional -Depends: libcos4-1 (= ${binary:Version}), ${misc:Depends} +Depends: libcos4-2 (= ${binary:Version}), ${misc:Depends} Description: omniORB CORBA services stubs debugging symbols omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -86,8 +97,9 @@ Package: libcos4-dev Architecture: any +Multi-Arch: same Section: libdevel -Depends: libcos4-1 (= ${binary:Version}), libomniorb4-dev (= ${binary:Version}), pkg-config, ${misc:Depends} +Depends: libcos4-2 (= ${binary:Version}), libomniorb4-dev (= ${binary:Version}), pkg-config, ${misc:Depends} Description: omniORB CORBA services stubs development files omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -97,10 +109,13 @@ . This includes developer files for libcos4 and libcosdynamic4. -Package: libomniorb4-1 +Package: libomniorb4-2 Architecture: any +Multi-Arch: same Section: libs Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libomniorb4-1 +Replaces: libomniorb4-1 Description: omniORB core libraries omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -111,11 +126,12 @@ This includes libomniorb4, libomnicodesets4, libomnidynamic4 and libomnissltp4. -Package: libomniorb4-1-dbg +Package: libomniorb4-2-dbg Architecture: any +Multi-Arch: same Section: debug Priority: optional -Depends: libomniorb4-1 (= ${binary:Version}), ${misc:Depends} +Depends: libomniorb4-2 (= ${binary:Version}), ${misc:Depends} Description: omniORB core libraries debugging symbols omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -128,8 +144,11 @@ Package: libomniorb4-dev Architecture: any +Multi-Arch: same Section: libdevel -Depends: libomniorb4-1 (= ${binary:Version}), libomnithread3-dev (= ${binary:Version}), libssl1.0-dev | libssl-dev (<< 1.1.0~), pkg-config, ${misc:Depends} +Depends: libomniorb4-2 (= ${binary:Version}), libomnithread4-dev (= ${binary:Version}), libssl-dev, pkg-config, ${misc:Depends} +Breaks: libomniorb3-dev +Replaces: libomniorb3-dev Description: omniORB core libraries development files omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -140,8 +159,9 @@ This includes developer files for libomniorb4, libomnicodesets4, libomnidynamic4 and libomnissltp4. -Package: libomnithread3c2 +Package: libomnithread4 Architecture: any +Multi-Arch: same Section: libs Depends: ${shlibs:Depends}, ${misc:Depends} Description: C++ threading library @@ -151,13 +171,14 @@ protocol and should be interoperable with any other CORBA 2.6 compliant ORB. . - This includes libomnithread3. + This includes libomnithread4. -Package: libomnithread3c2-dbg +Package: libomnithread4-dbg Architecture: any +Multi-Arch: same Section: debug Priority: optional -Depends: libomnithread3c2 (= ${binary:Version}), ${misc:Depends} +Depends: libomnithread4 (= ${binary:Version}), ${misc:Depends} Description: C++ threading library debugging symbols omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -165,12 +186,15 @@ protocol and should be interoperable with any other CORBA 2.6 compliant ORB. . - This includes the debug version of libomnithread3. + This includes the debug version of libomnithread4. -Package: libomnithread3-dev +Package: libomnithread4-dev Architecture: any +Multi-Arch: same Section: libdevel -Depends: libomnithread3c2 (= ${binary:Version}), pkg-config, ${misc:Depends} +Depends: libomnithread4 (= ${binary:Version}), pkg-config, ${misc:Depends} +Breaks: libomnithread3-dev +Replaces: libomnithread3-dev Description: C++ threading library development files omniORB4 is a freely available Common Object Request Broker Architecture (CORBA) 2.6 compliant object request broker (ORB) @@ -178,11 +202,11 @@ protocol and should be interoperable with any other CORBA 2.6 compliant ORB. . - This includes developer files libomnithread3. + This includes developer files libomnithread4. Package: omniidl Architecture: any -Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} +Depends: ${shlibs:Depends}, ${python3:Depends}, ${misc:Depends} Suggests: omniidl-python Breaks: omniidl-python (<< 3.5-1) Description: omniORB IDL to C++ and Python compiler diff -Nru omniorb-dfsg-4.1.6/debian/libcos4-1.install omniorb-dfsg-4.2.2/debian/libcos4-1.install --- omniorb-dfsg-4.1.6/debian/libcos4-1.install 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libcos4-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib/libCOS4.so.* -usr/lib/libCOSDynamic4.so.* diff -Nru omniorb-dfsg-4.1.6/debian/libcos4-2.install omniorb-dfsg-4.2.2/debian/libcos4-2.install --- omniorb-dfsg-4.1.6/debian/libcos4-2.install 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libcos4-2.install 2017-11-14 12:20:32.000000000 +0000 @@ -0,0 +1,2 @@ +usr/lib/*/libCOS4.so.* +usr/lib/*/libCOSDynamic4.so.* diff -Nru omniorb-dfsg-4.1.6/debian/libcos4-dev.install omniorb-dfsg-4.2.2/debian/libcos4-dev.install --- omniorb-dfsg-4.1.6/debian/libcos4-dev.install 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libcos4-dev.install 2017-11-14 12:20:43.000000000 +0000 @@ -1,7 +1,7 @@ -usr/lib/libCOS4.a -usr/lib/libCOS4.so -usr/lib/libCOSDynamic4.a -usr/lib/libCOSDynamic4.so -usr/lib/pkgconfig/omniCOS4.pc -usr/lib/pkgconfig/omniCOSDynamic4.pc +usr/lib/*/libCOS4.a +usr/lib/*/libCOS4.so +usr/lib/*/libCOSDynamic4.a +usr/lib/*/libCOSDynamic4.so +usr/lib/*/pkgconfig/omniCOS4.pc +usr/lib/*/pkgconfig/omniCOSDynamic4.pc usr/include/COS/ diff -Nru omniorb-dfsg-4.1.6/debian/libomniorb4-1.dirs omniorb-dfsg-4.2.2/debian/libomniorb4-1.dirs --- omniorb-dfsg-4.1.6/debian/libomniorb4-1.dirs 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomniorb4-1.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -etc/ diff -Nru omniorb-dfsg-4.1.6/debian/libomniorb4-1.install omniorb-dfsg-4.2.2/debian/libomniorb4-1.install --- omniorb-dfsg-4.1.6/debian/libomniorb4-1.install 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomniorb4-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -usr/lib/libomniCodeSets4.so.* -usr/lib/libomniConnectionMgmt4.so.* -usr/lib/libomniDynamic4.so.* -usr/lib/libomniORB4.so.* -usr/lib/libomnisslTP4.so.* diff -Nru omniorb-dfsg-4.1.6/debian/libomniorb4-2.dirs omniorb-dfsg-4.2.2/debian/libomniorb4-2.dirs --- omniorb-dfsg-4.1.6/debian/libomniorb4-2.dirs 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomniorb4-2.dirs 2014-10-12 15:11:44.000000000 +0000 @@ -0,0 +1 @@ +etc/ diff -Nru omniorb-dfsg-4.1.6/debian/libomniorb4-2.install omniorb-dfsg-4.2.2/debian/libomniorb4-2.install --- omniorb-dfsg-4.1.6/debian/libomniorb4-2.install 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomniorb4-2.install 2017-11-14 12:20:55.000000000 +0000 @@ -0,0 +1,7 @@ +usr/lib/*/libomniCodeSets4.so.* +usr/lib/*/libomniConnectionMgmt4.so.* +usr/lib/*/libomniDynamic4.so.* +usr/lib/*/libomniORB4.so.* +usr/lib/*/libomnisslTP4.so.* +usr/lib/*/libomniZIOP4.so.* +usr/lib/*/libomniZIOPDynamic4.so.* diff -Nru omniorb-dfsg-4.1.6/debian/libomniorb4-dev.install omniorb-dfsg-4.2.2/debian/libomniorb4-dev.install --- omniorb-dfsg-4.1.6/debian/libomniorb4-dev.install 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomniorb4-dev.install 2017-11-14 12:21:11.000000000 +0000 @@ -1,15 +1,21 @@ -usr/lib/libomniCodeSets4.a -usr/lib/libomniCodeSets4.so -usr/lib/libomniConnectionMgmt4.a -usr/lib/libomniConnectionMgmt4.so -usr/lib/libomniDynamic4.a -usr/lib/libomniDynamic4.so -usr/lib/libomniORB4.a -usr/lib/libomniORB4.so -usr/lib/libomnisslTP4.a -usr/lib/libomnisslTP4.so -usr/lib/pkgconfig/omniConnectionMgmt4.pc -usr/lib/pkgconfig/omniDynamic4.pc -usr/lib/pkgconfig/omniORB4.pc +usr/lib/*/libomniCodeSets4.a +usr/lib/*/libomniCodeSets4.so +usr/lib/*/libomniConnectionMgmt4.a +usr/lib/*/libomniConnectionMgmt4.so +usr/lib/*/libomniDynamic4.a +usr/lib/*/libomniDynamic4.so +usr/lib/*/libomniORB4.a +usr/lib/*/libomniORB4.so +usr/lib/*/libomnisslTP4.a +usr/lib/*/libomnisslTP4.so +usr/lib/*/libomniZIOP4.a +usr/lib/*/libomniZIOP4.so +usr/lib/*/libomniZIOPDynamic4.a +usr/lib/*/libomniZIOPDynamic4.so +usr/lib/*/pkgconfig/omniConnectionMgmt4.pc +usr/lib/*/pkgconfig/omniDynamic4.pc +usr/lib/*/pkgconfig/omniORB4.pc +usr/lib/*/pkgconfig/omniZIOP4.pc +usr/lib/*/pkgconfig/omniZIOPDynamic4.pc usr/include/omniconfig.h usr/include/omniORB4/ diff -Nru omniorb-dfsg-4.1.6/debian/libomnithread3c2.install omniorb-dfsg-4.2.2/debian/libomnithread3c2.install --- omniorb-dfsg-4.1.6/debian/libomnithread3c2.install 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomnithread3c2.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/libomnithread.so.* diff -Nru omniorb-dfsg-4.1.6/debian/libomnithread3-dev.install omniorb-dfsg-4.2.2/debian/libomnithread3-dev.install --- omniorb-dfsg-4.1.6/debian/libomnithread3-dev.install 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomnithread3-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -usr/lib/libomnithread.a -usr/lib/libomnithread.so -usr/lib/pkgconfig/omnithread3.pc -usr/include/omnithread.h -usr/include/omnithread/ diff -Nru omniorb-dfsg-4.1.6/debian/libomnithread4-dev.install omniorb-dfsg-4.2.2/debian/libomnithread4-dev.install --- omniorb-dfsg-4.1.6/debian/libomnithread4-dev.install 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomnithread4-dev.install 2017-11-14 12:21:20.000000000 +0000 @@ -0,0 +1,5 @@ +usr/lib/*/libomnithread.a +usr/lib/*/libomnithread.so +usr/lib/*/pkgconfig/omnithread4.pc +usr/include/omnithread.h +usr/include/omnithread/ diff -Nru omniorb-dfsg-4.1.6/debian/libomnithread4.install omniorb-dfsg-4.2.2/debian/libomnithread4.install --- omniorb-dfsg-4.1.6/debian/libomnithread4.install 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/libomnithread4.install 2017-11-14 12:21:25.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/*/libomnithread.so.* diff -Nru omniorb-dfsg-4.1.6/debian/patches/buildsys omniorb-dfsg-4.2.2/debian/patches/buildsys --- omniorb-dfsg-4.1.6/debian/patches/buildsys 2011-03-14 23:40:12.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/buildsys 2017-11-13 23:54:40.000000000 +0000 @@ -6,9 +6,19 @@ Author: Bastian Blank Last-Update: 2010-08-08 +Index: b/mk/beforeauto.mk.in +=================================================================== --- a/mk/beforeauto.mk.in +++ b/mk/beforeauto.mk.in -@@ -675,17 +675,16 @@ +@@ -68,7 +68,6 @@ else + TOOLBINDIR = $(TOP)/$(BINDIR) + endif + +-OMKDEPEND = $(TOOLBINDIR)/omkdepend + OMNIORB_IDL_ONLY = $(TOOLBINDIR)/omniidl -bcxx + + else +@@ -708,7 +707,7 @@ AR = ar cq CC = @CC@ CXX = @CXX@ RANLIB = @RANLIB@ @@ -17,9 +27,8 @@ INSTLIBFLAGS = -m 0644 INSTEXEFLAGS = -m 0755 CP = cp - MV = mv -f +@@ -716,8 +715,8 @@ MV = mv -f CPP = @CPP@ --OMKDEPEND = $(TOOLBINDIR)/omkdepend RMDIRHIER = $(RM) -rf -CXXMAKEDEPEND = $(OMKDEPEND) -D__cplusplus @@ -29,7 +38,7 @@ # -@@ -746,8 +745,6 @@ +@@ -786,8 +785,6 @@ CXXLINKOPTIONS = @LDFLAGS@ $(CXXDEBUGFL # ifdef Compiler_GCC @@ -38,9 +47,11 @@ CXXOPTIONS = -Wall -Wno-unused -fexceptions @EXTRA_GCC_CXXFLAGS@ EgcsMajorVersion = 1 EgcsMinorVersion = 1 +Index: b/src/tool/dir.mk +=================================================================== --- a/src/tool/dir.mk +++ b/src/tool/dir.mk -@@ -7,7 +7,7 @@ +@@ -7,7 +7,7 @@ export:: endif ifdef UnixPlatform diff -Nru omniorb-dfsg-4.1.6/debian/patches/klotz omniorb-dfsg-4.2.2/debian/patches/klotz --- omniorb-dfsg-4.1.6/debian/patches/klotz 2011-02-20 14:01:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/klotz 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -Description: Add missing else statement - The attached patch (against SVN trunk) adds an "else" statement that - in our opinion got lost in omniORB 4.1.4 in this checkin (file - omniObjRef.cc): - . - Revision 1.4.2.7 2008/10/28 15:54:51 dgrisby - Internal CommFailure exception escapes after failed-on-forward call - that is not retried. - . - There were two identical code blocks in omniORB 4.1.3 that were - altered by the above checkin. In omniORB 4.1.4 a diff shows that the - "else" statement misses in one of the blocks. - . - The erroneous behavior we are seeing is this: - . - * Client contacts Naming Service and establishes a connection - * Later the Naming Service closes the connection due to its - inConScanPeriod setting - * Client contacts Naming Service again before its outConScanPeriod is - over - * Client sees the dead connection but instead of performing a retry it - immediately throws a COMM_FAILURE exception - . - omniORB 4.1.3 and patched 4.1.4 clients work as expected and open a - new connection to the Naming Service. -Forwarded: http://www.omniorb-support.com/pipermail/omniorb-list/2010-July/030686.html -Author: Peter Klotz - ---- a/src/lib/omniORB/orbcore/omniObjRef.cc -+++ b/src/lib/omniORB/orbcore/omniObjRef.cc -@@ -1116,6 +1116,7 @@ - if (ex.retry()) { - required_retry = 1; - } -+ else { - if (fwd) { - omni::revertToOriginalProfile(this); - CORBA::TRANSIENT ex2(TRANSIENT_FailedOnForwarded, ex.completed()); -@@ -1136,6 +1137,7 @@ - if (!_omni_callTransientExceptionHandler(this, retries++, ex2)) - OMNIORB_THROW(TRANSIENT,ex.minor(),ex.completed()); - } -+ } - } - catch(CORBA::COMM_FAILURE& ex) { - if( fwd ) { diff -Nru omniorb-dfsg-4.1.6/debian/patches/pkgconfig omniorb-dfsg-4.2.2/debian/patches/pkgconfig --- omniorb-dfsg-4.1.6/debian/patches/pkgconfig 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/pkgconfig 2014-10-28 13:10:16.000000000 +0000 @@ -0,0 +1,62 @@ +Description: Adapt pkgconfig files to new release +--- a/contrib/pkgconfig/GNUmakefile.in ++++ b/contrib/pkgconfig/GNUmakefile.in +@@ -6,7 +6,7 @@ + + INSTALLDIR = $(INSTALLLIBDIR)/pkgconfig + +-PKGFILES = omnithread3.pc omniORB4.pc omniDynamic4.pc \ ++PKGFILES = omnithread4.pc omniORB4.pc omniDynamic4.pc \ + omniCOS4.pc omniCOSDynamic4.pc omniConnectionMgmt4.pc \ + omniZIOP4.pc omniZIOPDynamic4.pc + +--- a/contrib/pkgconfig/omniORB4.pc.in ++++ b/contrib/pkgconfig/omniORB4.pc.in +@@ -9,7 +9,7 @@ + Name: omniORB4 + Description: CORBA Object Request Broker. + Version: @PACKAGE_VERSION@ +-Requires: omnithread3 ++Requires: omnithread4 + Libs: -L${libdir} -lomniORB4 + Cflags: -I${includedir} + unloadable_stubs=-DOMNI_UNLOADABLE_STUBS +--- a/contrib/pkgconfig/omnithread3.pc.in ++++ b/contrib/pkgconfig/omnithread3.pc.in +@@ -1,11 +0,0 @@ +-prefix=@prefix@ +-exec_prefix=@exec_prefix@ +-libdir=@libdir@ +-includedir=@includedir@ +- +-Name: omnithread3 +-Description: Threading library for omniORB4 +-Version: @PACKAGE_VERSION@ +-Requires: +-Libs: -L${libdir} -lomnithread +-Cflags: -D@PROCESSOR_DEFINE@ -D@PLATFORM_DEFINE@ -D__OSVERSION__=@OSVERSION@ -I${includedir} +--- a/contrib/pkgconfig/omnithread4.pc.in ++++ b/contrib/pkgconfig/omnithread4.pc.in +@@ -0,0 +1,11 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: omnithread4 ++Description: Threading library for omniORB4 ++Version: @PACKAGE_VERSION@ ++Requires: ++Libs: -L${libdir} -lomnithread ++Cflags.private: -D@PROCESSOR_DEFINE@ -D@PLATFORM_DEFINE@ -D__OSVERSION__=@OSVERSION@ -I${includedir} +--- a/configure.ac ++++ b/configure.ac +@@ -330,7 +330,7 @@ + contrib/pkgconfig/GNUmakefile) + + AC_OUTPUT([ +-contrib/pkgconfig/omnithread3.pc ++contrib/pkgconfig/omnithread4.pc + contrib/pkgconfig/omniORB4.pc + contrib/pkgconfig/omniDynamic4.pc + contrib/pkgconfig/omniCOS4.pc diff -Nru omniorb-dfsg-4.1.6/debian/patches/private_pythondir omniorb-dfsg-4.2.2/debian/patches/private_pythondir --- omniorb-dfsg-4.1.6/debian/patches/private_pythondir 2011-09-26 22:40:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/private_pythondir 2018-02-07 16:12:52.000000000 +0000 @@ -6,9 +6,11 @@ Author: Floris Bruynooghe Last-Update: 2011-07-21 +Index: b/mk/beforeauto.mk.in +=================================================================== --- a/mk/beforeauto.mk.in +++ b/mk/beforeauto.mk.in -@@ -40,8 +40,8 @@ +@@ -40,8 +40,8 @@ INSTALLTARGET := 1 INSTALLINCDIR := $(DESTDIR)@includedir@ INSTALLBINDIR := $(DESTDIR)@bindir@ INSTALLLIBDIR := $(DESTDIR)@libdir@ @@ -18,10 +20,12 @@ +INSTALLPYEXECDIR := $(DESTDIR)/usr/lib/omniidl INSTALLIDLDIR := $(DESTDIR)@datadir@/idl - ############################################################################# + +Index: b/src/tool/omniidl/python/scripts/omniidl.in +=================================================================== --- a/src/tool/omniidl/python/scripts/omniidl.in +++ b/src/tool/omniidl/python/scripts/omniidl.in -@@ -44,8 +44,8 @@ +@@ -43,8 +43,8 @@ import os, os.path pylibdir = archlibdir = None binarchdir = os.path.abspath(os.path.dirname(sys.argv[0])) @@ -32,7 +36,7 @@ if os.path.isdir(sppath): sys.path.append(sppath) -@@ -93,32 +93,6 @@ +@@ -92,20 +92,6 @@ if binarchdir != "": if os.path.isdir(archlibdir): sys.path.insert(0, archlibdir) @@ -44,24 +48,54 @@ - "@pyexecdir@" ] - - --# Implement a string replace function for all Python versions. We --# can't use the version in idlstring.py, since we're trying to work --# out the path to find modules including that one. -- --import string --try: -- replace = string.replace -- --except NameError: -- def replace(s, old, new): -- return s.replace(old, new) +-# Autoconf insists on making our life difficult... +-for path in paths: +- path = path.replace("${exec_prefix}", "@exec_prefix@") +- path = path.replace("${prefix}", "@prefix@") +- sys.path.append(path) +- + try: + import _omniidl + except ImportError, msg: +Index: b/src/tool/omniidl/python3/scripts/omniidl.in +=================================================================== +--- a/src/tool/omniidl/python3/scripts/omniidl.in ++++ b/src/tool/omniidl/python3/scripts/omniidl.in +@@ -43,11 +43,11 @@ import os, os.path + pylibdir = archlibdir = None + binarchdir = os.path.abspath(os.path.dirname(sys.argv[0])) + +-# Try a path based on the installation prefix +-sppath = "@prefix@/lib/python" + sys.version[:3] + "/site-packages" +- +-if os.path.isdir(sppath): +- sys.path.append(sppath) ++omniidldir = "/does-not-exist" ++if binarchdir == "/usr/bin": ++ omniidldir = os.path.join(os.path.dirname(binarchdir), "lib", "omniidl") ++if os.path.isdir(omniidldir): ++ sys.path.insert(0, omniidldir) + + # Paths in a traditional omni tree + if binarchdir != "": +@@ -92,20 +92,6 @@ if binarchdir != "": + if os.path.isdir(archlibdir): + sys.path.insert(0, archlibdir) + +-# Last chance, try a path based on the installation prefixes +-sys.path.append("@prefix@/lib/python" + sys.version[:3] + "/site-packages") +- +-paths = [ "@exec_prefix@/lib/python" + sys.version[:3] + "/site-packages", +- "@pythondir@", +- "@pyexecdir@" ] - - -# Autoconf insists on making our life difficult... -for path in paths: -- path = replace(path, "${exec_prefix}", "@exec_prefix@") -- path = replace(path, "${prefix}", "@prefix@") +- path = path.replace("${exec_prefix}", "@exec_prefix@") +- path = path.replace("${prefix}", "@prefix@") - sys.path.append(path) - +- try: import _omniidl + except ImportError as msg: diff -Nru omniorb-dfsg-4.1.6/debian/patches/revert_abi_breakage omniorb-dfsg-4.2.2/debian/patches/revert_abi_breakage --- omniorb-dfsg-4.1.6/debian/patches/revert_abi_breakage 2011-03-14 23:40:12.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/revert_abi_breakage 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -Description: Ensure the ABI stays compatible - Upstream accidentically introduced an ABI incompatible change in - 4.1.2. This patch reverts this change. - . - Upstream rejected this since the damage had already been done and - they didn't want to break the ABI twice. -Forwarded: http://www.omniorb-support.com/pipermail/omniorb-list/2008-April/029347.html -Author: Thomas Girard -Last-Update: 2010-08-08 - ---- a/include/omniORB4/sslContext.h -+++ b/include/omniORB4/sslContext.h -@@ -160,7 +160,6 @@ - const char* pd_password; - SSL_CTX* pd_ctx; - omni_tracedmutex* pd_locks; -- CORBA::Boolean pd_ssl_owner; - }; - - #undef _core_attr ---- a/src/lib/omniORB/orbcore/ssl/sslContext.cc -+++ b/src/lib/omniORB/orbcore/ssl/sslContext.cc -@@ -122,19 +122,42 @@ - - sslContext* sslContext::singleton = 0; - -+static sslContext* ssl_owner = 0; -+ -+static bool become_ssl_owner(sslContext* context) { -+ bool become_owner = false; -+ -+ if (ssl_owner == 0 && CRYPTO_get_locking_callback() == 0) { -+ ssl_owner = context; -+ become_owner = true; -+ } -+ -+ return become_owner; -+} -+ -+static bool was_ssl_owner(sslContext* context) { -+ bool was_owner = false; -+ -+ if (ssl_owner != 0 && ssl_owner == context) { -+ was_owner = true; -+ ssl_owner = 0; -+ } -+ -+ return was_owner; -+} - - ///////////////////////////////////////////////////////////////////////// - sslContext::sslContext(const char* cafile, - const char* keyfile, - const char* password) : - pd_cafile(cafile), pd_keyfile(keyfile), pd_password(password), pd_ctx(0), -- pd_locks(0), pd_ssl_owner(0) {} -+ pd_locks(0) {} - - - ///////////////////////////////////////////////////////////////////////// - sslContext::sslContext() : - pd_cafile(0), pd_keyfile(0), pd_password(0), pd_ctx(0), -- pd_locks(0), pd_ssl_owner(0) { -+ pd_locks(0) { - } - - ///////////////////////////////////////////////////////////////////////// -@@ -144,7 +167,7 @@ - if (pd_ctx) return; - - // Assume we own the ssl if no locking callback yet. -- pd_ssl_owner = CRYPTO_get_locking_callback() == 0; -+ bool pd_ssl_owner = become_ssl_owner(this); - - if (pd_ssl_owner) { - SSL_library_init(); -@@ -189,7 +212,7 @@ - if (pd_ctx) { - SSL_CTX_free(pd_ctx); - } -- if (pd_ssl_owner) -+ if (was_ssl_owner(this)) - thread_cleanup(); - } - diff -Nru omniorb-dfsg-4.1.6/debian/patches/series omniorb-dfsg-4.2.2/debian/patches/series --- omniorb-dfsg-4.1.6/debian/patches/series 2017-11-13 13:35:53.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/series 2017-11-13 23:55:08.000000000 +0000 @@ -1,11 +1,9 @@ configfile -revert_abi_breakage buildsys cos_stubs -#useless_linking private_pythondir spurious_hashbang set_ipv6_v6only_to_0 catior_manpage -hurd -value_in_exception.patch +pkgconfig +#hurd diff -Nru omniorb-dfsg-4.1.6/debian/patches/set_ipv6_v6only_to_0 omniorb-dfsg-4.2.2/debian/patches/set_ipv6_v6only_to_0 --- omniorb-dfsg-4.1.6/debian/patches/set_ipv6_v6only_to_0 2011-05-15 11:09:12.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/set_ipv6_v6only_to_0 2014-10-10 16:28:51.000000000 +0000 @@ -7,9 +7,9 @@ Bug-Debian: http://bugs.debian.org/624099 Author: Upstream ---- a/include/omniORB4/internal/SocketCollection.h -+++ b/include/omniORB4/internal/SocketCollection.h -@@ -161,7 +161,6 @@ +--- a/include/omniORB4/internal/tcpSocket.h ++++ b/include/omniORB4/internal/tcpSocket.h +@@ -46,7 +46,6 @@ #define SOCKNAME_SIZE_T OMNI_SOCKNAME_SIZE_T #define USE_NONBLOCKING_CONNECT diff -Nru omniorb-dfsg-4.1.6/debian/patches/value_in_exception.patch omniorb-dfsg-4.2.2/debian/patches/value_in_exception.patch --- omniorb-dfsg-4.1.6/debian/patches/value_in_exception.patch 2017-11-13 13:35:53.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/patches/value_in_exception.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ ---- a/src/lib/omniORB/orbcore/GIOP_S.cc -+++ b/src/lib/omniORB/orbcore/GIOP_S.cc -@@ -558,6 +558,8 @@ - } - } - pd_state = ReplyCompleted; -+ -+ clearValueTracker(); - return 1; - } - -@@ -662,6 +664,8 @@ - } - - pd_state = ReplyCompleted; -+ -+ clearValueTracker(); - return 1; - } - diff -Nru omniorb-dfsg-4.1.6/debian/README.source omniorb-dfsg-4.2.2/debian/README.source --- omniorb-dfsg-4.1.6/debian/README.source 2010-01-10 13:13:30.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/README.source 2014-10-03 16:07:26.000000000 +0000 @@ -1,6 +1,8 @@ = Compiling omniORB = - * omniORB-.tar.gz is retrieved from: + * omniORB-.tar.bz2 is retrieved from: http://omniorb.sourceforge.net * It was repackaged to remove etc/*.zip and bin/x86_win32/* + + -- Floris Bruynooghe , Fri, 28 Mar 2014 00:28:34 +0000 diff -Nru omniorb-dfsg-4.1.6/debian/rules omniorb-dfsg-4.2.2/debian/rules --- omniorb-dfsg-4.1.6/debian/rules 2017-11-13 13:35:53.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/rules 2017-11-14 15:01:45.000000000 +0000 @@ -3,36 +3,42 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk + +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += --build $(DEB_HOST_GNU_TYPE) -else - confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) endif PRG_PACKAGES := omniorb omniorb-nameserver omniidl -DEV_PACKAGES := libcos4-dev libomniorb4-dev libomnithread3-dev +DEV_PACKAGES := libcos4-dev libomniorb4-dev libomnithread4-dev -build/config.status: +configure-stamp: dh_testdir - cp -f /usr/share/misc/config.sub /usr/share/misc/config.guess bin/scripts - -mkdir build + dh_autotools-dev_updateconfig + dh_autoreconf + rm -rf build + mkdir -p build cd build && \ - ../configure $(confflags) \ + PYTHON=/usr/bin/python3 ../configure $(confflags) \ --prefix=/usr \ + --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --disable-thread-tracing \ - --with-openssl=/usr \ + --with-openssl \ --with-omniORB-config=/etc/omniORB.cfg \ --with-omniNames-logdir=/var/lib/omniorb + touch $@ build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp -build-stamp: build/config.status +build-stamp: configure-stamp dh_testdir $(MAKE) -C build touch $@ @@ -43,7 +49,8 @@ rm -f build-stamp configure-stamp -rm -rf build -find . -name "*.pyc" -exec rm {} \; - -rm bin/scripts/config.guess bin/scripts/config.sub + dh_autoreconf_clean + dh_autotools-dev_restoreconfig dh_clean install: build @@ -52,7 +59,9 @@ dh_prep $(MAKE) -C build install DESTDIR=$(CURDIR)/debian/tmp -find debian/tmp -name "*.pyc" -exec rm {} \; - dh_install --sourcedir=debian/tmp --list-missing + find debian/tmp -type d -name __pycache__ | xargs -r rm -rf + dh_missing --sourcedir=debian/tmp --list-missing + dh_install --sourcedir=debian/tmp # Build architecture-independent files here. binary-indep: build install @@ -77,23 +86,23 @@ dh_testdir -a dh_testroot -a dh_installdirs -a - install -m 0644 sample.cfg debian/libomniorb4-1/etc/omniORB.cfg + install -m 0644 sample.cfg debian/libomniorb4-2/etc/omniORB.cfg dh_installdocs -a dh_installexamples -a dh_installinit -a --name=omniorb4-nameserver dh_installman -a dh_installchangelogs update.log -a dh_strip $(addprefix -p,$(PRG_PACKAGES)) $(addprefix -p,$(DEV_PACKAGES)) - dh_strip -plibcos4-1 --dbg-package=libcos4-1-dbg - dh_strip -plibomniorb4-1 --dbg-package=libomniorb4-1-dbg - dh_strip -plibomnithread3c2 --dbg-package=libomnithread3c2-dbg + dh_strip -plibcos4-2 --dbg-package=libcos4-2-dbg + dh_strip -plibomniorb4-2 --dbg-package=libomniorb4-2-dbg + dh_strip -plibomnithread4 --dbg-package=libomnithread4-dbg dh_link -a dh_compress -a dh_fixperms -a - dh_makeshlibs -plibomnithread3c2 -V 'libomnithread3c2 (>= 4.0.6)' - dh_makeshlibs -plibomniorb4-1 -V 'libomniorb4-1 (>= 4.1.6)' - dh_makeshlibs -plibcos4-1 -V 'libcos4-1 (>= 4.1.6)' - dh_python2 -pomniidl + dh_makeshlibs -plibomnithread4 -V 'libomnithread4 (>= 4.2.0)' + dh_makeshlibs -plibomniorb4-2 -V 'libomniorb4-2 (>= 4.2.0)' + dh_makeshlibs -plibcos4-2 -V 'libcos4-2 (>= 4.2.0)' + dh_python3 -pomniidl dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a diff -Nru omniorb-dfsg-4.1.6/debian/watch omniorb-dfsg-4.2.2/debian/watch --- omniorb-dfsg-4.1.6/debian/watch 2008-05-28 21:12:02.000000000 +0000 +++ omniorb-dfsg-4.2.2/debian/watch 2014-10-03 16:07:26.000000000 +0000 @@ -2,4 +2,4 @@ version=3 -http://sf.net/omniorb/omniORB-(.+)\.tar\.gz +http://sf.net/omniorb/omniORB-(.+)\.tar\.bz2 diff -Nru omniorb-dfsg-4.1.6/doc/omniNames.html omniorb-dfsg-4.2.2/doc/omniNames.html --- omniorb-dfsg-4.1.6/doc/omniNames.html 2008-02-14 11:46:32.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniNames.html 2013-02-22 16:42:44.000000000 +0000 @@ -1,181 +1,157 @@ - +The omniNames CORBA Naming Service + -The OMNI Naming Service - - - + + - - - - - - -
- - -
-

The OMNI Naming Service

-

14 February 2008


- - -

1  Introduction

- -The OMNI Naming Service (omniNames) is an omniORB -implementation of the OMG's COS Naming Service Specification. It -offers a way for a client to turn a human-readable name into an object -reference, on which the client can subsequently invoke operations in -the normal way. See the OMG specification for full details of the -functionality provided by the Naming Service.
-
-The Naming Service stores a set of bindings of names to objects. + +

The omniNames CORBA Naming Service

omniORB 4.2

+

1  Introduction

omniNames is omniORB’s implementation of the OMG’s COS Naming Service +Specification. It offers a way for a client to turn a human-readable +name into an object reference, on which the client can subsequently +invoke operations in the normal way. See the OMG specification for +full details of the functionality provided by the Naming Service.

The Naming Service stores a set of bindings of names to objects. These bindings can be arranged as an arbitrary directed graph, although they are often arranged in a tree hierarchy. Each node in -the graph is a naming context. There is a “root” context at +the graph is a naming context. There is a ‘root’ context at which name lookups usually start. This is the object returned by the -call to CORBA::ORB::resolve_initial_references("NameService").
-
- - -

2  `Log' file

- -The Naming Service is often part of the bootstrapping process of other -CORBA programs. For this reason, if an instance of omniNames crashes -(or the machine on which it runs is rebooted), it is important that -certain aspects of its operation persist upon restarting. Firstly the -root context of the Naming Service should always be accessible through -the same object reference. This helps the ORB to implement the -resolve_initial_references call by allowing the object -reference to be stored in a configuration file, for example. -Secondly, the naming graph with all its bindings should persist -between invocations.
-
-To achieve this, omniNames generates a redo log file, to which it -writes out an entry every time a change is made to the naming graph. -The directory in which this log file is written can be specified with -the OMNINAMES_LOGDIR environment variable. When omniNames is -restarted it uses the log file so that it can regenerate the naming -graph.
-
-Periodically the log file is checkpointed, removing unnecessary -entries from the log file. The idle time between checkpoints can be -set with the OMNINAMES_ITBC environment variable. It defaults -to 15 minutes.
-
- - -

3  Starting omniNames and setting omniORB.cfg

- -When starting omniNames for the first time, you can either let it +call to CORBA::ORB::resolve_initial_references("NameService").

+

2  Data file

omniNames persists its contents in a data file. The data file takes +the form of a ‘redo log’, to which it writes out an entry every time a +change is made to the naming graph. The directory in which this log +file is written can be specified with the -datadir command +line option or the OMNINAMES_DATADIR environment variable. +When omniNames is restarted it uses the data file so that it can +regenerate the naming graph.

Periodically the data file is checkpointed, removing unnecessary +entries from the file. The idle time between checkpoints defaults to +15 minutes. That can be overridden by specifying a period in seconds +in the OMNINAMES_ITBC environment variable.

The name of the data file name normally includes the hostname, in the +form omninames-hostname.dat. To suppress +inclusion of the hostname, start omniNames with the +-nohostname option.

Previous versions of omniNames referred to the data file as a ‘log +file’, and the file had the extension ‘.log’. When omniNames +starts up, it will accept a data file with the extension ‘.log’ +and replace it with one with the extension ‘.dat’.

+

3  Starting omniNames and configuring omniORB

When starting omniNames for the first time, you can either let it start with the default TCP port of 2809, or you can specify the port -number on which it should listen. This is written to the log file so +number on which it should listen. This is written to the data file so that on subsequent invocations it will listen on the same port number and thus can be accessible through the same object reference. When omniNames starts up successfully it writes the stringified object -reference for its root context on standard error.
-
-At startup, omniORB tries to read the configuration file -omniORB.cfg to obtain the object reference to the root context -of the Naming Service. This object reference is returned by -resolve_initial_references("NameService"). There are a number -of methods of specifying the root naming context in -omniORB.cfg—see the omniORB manual for details.
-
- - -

4  Command line parameters

- -omniNames accepts the following command line parameters.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
-helpOutput usage information.
-start [port]Start omniNames for the first time, listening on - port.
-alwaysIn conjunction with -start, always start up - omniNames, even if its log file already exists.
-logdir directorySpecifies the directory for the redo log file, overriding the - default.
-errlog filenameCauses output that would normally be sent to stderr to go to the - specified file instead.
-nohostnameNormally, omniNames includes the host name in the name of the redo - log file. This option disables that, meaning the log file can be - used on a different host, or if the host name - changes.
-ignoreportomniNames normally adds its own endpoint, based on the port - specification (given with -start or stored in the log - file). This option causes it to ignore the port. It should be used - in conjunction with specific -ORBendPoint options to - ensure object references are stable.
-install [port]On Windows, install omniNames service. See below.
-manualOn Windows, specify that the service should be started - manually. See below.
-removeOn Windows, uninstall omniNames service. See below.

- - -

5  Windows service

- -omniNames can be run as a Windows service.
-
-To install the service, run with the -install command line -option, with a port to override the default 2809 if necessary. The -command line should include any other parameters of relevance, such as -the log directory and error log file. It is particularly important to -specify an error log file, since the service runs in an environment -where stderr goes nowhere. Similarly, if omniORB tracing is requested -with the various -ORBtrace options, -ORBtraceFile -should be specified, otherwise the trace messages vanish.
-
-The service is normally configured to start at system startup time. +reference for its root context on standard error.

At startup, omniORB reads its configuration from omniORB.cfg or +from the Windows registry. Amongst other settings, the configuration +contains the object reference to the root context of the Naming +Service. This object reference is returned by +resolve_initial_references("NameService"). There are a number +of methods of specifying the root naming context—see the omniORB +manual for details.

+

4  Command line parameters

omniNames accepts the following command line parameters.

+ + + + + + + + + + +
 
+-help Output usage information.
+-start [port] Start omniNames for the first time, listening on +port.
+-always In conjunction with -start, always start up +omniNames, even if its data file already exists.
+-datadir directory Specifies the directory for the data file, overriding the +default.
+-logdir directory Equivalent to -datadir, for compatibility with previous +omniNames versions.
+-errlog filename Causes trace output that would normally be sent to stderr to go to the +specified file instead.
+-nohostname Normally, omniNames includes the host name in the name of the data +file. This option disables that, meaning the data file can be used +on a different host, or if the host name changes.
+-install [port] On Windows, install omniNames service. See below.
+-manual On Windows, specify that the service should be configured to +require manual start. See below.
+-remove On Windows, uninstall omniNames service. See below.
+

5  Machines with multiple IP addresses

The CORBA naming service is a tree (or graph) of NamingContext +CORBA objects. For each of those CORBA objects, the object reference +contains details about the endpoint—i.e. the host address +and port—that is used to contact the object.

When the machine running omniNames has multiple IP addresses, omniORB +listens for incoming connections on all addresses, but it arbitrarily +picks one of the addresses to publish in object references. It might +pick the ‘wrong’ one, meaning that clients connect to the configured +root context successfully, but then fail to connect to the +sub-contexts. To force omniORB to publish the correct IP address, use +the -ORBendPointPublish command line parameter:

+-ORBendPointPublish giop:tcp:address: +

where address can be an IP address or a host name.

Occasionally, it is necessary to limit omniNames to listen on just one +of a machine’s IP addresses. To do that, use -ORBendPoint to +specify the address to listen on. In this case, you should also +specify a port (e.g. the standard 2809), otherwise an arbitrary +ephemeral port will be used for the endpoint:

+-ORBendPoint giop:tcp:address:2809 +
+

6  Windows service

omniNames can be run as a Windows service. To install the service, run +with the -install command line option, with a port to +override the default 2809 if necessary. The command line should +include any other parameters of relevance, such as the data directory +and error log file. It is particularly important to specify an error +log file, since the service runs in an environment where stderr goes +nowhere.

The service is normally configured to start at system startup time. Specifying -manual configures it for manual startup. Regardless of that setting, the service is not automatically started at the time it is installed. It should be started manually with the service control manager if it is to run before the next system -restart.
-
-Once installed, the service can be uninstalled by running omniNames -with the -remove option.
-
+restart.

Once installed, the service can be uninstalled by running omniNames +with the -remove option.


This document was translated from LATEX by -HEVEA.
+HEVEA. Binary files /tmp/tmpAImAYv/p4jQLK3klS/omniorb-dfsg-4.1.6/doc/omniNames.pdf and /tmp/tmpAImAYv/V3z_zxpzZI/omniorb-dfsg-4.2.2/doc/omniNames.pdf differ diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/index.html omniorb-dfsg-4.2.2/doc/omniORB/index.html --- omniorb-dfsg-4.1.6/doc/omniORB/index.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/index.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,152 +1,137 @@ - - - -omniORB - - - - - - + + + + + +omniORB + + + -

The omniORB version 4.1
-User’s Guide -

Duncan Grisby
-
(email: dgrisby@apasphere.com)
-Apasphere Ltd.
-Sai-Lai Lo
-David Riddoch
-AT&T Laboratories Cambridge
-

July 2009 -

Changes and Additions, July 2007 -

  • -Updates for omniORB 4.1.1. -

Changes and Additions, June 2005 -

  • -New omniORB 4.1 features. -

Changes and Additions, October 2004 -

  • -Packaging stubs into DLLs. -

Changes and Additions, July 2004 -

  • -Minor updates. -

Changes and Additions, November 2002 -

  • -Per thread timeouts. -
  • Implement missing interceptors. -
  • Minor fixes. -

Changes and Additions, June 2002 -

  • -Updated to omniORB 4.0. -

Contents

+

The omniORB version 4.2
+Users’ Guide +

Duncan Grisby
+
(dgrisby@apasphere.com)
+

Contents

+ -
This document was translated from LATEX by -HEVEA.
- +
This document was translated from LATEX by +HEVEA.
+ diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB001.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB001.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB001.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB001.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,26 +1,38 @@ - - - - - - - -Introduction - - -Up -Next -
-

Chapter 1  Introduction

omniORB is an Object Request Broker (ORB) that implements the 2.6 -specification of the Common Object Request Broker Architecture -(CORBA) [OMG01]1. It has -passed the Open Group CORBA compliant testsuite (for CORBA 2.1) and -was one of the three ORBs to be granted the CORBA brand in June -19992.

This user guide tells you how to use omniORB to develop CORBA -applications. It assumes a basic understanding of CORBA.

In this chapter, we give an overview of the main features of omniORB -and what you need to do to setup your environment to run omniORB.

1.1  Features

1.1.1  Multithreading

omniORB is fully multithreaded. To achieve low call overhead, -unnecessary call-multiplexing is eliminated. With the default + + + + + + +Introduction + + +Up +Next +


+

Chapter 1  Introduction

+

omniORB is an Object Request Broker (ORB) that implements version 2.6 +of the Common Object Request Broker Architecture +(CORBA) [OMG01] specification. Where possible, backward +compatibility has been maintained back to specification 2.0. It passed +the Open Group CORBA compliant testsuite (for CORBA 2.1) and was one +of the three ORBs to be granted the CORBA brand in June 1999.

This user guide tells you how to use omniORB to develop CORBA +applications. It assumes a basic understanding of CORBA.

In this chapter, we give an overview of the main features of omniORB +and what you need to do to set up your environment to run omniORB.

+

1.1  Features

+

omniORB is quite feature-rich, but it does not slavishly implement +every last part of the CORBA specification. The goal is to provide the +most generally useful parts of the specification in a clean and +efficient manner. Highlights are:

  • C++ and Python language bindings.
  • Support for the complete Portable Object Adapter (POA) specification.
  • Support for the Interoperable Naming Service (INS).
  • Internet Inter-ORB Protocol (IIOP 1.2) is used as the native +protocol.
  • The omniORB runtime is fully multithreaded. It uses platform +thread support encapsulated with a small class library, omnithread, +to abstract away from differences in native thread APIs.
  • TypeCode and type Any are supported.
  • DynAny is supported.
  • The Dynamic Invocation and Dynamic Skeleton interfaces are supported.
  • Valuetype and abstract interfaces are supported.
  • Asynchronous Method Invocation (AMI) supported, including both +polling and callback models.
  • Extensive control over connection management.
  • Soft real-time features including call deadlines and timeouts.
  • A COS Naming Service, omniNames.
  • Many platforms are supported, including most Unix platforms and +Windows.
  • It has been successfully tested for interoperability via IIOP with +other ORBs.
+

1.1.1  Multithreading

+

omniORB is fully multithreaded. To achieve low call overhead, +unnecessary call multiplexing is eliminated. With the default policies, there is at most one call in-flight in each communication channel between two address spaces at any one time. To do this without limiting the level of concurrency, new channels connecting the two @@ -32,114 +44,113 @@ arguments, large data elements are sent as soon as they are processed while the other arguments are being marshalled. With GIOP 1.2, large messages are fragmented, so the marshaller can start transmission -before it knows how large the entire message will be.

From version 4.0 onwards, omniORB also supports a flexible thread -pooling policy, and supports sending multiple interleaved calls on a -single connection. This policy leads to a small amount of additional -call overhead, compared to the default thread per connection model, -but allows omniORB to scale to extremely large numbers of concurrent -clients.

1.1.2  Portability

omniORB has always been designed to be portable. It runs on many -flavours of Unix, Windows, several embedded operating systems, and -relatively obscure systems such as OpenVMS and Fujitsu-Siemens BS2000. -It is designed to be easy to port to new platforms. The IDL to C++ -mapping for all target platforms is the same.

omniORB uses real C++ exceptions and nested classes. It keeps to the +before it knows how large the entire message will be.

omniORB also supports a flexible thread pool policy, and supports +sending multiple interleaved calls on a single connection. This policy +leads to a small amount of additional call overhead, compared to the +default thread per connection model, but allows omniORB to scale to +extremely large numbers of concurrent clients.

+

1.1.2  Portability

+

omniORB runs on many flavours of Unix, Windows, several embedded +operating systems, and relatively obscure systems such as OpenVMS and +Fujitsu-Siemens BS2000. It is designed to be easy to port to new +platforms. The IDL to C++ mapping for all target platforms is the +same.

omniORB uses real C++ exceptions and nested classes. It keeps to the CORBA specification’s standard mapping as much as possible and does -not use the alternative mappings for C++ dialects. The only exception -is the mapping of IDL modules, which can use either namespaces or -nested classes.

omniORB relies on native thread libraries to provide multithreading -capability. A small class library (omnithread [Ric96]) is used +not use the alternative mappings for C++ dialects. The only small +exception is the mapping of IDL modules, which can use either +namespaces according to the standard, or nested classes for truly +ancient C++ compilers without namespace support.

omniORB relies on native thread libraries to provide multithreading +capability. A small class library (omnithread [Ric96]) is used to encapsulate the APIs of the native thread libraries. In application code, it is recommended but not mandatory to use this class library for thread management. It should be easy to port omnithread to any platform that either supports the POSIX thread standard or has a -thread package that supports similar capabilities.

1.1.3  Missing features

-

omniORB is not (yet) a complete implementation of the CORBA 2.6 core. -The following is a list of the most significant missing features.

  • omniORB does not have its own Interface Repository. However, it +thread package that supports similar capabilities.

    Partly for historical reasons, and partly to support users with +archaic compilers, omniORB does not use the C++ standard library.

    The omniORB IDL compiler, omniidl, requires Python 2.5, 2.6 or 2.7.

    +

    1.1.3  Missing features

    +

    +

    omniORB is not a complete implementation of the CORBA 2.6 core. The +following is a list of the most significant missing features.

    • omniORB does not have its own Interface Repository. However, it can act as a client to an IfR. The omniifr project -(http://omniifr.sourceforge.net/) aims to create an IfR for -omniORB.
    • omniORB supports interceptors, but not the standard Portable -Interceptor API.

    These features may be implemented in the short to medium term. It is -best to check out the latest status on the omniORB home page -(http://omniorb.sourceforge.net/).

    1.2  Setting up your environment

    -

    To get omniORB running, you first need to install omniORB according to -the instructions in the installation notes for your platform. Most -Unix platforms can use the Autoconf configure script to -automate the configuration process.

    Once omniORB is installed in a suitable location, you must configure -it according to your required set-up. The configuration can be set -with a configuration file, environment variables, command-line -arguments or, on Windows, the Windows registry.

    • On Unix platforms, the omniORB runtime looks for the environment -variable OMNIORB_CONFIG. If this variable is defined, it +(http://omniifr.sourceforge.net/) aims to create an IfR for +omniORB.
    • omniORB supports interceptors, but not the standard Portable +Interceptor API.
    +

    1.2  Setting up your environment

    +

    +

    To get omniORB running, you first need to install omniORB according to +the instructions in the installation notes for your platform. See +README.FIRST.txt at the top of the omniORB tree for +instructions. Most Unix platforms can use the Autoconf +configure script to automate the configuration process.

    Once omniORB is installed in a suitable location, you must configure +it according to your required setup. The configuration can be set with +a configuration file, environment variables, command-line arguments +or, on Windows, the Windows registry.

    • On Unix platforms, the omniORB runtime looks for the environment +variable OMNIORB_CONFIG. If this variable is defined, it contains the pathname of the omniORB configuration file. If the variable is not set, omniORB will use the compiled-in pathname to -locate the file (by default /etc/omniORB.cfg).
    • On Win32 platforms (Windows NT, 2000, 95, 98), omniORB first -checks the environment variable OMNIORB_CONFIG to obtain the -pathname of the configuration file. If this is not set, it then -attempts to obtain configuration data in the system registry. It -searches for the data under the key -HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

    omniORB has a large number of parameters than can be configured. See -chapter 4 for full details. The files -sample.cfg and sample.reg contain an example -configuration file and set of registry entries respectively.

    To get all the omniORB examples running, the main thing you need to +locate the file (by default /etc/omniORB.cfg).

  • On Win32 / Win64 platforms, omniORB first checks the environment +variable OMNIORB_CONFIG to obtain the pathname of the +configuration file. If this is not set, it then attempts to obtain +configuration data in the system registry. It searches for the data +under the key HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

omniORB has a large number of parameters than can be configured. See +chapter 4 for full details. The files +sample.cfg and sample.reg contain an example +configuration file and set of registry entries respectively.

To get all the omniORB examples running, the main thing you need to configure is the Naming service, omniNames. To do that, the -configuration file or registry should contain an entry of the form

  InitRef = NameService=corbaname::my.host.name
-

See section 6.1.2 for full details of corbaname URIs.

1.3  Platform specific variables

To compile omniORB programs correctly, several C++ preprocessor defines -must be specified to identify the target platform. On Unix -platforms where omniORB was configured with Autoconf, the -omniconfig.h file sets these for you. On other platforms, and +configuration file or registry should contain an entry of the form

  InitRef = NameService=corbaname::my.host.name
+

See section 7.1.4 for full details of +corbaname URIs.

+

1.3  Platform specific variables

+

To compile omniORB programs correctly, several C++ preprocessor +defines must be specified to identify the target platform. On +Unix platforms where omniORB was configured with Autoconf, the +omniconfig.h file sets these for you. On other platforms, and Unix platforms when Autoconf is not used, you must specify the -following defines:

- - - - - - - - - - - - - - - - - - -
PlatformCPP defines
Windows NT 4.0,2000,XP__x86__ __NT__ __OSVERSION__=4 __WIN32__
-Windows NT 3.5__x86__ __NT__ __OSVERSION__=3 __WIN32__
-Windows 95__x86__ __WIN32__
-Sun Solaris 2.5__sparc__ __sunos__ __OSVERSION__=5
-HPUX 10.x__hppa__ __hpux__ __OSVERSION__=10
-HPUX 11.x__hppa__ __hpux__ __OSVERSION__=11
-IBM AIX 4.x__aix__ __powerpc__ __OSVERSION__=4
-Digital Unix 3.2__alpha__ __osf1__ __OSVERSION__=3
-Linux 2.x (x86)__x86__ __linux__ __OSVERSION__=2
-Linux 2.x (powerpc)__powerpc__ __linux__ __OSVERSION__=2
-OpenVMS 6.x (alpha)__alpha__ __vms __OSVERSION__=6
-OpenVMS 6.x (vax)__vax__ __vms __OSVERSION__=6
-SGI Irix 6.x__mips__ __irix__ __OSVERSION__=6
-Reliant Unix 5.43__mips__ __SINIX__ __OSVERSION__=5
-ATMos 4.0__arm__ __atmos__ __OSVERSION__=4
-NextStep 3.x__m68k__ __nextstep__ __OSVERSION__=3
-Unixware 7__x86__ __uw7__ __OSVERSION__=5
-

The preprocessor defines for new platform ports not listed above can +following defines:

+ + + + + + + + + + + + + + + + + +
PlatformCPP defines
Windows__x86__ __NT__ __OSVERSION__=4 __WIN32__
+Windows NT 3.5__x86__ __NT__ __OSVERSION__=3 __WIN32__
+Sun Solaris 2.5__sparc__ __sunos__ __OSVERSION__=5
+HPUX 10.x__hppa__ __hpux__ __OSVERSION__=10
+HPUX 11.x__hppa__ __hpux__ __OSVERSION__=11
+IBM AIX 4.x__aix__ __powerpc__ __OSVERSION__=4
+Digital Unix 3.2__alpha__ __osf1__ __OSVERSION__=3
+Linux 2.x (x86)__x86__ __linux__ __OSVERSION__=2
+Linux 2.x (powerpc)__powerpc__ __linux__ __OSVERSION__=2
+OpenVMS 6.x (alpha)__alpha__ __vms __OSVERSION__=6
+OpenVMS 6.x (vax)__vax__ __vms __OSVERSION__=6
+SGI Irix 6.x__mips__ __irix__ __OSVERSION__=6
+Reliant Unix 5.43__mips__ __SINIX__ __OSVERSION__=5
+ATMos 4.0__arm__ __atmos__ __OSVERSION__=4
+NextStep 3.x__m68k__ __nextstep__ __OSVERSION__=3
+Unixware 7__x86__ __uw7__ __OSVERSION__=5
+

The preprocessor defines for new platform ports not listed above can be found in the corresponding platform configuration files. For instance, the platform configuration file for Sun Solaris 2.6 is in -mk/platforms/sun4_sosV_5.6.mk. The preprocessor defines to +mk/platforms/sun4_sosV_5.6.mk. The preprocessor defines to identify a platform are in the make variable -IMPORT_CPPFLAGS.

In a single source multi-target environment, you can put the +IMPORT_CPPFLAGS.

In a single source multi-target environment, you can put the preprocessor defines as the command-line arguments for the compiler. If you are building for a single platform, you can edit -include/omniconfig.h to add the definitions.


-1
Most of the 2.6 features have -been implemented. The features still missing in this release are -listed in section 1.1.3. Where possible, backward -compatibility has been maintained up to specification 2.0. -
2
More information can be found at -http://www.opengroup.org/press/7jun99_b.htm -
-
-Up -Next - - +include/omniconfig.h to add the definitions.

+
+Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB002.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB002.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB002.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB002.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,1405 +1,1389 @@ - - - - - - - -The Basics - - -Previous -Up -Next -
-

Chapter 2  The Basics

-

In this chapter, we go through three examples to illustrate the + + + + + + +The Basics + + +Previous +Up +Next +


+

Chapter 2  The Basics

+

+

In this chapter, we go through three examples to illustrate the practical steps to use omniORB. By going through the source code of each example, the essential concepts and APIs are introduced. If you have no previous experience with using CORBA, you should study this chapter in detail. There are pointers to other essential documents you -should be familiar with.

If you have experience with using other ORBs, you should still go +should be familiar with.

If you have experience with using other ORBs, you should still go through this chapter because it provides important information about the features and APIs that are necessarily omniORB specific. With the -Portable Object Adapter, there are very few omniORB specific details.

2.1  The Echo Object Example

Our example is an object which has only one method. The method simply -echos the argument string. We have to:

  1. define the object interface in IDL; -
  2. use the IDL compiler to generate the stub code1; -
  3. provide the servant object implementation; -
  4. write the client code.

These examples are in the src/examples/echo directory of the -omniORB distribution; there are several other examples one directory -above that in src/examples.

2.2  Specifying the Echo interface in IDL

We define an object interface, called Echo, as follows:

interface Echo { - string echoString(in string mesg); -};

If you are new to IDL, you can learn about its syntax in Chapter 3 of -the CORBA 2.6 specification [OMG01]. For the moment, you +Portable Object Adapter, there are very few omniORB specific details.

+

2.1  The Echo Object Example

+

Our example is an object which has only one method. The method simply +echos the argument string. We have to:

  1. define the object interface in IDL +
  2. use the IDL compiler to generate the stub code, which provides +the object mapping as defined in the CORBA specification +
  3. provide the servant object implementation +
  4. write the client code.

These examples are in the src/examples/echo directory of the +omniORB distribution; there are several other examples in +src/examples.

+

2.2  Specifying the Echo interface in IDL

+

We define an object interface, called Echo, as follows:

interface Echo { + string echoString(in string mesg); +};

If you are new to IDL, you can learn about its syntax in Chapter 3 of +the CORBA 2.6 specification [OMG01]. For the moment, you only need to know that the interface consists of a single operation, -echoString(), which takes a string as an input argument and returns -a copy of the same string.

The interface is written in a file, called echo.idl. It is part -of the CORBA standard that all IDL files should have the extension -‘.idl’, although omniORB does not enforce this.

For simplicity, the interface is defined in the global IDL namespace. -You should avoid this practice for the sake of object reusability. If -every CORBA developer defines their interfaces in the global IDL -namespace, there is a danger of name clashes between two independently -defined interfaces. Therefore, it is better to qualify your interfaces -by defining them inside module names. Of course, this does not -eliminate the chance of a name clash unless some form of naming -convention is agreed globally. Nevertheless, a well-chosen module name -can help a lot.

2.3  Generating the C++ stubs

From the IDL file, we use the IDL compiler to produce the C++ mapping +echoString(), which takes a string as an input argument and returns +a copy of the same string.

The interface is written in a file, called echo.idl. It is part +of the CORBA standard that all IDL files must have the extension +‘.idl’, although omniORB does not enforce this. In the omniORB +distribution, this file is in idl/echo.idl.

For simplicity, the interface is defined in the global IDL namespace. +You should normally avoid this practice for the sake of object +reusability. If every CORBA developer defines their interfaces in the +global IDL namespace, there is a danger of name clashes between two +independently defined interfaces. Therefore, it is better to qualify +your interfaces by defining them inside module names. Of +course, this does not eliminate the chance of a name clash unless some +form of naming convention is agreed globally. Nevertheless, a +well-chosen module name can help a lot.

+

2.3  Generating the C++ stubs

+

From the IDL file, we use the IDL compiler to produce the C++ mapping of the interface. The IDL compiler for omniORB is called omniidl. Given the IDL file, omniidl produces two stub files: a C++ header file -and a C++ source file. For example, from the file echo.idl, the -following files are produced:

  • -echo.hh -
  • echoSK.cc -

omniidl must be invoked with the -bcxx argument to +and a C++ source file. For example, from the file echo.idl, the +following files are produced:

  • +echo.hh +
  • echoSK.cc +

omniidl must be invoked with the -bcxx argument to tell it to generate C++ stubs. The following command line generates -the stubs for echo.idl:

omniidl -bcxx echo.idl

If you are using our make environment (ODE), you don’t need -to invoke omniidl explicitly. In the example file dir.mk, we -have the following line:

CORBA_INTERFACES = echo

That is all we need to instruct ODE to generate the stubs. -Remember, you won’t find the stubs in your working directory because -all stubs are written into the stub directory at the top level -of your build tree.

The full arguments to omniidl are detailed in -chapter 5.

2.4  Object References and Servants

We contact a CORBA object through an object reference. The -actual implementation of a CORBA object is termed a servant.

Object references and servants are quite separate entities, and it is +the stubs for echo.idl:

omniidl -bcxx echo.idl

Note that the names echo.hh and echoSK.cc are not +defined in the C++ mapping standard. Other CORBA implementations may +use different file names. To aid migration omniidl from other +implementations, omniidl has options to override the default output +file names. See section 5.2 for details.

If you are using our make environment, you don’t need to invoke +omniidl explicitly. In the example file dir.mk, we have the +following line:

CORBA_INTERFACES = echo

That is all we need to instruct the build system to generate +the stubs. You won’t find the stubs in your working directory because +all stubs are written into the stub directory at the top level +of your build tree.

The full arguments to omniidl are detailed in +chapter 5.

+

2.4  Object References and Servants

+

We contact a CORBA object through an object reference. The +actual implementation of a CORBA object is termed a servant.

Object references and servants are quite separate entities, and it is important not to confuse the two. Client code deals purely with object references, so there can be no confusion; object implementation code -must deal with both object references and servants. omniORB 4 uses +must deal with both object references and servants. omniORB uses distinct C++ types for object references and servants, so the C++ compiler will complain if you use a servant when an object reference -is expected, or vice-versa.


- -
-
Warning

omniORB 2.x did not use distinct types for object references -and servants, and often accepted a pointer to a servant when the CORBA -specification says it should only accept an object reference. If you -have code which relies on this, it will not compile with omniORB 3.x -or 4.x, even under the BOA compatibility mode. -


2.5  A Quick Tour of the C++ stubs

The C++ stubs conform to the standard mapping defined in the CORBA -specification [OMG03]. It is important to understand the -mapping before you start writing any serious CORBA applications. -Before going any further, it is worth knowing what the mapping looks -like.

For the example interface Echo, the C++ mapping for its object -reference is Echo_ptr. The type is defined in echo.hh. -The relevant section of the code is reproduced below. The stub code -produced by other ORBs will be functionally equivalent to omniORB’s, -but will almost certainly look very different.

class Echo; -class _objref_Echo; -class _impl_Echo; -typedef _objref_Echo* Echo_ptr; - -class Echo { -public: - // Declarations for this interface type. - typedef Echo_ptr _ptr_type; - typedef Echo_var _var_type; - - static _ptr_type _duplicate(_ptr_type); - static _ptr_type _narrow(CORBA::Object_ptr); - static _ptr_type _nil(); - - // ... methods generated for internal use -}; - -class _objref_Echo : - public virtual CORBA::Object, public virtual omniObjRef { -public: - char * echoString(const char* mesg); - - // ... methods generated for internal use -};

In a compliant application, the operations defined in an object -interface should only be invoked via an object reference. -This is done by using arrow (‘->’) on an object reference. -For example, the call to the operation echoString() would be -written as obj->echoString(mesg).

It should be noted that the concrete type of an object reference is -opaque, i.e. you must not make any assumption about how an object -reference is implemented. In our example, even though Echo_ptr -is implemented as a pointer to the class _objref_Echo, it -should not be used as a C++ pointer, i.e. conversion to void*, -arithmetic operations, and relational operations including testing for -equality using operator==, must not be performed on the type.

In addition to class _objref_Echo, the mapping defines three -static member functions in the class Echo: _nil(), -_duplicate(), and _narrow().

The _nil() function returns a nil object reference of the Echo -interface. The following call is guaranteed to return TRUE:

CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil());

Remember, CORBA::is_nil() is the only compliant way to check if an -object reference is nil. You should not use the equality -operator==. Many C++ ORBs use the null pointer to represent a -nil object reference; omniORB does not.

The _duplicate() function returns a new object reference of the -Echo interface. The new object reference can be used -interchangeably with the old object reference to perform an operation -on the same object. Duplications are required to satisfy the C++ -mapping’s reference counting memory management.

All CORBA objects inherit from the generic object -CORBA::Object. CORBA::Object_ptr is the object -reference type for CORBA::Object. Any _ptr object -reference is therefore conceptually inherited from -CORBA::Object_ptr. In other words, an object reference such as -Echo_ptr can be used in places where a -CORBA::Object_ptr is expected.

The _narrow() function takes an argument of type -CORBA::Object_ptr and returns a new object reference of the -Echo interface. If the actual (runtime) type of the argument -object reference can be narrowed to Echo_ptr, _narrow() +is expected, or vice-versa.

+

2.5  A quick look at the C++ mapping

+

The C++ stubs conform to the standard mapping defined in the CORBA +specification [OMG03]. Sadly, since it pre-dates the C++ +standard library, the C++ language mapping is quite hard to use, +especially because it has complex memory management rules.

The best way to understand the mapping is to read either the +specification or, better, a book about using CORBA from C++. Reading +the code generated by omniidl is hard-going, and it is difficult to +distinguish the parts you need to know from the implementation +details.

+

2.5.1  Mapping overview

+

For interface Echo, omniidl generates four things of note:

  • +class Echo, containing static functions and type +definitions
  • Echo_ptr, an object reference type with pointer +semantics
  • Echo_var, a memory management helper for +Echo_ptr
  • class POA_Echo, the server-side skeleton class
+

2.5.2  Interface scope type

+

A C++ class Echo is defined to hold a number of static +functions and type definitions. It looks like this:

class Echo { +public: + typedef Echo_ptr _ptr_type; + typedef Echo_var _var_type; + + static _ptr_type _duplicate(_ptr_type); + static _ptr_type _narrow(CORBA::Object_ptr); + static _ptr_type _nil(); +};

The _ptr_type and _var_type typedefs are there to +facilitate template programming. The static functions are described +below.

+

2.5.3  Object reference pointer type

+

For interface Echo, the mapping defines the object reference +type Echo_ptr which has pointer semantics. The _ptr +type provides access to the interface’s operations. The concrete type +of an object reference is opaque, i.e. you must not make any +assumptions about how an object reference is implemented. You can +imagine it looks something like this:

class private_class : public some_base_class { + char* echoString(const char* mesg); +}; + +typedef something Echo_ptr;

To use an object reference, you use the arrow operator ‘->’ to +invoke its operations, but you must not use it as a C++ pointer in any +other respect. It is non-compliant to convert it to void*, +perform arithmetic or relational operations including testing for +equality using operator==.

In some CORBA implementations, Echo_ptr is a typedef to +Echo*. In omniORB, it is not—the object reference type is +distinct from class Echo.

+

2.5.3.1  Nil object reference

+

Object references can be nil. To obtain a nil object reference +for interface Echo, call Echo::_nil(). To test if an +object reference is nil, use CORBA::_is_nil():

CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil());

Echo::_nil() is the only compliant way to obtain a nil Echo +reference, and CORBA::is_nil() is the only compliant way to check +if an object reference is nil. You should not use the equality +operator==. Many C++ ORBs use the null pointer to represent a +nil object reference, but omniORB does not.

+

2.5.3.2  Object reference lifecycle

+

Object references are reference counted. That is, the opaque C++ +objects on the client side that implement Echo_ptr are +reference counted, so they are deleted when the count goes to zero. +The lifetime of an object reference has no bearing at all on the +lifetime of the CORBA object to which it is a reference—when an +object reference is deleted, it has no effect on the object in +the server.

Reference counting for Echo object references is performed with +Echo::_duplicate() and CORBA::release().

The _duplicate() function returns a new object reference of the +Echo interface. The new object reference can be used interchangeably +with the old object reference to perform an operation on the same +object.

To indicate that an object reference will no longer be accessed, you +must call the CORBA::release() operation. Its signature is as +follows:

namespace CORBA { + void release(CORBA::Object_ptr obj); + ... // other methods +};

Once you have called CORBA::release() on an object reference, you +may no longer use that reference. This is because the associated +resources may have been deallocated. Remember that we are referring to +the resources associated with the object reference and not the +servant object. Servant objects are not affected by the lifetimes +of object references. In particular, servants are not deleted when all +references to them have been released—CORBA does not perform +distributed garbage collection.

Nil object references are not reference counted, so there is no +need to call _duplicate() and release() with them, although it +does no harm.

Since object references must be released explicitly, their usage is +prone to error and can lead to memory leaks or invalid memory +accesses. The mapping defines the object reference variable +type Echo_var to make life somewhat easier.

The Echo_var is more convenient to use because it +automatically releases its object reference when it goes out of scope +or when assigned a new object reference. For many operations, mixing +data of type Echo_var and Echo_ptr is possible without +any explicit operations or casting. For instance, the echoString() +operation can be called using the arrow (‘->’) on a +Echo_var, as one can do with a Echo_ptr.

The usage of Echo_var is illustrated below:

Echo_var a; +Echo_ptr p = ... // somehow obtain an object reference + +a = p; // a assumes ownership of p, must not use p any more + +Echo_var b = a; // implicit _duplicate + +p = ... // somehow obtain another object reference + +a = Echo::_duplicate(p); // release old object reference + // a now holds a copy of p.

The mappings of many other IDL data types include _var types +with similar semantics.

+

2.5.3.3  Object reference inheritance

+

All CORBA objects inherit from the generic object +CORBA::Object. CORBA::Object_ptr is the object +reference type for base CORBA::Object. Object references can be +implicitly widened to base interface types, so this is valid:

Echo_ptr echo_ref = // get reference from somewhere +CORBA::Object_ptr base_ref = echo_ref; // widen

An object reference such as Echo_ptr can be used in places +where a CORBA::Object_ptr is expected. Conversely, the +Echo::_narrow() function takes an argument of type +CORBA::Object_ptr and returns a new object reference of the +Echo interface. If the actual (runtime) type of the argument +object reference can be narrowed to Echo_ptr, _narrow() will return a valid object reference. Otherwise it will return a nil -object reference. Note that _narrow() performs an implicit +object reference. Note that _narrow() performs an implicit duplication of the object reference, so the result must be released. -Note also that _narrow() may involve a remote call to check the +Note also that _narrow() may involve a remote call to check the type of the object, so it may throw CORBA system exceptions such as -COMM_FAILURE or OBJECT_NOT_EXIST.

To indicate that an object reference will no longer be accessed, you -must call the CORBA::release() operation. Its signature is as -follows:

namespace CORBA { - void release(CORBA::Object_ptr obj); - ... // other methods -};

Once you have called CORBA::release() on an object reference, you -must no longer use that reference. This is because the associated -resources may have been deallocated. Notice that we are referring to -the resources associated with the object reference and not the -servant object. Servant objects are not affected by the lifetimes of -object references. In particular, servants are not deleted when all -references to them have been released—CORBA does not perform -distributed garbage collection.

As described above, the equality operator== should not be used +TRANSIENT or OBJECT_NOT_EXIST.

+

2.5.3.4  Object reference equivalence

+

As described above, the equality operator== should not be used on object references. To test if two object references are equivalent, -the member function _is_equivalent() of the generic object -CORBA::Object can be used. Here is an example of its usage:

Echo_ptr A; -... // initialise A to a valid object reference -Echo_ptr B = A; -CORBA::Boolean true_result = A->_is_equivalent(B); -// Note: the above call is guaranteed to be TRUE

You have now been introduced to most of the operations that can be -invoked via Echo_ptr. The generic object CORBA::Object -provides a few more operations and all of them can be invoked via -Echo_ptr. These operations deal mainly with CORBA’s dynamic -interfaces. You do not have to understand them in order to use the C++ -mapping provided via the stubs.

Since object references must be released explicitly, their usage is -prone to error and can lead to memory leakage. The mapping defines the -object reference variable type to make life easier. In our -example, the variable type Echo_var is defined2.

The Echo_var is more convenient to use because it will -automatically release its object reference when it is deallocated or -when assigned a new object reference. For many operations, mixing data -of type Echo_var and Echo_ptr is possible without any -explicit operations or castings3. For instance, the operation -echoString() can be called using the arrow (‘->’) on a -Echo_var, as one can do with a Echo_ptr.

The usage of Echo_var is illustrated below:

Echo_var a; -Echo_ptr p = ... // somehow obtain an object reference - -a = p; // a assumes ownership of p, must not use p any more - -Echo_var b = a; // implicit _duplicate - -p = ... // somehow obtain another object reference - -a = Echo::_duplicate(p); // release old object reference - // a now holds a copy of p.

2.5.1  Servant Object Implementation

-

Before the Portable Object Adapter (POA) specification, many of the -details of how servant objects should be implemented and registered -with the system were unspecified, so server-side code was not portable -between ORBs. The POA specification rectifies that. omniORB 4 still -supports the old omniORB 2.x BOA mapping, but you should always use -the POA mapping for new code. BOA code and POA code can coexist within -a single program. See section 3.1 for details of the -BOA compatibility, and problems you may encounter.

For each object interface, a skeleton class is generated. In +the member function _is_equivalent() of the generic object +CORBA::Object can be used. Here is an example of its usage:

Echo_ptr a; +... // initialise a to a valid object reference +Echo_ptr b = a; +CORBA::Boolean true_result = a->_is_equivalent(a); +// Note: the above call is guaranteed to be true

_is_equivalent() does not contact the object to check for +equivalence—it uses purely local knowledge, meaning that it is +possible to construct situations in which two object references refer +to the same object, but _is_equivalent() does not consider them +equivalent. If you need a strong sense of object identity, you must +implement it with explicit IDL operations.

+

2.5.4  Servant Object Implementation

+

+

For each object interface, a skeleton class is generated. In our example, the POA specification says that the skeleton class for -interface Echo is named POA_Echo. A servant +interface Echo is named POA_Echo. A servant implementation can be written by creating an implementation class that -derives from the skeleton class.

The skeleton class POA_Echo is defined in echo.hh. The -relevant section of the code is reproduced below.

class POA_Echo : - public virtual PortableServer::ServantBase -{ -public: - Echo_ptr _this(); - - virtual char * echoString(const char* mesg) = 0; - // ... -};

The code fragment shows the only member functions that can be used in +derives from the skeleton class.

The skeleton class POA_Echo is defined in echo.hh. The +relevant section of the code is reproduced below.

class POA_Echo : + public virtual PortableServer::ServantBase +{ +public: + Echo_ptr _this(); + + virtual char * echoString(const char* mesg) = 0; +};

The code fragment shows the only member functions that can be used in the object implementation code. Other member functions are generated for internal use only. As with the code generated for object references, other POA-based ORBs will generate code which looks -different, but is functionally equivalent to this.

echoString()

+different, but is functionally equivalent to this.

echoString()

It is through this abstract function that an implementation class -provides the implementation of the echoString() operation. Notice -that its signature is the same as the echoString() function that -can be invoked via the Echo_ptr object reference.
_this()

-This function returns an object reference for the target object, -provided the POA policies permit it. The returned value must be -deallocated via CORBA::release(). See section 2.8 -for an example of how this function is used.

2.6  Writing the servant implementation

-

You define an implementation class to provide the servant -implementation. There is little constraint on how you design your -implementation class except that it has to inherit from the stubs’ -skeleton class and to implement all the abstract functions defined in -the skeleton class. Each of these abstract functions corresponds to an -operation of the interface. They are the hooks for the ORB to perform -upcalls to your implementation.

Here is a simple implementation of the Echo object.

class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -}

There are four points to note here:

Storage Responsibilities

-A string, which is used both as an in argument and the return value of -echoString(), is a variable size data type. Other examples of -variable size data types include sequences, type ‘any’, etc. For these -data types, you must be clear about whose responsibility it is to -allocate and release the associated storage. As a rule of thumb, the -client (or the caller to the implementation functions) owns the -storage of all IN arguments, the object implementation (or the callee) -must copy the data if it wants to retain a copy. For OUT arguments and -return values, the object implementation allocates the storage and -passes the ownership to the client. The client must release the -storage when the variables will no longer be used. For details, -please refer to the C++ mapping specification.
Multi-threading

+provides the implementation of the echoString() operation. Notice +that its signature is the same as the echoString() function that +can be invoked via the Echo_ptr object reference. This will be +the case most of the time, but object reference operations for certain +parameter types use special helper classes to facilitate correct +memory management.
_this()

+The _this() function returns an object reference for the target +object, provided the POA policies permit it. The returned value must +be deallocated via CORBA::release(). See +section 2.8 for an example of how this function is used.
+

2.6  Writing the servant implementation

+

+

You define a class to provide the servant implementation. There is +little constraint on how you design your implementation class except +that it has to inherit from the skeleton class1 and to +implement all the abstract functions defined in the skeleton +class. Each of these abstract functions corresponds to an operation of +the interface. They are the hooks for the ORB to perform upcalls to +your implementation. Here is a simple implementation of the Echo +object.

class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + +char* Echo_i::echoString(const char* mesg) +{ + return CORBA::string_dup(mesg); +}

There are four points to note here:

Storage Responsibilities

+String, which is used both as an in argument and the return value of +echoString(), is a variable sized data type. Other examples of +variable sized data types include sequences, type ‘any’, etc. For +these data types, you must be clear about whose responsibility it is +to allocate and release the associated storage. As a rule of thumb, +the client (or the caller to the implementation functions) owns the +storage of all in arguments, the object implementation (or the +callee) must copy the data if it wants to retain a copy. For +out arguments and return values, the object implementation +allocates the storage and passes the ownership to the client. The +client must release the storage when the variables will no longer be +used. For details, see the C++ mapping specification.
Multi-threading

As omniORB is fully multithreaded, multiple threads may perform the same upcall to your implementation concurrently. It is up to your implementation to synchronise the threads’ accesses to shared data. In our simple example, we have no shared data to protect so no thread -synchronisation is necessary.

Alternatively, you can create a POA which has the -SINGLE_THREAD_MODEL Thread Policy. This guarantees that all -calls to that POA are processed sequentially.

Reference Counting

+synchronisation is necessary.

Alternatively, you can create a POA which has the +SINGLE_THREAD_MODEL Thread Policy. This guarantees that all +calls to that POA are processed sequentially.

Reference Counting

All servant objects are reference counted. The base -PortableServer::ServantBase class from which all servant -skeleton classes derive defines member functions named _add_ref() -and _remove_ref()4. The reference -counting means that an Echo_i instance will be deleted when no +PortableServer::ServantBase class from which all servant +skeleton classes derive defines member functions named _add_ref() +and _remove_ref()2. The reference +counting means that an Echo_i instance will be deleted when no more references to it are held by application code or the POA itself. Note that this is totally separate from the reference counting which is associated with object references—a servant object is -never deleted due to a CORBA object reference being released.
Instantiation

+never deleted due to a CORBA object reference being released.
Instantiation

Servants are usually instantiated on the heap, i.e. using the -new operator. However, they can also be created on the stack as +new operator. However, they can also be created on the stack as automatic variables. If you do that, it is vital to make sure that the servant has been deactivated, and thus released by the POA, before the -variable goes out of scope and is destroyed.

2.7  Writing the client

Here is an example of how an Echo_ptr object reference is -used.

1 void - 2 hello(CORBA::Object_ptr obj) - 3 { - 4 Echo_var e = Echo::_narrow(obj); - 5 - 6 if (CORBA::is_nil(e)) { - 7 cerr << "cannot invoke on a nil object reference." - 8 << endl; - 9 return; - 10 } - 11 - 12 CORBA::String_var src = (const char*) "Hello!"; - 13 CORBA::String_var dest; - 14 - 15 dest = e->echoString(src); - 16 - 17 cerr << "I said,\"" << src << "\"." - 18 << " The Object said,\"" << dest <<"\"" << endl; - 19 }

Briefly, the hello() function accepts a generic object reference. -The object reference (obj) is narrowed to Echo_ptr. If -the object reference returned by Echo::_narrow() is not nil, the -operation echoString() is invoked. Finally, both the argument to -and the return value of echoString() are printed to cerr.

The example also illustrates how T_var types are used. As was -explained in the previous section, T_var types take care of +variable goes out of scope and is destroyed.

+

2.7  Writing the client

+

Here is an example of how an Echo_ptr object reference is +used.

1 void + 2 hello(CORBA::Object_ptr obj) + 3 { + 4 Echo_var e = Echo::_narrow(obj); + 5 + 6 if (CORBA::is_nil(e)) { + 7 cerr << "cannot invoke on a nil object reference." + 8 << endl; + 9 return; + 10 } + 11 + 12 CORBA::String_var src = (const char*) "Hello!"; + 13 CORBA::String_var dest; + 14 + 15 dest = e->echoString(src); + 16 + 17 cout << "I said,\"" << src << "\"." + 18 << " The Object said,\"" << dest <<"\"" << endl; + 19 }

The hello() function accepts a generic object reference. The +object reference (obj) is narrowed to Echo_ptr. If the +object reference returned by Echo::_narrow() is not nil, the +operation echoString() is invoked. Finally, both the argument to +and the return value of echoString() are printed to cout.

The example also illustrates how T_var types are used. As was +explained in the previous section, T_var types take care of storage allocation and release automatically when variables are -reassigned or when the variables go out of scope.

In line 4, the variable e takes over the storage responsibility -of the object reference returned by Echo::_narrow(). The object -reference is released by the destructor of e. It is called +reassigned or when the variables go out of scope.

In line 4, the variable e takes over the storage responsibility +of the object reference returned by Echo::_narrow(). The object +reference is released by the destructor of e. It is called automatically when the function returns. Lines 6 and 15 show how a -Echo_var variable is used. As explained earlier, the -Echo_var type can be used interchangeably with the -Echo_ptr type.

The argument and the return value of echoString() are stored in -CORBA::String_var variables src and dest +Echo_var variable is used. As explained earlier, the +Echo_var type can be used interchangeably with the +Echo_ptr type.

The argument and the return value of echoString() are stored in +CORBA::String_var variables src and dest respectively. The strings managed by the variables are deallocated by -the destructor of CORBA::String_var. It is called +the destructor of CORBA::String_var. It is called automatically when the variable goes out of scope (as the function -returns). Line 15 shows how CORBA::String_var variables are +returns). Line 15 shows how CORBA::String_var variables are used. They can be used in place of a string (for which the mapping is -char*)5. As used in line 12, assigning a constant string -(const char*) to a CORBA::String_var causes the string -to be copied. On the other hand, assigning a char* to a -CORBA::String_var, as used in line 15, causes the latter to -assume the ownership of the string6.

Under the C++ mapping, T_var types are provided for all the -non-basic data types. It is obvious that one should use automatic -variables whenever possible both to avoid memory leaks and to maximise -performance. However, when one has to allocate data items on the heap, -it is a good practice to use the T_var types to manage the -heap storage.

2.8  Example 1 — Colocated Client and Implementation

-

Having introduced the client and the object implementation, we can now +char*)3. As used in line 12, assigning a constant string +(const char*) to a CORBA::String_var causes the string +to be copied. On the other hand, assigning a char* to a +CORBA::String_var, as used in line 15, causes the latter to +assume the ownership of the string4.

Under the C++ mapping, T_var types are provided for all the +non-basic data types. One should use automatic variables whenever +possible both to avoid memory leaks and to maximise performance. +However, when one has to allocate data items on the heap, it is a good +practice to use the T_var types to manage the heap storage.

+

2.8  Example 1 — Colocated Client and Servant

+

+

Having introduced the client and the object implementation, we can now describe how to link up the two via the ORB and POA. In this section, we describe an example in which both the client and the object implementation are in the same address space. In the next two sections, we shall describe the case where the two are in different -address spaces.

The code for this example is reproduced below:

1 int - 2 main(int argc, char **argv) - 3 { - 4 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB4"); - 5 - 6 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - 7 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - 8 - 9 Echo_i *myecho = new Echo_i(); - 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - 11 - 12 Echo_var myechoref = myecho->_this(); - 13 myecho->_remove_ref(); - 14 - 15 PortableServer::POAManager_var pman = poa->the_POAManager(); - 16 pman->activate(); - 17 - 18 hello(myechoref); - 19 - 20 orb->destroy(); - 21 return 0; - 22 }

The example illustrates several important interactions among the ORB, -the POA, the servant, and the client. Here are the details:

2.8.1  ORB initialisation

Line 4

-The ORB is initialised by calling the CORBA::ORB_init() +address spaces.

The code for this example is reproduced below:

1 int + 2 main(int argc, char **argv) + 3 { + 4 CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv, "omniORB4"); + 5 + 6 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + 7 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + 8 + 9 PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + 11 + 12 Echo_var myechoref = myecho->_this(); + 13 + 14 PortableServer::POAManager_var pman = poa->the_POAManager(); + 15 pman->activate(); + 16 + 17 hello(myechoref); + 18 + 19 orb->destroy(); + 20 return 0; + 21 }

The example illustrates several important interactions among the ORB, +the POA, the servant, and the client. Here are the details:

+

2.8.1  ORB initialisation

+
Line 4

+The ORB is initialised by calling the CORBA::ORB_init() function. The function uses the optional 3rd argument to determine which ORB should be returned. Unless you are using omniORB specific features, it is usually best to leave it out, and get the default ORB. To explicitly ask for omniORB 4.x, this argument must be -‘omniORB4’7.

CORBA::ORB_init() takes the list of command line arguments and -processes any that start ‘-ORB’. It removes these arguments -from the list, so application code does not have to deal with them.

If any error occurs during ORB initialisation, such as invalid ORB +‘omniORB4’5.

CORBA::ORB_init() takes the list of command line arguments and +processes any that start ‘-ORB’. It removes these arguments +from the list, so application code does not have to deal with them.

If any error occurs during ORB initialisation, such as invalid ORB arguments, or an invalid configuration file, the -CORBA::INITIALIZE system exception is raised.

2.8.2  Obtaining the Root POA

Lines 6–7

+CORBA::INITIALIZE system exception is raised.

+

2.8.2  Obtaining the Root POA

+
Lines 6–7

To activate our servant object and make it available to clients, we -must register it with a POA. In this example, we use the Root -POA, rather than creating any child POAs. The Root POA is found with -orb->resolve_initial_references(), which returns a plain -CORBA::Object. In line 7, we narrow the reference to the right -type for a POA.

A POA’s behaviour is governed by its policies. The Root POA has +must register it with a POA. In this example, we use the Root +POA, rather than creating any child POAs. The Root POA is found with +orb->resolve_initial_references(), which returns a plain +CORBA::Object. In line 7, we narrow the reference to the right +type for a POA.

A POA’s behaviour is governed by its policies. The Root POA has suitable policies for many simple servers, and closely matches the ‘policies’ used by omniORB 2’s BOA. See Chapter 11 of the CORBA 2.6 -specification[OMG01] for details of all the POA policies -which are available.

2.8.3  Object initialisation

Line 9

-An instance of the Echo servant is initialised using the new -operator.
Line 10

+specification[OMG01] for details of all the POA policies +which are available.

+

2.8.3  Object initialisation

+
Line 9

+An instance of the Echo servant is initialised using the new +operator. The PortableServer::Servant_var<> template +automatically is analogous to the T_var types generated by the +IDL compiler. It releases our reference to the servant when it goes +out of scope.
Line 10

The servant object is activated in the Root POA using -poa->activate_object(), which returns an object identifier -(of type PortableServer::ObjectId*). The object id must +poa->activate_object(), which returns an object identifier +(of type PortableServer::ObjectId*). The object id must be passed back to various POA operations. The caller is responsible -for freeing the object id, so it is assigned to a _var type.
Line 12

+for freeing the object id, so it is assigned to a _var type.
Line 12

The object reference is obtained from the servant object by calling -_this(). Like all object references, the return value of -_this() must be released by CORBA::release() when it is no -longer needed. In this case, we assign it to a _var type, so -the release is implicit at the end of the function.

One of the important characteristics of an object reference is that it +its _this() method. Like all object references, the return value +of _this() must be released by CORBA::release() when it is no +longer needed. In this case, we assign it to a _var type, so +the release is implicit at the end of the function.

One of the important characteristics of an object reference is that it is completely location transparent. A client can invoke on the object using its object reference without any need to know whether the servant object is colocated in the same address space or is in a -different address space.

In the case of colocated client and servant, omniORB is able to +different address space.

In the case of colocated client and servant, omniORB is able to short-circuit the client calls so they do not involve IIOP. The calls still go through the POA, however, so the various POA policies affect local calls in the same way as remote ones. This optimisation is -applicable not only to object references returned by _this(), but +applicable not only to object references returned by _this(), but to any object references that are passed around within the same -address space or received from other address spaces via remote calls.

Line 13

-The server code releases the reference it holds to the servant -object. The only reference to that object is now held by the POA (it -gained the reference on the call to activate_object()), so when -the object is deactivated (or the POA is destroyed), the servant -object will be deleted automatically. After this point, the code must -no longer use the myecho pointer.

2.8.4  Activating the POA

Lines 15–16

-POAs are initially in the holding state, meaning that incoming +address space or received from other address spaces via remote calls.

+

2.8.4  Activating the POA

+
Lines 15–16

+POAs are initially in the holding state, meaning that incoming requests are blocked. Lines 15 and 16 acquire a reference to the POA’s -POA manager, and use it to put the POA into the active state. -Incoming requests are now served. Failing to activate the POA +POA manager, and use it to put the POA into the active state. +Incoming requests are now served. Failing to activate the POA is one of the most common programming mistakes. If your program -appears deadlocked, make sure you activated the POA!

2.8.5  Performing a call

Line 18

-At long last, we can call hello() with this object reference. The +appears deadlocked, make sure you activated the POA!
+

2.8.5  Performing a call

+
Line 18

+At long last, we can call hello() with this object reference. The argument is widened implicitly to the generic object reference -CORBA::Object_ptr.

2.8.6  ORB destruction

Line 20

+CORBA::Object_ptr.
+

2.8.6  ORB destruction

+
Line 20

Shutdown the ORB permanently. This call causes the ORB to release all its resources, e.g. internal threads, and also to deactivate any servant objects which are currently active. When it deactivates the -Echo_i instance, the servant’s reference count drops to zero, -so the servant is deleted.

This call is particularly important when writing a CORBA DLL on +Echo_i instance, the servant’s reference count drops to zero, +so the servant is deleted.

This call is particularly important when writing a CORBA DLL on Windows NT that is to be used from ActiveX. If this call is absent, -the application will hang when the CORBA DLL is unloaded.

2.9  Example 2 — Different Address Spaces

In this example, the client and the object implementation reside in +the application will hang when the CORBA DLL is unloaded.

+

2.9  Example 2 — Different Address Spaces

+

In this example, the client and the object implementation reside in two different address spaces. The code of this example is almost the same as the previous example. The only difference is the extra work which needs to be done to pass the object reference from the object -implementation to the client.

The simplest (and quite primitive) way to pass an object reference -between two address spaces is to produce a stringified version +implementation to the client.

The simplest (and quite primitive) way to pass an object reference +between two address spaces is to produce a stringified version of the object reference and to pass this string to the client as a command-line argument. The string is then converted by the client into a proper object reference. This method is used in this example. In the next example, we shall introduce a better way of -passing the object reference using the CORBA Naming Service.

2.9.1  Object Implementation: Making a Stringified Object Reference

The main() function of the server side is reproduced below. The -full listing (eg2_impl.cc) can be found at the end of this -chapter.

1 int main(int argc, char** argv) - 2 { - 3 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - 4 - 5 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - 6 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - 7 - 8 Echo_i* myecho = new Echo_i(); - 9 - 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - 11 - 12 obj = myecho->_this(); - 13 CORBA::String_var sior(orb->object_to_string(obj)); - 14 cerr << (char*)sior << endl; - 15 - 16 myecho->_remove_ref(); - 17 - 18 PortableServer::POAManager_var pman = poa->the_POAManager(); - 19 pman->activate(); - 20 - 21 orb->run(); - 22 orb->destroy(); - 23 return 0; - 24 }

The stringified object reference is obtained by calling the ORB’s -object_to_string() function (line 13). This results in a -string starting with the signature ‘IOR:’ and followed by some -hexadecimal digits. All CORBA 2 compliant ORBs are able to convert the -string into its internal representation of a so-called Interoperable -Object Reference (IOR). The IOR contains the location information and -a key to uniquely identify the object implementation in its own -address space. From the IOR, an object reference can be constructed.

2.9.2  Client: Using a Stringified Object Reference

-

The stringified object reference is passed to the client as a +passing the object reference using the CORBA Naming Service.

+

2.9.1  Making a Stringified Object Reference

+

The main() function of the server side is reproduced below. The +full listing (eg2_impl.cc) can be found at the end of this +chapter.

1 int main(int argc, char** argv) + 2 { + 3 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + 4 + 5 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + 6 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + 7 + 8 PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + 9 + 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + 11 + 12 obj = myecho->_this(); + 13 CORBA::String_var sior(orb->object_to_string(obj)); + 14 cerr << sior << endl; + 15 + 16 PortableServer::POAManager_var pman = poa->the_POAManager(); + 17 pman->activate(); + 18 + 19 orb->run(); + 20 orb->destroy(); + 21 return 0; + 22 }

The stringified object reference is obtained by calling the ORB’s +object_to_string() function (line 13). This results in a +string starting with the signature ‘IOR:’ and followed by quite +a lot of hexadecimal digits. All CORBA compliant ORBs are able to +convert the string into its internal representation of a so-called +Interoperable Object Reference (IOR). The IOR contains the location +information and a key to uniquely identify the object implementation +in its own address space. From the IOR, an object reference can be +constructed.

+

2.9.2  Client: Using a Stringified Object Reference

+

+

The stringified object reference is passed to the client as a command-line argument. The client uses the ORB’s -string_to_object() function to convert the string into a generic -object reference (CORBA::Object_ptr). The relevant section of -the code is reproduced below. The full listing (eg2_clt.cc) can -be found at the end of this chapter.

try { - CORBA::Object_var obj = orb->string_to_object(argv[1]); - hello(obj); -} -catch(CORBA::TRANSIENT&) { - ... // code to handle transient exception... -}

2.9.3  Catching System Exceptions

When omniORB detects an error condition, it may raise a system +string_to_object() function to convert the string into a generic +object reference (CORBA::Object_ptr). The relevant section of +the code is reproduced below. The full listing (eg2_clt.cc) can +be found at the end of this chapter.

try { + CORBA::Object_var obj = orb->string_to_object(argv[1]); + hello(obj); +} +catch (CORBA::TRANSIENT&) { + ... // code to handle transient exception... +}
+

2.9.3  Catching System Exceptions

+

When omniORB detects an error condition, it may raise a system exception. The CORBA specification defines a series of exceptions covering most of the error conditions that an ORB may encounter. The client may choose to catch these exceptions and recover from the error -condition8. For instance, the code fragment, shown in -section 2.9.2, catches the TRANSIENT system exception +condition6. For instance, the code fragment, shown in +section 2.9.2, catches the TRANSIENT system exception which indicates that the object could not be contacted at the time of -the call, usually meaning the server is not running.

All system exceptions inherit from CORBA::SystemException. With -compilers that properly support RTTI9, a single catch of CORBA::SystemException will -catch all the different system exceptions thrown by omniORB.

When omniORB detects an internal error such as corrupt data or invalid -conditions, it raises the exception omniORB::fatalException. -When this exception is raised, it is not sensible to proceed with any -operation that involves the ORB’s runtime. It is best to exit the -program immediately. The exception structure carried by -omniORB::fatalException contains the exact location (the file -name and the line number) where the exception is raised. In most -cases, fatalExceptions occur due to incorrect behaviour by the -application code, but they may be caused by bugs in omniORB.

2.9.4  Lifetime of a CORBA object

CORBA objects are either transient or persistent. The +the call, usually meaning the server is not running.

All system exceptions inherit from CORBA::SystemException. +Unless you have a truly ancient C++ compiler, a single catch of +CORBA::SystemException will catch all the different system +exceptions.

+

2.9.4  Lifetime of a CORBA object

+

CORBA objects are either transient or persistent. The majority are transient, meaning that the lifetime of the CORBA object (as contacted through an object reference) is the same as the lifetime of its servant object. Persistent objects can live beyond the destruction of their servant object, the POA they were created in, and even their process. Persistent objects are, of course, only -contactable when their associated servants are active, or can be -activated by their POA with a servant manager10. A reference to -a persistent object can be published, and will remain valid even if -the server process is restarted.

A POA’s Lifespan Policy determines whether objects created within it -are transient or persistent. The Root POA has the TRANSIENT -policy.

An alternative to creating persistent objects is to register object -references in a naming service and bind them to fixed path +contactable when their associated server processes are running, and +their servants are active or can be activated by their POA with a +servant manager7. A reference to a persistent object can +be published, and will remain valid even if the server process is +restarted.

To support persistent objects, the servants must be activated in their +POA with the same object identifier each time. Also, the server must +be configured with the same endpoint details so it is +contactable in the same way as previous invocations. See +section 6.6 for details.

A POA’s Lifespan Policy determines whether objects created within it +are transient or persistent. The Root POA has the TRANSIENT +policy.

An alternative to creating persistent objects is to register object +references in a naming service and bind them to fixed path names. Clients can bind to the object implementations at run time by asking the naming service to resolve the path names to the object references. CORBA defines a standard naming service, which is a -component of the Common Object Services (COS) [OMG98], +component of the Common Object Services (COS) [OMG98], that can be used for this purpose. The next section describes an -example of how to use the COS Naming Service.

2.10  Example 3 — Using the Naming Service

In this example, the object implementation uses the Naming -Service [OMG98] to pass on the object reference to the -client. This method is far more practical than using stringified +example of how to use the COS Naming Service.

+

2.10  Example 3 — Using the Naming Service

+

In this example, the object implementation uses the Naming +Service [OMG98] to pass on the object reference to the +client. This method is often more practical than using stringified object references. The full listing of the object implementation -(eg3_impl.cc) and the client (eg3_clt.cc) can be found -at the end of this chapter.

The names used by the Naming service consist of a sequence of -name components. Each name component has an id and a -kind field, both of which are strings. All name components +(eg3_impl.cc) and the client (eg3_clt.cc) can be found +at the end of this chapter.

The names used by the Naming service consist of a sequence of +name components. Each name component has an id and a +kind field, both of which are strings. All name components except the last one are bound to a naming context. A naming context is analogous to a directory in a filing system: it can contain names of object references or other naming contexts. The last name component is -bound to an object reference.

Sequences of name components can be represented as a flat string, +bound to an object reference.

Sequences of name components can be represented as a flat string, using ‘.’ to separate the id and kind fields, and ‘/’ to separate name -components from each other11. In our example, the Echo object +components from each other8. In our example, the Echo object reference is bound to the stringified name -‘test.my_context/Echo.Object’.

The kind field is intended to describe the name in a +‘test.my_context/Echo.Object’.

The kind field is intended to describe the name in a syntax-independent way. The naming service does not interpret, assign, or manage these values. However, both the name and the kind attribute must match for a name lookup to succeed. In this example, the kind -values for test and Echo are chosen to be -‘my_context’ and ‘Object’ respectively. This is an -arbitrary choice as there is no standardised set of kind values.

2.10.1  Obtaining the Root Context Object Reference

-

The initial contact with the Naming Service can be established via the -root context. The object reference to the root context is +values for test and Echo are chosen to be +‘my_context’ and ‘Object’ respectively. This is an +arbitrary choice as there is no standardised set of kind values.

+

2.10.1  Obtaining the Root Context Object Reference

+

+

The initial contact with the Naming Service can be established via the +root context. The object reference to the root context is provided by the ORB and can be obtained by calling -resolve_initial_references(). The following code fragment shows -how it is used:

CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv); - -CORBA::Object_var initServ; -initServ = orb->resolve_initial_references("NameService"); - -CosNaming::NamingContext_var rootContext; -rootContext = CosNaming::NamingContext::_narrow(initServ);

Remember, omniORB constructs its internal list of initial references -at initialisation time using the information provided in the -configuration file omniORB.cfg, or given on the command -line. If this file is not present, the internal list will be empty and -resolve_initial_references() will raise a -CORBA::ORB::InvalidName exception.

2.10.2  The Naming Service Interface

It is beyond the scope of this chapter to describe in detail the +resolve_initial_references(). The following code fragment shows +how it is used:

CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv); +CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + +CosNaming::NamingContext_var rootContext; +rootContext = CosNaming::NamingContext::_narrow(obj);

Remember from section 1.2, omniORB constructs its internal +list of initial references at initialisation time using the +information provided in the configuration file omniORB.cfg, or +given on the command line. If this file is not present, the internal +list will be empty and resolve_initial_references() will raise a +CORBA::ORB::InvalidName exception.

+

2.10.2  The Naming Service Interface

+

It is beyond the scope of this chapter to describe in detail the Naming Service interface. You should consult the CORBA services -specification [OMG98] (chapter 3). The code listed in -eg3_impl.cc and eg3_clt.cc are good examples of how the -service can be used. Please spend time to study the examples -carefully.

2.11  Example 4 — Using tie implementation templates

omniORB supports tie implementation templates as an alternative -way of providing servant classes. If you use the -Wbtp option +specification [OMG98] (chapter 3). The code listed in +eg3_impl.cc and eg3_clt.cc are good examples of how the +service can be used.

+

2.11  Example 4 — Using tie implementation templates

+

+

omniORB supports tie implementation templates as an alternative +way of providing servant classes. If you use the -Wbtp option to omniidl, it generates an extra template class for each interface. This template class can be used to tie a C++ class to the skeleton -class of the interface.

The source code in eg3_tieimpl.cc at the end of this chapter +class of the interface.

The source code in eg3_tieimpl.cc at the end of this chapter illustrates how the template class can be used. The code is almost -identical to eg3_impl.cc with only a few changes.

Firstly, the servant class Echo_i does not inherit from any -stub classes. This is the main benefit of using the template class +identical to eg3_impl.cc with only a few changes.

Firstly, the servant class Echo_i does not inherit from any +skeleton classes. This is the main benefit of using the template class because there are applications in which it is difficult to require -every servant class to derive from CORBA classes.

Secondly, the instantiation of a CORBA object now involves creating an -instance of the implementation class and an instance of the -template. Here is the relevant code fragment:

class Echo_i { ... }; - -Echo_i *myimpl = new Echo_i(); -POA_Echo_tie<Echo_i> myecho(myimpl); - -PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho);

For interface Echo, the name of its tie implementation template -is POA_Echo_tie. The template parameter is the servant +every servant class to derive from CORBA classes.

Secondly, the instantiation of a CORBA object now involves creating an +instance of the implementation class and an instance of the +template. Here is the relevant code fragment:

class Echo_i { ... }; + +Echo_i *myimpl = new Echo_i(); +POA_Echo_tie<Echo_i> myecho(myimpl); + +PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho);

For interface Echo, the name of its tie implementation template +is POA_Echo_tie. The template parameter is the servant class that contains an implementation of each of the operations defined in the interface. As used above, the tie template takes -ownership of the Echo_i instance, and deletes it when the tie +ownership of the Echo_i instance, and deletes it when the tie object goes out of scope. The tie constructor has an optional boolean -argument (defaulted to true) which indicates whether or not it should -delete the servant object. For full details of using tie templates, -see the CORBA C++ mapping specification.

2.12  Source Listings

2.12.1  eg1.cc

// eg1.cc - This is the source code of example 1 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// In this example, both the object implementation and the -// client are in the same process. -// -// Usage: eg1 -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -// This is the object implementation. - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - - -////////////////////////////////////////////////////////////////////// - -// This function acts as a client to the object. - -static void hello(Echo_ptr e) -{ - if( CORBA::is_nil(e) ) { - cerr << "hello: The object reference is nil!\n" << endl; - return; - } - - CORBA::String_var src = (const char*) "Hello!"; - // String literals are (char*) rather than (const char*) on some - // old compilers. Thus it is essential to cast to (const char*) - // here to ensure that the string is copied, so that the - // CORBA::String_var does not attempt to 'delete' the string - // literal. - - CORBA::String_var dest = e->echoString(src); - - cout << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - - - try { - // Initialise the ORB. - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - // Obtain a reference to the root POA. - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - // We allocate the object on the heap. Since this is a reference - // counted object, it will be deleted by the POA when it is no - // longer needed. - Echo_i* myecho = new Echo_i(); - - // Activate the object. This tells the POA that this object is - // ready to accept requests. - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object. - Echo_var myechoref = myecho->_this(); - - // Decrement the reference count of the object implementation, so - // that it will be properly cleaned up when the POA has determined - // that it is no longer needed. - myecho->_remove_ref(); - - // Obtain a POAManager, and tell the POA to start accepting - // requests on its objects. - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - // Do the client-side call. - hello(myechoref); - - // Clean up all the resources. - orb->destroy(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}

2.12.2  eg2_impl.cc

// eg2_impl.cc - This is the source code of example 2 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the object implementation. -// -// Usage: eg2_impl -// -// On startup, the object reference is printed to cerr as a -// stringified IOR. This string should be used as the argument to -// eg2_clt. -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - cout << "Upcall " << mesg << endl; - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - Echo_i* myecho = new Echo_i(); - - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object, and print it out as a - // stringified IOR. - obj = myecho->_this(); - CORBA::String_var sior(orb->object_to_string(obj)); - cout << (char*)sior << endl; - - myecho->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}

2.12.3  eg2_clt.cc

// eg2_clt.cc - This is the source code of example 2 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the client. The object reference is given as a -// stringified IOR on the command line. -// -// Usage: eg2_clt <object reference> -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> -# include <fstream> - using namespace std; -#else -# include <iostream.h> -#endif - - -static void hello(Echo_ptr e) -{ - CORBA::String_var src = (const char*) "Hello!"; - - CORBA::String_var dest = e->echoString(src); - - cout << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - - - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - if( argc != 2 ) { - cerr << "usage: eg2_clt <object reference>" << endl; - return 1; - } - - CORBA::Object_var obj = orb->string_to_object(argv[1]); - Echo_var echoref = Echo::_narrow(obj); - if( CORBA::is_nil(echoref) ) { - cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; - return 1; - } - for (CORBA::ULong count=0; count<10; count++) - hello(echoref); - - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}

2.12.4  eg3_impl.cc

// eg3_impl.cc - This is the source code of example 3 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the object implementation. -// -// Usage: eg3_impl -// -// On startup, the object reference is registered with the -// COS naming service. The client uses the naming service to -// locate this object. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// test [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); - - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int -main(int argc, char **argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - Echo_i* myecho = new Echo_i(); - - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object, and register it in - // the naming service. - obj = myecho->_this(); - - CORBA::String_var x; - x = orb->object_to_string(obj); - cout << x << endl; - - if( !bindObjectToName(orb, obj) ) - return 1; - - myecho->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Boolean -bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return 0; - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch (CORBA::ORB::InvalidName&) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return 0; - } - - try { - // Bind a context called "test" to the root context: - - CosNaming::Name contextName; - contextName.length(1); - contextName[0].id = (const char*) "test"; // string copied - contextName[0].kind = (const char*) "my_context"; // string copied - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - CosNaming::NamingContext_var testContext; - try { - // Bind the context to root. - testContext = rootContext->bind_new_context(contextName); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - // If the context already exists, this exception will be raised. - // In this case, just resolve the name and assign testContext - // to the object returned: - CORBA::Object_var obj; - obj = rootContext->resolve(contextName); - testContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(testContext) ) { - cerr << "Failed to narrow naming context." << endl; - return 0; - } - } - - // Bind objref with name Echo to the testContext: - CosNaming::Name objectName; - objectName.length(1); - objectName[0].id = (const char*) "Echo"; // string copied - objectName[0].kind = (const char*) "Object"; // string copied - - try { - testContext->bind(objectName, objref); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - testContext->rebind(objectName, objref); - } - // Note: Using rebind() will overwrite any Object previously bound - // to /test/Echo with obj. - // Alternatively, bind() can be used, which will raise a - // CosNaming::NamingContext::AlreadyBound exception if the name - // supplied is already bound to an object. - - // Amendment: When using OrbixNames, it is necessary to first try bind - // and then rebind, as rebind on it's own will throw a NotFoundexception if - // the Name has not already been bound. [This is incorrect behaviour - - // it should just bind]. - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - return 0; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - return 1; -}

2.12.5  eg3_clt.cc

// eg3_clt.cc - This is the source code of example 3 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the client. It uses the COSS naming service -// to obtain the object reference. -// -// Usage: eg3_clt -// -// -// On startup, the client lookup the object reference from the -// COS naming service. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// text [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb); - -static void hello(Echo_ptr e) -{ - if( CORBA::is_nil(e) ) { - cerr << "hello: The object reference is nil!\n" << endl; - return; - } - - CORBA::String_var src = (const char*) "Hello!"; - - CORBA::String_var dest = e->echoString(src); - - cerr << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int -main (int argc, char **argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = getObjectReference(orb); - - Echo_var echoref = Echo::_narrow(obj); - - for (CORBA::ULong count=0; count < 10; count++) - hello(echoref); - - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Object_ptr -getObjectReference(CORBA::ORB_ptr orb) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return CORBA::Object::_nil(); - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch(CORBA::ORB::InvalidName& ex) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return CORBA::Object::_nil(); - } - - // Create a name object, containing the name test/context: - CosNaming::Name name; - name.length(2); - - name[0].id = (const char*) "test"; // string copied - name[0].kind = (const char*) "my_context"; // string copied - name[1].id = (const char*) "Echo"; - name[1].kind = (const char*) "Object"; - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - try { - // Resolve the name to an object reference. - return rootContext->resolve(name); - } - catch(CosNaming::NamingContext::NotFound& ex) { - // This exception is thrown if any of the components of the - // path [contexts or the object] aren't found: - cerr << "Context not found." << endl; - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - - return CORBA::Object::_nil(); -}

2.12.6  eg3_tieimpl.cc

// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that -// the tie implementation skeleton is used. -// -// This is the object implementation. -// -// Usage: eg3_tieimpl -// -// On startup, the object reference is registered with the -// COS naming service. The client uses the naming service to -// locate this object. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// test [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr); - - -// This is the object implementation. Notice that it does not inherit -// from any stub class, and notice that the echoString() member -// function does not have to be virtual. - -class Echo_i { -public: - inline Echo_i() {} - inline ~Echo_i() {} - char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - // Note that the <myecho> tie object is constructed on the stack - // here. It will delete its implementation (myimpl) when it it - // itself destroyed (when it goes out of scope). It is essential - // however to ensure that such servants are not deleted whilst - // still activated. - // - // Tie objects can of course be allocated on the heap using new, - // in which case they are deleted when their reference count - // becomes zero, as with any other servant object. - Echo_i* myimpl = new Echo_i(); - POA_Echo_tie<Echo_i> myecho(myimpl); - - PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho); - - // Obtain a reference to the object, and register it in - // the naming service. - obj = myecho._this(); - if( !bindObjectToName(orb, obj) ) - return 1; - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Boolean -bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return 0; - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch (CORBA::ORB::InvalidName&) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return 0; - } - - try { - // Bind a context called "test" to the root context: - - CosNaming::Name contextName; - contextName.length(1); - contextName[0].id = (const char*) "test"; // string copied - contextName[0].kind = (const char*) "my_context"; // string copied - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - CosNaming::NamingContext_var testContext; - try { - // Bind the context to root. - testContext = rootContext->bind_new_context(contextName); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - // If the context already exists, this exception will be raised. - // In this case, just resolve the name and assign testContext - // to the object returned: - CORBA::Object_var obj; - obj = rootContext->resolve(contextName); - testContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(testContext) ) { - cerr << "Failed to narrow naming context." << endl; - return 0; - } - } - - // Bind objref with name Echo to the testContext: - CosNaming::Name objectName; - objectName.length(1); - objectName[0].id = (const char*) "Echo"; // string copied - objectName[0].kind = (const char*) "Object"; // string copied - - try { - testContext->bind(objectName, objref); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - testContext->rebind(objectName, objref); - } - // Note: Using rebind() will overwrite any Object previously bound - // to /test/Echo with obj. - // Alternatively, bind() can be used, which will raise a - // CosNaming::NamingContext::AlreadyBound exception if the name - // supplied is already bound to an object. - - // Amendment: When using OrbixNames, it is necessary to first try bind - // and then rebind, as rebind on it's own will throw a NotFoundexception if - // the Name has not already been bound. [This is incorrect behaviour - - // it should just bind]. - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - return 0; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - return 1; -}

-1
The stub -code is the C++ code that provides the object mapping as defined in -the CORBA specification. -
2
In -omniORB, all object reference variable types are instantiated from the -template type _CORBA_ObjRef_Var. -
3
However, the implementation -of the type conversion operator between Echo_var and -Echo_ptr varies slightly among different C++ compilers; you -may need to do an explicit cast if the compiler complains about the -conversion being ambiguous. -
4
In the previous 1.0 version of the C++ +argument (defaulted to true) which indicates whether or not it +should delete the servant object. For full details of using tie +templates, see the CORBA C++ mapping specification.

+

2.12  Source Listings

+

2.12.1  eg1.cc

+
// eg1.cc - This is the source code of example 1 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// In this example, both the object implementation and the +// client are in the same process. +// +// Usage: eg1 +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +// This is the object implementation. + +class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + // Memory management rules say we must return a newly allocated + // string. + return CORBA::string_dup(mesg); +} + + +////////////////////////////////////////////////////////////////////// + +// This function acts as a client to the object. + +static void hello(Echo_ptr e) +{ + if( CORBA::is_nil(e) ) { + cerr << "hello: The object reference is nil!" << endl; + return; + } + + CORBA::String_var src = (const char*) "Hello!"; + // String literals are (char*) rather than (const char*) on some + // old compilers. Thus it is essential to cast to (const char*) + // here to ensure that the string is copied, so that the + // CORBA::String_var does not attempt to 'delete' the string + // literal. + + CORBA::String_var dest = e->echoString(src); + + cout << "I said, \"" << (char*)src << "\"." << endl + << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + // Initialise the ORB. + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + // Obtain a reference to the root POA. + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + // We allocate the servant (implementation object) on the heap. + // The servant is reference counted. We start out holding a + // reference, and when the object is activated, the POA holds + // another reference. The PortableServer::Servant_var<> template + // automatically releases our reference when it goes out of scope. + PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + + // Activate the object. This tells the POA that this object is + // ready to accept requests. + PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + + // Obtain a reference to the object. + Echo_var myechoref = myecho->_this(); + + // Obtain a POAManager, and tell the POA to start accepting + // requests on its objects. + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + // Do the client-side call. + hello(myechoref); + + // Clean up all the resources. + orb->destroy(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +}
+

2.12.2  eg2_impl.cc

+
// eg2_impl.cc - This is the source code of example 2 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the object implementation. +// +// Usage: eg2_impl +// +// On startup, the object reference is printed to cout as a +// stringified IOR. This string should be used as the argument to +// eg2_clt. +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + + +class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + cout << "Upcall: " << mesg << endl; + return CORBA::string_dup(mesg); +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + + PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + + // Obtain a reference to the object, and print it out as a + // stringified IOR. + obj = myecho->_this(); + CORBA::String_var sior(orb->object_to_string(obj)); + cout << sior << endl; + + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + // Block until the ORB is shut down. + orb->run(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +}
+

2.12.3  eg2_clt.cc

+
// eg2_clt.cc - This is the source code of example 2 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the client. The object reference is given as a +// stringified IOR on the command line. +// +// Usage: eg2_clt <object reference> +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + + +static void hello(Echo_ptr e) +{ + CORBA::String_var src = (const char*) "Hello!"; + + CORBA::String_var dest = e->echoString(src); + + cout << "I said, \"" << (char*)src << "\"." << endl + << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + if (argc != 2) { + cerr << "usage: eg2_clt <object reference>" << endl; + return 1; + } + + CORBA::Object_var obj = orb->string_to_object(argv[1]); + + Echo_var echoref = Echo::_narrow(obj); + + if (CORBA::is_nil(echoref)) { + cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; + return 1; + } + + for (CORBA::ULong count=0; count<10; count++) + hello(echoref); + + orb->destroy(); + } + catch (CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +}
+

2.12.4  eg3_impl.cc

+
// eg3_impl.cc - This is the source code of example 3 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the object implementation. +// +// Usage: eg3_impl +// +// On startup, the object reference is registered with the +// COS naming service. The client uses the naming service to +// locate this object. +// +// The name which the object is bound to is as follows: +// root [context] +// | +// test [context] kind [my_context] +// | +// Echo [object] kind [Object] +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); + + +class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + return CORBA::string_dup(mesg); +} + +////////////////////////////////////////////////////////////////////// + +int +main(int argc, char **argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + + PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + + // Obtain a reference to the object, and register it in + // the naming service. + obj = myecho->_this(); + + CORBA::String_var sior(orb->object_to_string(obj)); + cout << sior << endl; + + if (!bindObjectToName(orb, obj)) + return 1; + + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + orb->run(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} + +////////////////////////////////////////////////////////////////////// + +static CORBA::Boolean +bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) +{ + CosNaming::NamingContext_var rootContext; + + try { + // Obtain a reference to the root context of the Name service: + CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + + // Narrow the reference returned. + rootContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(rootContext)) { + cerr << "Failed to narrow the root naming context." << endl; + return 0; + } + } + catch (CORBA::NO_RESOURCES&) { + cerr << "Caught NO_RESOURCES exception. You must configure omniORB " + << "with the location" << endl + << "of the naming service." << endl; + return 0; + } + catch (CORBA::ORB::InvalidName&) { + // This should not happen! + cerr << "Service required is invalid [does not exist]." << endl; + return 0; + } + + try { + // Bind a context called "test" to the root context: + + CosNaming::Name contextName; + contextName.length(1); + contextName[0].id = (const char*) "test"; // string copied + contextName[0].kind = (const char*) "my_context"; // string copied + // Note on kind: The kind field is used to indicate the type + // of the object. This is to avoid conventions such as that used + // by files (name.type -- e.g. test.ps = postscript etc.) + + CosNaming::NamingContext_var testContext; + try { + // Bind the context to root. + testContext = rootContext->bind_new_context(contextName); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + // If the context already exists, this exception will be raised. + // In this case, just resolve the name and assign testContext + // to the object returned: + CORBA::Object_var obj = rootContext->resolve(contextName); + testContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(testContext)) { + cerr << "Failed to narrow naming context." << endl; + return 0; + } + } + + // Bind objref with name Echo to the testContext: + CosNaming::Name objectName; + objectName.length(1); + objectName[0].id = (const char*) "Echo"; // string copied + objectName[0].kind = (const char*) "Object"; // string copied + + try { + testContext->bind(objectName, objref); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + testContext->rebind(objectName, objref); + } + // Note: Using rebind() will overwrite any Object previously bound + // to /test/Echo with obj. + // Alternatively, bind() can be used, which will raise a + // CosNaming::NamingContext::AlreadyBound exception if the name + // supplied is already bound to an object. + } + catch (CORBA::TRANSIENT& ex) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "naming service." << endl + << "Make sure the naming server is running and that omniORB is " + << "configured correctly." << endl; + + return 0; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() + << " while using the naming service." << endl; + return 0; + } + return 1; +}
+

2.12.5  eg3_clt.cc

+
// eg3_clt.cc - This is the source code of example 3 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the client. It uses the COSS naming service +// to obtain the object reference. +// +// Usage: eg3_clt +// +// +// On startup, the client lookup the object reference from the +// COS naming service. +// +// The name which the object is bound to is as follows: +// root [context] +// | +// text [context] kind [my_context] +// | +// Echo [object] kind [Object] +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb); + +static void hello(Echo_ptr e) +{ + if (CORBA::is_nil(e)) { + cerr << "hello: The object reference is nil!\n" << endl; + return; + } + + CORBA::String_var src = (const char*) "Hello!"; + + CORBA::String_var dest = e->echoString(src); + + cerr << "I said, \"" << (char*)src << "\"." << endl + << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; +} + +////////////////////////////////////////////////////////////////////// + +int +main (int argc, char **argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + CORBA::Object_var obj = getObjectReference(orb); + + Echo_var echoref = Echo::_narrow(obj); + + for (CORBA::ULong count=0; count < 10; count++) + hello(echoref); + + orb->destroy(); + } + catch (CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} + +////////////////////////////////////////////////////////////////////// + +static CORBA::Object_ptr +getObjectReference(CORBA::ORB_ptr orb) +{ + CosNaming::NamingContext_var rootContext; + + try { + // Obtain a reference to the root context of the Name service: + CORBA::Object_var obj; + obj = orb->resolve_initial_references("NameService"); + + // Narrow the reference returned. + rootContext = CosNaming::NamingContext::_narrow(obj); + + if (CORBA::is_nil(rootContext)) { + cerr << "Failed to narrow the root naming context." << endl; + return CORBA::Object::_nil(); + } + } + catch (CORBA::NO_RESOURCES&) { + cerr << "Caught NO_RESOURCES exception. You must configure omniORB " + << "with the location" << endl + << "of the naming service." << endl; + return CORBA::Object::_nil(); + } + catch (CORBA::ORB::InvalidName& ex) { + // This should not happen! + cerr << "Service required is invalid [does not exist]." << endl; + return CORBA::Object::_nil(); + } + + // Create a name object, containing the name test/context: + CosNaming::Name name; + name.length(2); + + name[0].id = (const char*) "test"; // string copied + name[0].kind = (const char*) "my_context"; // string copied + name[1].id = (const char*) "Echo"; + name[1].kind = (const char*) "Object"; + // Note on kind: The kind field is used to indicate the type + // of the object. This is to avoid conventions such as that used + // by files (name.type -- e.g. test.ps = postscript etc.) + + try { + // Resolve the name to an object reference. + return rootContext->resolve(name); + } + catch (CosNaming::NamingContext::NotFound& ex) { + // This exception is thrown if any of the components of the + // path [contexts or the object] aren't found: + cerr << "Context not found." << endl; + } + catch (CORBA::TRANSIENT& ex) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "naming service." << endl + << "Make sure the naming server is running and that omniORB is " + << "configured correctly." << endl; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() + << " while using the naming service." << endl; + } + return CORBA::Object::_nil(); +}
+

2.12.6  eg3_tieimpl.cc

+
// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that +// the tie implementation skeleton is used. +// +// This is the object implementation. +// +// Usage: eg3_tieimpl +// +// On startup, the object reference is registered with the +// COS naming service. The client uses the naming service to +// locate this object. +// +// The name which the object is bound to is as follows: +// root [context] +// | +// test [context] kind [my_context] +// | +// Echo [object] kind [Object] +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); + + +// This is the object implementation. Notice that it does not inherit +// from any skeleton class, and notice that the echoString() member +// function does not have to be virtual. + +class Echo_i { +public: + inline Echo_i() {} + inline ~Echo_i() {} + char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + return CORBA::string_dup(mesg); +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + // Note that the <myecho> tie object is constructed on the stack + // here. It will delete its implementation (myimpl) when it it + // itself destroyed (when it goes out of scope). It is essential + // however to ensure that such servants are not deleted whilst + // still activated. + // + // Tie objects can of course be allocated on the heap using new, + // in which case they are deleted when their reference count + // becomes zero, as with any other servant object. + Echo_i* myimpl = new Echo_i(); + POA_Echo_tie<Echo_i> myecho(myimpl); + + PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho); + + // Obtain a reference to the object, and register it in + // the naming service. + obj = myecho._this(); + if (!bindObjectToName(orb, obj)) + return 1; + + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + orb->run(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} + +////////////////////////////////////////////////////////////////////// + +static CORBA::Boolean +bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) +{ + CosNaming::NamingContext_var rootContext; + + try { + // Obtain a reference to the root context of the Name service: + CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + + // Narrow the reference returned. + rootContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(rootContext)) { + cerr << "Failed to narrow the root naming context." << endl; + return 0; + } + } + catch (CORBA::NO_RESOURCES&) { + cerr << "Caught NO_RESOURCES exception. You must configure omniORB " + << "with the location" << endl + << "of the naming service." << endl; + return 0; + } + catch (CORBA::ORB::InvalidName&) { + // This should not happen! + cerr << "Service required is invalid [does not exist]." << endl; + return 0; + } + + try { + // Bind a context called "test" to the root context: + + CosNaming::Name contextName; + contextName.length(1); + contextName[0].id = (const char*) "test"; // string copied + contextName[0].kind = (const char*) "my_context"; // string copied + // Note on kind: The kind field is used to indicate the type + // of the object. This is to avoid conventions such as that used + // by files (name.type -- e.g. test.ps = postscript etc.) + + CosNaming::NamingContext_var testContext; + try { + // Bind the context to root. + testContext = rootContext->bind_new_context(contextName); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + // If the context already exists, this exception will be raised. + // In this case, just resolve the name and assign testContext + // to the object returned: + CORBA::Object_var obj = rootContext->resolve(contextName); + testContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(testContext)) { + cerr << "Failed to narrow naming context." << endl; + return 0; + } + } + + // Bind objref with name Echo to the testContext: + CosNaming::Name objectName; + objectName.length(1); + objectName[0].id = (const char*) "Echo"; // string copied + objectName[0].kind = (const char*) "Object"; // string copied + + try { + testContext->bind(objectName, objref); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + testContext->rebind(objectName, objref); + } + // Note: Using rebind() will overwrite any Object previously bound + // to /test/Echo with obj. + // Alternatively, bind() can be used, which will raise a + // CosNaming::NamingContext::AlreadyBound exception if the name + // supplied is already bound to an object. + } + catch (CORBA::TRANSIENT& ex) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "naming service." << endl + << "Make sure the naming server is running and that omniORB is " + << "configured correctly." << endl; + + return 0; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() + << " while using the naming service." << endl; + return 0; + } + return 1; +}
+
+1
Rather than +deriving from the skeleton class, an alternative is to use a +tie template, described in section 2.11.
2
In the previous 1.0 version of the C++ mapping, servant reference counting was optional, chosen by inheriting -from a mixin class named RefCountServantBase. That has been +from a mixin class named RefCountServantBase. That has been deprecated in the 1.1 version of the C++ mapping, but the class is still available as an empty struct, so existing code that inherits -from RefCountServantBase will continue to work. -
5
A conversion operator of -CORBA::String_var converts a CORBA::String_var -to a char*. -
6
Please refer to the C++ -mapping specification for details of the String_var mapping. -
7
For backwards compatibility, the ORB identifiers -‘omniORB2’ and ‘omniORB3’ are also accepted. -
8
If a system exception is not caught, the C++ -runtime will call the terminate() function. This function is +from RefCountServantBase will continue to work.
3
A conversion operator of +CORBA::String_var converts a CORBA::String_var +to a char*.
4
Please refer to the C++ +mapping specification for details of the String_var mapping.
5
For backwards compatibility, the ORB identifiers +‘omniORB2’ and ‘omniORB3’ are also accepted.
6
If a system exception is not caught, the C++ +runtime will call the terminate() function. This function is defaulted to abort the whole process and on some systems will cause a -core file to be produced. -
9
Run Time Type -Identification -
10
The POA itself -can be activated on demand with an adapter activator. -
11
There are escaping rules to cope +core file to be produced.
7
The POA itself can be activated on demand +with an adapter activator.
8
There are escaping rules to cope with id and kind fields which contain ‘.’ and ‘/’ characters. See -chapter 6 of this manual, and chapter 3 of the CORBA +chapter 7 of this manual, and chapter 3 of the CORBA services specification, as updated for the Interoperable Naming -Service [OMG00]. -
-
-Previous -Up -Next - - +Service [OMG00].
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB003.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB003.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB003.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB003.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,97 +1,107 @@ - - - - - - - -C++ language mapping - - -Previous -Up -Next -
-

Chapter 3  C++ language mapping

Now that you are familiar with the basics, it is important to + + + + + + +C++ language mapping + + +Previous +Up +Next +


+

Chapter 3  C++ language mapping

+

Now that you are familiar with the basics, it is important to familiarise yourself with the standard IDL to C++ language mapping. -The mapping is described in detail in [OMG03]. If you have +The mapping is described in detail in [OMG03]. If you have not done so, you should obtain a copy of the document and use that as -the programming guide to omniORB.

The specification is not an easy read. The alternative is to use one -of the books on CORBA programming that has begun to appear. For -instance, Henning and Vinoski’s ‘Advanced CORBA Programming with -C++’ [HV99] includes many example code bits to illustrate -how to use the C++ mapping.

3.1  omniORB 2 BOA compatibility

-

If you use the -WbBOA option to omniidl, it will generate -skeleton code with the same interface as the old omniORB 2 BOA -mapping, as well as code to be used with the POA. Note that since the -major problem with the BOA specification was that server code was not -portable between ORBs, it is unlikely that omniORB 4.1’s BOA +the programming guide to omniORB.

The specification is not an easy read. The alternative is to use one +of the books on CORBA programming. For instance, Henning and Vinoski’s +‘Advanced CORBA Programming with C++’ [HV99] includes many +example code fragments to illustrate how to use the C++ mapping.

+

3.1  omniORB 2 BOA compatibility

+

+

Before the Portable Object Adapter (POA) specification, many of the +details of how servant objects should be implemented and registered +with the system were unspecified, so server-side code was not portable +between ORBs. The POA specification rectifies that. For compatibility, +omniORB 4 still supports the old omniORB 2.x BOA mapping, but you +should always use the POA mapping for new code. BOA code and POA code +can coexist within a single program.

If you use the -WbBOA option to omniidl, it will generate +skeleton code with (nearly) the same interface as the old omniORB 2 +BOA mapping, as well as code to be used with the POA. Note that since +the major problem with the BOA specification was that server code was +not portable between ORBs, it is unlikely that omniORB’s BOA compatibility will help you much if you are moving from a different -BOA-based ORB.

The BOA compatibility permits the majority of BOA code to compile +BOA-based ORB.

The BOA compatibility permits the majority of BOA code to compile without difficulty. However, there are a number of constructs which -relied on omniORB 2 implementation details which no longer work.

  • omniORB 2 did not use distinct types for object references and +relied on omniORB 2 implementation details which no longer work.

    • omniORB 2 did not use distinct types for object references and servants, and often accepted a pointer to a servant when the CORBA specification says it should only accept an object reference. Such -code will not compile under omniORB 4.1.
    • The reverse is true for BOA::obj_is_ready(). It now only +code will not compile under omniORB 4.
    • The reverse is true for BOA::obj_is_ready(). It now only works when passed a pointer to a servant object, not an object reference. The more commonly used mechanism of calling -_obj_is_ready(boa) on the servant object still works as -expected.
    • It used to be the case that the skeleton class for interface -I (_sk_I) was derived from class I. This meant +_obj_is_ready(boa) on the servant object still works as +expected.
    • It used to be the case that the skeleton class for interface +I (_sk_I) was derived from class I. This meant that the names of any types declared in the interface were available in the scope of the skeleton class. This is no longer true. If you -have an interface:
      interface I { - struct S { - long a,b; - }; - S op(); -};

      then where before the implementation code might have been:

      class I_impl : public virtual _sk_I { - S op(); // _sk_I is derived from I -}; -I::S I_impl::op() { - S ret; - // ... -}

      it is now necessary to fully qualify all uses of S:

      class I_impl : public virtual _sk_I { - I::S op(); // _sk_I is not derived from I -}; -I::S I_impl::op() { - I::S ret; - // ... -}
    • The proprietary omniORB 2 LifeCycle extensions are no longer +have an interface:
      interface I { + struct S { + long a,b; + }; + S op(); +};

      then where before the implementation code might have been:

      class I_impl : public virtual _sk_I { + S op(); // _sk_I is derived from I +}; +I::S I_impl::op() { + S ret; + // ... +}

      it is now necessary to fully qualify all uses of S:

      class I_impl : public virtual _sk_I { + I::S op(); // _sk_I is not derived from I +}; +I::S I_impl::op() { + I::S ret; + // ... +}
    • The proprietary omniORB 2 LifeCycle extensions are no longer supported. All of the facilities it offered can be implemented with -the POA interfaces, and the omniORB::LOCATION_FORWARD -exception (see section 4.8). Code which used the -old interfaces will have to be rewritten.

    3.2  omniORB 3.0 compatibility

    omniORB 4.1 is almost completely source-code compatible with omniORB +the POA interfaces, and the omniORB::LOCATION_FORWARD +exception (see section 4.8). Code which used the +old interfaces will have to be rewritten.

+

3.2  omniORB 3.0 compatibility

+

omniORB 4 is almost completely source-code compatible with omniORB 3.0. There are two main cases where code may have to change. The first is code that uses the omniORB API, some aspects of which have changed. The omniORB configuration file also has a new format. See the -next chapter for details of the new API and configuration file.

The second case of code that may have to change is code using the +next chapter for details of the new API and configuration file.

The second case of code that may have to change is code using the Dynamic Any interfaces. The standard changed quite significantly between CORBA 2.2 and CORBA 2.3; omniORB 3.0 supported the old CORBA -2.2 interfaces; omniORB 4.1 uses the new mapping. The changes are -largely syntax changes, rather than semantic differences.

3.3  omniORB 4.0 compatibility

omniORB 4.1 is source-code compatible with omniORB 4.0, with four -exceptions:

  1. As required by the 1.1 version of the CORBA C++ mapping -specification, the RefCountServantBase class has been +2.2 interfaces; omniORB 4 uses the new mapping. The changes are +largely syntax changes, rather than semantic differences.

    +

    3.3  omniORB 4.0 compatibility

    +

    omniORB 4.2 is source-code compatible with omniORB 4.0, with four +exceptions:

    1. As required by the 1.1 version of the CORBA C++ mapping +specification, the RefCountServantBase class has been deprecated, and the reference counting functionality moved into -ServantBase. For backwards compatibility, -RefCountServantBase still exists, but is now defined as an +ServantBase. For backwards compatibility, +RefCountServantBase still exists, but is now defined as an empty struct. Most code will continue to work unchanged, but code -that explicitly calls RefCountServantBase::_add_ref() or -_remove_ref() will no longer compile.
    2. omniORB 4.0 had an option for Any extraction semantics that was +that explicitly calls RefCountServantBase::_add_ref() or +_remove_ref() will no longer compile.
    3. omniORB 4.0 had an option for Any extraction semantics that was compatible with omniORB 2.7, where ownership of extracted values was -not maintained by the Any. That option is no longer available.
    4. The members of the clientSendRequest interceptor have +not maintained by the Any. That option is no longer available.
    5. The members of the clientSendRequest interceptor have been changed, replacing all the separate variables with a single -member of type GIOP_C. All the values previously available -can be accessed through the GIOP_C instance.
    6. The C++ mapping contains Any insertion operators for sequence +member of type GIOP_C. All the values previously available +can be accessed through the GIOP_C instance.
    7. The C++ mapping contains Any insertion operators for sequence types that are passed by pointer, which cause the Any to take ownership of the inserted sequence. In omniORB 4.0 and earlier, the sequence was immediately marshalled into the Any’s internal buffer, and the sequence was deleted. In omniORB 4.1, the sequence pointer is stored by the Any, and the sequence is deleted later when the Any -is destroyed.

      For most uses, this change is not visible to application code. +is destroyed.

      For most uses, this change is not visible to application code. However, if a sequence is constructed using an application-supplied -buffer with the release flag set to false (meaning that the +buffer with the release flag set to false (meaning that the application continues to own the buffer), it is now important that the buffer is not deleted or modified while the Any exists, since the Any continues to refer to the buffer contents. This change @@ -99,9 +109,22 @@ with the Any seeing modified data or the process crashing due to accessing deleted data. To avoid this situation, use the alternative Any insertion operator using a const reference, which copies the -sequence.


    -Previous -Up -Next - - +sequence.

+

3.4  omniORB 4.1 compatibility

+

omniORB 4.2 is source-code compatible with omniORB 4.1 with one +exception:

  1. When omniORB 4.1 and earlier detected a timeout condition, they +would throw the CORBA::TRANSIENT system exception. omniORB +4.2 supports the CORBA::TIMEOUT system exception that was +introduced with the CORBA Messaging specification. Application code +that caught CORBA::TRANSIENT to handle timeout situations +should be updated to catch CORBA::TIMEOUT +instead. Alternatively, to avoid code changes, omniORB can be +configured to throw CORBA::TRANSIENT for timeouts, by setting +the throwTransientOnTimeout parameter to 1. See +section 4.4.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB004.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB004.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB004.html 2011-04-04 16:56:41.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB004.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,523 +1,629 @@ - - - - - - - -omniORB configuration and API - - -Previous -Up -Next -
-

Chapter 4  omniORB configuration and API

-

omniORB 4.1 has a wide range of parameters that can be -configured. They can be set in the configuration file / Windows -registry, as environment variables, on the command line, or within a -proprietary extra argument to CORBA::ORB_init(). A few parameters -can be configured at run time. This chapter lists all the -configuration parameters, and how they are used.

4.1  Setting parameters

When CORBA::ORB_init() is called, the value for each configuration -parameter is searched for in the following order:

  1. Command line arguments -
  2. ORB_init() options -
  3. Environment variables -
  4. Configuration file / Windows registry -
  5. Built-in defaults

4.1.1  Command line arguments

Command line arguments take the form -‘-ORBparameter’, and usually expect another -argument. An example is ‘-ORBtraceLevel 10’.

4.1.2  ORB_init() parameter

ORB_init()’s extra argument accepts an array of two-dimensional -string arrays, like this:

const char* options[][2] = { { "traceLevel", "1" }, { 0, 0 } }; -orb = CORBA::ORB_init(argc,argv,"omniORB4",options);

4.1.3  Environment variables

Environment variables consist of the parameter name prefixed with -‘ORB’. Using bash, for example

export ORBtraceLevel=10

4.1.4  Configuration file

The best way to understand the format of the configuration file is to -look at the sample.cfg file in the omniORB distribution. Each -parameter is set on a single line like

traceLevel = 10
-

Some parameters can have more than one value, in which case the + + + + + + +omniORB configuration and API + + +Previous +Up +Next +


+

Chapter 4  omniORB configuration and API

+

+

omniORB has a wide range of parameters that can be configured. They +can be set in the configuration file / Windows registry, as +environment variables, on the command line, or within a proprietary +extra argument to CORBA::ORB_init(). A few parameters can be +configured at run time. This chapter lists all the configuration +parameters, and how they are used.

+

4.1  Setting parameters

+

When CORBA::ORB_init() is called, the value for each configuration +parameter is searched for in the following order:

  1. Command line arguments +
  2. ORB_init() options +
  3. Environment variables +
  4. Configuration file / Windows registry +
  5. Built-in defaults
+

4.1.1  Command line arguments

+

Command line arguments take the form +‘-ORBparameter’, and usually expect another +argument. An example is ‘-ORBtraceLevel 10’.

+

4.1.2  ORB_init() parameter

+

ORB_init()’s extra argument accepts an array of two-dimensional +string arrays, like this:

const char* options[][2] = { { "traceLevel", "1" }, { 0, 0 } }; +orb = CORBA::ORB_init(argc,argv,"omniORB4",options);
+

4.1.3  Environment variables

+

Environment variables consist of the parameter name prefixed with +‘ORB’. Using bash, for example

export ORBtraceLevel=10
+

4.1.4  Configuration file

+

The best way to understand the format of the configuration file is to +look at the sample.cfg file in the omniORB distribution. Each +parameter is set on a single line like

traceLevel = 10
+

Some parameters can have more than one value, in which case the parameter name may be specified more than once, or you can leave it -out:

InitRef = NameService=corbaname::host1.example.com
+out:

InitRef = NameService=corbaname::host1.example.com
         = InterfaceRepository=corbaloc::host2.example.com:1234/IfR
-

+

-
-Note how command line arguments and environment variables prefix -parameter names with ‘-ORB’ and ‘ORB’ respectively, but the -configuration file and the extra argument to ORB_init() do not use -a prefix. -

4.1.5  Windows registry

On Windows, configuration parameters can be stored in the registry, -under the key HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

The file sample.reg shows the settings that can be made. It can -be edited and then imported into regedit.

4.2  Tracing options

The following options control debugging trace output.

traceLevel    default = -1

omniORB can output tracing and diagnostic messages to the standard -error stream. The following levels are defined:

- - - - - - - - -
 
-level 0critical errors only
level 1informational messages only
level 2configuration information and warnings
-level 5notifications when server threads are -created and communication endpoints are shutdown
-level 10execution and exception traces
level 25trace each send or receive of a giop message
level 30dump up to 128 bytes of each giop message
level 40dump complete contents of each giop message

The trace level is cumulative, so at level 40, all trace -messages are output.

traceExceptions    default = -0

If the traceExceptions parameter is set true, all system +

+Command line arguments and environment variables prefix parameter +names with ‘-ORB’ and ‘ORB’ respectively, but the configuration file +and the extra argument to ORB_init() do not use a prefix. +

+

4.1.5  Windows registry

+

On Windows, configuration parameters can be stored in the registry, +under the key HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

The file sample.reg shows the settings that can be made. It can +be edited and then imported into regedit.

+

4.2  Tracing options

+

The following options control debugging trace output.

traceLevel    default = +1

omniORB can output tracing and diagnostic messages to the standard +error stream. The following levels are defined:

+ + + + + + + + +
 
+level 0critical errors only
level 1informational messages only
level 2configuration information and warnings
+level 5notifications when server threads are +created and communication endpoints are shutdown
+level 10execution and exception traces
level 25trace each send or receive of a GIOP message
level 30dump up to 128 bytes of each GIOP message
level 40dump complete contents of each GIOP message

The trace level is cumulative, so at level 40, all trace +messages are output.

traceExceptions    default = +0

If the traceExceptions parameter is set true, all system exceptions are logged as they are thrown, along with details about where the exception is thrown from. This parameter is enabled by -default if the traceLevel is set to 10 or more.

traceInvocations    default = -0

If the traceInvocations parameter is set true, all local and -remote invocations are logged, in addition to any logging that may -have been selected with traceLevel.

traceInvocationReturns    default = -0

If the traceInvocationReturns parameter is set true, a log -message is output as an operation invocation returns. In conjunction -with traceInvocations and traceTime (described below), -this provides a simple way of timing CORBA calls within your -application.

traceThreadId    default = -0

If traceThreadId is set true, all trace messages are prefixed -with the id of the thread outputting the message. This can be handy -for tracking down race conditions, but it adds significant overhead to -the logging function so it is turned off by default.

traceTime    default = -0

If traceTime is set true, all trace messages are prefixed with -the time. This is useful, but on some platforms it adds a very large -overhead, so it is turned off by default.

traceFile    default = -

omniORB’s tracing is normally sent to stderr. if traceFile it -set, the specified file name is used for trace messages.

4.2.1  Tracing API

The tracing parameters can be modified at runtime by assigning to the -following variables

namespace omniORB { - CORBA::ULong traceLevel; - CORBA::Boolean traceExceptions; - CORBA::Boolean traceInvocations; - CORBA::Boolean traceInvocationReturns; - CORBA::Boolean traceThreadId; - CORBA::Boolean traceTime; -};

Log messages can be sent somewhere other than stderr by registering a -logging function which is called with the text of each log message:

namespace omniORB { - typedef void (*logFunction)(const char*); - void setLogFunction(logFunction f); -};

The log function must not make any CORBA calls, since that could lead +default if the traceLevel is set to 10 or more.

traceInvocations    default = +0

If the traceInvocations parameter is set true, all local +and remote invocations are logged, in addition to any logging that may +have been selected with traceLevel.

traceInvocationReturns    default = +0

If the traceInvocationReturns parameter is set true, a +log message is output as an operation invocation returns. In +conjunction with traceInvocations and traceTime +(described below), this provides a simple way of timing CORBA calls +within your application.

traceThreadId    default = +1

If traceThreadId is set true, all trace messages are +prefixed with the id of the thread outputting the message. This can be +handy for making sense of multi-threaded code, but it adds overhead to +the logging so it can be disabled.

traceTime    default = +1

If traceTime is set true, all trace messages are +prefixed with the time. This is useful, but on some platforms it adds +a very large overhead, so it can be turned off.

traceFile    default = +

omniORB’s tracing is normally sent to stderr. If traceFile it +set, the specified file name is used for trace messages.

+

4.2.1  Tracing API

+

The tracing parameters can be modified at runtime by assigning to the +following variables

namespace omniORB { + CORBA::ULong traceLevel; + CORBA::Boolean traceExceptions; + CORBA::Boolean traceInvocations; + CORBA::Boolean traceInvocationReturns; + CORBA::Boolean traceThreadId; + CORBA::Boolean traceTime; +};

Log messages can be sent somewhere other than stderr by registering a +logging function which is called with the text of each log message:

namespace omniORB { + typedef void (*logFunction)(const char*); + void setLogFunction(logFunction f); +};

The log function must not make any CORBA calls, since that could lead to infinite recursion as outputting a log message caused other log -messages to be generated, and so on.

4.3  Miscellaneous global options

These options control miscellaneous features that affect the whole ORB -runtime.

dumpConfiguration    default = -0

If set true, the ORB dumps the values of all configuration parameters -at start-up.

scanGranularity    default = -5

As explained in chapter 8, omniORB regularly +messages to be generated, and so on.

+

4.3  Miscellaneous global options

+

These options control miscellaneous features that affect the whole ORB +runtime.

dumpConfiguration    default = +0

If set true, the ORB dumps the values of all configuration +parameters at start-up.

scanGranularity    default = +5

As explained in chapter 6, omniORB regularly scans incoming and outgoing connections, so it can close unused ones. This value is the granularity in seconds at which the ORB -performs its scans. A value of zero turns off the scanning altogether.

nativeCharCodeSet    default = -ISO-8859-1

The native code set the application is using for char and -string. See chapter 9.

nativeWCharCodeSet    default = -UTF-16

The native code set the application is using for wchar and -wstring. See chapter 9.

copyValuesInLocalCalls    default = -1

Determines whether valuetype parameters in local calls are copied or -not. See chapter 13.

abortOnInternalError    default = -0

If this is set true, internal fatal errors will abort immediately, -rather than throwing the omniORB::fatalException exception. -This can be helpful for tracking down bugs, since it leaves the call -stack intact.

abortOnNativeException    default = -0

On Windows, ‘native’ exceptions such as segmentation faults and divide -by zero appear as C++ exceptions that can be caught with catch -(...). Setting this parameter to true causes such exceptions to -abort the process instead.

maxSocketSend
-maxSocketRecv
+performs its scans. A value of zero turns off the scanning altogether.

nativeCharCodeSet    default = +ISO-8859-1

The native code set the application is using for char and +string. See chapter 8.

nativeWCharCodeSet    default = +UTF-16

The native code set the application is using for wchar and +wstring. See chapter 8.

defaultCharCodeSet    default = +none

The default code set used for char and string if the +server does not specify it in its IORs. See +chapter 8.

defaultWCharCodeSet    default = +none

The default code set used for wchar and wstring if the +server does not specify it in its IORs. See +chapter 8.

copyValuesInLocalCalls    default = +1

Determines whether valuetype parameters in local calls are copied or +not. See chapter 11.

abortOnInternalError    default = +0

If this is set true, internal fatal errors will abort +immediately, rather than throwing the omniORB::fatalException +exception. This can be helpful for tracking down bugs, since it +leaves the call stack intact.

abortOnNativeException    default = +0

On Windows, ‘native’ exceptions such as segmentation faults and divide +by zero appear as C++ exceptions that can be caught with catch +(...). Setting this parameter to true causes such exceptions +to abort the process instead.

maxSocketSend
+maxSocketRecv
On some platforms, calls to send() and recv() have a limit on the buffer size that can be used. These parameters set the limits in bytes -that omniORB uses when sending / receiving bulk data.

The default values are platform specific. It is unlikely that you will -need to change the values from the defaults.

The minimum valid limit is 1KB, 1024 bytes.

socketSendBuffer    default = --1 or 16384

On Windows, there is a kernel buffer used during send operations. A +that omniORB uses when sending / receiving bulk data.

The default values are platform specific. It is unlikely that you will +need to change the values from the defaults.

The minimum valid limit is 1KB, 1024 bytes.

socketSendBuffer    default = +-1 or 16384

On Windows, there is a kernel buffer used during send operations. A bug in Windows means that if a send uses the entire kernel buffer, a select() on the socket blocks until all the data has been acknowledged by the receiver, resulting in dreadful performance. This parameter modifies the socket send buffer from its default (8192 bytes on Windows) to the value specified. If this parameter is set to -1, the -socket send buffer is left at the system default.

On Windows, the default value of this parameter is 16384 bytes; on all -other platforms the default is -1.

validateUTF8    default = -0

When transmitting a string that is supposed to be UTF-8, omniORB +socket send buffer is left at the system default.

On Windows, the default value of this parameter is 16384 bytes; on all +other platforms the default is -1.

validateUTF8    default = +0

When transmitting a string that is supposed to be UTF-8, omniORB usually passes it directly, assuming that it is valid. With this -parameter set true, omniORB checks that all UTF-8 strings are valid, -and throws DATA_CONVERSION if not.

4.4  Client side options

These options control aspects of client-side behaviour.

InitRef    default = -none

Specify objects available from -ORB::resolve_initial_references(). The arguments take the form -<key>=<uri>, where key is the name given to -resolve_initial_references() and uri is a +parameter set true, omniORB checks that all UTF-8 strings are +valid, and throws DATA_CONVERSION if not.

+

4.4  Client side options

+

+

These options control aspects of client-side behaviour.

InitRef    default = +none

Specify objects available from +ORB::resolve_initial_references(). The arguments take the form +<key>=<uri>, where key is the name given to +resolve_initial_references() and uri is a valid CORBA object reference URI, as detailed in -chapter 6.

DefaultInitRef    default = -none

Specify the default URI prefix for -resolve_initial_references(), as explained in -chapter 6.

clientTransportRule    default = -* unix,tcp,ssl

Used to specify the way the client contacts a server, depending on the -server’s address. See section 8.7.1 for details.

clientCallTimeOutPeriod    default = -0

Call timeout in milliseconds for the client side. If a call takes +chapter 7.

DefaultInitRef    default = +none

Specify the default URI prefix for +resolve_initial_references(), as explained in +chapter 7.

clientTransportRule    default = +* unix,tcp,ssl

Used to specify the way the client contacts a server, depending on the +server’s address. See section 6.7.1 for details.

clientCallTimeOutPeriod    default = +0

Call timeout in milliseconds for the client side. If a call takes longer than the specified number of milliseconds, the ORB closes the -connection to the server and raises a TRANSIENT exception. A +connection to the server and raises a TRANSIENT exception. A value of zero means no timeout; calls can block for ever. See -section 8.3.1 for more information about timeouts.

Note: omniORB 3 had timeouts specified in seconds; -omniORB 4.0 and later use milliseconds for timeouts.

clientConnectTimeOutPeriod    default = -0

The timeout that is used in the case that a new network connection is +section 6.3.1 for more information about timeouts.

Note: omniORB 3 had timeouts specified in seconds; +omniORB 4.0 and later use milliseconds for timeouts.

clientConnectTimeOutPeriod    default = +0

The timeout that is used in the case that a new network connection is established to the server. A value of zero means that the normal call -timeout is used. See section 8.3.1 for more information -about timeouts.

supportPerThreadTimeOut    default = -0

If this parameter is set true, timeouts can be set on a per thread -basis, as well as globally and per object. Checking per-thread storage -has a noticeable performance impact, so it is turned off by default.

resetTimeoutOnRetries    default = -0

If true, the call timeout is reset when an exception handler causes a -call to be retried. If false, the timeout is not reset, and therefore -applies to the call as a whole, rather than to each individual call -attempt.

outConScanPeriod    default = -120

Idle timeout in seconds for outgoing (i.e. client initiated) +timeout is used. See section 6.3.1 for more information +about timeouts.

supportPerThreadTimeOut    default = +0

If this parameter is set true, timeouts can be set on a per +thread basis, as well as globally and per object. Checking per-thread +storage has a noticeable performance impact, so it is turned off by +default.

resetTimeoutOnRetries    default = +0

If true, the call timeout is reset when an exception handler +causes a call to be retried. If false, the timeout is not +reset, and therefore applies to the call as a whole, rather than to +each individual call attempt.

throwTransientOnTimeout    default = +0

omniORB 4.2 supports the CORBA::TIMEOUT exception that is part +of the CORBA Messaging specification. By default, that is the +exception thrown when timeouts occur. Previous omniORB releases did +not have the CORBA::TIMEOUT exception, and instead used +CORBA::TRANSIENT. If this parameter is set true, omniORB +follows the old behaviour of throwing CORBA::TRANSIENT when a +timeout occurs.

outConScanPeriod    default = +120

Idle timeout in seconds for outgoing (i.e. client initiated) connections. If a connection has been idle for this amount of time, -the ORB closes it. See section 8.5.

maxGIOPConnectionPerServer    default = -5

The maximum number of concurrent connections the ORB will open to a -single server. If multiple threads on the client call the same +the ORB closes it. See section 6.5.

maxGIOPConnectionPerServer    default = +5

The maximum number of concurrent connections the ORB will open to a +single server. If multiple threads on the client call the same server, the ORB opens additional connections to the server, up to the maximum specified by this parameter. If the maximum is reached, -threads are blocked until a connection becomes free for them to use.

oneCallPerConnection    default = -1

When this parameter is set to true (the default), the ORB will only -send a single call on a connection at a time. If multiple client +threads are blocked until a connection becomes free for them to use.

oneCallPerConnection    default = +1

When this parameter is set to true (the default), the ORB will +only send a single call on a connection at a time. If multiple client threads invoke on the same server, multiple connections are opened, up to the limit specified by -maxGIOPConnectionPerServer. With this parameter set to -false, the ORB will allow concurrent calls on a single +maxGIOPConnectionPerServer. With this parameter set to +false, the ORB will allow concurrent calls on a single connection. This saves connection resources, but requires slightly more management work for both client and server. Some server-side ORBs -(including omniORB versions before 4.0) serialise all calls on a -single connection.

maxInterleavedCallsPerConnection    default = -5

The maximum number of calls that can be interleaved on a connection. -If more concurrent calls are made, they are queued.

offerBiDirectionalGIOP    default = -0

If set true, the client will indicate to servers that it is willing to -accept callbacks on client-initiated connections using bidirectional -GIOP, provided the relevant POA policies are set. See -section 8.8.

diiThrowsSysExceptions    default = -0

If this is true, DII functions throw system exceptions; if it is -false, system exceptions that occur are passed through the -Environment object.

verifyObjectExistsAndType    default = -1

By default, omniORB uses the GIOP LOCATE_REQUEST message to +(including omniORB versions before 4.0) serialise all incoming calls +on a single connection.

maxInterleavedCallsPerConnection    default = +5

The maximum number of calls that can be interleaved on a connection. +If more concurrent calls are made, they are queued.

offerBiDirectionalGIOP    default = +0

If set true, the client will indicate to servers that it is +willing to accept callbacks on client-initiated connections using +bidirectional GIOP, provided the relevant POA policies are set. See +section 6.8.

diiThrowsSysExceptions    default = +0

If this is true, DII functions throw system exceptions; if it +is false, system exceptions that occur are passed through the +Environment object.

verifyObjectExistsAndType    default = +1

By default, omniORB uses the GIOP LOCATE_REQUEST message to verify the existence of an object prior to the first invocation. In the case that the full type of the object is not known, it instead -calls the _is_a() operation to check the object’s type. Some ORBs +calls the _is_a() operation to check the object’s type. Some ORBs have bugs that mean one or other of these operations fail. Setting -this parameter false prevents omniORB from making these calls.

giopTargetAddressMode    default = -0

GIOP 1.2 supports three addressing modes for contacting objects. This +this parameter false prevents omniORB from making these calls.

giopTargetAddressMode    default = +0

GIOP 1.2 supports three addressing modes for contacting objects. This parameter selects the mode that omniORB uses. A value of 0 means -GIOP::KeyAddr; 1 means GIOP::ProfileAddr; 2 means -GIOP::ReferenceAddr.

immediateAddressSwitch    default = -0

If true, the client will immediately switch to use a new address to -contact an object after a failure. If false (the default), the current -address will be retried in certain circumstances.

bootstrapAgentHostname    default = -none

If set, this parameter indicates the hostname to use for look-ups +GIOP::KeyAddr; 1 means GIOP::ProfileAddr; 2 means +GIOP::ReferenceAddr.

immediateAddressSwitch    default = +0

If true, the client will immediately switch to use a new +address to contact an object after a failure. If false (the +default), the current address will be retried in certain +circumstances.

bootstrapAgentHostname    default = +none

If set, this parameter indicates the hostname to use for look-ups using the obsolete Sun bootstrap agent. This mechanism is superseded -by the interoperable naming service.

bootstrapAgentPort    default = -900

The port number for the obsolete Sun bootstrap agent.

principal    default = -none

GIOP 1.0 and 1.1 have a request header field named ‘principal’, which +by the interoperable naming service.

bootstrapAgentPort    default = +900

The port number for the obsolete Sun bootstrap agent.

principal    default = +none

GIOP 1.0 and 1.1 have a request header field named ‘principal’, which contains a sequence of octets. It was never defined what it should mean, and its use is now deprecated; GIOP 1.2 has no such field. Some systems (e.g. Gnome) use the principal field as a primitive authentication scheme. This parameter sets the data omniORB uses in -the principal field. The default is an empty sequence.

4.5  Server side options

These parameters affect server-side operations.

endPoint             default = giop:tcp::
-endPointNoListen
-endPointPublish
-endPointNoPublish
-endPointPublishAllIFs
+the principal field. The default is an empty sequence.

+

4.5  Server side options

+

These parameters affect server-side operations.

endPoint             default = giop:tcp::
+endPointNoListen
+endPointPublish
+endPointNoPublish
+endPointPublishAllIFs
These options determine the end-points the ORB should listen on, and the details that should be published in IORs. See -chapter 8 for details.

serverTransportRule    default = -* unix,tcp,ssl

Configure the rules about whether a server should accept an incoming -connection from a client. See section 8.7.2 for -details.

serverCallTimeOutPeriod    default = -0

This timeout is used to catch the situation that the server starts +chapter 6 for details.

serverTransportRule    default = +* unix,tcp,ssl

Configure the rules about whether a server should accept an incoming +connection from a client. See section 6.7.2 for +details.

serverCallTimeOutPeriod    default = +0

This timeout is used to catch the situation that the server starts receiving a request, but the end of the request never comes. If a calls takes longer than the specified number of milliseconds to arrive, the ORB shuts the connection. A value of zero means never -timeout.

inConScanPeriod    default = -180

Idle timeout in seconds for incoming. If a connection has been idle -for this amount of time, the ORB closes it. See -section 8.5.

threadPerConnectionPolicy    default = -1

If true (the default), the ORB dedicates one server thread to each -incoming connection. Setting it false means the server should use a -thread pool.

maxServerThreadPerConnection    default = -100

If the client multiplexes several concurrent requests on a single +timeout.

inConScanPeriod    default = +180

Idle timeout in seconds for incoming connections. If a connection has +been idle for this amount of time, the ORB closes it. See +section 6.5.

threadPerConnectionPolicy    default = +1

If true (the default), the ORB dedicates one server thread to +each incoming connection. Setting it false means the server +should use a thread pool.

maxServerThreadPerConnection    default = +100

If the client multiplexes several concurrent requests on a single connection, omniORB uses extra threads to service them. This parameter specifies the maximum number of threads that are allowed to service a -single connection at any one time.

maxServerThreadPoolSize    default = -100

The maximum number of threads the server will allocate to do various +single connection at any one time.

maxServerThreadPoolSize    default = +100

The maximum number of threads the server will allocate to do various tasks, including dispatching calls in the thread pool mode. This number does not include threads dispatched under the thread per -connection server mode.

threadPerConnectionUpperLimit    default = -10000

If the threadPerConnectionPolicy parameter is true, the ORB can -automatically transition to thread pool mode if too many connections -arrive. This parameter sets the number of connections at which thread -pooling is started. The default of 10000 is designed to mean that it -never happens.

threadPerConnectionLowerLimit    default = -9000

If thread pooling was started because the number of connections hit +connection server mode.

threadPerConnectionUpperLimit    default = +10000

If the threadPerConnectionPolicy parameter is true, the +ORB can automatically transition to thread pool mode if too many +connections arrive. This parameter sets the number of connections at +which thread pooling is started. The default of 10000 is designed to +mean that it never happens.

threadPerConnectionLowerLimit    default = +9000

If thread pooling was started because the number of connections hit the upper limit, this parameter determines when thread per connection -should start again.

threadPoolWatchConnection    default = -1

After dispatching an upcall in thread pool mode, the thread that has +should start again.

threadPoolWatchConnection    default = +1

After dispatching an upcall in thread pool mode, the thread that has just performed the call can watch the connection for a short time before returning to the pool. This leads to less thread switching for a series of calls from a single client, but is less fair if there are concurrent clients. The connection is watched if the number of threads -concurrently handling the connection is <= the value of this -parameter. i.e. if the parameter is zero, the connection is never -watched; if it is 1, the last thread managing a connection watches it; -if 2, the connection is still watched if there is one other thread -still in an upcall for the connection, and so on.

See section 8.4.2.

connectionWatchPeriod    default = -50000

For each endpoint, the ORB allocates a thread to watch for new +concurrently handling the connection is less than or equal to the +value of this parameter. i.e. if the parameter is zero, the +connection is never watched; if it is 1, the last thread managing a +connection watches it; if 2, the connection is still watched if there +is one other thread still in an upcall for the connection, and so +on. See section 6.4.2.

connectionWatchPeriod    default = +50000

For each endpoint, the ORB allocates a thread to watch for new connections and to monitor existing connections for calls that should be handed by the thread pool. The thread blocks in select() or similar for a period, after which it re-scans the lists of connections it -should watch. This parameter is specified in microseconds.

connectionWatchImmediate    default = -0

When a thread handles an incoming call, it unmarshals the arguments +should watch. This parameter is specified in microseconds.

connectionWatchImmediate    default = +0

When a thread handles an incoming call, it unmarshals the arguments then marks the connection as watchable by the connection watching thread, in case the client sends a concurrent call on the same -connection. If this parameter is set to the default false, the +connection. If this parameter is set to the default false, the connection is not actually watched until the next connection watch -period (determined by the connectionWatchPeriod parameter). If -this parameter is set true, the connection watching thread is +period (determined by the connectionWatchPeriod parameter). If +this parameter is set true, the connection watching thread is immediately signalled to watch the connection. That leads to faster interactive response to clients that multiplex calls, but adds -significant overhead along the call chain.

Note that this setting has no effect on Windows, since it has no -mechanism for signalling the connection watching thread.

acceptBiDirectionalGIOP    default = -0

Determines whether a server will ever accept clients’ offers of -bidirectional GIOP connections. See section 8.8.

unixTransportDirectory    default = -/tmp/omni-%u

(Unix platforms only). Selects the location used to store Unix domain -sockets. The ‘%u’ is expanded to the user name.

unixTransportPermission    default = -0777

(Unix platforms only). Determines the octal permission bits for Unix +significant overhead along the call chain.

Note that this setting has no effect on Windows, since it has no +mechanism for signalling the connection watching thread.

acceptBiDirectionalGIOP    default = +0

Determines whether a server will ever accept clients’ offers of +bidirectional GIOP connections. See section 6.8.

unixTransportDirectory    default = +/tmp/omni-%u

(Unix platforms only). Selects the location used to store Unix domain +sockets. The ‘%u’ is expanded to the user name.

unixTransportPermission    default = +0777

(Unix platforms only). Determines the octal permission bits for Unix domain sockets. By default, all users can connect to a server, just as -with TCP.

supportCurrent    default = -1

omniORB supports the PortableServer::Current interface to +with TCP.

supportCurrent    default = +1

omniORB supports the PortableServer::Current interface to provide thread context information to servants. Supporting current has a small but noticeable run-time overhead due to accessing thread -specific storage, so this option allows it to be turned off.

objectTableSize    default = -0

Hash table size of the Active Object Map. If this is zero, the ORB +specific storage, so this option allows it to be turned off.

objectTableSize    default = +0

Hash table size of the Active Object Map. If this is zero, the ORB uses a dynamically resized open hash table. This is normally the best option, but it leads to less predictable performance since any operation which adds or removes a table entry may trigger a resize. If set to a non-zero value, the hash table has the specified number of entries, and is never resized. Note that the hash table is open, so this does not limit the number of active objects, just how efficiently -they can be located.

poaHoldRequestTimeout    default = -0

If a POA is put in the HOLDING state, calls to it will be timed +they can be located.

poaHoldRequestTimeout    default = +0

If a POA is put in the HOLDING state, calls to it will be timed out after the specified number of milliseconds, by raising a -TRANSIENT exception. Zero means no timeout.

poaUniquePersistentSystemIds    default = -1

The POA specification requires that object ids in POAs with the +CORBA::TIMEOUT exception. Zero means no timeout.

poaUniquePersistentSystemIds    default = +1

The POA specification requires that object ids in POAs with the PERSISTENT and SYSTEM_ID policies are unique between instantiations of the POA. Older versions of omniORB did not comply with that, and -reused object ids. With this value true, the POA has the correct -behaviour; with false, the POA uses the old scheme for compatibility.

idleThreadTimeout    default = -10

When a thread created by omniORB becomes idle, it is kept alive for a +reused object ids. With this value true, the POA has the +correct behaviour; with false, the POA uses the old scheme for +compatibility.

idleThreadTimeout    default = +10

When a thread created by omniORB becomes idle, it is kept alive for a while, in case a new thread is required. Once a thread has been idle -for the number of seconds specified in this parameter, it exits.

supportBootstrapAgent    default = -0

If set true, servers support the Sun bootstrap agent protocol.

4.5.1  Main thread selection

There is one server-side parameter that must be set with an API -function, rather than a normal configuration parameter:

namespace omniORB { - void setMainThread(); -};

POAs with the MAIN_THREAD policy dispatch calls on the ‘main’ +for the number of seconds specified in this parameter, it exits.

supportBootstrapAgent    default = +0

If set true, servers support the Sun bootstrap agent protocol.

+

4.5.1  Main thread selection

+

There is one server-side parameter that must be set with an API +function, rather than a normal configuration parameter:

namespace omniORB { + void setMainThread(); +};

POAs with the MAIN_THREAD policy dispatch calls on the ‘main’ thread. By default, omniORB assumes that the thread that initialised the omnithread library is the ‘main’ thread. To choose a different thread, call this function from the desired ‘main’ thread. The calling -thread must have an omni_thread associated with it (i.e. it +thread must have an omni_thread associated with it (i.e. it must have been created by omnithread, or -omni_thread::create_dummy() must have been called). If it -does not, the function throws CORBA::INITIALIZE.

Note that calls are only actually dispatched to the ‘main’ thread if -ORB::run() or ORB::perform_work() is called from that thread.

4.6  GIOP and interoperability options

These options control omniORB’s use of GIOP, and cover some areas -where omniORB can work around buggy behaviour by other ORBs.

maxGIOPVersion    default = -1.2

Choose the maximum GIOP version the ORB should support. Valid values -are 1.0, 1.1 and 1.2.

giopMaxMsgSize    default = -2097152

The largest message, in bytes, that the ORB will send or receive, to -avoid resource starvation. If the limit is exceeded, a MARSHAL -exception is thrown. The size must be >= 8192.

strictIIOP    default = -1

If true, be strict about interpretation of the IIOP specification; if -false, permit some buggy behaviour to pass.

lcdMode    default = -0

If true, select ‘Lowest Common Denominator’ mode. This disables +omni_thread::create_dummy() must have been called). If it +does not, the function throws CORBA::INITIALIZE.

Note that calls are only actually dispatched to the ‘main’ thread if +ORB::run() or ORB::perform_work() is called from that thread.

+

4.6  GIOP and interoperability options

+

These options control omniORB’s use of GIOP, and cover some areas +where omniORB can work around buggy behaviour by other ORBs.

maxGIOPVersion    default = +1.2

Choose the maximum GIOP version the ORB should support. Valid values +are 1.0, 1.1 and 1.2.

giopMaxMsgSize    default = +2097152

The largest message, in bytes, that the ORB will send or receive, to +avoid resource starvation. If the limit is exceeded, a MARSHAL +exception is thrown. The size must be >= 8192.

strictIIOP    default = +1

If true, be strict about interpretation of the IIOP +specification; if false, permit some buggy behaviour to pass.

lcdMode    default = +0

If true, select ‘Lowest Common Denominator’ mode. This disables various IIOP and GIOP features that are known to cause problems with -some ORBs.

tcAliasExpand    default = -0

This flag is used to indicate whether TypeCodes associated with Anys +some ORBs.

tcAliasExpand    default = +0

This flag is used to indicate whether TypeCodes associated with Anys should have aliases removed. This functionality is included because some ORBs will not recognise an Any containing a TypeCode with aliases -to be the same as the actual type contained in the Any. Note that -omniORB will always remove top-level aliases, but will not remove -aliases from TypeCodes that are members of other TypeCodes (e.g. -TypeCodes for members of structs etc.), unless tcAliasExpand is -set to 1. There is a performance penalty when inserting into an Any if -tcAliasExpand is set to 1.

useTypeCodeIndirections    default = -1

TypeCode Indirections reduce the size of marshalled TypeCodes, and are +to be the same as the actual type contained in the Any. There is a +performance penalty when inserting into an Any if tcAliasExpand +is set to 1.

useTypeCodeIndirections    default = +1

TypeCode Indirections reduce the size of marshalled TypeCodes, and are essential for recursive types, but some old ORBs do not support them. -Setting this flag to false prevents the use of indirections (and, -therefore, recursive TypeCodes).

acceptMisalignedTcIndirections    default = -0

If true, try to fix a mis-aligned indirection in a typecode. This is -used to work around a bug in some old versions of Visibroker’s Java -ORB.

4.7  System Exception Handlers

By default, all system exceptions that are raised during an operation +Setting this flag to false prevents the use of indirections +(and, therefore, prevents the use of recursive TypeCodes).

acceptMisalignedTcIndirections    default = +0

If true, try to fix a mis-aligned indirection in a +typecode. This is used to work around a bug in some old versions of +Visibroker’s Java ORB.

+

4.7  System Exception Handlers

+

By default, all system exceptions that are raised during an operation invocation, with the exception of some cases of -CORBA::TRANSIENT, are propagated to the application code. Some +CORBA::TRANSIENT, are propagated to the application code. Some applications may prefer to trap these exceptions within the proxy objects so that the application logic does not have to deal with the -error condition. For example, when a CORBA::COMM_FAILURE is +error condition. For example, when a CORBA::COMM_FAILURE is received, an application may just want to retry the invocation until it finally succeeds. This approach is useful for objects that are -persistent and have idempotent operations.

omniORB provides a set of functions to install exception handlers. +persistent and have idempotent operations.

omniORB provides a set of functions to install exception handlers. Once they are installed, proxy objects will call these handlers when the associated system exceptions are raised by the ORB runtime. -Handlers can be installed for CORBA::TRANSIENT, -CORBA::COMM_FAILURE and CORBA::SystemException. This -last handler covers all system exceptions other than the two covered -by the first two handlers. An exception handler can be installed for +Handlers can be installed for CORBA::TRANSIENT, +CORBA::TIMEOUT, CORBA::COMM_FAILURE and +CORBA::SystemException. This last handler covers all +system exceptions other than the three specific ones covered by the +first three handlers. An exception handler can be installed for individual proxy objects, or it can be installed for all proxy objects -in the address space.

4.7.1  Minor codes

omniORB makes extensive use of exception minor codes to indicate the +in the address space.

+

4.7.1  Minor codes

+

omniORB makes extensive use of exception minor codes to indicate the specific circumstances surrounding a system exception. The file -include/omniORB4/minorCode.h contains definitions of all the +include/omniORB4/minorCode.h contains definitions of all the minor codes used in omniORB, covering codes allocated in the CORBA specification, and ones specific to omniORB. In compilers with namespace support, the minor code constants appear in namespace -omni; otherwise they are in the global scope.

Applications can use minor codes to adjust their behaviour according -to the condition, e.g.

try { - ... -} -catch (CORBA::TRANSIENT& ex) { - if (ex.minor() == omni::TRANSIENT_ConnectFailed) { - // retry with a different object reference... - } - else { - // print an error message... - } -}

4.7.2  CORBA::TRANSIENT handlers

TRANSIENT exceptions can occur in many circumstances. One -circumstance is as follows:

  1. The client invokes on an object reference. -
  2. The object replies with a LOCATION_FORWARD message. -
  3. The client caches the new location and retries to the new location. -
  4. Time passes... -
  5. The client tries to invoke on the object again, using the +omni; otherwise they are in the global scope.

    Applications can use minor codes to adjust their behaviour according +to the condition, e.g.

    try { + ... +} +catch (CORBA::TRANSIENT& ex) { + if (ex.minor() == omni::TRANSIENT_ConnectFailed) { + // retry with a different object reference... + } + else { + // print an error message... + } +}
    +

    4.7.2  CORBA::TRANSIENT handlers

    +

    TRANSIENT exceptions can occur in many circumstances. One +circumstance is as follows:

    1. The client invokes on an object reference. +
    2. The object replies with a LOCATION_FORWARD message. +
    3. The client caches the new location and retries to the new location. +
    4. Time passes... +
    5. The client tries to invoke on the object again, using the cached, forwarded location. -
    6. The attempt to contact the object fails. -
    7. The ORB runtime resets the location cache and throws a -TRANSIENT exception with minor code -TRANSIENT_FailedOnForwarded.

    In this situation, the default TRANSIENT exception handler +

  6. The attempt to contact the object fails. +
  7. The ORB runtime resets the location cache and throws a +TRANSIENT exception with minor code +TRANSIENT_FailedOnForwarded.

In this situation, the default TRANSIENT exception handler retries the call, using the object’s original location. If the retry -results in another LOCATION_FORWARD, to the same or a -different location, and that forwarded location fails -immediately, the TRANSIENT exception will occur again, and the +results in another LOCATION_FORWARD, to the same or a +different location, and that forwarded location fails +immediately, the TRANSIENT exception will occur again, and the pattern will repeat. With repeated exceptions, the handler starts -adding delays before retries, with exponential back-off.

In all other circumstances, the default TRANSIENT handler just -passes the exception on to the caller.

Applications can override the default behaviour by installing their -own exception handler. The API to do so is summarised below:

namespace omniORB { - - typedef CORBA::Boolean - (*transientExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::TRANSIENT& ex); - - void - installTransientExceptionHandler(void* cookie, - transientExceptionHandler_t fn); - - void - installTransientExceptionHandler(CORBA::Object_ptr obj, - void* cookie, - transientExceptionHandler_t fn); -}

The overloaded function installTransientExceptionHandler() can be -used to install the exception handlers for CORBA::TRANSIENT. -Two forms are available: the first form installs an exception handler -for all object references except for those which have an exception -handler installed by the second form, which takes an additional -argument to identify the target object reference. The argument -cookie is an opaque pointer which will be passed on by the ORB -when it calls the exception handler.

An exception handler will be called by proxy objects with three -arguments. The cookie is the opaque pointer registered by -installTransientExceptionHandler(). The argument -n_retries is the number of times the proxy has called this -handler for the same invocation. The argument ex is the value +adding delays before retries, with exponential back-off.

In all other circumstances, the default TRANSIENT handler just +passes the exception on to the caller.

Applications can override the default behaviour by installing their +own exception handler. The API to do so is summarised below:

namespace omniORB { + + typedef CORBA::Boolean + (*transientExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex); + + void + installTransientExceptionHandler(void* cookie, + transientExceptionHandler_t fn); + + void + installTransientExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandler_t fn); +}

The overloaded installTransientExceptionHandler() function is used +to install the exception handlers for CORBA::TRANSIENT. Two +forms are available: the first form installs an exception handler for +all object references except for those which have an exception handler +installed by the second form, which takes an additional argument to +identify the target object reference. The argument cookie is an +opaque pointer which will be passed on by the ORB when it calls the +exception handler.

An exception handler will be called by proxy objects with three +arguments. The cookie is the opaque pointer registered by +installTransientExceptionHandler(). The argument +n_retries is the number of times the proxy has called this +handler for the same invocation. The argument ex is the value of the exception caught. The exception handler is expected to do whatever is appropriate and return a boolean value. If the return -value is TRUE(1), the proxy object retries the operation. If the -return value is FALSE(0), the original exception is propagated into -the application code. In the case of a TRANSIENT exception due -to a failed location forward, the exception propagated to the -application is the original exception that caused the -TRANSIENT (e.g. a COMM_FAILURE or -OBJECT_NOT_EXIST), rather than the TRANSIENT -exception1.

The following sample code installs a simple exception handler for all -objects and for a specific object:

CORBA::Boolean my_transient_handler1 (void* cookie, - CORBA::ULong retries, - const CORBA::TRANSIENT& ex) -{ - cerr << "transient handler 1 called." << endl; - return 1; // retry immediately. -} - -CORBA::Boolean my_transient_handler2 (void* cookie, - CORBA::ULong retries, - const CORBA::TRANSIENT& ex) -{ - cerr << "transient handler 2 called." << endl; - return 1; // retry immediately. -} - - -static Echo_ptr myobj; - -void installhandlers() -{ - omniORB::installTransientExceptionHandler(0,my_transient_handler1); - // All proxy objects will call my_transient_handler1 from now on. - - omniORB::installTransientExceptionHandler(myobj,0,my_transient_handler2); - // The proxy object of myobj will call my_transient_handler2 from now on. -}

4.7.3  CORBA::COMM_FAILURE

If the ORB has successfully contacted an object at some point, and +value is true, the proxy object retries the operation. If the +return value is false, the original exception is propagated +into the application code. In the case of a TRANSIENT exception +due to a failed location forward, the exception propagated to the +application is the original exception that caused the +TRANSIENT (e.g. a COMM_FAILURE or +OBJECT_NOT_EXIST), rather than the TRANSIENT +exception1.

The following sample code installs a simple exception handler for all +objects and for a specific object:

CORBA::Boolean my_transient_handler1(void* cookie, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex) +{ + cerr << "transient handler 1 called." << endl; + return true; // retry immediately. +} + +CORBA::Boolean my_transient_handler2(void* cookie, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex) +{ + cerr << "transient handler 2 called." << endl; + return false; // do not retry. +} + + +static Echo_ptr myobj; + +void installhandlers() +{ + omniORB::installTransientExceptionHandler(0, my_transient_handler1); + // All proxy objects will call my_transient_handler1 from now on. + + omniORB::installTransientExceptionHandler(myobj, 0, my_transient_handler2); + // The proxy object of myobj will call my_transient_handler2 from now on. +}
+

4.7.3  CORBA::TIMEOUT

+

When a call timeout occurs, by default the ORB throws +CORBA::TIMEOUT. The default behaviour of the proxy objects is +to propagate this exception to the application. Applications can +override the default behaviour by installing their own exception +handlers. The API to do so is summarised below:

typedef CORBA::Boolean +(*timeoutExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TIMEOUT& ex); + +void +installTimeoutExceptionHandler(void* cookie, + timeoutExceptionHandler_t fn); + +void +installTimeoutExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + timeoutExceptionHandler_t fn);

The functions are equivalent to their counterparts for +CORBA::TRANSIENT.

omniORB version 4.1 and earlier did not have the CORBA::TIMEOUT +exception, and threw CORBA::TRANSIENT instead. If the +throwTransientOnTimeout configuration parameter is set to +1, omniORB 4.2 reverts to this behaviour, and calls the +transient exception handler instead of the timeout exception handler.

The timeout exception handler is used when a CORBA call times out. It +is not called when an AMI poller operation throws +CORBA::TIMEOUT. In that situation, the exception is always +propagated to the caller.

+

4.7.4  CORBA::COMM_FAILURE

+

If the ORB has successfully contacted a server at some point, and access to it subsequently fails (and the condition for -TRANSIENT described above does not occur), the ORB raises a -CORBA::COMM_FAILURE exception.

The default behaviour of the proxy objects is to propagate this +TRANSIENT described above does not occur), the ORB raises a +CORBA::COMM_FAILURE exception.

The default behaviour of the proxy objects is to propagate this exception to the application. Applications can override the default behaviour by installing their own exception handlers. The API to do so -is summarised below:

typedef CORBA::Boolean -(*commFailureExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::COMM_FAILURE& ex); - -void -installCommFailureExceptionHandler(void* cookie, - commFailureExceptionHandler_t fn); - -void -installCommFailureExceptionHandler(CORBA::Object_ptr obj, - void* cookie, - commFailureExceptionHandler_t fn);

The functions are equivalent to their counterparts for -CORBA::TRANSIENT.

4.7.4  CORBA::SystemException

If a system exceptions other than TRANSIENT or -COMM_FAILURE occurs, the default behaviour of the proxy +is summarised below:

typedef CORBA::Boolean +(*commFailureExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::COMM_FAILURE& ex); + +void +installCommFailureExceptionHandler(void* cookie, + commFailureExceptionHandler_t fn); + +void +installCommFailureExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + commFailureExceptionHandler_t fn);

The functions are equivalent to their counterparts for +CORBA::TRANSIENT.

+

4.7.5  CORBA::SystemException

+

If a system exceptions other than TRANSIENT, TIMEOUT or +COMM_FAILURE occurs, the default behaviour of the proxy objects is to propagate this exception to the application. Applications can override the default behaviour by installing their -own exception handlers. The API to do so is summarised below:

typedef CORBA::Boolean -(*systemExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::SystemException& ex); - -void -installSystemExceptionHandler(void* cookie, - systemExceptionHandler_t fn); - -void -installSystemExceptionHandler(CORBA::Object_ptr obj, - void* cookie, - systemExceptionHandler_t fn);

The functions are equivalent to their counterparts for -CORBA::TRANSIENT.

4.8  Location forwarding

-

Any CORBA operation invocation can return a LOCATION_FORWARD +own exception handlers. The API to do so is summarised below:

typedef CORBA::Boolean +(*systemExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::SystemException& ex); + +void +installSystemExceptionHandler(void* cookie, + systemExceptionHandler_t fn); + +void +installSystemExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + systemExceptionHandler_t fn);

The functions are equivalent to their counterparts for +CORBA::TRANSIENT.

+

4.7.6  Extended exception handlers

+

New in omniORB 4.2, each of the exception handlers described above +also has an ‘extended’ form in which the exception handler takes two +additional parameters, the object reference being invoked upon, and a +string containing the name of the operation invoked. e.g.:

namespace omniORB { + + typedef CORBA::Boolean + (*transientExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex, + CORBA::Object_ptr obj, + const char* op); + + void + installTransientExceptionHandlerExt(void* cookie, + transientExceptionHandlerExt_t fn); + + void + installTransientExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandlerExt_t fn); +}

Note that the operation parameter can sometimes be null. By default, +omniORB sends a LocateRequest message prior to the first +operation invocation on an object reference. That LocateRequest +is subject to the same exception handling mechanism as a normal +operation invocation, but it is represented with a null operation +name. Exception handler code that uses the operation name must +correctly handle a null operation name pointer.

+

4.8  Location forwarding

+

+

Any CORBA operation invocation can return a LOCATION_FORWARD message to the caller, indicating that it should retry the invocation on a new object reference. The standard allows ServantManagers to -trigger LOCATION_FORWARDs by raising the -PortableServer::ForwardRequest exception, but it does not +trigger LOCATION_FORWARDs by raising the +PortableServer::ForwardRequest exception, but it does not provide a similar mechanism for normal servants. omniORB provides the -omniORB::LOCATION_FORWARD exception for this purpose. It -can be thrown by any operation implementation.

namespace omniORB { - class LOCATION_FORWARD { - public: - LOCATION_FORWARD(CORBA::Object_ptr objref); - }; -};

The exception object consumes the object reference it is -passed.


-1
This is a change from omniORB 4.0 and earlier, -where it was the TRANSIENT exception that was propagated to the -application. -
-
-Previous -Up -Next - - +omniORB::LOCATION_FORWARD exception for this purpose. It +can be thrown by any operation implementation.

namespace omniORB { + class LOCATION_FORWARD { + public: + LOCATION_FORWARD(CORBA::Object_ptr objref); + }; +};

The exception object consumes the object reference it is +passed.

+
+1
This is different from omniORB 4.0 and earlier, +where it was the TRANSIENT exception that was propagated to +the application.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB005.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB005.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB005.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB005.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,211 +1,333 @@ - - - - - - - -The IDL compiler - - -Previous -Up -Next -
-

Chapter 5  The IDL compiler

-

omniORB’s IDL compiler is called omniidl. It consists of a generic + + + + + + +The IDL compiler + + +Previous +Up +Next +


+

Chapter 5  The IDL compiler

+

+

omniORB’s IDL compiler is called omniidl. It consists of a generic front-end parser written in C++, and a number of back-ends written in Python. omniidl is very strict about IDL validity, so you may find that it reports errors in IDL which compiles fine with other IDL -compilers.

The general form of an omniidl command line is:

omniidl [options] -b<back-end> [back-end options] <file 1> <file 2>

5.1  Common options

The following options are common to all back-ends:

- - - - - - - - - - - - - - - - - - - - -
--bback-endRun the specified back-end. For the C++ ORB, use -bcxx.
--Dname[=value]Define name for the preprocessor.
--UnameUndefine name for the preprocessor.
--IdirInclude dir in the preprocessor search path.
--EOnly run the preprocessor, sending its output to stdout.
--YcmdUse cmd as the preprocessor, rather than the normal C -preprocessor.
--NDo not run the preprocessor.
--TUse a temporary file, not a pipe, for preprocessor output.
--Wparg[,arg…]Send arguments to the preprocessor.
--Wbarg[,arg…]Send arguments to the back-end.
--nfDo not warn about unresolved forward declarations.
--kKeep comments after declarations, to be used by some back-ends.
--KKeep comments before declarations, to be used by some back-ends.
--CdirChange directory to dir before writing output files.
--dDump the parsed IDL then exit, without running a back-end.
--pdirUse dir as a path to find omniidl back-ends.
--VPrint version information then exit.
--uPrint usage information.
--vVerbose: trace compilation stages.
-

Most of these options are self explanatory, but some are not -so obvious.

5.1.1  Preprocessor interactions

IDL is processed by the C preprocessor before omniidl parses it. +compilers.

The general form of an omniidl command line is:

omniidl [options] -b<back-end> [back-end options] <file> +
+

5.1  Common options

+

The following options are common to all back-ends:

+ + + + + + + + + + + + + + + + + + + + +
+-bback-end +Run the specified back-end. For the C++ ORB, use -bcxx.
+-Dname[=value] +Define name for the preprocessor.
+-Uname +Undefine name for the preprocessor.
+-Idir +Include dir in the preprocessor search path.
+-E +Only run the preprocessor, sending its output to stdout.
+-Ycmd +Use cmd as the preprocessor, rather than the normal C +preprocessor.
+-N +Do not run the preprocessor.
+-T +Use a temporary file, not a pipe, for preprocessor output.
+-Wparg[,arg…] +Send arguments to the preprocessor.
+-Wbarg[,arg…] +Send arguments to the back-end.
+-nf +Do not warn about unresolved forward declarations.
+-k +Keep comments after declarations, to be used by some back-ends.
+-K +Keep comments before declarations, to be used by some back-ends.
+-Cdir +Change directory to dir before writing output files.
+-d +Dump the parsed IDL then exit, without running a back-end.
+-pdir +Use dir as a path to find omniidl back-ends.
+-V +Print version information then exit.
+-u +Print usage information.
+-v +Verbose: trace compilation stages.
+

Most of these options are self explanatory, but some are not +so obvious.

+

5.1.1  Preprocessor interactions

+

IDL is processed by the C preprocessor before omniidl parses it. omniidl always uses the GNU C preprocessor (which it builds with the -name omnicpp). The -D, -U, and -I +name omnicpp). The -D, -U, and -I options are just sent to the preprocessor. Note that the current directory is not on the include search path by default—use -‘-I.’ for that. The -Y option can be used to +‘-I.’ for that. The -Y option can be used to specify a different preprocessor to omnicpp. Beware that line directives inserted by other preprocessors are likely to confuse -omniidl.

5.1.1.1  Windows 9x

The output from the C preprocessor is normally fed to the omniidl +omniidl.

+

5.1.1.1  Ancient history: Windows 9x

+

The output from the C preprocessor is normally fed to the omniidl parser through a pipe. On some Windows 98 machines (but not all!) the pipe does not work, and the preprocessor output is echoed to the screen. When this happens, the omniidl parser sees an empty file, and produces useless stub files with strange long names. To avoid the -problem, use the ‘-T’ option to create a temporary file -between the two stages.

5.1.2  Forward-declared interfaces

If you have an IDL file like:

interface I; -interface J { - attribute I the_I; -};

then omniidl will normally issue a warning:

  test.idl:1: Warning: Forward declared interface `I' was never
+problem, use the ‘-T’ option to create a temporary file
+between the two stages.

+

5.1.2  Forward-declared interfaces

+

If you have an IDL file like:

interface I; +interface J { + attribute I the_I; +};

then omniidl will normally issue a warning:

  test.idl:1: Warning: Forward declared interface `I' was never
   fully defined
-

It is illegal to declare such IDL in isolation, but it -is valid to define interface I in a separate file. If +

It is illegal to declare such IDL in isolation, but it +is valid to define interface I in a separate file. If you have a lot of IDL with this sort of construct, you will drown -under the warning messages. Use the -nf option to suppress -them.

5.1.3  Comments

By default, omniidl discards comments in the input IDL. However, with -the -k and -K options, it preserves the comments +under the warning messages. Use the -nf option to suppress +them.

+

5.1.3  Comments

+

By default, omniidl discards comments in the input IDL. However, with +the -k and -K options, it preserves the comments for use by the back-ends. The C++ back-end ignores this information, -but it is relatively easy to write new back-ends which do make -use of comments.

The two different options relate to how comments are attached to -declarations within the IDL. Given IDL like:

interface I { - void op1(); - // A comment - void op2(); -};

the -k flag will attach the comment to op1(); -the -K flag will attach it to op2().

5.2  C++ back-end options

When you specify the C++ back-end (with -bcxx), the -following -Wb options are available. Note that the --Wb options must be specified after the --bcxx option, so omniidl knows which back-end to give the -arguments to.

- - - - - - - - - - - - - - - -
--Wbh=suffixUse suffix for generated header files. Default -‘.hh’.
--Wbs=suffixUse suffix for generated stub files. Default -‘SK.cc.’
--Wbd=suffixUse suffix for generated dynamic files. Default -‘DynSK.cc.’
--WbaGenerate stubs for TypeCode and Any.
--WbinlineOutput stubs for #included IDL files in line with the -main file.
--WbtpGenerate ‘tie’ implementation skeletons.
--WbtfGenerate flattened ‘tie’ implementation skeletons.
--Wbsplice-modulesSplice together multiply-opened modules into one.
--WbexampleGenerate example implementation code.
--WbFGenerate code fragments (for experts only).
--WbBOAGenerate BOA compatible skeletons.
--WboldGenerate old CORBA 2.1 signatures for skeletons.
--Wbold_prefixMap C++ reserved words with prefix ‘_’ rather than -‘_cxx_’.
--Wbkeep_inc_pathPreserve IDL ‘#include’ paths in generated - ‘#include’ directives.
--Wbuse_quotesUse quotes in ‘#include’ directives -(e.g. "foo" rather than <foo>.)

Again, most of these are self-explanatory.

5.2.1  Stub / skeleton files

By default, omniidl separates the normal stub and skeleton file (the -SK.cc file) from the ‘dynamic’ stubs (the DynSK.cc +but it is relatively easy to write new back-ends which do make +use of comments.

The two different options relate to how comments are attached to +declarations within the IDL. Given IDL like:

interface I { + void op1(); + // A comment + void op2(); +};

the -k flag will attach the comment to op1(); +the -K flag will attach it to op2().

+

5.2  C++ back-end options

+

+

When you specify the C++ back-end (with -bcxx), the +following -Wb options are available. Note that the +-Wb options must be specified after the +-bcxx option, so omniidl knows which back-end to give the +arguments to.

+ + + + + + + + + + + + + + + + + + + +
+-Wbh=suffix +Use suffix for generated header files. Default +‘.hh’.
+-Wbs=suffix +Use suffix for generated stub files. Default +‘SK.cc.’
+-Wbd=suffix +Use suffix for generated dynamic files. Default +‘DynSK.cc.’
+-Wba +Generate stubs for TypeCode and Any.
+-Wbtp +Generate ‘tie’ implementation skeletons.
+-Wbtf +Generate flattened ‘tie’ implementation skeletons.
+-Wbami +Generate AMI types and operations.
+-Wbexample +Generate example implementation code.
+-Wbinline +Output stubs for #included IDL files in line with the +main file.
+-Wbuse-quotes +Use quotes in ‘#include’ directives +(e.g. "foo" rather than <foo>.)
+-Wbkeep-inc-path +Preserve IDL ‘#include’ paths in generated + ‘#include’ directives.
+-Wbvirtual-objref +Use virtual functions for object reference operations.
+-Wbimpl-mapping +Use the ‘implementation’ mapping for object reference methods.
+-Wbsplice-modules +Splice together multiply-opened modules into one.
+-WbBOA +Generate BOA compatible skeletons.
+-Wbold +Generate old CORBA 2.1 signatures for skeletons.
+-Wbold-prefix +Map C++ reserved words with prefix ‘_’ rather than +‘_cxx_’.
+-WbF +Generate code fragments (only for use during omniORB build).
+
+

5.2.1  Optional code generation options

+

By default, omniidl generates the minimum code required to provide all +the IDL-defined types and interfaces, which is sufficient for the +majority of applications. Additional code can also be generated, for +various purposes:

+

5.2.1.1  Any and TypeCode

+

To generate TypeCodes and Any insertion operators, give the +-Wba option. See chapter 10 for details.

By default, omniidl separates the normal stub and skeleton file (the +SK.cc file) from these ‘dynamic’ stubs (the DynSK.cc file), so applications that do not need support for Any and TypeCode for a particular IDL file do not waste space with unnecessary -definitions. It is possible to output both the normal stubs and -the dynamic stubs to a single file, by simply specifying the same +definitions. It is possible to output both the normal stubs and the +dynamic stubs to a single file, by simply specifying the same extension for both files. This command places both the normal stubs -and the dynamic stubs in aSK.cc:

-omniidl -bcxx -Wba -Wbd=SK.cc a.idl -

5.2.2  Module splicing

On ancient C++ compilers without namespace support, IDL modules map to +and the dynamic stubs in aSK.cc:

+omniidl -bcxx -Wba -Wbd=SK.cc a.idl +
+

5.2.1.2  Tie templates

+

As described in section 2.11, tie templates can be used to +provide servant implementations, instead of using inheritance from the +normal skeleton classes. To generate tie templates, give the +-Wbtp option to omniidl.

When using a pre-namespace C++ compiler, IDL modules are mapped to C++ +classes, which causes a problem with tie templates. The C++ mapping +says that for the interface M::I, the C++ tie template class +should be named POA_M::I_tie. However, since template classes +cannot be declared inside other classes, this naming scheme cannot be +used if POA_M is a class.

The C++ mapping has an alternative option of ‘flattened’ tie class +names, in which the template class is declared at global scope with +the name POA_M_I_tie. i.e. all occurrences of ‘::’ +are replaced by ‘_’. Generate the flattened ties using the +-Wbtf command line argument.

+

5.2.1.3  Asynchronous Method Invocation

+

Generate asynchronous invocation operations and the various types +required by AMI by specifying -Wbami. See +chapter 12 for details.

+

5.2.1.4  Example implementations

+

If you use the -Wbexample flag, omniidl will generate an +example implementation file as well as the stubs and skeletons. For +IDL file foo.idl, the example code is written to +foo_i.cc. The example file contains class and method +declarations for the operations of all interfaces in the IDL file, +along with a main() function which creates an instance of each +object. You still have to fill in the operation implementations, of +course.

+

5.2.2  Include file options

+

IDL files regularly #include other files. By default, if file +a.idl says #include <b/c.idl> then the generated +header a.hh has an include of the form #include +<c.idl>, and aSK.cc and aDynSK.cc contain only code +corresponding to the declarations in a.idl.

If the -Wbinline option is provided, all the +#included declarations are generated in a.hh, +aSK.cc and aDynSK.cc, meaning the application code +should only use that single set of files.

If -Wbuse-quotes is specified, then the directive in +a.hh uses quotes rather than angle brackets: +#include "c.idl".

Normally any path details contained in the IDL #include +directive are removed, leaving just the base name. If +-Wbkeep-inc-path is specified, the directive in +a.hh is #include <b/c.idl>.

+

5.2.3  Object reference operations

+

Some of the C++ mapping’s parameter passing rules are problematic in +terms of memory management. For example, if an IDL operation has a +parameter of type inout string, the standard mapping has a C++ +parameter of type char*&. If application code passes a +String_var for the parameter, some C++ compilers choose the +wrong conversion operator and cause a violation of the memory +management rules1.

To avoid this, omniORB uses some helper classes as the parameter types +in object reference operations, meaning that the correct memory +management rules are always followed. Normally, that is invisible to +application code, but occasionally it becomes problematic. One example +is that if a local interface is derived from a normal +unconstrained interface, the C++ mapping of the local interface +derives from the object reference class, and so the base object +reference class must use the standard mapping rather than omniORB’s +usual enhanced mapping. To choose the standard ‘implementation +mapping’, give the -Wbimpl-mapping option to omniidl.

Similarly, omniidl usually uses non-virtual methods in its object +reference classes, since there is no usual need to override them. The +local interface situation also requires method overrides, so omniidl +must be instructed to generate object references as virtual. Use +-Wbvirtual-objref to achieve this.

More details about the local interface mapping can be found in +section 11.8.

+

5.2.4  Module splicing

+

On ancient C++ compilers without namespace support, IDL modules map to C++ classes, and so cannot be reopened. For some IDL, it is possible to ‘splice’ reopened modules on to the first occurrence of the module, so all module definitions are in a single class. It is possible in -this sort of situation:

module M1 { - interface I {}; -}; -module M2 { - interface J { - attribute M1::I ok; - }; -}; -module M1 { - interface K { - attribute I still_ok; - }; -};

but not if there are cross-module dependencies:

module M1 { - interface I {}; -}; -module M2 { - interface J { - attribute M1::I ok; - }; -}; -module M1 { - interface K { - attribute M2::J oh_dear; - }; -};

In both of these cases, the -Wbsplice-modules +this sort of situation:

module M1 { + interface I {}; +}; +module M2 { + interface J { + attribute M1::I ok; + }; +}; +module M1 { + interface K { + attribute I still_ok; + }; +};

but not if there are cross-module dependencies:

module M1 { + interface I {}; +}; +module M2 { + interface J { + attribute M1::I ok; + }; +}; +module M1 { + interface K { + attribute M2::J oh_dear; + }; +};

In both of these cases, the -Wbsplice-modules option causes omniidl to put all of the definitions for module -M1 into a single C++ class. For the first case, this will work -fine. For the second case, class M1::K will contain a reference -to M2::J, which has not yet been defined; the C++ compiler will -complain.

5.2.3  Flattened tie classes

Another problem with mapping IDL modules to C++ classes arises with -tie templates. The C++ mapping says that for the interface -M::I, the C++ tie template class should be named -POA_M::I_tie. However, since template classes cannot be -declared inside other classes, this naming scheme cannot be used with -compilers without namespace support.

The standard solution is to produce ‘flattened’ tie class names, using -the -Wbtf command line argument. With that flag, the -template class is declared at global scope with the name -POA_M_I_tie. i.e. all occurrences of ‘::’ are -replaced by ‘_’.

5.2.4  Generating example implementations

If you use the -Wbexample flag, omniidl will generate an -example implementation file as well as the stubs and skeletons. For -IDL file foo.idl, the example code is written to -foo_i.cc. The example file contains class and method -declarations for the operations of all interfaces in the IDL file, -along with a main() function which creates an instance of each -object. You still have to fill in the operation implementations, of -course.

5.3  Examples

Generate the C++ headers and stubs for a file a.idl:

-omniidl -bcxx a.idl -

Generate with Any support:

-omniidl -bcxx -Wba a.idl -

As above, but also generate Python stubs (assuming omniORBpy -is installed):

-omniidl -bcxx -Wba -bpython a.idl -

Just check the IDL files for validity, generating no output:

-omniidl a.idl b.idl -

-Previous -Up -Next - - +M1 into a single C++ class. For the first case, this will work +fine. For the second case, class M1::K will contain a reference +to M2::J, which has not yet been defined; the C++ compiler will +complain.

+

5.3  Examples

+

Generate the C++ headers and stubs for a file a.idl:

+omniidl -bcxx a.idl +

Generate with Any support:

+omniidl -bcxx -Wba a.idl +

As above, but also generate Python stubs (assuming omniORBpy +is installed):

+omniidl -bcxx -Wba -bpython a.idl +

Just check the IDL files for validity, generating no output:

+omniidl a.idl b.idl +
+
+1
For this reason, the _var types +define an inout() method that ensures use of the correct +conversion and thus avoids this kind of trouble.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB006.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB006.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB006.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB006.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,202 +1,657 @@ - - - + + + + + + +Connection and Thread Management + + +Previous +Up +Next +
+

Chapter 6  Connection and Thread Management

+

+

This chapter describes how omniORB manages threads and network +connections.

+

6.1  Background

+

In CORBA, the ORB is the ‘middleware’ that allows a client to invoke +an operation on an object without regard to its implementation or +location. In order to invoke an operation on an object, a client needs +to ‘bind’ to the object by acquiring its object reference. Such a +reference may be obtained as the result of an operation on another +object (such as a naming service or factory object) or by conversion +from a stringified representation. If the object is in a different +address space, the binding process involves the ORB building a proxy +object in the client’s address space. The ORB arranges for invocations +on the proxy object to be transparently mapped to equivalent +invocations on the implementation object.

For the sake of interoperability, CORBA mandates that all ORBs should +support IIOP as the means to communicate remote invocations over a +TCP/IP connection. IIOP is usually1 +asymmetric with respect to the roles of the parties at the two ends of +a connection. At one end is the client which can only initiate remote +invocations. At the other end is the server which can only receive +remote invocations.

Notice that in CORBA, as in most distributed systems, remote bindings +are established implicitly without application intervention. This +provides the illusion that all objects are local, a property known as +‘location transparency’. CORBA does not specify when such bindings +should be established or how they should be multiplexed over the +underlying network connections. Instead, ORBs are free to implement +implicit binding by a variety of means.

The rest of this chapter describes how omniORB manages network +connections and the programming interface to fine tune the management +policy.

+

6.2  The model

+

omniORB is designed from the ground up to be fully multi-threaded. The +objective is to maximise the degree of concurrency and at the same +time eliminate any unnecessary thread overhead. Another objective is +to minimise the interference by the activities of other threads on the +progress of a remote invocation. In other words, thread ‘cross-talk’ +should be minimised within the ORB. To achieve these objectives, the +degree of multiplexing at every level is kept to a minimum by default.

Minimising multiplexing works well when the system is relatively +lightly loaded. However, when the ORB is under heavy load, it can +sometimes be beneficial to conserve operating system resources such as +threads and network connections by multiplexing at the ORB +level. omniORB has various options that control its multiplexing +behaviour.

+

6.3  Client side behaviour

+

On the client side of a connection, the thread that invokes on a proxy +object drives the GIOP protocol directly and blocks on the connection +to receive the reply. The first time the client makes a call to a +particular address space, the ORB opens a suitable connection to the +remote address space (based on the client transport rule as described +in section 6.7.1). After the reply has been received, +the ORB caches the open network connection, ready for use by another +call.

If two (or more) threads in a multi-threaded client attempt to contact +the same address space simultaneously, there are two different ways to +proceed. The default way is to open another network connection to the +server. This means that neither the client or server ORB has to +perform any multiplexing on the network connections—multiplexing is +performed by the operating system, which has to deal with multiplexing +anyway. The second possibility is for the client to multiplex the +concurrent requests on a single network connection. This conserves +operating system resources (network connections), but means that both +the client and server have to deal with multiplexing issues +themselves.

In the default one call per connection mode, there is a limit to the +number of concurrent connections that are opened, set with the +maxGIOPConnectionPerServer parameter. To tell the ORB +that it may multiplex calls on a single connection, set the +oneCallPerConnection parameter to zero. If the +oneCallPerConnection parameter is set to the default +value of one, and there are more concurrent calls than specified by +maxGIOPConnectionPerServer, calls block waiting for connections +to become free.

Note that some server-side ORBs, including omniORB versions before +version 4.0, are unable to deal with concurrent calls multiplexed on a +single connection, so they serialise the calls. It is usually best to +keep to the default mode of opening multiple connections.

+

6.3.1  Client side timeouts

+

+

omniORB can associate a timeout with a call, meaning that if the call +takes too long a CORBA::TIMEOUT exception2 is +thrown. Timeouts can be set for the whole process, for a specific +thread, or for a specific object reference.

Timeouts are set using this API:

namespace omniORB { + void setClientCallTimeout(CORBA::ULong millisecs); + void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs); + void setClientThreadCallTimeout(CORBA::ULong millisecs); + void setClientConnectTimeout(CORBA::ULong millisecs); +};

setClientCallTimeout() sets either the global timeout or the +timeout for a specific object reference. +setClientThreadCallTimeout() sets the timeout for the calling +thread. The calling thread must have an omni_thread associated +with it. Setting any timeout value to zero disables it.

Accessing per-thread state is a relatively expensive operation, so per +thread timeouts are disabled by default. The +supportPerThreadTimeOut parameter must be set true to +enable them.

To choose the timeout value to use for a call, the ORB first looks to +see if there is a timeout for the object reference, then to the +calling thread, and finally to the global timeout.

When a client has no existing connection to communicate with a server, +it must open a new connection before performing the +call. setClientConnectTimeout() sets an overriding timeout for +cases where a new connection must be established. The effect of the +connect timeout depends upon whether the connect timeout is greater +or less than the timeout that would otherwise be used.

As an example, imagine that the usual call timeout is 10 seconds:

Connect timeout > usual timeout

+

If the connect timeout is set to 20 seconds, then a call that +establishes a new connection will be permitted 20 seconds before it +times out. Subsequent calls using the same connection have the normal +10 second timeout. If establishing the connection takes 8 seconds, +then the call itself takes 5 seconds, the call succeeds despite having +taken 13 seconds in total, longer than the usual timeout.

This kind of configuration is good when connections are slow to be +established.

If an object reference has multiple possible endpoints available, and +connecting to the first endpoint times out, only that one endpoint +will have been tried before an exception is raised. However, once the +timeout has occurred, the object reference will switch to use the next +endpoint. If the application attempts to make another call, it will +use the next endpoint.

Connect timeout < usual timeout

+

If the connect timeout is set to 2 seconds, the actual network-level +connect is only permitted to take 2 seconds. As long as the connection +is established in less than 2 seconds, the call can proceed. The 10 +second call timeout still applies to the time taken for the whole call +(including the connection establishment). So, if establishing the +connection takes 1.5 seconds, and the call itself takes 9.5 seconds, +the call will time out because although it met the connection timeout, +it exceeded the 10 second total call timeout. On the other hand, if +establishing the connection takes 3 seconds, the call will fail after +only 2 seconds, since only 2 seconds are permitted for the connect.

If an object reference has multiple possible endpoints available, the +client will attempt to connect to them in turn, until one succeeds. +The connect timeout applies to each connection attempt. So with a +connect timeout of 2 seconds, the client will spend up to 2 seconds +attempting to connect to the first address and then, if that fails, up +to 2 seconds trying the second address, and so on. The 10 second +timeout still applies to the call as a whole, so if the total time +taken on timed-out connection attempts exceeds 10 seconds, the call +will time out.

This kind of configuration is useful where calls may take a long time +to complete (so call timeouts are long), but a fast indication of +connection failure is required.

+

6.4  Server side behaviour

+

The server side has two primary modes of operation: thread per +connection and thread pooling. It is able to dynamically transition +between the two modes, and it supports a hybrid scheme that behaves +mostly like thread pooling, but has the same fast turn-around for +sequences of calls as thread per connection.

+

6.4.1  Thread per connection mode

+

In thread per connection mode (the default, and the only option in +omniORB versions before 4.0), each connection has a single thread +dedicated to it. The thread blocks waiting for a request. When it +receives one, it unmarshals the arguments, makes the up-call to the +application code, marshals the reply, and goes back to watching the +connection. There is thus no thread switching along the call chain, +meaning the call is very efficient.

As explained above, a client can choose to multiplex multiple +concurrent calls on a single connection, so once the server has +received the request, and just before it makes the call into +application code, it marks the connection as ‘selectable’, meaning +that another thread should watch it to see if any other requests +arrive. If they do, extra threads are dispatched to handle the +concurrent calls. GIOP 1.2 actually allows the argument data for +multiple calls to be interleaved on a connection, so the unmarshalling +code has to handle that too. As soon as any multiplexing occurs on the +connection, the aim of removing thread switching cannot be met, and +there is inevitable inefficiency due to thread switching.

The maxServerThreadPerConnection parameter can be set to limit +the number of threads that can be allocated to a single connection +containing concurrent calls. Setting the parameter to 1 mimics the +behaviour of omniORB versions before 4.0, that did not support +calls multiplexed on one connection.

+

6.4.2  Thread pool mode

+

+

In thread pool mode, selected by setting the +threadPerConnectionPolicy parameter to zero, a single thread +watches all incoming connections. When a call arrives on one of them, +a thread is chosen from a pool of threads, and set to work +unmarshalling the arguments and performing the up-call. There is +therefore at least one thread switch for each call.

The thread pool is not pre-initialised. Instead, threads are started +on demand, and idle threads are stopped after a period of inactivity. +The maximum number of threads that can be started in the pool is set +with the maxServerThreadPoolSize parameter. The default +is 100.

A common pattern in CORBA applications is for a client to make several +calls to a single object in quick succession. To handle this situation +most efficiently, the default behaviour is to not return a thread to +the pool immediately after a call is finished. Instead, it is set to +watch the connection it has just served for a short while, mimicking +the behaviour in thread per connection mode. If a new call comes in +during the watching period, the call is dispatched without any thread +switching, just as in thread per connection mode. Of course, if the +server is supporting a very large number of connections (more than the +size of the thread pool), this policy can delay a call coming from +another connection. If the threadPoolWatchConnection +parameter is set to zero, connection watching is disabled and threads +return to the pool immediately after finishing a single request.

In the face of multiplexed calls on a single connection, multiple +threads from the pool can be dispatched for one connection, just as in +thread per connection mode. With threadPoolWatchConnection set +to the default value of 1, only the last thread servicing a connection +will watch it when it finishes a request. Setting the parameter to a +larger number allows the last n connections to watch the +connection.

+

6.4.3  Policy transition

+

If the server is dealing with a relatively small number of +connections, it is most efficient to use thread per connection mode. +If the number of connections becomes too large, however, operating +system limits on the number of threads may cause a significant +slowdown, or even prevent the acceptance of new connections +altogether.

To give the most efficient response in all circumstances, omniORB +allows a server to start in thread per connection mode, and transition +to thread pooling if many connections arrive. This is controlled with +the threadPerConnectionUpperLimit and +threadPerConnectionLowerLimit parameters. The upper limit must +always be larger than the lower limit. The upper limit chooses the +number of connections at which time the ORB transitions to thread pool +mode; the lower limit selects the point at which the transition back +to thread per connection is made.

For example, setting the upper limit to 50 and the lower limit to 30 +would mean that the first 49 connections would receive dedicated +threads. The 50th to arrive would trigger thread pooling. All future +connections to arrive would make use of threads from the pool. Note +that the existing dedicated threads continue to service their +connections until the connections are closed. If the number of +connections falls below 30, thread per connection is reactivated and +new connections receive their own dedicated threads (up to the limit +of 50 again). Once again, existing connections in thread pool mode +stay in that mode until they are closed.

+

6.5  Idle connection shutdown

+

+

It is wasteful to leave a connection open when it has been left unused +for a considerable time. Too many idle connections could block out new +connections when the system runs out of spare communication channels. +For example, most platforms have a limit on the number of file handles +a process can open. Many platforms have a very small default limit +like 64. The value can often be increased to a maximum of a thousand +or more by changing the ‘ulimit’ in the shell.

Every so often, a thread scans all open connections to see which are +idle. The scanning period (in seconds) is set with the +scanGranularity parameter. The default is 5 seconds.

Outgoing connections (initiated by clients) and incoming connections +(initiated by servers) have separate idle timeouts. The timeouts are +set with the outConScanPeriod and inConScanPeriod +parameters respectively. The values are in seconds, and must be a +multiple of the scan granularity.

Beware that setting outConScanPeriod or inConScanPeriod +to be equal to (or less than) scanGranularity means that +connections are considered candidates for closure immediately after +they are opened. That can mean that the connections are closed before +any calls have been sent through them. If oneway calls are used, such +connection closure can result in silent loss of calls.

+

6.5.1  Interoperability Considerations

+

The IIOP specification allows both the client and the server to +shutdown a connection unilaterally. When one end is about to shutdown +a connection, it should send a CloseConnection message to the +other end. It should also make sure that the message will reach the +other end before it proceeds to shutdown the connection.

The client should distinguish between an orderly and an abnormal +connection shutdown. When a client receives a CloseConnection +message before the connection is closed, the condition is an orderly +shutdown. If the message is not received, the condition is an +abnormal shutdown. In an abnormal shutdown, the ORB should raise a +COMM_FAILURE exception whereas in an orderly shutdown, the ORB +should not raise an exception and should try to re-establish a +new connection transparently.

omniORB implements these semantics completely. However, it is known +that some ORBs are not (yet) able to distinguish between an orderly +and an abnormal shutdown. Usually this is manifested as the client in +these ORBs seeing a COMM_FAILURE occasionally when connected +to an omniORB server. The work-around is either to catch the exception +in the application code and retry, or to turn off the idle connection +shutdown inside the omniORB server.

+

6.6  Transports and endpoints

+

+

omniORB can support multiple network transports. All platforms +(usually) have a TCP transport available. Unix platforms support a +Unix domain socket transport. Platforms with the OpenSSL library +available can support an SSL transport.

Servers must be configured in two ways with regard to transports: the +transports and interfaces on which they listen, and the details that +are published in IORs for clients to see. Usually the published +details will be the same as the listening details, but there are times +when it is useful to publish different information.

Details are selected with the endPoint family of parameters. +The simplest is plain endPoint, which chooses a transport and +interface details, and publishes the information in IORs. Endpoint +parameters are in the form of URIs, with a scheme name of +‘giop:’, followed by the transport name. Different transports +have different parameters following the transport.

TCP endpoints have the format:

+giop:tcp:<host>:<port> +

The host must be a valid host name or IP address for the +server machine. It determines the network interface on which the +server listens. The port selects the TCP port to listen on, which must +be unoccupied. Either the host or port, or both can be left empty. If +the host is empty, the ORB publishes the IP address of the first +non-loopback network interface it can find (or the loopback if that is +the only interface), but listens on all network interfaces. If +the port is empty, the operating system chooses an ephemeral +port.

Multiple TCP endpoints can be selected, either to specify multiple +network interfaces on which to listen, or (less usefully) to select +multiple TCP ports on which to listen.

If no endPoint parameters are set, the ORB assumes a single +parameter of giop:tcp::, meaning IORs contain the address of +the first non-loopback network interface, the ORB listens on all +interfaces, and the OS chooses a port number.

SSL endpoints have the same format as TCP ones, except ‘tcp’ +is replaced with ‘ssl’. Unix domain socket endpoints have the +format:

+giop:unix:<filename> +

where the filename is the name of the socket within the +filesystem. If the filename is left blank, the ORB chooses a name +based on the process id and a timestamp.

To listen on an endpoint without publishing it in IORs, specify it +with the endPointNoPublish configuration parameter. See below +for more details about endpoint publishing.

+

6.6.1  Port ranges

+

Sometimes it is useful to restrict a server to listen on one of a +range of ports, rather than pinning it to one particular port or +allowing the OS to choose an ephemeral port. omniORB 4.2 introduces +the ability to specify a range of ports using a hyphen. e.g. to +listen on a port between 5000 and 5010 inclusive:

+giop:tcp::5000-5010 +

omniORB randomly chooses a port in the range. If it finds that the +chosen port is already occupied, it keeps trying different ports until +it finds a free one. If all the ports in the range are occupied, it +throws CORBA::INITIALIZE.

+

6.6.2  IPv6

+

On platforms where it is available, omniORB supports IPv6. On most +Unix platforms, IPv6 sockets accept both IPv6 and IPv4 connections, so +omniORB’s default giop:tcp:: endpoint accepts both IPv4 and +IPv6 connections. On Windows versions before Windows Vista, each +socket type only accepts incoming connections of the same type, so an +IPv6 socket cannot be used with IPv4 clients. For this reason, the +default giop:tcp:: endpoint only listens for IPv4 connections. +Since endpoints with a specific host name or address only listen on a +single network interface, they are inherently limited to just one +protocol family.

To explicitly ask for just IPv4 or just IPv6, an endpoint with the +wildcard address for the protocol family should be used. For IPv4, the +wildcard address is ‘0.0.0.0’, and for IPv6 it is ‘::’. +So, to listen for IPv4 connections on all IPv4 network interfaces, use +an endpoint of:

+giop:tcp:0.0.0.0: +

All IPv6 addresses contain colons, so the address portion in +URIs must be contained within [] characters. Therefore, to +listen just for IPv6 connections on all IPv6 interfaces, use the +somewhat cryptic:

+giop:tcp:[::]: +

To listen for both IPv4 and IPv6 connections on Windows +versions prior to Vista, both endpoints must be explicitly provided.

+

6.6.2.1  Link local addresses

+

In IPv6, all network interfaces are assigned a link local +address, starting with the digits fe80. The link local address +is only valid on the same ‘link’ as the interface, meaning directly +connected to the interface, or possibly on the same subnet, depending +on how the network is switched. To connect to a server’s link local +address, a client has to know which of its network interfaces is on +the same link as the server. Since there is no way for omniORB to know +which local interface a remote link local address may be connected to, +and in extreme circumstances may even end up contacting the wrong +server if it picks the wrong interface, link local addresses are not +considered valid. Servers do not publish link local addresses in their +IORs.

+

6.6.3  Endpoint publishing

+

For clients to be able to connect to a server, the server publishes +endpoint information in its IORs (Interoperable Object References). +Normally, omniORB publishes the first available address for each of +the endpoints it is listening on.

The endpoint information to publish is determined by the +endPointPublish configuration parameter. It contains a +comma-separated list of publish rules. The rules are applied in turn +to each of the configured endpoints; if a rule matches an endpoint, it +causes one or more endpoints to be published.

The following core rules are supported:

+ + + + + +
addrthe first natural address of the endpoint
ipv4the first IPv4 address of a TCP or SSL endpoint
ipv6the first IPv6 address of a TCP or SSL endpoint
namethe first address that can be resolved to a name
hostnamethe result of the gethostname() system call
fqdnthe fully-qualified domain name

The core rules can be combined using the vertical bar operator to +try several rules in turn until one succeeds. e.g:

+
name|ipv6|ipv4the name of the endpoint if it has one; + failing that, its first IPv6 address; + failing that, its first IPv4 address. +

Multiple rules can be combined using the comma operator to +publish more than one endpoint. e.g.

+
name,addrthe name of the endpoint (if it has one), +followed by its first address. +

For endpoints with multiple addresses (e.g. TCP endpoints on +multi-homed machines), the all() manipulator causes all +addresses to be published. e.g.:

+ + + + +
all(addr)all addresses are published
all(name)all addresses that resolve to names are published
all(name|addr)all addresses are published by name if they have +one, address otherwise.
all(name,addr)all addresses are published by name (if they +have one), and by address.
all(name), all(addr)first the names of all addresses are published, +followed by all the addresses.

A specific endpoint can be published by giving its endpoint URI, +even if the server is not listening on that endpoint. e.g.:

+ +
giop:tcp:not.my.host:12345
giop:unix:/not/my/socket-file

If the host or port number for a TCP or SSL URI are missed out, +they are filled in with the details from each listening TCP/SSL +endpoint. This can be used to publish a different name for a +TCP/SSL endpoint that is using an ephemeral port, for example.

omniORB 4.0 supported two options related to endpoint publishing that +are superseded by the endPointPublish parameter, and so are now +deprecated. Setting endPointPublishAllIFs to 1 is equivalent to +setting endPointPublish to ‘all(addr)’. The +endPointNoListen parameter is equivalent to adding endpoint +URIs to the endPointPublish parameter.

+

6.7  Connection selection and acceptance

+

In the face of IORs containing details about multiple different +endpoints, clients have to know how to choose the one to use to +connect a server. Similarly, servers may wish to restrict which +clients can connect to particular transports. This is achieved with +transport rules.

+

6.7.1  Client transport rules

+

+

The clientTransportRule parameter is used to filter and +prioritise the order in which transports specified in an IOR are +tried. Each rule has the form:

+<address mask> [action]+ +

The address mask can be one of

+ + + + +
1.localhostThe address of this machine
+2.w.x.y.z/m1.m2.m3.m4An IPv4 address +with bits selected by the mask, e.g. + 172.16.0.0/255.240.0.0
+3.w.x.y.z/prefixlenAn IPv4 address with +prefixlen significant bits, e.g. + 172.16.2.0/24
+4.a:b:c:d:e:f:g:h/prefixlenAn IPv6 +address with prefixlen significant bits, e.g. + 3ffe:505:2:1::/64
+5.*Wildcard that matches any address

The action is one or more of the following:

+ + + + +
1.noneDo not use this address
2.tcpUse a TCP transport
3.sslUse an SSL transport
4.unixUse a Unix socket transport
5.bidirConnections to this address can be used +bidirectionally (see section 6.8)

The transport-selecting actions form a prioritised list, so +an action of ‘unix,ssl,tcp’ means to use a Unix transport if +there is one, failing that a SSL transport, failing that a TCP +transport. In the absence of any explicit rules, the client uses the +implicit rule of ‘* unix,ssl,tcp’.

If more than one rule is specified, they are prioritised in the order +they are specified. For example, the configuration file might contain:

  clientTransportRule = 192.168.1.0/255.255.255.0  unix,tcp
+  clientTransportRule = 172.16.0.0/255.240.0.0     unix,tcp
+                      =       *                    none
+

This would be useful if there is a fast network +(192.168.1.0) which should be used in preference to another network +(172.16.0.0), and connections to other networks are not permitted at +all.

In general, the result of filtering the endpoint specifications in an +IOR with the client transport rule will be a prioritised list of +transports and networks. (If the transport rules do not prioritise one +endpoint over another, the order the endpoints are listed in the IOR +is used.) When trying to contact an object, the ORB tries its +possible endpoints in turn, until it finds one with which it can +contact the object. Only after it has unsuccessfully tried all +permissible endpoints will it raise a TRANSIENT exception to +indicate that the connect failed.

+

6.7.2  Server transport rules

+

+

Server transport rules have the same format as client transport +rules. Rather than being used to select which of a set of ways to +contact a machine, they are used to determine whether or not to accept +connections from particular clients. In this example, we only allow +connections from our intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
+                      = 172.16.0.0/255.240.0.0     tcp,ssl
+                      = *                          none
+

And in this one, we accept only SSL connections if the +client is not on the intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
+                      = 172.16.0.0/255.240.0.0     tcp,ssl
+                      = *                          ssl,bidir
+

In the absence of any explicit rules, the server uses the +implicit rule of ‘* unix,ssl,tcp’, meaning any kind of +connection is accepted from any client.

+

6.8  Bidirectional GIOP

+

+

omniORB supports bidirectional GIOP, which allows callbacks to be made +using a connection opened by the original client, rather than the +normal model where the server opens a new connection for the callback. +This is important for negotiating firewalls, since they tend not to +allow connections back on arbitrary ports.

There are several steps required for bidirectional GIOP to be enabled +for a callback. Both the client and server must be configured +correctly. On the client side, these conditions must be met:

  • The offerBiDirectionalGIOP parameter must be set to true. +
  • The client transport rule for the target server must contain the +bidir action. +
  • The POA containing the callback object (or objects) must have +been created with a BidirectionalPolicy value of +BOTH.

On the server side, these conditions must be met:

  • The acceptBiDirectionalGIOP parameter must be set to true. +
  • The server transport rule for the requesting client must contain +the bidir action. +
  • The POA hosting the object contacted by the client must have +been created with a BidirectionalPolicy value of +BOTH.
+

6.9  TLS / SSL transport

+

omniORB supports a TLS / SSL transport, using OpenSSL. It is only +built if OpenSSL is available. On platforms using Autoconf, it is +autodetected in many locations, or its location can be given with the +--with-openssl= argument to configure. On other +platforms, the OPEN_SSL_ROOT make variable must be set in the +platform file.

To use the SSL transport, you must link your application with the +omnisslTP library, and correctly set up certificates. See the +src/examples/ssl_echo directory for an example. That directory +contains a README file with more details.

+

6.9.1  Self-signed certificate authority

+

By default, omniORB configures OpenSSL to require both clients and +servers to have certificates that are signed by a Certificate +Authority (CA). It is possible to use a public CA to obtain keys that +can be independently verified, but for many purposes, it is sufficient +to use a private CA to sign all the keys in use in an application. The +following is a brief description of how to become your own certificate +authority and issue and sign certificates, using the OpenSSL command +line tools.

Before starting, find the default openssl.cnf file that was +installed with OpenSSL, copy it to a suitable location, and edit it as +you feel appropriate. Now, build a certificate directory structure, +authority key and certificate:

  mkdir demoCA demoCA/private demoCA/newcerts
 
-
-
-
-Interoperable Naming Service
-
-
-Previous
-Up
-Next
-
-

Chapter 6  Interoperable Naming Service

-

omniORB supports the Interoperable Naming Service (INS). The following -is a summary of its facilities.

6.1  Object URIs

As well as accepting IOR-format strings, ORB::string_to_object() -also supports two Uniform Resource Identifier (URI) [BLFIM98] -formats, which can be used to specify objects in a convenient -human-readable form. IOR-format strings are now also considered URIs.

6.1.1  corbaloc

corbaloc URIs allow you to specify object references which -can be contacted by IIOP, or found through -ORB::resolve_initial_references(). To specify an IIOP object -reference, you use a URI of the form:

-corbaloc:iiop:<host>:<port>/<object key> -

for example:

-corbaloc:iiop:myhost.example.com:1234/MyObjectKey -

which specifies an object with key ‘MyObjectKey’ within a -process running on myhost.example.com listening on port 1234. Object -keys containing non-ASCII characters can use the standard URI % -escapes:

-corbaloc:iiop:myhost.example.com:1234/My%efObjectKey -

denotes an object key with the value 239 (hex ef) in the -third octet.

The protocol name ‘iiop’ can be abbreviated to the empty -string, so the original URI can be written:

-corbaloc::myhost.example.com:1234/MyObjectKey -

The IANA has assigned port number 28091 for use by corbaloc, so if -the server is listening on that port, you can leave the port number -out. The following two URIs refer to the same object:

-corbaloc::myhost.example.com:2809/MyObjectKey
-corbaloc::myhost.example.com/MyObjectKey -

You can specify an object which is available at more than -one location by separating the locations with commas:

-corbaloc::myhost.example.com,:localhost:1234/MyObjectKey -

Note that you must restate the protocol for each address, -hence the ‘:’ before ‘localhost’. It could -equally have been written ‘iiop:localhost’.

You can also specify an IIOP version number:

-corbaloc::1.2@myhost.example.com/MyObjectKey -

Specifying IIOP versions above 1.0 is slightly risky since higher -versions make use of various information stored in IORs that is not -present in a corbaloc URI. It is generally best to contact initial -corbaloc objects with IIOP 1.0, and rely on higher versions for all -other object references.

Alternatively, to use resolve_initial_references(), you -use a URI of the form:

-corbaloc:rir:/NameService -

6.1.2  corbaname

-

corbaname URIs cause string_to_object() to look-up a -name in a CORBA Naming service. They are an extension of the -corbaloc syntax:

-corbaname:<corbaloc location>/<object key>#<stringified name> -

for example:

-corbaname::myhost/NameService#project/example/echo.obj
-corbaname:rir:/NameService#project/example/echo.obj -

The object found with the corbaloc-style portion -must be of type CosNaming::NamingContext, or something -derived from it. If the object key (or rir name) is -‘NameService’, it can be left out:

-corbaname::myhost#project/example/echo.obj
-corbaname:rir:#project/example/echo.obj -

The stringified name portion can also be left out, in which -case the URI denotes the CosNaming::NamingContext which would -have been used for a look-up:

-corbaname::myhost.example.com
-corbaname:rir: -

The first of these examples is the easiest way of specifying -the location of a naming service.

6.2  Configuring resolve_initial_references

-

The INS specifies two standard command line arguments which provide a -portable way of configuring ORB::resolve_initial_references():

6.2.1  ORBInitRef

-ORBInitRef takes an argument of the form -<ObjectId>=<ObjectURI>. So, for example, -with command line arguments of:

--ORBInitRef NameService=corbaname::myhost.example.com -

resolve_initial_references("NameService") will -return a reference to the object with key ‘NameService’ available on -myhost.example.com, port 2809. Since IOR-format strings are considered -URIs, you can also say things like:

--ORBInitRef NameService=IOR:00ff... -

6.2.2  ORBDefaultInitRef

-ORBDefaultInitRef provides a prefix string which is used to -resolve otherwise unknown names. When -resolve_initial_references() is unable to resolve a name which -has been specifically configured (with -ORBInitRef), it -constructs a string consisting of the default prefix, a ‘/’ -character, and the name requested. The string is then fed to -string_to_object(). So, for example, with a command line of:

--ORBDefaultInitRef corbaloc::myhost.example.com -

a call to resolve_initial_references("MyService") -will return the object reference denoted by -‘corbaloc::myhost.example.com/MyService’.

Similarly, a corbaname prefix can be used to cause -look-ups in the naming service. Note, however, that since a -‘/’ character is always added to the prefix, it is -impossible to specify a look-up in the root context of the naming -service—you have to use a sub-context, like:

--ORBDefaultInitRef corbaname::myhost.example.com#services -

6.3  omniNames

6.3.1  NamingContextExt

omniNames supports the extended CosNaming::NamingContextExt -interface:

module CosNaming { - interface NamingContextExt : NamingContext { - typedef string StringName; - typedef string Address; - typedef string URLString; + openssl req -config openssl.cnf -x509 -newkey rsa:2048 \ + -keyout demoCA/private/cakey.pem -out demoCA/cacert.pem -days 3650 - StringName to_string(in Name n) raises(InvalidName); - Name to_name (in StringName sn) raises(InvalidName); + echo 01 >demoCA/serial + touch demoCA/index.txt +

Next, issue a key request and sign it:

  openssl req -config openssl.cnf -new -keyout server_key.pem \
+     -out server_req.pem -days 3650
 
-    exception InvalidAddress {};
+  openssl ca -config openssl.cnf -policy policy_anything \
+     -out server_cert.pem -in server_req.pem 
+

Amongst other things, you now have a server key file in +server_key.pem and a certificate in server_cert.pem. To +make a single file containing both the key and the certificate, +suitable for use in omniORB, concatenate the key and certificate files +together. You can skip the human-readable(ish) text in the +certificate file before the -----BEGIN CERTIFICATE----- marker.

If need be, create more certificates for servers and clients in the +same way.

+

6.10  ZIOP

+

omniORB has support for ZIOP, which compresses transmitted +messages. To use it, link with the omniZIOP4 library.

On Unix platforms, ZIOP support is automatically enabled if the +configure script detects zlib. To enable it on Windows, set the +EnableZIOP make variable in the platform configuration file.

omniORB has an almost complete implementation of the ZIOP +specification, with the following extensions and differences:

  1. +To avoid a dependency on CORBA::Any, compression policies +can be obtained with functions in the omniZIOP namespace, +rather than with the standard orb->create_policy(). See +include/omniORB4/omniZIOP.h for details. To use Any +with the standard orb->create_policy(), link with the +omniZIOPDynamic4 library in addition to omniZIOP4.
  2. Client-side policies are global, set with +omniZIOP::setGlobalPolicies(). +CORBA::Object::_set_policy_overrides() is not supported.
  3. POAs can be given ZIOP policies as shown in the +src/examples/ziop/ziop_impl.cc, but they can also use the +global policies set with omniZIOP::setGlobalPolicies(). This +is useful to apply ZIOP policies to the RootPOA or omniINSPOA. +

In addition to the standard policies, whether or not to +enable ZIOP is determined by client and server transport rules. For a +client to use ZIOP, the matching client transport rule must include +‘ziop’; similarly, for a server to use ZIOP, the matching +server transport rule must include ‘ziop’. e.g. to use the +examples:

  ziop_impl -ORBserverTransportRule "* unix,ssl,tcp,ziop"
 
-    URLString   to_url(in Address addr, in StringName sn)
-      raises(InvalidAddress, InvalidName);
-
-    Object      resolve_str(in StringName n)
-      raises(NotFound, CannotProceed, InvalidName, AlreadyBound);
-  };
-};

to_string() and to_name() convert from CosNaming::Name -sequences to flattened strings and vice-versa. Note that calling -these operations involves remote calls to the naming service, so they -are not particularly efficient. You can use the omniORB specific local -omniURI::nameToString() and omniURI::stringToName() -functions instead.

A CosNaming::Name is stringified by separating name components -with ‘/’ characters. The kind and id fields of -each component are separated by ‘.’ characters. If the -kind field is empty, the representation has no trailing -‘.’; if the id is empty, the representation starts -with a ‘.’ character; if both id and kind -are empty, the representation is just a ‘.’. The backslash -‘\’ is used to escape the meaning of -‘/’, ‘.’ and ‘\’ itself.

to_url() takes a corbaloc style address and key string -(but without the corbaloc: part), and a stringified name, -and returns a corbaname URI (incorrectly called a URL) -string, having properly escaped any invalid characters. The -specification does not make it clear whether or not the address string -should also be escaped by the operation; omniORB does not escape -it. For this reason, it is best to avoid calling to_url() if the -address part contains escapable characters. omniORB provides the -equivalent local function omniURI::addrAndNameToURI().

resolve_str() is equivalent to calling to_name() followed by -the inherited resolve() operation. There are no string-based -equivalents of the various bind operations.

6.3.2  Use with corbaname

To make it easy to use omniNames with corbaname URIs, it -starts with the default port of 2809, and an object key of -‘NameService’ for the root naming context.

6.4  omniMapper

omniMapper is a simple daemon which listens on port 2809 (or any other -port), and redirects IIOP requests for configured object keys to -associated persistent object references. It can be used to make a -naming service (even an old non-INS aware version of omniNames or -other ORB’s naming service) appear on port 2809 with the object key -‘NameService’. The same goes for any other service you may -wish to specify, such as an interface repository. omniMapper is -started with a command line of:

-omniMapper [-port <port>] [-config <config file>] [-v] -

The -port option allows you to choose a port other -than 2809 to listen on. The -config option specifies a -location for the configuration file. The default name is -/etc/omniMapper.cfg, or C:\omniMapper.cfg on -Windows. omniMapper does not normally print anything; the -v -option makes it verbose so it prints configuration information and a -record of the redirections it makes, to standard output.

The configuration file is very simple. Each line contains a string to -be used as an object key, some white space, and an IOR (or any valid -URI) that it will redirect that object key to. Comments should be -prefixed with a ‘#’ character. For example:

-
# Example omniMapper.cfg
-NameService         IOR:000f...
-InterfaceRepository IOR:0100...
-

omniMapper can either be run on a single machine, in much the same way -as omniNames, or it can be run on every machine, with a common -configuration file. That way, each machine’s omniORB configuration -file could contain the line:

-
ORBDefaultInitRef corbaloc::localhost
-

6.5  Creating objects with simple object keys

In normal use, omniORB creates object keys containing various -information including POA names and various non-ASCII characters. -Since object keys are supposed to be opaque, this is not usually a -problem. The INS breaks this opacity and requires servers to create -objects with human-friendly keys.

If you wish to make your objects available with human-friendly URIs, -there are two options. The first is to use omniMapper as described -above, in conjunction with a PERSISTENT POA. The second is to -create objects with the required keys yourself. You do this with a -special POA with the name ‘omniINSPOA’, acquired from -resolve_initial_references(). This POA has the USER_ID -and PERSISTENT policies, and the special property that the -object keys it creates contain only the object ids given to the POA, -and no other data. It is a normal POA in all other respects, so you -can activate/deactivate it, create children, and so on, in the usual -way.

Children of the omniINSPOA do not inherit its special properties of -creating simple object keys. If the omniINSPOA’s policies are not -suitable for your application, you cannot create a POA with different -policies (such as single threading, for example), and still generate -simple object keys. Instead, you can activate a servant in the -omniINSPOA that uses location forwarding to redirect requests to -objects in a different POA.


-1
Not 2089 as -printed in [OMG00]! -
-
-Previous -Up -Next - - + ziop_clt -ORBclientTransportRule "* unix,ssl,tcp,ziop" IOR:... +

This allows you to enable ZIOP for WAN links, but disable it +for LAN communication, for example.

+

6.10.1  Forcing ZIOP Policies

+

The fact that a server supports ZIOP is encoded in its IORs. This +means that if a client uses a corbaloc URI to reference an +object, the object reference does not contain ZIOP details, and thus +the communication cannot use ZIOP. If a client is absolutely certain +that a server supports ZIOP, it can extend an object reference with +ZIOP details using omniZIOP::setServerPolicies(). Using the new +object reference, the client will be able to make ZIOP calls.

namespace omniZIOP { + CORBA::Object_ptr + setServerPolicies(CORBA::Object_ptr obj, const CORBA::PolicyList& policies); +};

Creating a ZIOP-enabling object reference in this way is dangerous! +If the server does not actually support ZIOP, it will receive +compressed messages that it cannot handle. A well-behaved server will +throw a CORBA::MARSHAL exception in response, or perhaps just +drop the invalid connection.

+

6.11  Connection Management Extension

+

The omniConnectionMgmt library provides an omniORB-specific +extension for application-level connection management. Its purpose is +to allow clients and servers to negotiate private GIOP connections, +and to control how the connections are used in multi-threaded +situations.

The omniConnectionMgmt library has two functions, defined in +include/omniORB4/omniConnectionMgmt.h:

namespace omniConnectionMgmt { + + void init(); + + CORBA::Object_ptr + makeRestrictedReference(CORBA::Object_ptr obj, + CORBA::ULong connection_id, + CORBA::ULong max_connections, + CORBA::ULong max_threads, + CORBA::Boolean data_batch, + CORBA::Boolean permit_interleaved, + CORBA::Boolean server_hold_open); +};

The init() function must be called before +CORBA::ORB_init() in every process that is to take part in the +connection management.

The makeRestrictedReference() function is the single entry-point to +the connection management functionality. It builds an annotated object +reference that contains information for the connection management +system. It returns a new reference, leaving the original object +reference unchanged.

+

6.11.1  Client-side parameters

+

These parameters affect the client side of a connection:

connection_id

This number identifies the private connection set. All object +references with the same connection_id will share the same set +of GIOP connections. Object references with different connection ids +are guaranteed to use different connections from each other, and from +object references that have not been annotated with +makeRestrictedReference().

max_connections

This parameter overrides the omniORB maxGIOPConnectionPerServer +configuration parameter for the given connection_id. It +determines the maximum number of separate GIOP connections that will +be opened to the object’s server to service concurrent calls. It is +common to set this value to 1, indicating that only one connection +will be used for the given connection_id. Note that this +parameter can only be used to reduce the default +maxGIOPConnectionPerServer value, not increase it.

data_batch

omniORB usually configures its TCP connections to disable Nagle’s +algorithm, which batches small messages together into single IP +packages, since that is best for the usual CORBA usage pattern of +two-way requests. Setting this parameter to true overrides that, and +enables Nagle’s algorithm on TCP connections or equivalent +functionality on other transports. This can increase throughput if a +client is sending a large number of small oneway calls.

permit_interleaved

This parameter overrides the oneCallPerConnection configuration +parameter that determines whether multi-threaded clients can +interleave calls on a single connection, issuing a new request message +while a previous request is still waiting for a reply. If +permit_interleaved is true, clients can interleave messages; +if it is false, they cannot.

+

6.11.2  Server-side parameters

+

These parameters affect the client side of a connection:

max_threads

This parameter overrides the global +maxServerThreadPerConnection configuration parameter that +determines the maximum number of concurrent threads the server will +use to service requests coming from a connection. Note that this +parameter is only relevant if either the client permits interleaved +calls, or if oneway operations are used, since those are the only +circumstances under which the server can receive a new request on a +connection while already handling a request. As with the +max_connections client-side parameter, this parameter can only +reduce the default number of threads, not increase it.

server_hold_open

Normally, both clients and servers can decide to close a GIOP +connection at any time. When using normal two-way calls, this is no +problem since if a server closes a connection, the client is +guaranteed to notice it when it waits for a reply, and can retry the +call if necessary. With oneway calls, however, if a server closes a +connection just as the client is sending a request, the client will +not know whether the oneway call was received or not, and the call +will potentially be lost. By setting the server_hold_open +parameter to true, the server will not close the connection, relying +on the client to do so. In that case, oneway calls will not be lost +unless there is a network problem that breaks the GIOP connection.

+

6.11.3  Usage

+

The omniConnectionMgmt extension is very easy to use—simply call the +init() method in all processes involved, then restrict references +as required. The makeRestrictedReference() function adds profile +information to the object reference’s IOR, meaning that the parameters +become part of the object reference and are transmitted along with +it. In other words, a server can create a restricted reference and +send it to a client, and the client will automatically make use of the +restricted parameters when it invokes operations on the object +reference. Alternatively, a client can restrict a normal reference it +receives, in order to change its own behaviour.

+
+1
GIOP 1.2 supports +‘bidirectional GIOP’, which permits the rôles to be reversed.
2
Or +CORBA::TRANSIENT if the backwards-compatibility +throwTransientOnTimeout parameter is set to 1.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB007.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB007.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB007.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB007.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,119 +1,231 @@ - - - - - - - -Interface Type Checking - - -Previous -Up -Next -
-

Chapter 7  Interface Type Checking

-

This chapter describes the mechanism used by omniORB to ensure type -safety when object references are exchanged across the network. This -mechanism is handled completely within the ORB. There is no -programming interface visible at the application level. However, for -the sake of diagnosing the problem when there is a type violation, it -is useful to understand the underlying mechanism in order to interpret -the error conditions reported by the ORB.

7.1  Introduction

In GIOP/IIOP, an object reference is encoded as an Interoperable -Object Reference (IOR) when it is sent across a network connection. -The IOR contains a Repository ID (RepoId) and one or more -communication profiles. The communication profiles describe where and -how the object can be contacted. The RepoId is a string which uniquely -identifies the IDL interface of the object.

Unless the ID pragma is specified in the IDL, the ORB generates -the RepoId string in the so-called OMG IDL Format1. For instance, the RepoId for the Echo -interface used in the examples of chapter 2 is -IDL:Echo:1.0.

When interface inheritance is used in the IDL, the ORB always sends the -RepoId of the most derived interface. For example:

// IDL - interface A { - ... - }; - interface B : A { - ... - }; - interface C { - void op(in A arg); - };
// C++ - C_ptr server; - B_ptr objB; - A_ptr objA = objB; - server->op(objA); // Send B as A

In the example, the operation C::op() accepts an object reference -of type A. The real type of the reference passed to C::op() -is B, which inherits from A. In this case, the RepoId of -B, and not that of A, is sent across the network.

The GIOP/IIOP specification allows an ORB to send a null string in the -RepoId field of an IOR. It is up to the receiving end to work out the -real type of the object. omniORB never sends out null strings as -RepoIds, but it may receive null RepoIds from other ORBs. In that -case, it will use the mechanism described below to ensure type safety.

7.2  Interface Inheritance

When the ORB receives an IOR of interface type B when it expects the -type to be A, it must find out if B inherits from A. When the ORB has -no local knowledge of the type B, it must work out the type of B -dynamically.

The CORBA specification defines an Interface Repository (IR) from -which IDL interfaces can be queried dynamically. In the above -situation, the ORB could contact the IR to find out the type of B. -However, this approach assumes that an IR is always available and -contains the up-to-date information of all the interfaces used in the -domain. This assumption may not be valid in many applications.

An alternative is to use the _is_a() operation to work out the -actual type of an object. This approach is simpler and more robust -than the previous one because no 3rd party is involved, so this is -what omniORB does.

class Object{ - CORBA::Boolean _is_a(const char* type_id); -};

The _is_a() operation is part of the CORBA::Object -interface and must be implemented by every object. The input argument -is a RepoId. The function returns true(1) if the object is really an -instance of that type, including if that type is a base type of the -most derived type of that object.

In the situation above, the ORB would invoke the _is_a() -operation on the object and ask if the object is of type A -before it processes any application invocation on the object.

Notice that the _is_a() call is not performed when the IOR -is unmarshalled. It is performed just prior to the first application -invocation on the object. This leads to some interesting failure modes -if B reports that it is not an A. Consider the following example:

// IDL -interface A { ... }; -interface B : A { ... }; -interface D { ... }; -interface C { - A op1(); - Object op2(); -};
1 // C++ - 2 C_ptr objC; - 3 A_ptr objA; - 4 CORBA::Object_ptr objR; - 5 - 6 objA = objC->op1(); - 7 (void) objA->_non_existent(); - 8 - 9 objR = objC->op2(); - 10 objA = A::_narrow(objR);

If the stubs of A,B,C,D are linked into the executable and:

-Case 1
C::op1() and C::op2() return a B. Lines 6–10 -complete successfully. The remote object is only contacted at line 7.
Case 2
C::op1() and C::op2() return a D. This condition -only occurs if the runtime of the remote end is buggy. Even though the -IDL definitions show that D is not derived from A, omniORB gives it -the benefit of the doubt, in case it actually has a more derived -interface that is derived from both A and D. At line 7, the object is -contacted to ask if it is an A. The answer is no, so a -CORBA::INV_OBJREF exception is raised. At line 10, the narrow -operation will fail, and objA will be set to nil. -

If only the stubs of A are linked into the executable and:

-Case 1
C::op1() and C::op2() return a B. Lines 6–10 -complete successfully. When lines 7 and 10 are executed, the object is -contacted to ask if it is an A.
Case 2
C::op1() and C::op2() return a D. This condition -only occurs if the runtime of the remote end is buggy. Line 6 -completes and no exception is raised. At line 7, the object is -contacted to ask if it is an A. If the answer is no, a -CORBA::INV_OBJREF exception is raised. At line 10, the narrow -operation will fail, and objA will be set to nil. -

-1
For further -details of the repository ID formats, see section 10.6 in the CORBA -2.6 specification. -
-
-Previous -Up -Next - - + + + + + + +Interoperable Naming Service + + +Previous +Up +Next +
+

Chapter 7  Interoperable Naming Service

+

+

omniORB supports the Interoperable Naming Service (INS). The following +is a summary of its facilities.

+

7.1  Object URIs

+

As well as accepting IOR-format strings, ORB::string_to_object() +also supports two Uniform Resource Identifier (URI) [BLFIM98] +formats, which can be used to specify objects in a convenient +human-readable form. IOR-format strings are now also considered URIs.

+

7.1.1  corbaloc

+

corbaloc URIs allow you to specify object references which +can be contacted by IIOP, or found through +ORB::resolve_initial_references(). To specify an IIOP object +reference, you use a URI of the form:

+corbaloc:iiop:<host>:<port>/<object key> +

for example:

+corbaloc:iiop:myhost.example.com:1234/MyObjectKey +

which specifies an object with key ‘MyObjectKey’ within a +process running on myhost.example.com listening on port 1234. Object +keys containing non-ASCII characters can use the standard URI % +escapes:

+corbaloc:iiop:myhost.example.com:1234/My%efObjectKey +

denotes an object key with the value 239 (hex ef) in the +third octet.

The protocol name ‘iiop’ can be abbreviated to the empty +string, so the original URI can be written:

+corbaloc::myhost.example.com:1234/MyObjectKey +

The IANA has assigned port number 28091 for use by corbaloc, so if +the server is listening on that port, you can leave the port number +out. The following two URIs refer to the same object:

+corbaloc::myhost.example.com:2809/MyObjectKey
+corbaloc::myhost.example.com/MyObjectKey +

You can specify an object which is available at more than +one location by separating the locations with commas:

+corbaloc::myhost.example.com,:localhost:1234/MyObjectKey +

Note that you must restate the protocol for each address, +hence the ‘:’ before ‘localhost’. It could +equally have been written ‘iiop:localhost’.

You can also specify an IIOP version number:

+corbaloc::1.2@myhost.example.com/MyObjectKey +

Specifying IIOP versions above 1.0 is slightly risky since +higher versions make use of various information stored in IORs that is +not present in a corbaloc URI. It is generally best to contact initial +corbaloc objects with IIOP 1.0, and rely on higher versions for all +other object references.

+

7.1.2  Other transports

+

The only transport specified in the CORBA standard is iiop, +but omniORB also supports the following extensions:

ssliop

+Equivalent semantics to iiop, but the server is contacted +using SSL / TLS. As with iiop, the address details are of +the form host:port.
omniunix

+The omniORB Unix domain socket transport. The address details are of +the form filename.
+

7.1.3  Resolve initial references

+

A corbaloc: can also specify a call to +resolve_initial_references(). This

orb->string_to_object("corbaloc:rir:/NameService");

is identical in behaviour to

orb->resolve_initial_references("NameService");
+

7.1.4  corbaname

+

+

corbaname URIs cause string_to_object() to look-up a +name in a CORBA Naming service. They are an extension of the +corbaloc syntax:

+corbaname:<corbaloc location>/<object key>#<stringified name> +

for example:

+corbaname::myhost/NameService#project/example/echo.obj
+corbaname:rir:/NameService#project/example/echo.obj +

The object found with the corbaloc-style portion +must be of type CosNaming::NamingContext, or something +derived from it. If the object key (or rir name) is +‘NameService’, it can be left out:

+corbaname::myhost#project/example/echo.obj
+corbaname:rir:#project/example/echo.obj +

The stringified name portion can also be left out, in which +case the URI denotes the CosNaming::NamingContext which would +have been used for a look-up:

+corbaname::myhost.example.com
+corbaname:rir: +

The first of these examples is the easiest way of specifying +the location of a naming service.

+

7.2  Configuring resolve_initial_references

+

+

The INS specifies two standard command line arguments which provide a +portable way of configuring ORB::resolve_initial_references():

+

7.2.1  ORBInitRef

+

-ORBInitRef takes an argument of the form +<ObjectId>=<ObjectURI>. So, for example, +with command line arguments of:

+-ORBInitRef NameService=corbaname::myhost.example.com +

resolve_initial_references("NameService") will +return a reference to the object with key ‘NameService’ available on +myhost.example.com, port 2809. Since IOR-format strings are considered +URIs, you can also say things like:

+-ORBInitRef NameService=IOR:00ff... +
+

7.2.2  ORBDefaultInitRef

+

-ORBDefaultInitRef provides a prefix string which is used to +resolve otherwise unknown names. When +resolve_initial_references() is unable to resolve a name which +has been specifically configured (with -ORBInitRef), it +constructs a string consisting of the default prefix, a ‘/’ +character, and the name requested. The string is then fed to +string_to_object(). So, for example, with a command line of:

+-ORBDefaultInitRef corbaloc::myhost.example.com +

a call to resolve_initial_references("MyService") +will return the object reference denoted by +‘corbaloc::myhost.example.com/MyService’.

Similarly, a corbaname prefix can be used to cause +look-ups in the naming service. Note, however, that since a +‘/’ character is always added to the prefix, it is +impossible to specify a look-up in the root context of the naming +service—you have to use a sub-context, like:

+-ORBDefaultInitRef corbaname::myhost.example.com#services +
+

7.3  omniNames

+

7.3.1  NamingContextExt

+

omniNames supports the extended CosNaming::NamingContextExt +interface:

module CosNaming { + interface NamingContextExt : NamingContext { + typedef string StringName; + typedef string Address; + typedef string URLString; + + StringName to_string(in Name n) raises(InvalidName); + Name to_name (in StringName sn) raises(InvalidName); + + exception InvalidAddress {}; + + URLString to_url(in Address addr, in StringName sn) + raises(InvalidAddress, InvalidName); + + Object resolve_str(in StringName n) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + }; +};

to_string() and to_name() convert from CosNaming::Name +sequences to flattened strings and vice-versa. Note that calling +these operations involves remote calls to the naming service, so they +are not particularly efficient. You can use the omniORB specific local +omniURI::nameToString() and omniURI::stringToName() +functions instead.

A CosNaming::Name is stringified by separating name components +with ‘/’ characters. The kind and id fields of +each component are separated by ‘.’ characters. If the +kind field is empty, the representation has no trailing +‘.’; if the id is empty, the representation starts +with a ‘.’ character; if both id and kind +are empty, the representation is just a ‘.’. The backslash +‘\’ is used to escape the meaning of +‘/’, ‘.’ and ‘\’ itself.

to_url() takes a corbaloc style address and key string +(but without the corbaloc: part), and a stringified name, +and returns a corbaname URI (incorrectly called a URL) +string, having properly escaped any invalid characters. The +specification does not make it clear whether or not the address string +should also be escaped by the operation; omniORB does not escape +it. For this reason, it is best to avoid calling to_url() if the +address part contains escapable characters. To avoid remote calls, +omniORB provides the equivalent local function +omniURI::addrAndNameToURI().

resolve_str() is equivalent to calling to_name() followed by +the inherited resolve() operation. There are no string-based +equivalents of the various bind operations.

+

7.3.2  Use with corbaname

+

To make it easy to use omniNames with corbaname URIs, it +starts with the default port of 2809, and an object key of +‘NameService’ for the root naming context.

+

7.4  omniMapper

+

omniMapper is a simple daemon which listens on port 2809 (or any other +port), and redirects IIOP requests for configured object keys to +associated persistent object references. It can be used to make a +naming service (even an old non-INS aware version of omniNames or +other ORB’s naming service) appear on port 2809 with the object key +‘NameService’. The same goes for any other service you may +wish to specify, such as an interface repository. omniMapper is +started with a command line of:

+omniMapper [-port <port>] [-config <config file>] [-v] +

The -port option allows you to choose a port other +than 2809 to listen on. The -config option specifies a +location for the configuration file. The default name is +/etc/omniMapper.cfg, or C:\omniMapper.cfg on +Windows. omniMapper does not normally print anything; the -v +option makes it verbose so it prints configuration information and a +record of the redirections it makes, to standard output.

The configuration file is very simple. Each line contains a string to +be used as an object key, some white space, and an IOR (or any valid +URI) that it will redirect that object key to. Comments should be +prefixed with a ‘#’ character. For example:

+
# Example omniMapper.cfg
+NameService         IOR:000f...
+InterfaceRepository IOR:0100...
+

omniMapper can either be run on a single machine, in much the same way +as omniNames, or it can be run on every machine, with a common +configuration file. That way, each machine’s omniORB configuration +file could contain the line:

+
ORBDefaultInitRef corbaloc::localhost
+
+

7.5  Creating objects with simple object keys

+

In normal use, omniORB creates object keys containing various +information including POA names and various non-ASCII characters. +Since object keys are supposed to be opaque, this is not usually a +problem. The INS breaks this opacity and requires servers to create +objects with human-friendly keys.

If you wish to make your objects available with human-friendly URIs, +there are two options. The first is to use omniMapper as described +above, in conjunction with a PERSISTENT POA. The second is to +create objects with the required keys yourself. You do this with a +special POA with the name ‘omniINSPOA’, acquired from +resolve_initial_references(). This POA has the USER_ID +and PERSISTENT policies, and the special property that the +object keys it creates contain only the object ids given to the POA, +and no other data. It is a normal POA in all other respects, so you +can activate/deactivate it, create children, and so on, in the usual +way.

Children of the omniINSPOA do not inherit its special properties of +creating simple object keys. If the omniINSPOA’s policies are not +suitable for your application, you cannot create a POA with different +policies (such as single threading, for example), and still generate +simple object keys. Instead, you can activate a servant in the +omniINSPOA that uses location forwarding to redirect requests to +objects in a different POA.

+
+1
Not 2089 as +printed in [OMG00]!
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB008.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB008.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB008.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB008.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,446 +1,110 @@ - - - - - - - -Connection and Thread Management - - -Previous -Up -Next -
-

Chapter 8  Connection and Thread Management

-

This chapter describes how omniORB manages threads and network -connections.

8.1  Background

In CORBA, the ORB is the ‘middleware’ that allows a client to invoke -an operation on an object without regard to its implementation or -location. In order to invoke an operation on an object, a client needs -to ‘bind’ to the object by acquiring its object reference. Such a -reference may be obtained as the result of an operation on another -object (such as a naming service or factory object) or by conversion -from a stringified representation. If the object is in a different -address space, the binding process involves the ORB building a proxy -object in the client’s address space. The ORB arranges for invocations -on the proxy object to be transparently mapped to equivalent -invocations on the implementation object.

For the sake of interoperability, CORBA mandates that all ORBs should -support IIOP as the means to communicate remote invocations over a -TCP/IP connection. IIOP is usually1 -asymmetric with respect to the roles of the parties at the two ends of -a connection. At one end is the client which can only initiate remote -invocations. At the other end is the server which can only receive -remote invocations.

Notice that in CORBA, as in most distributed systems, remote bindings -are established implicitly without application intervention. This -provides the illusion that all objects are local, a property known as -‘location transparency’. CORBA does not specify when such bindings -should be established or how they should be multiplexed over the -underlying network connections. Instead, ORBs are free to implement -implicit binding by a variety of means.

The rest of this chapter describes how omniORB manages network -connections and the programming interface to fine tune the management -policy.

8.2  The model

omniORB is designed from the ground up to be fully multi-threaded. The -objective is to maximise the degree of concurrency and at the same -time eliminate any unnecessary thread overhead. Another objective is -to minimise the interference by the activities of other threads on the -progress of a remote invocation. In other words, thread ‘cross-talk’ -should be minimised within the ORB. To achieve these objectives, the -degree of multiplexing at every level is kept to a minimum by default.

Minimising multiplexing works well when the ORB is relatively lightly -loaded. However, when the ORB is under heavy load, it can sometimes be -beneficial to conserve operating system resources such as threads and -network connections by multiplexing at the ORB level. omniORB has -various options that control its multiplexing behaviour.

8.3  Client side behaviour

On the client side of a connection, the thread that invokes on a proxy -object drives the GIOP protocol directly and blocks on the connection -to receive the reply. The first time the client makes a call to a -particular address space, the ORB opens a suitable connection to the -remote address space (based on the client transport rule as described -in section 8.7.1). After the reply has been received, -the ORB caches the open network connection, ready for use by another -call.

If two (or more) threads in a multi-threaded client attempt to contact -the same address space simultaneously, there are two different ways to -proceed. The default way is to open another network connection to the -server. This means that neither the client or server ORB has to -perform any multiplexing on the network connections—multiplexing is -performed by the operating system, which has to deal with multiplexing -anyway. The second possibility is for the client to multiplex the -concurrent requests on a single network connection. This conserves -operating system resources (network connections), but means that both -the client and server have to deal with multiplexing issues -themselves.

In the default one call per connection mode, there is a limit to the -number of concurrent connections that are opened, set with the -maxGIOPConnectionPerServer parameter. To tell the ORB -that it may multiplex calls on a single connection, set the -oneCallPerConnection parameter to zero. If the -oneCallPerConnection parameter is set to the default -value of one, and there are more concurrent calls than specified by -maxGIOPConnectionPerServer, calls block waiting for connections -to become free.

Note that some server-side ORBs, including omniORB versions before -version 4.0, are unable to deal with concurrent calls multiplexed on a -single connection, so they serialise the calls. It is usually best to -keep to the default mode of opening multiple connections.

8.3.1  Client side timeouts

-

omniORB can associate a timeout with a call, meaning that if the call -takes too long a TRANSIENT exception is thrown. Timeouts can be -set for the whole process, for a specific thread, or for a specific -object reference.

Timeouts are set using this API:

namespace omniORB { - void setClientCallTimeout(CORBA::ULong millisecs); - void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs); - void setClientThreadCallTimeout(CORBA::ULong millisecs); - void setClientConnectTimeout(CORBA::ULong millisecs); -};

setClientCallTimeout() sets either the global timeout or the -timeout for a specific object reference. -setClientThreadCallTimeout() sets the timeout for the calling -thread. The calling thread must have an omni_thread associated -with it. Setting any timeout value to zero disables it.

Accessing per-thread state is a relatively expensive operation, so per -thread timeouts are disabled by default. The -supportPerThreadTimeOut parameter must be set true to enable -them.

To choose the timeout value to use for a call, the ORB first looks to -see if there is a timeout for the object reference, then to the -calling thread, and finally to the global timeout.

When a client has no existing connection to communicate with a server, -it must open a new connection before performing the -call. setClientConnectTimeout() sets an overriding timeout for -cases where a new connection must be established. The effect of the -connect timeout depends upon whether the connect timeout is greater -or less than the timeout that would otherwise be used.

As an example, imagine that the usual call timeout is 10 seconds:

Connect timeout > usual timeout

If the connect timeout is set to 20 seconds, then a call that -establishes a new connection will be permitted 20 seconds before it -times out. Subsequent calls using the same connection have the normal -10 second timeout. If establishing the connection takes 8 seconds, -then the call itself takes 5 seconds, the call succeeds despite having -taken 13 seconds in total, longer than the usual timeout.

This kind of configuration is good when connections are slow to be -established.

If an object reference has multiple possible endpoints available, and -connecting to the first endpoint times out, only that one endpoint -will have been tried before an exception is raised. However, once the -timeout has occurred, the object reference will switch to use the next -endpoint. If the application attempts to make another call, it will -use the next endpoint.

Connect timeout < usual timeout

If the connect timeout is set to 2 seconds, the actual network-level -connect is only permitted to take 2 seconds. As long as the connection -is established in less than 2 seconds, the call can proceed. The 10 -second call timeout still applies to the time taken for the whole call -(including the connection establishment). So, if establishing the -connection takes 1.5 seconds, and the call itself takes 9.5 seconds, -the call will time out because although it met the connection timeout, -it exceeded the 10 second total call timeout. On the other hand, if -establishing the connection takes 3 seconds, the call will fail after -only 2 seconds, since only 2 seconds are permitted for the connect.

If an object reference has multiple possible endpoints available, the -client will attempt to connect to them in turn, until one succeeds. -The connect timeout applies to each connection attempt. So with a -connect timeout of 2 seconds, the client will spend up to 2 seconds -attempting to connect to the first address and then, if that fails, up -to 2 seconds trying the second address, and so on. The 10 second -timeout still applies to the call as a whole, so if the total time -taken on timed-out connection attempts exceeds 10 seconds, the call -will time out.

This kind of configuration is useful where calls may take a long time -to complete (so call timeouts are long), but a fast indication of -connection failure is required.

8.4  Server side behaviour

The server side has two primary modes of operation: thread per -connection and thread pooling. It is able to dynamically transition -between the two modes, and it supports a hybrid scheme that behaves -mostly like thread pooling, but has the same fast turn-around for -sequences of calls as thread per connection.

8.4.1  Thread per connection mode

In thread per connection mode (the default, and the only option in -omniORB versions before 4.0), each connection has a single thread -dedicated to it. The thread blocks waiting for a request. When it -receives one, it unmarshals the arguments, makes the up-call to the -application code, marshals the reply, and goes back to watching the -connection. There is thus no thread switching along the call chain, -meaning the call is very efficient.

As explained above, a client can choose to multiplex multiple -concurrent calls on a single connection, so once the server has -received the request, and just before it makes the call into -application code, it marks the connection as ‘selectable’, meaning -that another thread should watch it to see if any other requests -arrive. If they do, extra threads are dispatched to handle the -concurrent calls. GIOP 1.2 actually allows the argument data for -multiple calls to be interleaved on a connection, so the unmarshalling -code has to handle that too. As soon as any multiplexing occurs on the -connection, the aim of removing thread switching cannot be met, and -there is inevitable inefficiency due to thread switching.

The maxServerThreadPerConnection parameter can be set to limit -the number of threads that can be allocated to a single connection -containing concurrent calls. Setting the parameter to 1 mimics the -behaviour of omniORB versions before 4.0, that did not support -calls multiplexed on one connection.

8.4.2  Thread pool mode

-

In thread pool mode, selected by setting the -threadPerConnectionPolicy parameter to zero, a single thread -watches all incoming connections. When a call arrives on one of them, -a thread is chosen from a pool of threads, and set to work -unmarshalling the arguments and performing the up-call. There is -therefore at least one thread switch for each call.

The thread pool is not pre-initialised. Instead, threads are started -on demand, and idle threads are stopped after a period of inactivity. -The maximum number of threads that can be started in the pool is set -with the maxServerThreadPoolSize parameter. The default -is 100.

A common pattern in CORBA applications is for a client to make several -calls to a single object in quick succession. To handle this situation -most efficiently, the default behaviour is to not return a thread to -the pool immediately after a call is finished. Instead, it is set to -watch the connection it has just served for a short while, mimicking -the behaviour in thread per connection mode. If a new call comes in -during the watching period, the call is dispatched without any thread -switching, just as in thread per connection mode. Of course, if the -server is supporting a very large number of connections (more than the -size of the thread pool), this policy can delay a call coming from -another connection. If the threadPoolWatchConnection -parameter is set to zero, connection watching is disabled and threads -return to the pool immediately after finishing a single request.

In the face of multiplexed calls on a single connection, multiple -threads from the pool can be dispatched for one connection, just as in -thread per connection mode. With threadPoolWatchConnection set -to the default value of 1, only the last thread servicing a connection -will watch it when it finishes a request. Setting the parameter to a -larger number allows the last n connections to watch the -connection.

8.4.3  Policy transition

If the server is dealing with a relatively small number of -connections, it is most efficient to use thread per connection mode. -If the number of connections becomes too large, however, operating -system limits on the number of threads may cause a significant -slowdown, or even prevent the acceptance of new connections -altogether.

To give the most efficient response in all circumstances, omniORB -allows a server to start in thread per connection mode, and transition -to thread pooling if many connections arrive. This is controlled with -the threadPerConnectionUpperLimit and -threadPerConnectionLowerLimit parameters. The former must -always be larger than the latter. The upper limit chooses the number -of connections at which time the ORB transitions to thread pool mode; -the lower limit selects the point at which the transition back to -thread per connection is made.

For example, setting the upper limit to 50 and the lower limit to 30 -would mean that the first 49 connections would receive dedicated -threads. The 50th to arrive would trigger thread pooling. All future -connections to arrive would make use of threads from the pool. Note -that the existing dedicated threads continue to service their -connections until the connections are closed. If the number of -connections falls below 30, thread per connection is reactivated and -new connections receive their own dedicated threads (up to the limit -of 50 again). Once again, existing connections in thread pool mode -stay in that mode until they are closed.

8.5  Idle connection shutdown

-

It is wasteful to leave a connection open when it has been left unused -for a considerable time. Too many idle connections could block out new -connections when it runs out of spare communication channels. For -example, most platforms have a limit on the number of file handles a -process can open. Many platforms have a very small default limit like -64. The value can often be increased to a maximum of a thousand or -more by changing the ‘ulimit’ in the shell.

Every so often, a thread scans all open connections to see which are -idle. The scanning period (in seconds) is set with the -scanGranularity parameter. The default is 5 seconds.

Outgoing connections (initiated by clients) and incoming connections -(initiated by servers) have separate idle timeouts. The timeouts are -set with the outConScanPeriod and inConScanPeriod -parameters respectively. The values are in seconds, and must be a -multiple of the scan granularity.

Beware that setting outConScanPeriod or inConScanPeriod -to be equal to (or less than) scanGranularity means that -connections are considered candidates for closure immediately after -they are opened. That can mean that the connections are closed before -any calls have been sent through them. If oneway calls are used, such -connection closure can result in silent loss of calls.

8.5.1  Interoperability Considerations

The IIOP specification allows both the client and the server to -shutdown a connection unilaterally. When one end is about to shutdown -a connection, it should send a CloseConnection message to the other -end. It should also make sure that the message will reach the other -end before it proceeds to shutdown the connection.

The client should distinguish between an orderly and an abnormal -connection shutdown. When a client receives a CloseConnection message -before the connection is closed, the condition is an orderly shutdown. -If the message is not received, the condition is an abnormal shutdown. -In an abnormal shutdown, the ORB should raise a COMM_FAILURE -exception whereas in an orderly shutdown, the ORB should not -raise an exception and should try to re-establish a new connection -transparently.

omniORB implements these semantics completely. However, it is known -that some ORBs are not (yet) able to distinguish between an orderly -and an abnormal shutdown. Usually this is manifested as the client in -these ORBs seeing a COMM_FAILURE occasionally when connected -to an omniORB server. The work-around is either to catch the exception -in the application code and retry, or to turn off the idle connection -shutdown inside the omniORB server.

8.6  Transports and endpoints

omniORB can support multiple network transports. All platforms -(usually) have a TCP transport available. Unix platforms support a -Unix domain socket transport. Platforms with the OpenSSL library -available can support an SSL transport.

Servers must be configured in two ways with regard to transports: the -transports and interfaces on which they listen, and the details that -are published in IORs for clients to see. Usually the published -details will be the same as the listening details, but there are times -when it is useful to publish different information.

Details are selected with the endPoint family of parameters. -The simplest is plain endPoint, which chooses a transport and -interface details, and publishes the information in IORs. Endpoint -parameters are in the form of URIs, with a scheme name of -‘giop:’, followed by the transport name. Different transports -have different parameters following the transport.

TCP endpoints have the format:

-giop:tcp:<host>:<port> -

The host must be a valid host name or IP address for the -server machine. It determines the network interface on which the -server listens. The port selects the TCP port to listen on, which must -be unoccupied. Either the host or port, or both can be left empty. If -the host is empty, the ORB publishes the IP address of the first -non-loopback network interface it can find (or the loopback if that is -the only interface), but listens on all network interfaces. If -the port is empty, the operating system chooses a port.

Multiple TCP endpoints can be selected, either to specify multiple -network interfaces on which to listen, or (less usefully) to select -multiple TCP ports on which to listen.

If no endPoint parameters are set, the ORB assumes a single -parameter of giop:tcp::, meaning IORs contain the address of -the first non-loopback network interface, the ORB listens on all -interfaces, and the OS chooses a port number.

SSL endpoints have the same format as TCP ones, except ‘tcp’ -is replaced with ‘ssl’. Unix domain socket endpoints have the -format:

-giop:unix:<filename> -

where the filename is the name of the socket within the -filesystem. If the filename is left blank, the ORB chooses a name -based on the process id and a timestamp.

To listen on an endpoint without publishing it in IORs, specify it -with the endPointNoPublish configuration parameter. See below -for more details about endpoint publishing.

8.6.1  IPv6

On platforms where it is available, omniORB supports IPv6. On most -Unix platforms, IPv6 sockets accept both IPv6 and IPv4 connections, so -omniORB’s default giop:tcp:: endpoint accepts both IPv4 and -IPv6 connections. On Windows versions before Windows Vista, each -socket type only accepts incoming connections of the same type, so an -IPv6 socket cannot be used with IPv4 clients. For this reason, the -default giop:tcp:: endpoint only listens for IPv4 connections. -Since endpoints with a specific host name or address only listen on a -single network interface, they are inherently limited to just one -protocol family.

To explicitly ask for just IPv4 or just IPv6, an endpoint with the -wildcard address for the protocol family should be used. For IPv4, the -wildcard address is ‘0.0.0.0’, and for IPv6 it is ‘::’. -So, to listen for IPv4 connections on all IPv4 network interfaces, use -an endpoint of:

-giop:tcp:0.0.0.0: -

All IPv6 addresses contain colons, so the address portion in -URIs must be contained within [] characters. Therefore, to -listen just for IPv6 connections on all IPv6 interfaces, use the -somewhat cryptic:

-giop:tcp:[::]: -

To listen for both IPv4 and IPv6 connections on Windows -versions prior to Vista, both endpoints must be explicitly provided.

8.6.1.1  Link local addresses

In IPv6, all network interfaces are assigned a link local -address, starting with the digits fe80. The link local address -is only valid on the same ‘link’ as the interface, meaning directly -connected to the interface, or possibly on the same subnet, depending -on how the network is switched. To connect to a server’s link local -address, a client has to know which of its network interfaces is on -the same link as the server. Since there is no way for omniORB to know -which local interface a remote link local address may be connected to, -and in extreme circumstances may even end up contacting the wrong -server if it picks the wrong interface, link local addresses are not -considered valid. Servers do not publish link local addresses in their -IORs.

8.6.2  Endpoint publishing

For clients to be able to connect to a server, the server publishes -endpoint information in its IORs (Interoperable Object References). -Normally, omniORB publishes the first available address for each of -the endpoints it is listening on.

The endpoint information to publish is determined by the -endPointPublish configuration parameter. It contains a -comma-separated list of publish rules. The rules are applied in turn -to each of the configured endpoints; if a rule matches an endpoint, it -causes one or more endpoints to be published.

The following core rules are supported:

- - - - - -
addrthe first natural address of the endpoint
ipv4the first IPv4 address of a TCP or SSL endpoint
ipv6the first IPv6 address of a TCP or SSL endpoint
namethe first address that can be resolved to a name
hostnamethe result of the gethostname() system call
fqdnthe fully-qualified domain name

The core rules can be combined using the vertical bar operator to -try several rules in turn until one succeeds. e.g:

-
name|ipv6|ipv4the name of the endpoint if it has one; - failing that, its first IPv6 address; - failing that, its first IPv4 address.

Multiple rules can be combined using the comma operator to -publish more than one endpoint. e.g.

-
name,addrthe name of the endpoint (if it has one), -followed by its first address.

For endpoints with multiple addresses (e.g. TCP endpoints on -multi-homed machines), the all() manipulator causes all -addresses to be published. e.g.:

- - - - -
all(addr)all addresses are published
all(name)all addresses that resolve to names are published
all(name|addr)all addresses are published by name if they have -one, address otherwise.
all(name,addr)all addresses are published by name (if they -have one), and by address.
all(name), all(addr)first the names of all addresses are published, -followed by all the addresses.

A specific endpoint can be published by giving its endpoint URI, -even if the server is not listening on that endpoint. e.g.:

- -
giop:tcp:not.my.host:12345
giop:unix:/not/my/socket-file

If the host or port number for a TCP or SSL URI are missed out, -they are filled in with the details from each listening TCP/SSL -endpoint. This can be used to publish a different name for a -TCP/SSL endpoint that is using an ephemeral port, for example.

omniORB 4.0 supported two options related to endpoint publishing that -are superseded by the endPointPublish parameter, and so are now -deprecated. Setting endPointPublishAllIFs to 1 is equivalent to -setting endPointPublish to ‘all(addr)’. The -endPointNoListen parameter is equivalent to adding endpoint -URIs to the endPointPublish parameter.

8.7  Connection selection and acceptance

In the face of IORs containing details about multiple different -endpoints, clients have to know how to choose the one to use to -connect a server. Similarly, servers may wish to restrict which -clients can connect to particular transports. This is achieved with -transport rules.

8.7.1  Client transport rules

-

The clientTransportRule parameter is used to filter and -prioritise the order in which transports specified in an IOR are -tried. Each rule has the form:

-<address mask> [action]+ -

The address mask can be one of

- - - - -
1.localhostThe address of this machine
-2.w.x.y.z/m1.m2.m3.m4An IPv4 address -with bits selected by the mask, e.g. - 172.16.0.0/255.240.0.0
-3.w.x.y.z/prefixlenAn IPv4 address with -prefixlen significant bits, e.g. - 172.16.2.0/24
-4.a:b:c:d:e:f:g:h/prefixlenAn IPv6 -address with prefixlen significant bits, e.g. - 3ffe:505:2:1::/64
-5.*Wildcard that matches any address

The action is one or more of the following:

- - - - -
1.noneDo not use this address
2.tcpUse a TCP transport
3.sslUse an SSL transport
4.unixUse a Unix socket transport
5.bidirConnections to this address can be used -bidirectionally (see section 8.8)

The transport-selecting actions form a prioritised list, so -an action of ‘unix,ssl,tcp’ means to use a Unix transport if -there is one, failing that a SSL transport, failing that a TCP -transport. In the absence of any explicit rules, the client uses the -implicit rule of ‘* unix,ssl,tcp’.

If more than one rule is specified, they are prioritised in the order -they are specified. For example, the configuration file might contain:

  clientTransportRule = 192.168.1.0/255.255.255.0  unix,tcp
-  clientTransportRule = 172.16.0.0/255.240.0.0     unix,tcp
-                      =       *                    none
-

This would be useful if there is a fast network -(192.168.1.0) which should be used in preference to another network -(172.16.0.0), and connections to other networks are not permitted at -all.

In general, the result of filtering the endpoint specifications in an -IOR with the client transport rule will be a prioritised list of -transports and networks. (If the transport rules do not prioritise one -endpoint over another, the order the endpoints are listed in the IOR -is used.) When trying to contact an object, the ORB tries its -possible endpoints in turn, until it finds one with which it can -contact the object. Only after it has unsuccessfully tried all -permissible endpoints will it raise a TRANSIENT exception to -indicate that the connect failed.

8.7.2  Server transport rules

-

The server transport rules have the same format as client transport -rules. Rather than being used to select which of a set of ways to -contact a machine, they are used to determine whether or not to accept -connections from particular clients. In this example, we only allow -connections from our intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
-                      = 172.16.0.0/255.240.0.0     tcp,ssl
-                      = *                          none
-

And in this one, we accept only SSL connections if the -client is not on the intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
-                      = 172.16.0.0/255.240.0.0     tcp,ssl
-                      = *                          ssl,bidir
-

In the absence of any explicit rules, the server uses the -implicit rule of ‘* unix,ssl,tcp’, meaning any kind of -connection is accepted from any client.

8.8  Bidirectional GIOP

-

omniORB supports bidirectional GIOP, which allows callbacks to be made -using a connection opened by the original client, rather than the -normal model where the server opens a new connection for the callback. -This is important for negotiating firewalls, since they tend not to -allow connections back on arbitrary ports.

There are several steps required for bidirectional GIOP to be enabled -for a callback. Both the client and server must be configured -correctly. On the client side, these conditions must be met:

  • The offerBiDirectionalGIOP parameter must be set to true. -
  • The client transport rule for the target server must contain the -bidir action. -
  • The POA containing the callback object (or objects) must have -been created with a BidirectionalPolicy value of -BOTH.

On the server side, these conditions must be met:

  • The acceptBiDirectionalGIOP parameter must be set to true. -
  • The server transport rule for the requesting client must contain -the bidir action. -
  • The POA hosting the object contacted by the client must have -been created with a BidirectionalPolicy value of -BOTH.

8.9  SSL transport

omniORB supports an SSL transport, using OpenSSL. It is only built if -OpenSSL is available. On platforms using Autoconf, it is autodetected -in many locations, or its location can be given with the ---with-openssl= argument to configure. On other -platforms, the OPEN_SSL_ROOT make variable must be set in the -platform file.

To use the SSL transport, you must link your application with the -omnisslTP library, and correctly set up certificates. See the -src/examples/ssl_echo directory for an example. That directory -contains a README file with more details.


-1
GIOP 1.2 supports -‘bidirectional GIOP’, which permits the rôles to be reversed. -
-
-Previous -Up -Next - - + + + + + + +Code set conversion + + +Previous +Up +Next +
+

Chapter 8  Code set conversion

+

+

omniORB supports full code set negotiation, used to select and +translate between different character code sets when transmitting +chars, strings, wchars and wstrings. The support is mostly transparent +to application code, but there are a number of options that can be +selected. This chapter covers the options, and also gives some +pointers about how to implement your own code sets, in case the ones +that come with omniORB are not sufficient.

+

8.1  Native code sets

+

For the ORB to know how to handle strings and wstrings given to it by +the application, it must know what code set they are represented +with, so it can properly translate them if need be. The defaults are +ISO 8859-1 (Latin 1) for char and string, and UTF-16 for wchar and +wstring. Different code sets can be chosen at initialisation time with +the nativeCharCodeSet and nativeWCharCodeSet +parameters. The supported code sets are printed out at initialisation +time if the ORB traceLevel is 15 or greater.

For most applications, the defaults are fine. Some applications may +need to set the native char code set to UTF-8, allowing the full +Unicode range to be supported in strings.

Note that the default for wchar is always UTF-16, even on Unix +platforms where wchar is a 32-bit type. Select the UCS-4 code set to +select characters outside the first plane without having to use UTF-16 +surrogates1.

+

8.2  Default code sets

+

The way code set conversion is meant to work in CORBA communication is +that each client and server has a native code set that it uses +for character data in application code, and supports a number of +transmission code sets that is uses for communication. When a +client connects to a server, the client picks one of the server’s +transmission code sets to use for the interaction. For that to work, +the client plainly has to know the server’s supported transmission +code sets.

Code set information from servers is embedded in IORs. A client with +an IOR from a server should therefore know what transmission code sets +the server supports. This approach can fail for two reasons:

  1. +A corbaloc URI (see chapter 7) does +not contain any code set information.
  2. Some badly-behaved servers that do support code set conversion +fail to put codeset information in their IORs. +

The CORBA standard says that if a server has not specified +transmission code set information, clients must assume that they only +support ISO-8859-1 for char and string, and do not support wchar and +wstring at all. The effect is that client code receives +DATA_CONVERSION or BAD_PARAM exceptions.

To avoid this issue, omniORB allows you to configure default +code sets that are used as a server’s transmission code sets if they +are not otherwise known. Set defaultCharCodeSet for char and +string data, and defaultWCharCodeSet for wchar and wstring data.

+

8.3  Code set library

+

To save space in the main ORB core library, most of the code set +implementations are in a separate library named omniCodeSets4. To use +the extra code sets, you must link your application with that +library. On most platforms, if you are using dynamic linking, +specifying the omniCodeSets4 library in the link command is sufficient +to have it initialised, and for the code sets to be available. With +static linking, or platforms with less intelligent dynamic linkers, +you must force the linker to initialise the library. You do that by +including the omniORB4/optionalFeatures.h header. By default, +that header enables several optional features. Look at the file +contents to see how to turn off particular features.

+

8.4  Implementing new code sets

+

It is quite easy to implement new code sets, if you need support for +code sets (or marshalling formats) that do not come with the omniORB +distribution. There are extensive comments in the headers and ORB code +that explain how to implement a code set; this section just serves to +point you in the right direction.

The main definitions for the code set support are in +include/omniORB4/codeSets.h. That defines a set of base classes +use to implement code sets, plus some derived classes that use look-up +tables to convert simple 8-bit and 16-bit code sets to Unicode.

When sending or receiving string data, there are a total of four code +sets in action: a native char code set, a transmission char code set, +a native wchar code set, and a transmission wchar code set. The native +code sets are as described above; the transmission code sets are the +ones selected to communicate with a remote machine. They are +responsible for understanding the GIOP marshalling formats, as well as +the code sets themselves. Each of the four code sets has an object +associated with it which contains methods for converting data.

There are two ways in which a string/wstring can be transmitted or +received. If the transmission code set in action knows how to deal +directly with the native code set (the trivial case being that they +are the same code set, but more complex cases are possible too), the +transmission code set object can directly marshal or unmarshal the +data into or out of the application buffer. If the transmission code +set does not know how to handle the native code set, it converts the +string/wstring into UTF-16, and passes that to the native code set +object (or vice-versa). All code set implementations must therefore +know how to convert to and from UTF-16.

With this explanation, the classes in codeSets.h should be easy +to understand. The next place to look is in the various existing code +set implementations, which are files of the form cs-*.cc in the +src/lib/omniORB/orbcore and src/lib/omniORB/codesets. +Note how all the 8-bit code sets (the ISO 8859-* family) consist +entirely of data and no code, since they are driven by look-up tables.

+
+1
If you have no idea what this means, don’t +worry—you’re better off not knowing unless you really have +to.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB009.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB009.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB009.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB009.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,83 +1,177 @@ - - - - - - - -Code set conversion - - -Previous -Up -Next -
-

Chapter 9  Code set conversion

-

omniORB supports full code set negotiation, used to select and -translate between different character code sets, for the transmission -of chars, strings, wchars and wstrings. The support is mostly -transparent to application code, but there are a number of options -that can be selected. This chapter covers the options, and also gives -some pointers about how to implement your own code sets, in case the -ones that come with omniORB are not sufficient.

9.1  Native code sets

For the ORB to know how to handle strings and wstrings given to it by -the application, it must know what code set they are represented -with, so it can properly translate them if need be. The defaults are -ISO 8859-1 (Latin 1) for char and string, and UTF-16 for wchar and -wstring. Different code sets can be chosen at initialisation time with -the nativeCharCodeSet and nativeWCharCodeSet -parameters. The supported code sets are printed out at initialisation -time if the ORB traceLevel is 15 or greater.

For most applications, the defaults are fine. Some applications may -need to set the native char code set to UTF-8, allowing the full -Unicode range to be supported in strings.

Note that the default for wchar is always UTF-16, even on Unix -platforms where wchar is a 32-bit type. Select the UCS-4 code set to -select characters outside the first plane without having to use UTF-16 -surrogates1.

9.2  Code set library

To save space in the main ORB core library, most of the code set -implementations are in a separate library named omniCodeSets4. To use -the extra code sets, you must link your application with that -library. On most platforms, if you are using dynamic linking, -specifying the omniCodeSets4 library in the link command is sufficient -to have it initialised, and for the code sets to be available. With -static linking, or platforms with less intelligent dynamic linkers, -you must force the linker to initialise the library. You do that by -including the omniORB4/optionalFeatures.h header. By default, -that header enables several optional features. Look at the file -contents to see how to turn off particular features.

9.3  Implementing new code sets

It is quite easy to implement new code sets, if you need support for -code sets (or marshalling formats) that do not come with the omniORB -distribution. There are extensive comments in the headers and ORB code -that explain how to implement a code set; this section just serves to -point you in the right direction.

The main definitions for the code set support are in -include/omniORB4/codeSets.h. That defines a set of base classes -use to implement code sets, plus some derived classes that use look-up -tables to convert simple 8-bit and 16-bit code sets to Unicode.

When sending or receiving string data, there are a total of four code -sets in action: a native char code set, a transmission char code set, -a native wchar code set, and a transmission wchar code set. The native -code sets are as described above; the transmission code sets are the -ones selected to communicate with a remote machine. They are -responsible for understanding the GIOP marshalling formats, as well as -the code sets themselves. Each of the four code sets has an object -associated with it which contains methods for converting data.

There are two ways in which a string/wstring can be transmitted or -received. If the transmission code set in action knows how to deal -directly with the native code set (the trivial case being that they -are the same code set, but more complex cases are possible too), the -transmission code set object can directly marshal or unmarshal the -data into or out of the application buffer. If the transmission code -set does not know how to handle the native code set, it converts the -string/wstring into UTF-16, and passes that to the native code set -object (or vice-versa). All code set implementations must therefore -know how to convert to and from UTF-16.

With this explanation, the classes in codeSets.h should be easy -to understand. The next place to look is in the various existing code -set implementations, which are files of the form cs-*.cc in the -src/lib/omniORB/orbcore and src/lib/omniORB/codesets. -Note how all the 8-bit code sets (the ISO 8859-* family) consist -entirely of data and no code, since they are driven by look-up tables.


-1
If you have no idea what this means, don’t -worry—you’re better off not knowing unless you really have -to. -
-
-Previous -Up -Next - - + + + + + + +Interceptors + + +Previous +Up +Next +
+

Chapter 9  Interceptors

+

+

omniORB supports interceptors that allow the application to insert +processing in various points along the call chain, and in various +other locations. It does not (yet) support the standard Portable +Interceptors API.

The interceptor interfaces are defined in a single header, +include/omniORB4/omniInterceptors.h. Each interception point +consists of a singleton object with add() and remove() methods, +and the definition of an ‘interceptor info’ class. For example:

class omniInterceptors { + ... + class clientSendRequest_T { + public: + + class info_T { + public: + GIOP_C& giop_c; + IOP::ServiceContextList service_contexts; + + info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} + + private: + info_T(); + info_T(const info_T&); + info_T& operator=(const info_T&); + }; + + typedef CORBA::Boolean (*interceptFunc)(info_T& info); + + void add(interceptFunc); + void remove(interceptFunc); + }; + ... +};

You can see that the interceptors themselves are functions +that take the info_T object as their argument and return +boolean. Interceptors are called in the order they are registered; +normally, all interceptor functions return true, meaning that +processing should continue with subsequent interceptors. If an +interceptor returns false, later interceptors are not +called. You should only do that if you really know what you are doing.

Notice that the info_T contains references to omniORB internal +data types. The definitions of these types can be found in other +header files within include/omniORB4 and +include/omniORB4/internal.

+

9.1  Interceptor registration

+

All the interceptor singletons are registered within another singleton +object of class omniInterceptors. You retrieve a pointer to the +object with the omniORB::getInterceptors() function, which +must be called after the ORB has been initialised with +CORBA::ORB_init(), but before the ORB is used. The code to +register an interceptor looks, for example, like:

omniInterceptors* interceptors = omniORB::getInterceptors(); +interceptors->clientSendRequest.add(myInterceptorFunc);
+

9.2  Available interceptors

+

The following interceptors are available:

encodeIOR

+Called when encoding an IOR to represent an object reference. This +interception point allows the application to insert extra profile +components into IORs. Note that you must understand and adhere to the +rules about data stored in IORs, otherwise the IORs created may be +invalid. omniORB itself uses this interceptor to insert various items, +so you can see an example of its use in the +insertSupportedComponents() function defined in +src/lib/omniORB/orbcore/ior.cc.
decodeIOR

+Called when decoding an IOR. The application can use this to get out +whatever information they put into IORs with encodeIOR. Again, see +extractSupportedComponents() in +src/lib/omniORB/orbcore/ior.cc for an example.
clientOpenConnection

+Called as a client opens a new connection to a server, after the +connection is opened but before it is used to send a request. The +interceptor function can set the info_T’s reject member +to true to cause the client to immediately close the new +connection and throw CORBA::TRANSIENT to the calling code. In that +case, the interceptor function can also set the why member to +provide a message that is logged.
clientSendRequest

+Called just before a request header is sent over the network. The +application can use it to insert service contexts in the header. See +the setCodeSetServiceContext() function in +src/lib/omniORB/orbcore/cdrStream.cc for an example of its use.
clientReceiveReply

+Called as the client receives a reply, just after unmarshalling the +reply header. Called for normal replies and exceptions.
serverAcceptConnection

+Called when a server accepts a new incoming connection, but before it +reads any data from it. The interceptor function can set the +info_T’s reject member to true to cause the +server to immediately close the new connection. In that case, the +interceptor function can also set the why member to provide a +message that is logged.
serverReceiveRequest

+Called when the server receives a request, just after unmarshalling +the request header. See the getCodeSetServiceContext() function in +src/lib/omniORB/orbcore/cdrStream.cc for an example.
serverSendReply

+Called just before the server marshals a reply header.
serverSendException

+Called just before the server marshals an exception reply header.
createRope

+Called when the ORB is about to create a ‘rope’ that encapsulates a +bundle of connections (‘strands’) to a remote address space. It allows +application code to override omniORB’s normal connection management.
createIdentity

+Called when the ORB is about to create an ‘identity’ object to +represent a CORBA object. It allows application code to provide its +own identity implementations. It is very unlikely that an application +will need to do this.
createORBServer

+Used internally by the ORB to register different kinds of server. At +present, only a GIOP server is registered. It is very unlikely that +application code will need to do this.
createThread

+Called whenever the ORB creates a thread. The info_T class for +this interceptor is
class info_T { + public: + virtual void run() = 0; + virtual omni_thread* self() = 0; + };

The interceptor is called in the context of the newly created thread. +The function must call the info_T’s run() method, to +pass control to the thread body. run() returns just before the +thread exits. This arrangement allows the interceptor to initialise +some per-thread state before the thread body runs, then release it +just before the thread exits.

The info_T’s self() method returns a pointer to the +omni_thread object for the thread, equivalent to calling +omni_thread::self().

assignUpcallThread

+The ORB maintains a general thread pool, from which threads are drawn +for various purposes. One purpose is for performing upcalls to +application code, in response to incoming CORBA calls. The +assignUpcallThread interceptor is called when a thread is +assigned to perform upcalls. In the thread per connection model, the +thread stays assigned to performing upcalls for the entire lifetime of +the underlying network connection; in the thread pool model, threads +are assigned for upcalls on a per call basis, so this interceptor is +triggered for every incoming call1. As with the createThread interceptor, the +interceptor function must call the info_T’s run() method to +pass control to the upcall.

When a thread finishes its assignment of processing upcalls, it +returns to the pool (even in thread per connection mode), so the same +thread can be reassigned to perform more upcalls, or reused for a +different purpose.

assignAMIThread

+Asynchronous Method Invocation (AMI) uses threads to perform outgoing +calls. The assignAMIThread interceptor is called when a thread +is assigned to perform AMI calls. As with the other thread +interceptors, the interceptor function must call the info_T’s +run() method to pass control to the AMI call.

Unlike the other interceptors, the interceptor functions for +createThread, assignUpcallThread and +assignAMIThread have no return values. Interceptor chaining is +performed by calls through the info_T::run() method, rather than +by visiting interceptor functions in turn.

+

9.3  Server-side call interceptor

+

Calls can be intercepted on the server just before the upcall into +application code. This interceptor is registered with omniORB’s +callDescriptor class, which is responsible for encapsulating +the state of a call. Unlike the transport-related +serverReceiveRequest, serverSendReply and +serverSendException interceptors, the callDescriptor +interceptor is invoked for all calls, even ones from colocated +clients in the same address space.

The types used for the call interceptor are defined in +include/omniORB4/callDescriptor.h. The interceptor takes the +form of a bare function with two parameters. The first parameter is a +pointer to the callDescriptor; the second is a pointer to +omniServant, which is the base class of all servant +classes. The interceptor function must call the +callDescriptor’s interceptedCall() method to pass on the +call.

This interception point allows access to various parts of omniORB’s +call machinery. The callDescriptor includes access to the +operation name and, if cast to the concrete subclass defined by the +IDL compiler, the call arguments and return values too.

+
+1
Except that with the +threadPoolWatchConnection parameter set true, a thread +can perform multiple upcalls even when thread pool mode is +active.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB010.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB010.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB010.html 2011-06-01 23:11:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB010.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,142 +1,250 @@ - - - - - - - -Interceptors - - -Previous -Up -Next -
-

Chapter 10  Interceptors

-

omniORB supports interceptors that allow the application to insert -processing in various points along the call chain, and in various -other locations. It does not (yet) support the standard Portable -Interceptors API.

The interceptor interfaces are defined in a single header, -include/omniORB4/omniInterceptors.h. Each interception point -consists of a singleton object with add() and remove() methods, -and the definition of an ‘interceptor info’ class. For example:

class omniInterceptors { - ... - class clientSendRequest_T { - public: - - class info_T { - public: - GIOP_C& giop_c; - IOP::ServiceContextList service_contexts; - - info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} - - private: - info_T(); - info_T(const info_T&); - info_T& operator=(const info_T&); - }; - - typedef CORBA::Boolean (*interceptFunc)(info_T& info); - - void add(interceptFunc); - void remove(interceptFunc); - }; - ... -};

You can see that the interceptors themselves are functions -that take the info_T object as their argument and return -boolean. Interceptors are called in the order they are registered; -normally, all interceptor functions return true, meaning that -processing should continue with subsequent interceptors. If an -interceptor returns false, later interceptors are not called. You -should only do that if you really know what you are doing.

Notice that the info_T contains references to omniORB internal -data types. The definitions of these types can be found in other -header files within include/omniORB4 and -include/omniORB4/internal.

10.1  Interceptor registration

All the interceptor singletons are registered within another singleton -object of class omniInterceptors. You retrieve a pointer to the -object with the omniORB::getInterceptors() function, which -must be called after the ORB has been initialised with -CORBA::ORB_init(), but before the ORB is used. The code to -register an interceptor looks, for example, like:

omniInterceptors* interceptors = omniORB::getInterceptors(); -interceptors->clientSendRequest.add(myInterceptorFunc);

10.2  Available interceptors

The following interceptors are available:

encodeIOR

-Called when encoding an IOR to represent an object reference. This -interception point allows the application to insert extra profile -components into IORs. Note that you must understand and adhere to the -rules about data stored in IORs, otherwise the IORs created may be -invalid. omniORB itself uses this interceptor to insert various items, -so you can see an example of its use in the -insertSupportedComponents() function defined in -src/lib/omniORB/orbcore/ior.cc.
decodeIOR

-Called when decoding an IOR. The application can use this to get out -whatever information they put into IORs with encodeIOR. Again, see -extractSupportedComponents() in -src/lib/omniORB/orbcore/ior.cc for an example.
clientOpenConnection

-Called as a client opens a new connection to a server, after the -connection is opened but before it is used to send a request. The -interceptor function can set the info_T’s reject member -to true to cause the client to immediately close the new connection -and throw CORBA::TRANSIENT to the calling code. In that case, the -interceptor function can also set the why member to provide a -message that is logged.
clientSendRequest

-Called just before a request header is sent over the network. The -application can use it to insert service contexts in the header. See -setCodeSetServiceContext() in -src/lib/omniORB/orbcore/cdrStream.cc for an example of its use.
clientReceiveReply

-Called as the client receives a reply, just after unmarshalling the -reply header. Called for normal replies and exceptions.
serverAcceptConnection

-Called when a server accepts a new incoming connection, but before -it reads any data from it. The interceptor function can set the -info_T’s reject member to true to cause the server to -immediately close the new connection. In that case, the interceptor -function can also set the why member to provide a message -that is logged.
serverReceiveRequest

-Called when the server receives a request, just after unmarshalling -the request header. See the getCodeSetServiceContext() function in -src/lib/omniORB/orbcore/cdrStream.cc for an example.
serverSendReply

-Called just before the server marshals a reply header.
serverSendException

-Called just before the server marshals an exception reply header.
createIdentity

-Called when the ORB is about to create an ‘identity’ object to -represent a CORBA object. It allows application code to provide its -own identity implementations. It is very unlikely that an application -will need to do this.
createORBServer

-Used internally by the ORB to register different kinds of server. At -present, only a GIOP server is registered. It is very unlikely that -application code will need to do this.
createThread

-Called whenever the ORB creates a thread. The info_T class for -this interceptor is
class info_T { - public: - virtual void run() = 0; - };

The interceptor function is called in the context of the newly created -thread. The function must call the info_T’s run() -method, to pass control to the thread body. run() returns just -before the thread exits. This arrangement allows the interceptor to -initialise some per-thread state before the thread body runs, then -release it just before the thread exits.

assignUpcallThread

-The ORB maintains a general thread pool, from which threads are drawn -for various purposes. One purpose is for performing upcalls to -application code, in response to incoming CORBA calls. The -assignUpcallThread interceptor is called when a thread is assigned to -perform upcalls. In the thread per connection model, the thread stays -assigned to performing upcalls for the entire lifetime of the -underlying network connection; in the thread pool model, threads are -assigned for upcalls on a per call basis, so this interceptor is -triggered for every incoming call1. As with the -createThread interceptor, the interceptor function must call the -info_T’s run() method to pass control to the upcall.

When a thread finishes its assignment of processing upcalls, it -returns to the pool (even in thread per connection mode), so the same -thread can be reassigned to perform more upcalls, or reused for a -different purpose.

Unlike the other interceptors, the interceptor functions for -createThread and assignUpcallThread have no return value. Interceptor -chaining is performed by calls through the info_T::run() method, -rather than by visiting interceptor functions in turn.


-1
Except that with the -threadPoolWatchConnection parameter set true, a thread can perform -multiple upcalls even when thread pool mode is active. -
-
-Previous -Up -Next - - + + + + + + +Type Any and TypeCode + + +Previous +Up +Next +
+

Chapter 10  Type Any and TypeCode

+

+

The CORBA specification provides for a type that can hold the value of +any OMG IDL type. This type is known as type Any. The OMG also +specifies a pseudo-object, TypeCode, that can encode a +description of any type specifiable in OMG IDL.

In this chapter, an example demonstrating the use of type Any is +presented. The example code is in the src/examples/anyExample +directory in the omniORB distribution. The example is followed by +sections describing the behaviour of type Any and TypeCode in omniORB. +For further information on type Any, refer to the C++ Mapping +specification., and for more information on TypeCode, refer to the +Interface Repository chapter in the CORBA core section of the CORBA +specification.

+

10.1  Example using type Any

+

Before going through this example, you should make sure that you have +read and understood the examples in chapter 2.

+

10.1.1  Type Any in IDL

+

+Type Any allows one to delay the decision on the type used in an +operation until run-time. To use type any in IDL, use the keyword +any, as in the following example:

// IDL +interface anyExample { + any testOp(in any mesg); +};

The operation testOp() in this example can now take any +value expressible in OMG IDL as an argument, and can also return any +type expressible in OMG IDL.

Type Any is mapped into C++ as the type CORBA::Any. When passed +as an argument or as a result of an operation, the following rules +apply:

+ + +
In InOut Out Return
const CORBA::Any& CORBA::Any& CORBA::Any*& CORBA::Any* +

So, the above IDL would map to the following C++:

// C++ + +class anyExample_i : public virtual POA_anyExample { +public: + anyExample_i() { } + virtual ~anyExample_i() { } + virtual CORBA::Any* testOp(const CORBA::Any& a); +};
+

10.1.2  Inserting and Extracting Basic Types from an Any

+

The question now arises as to how values are inserted into and removed +from an Any. This is achieved using two overloaded operators: +<<= and >>=.

To insert a value into an Any, the <<= operator is used, as +in this example:

// C++ +CORBA::Any an_any; +CORBA::Long l = 100; +an_any <<= l;

Note that the overloaded <<= operator has a return +type of void.

To extract a value, the >>= operator is used, as in this +example (where the Any contains a long):

// C++ +CORBA::Long l; +an_any >>= l; + +cout << "This is a long: " << l << endl;

The overloaded >>= operator returns a CORBA::Boolean. +If an attempt is made to extract a value from an Any when it contains +a different type of value (e.g. an attempt to extract a long from an +Any containing a double), the overloaded >>= operator will +return false; otherwise it will return true. Thus, a +common tactic to extract values from an Any is as follows:

// C++ +CORBA::Long l; +CORBA::Double d; +const char* str; + +if (an_any >>= l) { + cout << "Long: " << l << endl; +} +else if (an_any >>= d) { + cout << "Double: " << d << endl; +} +else if (an_any >>= str) { + cout << "String: " << str << endl; + // The storage of the extracted string is still owned by the any. +} +else { + cout << "Unknown value." << endl; +}
+

10.1.3  Inserting and Extracting Constructed Types from an Any

+

It is also possible to insert and extract constructed types and object +references from an Any. omniidl will generate insertion and extraction +operators for the constructed type. Note that it is necessary to +specify the -Wba command-line flag when running omniidl in +order to generate these operators. The following example illustrates +the use of constructed types with type Any:

// IDL +struct testStruct { + long l; + short s; +}; + +interface anyExample { + any testOp(in any mesg); +};

Upon compiling the above IDL with omniidl -bcxx -Wba, the +following overloaded operators are generated:

  1. +void operator<<=(CORBA::Any&, const testStruct&) +
  2. void operator<<=(CORBA::Any&, testStruct*) +
  3. CORBA::Boolean operator>>=(const CORBA::Any&,
    + const testStruct*&) +

Operators of this form are generated for all constructed types, and +for interfaces.

The first operator, (1), copies the constructed type, and +inserts it into the Any. The second operator, (2), inserts the +constructed type into the Any, and then manages it. Note that if the +second operator is used, the Any consumes the constructed type, and +the caller should not use the pointer to access the data after +insertion. The following is an example of how to insert a value into +an Any using operator (1):

// C++ +CORBA::Any an_any; + +testStruct t; +t.l = 456; +t.s = 8; + +an_any <<= t;

The third operator, (3), is used to extract the constructed +type from the Any, and can be used as follows:

const testStruct* tp; + +if (an_any >>= tp) { + cout << "testStruct: l: " << tp->l << endl; + cout << " s: " << tp->s << endl; +} +else { + cout << "Unknown value contained in Any." << endl; +}

As with basic types, if an attempt is made to extract a type from an +Any that does not contain a value of that type, the extraction +operator returns false. If the Any does contain that type, the +extraction operator returns true. If the extraction is +successful, the caller’s pointer will point to memory managed by the +Any. The caller must not delete or otherwise change this storage, and +should not use this storage after the contents of the Any are replaced +(either by insertion or assignment), or after the Any has been +destroyed. In particular, management of the pointer should not be +assigned to a _var type.

If the extraction fails, the caller’s pointer will be set to point to +null.

Note that there are special rules for inserting and extracting arrays +(using the _forany types), and for inserting and extracting +bounded strings, booleans, chars, and octets. Please refer to the C++ +Mapping specification for further information.

+

10.2  Type Any in omniORB

+

+

This section contains some notes on the use and behaviour of type Any +in omniORB.

+

10.2.1  Generating Insertion and Extraction Operators.

+

+To generate type Any insertion and extraction operators for +constructed types and interfaces, the -Wba command line flag +should be specified when running omniidl.

+

10.2.2  TypeCode comparison when extracting from an Any.

+

+When an attempt is made to extract a type from an Any, the TypeCode of +the type is checked for equivalence with the TypeCode of the +type stored by the Any. The equivalent() test in the TypeCode +interface is used for this purpose. For example:

// IDL 1 +typedef double Double1; + +struct Test1 { + Double1 a; +};
// IDL 2 +typedef double Double2; + +struct Test1 { + Double2 a; +};

If an attempt is made to extract the type Test1 defined in IDL +1 from an Any containing the Test1 defined in IDL 2, this will +succeed (and vice-versa), as the two types differ only by an alias.

+

10.2.3  Top-level aliases.

+

+When a type is inserted into an Any, the Any stores both the value of +the type and the TypeCode for that type. However, in some cases, a +top-level alias can be lost due to the details of the C++ mapping. For +example, consider these IDL definitions:

// IDL 3 +typedef sequence<double> seqDouble1; +typedef sequence<double> seqDouble2; +typedef seqDouble2 seqDouble3;

omniidl generates distinct types for seqDouble1 and +seqDouble2, and therefore each has its own set of C++ operators +for Any insertion and extraction. That means inserting a +seqDouble1 into an Any sets the Any’s TypeCode to include the +alias ‘seqDouble1’, and inserting a seqDouble2 sets the +TypeCode to the alias ‘seqDouble2’.

However, in the C++ mapping, seqDouble3 is required to be just +a C++ typedef to seqDouble2, so the C++ compiler uses the Any +insertion operator for seqDouble2. Therefore, inserting a +seqDouble3 sets the Any’s TypeCode to the seqDouble2 +alias. If this is not desirable, you can use the member function +‘void type(TypeCode_ptr)’ of the Any interface to explicitly +set the TypeCode to the correct one.

+

10.2.4  Removing aliases from TypeCodes.

+

+Some ORBs (such as old versions of Orbix) will not accept TypeCodes +containing tk_alias TypeCodes. When using type Any while +interoperating with these ORBs, it is necessary to remove +tk_alias TypeCodes from throughout the TypeCode representing a +constructed type.

To remove all tk_alias TypeCodes from TypeCodes transmitted in +Anys, supply the -ORBtcAliasExpand 1 command-line flag when +running an omniORB executable. There will be some (small) performance +penalty when transmitting Any values.

Note that the _tc_ TypeCodes generated for all constructed +types will contain the complete TypeCode for the type (including any +tk_alias TypeCodes), regardless of whether the +-ORBtcAliasExpand flag is set to 1 or not. It is only when +Anys are transmitted that the aliases are stripped.

+

10.2.5  Recursive TypeCodes.

+

+omniORB supports recursive TypeCodes. This means that types such as +the following can be inserted or extracted from an Any:

// IDL 4 +struct Test4 { + sequence<Test4> a; +};
+

10.2.6  Threads and type Any.

+

+Inserting and extracting simultaneously from the same Any (in 2 +threads) results in undefined behaviour.

In versions of omniORB before 4.0, extracting simultaneously from the +same Any (in 2 or more different threads) also led to undefined +behaviour. That is no longer the case—Any extraction is now thread +safe.

+

10.3  TypeCode in omniORB

+

This section contains some notes on the use and behaviour of TypeCode +in omniORB

+

10.3.1  TypeCodes in IDL.

+

When using TypeCodes in IDL, note that they are defined in the CORBA +scope. Therefore, CORBA::TypeCode should be used. Example:

// IDL 5 +struct Test5 { + long length; + CORBA::TypeCode desc; +};
+

10.3.2  orb.idl

+

The CORBA specification says that IDL using CORBA::TypeCode +must include the file orb.idl. That is not required in omniORB, +but a suitable orb.idl is available.

+

10.3.3  Generating TypeCodes for constructed types.

+

To generate a TypeCode for constructed types, specify the +-Wba command-line flag when running omniidl. This will +generate a _tc_ TypeCode describing the type, at the same +scope as the type. Example:

// IDL 6 +struct Test6 { + double a; + sequence<long> b; +};

A TypeCode, _tc_Test6, will be generated to describe the +struct Test6. The operations defined in the TypeCode interface +can be used to query the TypeCode about the type it represents.


+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB011.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB011.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB011.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB011.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,446 +1,248 @@ - - - - - - - -Type Any and TypeCode - - -Previous -Up -Next -
-

Chapter 11  Type Any and TypeCode

-

The CORBA specification provides for a type that can hold the value of -any OMG IDL type. This type is known as type Any. The OMG also -specifies a pseudo-object, TypeCode, that can encode a description of -any type specifiable in OMG IDL.

In this chapter, an example demonstrating the use of type Any is -presented. This is followed by sections describing the behaviour of -type Any and TypeCode in omniORB. For further information on type -Any, refer to the C++ Mapping specification., and for more information -on TypeCode, refer to the Interface Repository chapter in the CORBA -core section of the CORBA specification.

11.1  Example using type Any

Before going through this example, you should make sure that you have -read and understood the examples in chapter 2. The -source code for this example is included in the omniORB distribution, -in the directory src/examples/anyExample. A listing of the -source code is provided at the end of this chapter.

11.1.1  Type Any in IDL

-Type Any allows one to delay the decision on the type used in an -operation until run-time. To use type any in IDL, use the keyword -any, as in the following example:

// IDL -interface anyExample { - any testOp(in any mesg); -};

The operation testOp()() in this example can now take any -value expressible in OMG IDL as an argument, and can also return any -type expressible in OMG IDL.

Type Any is mapped into C++ as the type CORBA::Any. When passed -as an argument or as a result of an operation, the following rules -apply:

- - -
In InOut Out Return
const CORBA::Any& CORBA::Any& CORBA::Any*& CORBA::Any*

So, the above IDL would map to the following C++:

// C++ - -class anyExample_i : public virtual POA_anyExample { -public: - anyExample_i() { } - virtual ~anyExample_i() { } - virtual CORBA::Any* testOp(const CORBA::Any& a); -};

11.1.2  Inserting and Extracting Basic Types from an Any

The question now arises as to how values are inserted into and removed -from an Any. This is achieved using two overloaded operators: -<<= and >>=.

To insert a value into an Any, the <<= operator is used, as -in this example:

// C++ -CORBA::Any an_any; -CORBA::Long l = 100; -an_any <<= l;

Note that the overloaded <<= operator has a return -type of void.

To extract a value, the >>= operator is used, as in this -example (where the Any contains a long):

// C++ -CORBA::Long l; -an_any >>= l; - -cout << "This is a long: " << l << endl;

The overloaded >>= operator returns a CORBA::Boolean. -If an attempt is made to extract a value from an Any when it contains -a different type of value (e.g. an attempt to extract a long from an -Any containing a double), the overloaded >>= operator will -return False; otherwise it will return True. Thus, a common tactic to -extract values from an Any is as follows:

// C++ -CORBA::Long l; -CORBA::Double d; -const char* str; - -if (an_any >>= l) { - cout << "Long: " << l << endl; -} -else if (an_any >>= d) { - cout << "Double: " << d << endl; -} -else if (an_any >>= str) { - cout << "String: " << str << endl; - // The storage of the extracted string is still owned by the any. -} -else { - cout << "Unknown value." << endl; -}

11.1.3  Inserting and Extracting Constructed Types from an Any

It is also possible to insert and extract constructed types and object -references from an Any. omniidl will generate insertion and extraction -operators for the constructed type. Note that it is necessary to -specify the -WBa command-line flag when running omniidl in -order to generate these operators. The following example illustrates -the use of constructed types with type Any:

// IDL -struct testStruct { - long l; - short s; -}; - -interface anyExample { - any testOp(in any mesg); -};

Upon compiling the above IDL with omniidl -bcxx -Wba, the -following overloaded operators are generated:

  1. -void operator<<=(CORBA::Any&, const testStruct&) -
  2. void operator<<=(CORBA::Any&, testStruct*) -
  3. CORBA::Boolean operator>>=(const CORBA::Any&,
    - const testStruct*&) -

Operators of this form are generated for all constructed types, and -for interfaces.

The first operator, (1), copies the constructed type, and -inserts it into the Any. The second operator, (2), inserts the -constructed type into the Any, and then manages it. Note that if the -second operator is used, the Any consumes the constructed type, and -the caller should not use the pointer to access the data after -insertion. The following is an example of how to insert a value into -an Any using operator (1):

// C++ -CORBA::Any an_any; - -testStruct t; -t.l = 456; -t.s = 8; - -an_any <<= t;

The third operator, (3), is used to extract the constructed -type from the Any, and can be used as follows:

const testStruct* tp; - -if (an_any >>= tp) { - cout << "testStruct: l: " << tp->l << endl; - cout << " s: " << tp->s << endl; -} -else { - cout << "Unknown value contained in Any." << endl; -}

As with basic types, if an attempt is made to extract a type from an -Any that does not contain a value of that type, the extraction -operator returns False. If the Any does contain that type, the -extraction operator returns True. If the extraction is successful, the -caller’s pointer will point to memory managed by the Any. The caller -must not delete or otherwise change this storage, and should not use -this storage after the contents of the Any are replaced (either by -insertion or assignment), or after the Any has been destroyed. In -particular, management of the pointer should not be assigned to a -_var type.

If the extraction fails, the caller’s pointer will be set to point to -null.

Note that there are special rules for inserting and extracting arrays -(using the _forany types), and for inserting and extracting -bounded strings, booleans, chars, and octets. Please refer to the C++ -Mapping specification for further information.

11.2  Type Any in omniORB

-

This section contains some notes on the use and behaviour of type Any -in omniORB.

11.2.1  Generating Insertion and Extraction Operators.

-To generate type Any insertion and extraction operators for -constructed types and interfaces, the -Wba command line flag -should be specified when running omniidl.

11.2.2  TypeCode comparison when extracting from an Any.

-When an attempt is made to extract a type from an Any, the TypeCode of -the type is checked for equivalence with the TypeCode of the -type stored by the Any. The equivalent() test in the TypeCode -interface is used for this purpose.

Examples:

// IDL 1 -typedef double Double1; - -struct Test1 { - Double1 a; -};
// IDL 2 -typedef double Double2; - -struct Test1 { - Double2 a; -};

If an attempt is made to extract the type Test1 defined in IDL -1 from an Any containing the Test1 defined in IDL 2, this will -succeed (and vice-versa), as the two types differ only by an alias.

11.2.3  Top-level aliases.

-When a type is inserted into an Any, the Any stores both the value of -the type and the TypeCode for that type. However, in some cases, a -top-level alias can be lost due to the details of the C++ mapping. For -example, consider these IDL definitions:

// IDL 3 -typedef sequence<double> seqDouble1; -typedef sequence<double> seqDouble2; -typedef seqDouble2 seqDouble3;

omniidl generates distinct types for seqDouble1 and -seqDouble2, and therefore each has its own set of C++ operators -for Any insertion and extraction. That means inserting a -seqDouble1 into an Any sets the Any’s TypeCode to include the -alias ‘seqDouble1’, and inserting a seqDouble2 sets the -TypeCode to the alias ‘seqDouble2’.

However, in the C++ mapping, seqDouble3 is required to be just -a C++ typedef to seqDouble2, so the C++ compiler uses the Any -insertion operator for seqDouble2. Therefore, inserting a -seqDouble3 sets the Any’s TypeCode to the seqDouble2 -alias. If this is not desirable, you can use the member function -‘void type(TypeCode_ptr)’ of the Any interface to explicitly -set the TypeCode to the correct one.

11.2.4  Removing aliases from TypeCodes.

-Some ORBs (such as old versions of Orbix) will not accept TypeCodes -containing tk_alias TypeCodes. When using type Any while -interoperating with these ORBs, it is necessary to remove -tk_alias TypeCodes from throughout the TypeCode representing a -constructed type.

To remove all tk_alias TypeCodes from TypeCodes transmitted in -Anys, supply the -ORBtcAliasExpand 1 command-line flag when -running an omniORB executable. There will be some (small) performance -penalty when transmitting Any values.

Note that the _tc_ TypeCodes generated for all constructed -types will contain the complete TypeCode for the type (including any -tk_alias TypeCodes), regardless of whether the --ORBtcAliasExpand flag is set to 1 or not. It is only when -Anys are transmitted that the aliases are stripped.

11.2.5  Recursive TypeCodes.

-omniORB supports recursive TypeCodes. This means that types such as -the following can be inserted or extracted from an Any:

// IDL 4 -struct Test4 { - sequence<Test4> a; -};

11.2.6  Threads and type Any.

-Inserting and extracting simultaneously from the same Any (in 2 -different threads) results in undefined behaviour.

In versions of omniORB before 4.0, extracting simultaneously from the -same Any (in 2 or more different threads) also led to undefined -behaviour. That is no longer the case—Any extraction is now thread -safe.

11.3  TypeCode in omniORB

This section contains some notes on the use and behaviour of TypeCode -in omniORB

11.3.1  TypeCodes in IDL.

When using TypeCodes in IDL, note that they are defined in the CORBA -scope. Therefore, CORBA::TypeCode should be used. Example:

// IDL 5 -struct Test5 { - long length; - CORBA::TypeCode desc; -};

11.3.2  orb.idl

The CORBA specification says that IDL using CORBA::TypeCode -must include the file orb.idl. That is not required in omniORB, -but a suitable orb.idl is available.

11.3.3  Generating TypeCodes for constructed types.

To generate a TypeCode for constructed types, specify the --Wba command-line flag when running omniidl. This will -generate a _tc_ TypeCode describing the type, at the same -scope as the type. Example:

// IDL 6 -struct Test6 { - double a; - sequence<long> b; -};

A TypeCode, _tc_Test6, will be generated to describe the -struct Test6. The operations defined in the TypeCode interface -can be used to query the TypeCode about the type it represents.

11.4  Source Listing

11.4.1  anyExample_impl.cc

// anyExample_impl.cc - This is the source code of the example used in -// Chapter 9 "Type Any and TypeCode" of the omniORB -// users guide. -// -// This is the object implementation. -// -// Usage: anyExample_impl -// -// On startup, the object reference is printed to cout as a -// stringified IOR. This string should be used as the argument to -// anyExample_clt. -// - -#include <anyExample.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -class anyExample_i : public POA_anyExample { -public: - inline anyExample_i() {} - virtual ~anyExample_i() {} - virtual CORBA::Any* testOp(const CORBA::Any& a); -}; - - -CORBA::Any* anyExample_i::testOp(const CORBA::Any& a) -{ - cout << "Any received, containing: " << endl; - -#ifndef NO_FLOAT - CORBA::Double d; -#endif - - CORBA::Long l; - const char* str; - - testStruct* tp; - - - if (a >>= l) { - cout << "Long: " << l << endl; - } -#ifndef NO_FLOAT - // XXX - should we provide stream ops for _CORBA_Double_ and - // _CORBA_Float_on VMS?? - else if (a >>= d) { - cout << "Double: " << (double)d << endl; - } -#endif - else if (a >>= str) { - cout << "String: " << str << endl; - } - else if (a >>= tp) { - cout << "testStruct: l: " << tp->l << endl; - cout << " s: " << tp->s << endl; - } - else { - cout << "Unknown value." << endl; - } - - CORBA::Any* ap = new CORBA::Any; - - *ap <<= (CORBA::ULong) 314; - - cout << "Returning Any containing: ULong: 314\n" << endl; - return ap; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - anyExample_i* myobj = new anyExample_i(); - - PortableServer::ObjectId_var myobjid = poa->activate_object(myobj); - - obj = myobj->_this(); - CORBA::String_var sior(orb->object_to_string(obj)); - cout << (char*)sior << endl; - - myobj->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - orb->destroy(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}

11.4.2  anyExample_clt.cc

// anyExample_clt.cc - This is the source code of the example used in -// Chapter 9 "Type Any and TypeCode" of the omniORB -// users guide. -// -// This is the client. -// -// Usage: anyExample_clt <object reference> -// - -#include <anyExample.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - - -static void invokeOp(anyExample_ptr& tobj, const CORBA::Any& a) -{ - CORBA::Any_var bp; - - cout << "Invoking operation." << endl; - bp = tobj->testOp(a); - - cout << "Operation completed. Returned Any: "; - CORBA::ULong ul; - - if (bp >>= ul) { - cout << "ULong: " << ul << "\n" << endl; - } - else { - cout << "Unknown value." << "\n" << endl; - } -} - - -static void hello(anyExample_ptr tobj) -{ - CORBA::Any a; - - // Sending Long - CORBA::Long l = 100; - a <<= l; - cout << "Sending Any containing Long: " << l << endl; - invokeOp(tobj,a); - - // Sending Double -#ifndef NO_FLOAT - CORBA::Double d = 1.2345; - a <<= d; - cout << "Sending Any containing Double: " << d << endl; - invokeOp(tobj,a); -#endif - - // Sending String - const char* str = "Hello"; - a <<= str; - cout << "Sending Any containing String: " << str << endl; - invokeOp(tobj,a); - - // Sending testStruct [Struct defined in IDL] - testStruct t; - t.l = 456; - t.s = 8; - a <<= t; - cout << "Sending Any containing testStruct: l: " << t.l << endl; - cout << " s: " << t.s << endl; - invokeOp(tobj,a); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - if( argc != 2 ) { - cerr << "usage: anyExample_clt <object reference>" << endl; - return 1; - } - - { - CORBA::Object_var obj = orb->string_to_object(argv[1]); - anyExample_var ref = anyExample::_narrow(obj); - if( CORBA::is_nil(ref) ) { - cerr << "Can't narrow reference to type anyExample (or it was nil)." - << endl; - return 1; - } - hello(ref); - } - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}

-Previous -Up -Next - - + + + + + + +Objects by value, etc. + + +Previous +Up +Next +
+

Chapter 11  Objects by value, abstract interfaces and local interfaces

+

+

omniORB 4.1 supports objects by value, declared with the +valuetype keyword in IDL, and both abstract and local +interfaces. This chapter outlines some issues to do with using these +types in omniORB. You are assumed to have read the relevant parts of +the CORBA specification, specifically chapters 3, 4, 5 and 6 of the +CORBA 2.6 specification, and sections 1.17, 1.18 and 1.35 of the C++ +mapping specification, version 1.1.

+

11.1  Features

+

omniORB supports the complete objects by value specification, with the +exception of custom valuetypes. All other valuetype features including +value boxes, value sharing semantics, abstract valuetypes, and +abstract interfaces are supported. Local interfaces are supported, +with a number of caveats outlined in +section 11.8.

+

11.2  Reference counting

+

Values are reference counted. This means that, as long as your +application properly manages reference counts, values are usually +automatically deleted when they are no longer required. However, one +of the features of valuetypes is that they support the representation +of cyclic graph structures. In that kind of situation, the reference +counting garbage collection does not work, because references internal +to the graph prevent the reference counts ever becoming zero.

To avoid memory leaks, application code must explicitly break any +reference cycles in values it manipulates. This includes graphs of +values received as parameters and return values from CORBA operations.

+

11.3  Value sharing and local calls

+

When valuetypes are passed as parameters in CORBA calls (i.e. calls +on CORBA objects declared with interface in IDL), the structure +of related values is maintained. Consider, for example, the following +IDL definitions (which are from the example code in +src/examples/valuetype/simple:

module ValueTest { + valuetype One { + public string s; + public long l; + }; + + interface Test { + One op1(in One a, in One b); + }; +};

If the client to the Test object passes the same value in both +parameters, just one value is transmitted, and the object +implementation receives a copy of the single value, with references to +it in both parameters.

In the case that the object is remote from the client, there is +obviously a copying step involved. In the case that the object is in +the same address space as the client, the same copying semantics must +be maintained so that the object implementation can modify the values +it receives without the client seeing the modifications. To support +that, omniORB must copy the entire parameter list in one operation, in +case there is sharing between different parameters. Such copying is a +rather more time-consuming process than the parameter-by-parameter +copy that takes place in calls not involving valuetypes.

To avoid the overhead of copying parameters in this way, applications +can choose to relax the semantics of value copying in local calls, so +values are not copied at all, but are passed by reference. In that +case, the client to a call will see any modifications to the +values it passes as parameters (and similarly, the object +implementation will see any changes the client makes to returned +values). To choose this option, set the copyValuesInLocalCalls +configuration parameter to zero.

+

11.4  Value box factories

+

With normal valuetypes, omniidl generates factory classes (with names +ending _init) as required by the C++ mapping specification. +The application is responsible for registering the factories with the +ORB.

Unfortunately, the C++ mapping makes no mention of factories for value +boxes. In omniORB, factories for value boxes are automatically +registered with the ORB, and there are no application-visible factory +classes generated for them. Some other CORBA implementations generate +application visible factories, and the application does have to +register the factories with the ORB.

+

11.5  Standard value boxes

+

The standard CORBA::StringValue and CORBA::WStringValue +value boxes are available to application code. To make the definitions +available in IDL, #include the standard orb.idl.

+

11.6  Covariant returns

+

As required by the C++ mapping, on C++ compilers that support +covariant return types, omniidl generates code for the +_copy_value() function that returns the most derived type of the +value. On older compilers, _copy_value() returns +CORBA::ValueBase.

If you write code that calls _copy_value(), and you need to +support older compilers, you should assign the result to a variable of +type CORBA::ValueBase* and downcast to the target type, rather +than using the covariant return.

If you are overriding _copy_value(), you must correctly take +account of the OMNI_HAVE_COVARIANT_RETURNS preprocessor +definition.

+

11.7  Values inside Anys

+

Valuetypes inserted into Anys cause a number of interesting issues. +Even when inside Anys, values are required to support complete sharing +semantics. Take this IDL for example:

module ValueTest { + valuetype One { + public string s; + public long l; + }; + + interface AnyTest { + void op1(in One v, in Any a); + }; +};

Now, suppose the client behaves as follows:

ValueTest::One* v = new One_impl("hello", 123); +CORBA::Any a; +a <<= v; +obj->op1(v, a);

then on the server side:

void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a) +{ + ValueTest::One* v2; + a >>= v2; + assert(v2 == v); +}

This is all very well in this kind of simple situation, but problems +can arise if truncatable valuetypes are used. Imagine this derived +value:

module ValueTest { + valuetype Two : truncatable One { + public double d; + }; +};

Now, suppose that the client shown above sends an instance of +valuetype Two in both parameters, and suppose that the server +has not seen the definition of valuetype Two. In this +situation, as the first parameter is unmarshalled, it will be +truncated to valuetype One, as required. Now, when the Any is +unmarshalled, it refers to the same value, which has been truncated. +So, even though the TypeCode in the Any indicates that the value has +type Two, the stored value actually has type One. If the +receiver of the Any tries to pass it on, transmission will fail +because the Any’s value does not match its TypeCode.

In the opposite situation, where an Any parameter comes before a +valuetype parameter, a different problem occurs. In that case, as the +Any is unmarshalled, there is no type information available for +valuetype Two, so the value inside the Any has an internal +omniORB type used for unknown valuetypes. As the next parameter is +unmarshalled, omniORB sees that the shared value is unknown, and is +able to convert it to the target One valuetype with +truncation. In this case, the Any and the plain valuetype both have +the correct types and values, but the fact that both should have +referred to the same value has been lost.

Because of these issues, it is best to avoid defining interfaces that +mix valuetypes and Anys in a single operation, and certainly to avoid +trying to share plain values with values inside Anys.

+

11.7.1  Values inside DynAnys

+

The sharing semantics of valuetypes can also cause difficulties for +DynAny. The CORBA 2.6 specification does not mention how shared values +inside DynAnys should be handled; the CORBA 3.x specification slightly +clarifies the situation, but it is still unclear. To write portable +code it is best to avoid manipulating DynAnys containing values that +are shared.

In omniORB, when a value inside an Any is converted into a DynAny, the +value’s state is copied into the DynAny, and manipulated there. When +converting back to an Any a new value is created. This means that any +other references to the original value (whether themselves inside Anys +of not) still relate to the original value, with unchanged state. +However, this copying only occurs when a DynValue is actually created, +so for example a structure with two value members referring to the +same value can manipulated inside a DynAny without breaking the +sharing, provided the value members are not accessed as DynAnys. +Extracting the value members as ValueBase will reveal the sharing, for +example.

+

11.8  Local Interfaces

+

+

Local interfaces are somewhat under-specified in the C++ mapping. This +section outlines the way local interfaces are supported in omniORB, +and details the limitations and issues.

+

11.8.1  Simple local interfaces

+

With simple IDL, there are no particular issues:

module Test { + local interface Example { + string hello(in string arg); + }; +};

The IDL compiler generates an abstract base class +Test::Example. The application defines a class derived from it +that implements the abstract hello() member function. Instances of +that class can then be used where the IDL specifies interface +Example.

Note that, by default, local interface implementations have no +reference counting behaviour. If the local object should be deleted +when the last reference is released, the application must implement +the _add_ref() and _remove_ref() virtual member functions +within the implementation class. Make sure that the implementations +are thread safe.

+

11.8.2  Inheritance from unconstrained interfaces

+

Local interfaces can inherit from unconstrained (i.e. non-local) +interfaces:

module Test { + interface One { + void problem(inout string arg); + }; + local interface Two : One { + }; + + interface Receiver { + void setOne(in One a); + }; +};

IDL like this leads to two issues to do with omniORB’s C++ mapping +implementation.

First, an instance of local interface Two should be suitable to +pass as the argument to the setOne() method of a Receiver +object (as long as the object is in the same address space as the +caller). Therefore, the Two abstract base class has to inherit +from the internal class omniORB uses to map object references of type +One. For performance reasons, the class that implements +One object references normally has non-virtual member +functions. That means that the application-supplied problem() +member function for the implementation of local interface Two +will not override the base class’s version. To overcome this, the IDL +for the base unconstrained interface must be compiled with the +-Wbvirtual-objref switch to omniidl. That makes the member +functions of the mapping of One into virtual functions, so they +can be overridden.

The second problem is that, in some cases, omniORB uses a different +mapping for object reference member functions than the mapping used in +servant classes. For example, in the problem() operation, it uses +an internal type for the inout string argument that avoids memory +issues if the application uses a String_var in the argument. +This means that the abstract member function declared in the +Two class (and implemented by the application) has a different +signature to the member function in the base class. The +application-supplied class will therefore not properly override the +base class method. In all likelihood, the C++ compiler will also +complain that the two member functions are ambiguous. The solution to +this problem is to use the implementation mapping in the base object +reference class, rather than the normal object reference mapping, +using the -Wbimpl-mapping switch to omniidl. The consequence +of this is that some uses of _var types for inout arguments +that are normally acceptable in omniORB can now lead to memory +management problems.

In summary, to use local interfaces derived from normal unconstrained +interfaces, you should compile all your IDL with the omniidl flags:

+-Wbvirtual-objref -Wbimpl-mapping +
+

11.8.3  Valuetypes supporting local interfaces

+

According to the IDL specification, it should be possible to declare a +valuetype that supports a local interface:

local interface I { + void my_operation(); +}; +valuetype V supports I { + public string s; +};

omniidl accepts the IDL, but unfortunately the resulting C++ code does +not compile. The C++ mapping specification has a problem in that both +the CORBA::LocalObject and CORBA::ValueBase +classes have _add_ref() and _remove_ref() member +functions defined. The classes generated for the valuetype inherit +from both these base classes, and therefore have an ambiguity. Until +the C++ mapping resolves this conflict, valuetypes supporting local +interfaces cannot be used in omniORB.

+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB012.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB012.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB012.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB012.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,116 +1,72 @@ - - - - - - - -Packaging stubs into DLLs - - -Previous -Up -Next -
-

Chapter 12  Packaging stubs into DLLs

-

omniORB’s stubs can be packaged into shared libraries or DLLs. On Unix -platforms this is mostly painless, but on Windows things are slightly -more tricky.

12.1  Dynamic loading and unloading

As long as your platform supports running static initialisers and -destructors as libraries are loaded and unloaded, you can package -stubs into shared libraries / DLLs, and load them dynamically at -runtime.

There is one minor problem with this, which is that normally nil -object references are heap allocated, and only deallocated when the -ORB is destroyed. That means that if you unload a stub library from -which nil references have been obtained (just by creating an object -reference _var for example), there is a risk of a segmentation fault -when the ORB is destroyed. To avoid that problem, define the -OMNI_UNLOADABLE_STUBS C pre-processor symbol while you are -compiling the stub files. Unfortunately, with that define set, there -is a risk that object reference _vars at global scope will segfault -as they are unloaded. You must not create _vars at global scope if -you are using OMNI_UNLOADABLE_STUBS.

12.2  Windows DLLs

On Unix platforms, the linker figures out how to link the symbols -exported by a library in to the running program. On Windows, -unfortunately, you have to tell the linker where symbols are coming -from. This causes all manner of difficulties.

12.2.1  Exporting symbols

To (statically) link with a DLL file in Windows, you link with a LIB -file which references the symbols exported from the DLL. To build the -LIB and DLL files, the correct symbols must be exported. One way to do -that is to decorate the source code with magic tags that tell the -compiler to export the symbols. The alternative is to provide a DEF -file that lists all the symbols to be exported. omniORB uses a DEF -file.

The question is, how do you create the DEF file? The answer is to use -a Python script named makedeffile.py that lives in the -bin\scripts directory in the omniORB distribution. -makedeffile.py runs the dumpbin program that comes with -Visual C++, and processes its output to extract the necessary symbols. -Although it is designed for exporting the symbols from omniORB stub -files, it can actually be used for arbitrary C++ code. To use it to -create a DLL from a single source file, use the following steps:

  1. -Compile the source:

    cl -c -O2 -MD -GX -Fofoo.o -Tpfoo.cc

  2. Build a static library (It probably won’t work on its own due to -the -MD switch to cl, but we just need it to get the symbols -out):

    lib -out:foo_static.lib foo.o

  3. Use the script to build a .def file:

    makedeffile.py foo_static.lib foo 1.0 foo.def

  4. Build the .dll and .lib with the def file.

    link -out:foo.dll -dll -def:foo.def -implib:foo.lib foo.o -

Of course, you can link together many separate C++ files, rather than -just the one shown here.

12.2.2  Importing constant symbols

As if exporting the symbols from a DLL was not complicated enough, any -constant values exported by a DLL have to be explicitly -imported into the code using them. omniORB’s stub files declare -a number of such constants. This time, the constant declarations in -the generated header files are decorated in a way that tells the -compiler what to do. When the stub headers are #included, the correct -pre-processor defines must be set. If things are not set correctly, -the code all links without problems, but then mysteriously blows up at -run time.

Depending on how complex your situation is, there are a range of -solutions. Starting with the simplest, here are some scenarios you may -find yourself in:

  1. All stub code, and all code that uses it is wrapped up in a -single DLL.

    Do nothing special.

  2. All stub code is in a single DLL. Code using it is in another -DLL, or not in a DLL at all.

    #define USE_stub_in_nt_dll before #include of -the stub headers.

  3. The stubs for each IDL file are in separate DLLs, one DLL per -IDL file.

    In this case, if the IDL files #include each other, when -the stub files are compiled, import declarations are needed so -that references between the separate DLLs work. To do this, -first compile the IDL files with the -Wbdll_stubs -flag:

    omniidl -bcxx -Wbdll_stubs example.idl

    Then define the INCLUDED_stub_in_nt_dll pre-processor -symbol when compiling the stub files. As above, define -USE_stub_in_nt_dll when including the stub headers -into application code.

  4. Stubs and application code are packaged into multiple DLLs, but -DLLs contain the stubs for more than one IDL file.

    This situation is handled by ‘annotating’ the IDL files to -indicate which DLLs they will be compiled into. The annotation -takes the form of some #ifdefs to be inserted in the -stub headers. For example,

    // one.idl - -#pragma hh #ifndef COMPILING_FIRST_DLL -#pragma hh # ifndef USE_stub_in_nt_dll -#pragma hh # define USE_stub_in_nt_dll -#pragma hh # endif -#pragma hh #endif - -#include <two.idl> - -module ModuleOne { - ... -}; - - -// two.idl - -#pragma hh #ifndef COMPILING_SECOND_DLL -#pragma hh # ifndef USE_stub_in_nt_dll -#pragma hh # define USE_stub_in_nt_dll -#pragma hh # endif -#pragma hh #endif - -#include <three.idl> -...

    Here, one.idl is packaged into first.dll and -two.idl is in second.dll. When compiling -first.dll, the COMPILING_FIRST_DLL define is -set, meaning definitions from one.idl (and any other -files in that DLL) are not imported. Any other module that -includes the stub header for one.idl does not define -COMPILING_FIRST_DLL, and thus imports the necessary -symbols from the DLL.

    Rather than explicitly listing all the pre-processor code, it -can be cleaner to use a C++ header file for each DLL. See the -COS services IDL files in idl/COS for an example.


-Previous -Up -Next - - + + + + + + +Asynchronous Method Invocation + + +Previous +Up +Next +
+

Chapter 12  Asynchronous Method Invocation

+

+

omniORB 4.2 supports Asynchronous Method Invocation, AMI, as defined +in the CORBA Messaging specification. It supports both the polling and +callback models of asynchronous calls. Note that omniORB does not +support the other parts of the Messaging specification such as Quality +of Service, Routing and Persistent requests.

While omniORB mainly targets the 2.6 version of the CORBA +specification, the AMI support follows the CORBA Messaging +specification as described in the CORBA 3.1 specification, chapter +17 [OMG08]. That version of the specification is largely +the same as the one in CORBA 2.6. The only significant difference is +that exception replies in the callback model use a simpler +interface-independent mapping.

+

12.1  Implied IDL

+

AMI works by defining some additional implied IDL for each +interface in the real IDL. The implied IDL contains type and +operation definitions that enable asynchronous calls.

As a guide to the implied IDL, there is a special ami +back-end to omniidl that outputs the implied IDL for the given input +IDL. For example, given the Echo example IDL:

// echo.idl +interface Echo { + string echoString(in string mesg); +};

You can output the implied IDL using

+omniidl -bami echo.idl +

That outputs the following to standard out:

// ReplyHandler for interface Echo +interface AMI_EchoHandler : Messaging::ReplyHandler { + void echoString(in string ami_return_val); + void echoString_excep(in ::Messaging::ExceptionHolder excep_holder); +}; + +// Poller valuetype for interface Echo +abstract valuetype AMI_EchoPoller : Messaging::Poller { + void echoString(in unsigned long ami_timeout, out string ami_return_val); +}; + +// AMI implied operations for interface Echo +interface Echo { + void sendc_echoString(in ::AMI_EchoHandler ami_handler, in string mesg); + ::AMI_EchoPoller sendp_echoString(in string mesg); +};

Alternatively, you can use the -Wbdump option to +output an interleaved version that shows the original IDL and the +implied IDL together.

Note that the implied IDL output is for information only. You should +not compile it, but rather instruct the omniidl C++ back-end to +generate the corresponding C++ definitions.

+

12.2  Generating AMI stubs

+

To generate stub code including AMI types and operations, give the +-Wbami command line option to omniidl’s cxx +back-end:

+omniidl -bcxx -Wbami echo.idl +

That generates the normal C++ stubs and skeletons, plus all +the definitions in the implied IDL.

+

12.3  AMI examples

+

Example AMI clients for the Echo server can be found in +src/examples/ami.

+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB013.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB013.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB013.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB013.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,223 +1,122 @@ - - - - - - - -Objects by value, etc. - - -Previous -Up -Next -
-

Chapter 13  Objects by value, abstract interfaces and local interfaces

-

omniORB 4.1 supports objects by value, declared with the -valuetype keyword in IDL, and both abstract and local -interfaces. This chapter outlines some issues to do with using these -types in omniORB. You are assumed to have read the relevant parts of -the CORBA specification, specifically chapters 3, 4, 5 and 6 of the -CORBA 2.6 specification, and sections 1.17, 1.18 and 1.35 of the C++ -mapping specification, version 1.1.

13.1  Features

omniORB supports the complete objects by value specification, with the -exception of custom valuetypes. All other valuetype features including -value boxes, value sharing semantics, abstract valuetypes, and -abstract interfaces are supported. Local interfaces are supported, -with a number of caveats outlined in -section 13.8.

13.2  Reference counting

Values are reference counted. This means that, as long as your -application properly manages reference counts, values are usually -automatically deleted when they are no longer required. However, one -of the features of valuetypes is that they support the representation -of cyclic graph structures. In that kind of situation, the reference -counting garbage collection does not work, because references internal -to the graph prevent the reference counts ever becoming zero.

To avoid memory leaks, application code must explicitly break any -reference cycles in values it manipulates. This includes graphs of -values received as parameters and return values from CORBA operations.

13.3  Value sharing and local calls

When valuetypes are passed as parameters in CORBA calls (i.e. calls -on CORBA objects declared with interface in IDL), the structure -of related values is maintained. Consider, for example, the following -IDL definitions (which are from the example code in -src/examples/valuetype/simple:

module ValueTest { - valuetype One { - public string s; - public long l; - }; - - interface Test { - One op1(in One a, in One b); - }; -};

If the client to the Test object passes the same value in both -parameters, just one value is transmitted, and the object -implementation receives a copy of the single value, with references to -it in both parameters.

In the case that the object is remote from the client, there is -obviously a copying step involved. In the case that the object is in -the same address space as the client, the same copying semantics must -be maintained so that the object implementation can modify the values -it receives without the client seeing the modifications. To support -that, omniORB must copy the entire parameter list in one operation, in -case there is sharing between different parameters. Such copying is a -rather more time-consuming process than the parameter-by-parameter -copy that takes place in calls not involving valuetypes.

To avoid the overhead of copying parameters in this way, applications -can choose to relax the semantics of value copying in local calls, so -values are not copied at all, but are passed by reference. In that -case, the client to a call will see any modifications to the -values it passes as parameters (and similarly, the object -implementation will see any changes the client makes to returned -values). To choose this option, set the copyValuesInLocalCalls -configuration parameter to zero.

13.4  Value box factories

With normal valuetypes, omniidl generates factory classes (with names -ending _init) as required by the C++ mapping specification. -The application is responsible for registering the factories with the -ORB.

Unfortunately, the C++ mapping makes no mention of factories for value -boxes. In omniORB, factories for value boxes are automatically -registered with the ORB, and there are no application-visible factory -classes generated for them. Some other CORBA implementations generate -application visible factories, and the application does have to -register the factories with the ORB.

13.5  Standard value boxes

The standard CORBA::StringValue and CORBA::WStringValue -value boxes are available to application code. To make the definitions -available in IDL, #include the standard orb.idl.

13.6  Covariant returns

As required by the C++ mapping, on C++ compilers that support -covariant return types, omniidl generates code for the -_copy_value() function that returns the most derived type of the -value. On older compilers, _copy_value() returns -CORBA::ValueBase.

If you write code that calls _copy_value(), and you need to -support older compilers, you should assign the result to a variable of -type CORBA::ValueBase* and downcast to the target type, rather -than using the covariant return.

If you are overriding _copy_value(), you must correctly take -account of the OMNI_HAVE_COVARIANT_RETURNS preprocessor -definition.

13.7  Values inside Anys

Valuetypes inserted into Anys cause a number of interesting issues. -Even when inside Anys, values are required to support complete sharing -semantics. Take this IDL for example:

module ValueTest { - valuetype One { - public string s; - public long l; - }; - - interface AnyTest { - void op1(in One v, in Any a); - }; -};

Now, suppose the client behaves as follows:

ValueTest::One* v = new One_impl("hello", 123); -CORBA::Any a; -a <<= v; -obj->op1(v, a);

then on the server side:

void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a) -{ - ValueTest::One* v2; - a >>= v2; - assert(v2 == v); -}

This is all very well in this kind of simple situation, but problems -can arise if truncatable valuetypes are used. Imagine this derived -value:

module ValueTest { - valuetype Two : truncatable One { - public double d; - }; -};

Now, suppose that the client shown above sends an instance of -valuetype Two in both parameters, and suppose that the server -has not seen the definition of valuetype Two. In this -situation, as the first parameter is unmarshalled, it will be -truncated to valuetype One, as required. Now, when the Any is -unmarshalled, it refers to the same value, which has been truncated. -So, even though the TypeCode in the Any indicates that the value has -type Two, the stored value actually has type One. If the -receiver of the Any tries to pass it on, transmission will fail -because the Any’s value does not match its TypeCode.

In the opposite situation, where an Any parameter comes before a -valuetype parameter, a different problem occurs. In that case, as the -Any is unmarshalled, there is no type information available for -valuetype Two, so the value inside the Any has an internal -omniORB type used for unknown valuetypes. As the next parameter is -unmarshalled, omniORB sees that the shared value is unknown, and is -able to convert it to the target One valuetype with -truncation. In this case, the Any and the plain valuetype both have -the correct types and values, but the fact that both should have -referred to the same value has been lost.

Because of these issues, it is best to avoid defining interfaces that -mix valuetypes and Anys in a single operation, and certainly to avoid -trying to share plain values with values inside Anys.

13.7.1  Values inside DynAnys

The sharing semantics of valuetypes can also cause difficulties for -DynAny. The CORBA 2.6 specification does not mention how shared values -inside DynAnys should be handled; the CORBA 3.x specification slightly -clarifies the situation, but it is still unclear. To write portable -code it is best to avoid manipulating DynAnys containing values that -are shared.

In omniORB, when a value inside an Any is converted into a DynAny, the -value’s state is copied into the DynAny, and manipulated there. When -converting back to an Any a new value is created. This means that any -other references to the original value (whether themselves inside Anys -of not) still relate to the original value, with unchanged state. -However, this copying only occurs when a DynValue is actually created, -so for example a structure with two value members referring to the -same value can manipulated inside a DynAny without breaking the -sharing, provided the value members are not accessed as DynAnys. -Extracting the value members as ValueBase will reveal the sharing, for -example.

13.8  Local Interfaces

-

Local interfaces are somewhat under-specified in the C++ mapping. This -section outlines the way local interfaces are supported in omniORB, -and details the limitations and issues.

13.8.1  Simple local interfaces

With simple IDL, there are no particular issues:

module Test { - local interface Example { - string hello(in string arg); - }; -};

The IDL compiler generates an abstract base class -Test::Example. The application defines a class derived from it -that implements the abstract hello() member function. Instances of -that class can then be used where the IDL specifies interface -Example.

Note that, by default, local interface implementations have no -reference counting behaviour. If the local object should be deleted -when the last reference is released, the application must implement -the _add_ref() and _remove_ref() virtual member functions -within the implementation class. Make sure that the implementations -are thread safe.

13.8.2  Inheritance from unconstrained interfaces

Local interfaces can inherit from unconstrained (i.e. non-local) -interfaces:

module Test { - interface One { - void problem(inout string arg); - }; - local interface Two : One { - }; - - interface Receiver { - void setOne(in One a); - }; -};

IDL like this leads to two issues to do with omniORB’s C++ mapping -implementation.

First, an instance of local interface Two should be suitable to -pass as the argument to the setOne() method of a Receiver -object (as long as the object is in the same address space as the -caller). Therefore, the Two abstract base class has to inherit -from the internal class omniORB uses to map object references of type -One. For performance reasons, the class that implements -One object references normally has non-virtual member -functions. That means that the application-supplied problem() -member function for the implementation of local interface Two -will not override the base class’s version. To overcome this, the IDL -for the base unconstrained interface must be compiled with the --Wbvirtual_objref switch to omniidl. That makes the member functions -of the mapping of One into virtual functions, so they can be -overridden.

The second problem is that, in some cases, omniORB uses a different -mapping for object reference member functions than the mapping used in -servant classes. For example, in the problem() operation, it uses -an internal type for the inout string argument that avoids memory -issues if the application uses a String_var in the argument. This -means that the abstract member function declared in the Two -class (and implemented by the application) has a different signature -to the member function in the base class. The application-supplied -class will therefore not properly override the base class method. In -all likelihood, the C++ compiler will also complain that the two -member functions are ambiguous. The solution to this problem is to use -the implementation mapping in the base object reference class, rather -than the normal object reference mapping, using the -Wbimpl_mapping -switch to omniidl. The consequence of this is that some uses of _var -types for inout arguments that are normally acceptable in omniORB now -lead to memory problems.

In summary, to use local interfaces derived from normal unconstrained -interfaces, you should compile all your IDL with the omniidl flags:

--Wbvirtual_objref -Wbimpl_mapping -

13.8.3  Valuetypes supporting local interfaces

According to the IDL specification, it should be possible to declare a -valuetype that supports a local interface:

local interface I { - void my_operation(); -}; -valuetype V supports I { - public string s; -};

omniidl accepts the IDL, but unfortunately the resulting C++ code does -not compile. The C++ mapping specification has a problem in that both -the CORBA::LocalObject and CORBA::ValueBase -classes have add_ref() and remove_ref() member functions -defined. The classes generated for the valuetype inherit from both -these base classes, and therefore have an ambiguity. Until the C++ -mapping resolves this conflict, valuetypes supporting local interfaces -cannot be used in omniORB.


-Previous -Up -Next - - + + + + + + +Interface Type Checking + + +Previous +Up +Next +
+

Chapter 13  Interface Type Checking

+

+

This chapter describes the mechanism used by omniORB to ensure type +safety when object references are exchanged across the network. This +mechanism is handled completely within the ORB. There is no +programming interface visible at the application level. However, for +the sake of diagnosing the problem when there is a type violation, it +is useful to understand the underlying mechanism in order to interpret +the error conditions reported by the ORB.

+

13.1  Introduction

+

In GIOP/IIOP, an object reference is encoded as an Interoperable +Object Reference (IOR) when it is sent across a network connection. +The IOR contains a Repository ID (RepoId) and one or more +communication profiles. The communication profiles describe where and +how the object can be contacted. The RepoId is a string which uniquely +identifies the IDL interface of the object.

Unless the ID pragma is specified in the IDL, the ORB generates +the RepoId string in the so-called OMG IDL Format1. For instance, the RepoId for the Echo +interface used in the examples of chapter 2 is +IDL:Echo:1.0.

When interface inheritance is used in the IDL, the ORB always sends the +RepoId of the most derived interface. For example:

// IDL + interface A { + ... + }; + interface B : A { + ... + }; + interface C { + void op(in A arg); + };
// C++ + C_ptr server; + B_ptr objB; + A_ptr objA = objB; + server->op(objA); // Send B as A

In the example, the operation C::op() accepts an object reference +of type A. The real type of the reference passed to C::op() +is B, which inherits from A. In this case, the RepoId of +B, and not that of A, is sent across the network.

The GIOP/IIOP specification allows an ORB to send a null string in the +RepoId field of an IOR. It is up to the receiving end to work out the +real type of the object. omniORB never sends out null strings as +RepoIds, but it may receive null RepoIds from other ORBs. In that +case, it will use the mechanism described below to ensure type safety.

+

13.2  Interface Inheritance

+

When the ORB receives an IOR of interface type B when it expects the +type to be A, it must find out if B inherits from A. When the ORB has +no local knowledge of the type B, it must work out the type of B +dynamically.

The CORBA specification defines an Interface Repository (IR) from +which IDL interfaces can be queried dynamically. In the above +situation, the ORB could contact the IR to find out the type of B. +However, this approach assumes that an IR is always available and +contains the up-to-date information of all the interfaces used in the +domain. This assumption may not be valid in many applications.

An alternative is to use the _is_a() operation to work out the +actual type of an object. This approach is simpler and more robust +than the previous one because no 3rd party is involved, so this is +what omniORB does.

class Object{ + CORBA::Boolean _is_a(const char* type_id); +};

The _is_a() operation is part of the CORBA::Object +interface and must be implemented by every object. The input argument +is a RepoId. The function returns true if the object is really +an instance of that type, including if that type is a base type of the +most derived type of that object.

In the situation above, the ORB would invoke the _is_a() +operation on the object and ask if the object is of type A +before it processes any application invocation on the object.

Notice that the _is_a() call is not performed when the IOR +is unmarshalled. It is performed just prior to the first application +invocation on the object. This leads to some interesting failure modes +if B reports that it is not an A. Consider the following example:

// IDL +interface A { ... }; +interface B : A { ... }; +interface D { ... }; +interface C { + A op1(); + Object op2(); +};
1 // C++ + 2 C_ptr objC; + 3 A_ptr objA; + 4 CORBA::Object_ptr objR; + 5 + 6 objA = objC->op1(); + 7 (void) objA->_non_existent(); + 8 + 9 objR = objC->op2(); + 10 objA = A::_narrow(objR);

If the stubs of A,B,C,D are linked into the executable and:

+Case 1
C::op1() and C::op2() return a B. Lines 6–10 +complete successfully. The remote object is only contacted at line 7.
Case 2
C::op1() and C::op2() return a D. This condition +only occurs if the runtime of the remote end is buggy. Even though the +IDL definitions show that D is not derived from A, omniORB gives it +the benefit of the doubt, in case it actually has a more derived +interface that is derived from both A and D. At line 7, the object is +contacted to ask if it is an A. The answer is no, so a +CORBA::INV_OBJREF exception is raised. At line 10, the narrow +operation will fail, and objA will be set to nil. +

If only the stubs of A are linked into the executable and:

+Case 1
C::op1() and C::op2() return a B. Lines 6–10 +complete successfully. When lines 7 and 10 are executed, the object is +contacted to ask if it is an A.
Case 2
C::op1() and C::op2() return a D. This condition +only occurs if the runtime of the remote end is buggy. Line 6 +completes and no exception is raised. At line 7, the object is +contacted to ask if it is an A. If the answer is no, a +CORBA::INV_OBJREF exception is raised. At line 10, the narrow +operation will fail, and objA will be set to nil. +
+
+1
For further +details of the repository ID formats, see section 10.6 in the CORBA +2.6 specification.
+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB014.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB014.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB014.html 2009-07-16 14:57:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB014.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,42 +1,124 @@ - - - - - - - -References - - -Previous -Up -
-

References

-[BLFIM98]
-T. Berners-Lee, R. Fielding, U.C. Irvine, and L. Masinter. -Uniform Resource Identifiers (URI): Generic Syntax. -RFC 2396, August 1998.
[HV99]
-Michi Henning and Steve Vinoski. -Advanced CORBA Programming with C++. -Addison-Wesley professional computing series, 1999.
[OMG98]
-Object Management Group. -CORBAServices: Common Object Services Specification, December -1998.
[OMG00]
-Object Management Group. -Interoperable Naming Service revised chapters, August 2000. -From http://www.omg.org/cgi-bin/doc?ptc/00-08-07.
[OMG01]
-Object Management Group. -The Common Object Request Broker: Architecture and -Specification, 2.6 edition, December 2001. -From http://www.omg.org/cgi-bin/doc?formal/01-12-01.
[OMG03]
-Object Management Group. -C++ Language Mapping, 1.1 edition, 2003. -From http://www.omg.org/cgi-bin/doc?formal/03-06-03.
[Ric96]
-Tristan Richardson. -The OMNI Thread Abstraction. -AT&T Laboratories Cambridge, October 1996.

-Previous -Up - - + + + + + + +Packaging stubs into DLLs + + +Previous +Up +Next +
+

Chapter 14  Packaging stubs into DLLs

+

+

omniORB’s stubs can be packaged into shared libraries or DLLs. On Unix +platforms this is mostly painless, but on Windows things are slightly +more tricky.

+

14.1  Dynamic loading and unloading

+

As long as your platform supports running static initialisers and +destructors as libraries are loaded and unloaded, you can package +stubs into shared libraries / DLLs, and load them dynamically at +runtime.

There is one minor problem with this, which is that normally nil +object references are heap allocated, and only deallocated when the +ORB is destroyed. That means that if you unload a stub library from +which nil references have been obtained (just by creating an object +reference _var for example), there is a risk of a segmentation fault +when the ORB is destroyed. To avoid that problem, define the +OMNI_UNLOADABLE_STUBS C pre-processor symbol while you are +compiling the stub files. Unfortunately, with that define set, there +is a risk that object reference _vars at global scope will segfault +as they are unloaded. You must not create _vars at global scope if +you are using OMNI_UNLOADABLE_STUBS.

+

14.2  Windows DLLs

+

On Unix platforms, the linker figures out how to link the symbols +exported by a library in to the running program. On Windows, +unfortunately, you have to tell the linker where symbols are coming +from. This causes all manner of difficulties.

+

14.2.1  Exporting symbols

+

To (statically) link with a DLL file in Windows, you link with a LIB +file which references the symbols exported from the DLL. To build the +LIB and DLL files, the correct symbols must be exported. One way to do +that is to decorate the source code with magic tags that tell the +compiler to export the symbols. The alternative is to provide a DEF +file that lists all the symbols to be exported. omniORB uses a DEF +file.

The question is, how do you create the DEF file? The answer is to use +a Python script named makedeffile.py that lives in the +bin\scripts directory in the omniORB distribution. +makedeffile.py runs the dumpbin program that comes with +Visual C++, and processes its output to extract the necessary symbols. +Although it is designed for exporting the symbols from omniORB stub +files, it can actually be used for arbitrary C++ code. To use it to +create a DLL from a single source file, use the following steps:

  1. +Compile the source:

    cl -c -O2 -MD -GX -Fofoo.o -Tpfoo.cc

  2. Build a static library (It probably won’t work on its own due to +the -MD switch to cl, but we just need it to get the symbols +out):

    lib -out:foo_static.lib foo.o

  3. Use the script to build a .def file:

    makedeffile.py foo_static.lib foo 1.0 foo.def

  4. Build the .dll and .lib with the def file.

    link -out:foo.dll -dll -def:foo.def -implib:foo.lib foo.o +

Of course, you can link together many separate C++ files, rather than +just the one shown here.

+

14.2.2  Importing constant symbols

+

As if exporting the symbols from a DLL was not complicated enough, any +constant values exported by a DLL have to be explicitly +imported into the code using them. omniORB’s stub files declare +a number of such constants. This time, the constant declarations in +the generated header files are decorated in a way that tells the +compiler what to do. When the stub headers are #included, the correct +pre-processor defines must be set. If things are not set correctly, +the code all links without problems, but then mysteriously blows up at +run time.

Depending on how complex your situation is, there are a range of +solutions. Starting with the simplest, here are some scenarios you may +find yourself in:

  1. All stub code, and all code that uses it is wrapped up in a +single DLL.

    Do nothing special.

  2. All stub code is in a single DLL. Code using it is in another +DLL, or not in a DLL at all.

    #define USE_stub_in_nt_dll before #include of +the stub headers.

  3. The stubs for each IDL file are in separate DLLs, one DLL per +IDL file.

    In this case, if the IDL files #include each other, then +when the stub files are compiled, import declarations are needed +so that references between the separate DLLs work. To do this, +first compile the IDL files with the -Wbdll_stubs +flag:

    omniidl -bcxx -Wbdll_stubs example.idl

    Then define the INCLUDED_stub_in_nt_dll pre-processor +symbol when compiling the stub files. As above, define +USE_stub_in_nt_dll when including the stub headers +into application code.

  4. Stubs and application code are packaged into multiple DLLs, but +DLLs contain the stubs for more than one IDL file.

    This situation is handled by ‘annotating’ the IDL files to +indicate which DLLs they will be compiled into. The annotation +takes the form of some #ifdefs to be inserted in the +stub headers. For example,

    // one.idl + +#pragma hh #ifndef COMPILING_FIRST_DLL +#pragma hh # ifndef USE_stub_in_nt_dll +#pragma hh # define USE_stub_in_nt_dll +#pragma hh # endif +#pragma hh #endif + +#include <two.idl> + +module ModuleOne { + ... +}; + + +// two.idl + +#pragma hh #ifndef COMPILING_SECOND_DLL +#pragma hh # ifndef USE_stub_in_nt_dll +#pragma hh # define USE_stub_in_nt_dll +#pragma hh # endif +#pragma hh #endif + +#include <three.idl> +...

    Here, one.idl is packaged into first.dll and +two.idl is in second.dll. When compiling +first.dll, the COMPILING_FIRST_DLL define is +set, meaning definitions from one.idl (and any other +files in that DLL) are not imported. Any other module that +includes the stub header for one.idl does not define +COMPILING_FIRST_DLL, and thus imports the necessary +symbols from the DLL.

    Rather than explicitly listing all the pre-processor code, it +can be cleaner to use a C++ header file for each DLL. See the +COS services IDL files in idl/COS for an example.

+
+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB015.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB015.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB015.html 2005-07-19 10:34:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB015.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,61 +1,25 @@ - - - - - - - - - - -References - - - -Previous -Up -
- -

References

[BLFIM98]
-T. Berners-Lee, R. Fielding, U.C. Irvine, and L. Masinter. -Uniform Resource Identifiers (URI): Generic Syntax. -RFC 2396, August 1998.
-
-
[HV99]
-Michi Henning and Steve Vinoski. -Advanced CORBA Programming with C++. -Addison-Wesley professional computing series, 1999.
-
-
[OMG98]
-Object Management Group. -CORBAServices: Common Object Services Specification, December - 1998.
-
-
[OMG00]
-Object Management Group. -Interoperable Naming Service revised chapters, August 2000. -From http://www.omg.org/cgi-bin/doc?ptc/00-08-07.
-
-
[OMG01]
-Object Management Group. -The Common Object Request Broker: Architecture and - Specification, 2.6 edition, December 2001. -From http://www.omg.org/cgi-bin/doc?formal/01-12-01.
-
-
[OMG03]
-Object Management Group. -C++ Language Mapping, 1.1 edition, 2003. -From http://www.omg.org/cgi-bin/doc?formal/03-06-03.
-
-
[Ric96]
-Tristan Richardson. -The OMNI Thread Abstraction. -AT&T Laboratories Cambridge, October 1996.
- - -
-Previous -Up - - + + + + + + +Resources + + +Previous +Up +Next +
+

Chapter 15  Resources

+

There are a number of useful online resources related to omniORB:


+Previous +Up +Next + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB016.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB016.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB016.html 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB016.html 2017-05-10 23:52:28.000000000 +0000 @@ -0,0 +1,45 @@ + + + + + + +References + + +Previous +Up +
+

References

+
+[BLFIM98]
+T. Berners-Lee, R. Fielding, U.C. Irvine, and L. Masinter. +Uniform Resource Identifiers (URI): Generic Syntax. +RFC 2396, August 1998.
[HV99]
+Michi Henning and Steve Vinoski. +Advanced CORBA Programming with C++. +Addison-Wesley professional computing series, 1999.
[OMG98]
+Object Management Group. +CORBAServices: Common Object Services Specification, December +1998.
[OMG00]
+Object Management Group. +Interoperable Naming Service revised chapters, August 2000. +From http://www.omg.org/cgi-bin/doc?ptc/00-08-07.
[OMG01]
+Object Management Group. +The Common Object Request Broker: Architecture and +Specification, 2.6 edition, December 2001. +From http://www.omg.org/cgi-bin/doc?formal/01-12-01.
[OMG03]
+Object Management Group. +C++ Language Mapping, 1.1 edition, 2003. +From http://www.omg.org/cgi-bin/doc?formal/03-06-03.
[OMG08]
+Object Management Group. +The Common Object Request Broker: Architecture and +Specification, 3.1 edition, January 2008. +From http://www.omg.org/cgi-bin/doc?formal/08-01-04.
[Ric96]
+Tristan Richardson. +The OMNI Thread Abstraction. +AT&T Laboratories Cambridge, October 1996.

+Previous +Up + + diff -Nru omniorb-dfsg-4.1.6/doc/omniORB/omniORB.html omniorb-dfsg-4.2.2/doc/omniORB/omniORB.html --- omniorb-dfsg-4.1.6/doc/omniORB/omniORB.html 2011-06-01 23:11:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/omniORB/omniORB.html 2017-05-10 23:52:28.000000000 +0000 @@ -1,39 +1,45 @@ - - - -omniORB - - - - - - + +omniORB + + -

The omniORB version 4.1
-User’s Guide -

Duncan Grisby
-
(email: dgrisby@apasphere.com)
-Apasphere Ltd.
-Sai-Lai Lo
-David Riddoch
-AT&T Laboratories Cambridge
-

July 2009 -

Changes and Additions, July 2007 -

  • -Updates for omniORB 4.1.1. -

Changes and Additions, June 2005 -

  • -New omniORB 4.1 features. -

Changes and Additions, October 2004 -

  • -Packaging stubs into DLLs. -

Changes and Additions, July 2004 -

  • -Minor updates. -

Changes and Additions, November 2002 -

  • -Per thread timeouts. -
  • Implement missing interceptors. -
  • Minor fixes. -

Changes and Additions, June 2002 -

  • -Updated to omniORB 4.0. -

Contents

-

Chapter 1  Introduction

omniORB is an Object Request Broker (ORB) that implements the 2.6 -specification of the Common Object Request Broker Architecture -(CORBA) [OMG01]1. It has -passed the Open Group CORBA compliant testsuite (for CORBA 2.1) and -was one of the three ORBs to be granted the CORBA brand in June -19992.

This user guide tells you how to use omniORB to develop CORBA -applications. It assumes a basic understanding of CORBA.

In this chapter, we give an overview of the main features of omniORB -and what you need to do to setup your environment to run omniORB.

-

1.1  Features

-

1.1.1  Multithreading

omniORB is fully multithreaded. To achieve low call overhead, -unnecessary call-multiplexing is eliminated. With the default +

The omniORB version 4.2
+Users’ Guide +

Duncan Grisby
+
(dgrisby@apasphere.com)
+

Contents

+ +

Chapter 1  Introduction

omniORB is an Object Request Broker (ORB) that implements version 2.6 +of the Common Object Request Broker Architecture +(CORBA) [OMG01] specification. Where possible, backward +compatibility has been maintained back to specification 2.0. It passed +the Open Group CORBA compliant testsuite (for CORBA 2.1) and was one +of the three ORBs to be granted the CORBA brand in June 1999.

This user guide tells you how to use omniORB to develop CORBA +applications. It assumes a basic understanding of CORBA.

In this chapter, we give an overview of the main features of omniORB +and what you need to do to set up your environment to run omniORB.

+ +

1.1  Features

omniORB is quite feature-rich, but it does not slavishly implement +every last part of the CORBA specification. The goal is to provide the +most generally useful parts of the specification in a clean and +efficient manner. Highlights are:

  • C++ and Python language bindings.
  • Support for the complete Portable Object Adapter (POA) specification.
  • Support for the Interoperable Naming Service (INS).
  • Internet Inter-ORB Protocol (IIOP 1.2) is used as the native +protocol.
  • The omniORB runtime is fully multithreaded. It uses platform +thread support encapsulated with a small class library, omnithread, +to abstract away from differences in native thread APIs.
  • TypeCode and type Any are supported.
  • DynAny is supported.
  • The Dynamic Invocation and Dynamic Skeleton interfaces are supported.
  • Valuetype and abstract interfaces are supported.
  • Asynchronous Method Invocation (AMI) supported, including both +polling and callback models.
  • Extensive control over connection management.
  • Soft real-time features including call deadlines and timeouts.
  • A COS Naming Service, omniNames.
  • Many platforms are supported, including most Unix platforms and +Windows.
  • It has been successfully tested for interoperability via IIOP with +other ORBs.
+ +

1.1.1  Multithreading

omniORB is fully multithreaded. To achieve low call overhead, +unnecessary call multiplexing is eliminated. With the default policies, there is at most one call in-flight in each communication channel between two address spaces at any one time. To do this without limiting the level of concurrency, new channels connecting the two @@ -99,1619 +93,1575 @@ arguments, large data elements are sent as soon as they are processed while the other arguments are being marshalled. With GIOP 1.2, large messages are fragmented, so the marshaller can start transmission -before it knows how large the entire message will be.

From version 4.0 onwards, omniORB also supports a flexible thread -pooling policy, and supports sending multiple interleaved calls on a -single connection. This policy leads to a small amount of additional -call overhead, compared to the default thread per connection model, -but allows omniORB to scale to extremely large numbers of concurrent -clients.

-

1.1.2  Portability

omniORB has always been designed to be portable. It runs on many -flavours of Unix, Windows, several embedded operating systems, and -relatively obscure systems such as OpenVMS and Fujitsu-Siemens BS2000. -It is designed to be easy to port to new platforms. The IDL to C++ -mapping for all target platforms is the same.

omniORB uses real C++ exceptions and nested classes. It keeps to the +before it knows how large the entire message will be.

omniORB also supports a flexible thread pool policy, and supports +sending multiple interleaved calls on a single connection. This policy +leads to a small amount of additional call overhead, compared to the +default thread per connection model, but allows omniORB to scale to +extremely large numbers of concurrent clients.

+ +

1.1.2  Portability

omniORB runs on many flavours of Unix, Windows, several embedded +operating systems, and relatively obscure systems such as OpenVMS and +Fujitsu-Siemens BS2000. It is designed to be easy to port to new +platforms. The IDL to C++ mapping for all target platforms is the +same.

omniORB uses real C++ exceptions and nested classes. It keeps to the CORBA specification’s standard mapping as much as possible and does -not use the alternative mappings for C++ dialects. The only exception -is the mapping of IDL modules, which can use either namespaces or -nested classes.

omniORB relies on native thread libraries to provide multithreading -capability. A small class library (omnithread [Ric96]) is used +not use the alternative mappings for C++ dialects. The only small +exception is the mapping of IDL modules, which can use either +namespaces according to the standard, or nested classes for truly +ancient C++ compilers without namespace support.

omniORB relies on native thread libraries to provide multithreading +capability. A small class library (omnithread [Ric96]) is used to encapsulate the APIs of the native thread libraries. In application code, it is recommended but not mandatory to use this class library for thread management. It should be easy to port omnithread to any platform that either supports the POSIX thread standard or has a -thread package that supports similar capabilities.

-

1.1.3  Missing features

-

omniORB is not (yet) a complete implementation of the CORBA 2.6 core. -The following is a list of the most significant missing features.

  • omniORB does not have its own Interface Repository. However, it +thread package that supports similar capabilities.

    Partly for historical reasons, and partly to support users with +archaic compilers, omniORB does not use the C++ standard library.

    The omniORB IDL compiler, omniidl, requires Python 2.5, 2.6 or 2.7.

    + +

    1.1.3  Missing features

    +

    omniORB is not a complete implementation of the CORBA 2.6 core. The +following is a list of the most significant missing features.

    • omniORB does not have its own Interface Repository. However, it can act as a client to an IfR. The omniifr project -(http://omniifr.sourceforge.net/) aims to create an IfR for -omniORB.
    • omniORB supports interceptors, but not the standard Portable -Interceptor API.

    These features may be implemented in the short to medium term. It is -best to check out the latest status on the omniORB home page -(http://omniorb.sourceforge.net/).

    -

    1.2  Setting up your environment

    -

    To get omniORB running, you first need to install omniORB according to -the instructions in the installation notes for your platform. Most -Unix platforms can use the Autoconf configure script to -automate the configuration process.

    Once omniORB is installed in a suitable location, you must configure -it according to your required set-up. The configuration can be set -with a configuration file, environment variables, command-line -arguments or, on Windows, the Windows registry.

    • On Unix platforms, the omniORB runtime looks for the environment -variable OMNIORB_CONFIG. If this variable is defined, it +(http://omniifr.sourceforge.net/) aims to create an IfR for +omniORB.
    • omniORB supports interceptors, but not the standard Portable +Interceptor API.
    + +

    1.2  Setting up your environment

    +

    To get omniORB running, you first need to install omniORB according to +the instructions in the installation notes for your platform. See +README.FIRST.txt at the top of the omniORB tree for +instructions. Most Unix platforms can use the Autoconf +configure script to automate the configuration process.

    Once omniORB is installed in a suitable location, you must configure +it according to your required setup. The configuration can be set with +a configuration file, environment variables, command-line arguments +or, on Windows, the Windows registry.

    • On Unix platforms, the omniORB runtime looks for the environment +variable OMNIORB_CONFIG. If this variable is defined, it contains the pathname of the omniORB configuration file. If the variable is not set, omniORB will use the compiled-in pathname to -locate the file (by default /etc/omniORB.cfg).
    • On Win32 platforms (Windows NT, 2000, 95, 98), omniORB first -checks the environment variable OMNIORB_CONFIG to obtain the -pathname of the configuration file. If this is not set, it then -attempts to obtain configuration data in the system registry. It -searches for the data under the key -HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

    omniORB has a large number of parameters than can be configured. See -chapter 4 for full details. The files -sample.cfg and sample.reg contain an example -configuration file and set of registry entries respectively.

    To get all the omniORB examples running, the main thing you need to +locate the file (by default /etc/omniORB.cfg).

  • On Win32 / Win64 platforms, omniORB first checks the environment +variable OMNIORB_CONFIG to obtain the pathname of the +configuration file. If this is not set, it then attempts to obtain +configuration data in the system registry. It searches for the data +under the key HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

omniORB has a large number of parameters than can be configured. See +chapter 4 for full details. The files +sample.cfg and sample.reg contain an example +configuration file and set of registry entries respectively.

To get all the omniORB examples running, the main thing you need to configure is the Naming service, omniNames. To do that, the -configuration file or registry should contain an entry of the form

  InitRef = NameService=corbaname::my.host.name
-

See section 6.1.2 for full details of corbaname URIs.

-

1.3  Platform specific variables

To compile omniORB programs correctly, several C++ preprocessor defines -must be specified to identify the target platform. On Unix -platforms where omniORB was configured with Autoconf, the -omniconfig.h file sets these for you. On other platforms, and +configuration file or registry should contain an entry of the form

  InitRef = NameService=corbaname::my.host.name
+

See section 7.1.4 for full details of +corbaname URIs.

+ +

1.3  Platform specific variables

To compile omniORB programs correctly, several C++ preprocessor +defines must be specified to identify the target platform. On +Unix platforms where omniORB was configured with Autoconf, the +omniconfig.h file sets these for you. On other platforms, and Unix platforms when Autoconf is not used, you must specify the -following defines:

- - - - - - - - - - - - - - - - - - -
PlatformCPP defines
Windows NT 4.0,2000,XP__x86__ __NT__ __OSVERSION__=4 __WIN32__
-Windows NT 3.5__x86__ __NT__ __OSVERSION__=3 __WIN32__
-Windows 95__x86__ __WIN32__
-Sun Solaris 2.5__sparc__ __sunos__ __OSVERSION__=5
-HPUX 10.x__hppa__ __hpux__ __OSVERSION__=10
-HPUX 11.x__hppa__ __hpux__ __OSVERSION__=11
-IBM AIX 4.x__aix__ __powerpc__ __OSVERSION__=4
-Digital Unix 3.2__alpha__ __osf1__ __OSVERSION__=3
-Linux 2.x (x86)__x86__ __linux__ __OSVERSION__=2
-Linux 2.x (powerpc)__powerpc__ __linux__ __OSVERSION__=2
-OpenVMS 6.x (alpha)__alpha__ __vms __OSVERSION__=6
-OpenVMS 6.x (vax)__vax__ __vms __OSVERSION__=6
-SGI Irix 6.x__mips__ __irix__ __OSVERSION__=6
-Reliant Unix 5.43__mips__ __SINIX__ __OSVERSION__=5
-ATMos 4.0__arm__ __atmos__ __OSVERSION__=4
-NextStep 3.x__m68k__ __nextstep__ __OSVERSION__=3
-Unixware 7__x86__ __uw7__ __OSVERSION__=5
-

The preprocessor defines for new platform ports not listed above can +following defines:

+ + + + + + + + + + + + + + + + + +
PlatformCPP defines
Windows__x86__ __NT__ __OSVERSION__=4 __WIN32__
+Windows NT 3.5__x86__ __NT__ __OSVERSION__=3 __WIN32__
+Sun Solaris 2.5__sparc__ __sunos__ __OSVERSION__=5
+HPUX 10.x__hppa__ __hpux__ __OSVERSION__=10
+HPUX 11.x__hppa__ __hpux__ __OSVERSION__=11
+IBM AIX 4.x__aix__ __powerpc__ __OSVERSION__=4
+Digital Unix 3.2__alpha__ __osf1__ __OSVERSION__=3
+Linux 2.x (x86)__x86__ __linux__ __OSVERSION__=2
+Linux 2.x (powerpc)__powerpc__ __linux__ __OSVERSION__=2
+OpenVMS 6.x (alpha)__alpha__ __vms __OSVERSION__=6
+OpenVMS 6.x (vax)__vax__ __vms __OSVERSION__=6
+SGI Irix 6.x__mips__ __irix__ __OSVERSION__=6
+Reliant Unix 5.43__mips__ __SINIX__ __OSVERSION__=5
+ATMos 4.0__arm__ __atmos__ __OSVERSION__=4
+NextStep 3.x__m68k__ __nextstep__ __OSVERSION__=3
+Unixware 7__x86__ __uw7__ __OSVERSION__=5
+

The preprocessor defines for new platform ports not listed above can be found in the corresponding platform configuration files. For instance, the platform configuration file for Sun Solaris 2.6 is in -mk/platforms/sun4_sosV_5.6.mk. The preprocessor defines to +mk/platforms/sun4_sosV_5.6.mk. The preprocessor defines to identify a platform are in the make variable -IMPORT_CPPFLAGS.

In a single source multi-target environment, you can put the +IMPORT_CPPFLAGS.

In a single source multi-target environment, you can put the preprocessor defines as the command-line arguments for the compiler. If you are building for a single platform, you can edit -include/omniconfig.h to add the definitions.

-
-1
Most of the 2.6 features have -been implemented. The features still missing in this release are -listed in section 1.1.3. Where possible, backward -compatibility has been maintained up to specification 2.0. -
2
More information can be found at -http://www.opengroup.org/press/7jun99_b.htm -
- - -

Chapter 2  The Basics

-

In this chapter, we go through three examples to illustrate the +include/omniconfig.h to add the definitions.

+ +

Chapter 2  The Basics

+

In this chapter, we go through three examples to illustrate the practical steps to use omniORB. By going through the source code of each example, the essential concepts and APIs are introduced. If you have no previous experience with using CORBA, you should study this chapter in detail. There are pointers to other essential documents you -should be familiar with.

If you have experience with using other ORBs, you should still go +should be familiar with.

If you have experience with using other ORBs, you should still go through this chapter because it provides important information about the features and APIs that are necessarily omniORB specific. With the -Portable Object Adapter, there are very few omniORB specific details.

-

2.1  The Echo Object Example

Our example is an object which has only one method. The method simply -echos the argument string. We have to:

  1. define the object interface in IDL; -
  2. use the IDL compiler to generate the stub code1; -
  3. provide the servant object implementation; -
  4. write the client code.

These examples are in the src/examples/echo directory of the -omniORB distribution; there are several other examples one directory -above that in src/examples.

-

2.2  Specifying the Echo interface in IDL

We define an object interface, called Echo, as follows:

interface Echo { - string echoString(in string mesg); -};

If you are new to IDL, you can learn about its syntax in Chapter 3 of -the CORBA 2.6 specification [OMG01]. For the moment, you +Portable Object Adapter, there are very few omniORB specific details.

+ +

2.1  The Echo Object Example

Our example is an object which has only one method. The method simply +echos the argument string. We have to:

  1. define the object interface in IDL +
  2. use the IDL compiler to generate the stub code, which provides +the object mapping as defined in the CORBA specification +
  3. provide the servant object implementation +
  4. write the client code.

These examples are in the src/examples/echo directory of the +omniORB distribution; there are several other examples in +src/examples.

+ +

2.2  Specifying the Echo interface in IDL

We define an object interface, called Echo, as follows:

interface Echo { + string echoString(in string mesg); +};

If you are new to IDL, you can learn about its syntax in Chapter 3 of +the CORBA 2.6 specification [OMG01]. For the moment, you only need to know that the interface consists of a single operation, -echoString(), which takes a string as an input argument and returns -a copy of the same string.

The interface is written in a file, called echo.idl. It is part -of the CORBA standard that all IDL files should have the extension -‘.idl’, although omniORB does not enforce this.

For simplicity, the interface is defined in the global IDL namespace. -You should avoid this practice for the sake of object reusability. If -every CORBA developer defines their interfaces in the global IDL -namespace, there is a danger of name clashes between two independently -defined interfaces. Therefore, it is better to qualify your interfaces -by defining them inside module names. Of course, this does not -eliminate the chance of a name clash unless some form of naming -convention is agreed globally. Nevertheless, a well-chosen module name -can help a lot.

-

2.3  Generating the C++ stubs

From the IDL file, we use the IDL compiler to produce the C++ mapping +echoString(), which takes a string as an input argument and returns +a copy of the same string.

The interface is written in a file, called echo.idl. It is part +of the CORBA standard that all IDL files must have the extension +‘.idl’, although omniORB does not enforce this. In the omniORB +distribution, this file is in idl/echo.idl.

For simplicity, the interface is defined in the global IDL namespace. +You should normally avoid this practice for the sake of object +reusability. If every CORBA developer defines their interfaces in the +global IDL namespace, there is a danger of name clashes between two +independently defined interfaces. Therefore, it is better to qualify +your interfaces by defining them inside module names. Of +course, this does not eliminate the chance of a name clash unless some +form of naming convention is agreed globally. Nevertheless, a +well-chosen module name can help a lot.

+ +

2.3  Generating the C++ stubs

From the IDL file, we use the IDL compiler to produce the C++ mapping of the interface. The IDL compiler for omniORB is called omniidl. Given the IDL file, omniidl produces two stub files: a C++ header file -and a C++ source file. For example, from the file echo.idl, the -following files are produced:

  • -echo.hh -
  • echoSK.cc -

omniidl must be invoked with the -bcxx argument to +and a C++ source file. For example, from the file echo.idl, the +following files are produced:

  • +echo.hh +
  • echoSK.cc +

omniidl must be invoked with the -bcxx argument to tell it to generate C++ stubs. The following command line generates -the stubs for echo.idl:

omniidl -bcxx echo.idl

If you are using our make environment (ODE), you don’t need -to invoke omniidl explicitly. In the example file dir.mk, we -have the following line:

CORBA_INTERFACES = echo

That is all we need to instruct ODE to generate the stubs. -Remember, you won’t find the stubs in your working directory because -all stubs are written into the stub directory at the top level -of your build tree.

The full arguments to omniidl are detailed in -chapter 5.

-

2.4  Object References and Servants

We contact a CORBA object through an object reference. The -actual implementation of a CORBA object is termed a servant.

Object references and servants are quite separate entities, and it is +the stubs for echo.idl:

omniidl -bcxx echo.idl

Note that the names echo.hh and echoSK.cc are not +defined in the C++ mapping standard. Other CORBA implementations may +use different file names. To aid migration omniidl from other +implementations, omniidl has options to override the default output +file names. See section 5.2 for details.

If you are using our make environment, you don’t need to invoke +omniidl explicitly. In the example file dir.mk, we have the +following line:

CORBA_INTERFACES = echo

That is all we need to instruct the build system to generate +the stubs. You won’t find the stubs in your working directory because +all stubs are written into the stub directory at the top level +of your build tree.

The full arguments to omniidl are detailed in +chapter 5.

+ +

2.4  Object References and Servants

We contact a CORBA object through an object reference. The +actual implementation of a CORBA object is termed a servant.

Object references and servants are quite separate entities, and it is important not to confuse the two. Client code deals purely with object references, so there can be no confusion; object implementation code -must deal with both object references and servants. omniORB 4 uses +must deal with both object references and servants. omniORB uses distinct C++ types for object references and servants, so the C++ compiler will complain if you use a servant when an object reference -is expected, or vice-versa.


- -
-
Warning

omniORB 2.x did not use distinct types for object references -and servants, and often accepted a pointer to a servant when the CORBA -specification says it should only accept an object reference. If you -have code which relies on this, it will not compile with omniORB 3.x -or 4.x, even under the BOA compatibility mode. -


-

2.5  A Quick Tour of the C++ stubs

The C++ stubs conform to the standard mapping defined in the CORBA -specification [OMG03]. It is important to understand the -mapping before you start writing any serious CORBA applications. -Before going any further, it is worth knowing what the mapping looks -like.

For the example interface Echo, the C++ mapping for its object -reference is Echo_ptr. The type is defined in echo.hh. -The relevant section of the code is reproduced below. The stub code -produced by other ORBs will be functionally equivalent to omniORB’s, -but will almost certainly look very different.

class Echo; -class _objref_Echo; -class _impl_Echo; -typedef _objref_Echo* Echo_ptr; - -class Echo { -public: - // Declarations for this interface type. - typedef Echo_ptr _ptr_type; - typedef Echo_var _var_type; - - static _ptr_type _duplicate(_ptr_type); - static _ptr_type _narrow(CORBA::Object_ptr); - static _ptr_type _nil(); - - // ... methods generated for internal use -}; - -class _objref_Echo : - public virtual CORBA::Object, public virtual omniObjRef { -public: - char * echoString(const char* mesg); - - // ... methods generated for internal use -};

In a compliant application, the operations defined in an object -interface should only be invoked via an object reference. -This is done by using arrow (‘->’) on an object reference. -For example, the call to the operation echoString() would be -written as obj->echoString(mesg).

It should be noted that the concrete type of an object reference is -opaque, i.e. you must not make any assumption about how an object -reference is implemented. In our example, even though Echo_ptr -is implemented as a pointer to the class _objref_Echo, it -should not be used as a C++ pointer, i.e. conversion to void*, -arithmetic operations, and relational operations including testing for -equality using operator==, must not be performed on the type.

In addition to class _objref_Echo, the mapping defines three -static member functions in the class Echo: _nil(), -_duplicate(), and _narrow().

The _nil() function returns a nil object reference of the Echo -interface. The following call is guaranteed to return TRUE:

CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil());

Remember, CORBA::is_nil() is the only compliant way to check if an -object reference is nil. You should not use the equality -operator==. Many C++ ORBs use the null pointer to represent a -nil object reference; omniORB does not.

The _duplicate() function returns a new object reference of the -Echo interface. The new object reference can be used -interchangeably with the old object reference to perform an operation -on the same object. Duplications are required to satisfy the C++ -mapping’s reference counting memory management.

All CORBA objects inherit from the generic object -CORBA::Object. CORBA::Object_ptr is the object -reference type for CORBA::Object. Any _ptr object -reference is therefore conceptually inherited from -CORBA::Object_ptr. In other words, an object reference such as -Echo_ptr can be used in places where a -CORBA::Object_ptr is expected.

The _narrow() function takes an argument of type -CORBA::Object_ptr and returns a new object reference of the -Echo interface. If the actual (runtime) type of the argument -object reference can be narrowed to Echo_ptr, _narrow() +is expected, or vice-versa.

+ +

2.5  A quick look at the C++ mapping

The C++ stubs conform to the standard mapping defined in the CORBA +specification [OMG03]. Sadly, since it pre-dates the C++ +standard library, the C++ language mapping is quite hard to use, +especially because it has complex memory management rules.

The best way to understand the mapping is to read either the +specification or, better, a book about using CORBA from C++. Reading +the code generated by omniidl is hard-going, and it is difficult to +distinguish the parts you need to know from the implementation +details.

+ +

2.5.1  Mapping overview

For interface Echo, omniidl generates four things of note:

  • +class Echo, containing static functions and type +definitions
  • Echo_ptr, an object reference type with pointer +semantics
  • Echo_var, a memory management helper for +Echo_ptr
  • class POA_Echo, the server-side skeleton class
+ +

2.5.2  Interface scope type

A C++ class Echo is defined to hold a number of static +functions and type definitions. It looks like this:

class Echo { +public: + typedef Echo_ptr _ptr_type; + typedef Echo_var _var_type; + + static _ptr_type _duplicate(_ptr_type); + static _ptr_type _narrow(CORBA::Object_ptr); + static _ptr_type _nil(); +};

The _ptr_type and _var_type typedefs are there to +facilitate template programming. The static functions are described +below.

+ +

2.5.3  Object reference pointer type

For interface Echo, the mapping defines the object reference +type Echo_ptr which has pointer semantics. The _ptr +type provides access to the interface’s operations. The concrete type +of an object reference is opaque, i.e. you must not make any +assumptions about how an object reference is implemented. You can +imagine it looks something like this:

class private_class : public some_base_class { + char* echoString(const char* mesg); +}; + +typedef something Echo_ptr;

To use an object reference, you use the arrow operator ‘->’ to +invoke its operations, but you must not use it as a C++ pointer in any +other respect. It is non-compliant to convert it to void*, +perform arithmetic or relational operations including testing for +equality using operator==.

In some CORBA implementations, Echo_ptr is a typedef to +Echo*. In omniORB, it is not—the object reference type is +distinct from class Echo.

+ +

2.5.3.1  Nil object reference

Object references can be nil. To obtain a nil object reference +for interface Echo, call Echo::_nil(). To test if an +object reference is nil, use CORBA::_is_nil():

CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil());

Echo::_nil() is the only compliant way to obtain a nil Echo +reference, and CORBA::is_nil() is the only compliant way to check +if an object reference is nil. You should not use the equality +operator==. Many C++ ORBs use the null pointer to represent a +nil object reference, but omniORB does not.

+ +

2.5.3.2  Object reference lifecycle

Object references are reference counted. That is, the opaque C++ +objects on the client side that implement Echo_ptr are +reference counted, so they are deleted when the count goes to zero. +The lifetime of an object reference has no bearing at all on the +lifetime of the CORBA object to which it is a reference—when an +object reference is deleted, it has no effect on the object in +the server.

Reference counting for Echo object references is performed with +Echo::_duplicate() and CORBA::release().

The _duplicate() function returns a new object reference of the +Echo interface. The new object reference can be used interchangeably +with the old object reference to perform an operation on the same +object.

To indicate that an object reference will no longer be accessed, you +must call the CORBA::release() operation. Its signature is as +follows:

namespace CORBA { + void release(CORBA::Object_ptr obj); + ... // other methods +};

Once you have called CORBA::release() on an object reference, you +may no longer use that reference. This is because the associated +resources may have been deallocated. Remember that we are referring to +the resources associated with the object reference and not the +servant object. Servant objects are not affected by the lifetimes +of object references. In particular, servants are not deleted when all +references to them have been released—CORBA does not perform +distributed garbage collection.

Nil object references are not reference counted, so there is no +need to call _duplicate() and release() with them, although it +does no harm.

Since object references must be released explicitly, their usage is +prone to error and can lead to memory leaks or invalid memory +accesses. The mapping defines the object reference variable +type Echo_var to make life somewhat easier.

The Echo_var is more convenient to use because it +automatically releases its object reference when it goes out of scope +or when assigned a new object reference. For many operations, mixing +data of type Echo_var and Echo_ptr is possible without +any explicit operations or casting. For instance, the echoString() +operation can be called using the arrow (‘->’) on a +Echo_var, as one can do with a Echo_ptr.

The usage of Echo_var is illustrated below:

Echo_var a; +Echo_ptr p = ... // somehow obtain an object reference + +a = p; // a assumes ownership of p, must not use p any more + +Echo_var b = a; // implicit _duplicate + +p = ... // somehow obtain another object reference + +a = Echo::_duplicate(p); // release old object reference + // a now holds a copy of p.

The mappings of many other IDL data types include _var types +with similar semantics.

+ +

2.5.3.3  Object reference inheritance

All CORBA objects inherit from the generic object +CORBA::Object. CORBA::Object_ptr is the object +reference type for base CORBA::Object. Object references can be +implicitly widened to base interface types, so this is valid:

Echo_ptr echo_ref = // get reference from somewhere +CORBA::Object_ptr base_ref = echo_ref; // widen

An object reference such as Echo_ptr can be used in places +where a CORBA::Object_ptr is expected. Conversely, the +Echo::_narrow() function takes an argument of type +CORBA::Object_ptr and returns a new object reference of the +Echo interface. If the actual (runtime) type of the argument +object reference can be narrowed to Echo_ptr, _narrow() will return a valid object reference. Otherwise it will return a nil -object reference. Note that _narrow() performs an implicit +object reference. Note that _narrow() performs an implicit duplication of the object reference, so the result must be released. -Note also that _narrow() may involve a remote call to check the +Note also that _narrow() may involve a remote call to check the type of the object, so it may throw CORBA system exceptions such as -COMM_FAILURE or OBJECT_NOT_EXIST.

To indicate that an object reference will no longer be accessed, you -must call the CORBA::release() operation. Its signature is as -follows:

namespace CORBA { - void release(CORBA::Object_ptr obj); - ... // other methods -};

Once you have called CORBA::release() on an object reference, you -must no longer use that reference. This is because the associated -resources may have been deallocated. Notice that we are referring to -the resources associated with the object reference and not the -servant object. Servant objects are not affected by the lifetimes of -object references. In particular, servants are not deleted when all -references to them have been released—CORBA does not perform -distributed garbage collection.

As described above, the equality operator== should not be used +TRANSIENT or OBJECT_NOT_EXIST.

+ +

2.5.3.4  Object reference equivalence

As described above, the equality operator== should not be used on object references. To test if two object references are equivalent, -the member function _is_equivalent() of the generic object -CORBA::Object can be used. Here is an example of its usage:

Echo_ptr A; -... // initialise A to a valid object reference -Echo_ptr B = A; -CORBA::Boolean true_result = A->_is_equivalent(B); -// Note: the above call is guaranteed to be TRUE

You have now been introduced to most of the operations that can be -invoked via Echo_ptr. The generic object CORBA::Object -provides a few more operations and all of them can be invoked via -Echo_ptr. These operations deal mainly with CORBA’s dynamic -interfaces. You do not have to understand them in order to use the C++ -mapping provided via the stubs.

Since object references must be released explicitly, their usage is -prone to error and can lead to memory leakage. The mapping defines the -object reference variable type to make life easier. In our -example, the variable type Echo_var is defined2.

The Echo_var is more convenient to use because it will -automatically release its object reference when it is deallocated or -when assigned a new object reference. For many operations, mixing data -of type Echo_var and Echo_ptr is possible without any -explicit operations or castings3. For instance, the operation -echoString() can be called using the arrow (‘->’) on a -Echo_var, as one can do with a Echo_ptr.

The usage of Echo_var is illustrated below:

Echo_var a; -Echo_ptr p = ... // somehow obtain an object reference - -a = p; // a assumes ownership of p, must not use p any more - -Echo_var b = a; // implicit _duplicate - -p = ... // somehow obtain another object reference - -a = Echo::_duplicate(p); // release old object reference - // a now holds a copy of p.
-

2.5.1  Servant Object Implementation

-

Before the Portable Object Adapter (POA) specification, many of the -details of how servant objects should be implemented and registered -with the system were unspecified, so server-side code was not portable -between ORBs. The POA specification rectifies that. omniORB 4 still -supports the old omniORB 2.x BOA mapping, but you should always use -the POA mapping for new code. BOA code and POA code can coexist within -a single program. See section 3.1 for details of the -BOA compatibility, and problems you may encounter.

For each object interface, a skeleton class is generated. In +the member function _is_equivalent() of the generic object +CORBA::Object can be used. Here is an example of its usage:

Echo_ptr a; +... // initialise a to a valid object reference +Echo_ptr b = a; +CORBA::Boolean true_result = a->_is_equivalent(a); +// Note: the above call is guaranteed to be true

_is_equivalent() does not contact the object to check for +equivalence—it uses purely local knowledge, meaning that it is +possible to construct situations in which two object references refer +to the same object, but _is_equivalent() does not consider them +equivalent. If you need a strong sense of object identity, you must +implement it with explicit IDL operations.

+ +

2.5.4  Servant Object Implementation

+

For each object interface, a skeleton class is generated. In our example, the POA specification says that the skeleton class for -interface Echo is named POA_Echo. A servant +interface Echo is named POA_Echo. A servant implementation can be written by creating an implementation class that -derives from the skeleton class.

The skeleton class POA_Echo is defined in echo.hh. The -relevant section of the code is reproduced below.

class POA_Echo : - public virtual PortableServer::ServantBase -{ -public: - Echo_ptr _this(); - - virtual char * echoString(const char* mesg) = 0; - // ... -};

The code fragment shows the only member functions that can be used in +derives from the skeleton class.

The skeleton class POA_Echo is defined in echo.hh. The +relevant section of the code is reproduced below.

class POA_Echo : + public virtual PortableServer::ServantBase +{ +public: + Echo_ptr _this(); + + virtual char * echoString(const char* mesg) = 0; +};

The code fragment shows the only member functions that can be used in the object implementation code. Other member functions are generated for internal use only. As with the code generated for object references, other POA-based ORBs will generate code which looks -different, but is functionally equivalent to this.

echoString()

+different, but is functionally equivalent to this.

echoString()

It is through this abstract function that an implementation class -provides the implementation of the echoString() operation. Notice -that its signature is the same as the echoString() function that -can be invoked via the Echo_ptr object reference.
_this()

-This function returns an object reference for the target object, -provided the POA policies permit it. The returned value must be -deallocated via CORBA::release(). See section 2.8 -for an example of how this function is used.
-

2.6  Writing the servant implementation

-

You define an implementation class to provide the servant -implementation. There is little constraint on how you design your -implementation class except that it has to inherit from the stubs’ -skeleton class and to implement all the abstract functions defined in -the skeleton class. Each of these abstract functions corresponds to an -operation of the interface. They are the hooks for the ORB to perform -upcalls to your implementation.

Here is a simple implementation of the Echo object.

class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -}

There are four points to note here:

Storage Responsibilities

-A string, which is used both as an in argument and the return value of -echoString(), is a variable size data type. Other examples of -variable size data types include sequences, type ‘any’, etc. For these -data types, you must be clear about whose responsibility it is to -allocate and release the associated storage. As a rule of thumb, the -client (or the caller to the implementation functions) owns the -storage of all IN arguments, the object implementation (or the callee) -must copy the data if it wants to retain a copy. For OUT arguments and -return values, the object implementation allocates the storage and -passes the ownership to the client. The client must release the -storage when the variables will no longer be used. For details, -please refer to the C++ mapping specification.
Multi-threading

+provides the implementation of the echoString() operation. Notice +that its signature is the same as the echoString() function that +can be invoked via the Echo_ptr object reference. This will be +the case most of the time, but object reference operations for certain +parameter types use special helper classes to facilitate correct +memory management.
_this()

+The _this() function returns an object reference for the target +object, provided the POA policies permit it. The returned value must +be deallocated via CORBA::release(). See +section 2.8 for an example of how this function is used.
+ +

2.6  Writing the servant implementation

+

You define a class to provide the servant implementation. There is +little constraint on how you design your implementation class except +that it has to inherit from the skeleton class1 and to +implement all the abstract functions defined in the skeleton +class. Each of these abstract functions corresponds to an operation of +the interface. They are the hooks for the ORB to perform upcalls to +your implementation. Here is a simple implementation of the Echo +object.

class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + +char* Echo_i::echoString(const char* mesg) +{ + return CORBA::string_dup(mesg); +}

There are four points to note here:

Storage Responsibilities

+String, which is used both as an in argument and the return value of +echoString(), is a variable sized data type. Other examples of +variable sized data types include sequences, type ‘any’, etc. For +these data types, you must be clear about whose responsibility it is +to allocate and release the associated storage. As a rule of thumb, +the client (or the caller to the implementation functions) owns the +storage of all in arguments, the object implementation (or the +callee) must copy the data if it wants to retain a copy. For +out arguments and return values, the object implementation +allocates the storage and passes the ownership to the client. The +client must release the storage when the variables will no longer be +used. For details, see the C++ mapping specification.
Multi-threading

As omniORB is fully multithreaded, multiple threads may perform the same upcall to your implementation concurrently. It is up to your implementation to synchronise the threads’ accesses to shared data. In our simple example, we have no shared data to protect so no thread -synchronisation is necessary.

Alternatively, you can create a POA which has the -SINGLE_THREAD_MODEL Thread Policy. This guarantees that all -calls to that POA are processed sequentially.

Reference Counting

+synchronisation is necessary.

Alternatively, you can create a POA which has the +SINGLE_THREAD_MODEL Thread Policy. This guarantees that all +calls to that POA are processed sequentially.

Reference Counting

All servant objects are reference counted. The base -PortableServer::ServantBase class from which all servant -skeleton classes derive defines member functions named _add_ref() -and _remove_ref()4. The reference -counting means that an Echo_i instance will be deleted when no +PortableServer::ServantBase class from which all servant +skeleton classes derive defines member functions named _add_ref() +and _remove_ref()2. The reference +counting means that an Echo_i instance will be deleted when no more references to it are held by application code or the POA itself. Note that this is totally separate from the reference counting which is associated with object references—a servant object is -never deleted due to a CORBA object reference being released.
Instantiation

+never deleted due to a CORBA object reference being released.
Instantiation

Servants are usually instantiated on the heap, i.e. using the -new operator. However, they can also be created on the stack as +new operator. However, they can also be created on the stack as automatic variables. If you do that, it is vital to make sure that the servant has been deactivated, and thus released by the POA, before the -variable goes out of scope and is destroyed.
-

2.7  Writing the client

Here is an example of how an Echo_ptr object reference is -used.

1 void - 2 hello(CORBA::Object_ptr obj) - 3 { - 4 Echo_var e = Echo::_narrow(obj); - 5 - 6 if (CORBA::is_nil(e)) { - 7 cerr << "cannot invoke on a nil object reference." - 8 << endl; - 9 return; - 10 } - 11 - 12 CORBA::String_var src = (const char*) "Hello!"; - 13 CORBA::String_var dest; - 14 - 15 dest = e->echoString(src); - 16 - 17 cerr << "I said,\"" << src << "\"." - 18 << " The Object said,\"" << dest <<"\"" << endl; - 19 }

Briefly, the hello() function accepts a generic object reference. -The object reference (obj) is narrowed to Echo_ptr. If -the object reference returned by Echo::_narrow() is not nil, the -operation echoString() is invoked. Finally, both the argument to -and the return value of echoString() are printed to cerr.

The example also illustrates how T_var types are used. As was -explained in the previous section, T_var types take care of +variable goes out of scope and is destroyed.

+ +

2.7  Writing the client

Here is an example of how an Echo_ptr object reference is +used.

1 void + 2 hello(CORBA::Object_ptr obj) + 3 { + 4 Echo_var e = Echo::_narrow(obj); + 5 + 6 if (CORBA::is_nil(e)) { + 7 cerr << "cannot invoke on a nil object reference." + 8 << endl; + 9 return; + 10 } + 11 + 12 CORBA::String_var src = (const char*) "Hello!"; + 13 CORBA::String_var dest; + 14 + 15 dest = e->echoString(src); + 16 + 17 cout << "I said,\"" << src << "\"." + 18 << " The Object said,\"" << dest <<"\"" << endl; + 19 }

The hello() function accepts a generic object reference. The +object reference (obj) is narrowed to Echo_ptr. If the +object reference returned by Echo::_narrow() is not nil, the +operation echoString() is invoked. Finally, both the argument to +and the return value of echoString() are printed to cout.

The example also illustrates how T_var types are used. As was +explained in the previous section, T_var types take care of storage allocation and release automatically when variables are -reassigned or when the variables go out of scope.

In line 4, the variable e takes over the storage responsibility -of the object reference returned by Echo::_narrow(). The object -reference is released by the destructor of e. It is called +reassigned or when the variables go out of scope.

In line 4, the variable e takes over the storage responsibility +of the object reference returned by Echo::_narrow(). The object +reference is released by the destructor of e. It is called automatically when the function returns. Lines 6 and 15 show how a -Echo_var variable is used. As explained earlier, the -Echo_var type can be used interchangeably with the -Echo_ptr type.

The argument and the return value of echoString() are stored in -CORBA::String_var variables src and dest +Echo_var variable is used. As explained earlier, the +Echo_var type can be used interchangeably with the +Echo_ptr type.

The argument and the return value of echoString() are stored in +CORBA::String_var variables src and dest respectively. The strings managed by the variables are deallocated by -the destructor of CORBA::String_var. It is called +the destructor of CORBA::String_var. It is called automatically when the variable goes out of scope (as the function -returns). Line 15 shows how CORBA::String_var variables are +returns). Line 15 shows how CORBA::String_var variables are used. They can be used in place of a string (for which the mapping is -char*)5. As used in line 12, assigning a constant string -(const char*) to a CORBA::String_var causes the string -to be copied. On the other hand, assigning a char* to a -CORBA::String_var, as used in line 15, causes the latter to -assume the ownership of the string6.

Under the C++ mapping, T_var types are provided for all the -non-basic data types. It is obvious that one should use automatic -variables whenever possible both to avoid memory leaks and to maximise -performance. However, when one has to allocate data items on the heap, -it is a good practice to use the T_var types to manage the -heap storage.

-

2.8  Example 1 — Colocated Client and Implementation

-

Having introduced the client and the object implementation, we can now +char*)3. As used in line 12, assigning a constant string +(const char*) to a CORBA::String_var causes the string +to be copied. On the other hand, assigning a char* to a +CORBA::String_var, as used in line 15, causes the latter to +assume the ownership of the string4.

Under the C++ mapping, T_var types are provided for all the +non-basic data types. One should use automatic variables whenever +possible both to avoid memory leaks and to maximise performance. +However, when one has to allocate data items on the heap, it is a good +practice to use the T_var types to manage the heap storage.

+ +

2.8  Example 1 — Colocated Client and Servant

+

Having introduced the client and the object implementation, we can now describe how to link up the two via the ORB and POA. In this section, we describe an example in which both the client and the object implementation are in the same address space. In the next two sections, we shall describe the case where the two are in different -address spaces.

The code for this example is reproduced below:

1 int - 2 main(int argc, char **argv) - 3 { - 4 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB4"); - 5 - 6 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - 7 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - 8 - 9 Echo_i *myecho = new Echo_i(); - 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - 11 - 12 Echo_var myechoref = myecho->_this(); - 13 myecho->_remove_ref(); - 14 - 15 PortableServer::POAManager_var pman = poa->the_POAManager(); - 16 pman->activate(); - 17 - 18 hello(myechoref); - 19 - 20 orb->destroy(); - 21 return 0; - 22 }

The example illustrates several important interactions among the ORB, -the POA, the servant, and the client. Here are the details:

-

2.8.1  ORB initialisation

Line 4

-The ORB is initialised by calling the CORBA::ORB_init() +address spaces.

The code for this example is reproduced below:

1 int + 2 main(int argc, char **argv) + 3 { + 4 CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv, "omniORB4"); + 5 + 6 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + 7 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + 8 + 9 PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + 11 + 12 Echo_var myechoref = myecho->_this(); + 13 + 14 PortableServer::POAManager_var pman = poa->the_POAManager(); + 15 pman->activate(); + 16 + 17 hello(myechoref); + 18 + 19 orb->destroy(); + 20 return 0; + 21 }

The example illustrates several important interactions among the ORB, +the POA, the servant, and the client. Here are the details:

+ +

2.8.1  ORB initialisation

Line 4

+The ORB is initialised by calling the CORBA::ORB_init() function. The function uses the optional 3rd argument to determine which ORB should be returned. Unless you are using omniORB specific features, it is usually best to leave it out, and get the default ORB. To explicitly ask for omniORB 4.x, this argument must be -‘omniORB4’7.

CORBA::ORB_init() takes the list of command line arguments and -processes any that start ‘-ORB’. It removes these arguments -from the list, so application code does not have to deal with them.

If any error occurs during ORB initialisation, such as invalid ORB +‘omniORB4’5.

CORBA::ORB_init() takes the list of command line arguments and +processes any that start ‘-ORB’. It removes these arguments +from the list, so application code does not have to deal with them.

If any error occurs during ORB initialisation, such as invalid ORB arguments, or an invalid configuration file, the -CORBA::INITIALIZE system exception is raised.

-

2.8.2  Obtaining the Root POA

Lines 6–7

+CORBA::INITIALIZE system exception is raised.

+ +

2.8.2  Obtaining the Root POA

Lines 6–7

To activate our servant object and make it available to clients, we -must register it with a POA. In this example, we use the Root -POA, rather than creating any child POAs. The Root POA is found with -orb->resolve_initial_references(), which returns a plain -CORBA::Object. In line 7, we narrow the reference to the right -type for a POA.

A POA’s behaviour is governed by its policies. The Root POA has +must register it with a POA. In this example, we use the Root +POA, rather than creating any child POAs. The Root POA is found with +orb->resolve_initial_references(), which returns a plain +CORBA::Object. In line 7, we narrow the reference to the right +type for a POA.

A POA’s behaviour is governed by its policies. The Root POA has suitable policies for many simple servers, and closely matches the ‘policies’ used by omniORB 2’s BOA. See Chapter 11 of the CORBA 2.6 -specification[OMG01] for details of all the POA policies -which are available.

-

2.8.3  Object initialisation

Line 9

-An instance of the Echo servant is initialised using the new -operator.
Line 10

+specification[OMG01] for details of all the POA policies +which are available.

+ +

2.8.3  Object initialisation

Line 9

+An instance of the Echo servant is initialised using the new +operator. The PortableServer::Servant_var<> template +automatically is analogous to the T_var types generated by the +IDL compiler. It releases our reference to the servant when it goes +out of scope.
Line 10

The servant object is activated in the Root POA using -poa->activate_object(), which returns an object identifier -(of type PortableServer::ObjectId*). The object id must +poa->activate_object(), which returns an object identifier +(of type PortableServer::ObjectId*). The object id must be passed back to various POA operations. The caller is responsible -for freeing the object id, so it is assigned to a _var type.
Line 12

+for freeing the object id, so it is assigned to a _var type.
Line 12

The object reference is obtained from the servant object by calling -_this(). Like all object references, the return value of -_this() must be released by CORBA::release() when it is no -longer needed. In this case, we assign it to a _var type, so -the release is implicit at the end of the function.

One of the important characteristics of an object reference is that it +its _this() method. Like all object references, the return value +of _this() must be released by CORBA::release() when it is no +longer needed. In this case, we assign it to a _var type, so +the release is implicit at the end of the function.

One of the important characteristics of an object reference is that it is completely location transparent. A client can invoke on the object using its object reference without any need to know whether the servant object is colocated in the same address space or is in a -different address space.

In the case of colocated client and servant, omniORB is able to +different address space.

In the case of colocated client and servant, omniORB is able to short-circuit the client calls so they do not involve IIOP. The calls still go through the POA, however, so the various POA policies affect local calls in the same way as remote ones. This optimisation is -applicable not only to object references returned by _this(), but +applicable not only to object references returned by _this(), but to any object references that are passed around within the same -address space or received from other address spaces via remote calls.

Line 13

-The server code releases the reference it holds to the servant -object. The only reference to that object is now held by the POA (it -gained the reference on the call to activate_object()), so when -the object is deactivated (or the POA is destroyed), the servant -object will be deleted automatically. After this point, the code must -no longer use the myecho pointer.
-

2.8.4  Activating the POA

Lines 15–16

-POAs are initially in the holding state, meaning that incoming +address space or received from other address spaces via remote calls.

+ +

2.8.4  Activating the POA

Lines 15–16

+POAs are initially in the holding state, meaning that incoming requests are blocked. Lines 15 and 16 acquire a reference to the POA’s -POA manager, and use it to put the POA into the active state. -Incoming requests are now served. Failing to activate the POA +POA manager, and use it to put the POA into the active state. +Incoming requests are now served. Failing to activate the POA is one of the most common programming mistakes. If your program -appears deadlocked, make sure you activated the POA!
-

2.8.5  Performing a call

Line 18

-At long last, we can call hello() with this object reference. The +appears deadlocked, make sure you activated the POA!
+ +

2.8.5  Performing a call

Line 18

+At long last, we can call hello() with this object reference. The argument is widened implicitly to the generic object reference -CORBA::Object_ptr.
-

2.8.6  ORB destruction

Line 20

+CORBA::Object_ptr.
+ +

2.8.6  ORB destruction

Line 20

Shutdown the ORB permanently. This call causes the ORB to release all its resources, e.g. internal threads, and also to deactivate any servant objects which are currently active. When it deactivates the -Echo_i instance, the servant’s reference count drops to zero, -so the servant is deleted.

This call is particularly important when writing a CORBA DLL on +Echo_i instance, the servant’s reference count drops to zero, +so the servant is deleted.

This call is particularly important when writing a CORBA DLL on Windows NT that is to be used from ActiveX. If this call is absent, -the application will hang when the CORBA DLL is unloaded.

-

2.9  Example 2 — Different Address Spaces

In this example, the client and the object implementation reside in +the application will hang when the CORBA DLL is unloaded.

+ +

2.9  Example 2 — Different Address Spaces

In this example, the client and the object implementation reside in two different address spaces. The code of this example is almost the same as the previous example. The only difference is the extra work which needs to be done to pass the object reference from the object -implementation to the client.

The simplest (and quite primitive) way to pass an object reference -between two address spaces is to produce a stringified version +implementation to the client.

The simplest (and quite primitive) way to pass an object reference +between two address spaces is to produce a stringified version of the object reference and to pass this string to the client as a command-line argument. The string is then converted by the client into a proper object reference. This method is used in this example. In the next example, we shall introduce a better way of -passing the object reference using the CORBA Naming Service.

-

2.9.1  Object Implementation: Making a Stringified Object Reference

The main() function of the server side is reproduced below. The -full listing (eg2_impl.cc) can be found at the end of this -chapter.

1 int main(int argc, char** argv) - 2 { - 3 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - 4 - 5 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - 6 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - 7 - 8 Echo_i* myecho = new Echo_i(); - 9 - 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - 11 - 12 obj = myecho->_this(); - 13 CORBA::String_var sior(orb->object_to_string(obj)); - 14 cerr << (char*)sior << endl; - 15 - 16 myecho->_remove_ref(); - 17 - 18 PortableServer::POAManager_var pman = poa->the_POAManager(); - 19 pman->activate(); - 20 - 21 orb->run(); - 22 orb->destroy(); - 23 return 0; - 24 }

The stringified object reference is obtained by calling the ORB’s -object_to_string() function (line 13). This results in a -string starting with the signature ‘IOR:’ and followed by some -hexadecimal digits. All CORBA 2 compliant ORBs are able to convert the -string into its internal representation of a so-called Interoperable -Object Reference (IOR). The IOR contains the location information and -a key to uniquely identify the object implementation in its own -address space. From the IOR, an object reference can be constructed.

-

2.9.2  Client: Using a Stringified Object Reference

-

The stringified object reference is passed to the client as a +passing the object reference using the CORBA Naming Service.

+ +

2.9.1  Making a Stringified Object Reference

The main() function of the server side is reproduced below. The +full listing (eg2_impl.cc) can be found at the end of this +chapter.

1 int main(int argc, char** argv) + 2 { + 3 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + 4 + 5 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + 6 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + 7 + 8 PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + 9 + 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + 11 + 12 obj = myecho->_this(); + 13 CORBA::String_var sior(orb->object_to_string(obj)); + 14 cerr << sior << endl; + 15 + 16 PortableServer::POAManager_var pman = poa->the_POAManager(); + 17 pman->activate(); + 18 + 19 orb->run(); + 20 orb->destroy(); + 21 return 0; + 22 }

The stringified object reference is obtained by calling the ORB’s +object_to_string() function (line 13). This results in a +string starting with the signature ‘IOR:’ and followed by quite +a lot of hexadecimal digits. All CORBA compliant ORBs are able to +convert the string into its internal representation of a so-called +Interoperable Object Reference (IOR). The IOR contains the location +information and a key to uniquely identify the object implementation +in its own address space. From the IOR, an object reference can be +constructed.

+ +

2.9.2  Client: Using a Stringified Object Reference

+

The stringified object reference is passed to the client as a command-line argument. The client uses the ORB’s -string_to_object() function to convert the string into a generic -object reference (CORBA::Object_ptr). The relevant section of -the code is reproduced below. The full listing (eg2_clt.cc) can -be found at the end of this chapter.

try { - CORBA::Object_var obj = orb->string_to_object(argv[1]); - hello(obj); -} -catch(CORBA::TRANSIENT&) { - ... // code to handle transient exception... -}
-

2.9.3  Catching System Exceptions

When omniORB detects an error condition, it may raise a system +string_to_object() function to convert the string into a generic +object reference (CORBA::Object_ptr). The relevant section of +the code is reproduced below. The full listing (eg2_clt.cc) can +be found at the end of this chapter.

try { + CORBA::Object_var obj = orb->string_to_object(argv[1]); + hello(obj); +} +catch (CORBA::TRANSIENT&) { + ... // code to handle transient exception... +}
+ +

2.9.3  Catching System Exceptions

When omniORB detects an error condition, it may raise a system exception. The CORBA specification defines a series of exceptions covering most of the error conditions that an ORB may encounter. The client may choose to catch these exceptions and recover from the error -condition8. For instance, the code fragment, shown in -section 2.9.2, catches the TRANSIENT system exception +condition6. For instance, the code fragment, shown in +section 2.9.2, catches the TRANSIENT system exception which indicates that the object could not be contacted at the time of -the call, usually meaning the server is not running.

All system exceptions inherit from CORBA::SystemException. With -compilers that properly support RTTI9, a single catch of CORBA::SystemException will -catch all the different system exceptions thrown by omniORB.

When omniORB detects an internal error such as corrupt data or invalid -conditions, it raises the exception omniORB::fatalException. -When this exception is raised, it is not sensible to proceed with any -operation that involves the ORB’s runtime. It is best to exit the -program immediately. The exception structure carried by -omniORB::fatalException contains the exact location (the file -name and the line number) where the exception is raised. In most -cases, fatalExceptions occur due to incorrect behaviour by the -application code, but they may be caused by bugs in omniORB.

-

2.9.4  Lifetime of a CORBA object

CORBA objects are either transient or persistent. The +the call, usually meaning the server is not running.

All system exceptions inherit from CORBA::SystemException. +Unless you have a truly ancient C++ compiler, a single catch of +CORBA::SystemException will catch all the different system +exceptions.

+ +

2.9.4  Lifetime of a CORBA object

CORBA objects are either transient or persistent. The majority are transient, meaning that the lifetime of the CORBA object (as contacted through an object reference) is the same as the lifetime of its servant object. Persistent objects can live beyond the destruction of their servant object, the POA they were created in, and even their process. Persistent objects are, of course, only -contactable when their associated servants are active, or can be -activated by their POA with a servant manager10. A reference to -a persistent object can be published, and will remain valid even if -the server process is restarted.

A POA’s Lifespan Policy determines whether objects created within it -are transient or persistent. The Root POA has the TRANSIENT -policy.

An alternative to creating persistent objects is to register object -references in a naming service and bind them to fixed path +contactable when their associated server processes are running, and +their servants are active or can be activated by their POA with a +servant manager7. A reference to a persistent object can +be published, and will remain valid even if the server process is +restarted.

To support persistent objects, the servants must be activated in their +POA with the same object identifier each time. Also, the server must +be configured with the same endpoint details so it is +contactable in the same way as previous invocations. See +section 6.6 for details.

A POA’s Lifespan Policy determines whether objects created within it +are transient or persistent. The Root POA has the TRANSIENT +policy.

An alternative to creating persistent objects is to register object +references in a naming service and bind them to fixed path names. Clients can bind to the object implementations at run time by asking the naming service to resolve the path names to the object references. CORBA defines a standard naming service, which is a -component of the Common Object Services (COS) [OMG98], +component of the Common Object Services (COS) [OMG98], that can be used for this purpose. The next section describes an -example of how to use the COS Naming Service.

-

2.10  Example 3 — Using the Naming Service

In this example, the object implementation uses the Naming -Service [OMG98] to pass on the object reference to the -client. This method is far more practical than using stringified +example of how to use the COS Naming Service.

+ +

2.10  Example 3 — Using the Naming Service

In this example, the object implementation uses the Naming +Service [OMG98] to pass on the object reference to the +client. This method is often more practical than using stringified object references. The full listing of the object implementation -(eg3_impl.cc) and the client (eg3_clt.cc) can be found -at the end of this chapter.

The names used by the Naming service consist of a sequence of -name components. Each name component has an id and a -kind field, both of which are strings. All name components +(eg3_impl.cc) and the client (eg3_clt.cc) can be found +at the end of this chapter.

The names used by the Naming service consist of a sequence of +name components. Each name component has an id and a +kind field, both of which are strings. All name components except the last one are bound to a naming context. A naming context is analogous to a directory in a filing system: it can contain names of object references or other naming contexts. The last name component is -bound to an object reference.

Sequences of name components can be represented as a flat string, +bound to an object reference.

Sequences of name components can be represented as a flat string, using ‘.’ to separate the id and kind fields, and ‘/’ to separate name -components from each other11. In our example, the Echo object +components from each other8. In our example, the Echo object reference is bound to the stringified name -‘test.my_context/Echo.Object’.

The kind field is intended to describe the name in a +‘test.my_context/Echo.Object’.

The kind field is intended to describe the name in a syntax-independent way. The naming service does not interpret, assign, or manage these values. However, both the name and the kind attribute must match for a name lookup to succeed. In this example, the kind -values for test and Echo are chosen to be -‘my_context’ and ‘Object’ respectively. This is an -arbitrary choice as there is no standardised set of kind values.

-

2.10.1  Obtaining the Root Context Object Reference

-

The initial contact with the Naming Service can be established via the -root context. The object reference to the root context is +values for test and Echo are chosen to be +‘my_context’ and ‘Object’ respectively. This is an +arbitrary choice as there is no standardised set of kind values.

+ +

2.10.1  Obtaining the Root Context Object Reference

+

The initial contact with the Naming Service can be established via the +root context. The object reference to the root context is provided by the ORB and can be obtained by calling -resolve_initial_references(). The following code fragment shows -how it is used:

CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv); - -CORBA::Object_var initServ; -initServ = orb->resolve_initial_references("NameService"); - -CosNaming::NamingContext_var rootContext; -rootContext = CosNaming::NamingContext::_narrow(initServ);

Remember, omniORB constructs its internal list of initial references -at initialisation time using the information provided in the -configuration file omniORB.cfg, or given on the command -line. If this file is not present, the internal list will be empty and -resolve_initial_references() will raise a -CORBA::ORB::InvalidName exception.

-

2.10.2  The Naming Service Interface

It is beyond the scope of this chapter to describe in detail the +resolve_initial_references(). The following code fragment shows +how it is used:

CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv); +CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + +CosNaming::NamingContext_var rootContext; +rootContext = CosNaming::NamingContext::_narrow(obj);

Remember from section 1.2, omniORB constructs its internal +list of initial references at initialisation time using the +information provided in the configuration file omniORB.cfg, or +given on the command line. If this file is not present, the internal +list will be empty and resolve_initial_references() will raise a +CORBA::ORB::InvalidName exception.

+ +

2.10.2  The Naming Service Interface

It is beyond the scope of this chapter to describe in detail the Naming Service interface. You should consult the CORBA services -specification [OMG98] (chapter 3). The code listed in -eg3_impl.cc and eg3_clt.cc are good examples of how the -service can be used. Please spend time to study the examples -carefully.

-

2.11  Example 4 — Using tie implementation templates

omniORB supports tie implementation templates as an alternative -way of providing servant classes. If you use the -Wbtp option +specification [OMG98] (chapter 3). The code listed in +eg3_impl.cc and eg3_clt.cc are good examples of how the +service can be used.

+ +

2.11  Example 4 — Using tie implementation templates

+

omniORB supports tie implementation templates as an alternative +way of providing servant classes. If you use the -Wbtp option to omniidl, it generates an extra template class for each interface. This template class can be used to tie a C++ class to the skeleton -class of the interface.

The source code in eg3_tieimpl.cc at the end of this chapter +class of the interface.

The source code in eg3_tieimpl.cc at the end of this chapter illustrates how the template class can be used. The code is almost -identical to eg3_impl.cc with only a few changes.

Firstly, the servant class Echo_i does not inherit from any -stub classes. This is the main benefit of using the template class +identical to eg3_impl.cc with only a few changes.

Firstly, the servant class Echo_i does not inherit from any +skeleton classes. This is the main benefit of using the template class because there are applications in which it is difficult to require -every servant class to derive from CORBA classes.

Secondly, the instantiation of a CORBA object now involves creating an -instance of the implementation class and an instance of the -template. Here is the relevant code fragment:

class Echo_i { ... }; - -Echo_i *myimpl = new Echo_i(); -POA_Echo_tie<Echo_i> myecho(myimpl); - -PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho);

For interface Echo, the name of its tie implementation template -is POA_Echo_tie. The template parameter is the servant +every servant class to derive from CORBA classes.

Secondly, the instantiation of a CORBA object now involves creating an +instance of the implementation class and an instance of the +template. Here is the relevant code fragment:

class Echo_i { ... }; + +Echo_i *myimpl = new Echo_i(); +POA_Echo_tie<Echo_i> myecho(myimpl); + +PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho);

For interface Echo, the name of its tie implementation template +is POA_Echo_tie. The template parameter is the servant class that contains an implementation of each of the operations defined in the interface. As used above, the tie template takes -ownership of the Echo_i instance, and deletes it when the tie +ownership of the Echo_i instance, and deletes it when the tie object goes out of scope. The tie constructor has an optional boolean -argument (defaulted to true) which indicates whether or not it should -delete the servant object. For full details of using tie templates, -see the CORBA C++ mapping specification.

-

2.12  Source Listings

-

2.12.1  eg1.cc

// eg1.cc - This is the source code of example 1 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// In this example, both the object implementation and the -// client are in the same process. -// -// Usage: eg1 -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -// This is the object implementation. - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - - -////////////////////////////////////////////////////////////////////// - -// This function acts as a client to the object. - -static void hello(Echo_ptr e) -{ - if( CORBA::is_nil(e) ) { - cerr << "hello: The object reference is nil!\n" << endl; - return; - } - - CORBA::String_var src = (const char*) "Hello!"; - // String literals are (char*) rather than (const char*) on some - // old compilers. Thus it is essential to cast to (const char*) - // here to ensure that the string is copied, so that the - // CORBA::String_var does not attempt to 'delete' the string - // literal. - - CORBA::String_var dest = e->echoString(src); - - cout << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - - - try { - // Initialise the ORB. - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - // Obtain a reference to the root POA. - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - // We allocate the object on the heap. Since this is a reference - // counted object, it will be deleted by the POA when it is no - // longer needed. - Echo_i* myecho = new Echo_i(); - - // Activate the object. This tells the POA that this object is - // ready to accept requests. - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object. - Echo_var myechoref = myecho->_this(); - - // Decrement the reference count of the object implementation, so - // that it will be properly cleaned up when the POA has determined - // that it is no longer needed. - myecho->_remove_ref(); - - // Obtain a POAManager, and tell the POA to start accepting - // requests on its objects. - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - // Do the client-side call. - hello(myechoref); - - // Clean up all the resources. - orb->destroy(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}
-

2.12.2  eg2_impl.cc

// eg2_impl.cc - This is the source code of example 2 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the object implementation. -// -// Usage: eg2_impl -// -// On startup, the object reference is printed to cerr as a -// stringified IOR. This string should be used as the argument to -// eg2_clt. -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - cout << "Upcall " << mesg << endl; - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - Echo_i* myecho = new Echo_i(); - - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object, and print it out as a - // stringified IOR. - obj = myecho->_this(); - CORBA::String_var sior(orb->object_to_string(obj)); - cout << (char*)sior << endl; - - myecho->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}
-

2.12.3  eg2_clt.cc

// eg2_clt.cc - This is the source code of example 2 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the client. The object reference is given as a -// stringified IOR on the command line. -// -// Usage: eg2_clt <object reference> -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> -# include <fstream> - using namespace std; -#else -# include <iostream.h> -#endif - - -static void hello(Echo_ptr e) -{ - CORBA::String_var src = (const char*) "Hello!"; - - CORBA::String_var dest = e->echoString(src); - - cout << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - - - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - if( argc != 2 ) { - cerr << "usage: eg2_clt <object reference>" << endl; - return 1; - } - - CORBA::Object_var obj = orb->string_to_object(argv[1]); - Echo_var echoref = Echo::_narrow(obj); - if( CORBA::is_nil(echoref) ) { - cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; - return 1; - } - for (CORBA::ULong count=0; count<10; count++) - hello(echoref); - - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}
-

2.12.4  eg3_impl.cc

// eg3_impl.cc - This is the source code of example 3 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the object implementation. -// -// Usage: eg3_impl -// -// On startup, the object reference is registered with the -// COS naming service. The client uses the naming service to -// locate this object. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// test [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); - - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int -main(int argc, char **argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - Echo_i* myecho = new Echo_i(); - - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object, and register it in - // the naming service. - obj = myecho->_this(); - - CORBA::String_var x; - x = orb->object_to_string(obj); - cout << x << endl; - - if( !bindObjectToName(orb, obj) ) - return 1; - - myecho->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Boolean -bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return 0; - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch (CORBA::ORB::InvalidName&) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return 0; - } - - try { - // Bind a context called "test" to the root context: - - CosNaming::Name contextName; - contextName.length(1); - contextName[0].id = (const char*) "test"; // string copied - contextName[0].kind = (const char*) "my_context"; // string copied - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - CosNaming::NamingContext_var testContext; - try { - // Bind the context to root. - testContext = rootContext->bind_new_context(contextName); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - // If the context already exists, this exception will be raised. - // In this case, just resolve the name and assign testContext - // to the object returned: - CORBA::Object_var obj; - obj = rootContext->resolve(contextName); - testContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(testContext) ) { - cerr << "Failed to narrow naming context." << endl; - return 0; - } - } - - // Bind objref with name Echo to the testContext: - CosNaming::Name objectName; - objectName.length(1); - objectName[0].id = (const char*) "Echo"; // string copied - objectName[0].kind = (const char*) "Object"; // string copied - - try { - testContext->bind(objectName, objref); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - testContext->rebind(objectName, objref); - } - // Note: Using rebind() will overwrite any Object previously bound - // to /test/Echo with obj. - // Alternatively, bind() can be used, which will raise a - // CosNaming::NamingContext::AlreadyBound exception if the name - // supplied is already bound to an object. - - // Amendment: When using OrbixNames, it is necessary to first try bind - // and then rebind, as rebind on it's own will throw a NotFoundexception if - // the Name has not already been bound. [This is incorrect behaviour - - // it should just bind]. - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - return 0; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - return 1; -}
-

2.12.5  eg3_clt.cc

// eg3_clt.cc - This is the source code of example 3 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the client. It uses the COSS naming service -// to obtain the object reference. -// -// Usage: eg3_clt -// -// -// On startup, the client lookup the object reference from the -// COS naming service. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// text [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb); - -static void hello(Echo_ptr e) -{ - if( CORBA::is_nil(e) ) { - cerr << "hello: The object reference is nil!\n" << endl; - return; - } - - CORBA::String_var src = (const char*) "Hello!"; - - CORBA::String_var dest = e->echoString(src); - - cerr << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int -main (int argc, char **argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = getObjectReference(orb); - - Echo_var echoref = Echo::_narrow(obj); - - for (CORBA::ULong count=0; count < 10; count++) - hello(echoref); - - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Object_ptr -getObjectReference(CORBA::ORB_ptr orb) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return CORBA::Object::_nil(); - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch(CORBA::ORB::InvalidName& ex) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return CORBA::Object::_nil(); - } - - // Create a name object, containing the name test/context: - CosNaming::Name name; - name.length(2); - - name[0].id = (const char*) "test"; // string copied - name[0].kind = (const char*) "my_context"; // string copied - name[1].id = (const char*) "Echo"; - name[1].kind = (const char*) "Object"; - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - try { - // Resolve the name to an object reference. - return rootContext->resolve(name); - } - catch(CosNaming::NamingContext::NotFound& ex) { - // This exception is thrown if any of the components of the - // path [contexts or the object] aren't found: - cerr << "Context not found." << endl; - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - - return CORBA::Object::_nil(); -}
-

2.12.6  eg3_tieimpl.cc

// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that -// the tie implementation skeleton is used. -// -// This is the object implementation. -// -// Usage: eg3_tieimpl -// -// On startup, the object reference is registered with the -// COS naming service. The client uses the naming service to -// locate this object. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// test [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include <echo.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr); - - -// This is the object implementation. Notice that it does not inherit -// from any stub class, and notice that the echoString() member -// function does not have to be virtual. - -class Echo_i { -public: - inline Echo_i() {} - inline ~Echo_i() {} - char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - // Note that the <myecho> tie object is constructed on the stack - // here. It will delete its implementation (myimpl) when it it - // itself destroyed (when it goes out of scope). It is essential - // however to ensure that such servants are not deleted whilst - // still activated. - // - // Tie objects can of course be allocated on the heap using new, - // in which case they are deleted when their reference count - // becomes zero, as with any other servant object. - Echo_i* myimpl = new Echo_i(); - POA_Echo_tie<Echo_i> myecho(myimpl); - - PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho); - - // Obtain a reference to the object, and register it in - // the naming service. - obj = myecho._this(); - if( !bindObjectToName(orb, obj) ) - return 1; - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Boolean -bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return 0; - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch (CORBA::ORB::InvalidName&) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return 0; - } - - try { - // Bind a context called "test" to the root context: - - CosNaming::Name contextName; - contextName.length(1); - contextName[0].id = (const char*) "test"; // string copied - contextName[0].kind = (const char*) "my_context"; // string copied - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - CosNaming::NamingContext_var testContext; - try { - // Bind the context to root. - testContext = rootContext->bind_new_context(contextName); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - // If the context already exists, this exception will be raised. - // In this case, just resolve the name and assign testContext - // to the object returned: - CORBA::Object_var obj; - obj = rootContext->resolve(contextName); - testContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(testContext) ) { - cerr << "Failed to narrow naming context." << endl; - return 0; - } - } - - // Bind objref with name Echo to the testContext: - CosNaming::Name objectName; - objectName.length(1); - objectName[0].id = (const char*) "Echo"; // string copied - objectName[0].kind = (const char*) "Object"; // string copied - - try { - testContext->bind(objectName, objref); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - testContext->rebind(objectName, objref); - } - // Note: Using rebind() will overwrite any Object previously bound - // to /test/Echo with obj. - // Alternatively, bind() can be used, which will raise a - // CosNaming::NamingContext::AlreadyBound exception if the name - // supplied is already bound to an object. - - // Amendment: When using OrbixNames, it is necessary to first try bind - // and then rebind, as rebind on it's own will throw a NotFoundexception if - // the Name has not already been bound. [This is incorrect behaviour - - // it should just bind]. - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - return 0; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - return 1; -}
-
-1
The stub -code is the C++ code that provides the object mapping as defined in -the CORBA specification. -
2
In -omniORB, all object reference variable types are instantiated from the -template type _CORBA_ObjRef_Var. -
3
However, the implementation -of the type conversion operator between Echo_var and -Echo_ptr varies slightly among different C++ compilers; you -may need to do an explicit cast if the compiler complains about the -conversion being ambiguous. -
4
In the previous 1.0 version of the C++ +argument (defaulted to true) which indicates whether or not it +should delete the servant object. For full details of using tie +templates, see the CORBA C++ mapping specification.

+ +

2.12  Source Listings

+ +

2.12.1  eg1.cc

// eg1.cc - This is the source code of example 1 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// In this example, both the object implementation and the +// client are in the same process. +// +// Usage: eg1 +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +// This is the object implementation. + +class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + // Memory management rules say we must return a newly allocated + // string. + return CORBA::string_dup(mesg); +} + + +////////////////////////////////////////////////////////////////////// + +// This function acts as a client to the object. + +static void hello(Echo_ptr e) +{ + if( CORBA::is_nil(e) ) { + cerr << "hello: The object reference is nil!" << endl; + return; + } + + CORBA::String_var src = (const char*) "Hello!"; + // String literals are (char*) rather than (const char*) on some + // old compilers. Thus it is essential to cast to (const char*) + // here to ensure that the string is copied, so that the + // CORBA::String_var does not attempt to 'delete' the string + // literal. + + CORBA::String_var dest = e->echoString(src); + + cout << "I said, \"" << (char*)src << "\"." << endl + << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + // Initialise the ORB. + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + // Obtain a reference to the root POA. + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + // We allocate the servant (implementation object) on the heap. + // The servant is reference counted. We start out holding a + // reference, and when the object is activated, the POA holds + // another reference. The PortableServer::Servant_var<> template + // automatically releases our reference when it goes out of scope. + PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + + // Activate the object. This tells the POA that this object is + // ready to accept requests. + PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + + // Obtain a reference to the object. + Echo_var myechoref = myecho->_this(); + + // Obtain a POAManager, and tell the POA to start accepting + // requests on its objects. + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + // Do the client-side call. + hello(myechoref); + + // Clean up all the resources. + orb->destroy(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +}
+ +

2.12.2  eg2_impl.cc

// eg2_impl.cc - This is the source code of example 2 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the object implementation. +// +// Usage: eg2_impl +// +// On startup, the object reference is printed to cout as a +// stringified IOR. This string should be used as the argument to +// eg2_clt. +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + + +class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + cout << "Upcall: " << mesg << endl; + return CORBA::string_dup(mesg); +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + + PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + + // Obtain a reference to the object, and print it out as a + // stringified IOR. + obj = myecho->_this(); + CORBA::String_var sior(orb->object_to_string(obj)); + cout << sior << endl; + + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + // Block until the ORB is shut down. + orb->run(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +}
+ +

2.12.3  eg2_clt.cc

// eg2_clt.cc - This is the source code of example 2 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the client. The object reference is given as a +// stringified IOR on the command line. +// +// Usage: eg2_clt <object reference> +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + + +static void hello(Echo_ptr e) +{ + CORBA::String_var src = (const char*) "Hello!"; + + CORBA::String_var dest = e->echoString(src); + + cout << "I said, \"" << (char*)src << "\"." << endl + << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + if (argc != 2) { + cerr << "usage: eg2_clt <object reference>" << endl; + return 1; + } + + CORBA::Object_var obj = orb->string_to_object(argv[1]); + + Echo_var echoref = Echo::_narrow(obj); + + if (CORBA::is_nil(echoref)) { + cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; + return 1; + } + + for (CORBA::ULong count=0; count<10; count++) + hello(echoref); + + orb->destroy(); + } + catch (CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +}
+ +

2.12.4  eg3_impl.cc

// eg3_impl.cc - This is the source code of example 3 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the object implementation. +// +// Usage: eg3_impl +// +// On startup, the object reference is registered with the +// COS naming service. The client uses the naming service to +// locate this object. +// +// The name which the object is bound to is as follows: +// root [context] +// | +// test [context] kind [my_context] +// | +// Echo [object] kind [Object] +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); + + +class Echo_i : public POA_Echo +{ +public: + inline Echo_i() {} + virtual ~Echo_i() {} + virtual char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + return CORBA::string_dup(mesg); +} + +////////////////////////////////////////////////////////////////////// + +int +main(int argc, char **argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + PortableServer::Servant_var<Echo_i> myecho = new Echo_i(); + + PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); + + // Obtain a reference to the object, and register it in + // the naming service. + obj = myecho->_this(); + + CORBA::String_var sior(orb->object_to_string(obj)); + cout << sior << endl; + + if (!bindObjectToName(orb, obj)) + return 1; + + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + orb->run(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} + +////////////////////////////////////////////////////////////////////// + +static CORBA::Boolean +bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) +{ + CosNaming::NamingContext_var rootContext; + + try { + // Obtain a reference to the root context of the Name service: + CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + + // Narrow the reference returned. + rootContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(rootContext)) { + cerr << "Failed to narrow the root naming context." << endl; + return 0; + } + } + catch (CORBA::NO_RESOURCES&) { + cerr << "Caught NO_RESOURCES exception. You must configure omniORB " + << "with the location" << endl + << "of the naming service." << endl; + return 0; + } + catch (CORBA::ORB::InvalidName&) { + // This should not happen! + cerr << "Service required is invalid [does not exist]." << endl; + return 0; + } + + try { + // Bind a context called "test" to the root context: + + CosNaming::Name contextName; + contextName.length(1); + contextName[0].id = (const char*) "test"; // string copied + contextName[0].kind = (const char*) "my_context"; // string copied + // Note on kind: The kind field is used to indicate the type + // of the object. This is to avoid conventions such as that used + // by files (name.type -- e.g. test.ps = postscript etc.) + + CosNaming::NamingContext_var testContext; + try { + // Bind the context to root. + testContext = rootContext->bind_new_context(contextName); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + // If the context already exists, this exception will be raised. + // In this case, just resolve the name and assign testContext + // to the object returned: + CORBA::Object_var obj = rootContext->resolve(contextName); + testContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(testContext)) { + cerr << "Failed to narrow naming context." << endl; + return 0; + } + } + + // Bind objref with name Echo to the testContext: + CosNaming::Name objectName; + objectName.length(1); + objectName[0].id = (const char*) "Echo"; // string copied + objectName[0].kind = (const char*) "Object"; // string copied + + try { + testContext->bind(objectName, objref); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + testContext->rebind(objectName, objref); + } + // Note: Using rebind() will overwrite any Object previously bound + // to /test/Echo with obj. + // Alternatively, bind() can be used, which will raise a + // CosNaming::NamingContext::AlreadyBound exception if the name + // supplied is already bound to an object. + } + catch (CORBA::TRANSIENT& ex) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "naming service." << endl + << "Make sure the naming server is running and that omniORB is " + << "configured correctly." << endl; + + return 0; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() + << " while using the naming service." << endl; + return 0; + } + return 1; +}
+ +

2.12.5  eg3_clt.cc

// eg3_clt.cc - This is the source code of example 3 used in Chapter 2 +// "The Basics" of the omniORB user guide. +// +// This is the client. It uses the COSS naming service +// to obtain the object reference. +// +// Usage: eg3_clt +// +// +// On startup, the client lookup the object reference from the +// COS naming service. +// +// The name which the object is bound to is as follows: +// root [context] +// | +// text [context] kind [my_context] +// | +// Echo [object] kind [Object] +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb); + +static void hello(Echo_ptr e) +{ + if (CORBA::is_nil(e)) { + cerr << "hello: The object reference is nil!\n" << endl; + return; + } + + CORBA::String_var src = (const char*) "Hello!"; + + CORBA::String_var dest = e->echoString(src); + + cerr << "I said, \"" << (char*)src << "\"." << endl + << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; +} + +////////////////////////////////////////////////////////////////////// + +int +main (int argc, char **argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + CORBA::Object_var obj = getObjectReference(orb); + + Echo_var echoref = Echo::_narrow(obj); + + for (CORBA::ULong count=0; count < 10; count++) + hello(echoref); + + orb->destroy(); + } + catch (CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} + +////////////////////////////////////////////////////////////////////// + +static CORBA::Object_ptr +getObjectReference(CORBA::ORB_ptr orb) +{ + CosNaming::NamingContext_var rootContext; + + try { + // Obtain a reference to the root context of the Name service: + CORBA::Object_var obj; + obj = orb->resolve_initial_references("NameService"); + + // Narrow the reference returned. + rootContext = CosNaming::NamingContext::_narrow(obj); + + if (CORBA::is_nil(rootContext)) { + cerr << "Failed to narrow the root naming context." << endl; + return CORBA::Object::_nil(); + } + } + catch (CORBA::NO_RESOURCES&) { + cerr << "Caught NO_RESOURCES exception. You must configure omniORB " + << "with the location" << endl + << "of the naming service." << endl; + return CORBA::Object::_nil(); + } + catch (CORBA::ORB::InvalidName& ex) { + // This should not happen! + cerr << "Service required is invalid [does not exist]." << endl; + return CORBA::Object::_nil(); + } + + // Create a name object, containing the name test/context: + CosNaming::Name name; + name.length(2); + + name[0].id = (const char*) "test"; // string copied + name[0].kind = (const char*) "my_context"; // string copied + name[1].id = (const char*) "Echo"; + name[1].kind = (const char*) "Object"; + // Note on kind: The kind field is used to indicate the type + // of the object. This is to avoid conventions such as that used + // by files (name.type -- e.g. test.ps = postscript etc.) + + try { + // Resolve the name to an object reference. + return rootContext->resolve(name); + } + catch (CosNaming::NamingContext::NotFound& ex) { + // This exception is thrown if any of the components of the + // path [contexts or the object] aren't found: + cerr << "Context not found." << endl; + } + catch (CORBA::TRANSIENT& ex) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "naming service." << endl + << "Make sure the naming server is running and that omniORB is " + << "configured correctly." << endl; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() + << " while using the naming service." << endl; + } + return CORBA::Object::_nil(); +}
+ +

2.12.6  eg3_tieimpl.cc

// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that +// the tie implementation skeleton is used. +// +// This is the object implementation. +// +// Usage: eg3_tieimpl +// +// On startup, the object reference is registered with the +// COS naming service. The client uses the naming service to +// locate this object. +// +// The name which the object is bound to is as follows: +// root [context] +// | +// test [context] kind [my_context] +// | +// Echo [object] kind [Object] +// + +#include <echo.hh> + +#ifdef HAVE_STD +# include <iostream> + using namespace std; +#else +# include <iostream.h> +#endif + +static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); + + +// This is the object implementation. Notice that it does not inherit +// from any skeleton class, and notice that the echoString() member +// function does not have to be virtual. + +class Echo_i { +public: + inline Echo_i() {} + inline ~Echo_i() {} + char* echoString(const char* mesg); +}; + + +char* Echo_i::echoString(const char* mesg) +{ + return CORBA::string_dup(mesg); +} + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); + + // Note that the <myecho> tie object is constructed on the stack + // here. It will delete its implementation (myimpl) when it it + // itself destroyed (when it goes out of scope). It is essential + // however to ensure that such servants are not deleted whilst + // still activated. + // + // Tie objects can of course be allocated on the heap using new, + // in which case they are deleted when their reference count + // becomes zero, as with any other servant object. + Echo_i* myimpl = new Echo_i(); + POA_Echo_tie<Echo_i> myecho(myimpl); + + PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho); + + // Obtain a reference to the object, and register it in + // the naming service. + obj = myecho._this(); + if (!bindObjectToName(orb, obj)) + return 1; + + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + orb->run(); + } + catch (CORBA::SystemException& ex) { + cerr << "Caught CORBA::" << ex._name() << endl; + } + catch (CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} + +////////////////////////////////////////////////////////////////////// + +static CORBA::Boolean +bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) +{ + CosNaming::NamingContext_var rootContext; + + try { + // Obtain a reference to the root context of the Name service: + CORBA::Object_var obj = orb->resolve_initial_references("NameService"); + + // Narrow the reference returned. + rootContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(rootContext)) { + cerr << "Failed to narrow the root naming context." << endl; + return 0; + } + } + catch (CORBA::NO_RESOURCES&) { + cerr << "Caught NO_RESOURCES exception. You must configure omniORB " + << "with the location" << endl + << "of the naming service." << endl; + return 0; + } + catch (CORBA::ORB::InvalidName&) { + // This should not happen! + cerr << "Service required is invalid [does not exist]." << endl; + return 0; + } + + try { + // Bind a context called "test" to the root context: + + CosNaming::Name contextName; + contextName.length(1); + contextName[0].id = (const char*) "test"; // string copied + contextName[0].kind = (const char*) "my_context"; // string copied + // Note on kind: The kind field is used to indicate the type + // of the object. This is to avoid conventions such as that used + // by files (name.type -- e.g. test.ps = postscript etc.) + + CosNaming::NamingContext_var testContext; + try { + // Bind the context to root. + testContext = rootContext->bind_new_context(contextName); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + // If the context already exists, this exception will be raised. + // In this case, just resolve the name and assign testContext + // to the object returned: + CORBA::Object_var obj = rootContext->resolve(contextName); + testContext = CosNaming::NamingContext::_narrow(obj); + if (CORBA::is_nil(testContext)) { + cerr << "Failed to narrow naming context." << endl; + return 0; + } + } + + // Bind objref with name Echo to the testContext: + CosNaming::Name objectName; + objectName.length(1); + objectName[0].id = (const char*) "Echo"; // string copied + objectName[0].kind = (const char*) "Object"; // string copied + + try { + testContext->bind(objectName, objref); + } + catch(CosNaming::NamingContext::AlreadyBound& ex) { + testContext->rebind(objectName, objref); + } + // Note: Using rebind() will overwrite any Object previously bound + // to /test/Echo with obj. + // Alternatively, bind() can be used, which will raise a + // CosNaming::NamingContext::AlreadyBound exception if the name + // supplied is already bound to an object. + } + catch (CORBA::TRANSIENT& ex) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "naming service." << endl + << "Make sure the naming server is running and that omniORB is " + << "configured correctly." << endl; + + return 0; + } + catch (CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() + << " while using the naming service." << endl; + return 0; + } + return 1; +}
+ +
+1
Rather than +deriving from the skeleton class, an alternative is to use a +tie template, described in section 2.11.
2
In the previous 1.0 version of the C++ mapping, servant reference counting was optional, chosen by inheriting -from a mixin class named RefCountServantBase. That has been +from a mixin class named RefCountServantBase. That has been deprecated in the 1.1 version of the C++ mapping, but the class is still available as an empty struct, so existing code that inherits -from RefCountServantBase will continue to work. -
5
A conversion operator of -CORBA::String_var converts a CORBA::String_var -to a char*. -
6
Please refer to the C++ -mapping specification for details of the String_var mapping. -
7
For backwards compatibility, the ORB identifiers -‘omniORB2’ and ‘omniORB3’ are also accepted. -
8
If a system exception is not caught, the C++ -runtime will call the terminate() function. This function is +from RefCountServantBase will continue to work.
3
A conversion operator of +CORBA::String_var converts a CORBA::String_var +to a char*.
4
Please refer to the C++ +mapping specification for details of the String_var mapping.
5
For backwards compatibility, the ORB identifiers +‘omniORB2’ and ‘omniORB3’ are also accepted.
6
If a system exception is not caught, the C++ +runtime will call the terminate() function. This function is defaulted to abort the whole process and on some systems will cause a -core file to be produced. -
9
Run Time Type -Identification -
10
The POA itself -can be activated on demand with an adapter activator. -
11
There are escaping rules to cope +core file to be produced.
7
The POA itself can be activated on demand +with an adapter activator.
8
There are escaping rules to cope with id and kind fields which contain ‘.’ and ‘/’ characters. See -chapter 6 of this manual, and chapter 3 of the CORBA +chapter 7 of this manual, and chapter 3 of the CORBA services specification, as updated for the Interoperable Naming -Service [OMG00]. -
+Service [OMG00].
- -

Chapter 3  C++ language mapping

Now that you are familiar with the basics, it is important to + +

Chapter 3  C++ language mapping

Now that you are familiar with the basics, it is important to familiarise yourself with the standard IDL to C++ language mapping. -The mapping is described in detail in [OMG03]. If you have +The mapping is described in detail in [OMG03]. If you have not done so, you should obtain a copy of the document and use that as -the programming guide to omniORB.

The specification is not an easy read. The alternative is to use one -of the books on CORBA programming that has begun to appear. For -instance, Henning and Vinoski’s ‘Advanced CORBA Programming with -C++’ [HV99] includes many example code bits to illustrate -how to use the C++ mapping.

-

3.1  omniORB 2 BOA compatibility

-

If you use the -WbBOA option to omniidl, it will generate -skeleton code with the same interface as the old omniORB 2 BOA -mapping, as well as code to be used with the POA. Note that since the -major problem with the BOA specification was that server code was not -portable between ORBs, it is unlikely that omniORB 4.1’s BOA +the programming guide to omniORB.

The specification is not an easy read. The alternative is to use one +of the books on CORBA programming. For instance, Henning and Vinoski’s +‘Advanced CORBA Programming with C++’ [HV99] includes many +example code fragments to illustrate how to use the C++ mapping.

+ +

3.1  omniORB 2 BOA compatibility

+

Before the Portable Object Adapter (POA) specification, many of the +details of how servant objects should be implemented and registered +with the system were unspecified, so server-side code was not portable +between ORBs. The POA specification rectifies that. For compatibility, +omniORB 4 still supports the old omniORB 2.x BOA mapping, but you +should always use the POA mapping for new code. BOA code and POA code +can coexist within a single program.

If you use the -WbBOA option to omniidl, it will generate +skeleton code with (nearly) the same interface as the old omniORB 2 +BOA mapping, as well as code to be used with the POA. Note that since +the major problem with the BOA specification was that server code was +not portable between ORBs, it is unlikely that omniORB’s BOA compatibility will help you much if you are moving from a different -BOA-based ORB.

The BOA compatibility permits the majority of BOA code to compile +BOA-based ORB.

The BOA compatibility permits the majority of BOA code to compile without difficulty. However, there are a number of constructs which -relied on omniORB 2 implementation details which no longer work.

  • omniORB 2 did not use distinct types for object references and +relied on omniORB 2 implementation details which no longer work.

    • omniORB 2 did not use distinct types for object references and servants, and often accepted a pointer to a servant when the CORBA specification says it should only accept an object reference. Such -code will not compile under omniORB 4.1.
    • The reverse is true for BOA::obj_is_ready(). It now only +code will not compile under omniORB 4.
    • The reverse is true for BOA::obj_is_ready(). It now only works when passed a pointer to a servant object, not an object reference. The more commonly used mechanism of calling -_obj_is_ready(boa) on the servant object still works as -expected.
    • It used to be the case that the skeleton class for interface -I (_sk_I) was derived from class I. This meant +_obj_is_ready(boa) on the servant object still works as +expected.
    • It used to be the case that the skeleton class for interface +I (_sk_I) was derived from class I. This meant that the names of any types declared in the interface were available in the scope of the skeleton class. This is no longer true. If you -have an interface:
      interface I { - struct S { - long a,b; - }; - S op(); -};

      then where before the implementation code might have been:

      class I_impl : public virtual _sk_I { - S op(); // _sk_I is derived from I -}; -I::S I_impl::op() { - S ret; - // ... -}

      it is now necessary to fully qualify all uses of S:

      class I_impl : public virtual _sk_I { - I::S op(); // _sk_I is not derived from I -}; -I::S I_impl::op() { - I::S ret; - // ... -}
    • The proprietary omniORB 2 LifeCycle extensions are no longer +have an interface:
      interface I { + struct S { + long a,b; + }; + S op(); +};

      then where before the implementation code might have been:

      class I_impl : public virtual _sk_I { + S op(); // _sk_I is derived from I +}; +I::S I_impl::op() { + S ret; + // ... +}

      it is now necessary to fully qualify all uses of S:

      class I_impl : public virtual _sk_I { + I::S op(); // _sk_I is not derived from I +}; +I::S I_impl::op() { + I::S ret; + // ... +}
    • The proprietary omniORB 2 LifeCycle extensions are no longer supported. All of the facilities it offered can be implemented with -the POA interfaces, and the omniORB::LOCATION_FORWARD -exception (see section 4.8). Code which used the -old interfaces will have to be rewritten.
    -

    3.2  omniORB 3.0 compatibility

    omniORB 4.1 is almost completely source-code compatible with omniORB +the POA interfaces, and the omniORB::LOCATION_FORWARD +exception (see section 4.8). Code which used the +old interfaces will have to be rewritten.

+ +

3.2  omniORB 3.0 compatibility

omniORB 4 is almost completely source-code compatible with omniORB 3.0. There are two main cases where code may have to change. The first is code that uses the omniORB API, some aspects of which have changed. The omniORB configuration file also has a new format. See the -next chapter for details of the new API and configuration file.

The second case of code that may have to change is code using the +next chapter for details of the new API and configuration file.

The second case of code that may have to change is code using the Dynamic Any interfaces. The standard changed quite significantly between CORBA 2.2 and CORBA 2.3; omniORB 3.0 supported the old CORBA -2.2 interfaces; omniORB 4.1 uses the new mapping. The changes are -largely syntax changes, rather than semantic differences.

-

3.3  omniORB 4.0 compatibility

omniORB 4.1 is source-code compatible with omniORB 4.0, with four -exceptions:

  1. As required by the 1.1 version of the CORBA C++ mapping -specification, the RefCountServantBase class has been +2.2 interfaces; omniORB 4 uses the new mapping. The changes are +largely syntax changes, rather than semantic differences.

    + +

    3.3  omniORB 4.0 compatibility

    omniORB 4.2 is source-code compatible with omniORB 4.0, with four +exceptions:

    1. As required by the 1.1 version of the CORBA C++ mapping +specification, the RefCountServantBase class has been deprecated, and the reference counting functionality moved into -ServantBase. For backwards compatibility, -RefCountServantBase still exists, but is now defined as an +ServantBase. For backwards compatibility, +RefCountServantBase still exists, but is now defined as an empty struct. Most code will continue to work unchanged, but code -that explicitly calls RefCountServantBase::_add_ref() or -_remove_ref() will no longer compile.
    2. omniORB 4.0 had an option for Any extraction semantics that was +that explicitly calls RefCountServantBase::_add_ref() or +_remove_ref() will no longer compile.
    3. omniORB 4.0 had an option for Any extraction semantics that was compatible with omniORB 2.7, where ownership of extracted values was -not maintained by the Any. That option is no longer available.
    4. The members of the clientSendRequest interceptor have +not maintained by the Any. That option is no longer available.
    5. The members of the clientSendRequest interceptor have been changed, replacing all the separate variables with a single -member of type GIOP_C. All the values previously available -can be accessed through the GIOP_C instance.
    6. The C++ mapping contains Any insertion operators for sequence +member of type GIOP_C. All the values previously available +can be accessed through the GIOP_C instance.
    7. The C++ mapping contains Any insertion operators for sequence types that are passed by pointer, which cause the Any to take ownership of the inserted sequence. In omniORB 4.0 and earlier, the sequence was immediately marshalled into the Any’s internal buffer, and the sequence was deleted. In omniORB 4.1, the sequence pointer is stored by the Any, and the sequence is deleted later when the Any -is destroyed.

      For most uses, this change is not visible to application code. +is destroyed.

      For most uses, this change is not visible to application code. However, if a sequence is constructed using an application-supplied -buffer with the release flag set to false (meaning that the +buffer with the release flag set to false (meaning that the application continues to own the buffer), it is now important that the buffer is not deleted or modified while the Any exists, since the Any continues to refer to the buffer contents. This change @@ -1719,1035 +1669,953 @@ with the Any seeing modified data or the process crashing due to accessing deleted data. To avoid this situation, use the alternative Any insertion operator using a const reference, which copies the -sequence.

    -

    Chapter 4  omniORB configuration and API

    -

    omniORB 4.1 has a wide range of parameters that can be -configured. They can be set in the configuration file / Windows -registry, as environment variables, on the command line, or within a -proprietary extra argument to CORBA::ORB_init(). A few parameters -can be configured at run time. This chapter lists all the -configuration parameters, and how they are used.

    -

    4.1  Setting parameters

    When CORBA::ORB_init() is called, the value for each configuration -parameter is searched for in the following order:

    1. Command line arguments -
    2. ORB_init() options -
    3. Environment variables -
    4. Configuration file / Windows registry -
    5. Built-in defaults
    -

    4.1.1  Command line arguments

    Command line arguments take the form -‘-ORBparameter’, and usually expect another -argument. An example is ‘-ORBtraceLevel 10’.

    -

    4.1.2  ORB_init() parameter

    ORB_init()’s extra argument accepts an array of two-dimensional -string arrays, like this:

    const char* options[][2] = { { "traceLevel", "1" }, { 0, 0 } }; -orb = CORBA::ORB_init(argc,argv,"omniORB4",options);
    -

    4.1.3  Environment variables

    Environment variables consist of the parameter name prefixed with -‘ORB’. Using bash, for example

    export ORBtraceLevel=10
    -

    4.1.4  Configuration file

    The best way to understand the format of the configuration file is to -look at the sample.cfg file in the omniORB distribution. Each -parameter is set on a single line like

    traceLevel = 10
    -

    Some parameters can have more than one value, in which case the +sequence.

+ +

3.4  omniORB 4.1 compatibility

omniORB 4.2 is source-code compatible with omniORB 4.1 with one +exception:

  1. When omniORB 4.1 and earlier detected a timeout condition, they +would throw the CORBA::TRANSIENT system exception. omniORB +4.2 supports the CORBA::TIMEOUT system exception that was +introduced with the CORBA Messaging specification. Application code +that caught CORBA::TRANSIENT to handle timeout situations +should be updated to catch CORBA::TIMEOUT +instead. Alternatively, to avoid code changes, omniORB can be +configured to throw CORBA::TRANSIENT for timeouts, by setting +the throwTransientOnTimeout parameter to 1. See +section 4.4.
+ +

Chapter 4  omniORB configuration and API

+

omniORB has a wide range of parameters that can be configured. They +can be set in the configuration file / Windows registry, as +environment variables, on the command line, or within a proprietary +extra argument to CORBA::ORB_init(). A few parameters can be +configured at run time. This chapter lists all the configuration +parameters, and how they are used.

+ +

4.1  Setting parameters

When CORBA::ORB_init() is called, the value for each configuration +parameter is searched for in the following order:

  1. Command line arguments +
  2. ORB_init() options +
  3. Environment variables +
  4. Configuration file / Windows registry +
  5. Built-in defaults
+ +

4.1.1  Command line arguments

Command line arguments take the form +‘-ORBparameter’, and usually expect another +argument. An example is ‘-ORBtraceLevel 10’.

+ +

4.1.2  ORB_init() parameter

ORB_init()’s extra argument accepts an array of two-dimensional +string arrays, like this:

const char* options[][2] = { { "traceLevel", "1" }, { 0, 0 } }; +orb = CORBA::ORB_init(argc,argv,"omniORB4",options);
+ +

4.1.3  Environment variables

Environment variables consist of the parameter name prefixed with +‘ORB’. Using bash, for example

export ORBtraceLevel=10
+ +

4.1.4  Configuration file

The best way to understand the format of the configuration file is to +look at the sample.cfg file in the omniORB distribution. Each +parameter is set on a single line like

traceLevel = 10
+

Some parameters can have more than one value, in which case the parameter name may be specified more than once, or you can leave it -out:

InitRef = NameService=corbaname::host1.example.com
+out:

InitRef = NameService=corbaname::host1.example.com
         = InterfaceRepository=corbaloc::host2.example.com:1234/IfR
-

+

-
-Note how command line arguments and environment variables prefix -parameter names with ‘-ORB’ and ‘ORB’ respectively, but the -configuration file and the extra argument to ORB_init() do not use -a prefix. -

-

4.1.5  Windows registry

On Windows, configuration parameters can be stored in the registry, -under the key HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

The file sample.reg shows the settings that can be made. It can -be edited and then imported into regedit.

-

4.2  Tracing options

The following options control debugging trace output.

traceLevel    default = -1

omniORB can output tracing and diagnostic messages to the standard -error stream. The following levels are defined:

- - - - - - - - -
 
-level 0critical errors only
level 1informational messages only
level 2configuration information and warnings
-level 5notifications when server threads are -created and communication endpoints are shutdown
-level 10execution and exception traces
level 25trace each send or receive of a giop message
level 30dump up to 128 bytes of each giop message
level 40dump complete contents of each giop message

The trace level is cumulative, so at level 40, all trace -messages are output.

traceExceptions    default = -0

If the traceExceptions parameter is set true, all system +

+Command line arguments and environment variables prefix parameter +names with ‘-ORB’ and ‘ORB’ respectively, but the configuration file +and the extra argument to ORB_init() do not use a prefix. +

+ +

4.1.5  Windows registry

On Windows, configuration parameters can be stored in the registry, +under the key HKEY_LOCAL_MACHINE\SOFTWARE\omniORB.

The file sample.reg shows the settings that can be made. It can +be edited and then imported into regedit.

+ +

4.2  Tracing options

The following options control debugging trace output.

traceLevel    default = +1

omniORB can output tracing and diagnostic messages to the standard +error stream. The following levels are defined:

+ + + + + + + + +
 
+level 0critical errors only
level 1informational messages only
level 2configuration information and warnings
+level 5notifications when server threads are +created and communication endpoints are shutdown
+level 10execution and exception traces
level 25trace each send or receive of a GIOP message
level 30dump up to 128 bytes of each GIOP message
level 40dump complete contents of each GIOP message

The trace level is cumulative, so at level 40, all trace +messages are output.

traceExceptions    default = +0

If the traceExceptions parameter is set true, all system exceptions are logged as they are thrown, along with details about where the exception is thrown from. This parameter is enabled by -default if the traceLevel is set to 10 or more.

traceInvocations    default = -0

If the traceInvocations parameter is set true, all local and -remote invocations are logged, in addition to any logging that may -have been selected with traceLevel.

traceInvocationReturns    default = -0

If the traceInvocationReturns parameter is set true, a log -message is output as an operation invocation returns. In conjunction -with traceInvocations and traceTime (described below), -this provides a simple way of timing CORBA calls within your -application.

traceThreadId    default = -0

If traceThreadId is set true, all trace messages are prefixed -with the id of the thread outputting the message. This can be handy -for tracking down race conditions, but it adds significant overhead to -the logging function so it is turned off by default.

traceTime    default = -0

If traceTime is set true, all trace messages are prefixed with -the time. This is useful, but on some platforms it adds a very large -overhead, so it is turned off by default.

traceFile    default = -

omniORB’s tracing is normally sent to stderr. if traceFile it -set, the specified file name is used for trace messages.

-

4.2.1  Tracing API

The tracing parameters can be modified at runtime by assigning to the -following variables

namespace omniORB { - CORBA::ULong traceLevel; - CORBA::Boolean traceExceptions; - CORBA::Boolean traceInvocations; - CORBA::Boolean traceInvocationReturns; - CORBA::Boolean traceThreadId; - CORBA::Boolean traceTime; -};

Log messages can be sent somewhere other than stderr by registering a -logging function which is called with the text of each log message:

namespace omniORB { - typedef void (*logFunction)(const char*); - void setLogFunction(logFunction f); -};

The log function must not make any CORBA calls, since that could lead +default if the traceLevel is set to 10 or more.

traceInvocations    default = +0

If the traceInvocations parameter is set true, all local +and remote invocations are logged, in addition to any logging that may +have been selected with traceLevel.

traceInvocationReturns    default = +0

If the traceInvocationReturns parameter is set true, a +log message is output as an operation invocation returns. In +conjunction with traceInvocations and traceTime +(described below), this provides a simple way of timing CORBA calls +within your application.

traceThreadId    default = +1

If traceThreadId is set true, all trace messages are +prefixed with the id of the thread outputting the message. This can be +handy for making sense of multi-threaded code, but it adds overhead to +the logging so it can be disabled.

traceTime    default = +1

If traceTime is set true, all trace messages are +prefixed with the time. This is useful, but on some platforms it adds +a very large overhead, so it can be turned off.

traceFile    default = +

omniORB’s tracing is normally sent to stderr. If traceFile it +set, the specified file name is used for trace messages.

+ +

4.2.1  Tracing API

The tracing parameters can be modified at runtime by assigning to the +following variables

namespace omniORB { + CORBA::ULong traceLevel; + CORBA::Boolean traceExceptions; + CORBA::Boolean traceInvocations; + CORBA::Boolean traceInvocationReturns; + CORBA::Boolean traceThreadId; + CORBA::Boolean traceTime; +};

Log messages can be sent somewhere other than stderr by registering a +logging function which is called with the text of each log message:

namespace omniORB { + typedef void (*logFunction)(const char*); + void setLogFunction(logFunction f); +};

The log function must not make any CORBA calls, since that could lead to infinite recursion as outputting a log message caused other log -messages to be generated, and so on.

-

4.3  Miscellaneous global options

These options control miscellaneous features that affect the whole ORB -runtime.

dumpConfiguration    default = -0

If set true, the ORB dumps the values of all configuration parameters -at start-up.

scanGranularity    default = -5

As explained in chapter 8, omniORB regularly +messages to be generated, and so on.

+ +

4.3  Miscellaneous global options

These options control miscellaneous features that affect the whole ORB +runtime.

dumpConfiguration    default = +0

If set true, the ORB dumps the values of all configuration +parameters at start-up.

scanGranularity    default = +5

As explained in chapter 6, omniORB regularly scans incoming and outgoing connections, so it can close unused ones. This value is the granularity in seconds at which the ORB -performs its scans. A value of zero turns off the scanning altogether.

nativeCharCodeSet    default = -ISO-8859-1

The native code set the application is using for char and -string. See chapter 9.

nativeWCharCodeSet    default = -UTF-16

The native code set the application is using for wchar and -wstring. See chapter 9.

copyValuesInLocalCalls    default = -1

Determines whether valuetype parameters in local calls are copied or -not. See chapter 13.

abortOnInternalError    default = -0

If this is set true, internal fatal errors will abort immediately, -rather than throwing the omniORB::fatalException exception. -This can be helpful for tracking down bugs, since it leaves the call -stack intact.

abortOnNativeException    default = -0

On Windows, ‘native’ exceptions such as segmentation faults and divide -by zero appear as C++ exceptions that can be caught with catch -(...). Setting this parameter to true causes such exceptions to -abort the process instead.

maxSocketSend
-maxSocketRecv
+performs its scans. A value of zero turns off the scanning altogether.

nativeCharCodeSet    default = +ISO-8859-1

The native code set the application is using for char and +string. See chapter 8.

nativeWCharCodeSet    default = +UTF-16

The native code set the application is using for wchar and +wstring. See chapter 8.

defaultCharCodeSet    default = +none

The default code set used for char and string if the +server does not specify it in its IORs. See +chapter 8.

defaultWCharCodeSet    default = +none

The default code set used for wchar and wstring if the +server does not specify it in its IORs. See +chapter 8.

copyValuesInLocalCalls    default = +1

Determines whether valuetype parameters in local calls are copied or +not. See chapter 11.

abortOnInternalError    default = +0

If this is set true, internal fatal errors will abort +immediately, rather than throwing the omniORB::fatalException +exception. This can be helpful for tracking down bugs, since it +leaves the call stack intact.

abortOnNativeException    default = +0

On Windows, ‘native’ exceptions such as segmentation faults and divide +by zero appear as C++ exceptions that can be caught with catch +(...). Setting this parameter to true causes such exceptions +to abort the process instead.

maxSocketSend
+maxSocketRecv
On some platforms, calls to send() and recv() have a limit on the buffer size that can be used. These parameters set the limits in bytes -that omniORB uses when sending / receiving bulk data.

The default values are platform specific. It is unlikely that you will -need to change the values from the defaults.

The minimum valid limit is 1KB, 1024 bytes.

socketSendBuffer    default = --1 or 16384

On Windows, there is a kernel buffer used during send operations. A +that omniORB uses when sending / receiving bulk data.

The default values are platform specific. It is unlikely that you will +need to change the values from the defaults.

The minimum valid limit is 1KB, 1024 bytes.

socketSendBuffer    default = +-1 or 16384

On Windows, there is a kernel buffer used during send operations. A bug in Windows means that if a send uses the entire kernel buffer, a select() on the socket blocks until all the data has been acknowledged by the receiver, resulting in dreadful performance. This parameter modifies the socket send buffer from its default (8192 bytes on Windows) to the value specified. If this parameter is set to -1, the -socket send buffer is left at the system default.

On Windows, the default value of this parameter is 16384 bytes; on all -other platforms the default is -1.

validateUTF8    default = -0

When transmitting a string that is supposed to be UTF-8, omniORB +socket send buffer is left at the system default.

On Windows, the default value of this parameter is 16384 bytes; on all +other platforms the default is -1.

validateUTF8    default = +0

When transmitting a string that is supposed to be UTF-8, omniORB usually passes it directly, assuming that it is valid. With this -parameter set true, omniORB checks that all UTF-8 strings are valid, -and throws DATA_CONVERSION if not.

-

4.4  Client side options

These options control aspects of client-side behaviour.

InitRef    default = -none

Specify objects available from -ORB::resolve_initial_references(). The arguments take the form -<key>=<uri>, where key is the name given to -resolve_initial_references() and uri is a +parameter set true, omniORB checks that all UTF-8 strings are +valid, and throws DATA_CONVERSION if not.

+ +

4.4  Client side options

+

These options control aspects of client-side behaviour.

InitRef    default = +none

Specify objects available from +ORB::resolve_initial_references(). The arguments take the form +<key>=<uri>, where key is the name given to +resolve_initial_references() and uri is a valid CORBA object reference URI, as detailed in -chapter 6.

DefaultInitRef    default = -none

Specify the default URI prefix for -resolve_initial_references(), as explained in -chapter 6.

clientTransportRule    default = -* unix,tcp,ssl

Used to specify the way the client contacts a server, depending on the -server’s address. See section 8.7.1 for details.

clientCallTimeOutPeriod    default = -0

Call timeout in milliseconds for the client side. If a call takes +chapter 7.

DefaultInitRef    default = +none

Specify the default URI prefix for +resolve_initial_references(), as explained in +chapter 7.

clientTransportRule    default = +* unix,tcp,ssl

Used to specify the way the client contacts a server, depending on the +server’s address. See section 6.7.1 for details.

clientCallTimeOutPeriod    default = +0

Call timeout in milliseconds for the client side. If a call takes longer than the specified number of milliseconds, the ORB closes the -connection to the server and raises a TRANSIENT exception. A +connection to the server and raises a TRANSIENT exception. A value of zero means no timeout; calls can block for ever. See -section 8.3.1 for more information about timeouts.

Note: omniORB 3 had timeouts specified in seconds; -omniORB 4.0 and later use milliseconds for timeouts.

clientConnectTimeOutPeriod    default = -0

The timeout that is used in the case that a new network connection is +section 6.3.1 for more information about timeouts.

Note: omniORB 3 had timeouts specified in seconds; +omniORB 4.0 and later use milliseconds for timeouts.

clientConnectTimeOutPeriod    default = +0

The timeout that is used in the case that a new network connection is established to the server. A value of zero means that the normal call -timeout is used. See section 8.3.1 for more information -about timeouts.

supportPerThreadTimeOut    default = -0

If this parameter is set true, timeouts can be set on a per thread -basis, as well as globally and per object. Checking per-thread storage -has a noticeable performance impact, so it is turned off by default.

resetTimeoutOnRetries    default = -0

If true, the call timeout is reset when an exception handler causes a -call to be retried. If false, the timeout is not reset, and therefore -applies to the call as a whole, rather than to each individual call -attempt.

outConScanPeriod    default = -120

Idle timeout in seconds for outgoing (i.e. client initiated) +timeout is used. See section 6.3.1 for more information +about timeouts.

supportPerThreadTimeOut    default = +0

If this parameter is set true, timeouts can be set on a per +thread basis, as well as globally and per object. Checking per-thread +storage has a noticeable performance impact, so it is turned off by +default.

resetTimeoutOnRetries    default = +0

If true, the call timeout is reset when an exception handler +causes a call to be retried. If false, the timeout is not +reset, and therefore applies to the call as a whole, rather than to +each individual call attempt.

throwTransientOnTimeout    default = +0

omniORB 4.2 supports the CORBA::TIMEOUT exception that is part +of the CORBA Messaging specification. By default, that is the +exception thrown when timeouts occur. Previous omniORB releases did +not have the CORBA::TIMEOUT exception, and instead used +CORBA::TRANSIENT. If this parameter is set true, omniORB +follows the old behaviour of throwing CORBA::TRANSIENT when a +timeout occurs.

outConScanPeriod    default = +120

Idle timeout in seconds for outgoing (i.e. client initiated) connections. If a connection has been idle for this amount of time, -the ORB closes it. See section 8.5.

maxGIOPConnectionPerServer    default = -5

The maximum number of concurrent connections the ORB will open to a -single server. If multiple threads on the client call the same +the ORB closes it. See section 6.5.

maxGIOPConnectionPerServer    default = +5

The maximum number of concurrent connections the ORB will open to a +single server. If multiple threads on the client call the same server, the ORB opens additional connections to the server, up to the maximum specified by this parameter. If the maximum is reached, -threads are blocked until a connection becomes free for them to use.

oneCallPerConnection    default = -1

When this parameter is set to true (the default), the ORB will only -send a single call on a connection at a time. If multiple client +threads are blocked until a connection becomes free for them to use.

oneCallPerConnection    default = +1

When this parameter is set to true (the default), the ORB will +only send a single call on a connection at a time. If multiple client threads invoke on the same server, multiple connections are opened, up to the limit specified by -maxGIOPConnectionPerServer. With this parameter set to -false, the ORB will allow concurrent calls on a single +maxGIOPConnectionPerServer. With this parameter set to +false, the ORB will allow concurrent calls on a single connection. This saves connection resources, but requires slightly more management work for both client and server. Some server-side ORBs -(including omniORB versions before 4.0) serialise all calls on a -single connection.

maxInterleavedCallsPerConnection    default = -5

The maximum number of calls that can be interleaved on a connection. -If more concurrent calls are made, they are queued.

offerBiDirectionalGIOP    default = -0

If set true, the client will indicate to servers that it is willing to -accept callbacks on client-initiated connections using bidirectional -GIOP, provided the relevant POA policies are set. See -section 8.8.

diiThrowsSysExceptions    default = -0

If this is true, DII functions throw system exceptions; if it is -false, system exceptions that occur are passed through the -Environment object.

verifyObjectExistsAndType    default = -1

By default, omniORB uses the GIOP LOCATE_REQUEST message to +(including omniORB versions before 4.0) serialise all incoming calls +on a single connection.

maxInterleavedCallsPerConnection    default = +5

The maximum number of calls that can be interleaved on a connection. +If more concurrent calls are made, they are queued.

offerBiDirectionalGIOP    default = +0

If set true, the client will indicate to servers that it is +willing to accept callbacks on client-initiated connections using +bidirectional GIOP, provided the relevant POA policies are set. See +section 6.8.

diiThrowsSysExceptions    default = +0

If this is true, DII functions throw system exceptions; if it +is false, system exceptions that occur are passed through the +Environment object.

verifyObjectExistsAndType    default = +1

By default, omniORB uses the GIOP LOCATE_REQUEST message to verify the existence of an object prior to the first invocation. In the case that the full type of the object is not known, it instead -calls the _is_a() operation to check the object’s type. Some ORBs +calls the _is_a() operation to check the object’s type. Some ORBs have bugs that mean one or other of these operations fail. Setting -this parameter false prevents omniORB from making these calls.

giopTargetAddressMode    default = -0

GIOP 1.2 supports three addressing modes for contacting objects. This +this parameter false prevents omniORB from making these calls.

giopTargetAddressMode    default = +0

GIOP 1.2 supports three addressing modes for contacting objects. This parameter selects the mode that omniORB uses. A value of 0 means -GIOP::KeyAddr; 1 means GIOP::ProfileAddr; 2 means -GIOP::ReferenceAddr.

immediateAddressSwitch    default = -0

If true, the client will immediately switch to use a new address to -contact an object after a failure. If false (the default), the current -address will be retried in certain circumstances.

bootstrapAgentHostname    default = -none

If set, this parameter indicates the hostname to use for look-ups +GIOP::KeyAddr; 1 means GIOP::ProfileAddr; 2 means +GIOP::ReferenceAddr.

immediateAddressSwitch    default = +0

If true, the client will immediately switch to use a new +address to contact an object after a failure. If false (the +default), the current address will be retried in certain +circumstances.

bootstrapAgentHostname    default = +none

If set, this parameter indicates the hostname to use for look-ups using the obsolete Sun bootstrap agent. This mechanism is superseded -by the interoperable naming service.

bootstrapAgentPort    default = -900

The port number for the obsolete Sun bootstrap agent.

principal    default = -none

GIOP 1.0 and 1.1 have a request header field named ‘principal’, which +by the interoperable naming service.

bootstrapAgentPort    default = +900

The port number for the obsolete Sun bootstrap agent.

principal    default = +none

GIOP 1.0 and 1.1 have a request header field named ‘principal’, which contains a sequence of octets. It was never defined what it should mean, and its use is now deprecated; GIOP 1.2 has no such field. Some systems (e.g. Gnome) use the principal field as a primitive authentication scheme. This parameter sets the data omniORB uses in -the principal field. The default is an empty sequence.

-

4.5  Server side options

These parameters affect server-side operations.

endPoint             default = giop:tcp::
-endPointNoListen
-endPointPublish
-endPointNoPublish
-endPointPublishAllIFs
+the principal field. The default is an empty sequence.

+ +

4.5  Server side options

These parameters affect server-side operations.

endPoint             default = giop:tcp::
+endPointNoListen
+endPointPublish
+endPointNoPublish
+endPointPublishAllIFs
These options determine the end-points the ORB should listen on, and the details that should be published in IORs. See -chapter 8 for details.

serverTransportRule    default = -* unix,tcp,ssl

Configure the rules about whether a server should accept an incoming -connection from a client. See section 8.7.2 for -details.

serverCallTimeOutPeriod    default = -0

This timeout is used to catch the situation that the server starts +chapter 6 for details.

serverTransportRule    default = +* unix,tcp,ssl

Configure the rules about whether a server should accept an incoming +connection from a client. See section 6.7.2 for +details.

serverCallTimeOutPeriod    default = +0

This timeout is used to catch the situation that the server starts receiving a request, but the end of the request never comes. If a calls takes longer than the specified number of milliseconds to arrive, the ORB shuts the connection. A value of zero means never -timeout.

inConScanPeriod    default = -180

Idle timeout in seconds for incoming. If a connection has been idle -for this amount of time, the ORB closes it. See -section 8.5.

threadPerConnectionPolicy    default = -1

If true (the default), the ORB dedicates one server thread to each -incoming connection. Setting it false means the server should use a -thread pool.

maxServerThreadPerConnection    default = -100

If the client multiplexes several concurrent requests on a single +timeout.

inConScanPeriod    default = +180

Idle timeout in seconds for incoming connections. If a connection has +been idle for this amount of time, the ORB closes it. See +section 6.5.

threadPerConnectionPolicy    default = +1

If true (the default), the ORB dedicates one server thread to +each incoming connection. Setting it false means the server +should use a thread pool.

maxServerThreadPerConnection    default = +100

If the client multiplexes several concurrent requests on a single connection, omniORB uses extra threads to service them. This parameter specifies the maximum number of threads that are allowed to service a -single connection at any one time.

maxServerThreadPoolSize    default = -100

The maximum number of threads the server will allocate to do various +single connection at any one time.

maxServerThreadPoolSize    default = +100

The maximum number of threads the server will allocate to do various tasks, including dispatching calls in the thread pool mode. This number does not include threads dispatched under the thread per -connection server mode.

threadPerConnectionUpperLimit    default = -10000

If the threadPerConnectionPolicy parameter is true, the ORB can -automatically transition to thread pool mode if too many connections -arrive. This parameter sets the number of connections at which thread -pooling is started. The default of 10000 is designed to mean that it -never happens.

threadPerConnectionLowerLimit    default = -9000

If thread pooling was started because the number of connections hit +connection server mode.

threadPerConnectionUpperLimit    default = +10000

If the threadPerConnectionPolicy parameter is true, the +ORB can automatically transition to thread pool mode if too many +connections arrive. This parameter sets the number of connections at +which thread pooling is started. The default of 10000 is designed to +mean that it never happens.

threadPerConnectionLowerLimit    default = +9000

If thread pooling was started because the number of connections hit the upper limit, this parameter determines when thread per connection -should start again.

threadPoolWatchConnection    default = -1

After dispatching an upcall in thread pool mode, the thread that has +should start again.

threadPoolWatchConnection    default = +1

After dispatching an upcall in thread pool mode, the thread that has just performed the call can watch the connection for a short time before returning to the pool. This leads to less thread switching for a series of calls from a single client, but is less fair if there are concurrent clients. The connection is watched if the number of threads -concurrently handling the connection is <= the value of this -parameter. i.e. if the parameter is zero, the connection is never -watched; if it is 1, the last thread managing a connection watches it; -if 2, the connection is still watched if there is one other thread -still in an upcall for the connection, and so on.

See section 8.4.2.

connectionWatchPeriod    default = -50000

For each endpoint, the ORB allocates a thread to watch for new +concurrently handling the connection is less than or equal to the +value of this parameter. i.e. if the parameter is zero, the +connection is never watched; if it is 1, the last thread managing a +connection watches it; if 2, the connection is still watched if there +is one other thread still in an upcall for the connection, and so +on. See section 6.4.2.

connectionWatchPeriod    default = +50000

For each endpoint, the ORB allocates a thread to watch for new connections and to monitor existing connections for calls that should be handed by the thread pool. The thread blocks in select() or similar for a period, after which it re-scans the lists of connections it -should watch. This parameter is specified in microseconds.

connectionWatchImmediate    default = -0

When a thread handles an incoming call, it unmarshals the arguments +should watch. This parameter is specified in microseconds.

connectionWatchImmediate    default = +0

When a thread handles an incoming call, it unmarshals the arguments then marks the connection as watchable by the connection watching thread, in case the client sends a concurrent call on the same -connection. If this parameter is set to the default false, the +connection. If this parameter is set to the default false, the connection is not actually watched until the next connection watch -period (determined by the connectionWatchPeriod parameter). If -this parameter is set true, the connection watching thread is +period (determined by the connectionWatchPeriod parameter). If +this parameter is set true, the connection watching thread is immediately signalled to watch the connection. That leads to faster interactive response to clients that multiplex calls, but adds -significant overhead along the call chain.

Note that this setting has no effect on Windows, since it has no -mechanism for signalling the connection watching thread.

acceptBiDirectionalGIOP    default = -0

Determines whether a server will ever accept clients’ offers of -bidirectional GIOP connections. See section 8.8.

unixTransportDirectory    default = -/tmp/omni-%u

(Unix platforms only). Selects the location used to store Unix domain -sockets. The ‘%u’ is expanded to the user name.

unixTransportPermission    default = -0777

(Unix platforms only). Determines the octal permission bits for Unix +significant overhead along the call chain.

Note that this setting has no effect on Windows, since it has no +mechanism for signalling the connection watching thread.

acceptBiDirectionalGIOP    default = +0

Determines whether a server will ever accept clients’ offers of +bidirectional GIOP connections. See section 6.8.

unixTransportDirectory    default = +/tmp/omni-%u

(Unix platforms only). Selects the location used to store Unix domain +sockets. The ‘%u’ is expanded to the user name.

unixTransportPermission    default = +0777

(Unix platforms only). Determines the octal permission bits for Unix domain sockets. By default, all users can connect to a server, just as -with TCP.

supportCurrent    default = -1

omniORB supports the PortableServer::Current interface to +with TCP.

supportCurrent    default = +1

omniORB supports the PortableServer::Current interface to provide thread context information to servants. Supporting current has a small but noticeable run-time overhead due to accessing thread -specific storage, so this option allows it to be turned off.

objectTableSize    default = -0

Hash table size of the Active Object Map. If this is zero, the ORB +specific storage, so this option allows it to be turned off.

objectTableSize    default = +0

Hash table size of the Active Object Map. If this is zero, the ORB uses a dynamically resized open hash table. This is normally the best option, but it leads to less predictable performance since any operation which adds or removes a table entry may trigger a resize. If set to a non-zero value, the hash table has the specified number of entries, and is never resized. Note that the hash table is open, so this does not limit the number of active objects, just how efficiently -they can be located.

poaHoldRequestTimeout    default = -0

If a POA is put in the HOLDING state, calls to it will be timed +they can be located.

poaHoldRequestTimeout    default = +0

If a POA is put in the HOLDING state, calls to it will be timed out after the specified number of milliseconds, by raising a -TRANSIENT exception. Zero means no timeout.

poaUniquePersistentSystemIds    default = -1

The POA specification requires that object ids in POAs with the +CORBA::TIMEOUT exception. Zero means no timeout.

poaUniquePersistentSystemIds    default = +1

The POA specification requires that object ids in POAs with the PERSISTENT and SYSTEM_ID policies are unique between instantiations of the POA. Older versions of omniORB did not comply with that, and -reused object ids. With this value true, the POA has the correct -behaviour; with false, the POA uses the old scheme for compatibility.

idleThreadTimeout    default = -10

When a thread created by omniORB becomes idle, it is kept alive for a +reused object ids. With this value true, the POA has the +correct behaviour; with false, the POA uses the old scheme for +compatibility.

idleThreadTimeout    default = +10

When a thread created by omniORB becomes idle, it is kept alive for a while, in case a new thread is required. Once a thread has been idle -for the number of seconds specified in this parameter, it exits.

supportBootstrapAgent    default = -0

If set true, servers support the Sun bootstrap agent protocol.

-

4.5.1  Main thread selection

There is one server-side parameter that must be set with an API -function, rather than a normal configuration parameter:

namespace omniORB { - void setMainThread(); -};

POAs with the MAIN_THREAD policy dispatch calls on the ‘main’ +for the number of seconds specified in this parameter, it exits.

supportBootstrapAgent    default = +0

If set true, servers support the Sun bootstrap agent protocol.

+ +

4.5.1  Main thread selection

There is one server-side parameter that must be set with an API +function, rather than a normal configuration parameter:

namespace omniORB { + void setMainThread(); +};

POAs with the MAIN_THREAD policy dispatch calls on the ‘main’ thread. By default, omniORB assumes that the thread that initialised the omnithread library is the ‘main’ thread. To choose a different thread, call this function from the desired ‘main’ thread. The calling -thread must have an omni_thread associated with it (i.e. it +thread must have an omni_thread associated with it (i.e. it must have been created by omnithread, or -omni_thread::create_dummy() must have been called). If it -does not, the function throws CORBA::INITIALIZE.

Note that calls are only actually dispatched to the ‘main’ thread if -ORB::run() or ORB::perform_work() is called from that thread.

-

4.6  GIOP and interoperability options

These options control omniORB’s use of GIOP, and cover some areas -where omniORB can work around buggy behaviour by other ORBs.

maxGIOPVersion    default = -1.2

Choose the maximum GIOP version the ORB should support. Valid values -are 1.0, 1.1 and 1.2.

giopMaxMsgSize    default = -2097152

The largest message, in bytes, that the ORB will send or receive, to -avoid resource starvation. If the limit is exceeded, a MARSHAL -exception is thrown. The size must be >= 8192.

strictIIOP    default = -1

If true, be strict about interpretation of the IIOP specification; if -false, permit some buggy behaviour to pass.

lcdMode    default = -0

If true, select ‘Lowest Common Denominator’ mode. This disables +omni_thread::create_dummy() must have been called). If it +does not, the function throws CORBA::INITIALIZE.

Note that calls are only actually dispatched to the ‘main’ thread if +ORB::run() or ORB::perform_work() is called from that thread.

+ +

4.6  GIOP and interoperability options

These options control omniORB’s use of GIOP, and cover some areas +where omniORB can work around buggy behaviour by other ORBs.

maxGIOPVersion    default = +1.2

Choose the maximum GIOP version the ORB should support. Valid values +are 1.0, 1.1 and 1.2.

giopMaxMsgSize    default = +2097152

The largest message, in bytes, that the ORB will send or receive, to +avoid resource starvation. If the limit is exceeded, a MARSHAL +exception is thrown. The size must be >= 8192.

strictIIOP    default = +1

If true, be strict about interpretation of the IIOP +specification; if false, permit some buggy behaviour to pass.

lcdMode    default = +0

If true, select ‘Lowest Common Denominator’ mode. This disables various IIOP and GIOP features that are known to cause problems with -some ORBs.

tcAliasExpand    default = -0

This flag is used to indicate whether TypeCodes associated with Anys +some ORBs.

tcAliasExpand    default = +0

This flag is used to indicate whether TypeCodes associated with Anys should have aliases removed. This functionality is included because some ORBs will not recognise an Any containing a TypeCode with aliases -to be the same as the actual type contained in the Any. Note that -omniORB will always remove top-level aliases, but will not remove -aliases from TypeCodes that are members of other TypeCodes (e.g. -TypeCodes for members of structs etc.), unless tcAliasExpand is -set to 1. There is a performance penalty when inserting into an Any if -tcAliasExpand is set to 1.

useTypeCodeIndirections    default = -1

TypeCode Indirections reduce the size of marshalled TypeCodes, and are +to be the same as the actual type contained in the Any. There is a +performance penalty when inserting into an Any if tcAliasExpand +is set to 1.

useTypeCodeIndirections    default = +1

TypeCode Indirections reduce the size of marshalled TypeCodes, and are essential for recursive types, but some old ORBs do not support them. -Setting this flag to false prevents the use of indirections (and, -therefore, recursive TypeCodes).

acceptMisalignedTcIndirections    default = -0

If true, try to fix a mis-aligned indirection in a typecode. This is -used to work around a bug in some old versions of Visibroker’s Java -ORB.

-

4.7  System Exception Handlers

By default, all system exceptions that are raised during an operation +Setting this flag to false prevents the use of indirections +(and, therefore, prevents the use of recursive TypeCodes).

acceptMisalignedTcIndirections    default = +0

If true, try to fix a mis-aligned indirection in a +typecode. This is used to work around a bug in some old versions of +Visibroker’s Java ORB.

+ +

4.7  System Exception Handlers

By default, all system exceptions that are raised during an operation invocation, with the exception of some cases of -CORBA::TRANSIENT, are propagated to the application code. Some +CORBA::TRANSIENT, are propagated to the application code. Some applications may prefer to trap these exceptions within the proxy objects so that the application logic does not have to deal with the -error condition. For example, when a CORBA::COMM_FAILURE is +error condition. For example, when a CORBA::COMM_FAILURE is received, an application may just want to retry the invocation until it finally succeeds. This approach is useful for objects that are -persistent and have idempotent operations.

omniORB provides a set of functions to install exception handlers. +persistent and have idempotent operations.

omniORB provides a set of functions to install exception handlers. Once they are installed, proxy objects will call these handlers when the associated system exceptions are raised by the ORB runtime. -Handlers can be installed for CORBA::TRANSIENT, -CORBA::COMM_FAILURE and CORBA::SystemException. This -last handler covers all system exceptions other than the two covered -by the first two handlers. An exception handler can be installed for +Handlers can be installed for CORBA::TRANSIENT, +CORBA::TIMEOUT, CORBA::COMM_FAILURE and +CORBA::SystemException. This last handler covers all +system exceptions other than the three specific ones covered by the +first three handlers. An exception handler can be installed for individual proxy objects, or it can be installed for all proxy objects -in the address space.

-

4.7.1  Minor codes

omniORB makes extensive use of exception minor codes to indicate the +in the address space.

+ +

4.7.1  Minor codes

omniORB makes extensive use of exception minor codes to indicate the specific circumstances surrounding a system exception. The file -include/omniORB4/minorCode.h contains definitions of all the +include/omniORB4/minorCode.h contains definitions of all the minor codes used in omniORB, covering codes allocated in the CORBA specification, and ones specific to omniORB. In compilers with namespace support, the minor code constants appear in namespace -omni; otherwise they are in the global scope.

Applications can use minor codes to adjust their behaviour according -to the condition, e.g.

try { - ... -} -catch (CORBA::TRANSIENT& ex) { - if (ex.minor() == omni::TRANSIENT_ConnectFailed) { - // retry with a different object reference... - } - else { - // print an error message... - } -}
-

4.7.2  CORBA::TRANSIENT handlers

TRANSIENT exceptions can occur in many circumstances. One -circumstance is as follows:

  1. The client invokes on an object reference. -
  2. The object replies with a LOCATION_FORWARD message. -
  3. The client caches the new location and retries to the new location. -
  4. Time passes... -
  5. The client tries to invoke on the object again, using the +omni; otherwise they are in the global scope.

    Applications can use minor codes to adjust their behaviour according +to the condition, e.g.

    try { + ... +} +catch (CORBA::TRANSIENT& ex) { + if (ex.minor() == omni::TRANSIENT_ConnectFailed) { + // retry with a different object reference... + } + else { + // print an error message... + } +}
    + +

    4.7.2  CORBA::TRANSIENT handlers

    TRANSIENT exceptions can occur in many circumstances. One +circumstance is as follows:

    1. The client invokes on an object reference. +
    2. The object replies with a LOCATION_FORWARD message. +
    3. The client caches the new location and retries to the new location. +
    4. Time passes... +
    5. The client tries to invoke on the object again, using the cached, forwarded location. -
    6. The attempt to contact the object fails. -
    7. The ORB runtime resets the location cache and throws a -TRANSIENT exception with minor code -TRANSIENT_FailedOnForwarded.

    In this situation, the default TRANSIENT exception handler +

  6. The attempt to contact the object fails. +
  7. The ORB runtime resets the location cache and throws a +TRANSIENT exception with minor code +TRANSIENT_FailedOnForwarded.

In this situation, the default TRANSIENT exception handler retries the call, using the object’s original location. If the retry -results in another LOCATION_FORWARD, to the same or a -different location, and that forwarded location fails -immediately, the TRANSIENT exception will occur again, and the +results in another LOCATION_FORWARD, to the same or a +different location, and that forwarded location fails +immediately, the TRANSIENT exception will occur again, and the pattern will repeat. With repeated exceptions, the handler starts -adding delays before retries, with exponential back-off.

In all other circumstances, the default TRANSIENT handler just -passes the exception on to the caller.

Applications can override the default behaviour by installing their -own exception handler. The API to do so is summarised below:

namespace omniORB { - - typedef CORBA::Boolean - (*transientExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::TRANSIENT& ex); - - void - installTransientExceptionHandler(void* cookie, - transientExceptionHandler_t fn); - - void - installTransientExceptionHandler(CORBA::Object_ptr obj, - void* cookie, - transientExceptionHandler_t fn); -}

The overloaded function installTransientExceptionHandler() can be -used to install the exception handlers for CORBA::TRANSIENT. -Two forms are available: the first form installs an exception handler -for all object references except for those which have an exception -handler installed by the second form, which takes an additional -argument to identify the target object reference. The argument -cookie is an opaque pointer which will be passed on by the ORB -when it calls the exception handler.

An exception handler will be called by proxy objects with three -arguments. The cookie is the opaque pointer registered by -installTransientExceptionHandler(). The argument -n_retries is the number of times the proxy has called this -handler for the same invocation. The argument ex is the value +adding delays before retries, with exponential back-off.

In all other circumstances, the default TRANSIENT handler just +passes the exception on to the caller.

Applications can override the default behaviour by installing their +own exception handler. The API to do so is summarised below:

namespace omniORB { + + typedef CORBA::Boolean + (*transientExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex); + + void + installTransientExceptionHandler(void* cookie, + transientExceptionHandler_t fn); + + void + installTransientExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandler_t fn); +}

The overloaded installTransientExceptionHandler() function is used +to install the exception handlers for CORBA::TRANSIENT. Two +forms are available: the first form installs an exception handler for +all object references except for those which have an exception handler +installed by the second form, which takes an additional argument to +identify the target object reference. The argument cookie is an +opaque pointer which will be passed on by the ORB when it calls the +exception handler.

An exception handler will be called by proxy objects with three +arguments. The cookie is the opaque pointer registered by +installTransientExceptionHandler(). The argument +n_retries is the number of times the proxy has called this +handler for the same invocation. The argument ex is the value of the exception caught. The exception handler is expected to do whatever is appropriate and return a boolean value. If the return -value is TRUE(1), the proxy object retries the operation. If the -return value is FALSE(0), the original exception is propagated into -the application code. In the case of a TRANSIENT exception due -to a failed location forward, the exception propagated to the -application is the original exception that caused the -TRANSIENT (e.g. a COMM_FAILURE or -OBJECT_NOT_EXIST), rather than the TRANSIENT -exception1.

The following sample code installs a simple exception handler for all -objects and for a specific object:

CORBA::Boolean my_transient_handler1 (void* cookie, - CORBA::ULong retries, - const CORBA::TRANSIENT& ex) -{ - cerr << "transient handler 1 called." << endl; - return 1; // retry immediately. -} - -CORBA::Boolean my_transient_handler2 (void* cookie, - CORBA::ULong retries, - const CORBA::TRANSIENT& ex) -{ - cerr << "transient handler 2 called." << endl; - return 1; // retry immediately. -} - - -static Echo_ptr myobj; - -void installhandlers() -{ - omniORB::installTransientExceptionHandler(0,my_transient_handler1); - // All proxy objects will call my_transient_handler1 from now on. - - omniORB::installTransientExceptionHandler(myobj,0,my_transient_handler2); - // The proxy object of myobj will call my_transient_handler2 from now on. -}
-

4.7.3  CORBA::COMM_FAILURE

If the ORB has successfully contacted an object at some point, and +value is true, the proxy object retries the operation. If the +return value is false, the original exception is propagated +into the application code. In the case of a TRANSIENT exception +due to a failed location forward, the exception propagated to the +application is the original exception that caused the +TRANSIENT (e.g. a COMM_FAILURE or +OBJECT_NOT_EXIST), rather than the TRANSIENT +exception1.

The following sample code installs a simple exception handler for all +objects and for a specific object:

CORBA::Boolean my_transient_handler1(void* cookie, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex) +{ + cerr << "transient handler 1 called." << endl; + return true; // retry immediately. +} + +CORBA::Boolean my_transient_handler2(void* cookie, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex) +{ + cerr << "transient handler 2 called." << endl; + return false; // do not retry. +} + + +static Echo_ptr myobj; + +void installhandlers() +{ + omniORB::installTransientExceptionHandler(0, my_transient_handler1); + // All proxy objects will call my_transient_handler1 from now on. + + omniORB::installTransientExceptionHandler(myobj, 0, my_transient_handler2); + // The proxy object of myobj will call my_transient_handler2 from now on. +}
+ +

4.7.3  CORBA::TIMEOUT

When a call timeout occurs, by default the ORB throws +CORBA::TIMEOUT. The default behaviour of the proxy objects is +to propagate this exception to the application. Applications can +override the default behaviour by installing their own exception +handlers. The API to do so is summarised below:

typedef CORBA::Boolean +(*timeoutExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TIMEOUT& ex); + +void +installTimeoutExceptionHandler(void* cookie, + timeoutExceptionHandler_t fn); + +void +installTimeoutExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + timeoutExceptionHandler_t fn);

The functions are equivalent to their counterparts for +CORBA::TRANSIENT.

omniORB version 4.1 and earlier did not have the CORBA::TIMEOUT +exception, and threw CORBA::TRANSIENT instead. If the +throwTransientOnTimeout configuration parameter is set to +1, omniORB 4.2 reverts to this behaviour, and calls the +transient exception handler instead of the timeout exception handler.

The timeout exception handler is used when a CORBA call times out. It +is not called when an AMI poller operation throws +CORBA::TIMEOUT. In that situation, the exception is always +propagated to the caller.

+ +

4.7.4  CORBA::COMM_FAILURE

If the ORB has successfully contacted a server at some point, and access to it subsequently fails (and the condition for -TRANSIENT described above does not occur), the ORB raises a -CORBA::COMM_FAILURE exception.

The default behaviour of the proxy objects is to propagate this +TRANSIENT described above does not occur), the ORB raises a +CORBA::COMM_FAILURE exception.

The default behaviour of the proxy objects is to propagate this exception to the application. Applications can override the default behaviour by installing their own exception handlers. The API to do so -is summarised below:

typedef CORBA::Boolean -(*commFailureExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::COMM_FAILURE& ex); - -void -installCommFailureExceptionHandler(void* cookie, - commFailureExceptionHandler_t fn); - -void -installCommFailureExceptionHandler(CORBA::Object_ptr obj, - void* cookie, - commFailureExceptionHandler_t fn);

The functions are equivalent to their counterparts for -CORBA::TRANSIENT.

-

4.7.4  CORBA::SystemException

If a system exceptions other than TRANSIENT or -COMM_FAILURE occurs, the default behaviour of the proxy +is summarised below:

typedef CORBA::Boolean +(*commFailureExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::COMM_FAILURE& ex); + +void +installCommFailureExceptionHandler(void* cookie, + commFailureExceptionHandler_t fn); + +void +installCommFailureExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + commFailureExceptionHandler_t fn);

The functions are equivalent to their counterparts for +CORBA::TRANSIENT.

+ +

4.7.5  CORBA::SystemException

If a system exceptions other than TRANSIENT, TIMEOUT or +COMM_FAILURE occurs, the default behaviour of the proxy objects is to propagate this exception to the application. Applications can override the default behaviour by installing their -own exception handlers. The API to do so is summarised below:

typedef CORBA::Boolean -(*systemExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::SystemException& ex); - -void -installSystemExceptionHandler(void* cookie, - systemExceptionHandler_t fn); - -void -installSystemExceptionHandler(CORBA::Object_ptr obj, - void* cookie, - systemExceptionHandler_t fn);

The functions are equivalent to their counterparts for -CORBA::TRANSIENT.

-

4.8  Location forwarding

-

Any CORBA operation invocation can return a LOCATION_FORWARD +own exception handlers. The API to do so is summarised below:

typedef CORBA::Boolean +(*systemExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::SystemException& ex); + +void +installSystemExceptionHandler(void* cookie, + systemExceptionHandler_t fn); + +void +installSystemExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + systemExceptionHandler_t fn);

The functions are equivalent to their counterparts for +CORBA::TRANSIENT.

+ +

4.7.6  Extended exception handlers

New in omniORB 4.2, each of the exception handlers described above +also has an ‘extended’ form in which the exception handler takes two +additional parameters, the object reference being invoked upon, and a +string containing the name of the operation invoked. e.g.:

namespace omniORB { + + typedef CORBA::Boolean + (*transientExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex, + CORBA::Object_ptr obj, + const char* op); + + void + installTransientExceptionHandlerExt(void* cookie, + transientExceptionHandlerExt_t fn); + + void + installTransientExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandlerExt_t fn); +}

Note that the operation parameter can sometimes be null. By default, +omniORB sends a LocateRequest message prior to the first +operation invocation on an object reference. That LocateRequest +is subject to the same exception handling mechanism as a normal +operation invocation, but it is represented with a null operation +name. Exception handler code that uses the operation name must +correctly handle a null operation name pointer.

+ +

4.8  Location forwarding

+

Any CORBA operation invocation can return a LOCATION_FORWARD message to the caller, indicating that it should retry the invocation on a new object reference. The standard allows ServantManagers to -trigger LOCATION_FORWARDs by raising the -PortableServer::ForwardRequest exception, but it does not +trigger LOCATION_FORWARDs by raising the +PortableServer::ForwardRequest exception, but it does not provide a similar mechanism for normal servants. omniORB provides the -omniORB::LOCATION_FORWARD exception for this purpose. It -can be thrown by any operation implementation.

namespace omniORB { - class LOCATION_FORWARD { - public: - LOCATION_FORWARD(CORBA::Object_ptr objref); - }; -};

The exception object consumes the object reference it is -passed.

-
-1
This is a change from omniORB 4.0 and earlier, -where it was the TRANSIENT exception that was propagated to the -application. -
+omniORB::LOCATION_FORWARD exception for this purpose. It +can be thrown by any operation implementation.

namespace omniORB { + class LOCATION_FORWARD { + public: + LOCATION_FORWARD(CORBA::Object_ptr objref); + }; +};

The exception object consumes the object reference it is +passed.

+ +
+1
This is different from omniORB 4.0 and earlier, +where it was the TRANSIENT exception that was propagated to +the application.
- -

Chapter 5  The IDL compiler

-

omniORB’s IDL compiler is called omniidl. It consists of a generic + +

Chapter 5  The IDL compiler

+

omniORB’s IDL compiler is called omniidl. It consists of a generic front-end parser written in C++, and a number of back-ends written in Python. omniidl is very strict about IDL validity, so you may find that it reports errors in IDL which compiles fine with other IDL -compilers.

The general form of an omniidl command line is:

omniidl [options] -b<back-end> [back-end options] <file 1> <file 2>
-

5.1  Common options

The following options are common to all back-ends:

- - - - - - - - - - - - - - - - - - - - -
--bback-endRun the specified back-end. For the C++ ORB, use -bcxx.
--Dname[=value]Define name for the preprocessor.
--UnameUndefine name for the preprocessor.
--IdirInclude dir in the preprocessor search path.
--EOnly run the preprocessor, sending its output to stdout.
--YcmdUse cmd as the preprocessor, rather than the normal C -preprocessor.
--NDo not run the preprocessor.
--TUse a temporary file, not a pipe, for preprocessor output.
--Wparg[,arg…]Send arguments to the preprocessor.
--Wbarg[,arg…]Send arguments to the back-end.
--nfDo not warn about unresolved forward declarations.
--kKeep comments after declarations, to be used by some back-ends.
--KKeep comments before declarations, to be used by some back-ends.
--CdirChange directory to dir before writing output files.
--dDump the parsed IDL then exit, without running a back-end.
--pdirUse dir as a path to find omniidl back-ends.
--VPrint version information then exit.
--uPrint usage information.
--vVerbose: trace compilation stages.
-

Most of these options are self explanatory, but some are not -so obvious.

-

5.1.1  Preprocessor interactions

IDL is processed by the C preprocessor before omniidl parses it. +compilers.

The general form of an omniidl command line is:

omniidl [options] -b<back-end> [back-end options] <file> +
+ +

5.1  Common options

The following options are common to all back-ends:

+ + + + + + + + + + + + + + + + + + + + +
+-bback-end +Run the specified back-end. For the C++ ORB, use -bcxx.
+-Dname[=value] +Define name for the preprocessor.
+-Uname +Undefine name for the preprocessor.
+-Idir +Include dir in the preprocessor search path.
+-E +Only run the preprocessor, sending its output to stdout.
+-Ycmd +Use cmd as the preprocessor, rather than the normal C +preprocessor.
+-N +Do not run the preprocessor.
+-T +Use a temporary file, not a pipe, for preprocessor output.
+-Wparg[,arg…] +Send arguments to the preprocessor.
+-Wbarg[,arg…] +Send arguments to the back-end.
+-nf +Do not warn about unresolved forward declarations.
+-k +Keep comments after declarations, to be used by some back-ends.
+-K +Keep comments before declarations, to be used by some back-ends.
+-Cdir +Change directory to dir before writing output files.
+-d +Dump the parsed IDL then exit, without running a back-end.
+-pdir +Use dir as a path to find omniidl back-ends.
+-V +Print version information then exit.
+-u +Print usage information.
+-v +Verbose: trace compilation stages.
+

Most of these options are self explanatory, but some are not +so obvious.

+ +

5.1.1  Preprocessor interactions

IDL is processed by the C preprocessor before omniidl parses it. omniidl always uses the GNU C preprocessor (which it builds with the -name omnicpp). The -D, -U, and -I +name omnicpp). The -D, -U, and -I options are just sent to the preprocessor. Note that the current directory is not on the include search path by default—use -‘-I.’ for that. The -Y option can be used to +‘-I.’ for that. The -Y option can be used to specify a different preprocessor to omnicpp. Beware that line directives inserted by other preprocessors are likely to confuse -omniidl.

-

5.1.1.1  Windows 9x

The output from the C preprocessor is normally fed to the omniidl +omniidl.

+ +

5.1.1.1  Ancient history: Windows 9x

The output from the C preprocessor is normally fed to the omniidl parser through a pipe. On some Windows 98 machines (but not all!) the pipe does not work, and the preprocessor output is echoed to the screen. When this happens, the omniidl parser sees an empty file, and produces useless stub files with strange long names. To avoid the -problem, use the ‘-T’ option to create a temporary file -between the two stages.

-

5.1.2  Forward-declared interfaces

If you have an IDL file like:

interface I; -interface J { - attribute I the_I; -};

then omniidl will normally issue a warning:

  test.idl:1: Warning: Forward declared interface `I' was never
+problem, use the ‘-T’ option to create a temporary file
+between the two stages.

+ +

5.1.2  Forward-declared interfaces

If you have an IDL file like:

interface I; +interface J { + attribute I the_I; +};

then omniidl will normally issue a warning:

  test.idl:1: Warning: Forward declared interface `I' was never
   fully defined
-

It is illegal to declare such IDL in isolation, but it -is valid to define interface I in a separate file. If +

It is illegal to declare such IDL in isolation, but it +is valid to define interface I in a separate file. If you have a lot of IDL with this sort of construct, you will drown -under the warning messages. Use the -nf option to suppress -them.

-

5.1.3  Comments

By default, omniidl discards comments in the input IDL. However, with -the -k and -K options, it preserves the comments +under the warning messages. Use the -nf option to suppress +them.

+ +

5.1.3  Comments

By default, omniidl discards comments in the input IDL. However, with +the -k and -K options, it preserves the comments for use by the back-ends. The C++ back-end ignores this information, -but it is relatively easy to write new back-ends which do make -use of comments.

The two different options relate to how comments are attached to -declarations within the IDL. Given IDL like:

interface I { - void op1(); - // A comment - void op2(); -};

the -k flag will attach the comment to op1(); -the -K flag will attach it to op2().

-

5.2  C++ back-end options

When you specify the C++ back-end (with -bcxx), the -following -Wb options are available. Note that the --Wb options must be specified after the --bcxx option, so omniidl knows which back-end to give the -arguments to.

- - - - - - - - - - - - - - - -
--Wbh=suffixUse suffix for generated header files. Default -‘.hh’.
--Wbs=suffixUse suffix for generated stub files. Default -‘SK.cc.’
--Wbd=suffixUse suffix for generated dynamic files. Default -‘DynSK.cc.’
--WbaGenerate stubs for TypeCode and Any.
--WbinlineOutput stubs for #included IDL files in line with the -main file.
--WbtpGenerate ‘tie’ implementation skeletons.
--WbtfGenerate flattened ‘tie’ implementation skeletons.
--Wbsplice-modulesSplice together multiply-opened modules into one.
--WbexampleGenerate example implementation code.
--WbFGenerate code fragments (for experts only).
--WbBOAGenerate BOA compatible skeletons.
--WboldGenerate old CORBA 2.1 signatures for skeletons.
--Wbold_prefixMap C++ reserved words with prefix ‘_’ rather than -‘_cxx_’.
--Wbkeep_inc_pathPreserve IDL ‘#include’ paths in generated - ‘#include’ directives.
--Wbuse_quotesUse quotes in ‘#include’ directives -(e.g. "foo" rather than <foo>.)

Again, most of these are self-explanatory.

-

5.2.1  Stub / skeleton files

By default, omniidl separates the normal stub and skeleton file (the -SK.cc file) from the ‘dynamic’ stubs (the DynSK.cc +but it is relatively easy to write new back-ends which do make +use of comments.

The two different options relate to how comments are attached to +declarations within the IDL. Given IDL like:

interface I { + void op1(); + // A comment + void op2(); +};

the -k flag will attach the comment to op1(); +the -K flag will attach it to op2().

+ +

5.2  C++ back-end options

+

When you specify the C++ back-end (with -bcxx), the +following -Wb options are available. Note that the +-Wb options must be specified after the +-bcxx option, so omniidl knows which back-end to give the +arguments to.

+ + + + + + + + + + + + + + + + + + + +
+-Wbh=suffix +Use suffix for generated header files. Default +‘.hh’.
+-Wbs=suffix +Use suffix for generated stub files. Default +‘SK.cc.’
+-Wbd=suffix +Use suffix for generated dynamic files. Default +‘DynSK.cc.’
+-Wba +Generate stubs for TypeCode and Any.
+-Wbtp +Generate ‘tie’ implementation skeletons.
+-Wbtf +Generate flattened ‘tie’ implementation skeletons.
+-Wbami +Generate AMI types and operations.
+-Wbexample +Generate example implementation code.
+-Wbinline +Output stubs for #included IDL files in line with the +main file.
+-Wbuse-quotes +Use quotes in ‘#include’ directives +(e.g. "foo" rather than <foo>.)
+-Wbkeep-inc-path +Preserve IDL ‘#include’ paths in generated + ‘#include’ directives.
+-Wbvirtual-objref +Use virtual functions for object reference operations.
+-Wbimpl-mapping +Use the ‘implementation’ mapping for object reference methods.
+-Wbsplice-modules +Splice together multiply-opened modules into one.
+-WbBOA +Generate BOA compatible skeletons.
+-Wbold +Generate old CORBA 2.1 signatures for skeletons.
+-Wbold-prefix +Map C++ reserved words with prefix ‘_’ rather than +‘_cxx_’.
+-WbF +Generate code fragments (only for use during omniORB build).
+
+ +

5.2.1  Optional code generation options

By default, omniidl generates the minimum code required to provide all +the IDL-defined types and interfaces, which is sufficient for the +majority of applications. Additional code can also be generated, for +various purposes:

+ +

5.2.1.1  Any and TypeCode

To generate TypeCodes and Any insertion operators, give the +-Wba option. See chapter 10 for details.

By default, omniidl separates the normal stub and skeleton file (the +SK.cc file) from these ‘dynamic’ stubs (the DynSK.cc file), so applications that do not need support for Any and TypeCode for a particular IDL file do not waste space with unnecessary -definitions. It is possible to output both the normal stubs and -the dynamic stubs to a single file, by simply specifying the same +definitions. It is possible to output both the normal stubs and the +dynamic stubs to a single file, by simply specifying the same extension for both files. This command places both the normal stubs -and the dynamic stubs in aSK.cc:

-omniidl -bcxx -Wba -Wbd=SK.cc a.idl -
-

5.2.2  Module splicing

On ancient C++ compilers without namespace support, IDL modules map to +and the dynamic stubs in aSK.cc:

+omniidl -bcxx -Wba -Wbd=SK.cc a.idl +
+ +

5.2.1.2  Tie templates

As described in section 2.11, tie templates can be used to +provide servant implementations, instead of using inheritance from the +normal skeleton classes. To generate tie templates, give the +-Wbtp option to omniidl.

When using a pre-namespace C++ compiler, IDL modules are mapped to C++ +classes, which causes a problem with tie templates. The C++ mapping +says that for the interface M::I, the C++ tie template class +should be named POA_M::I_tie. However, since template classes +cannot be declared inside other classes, this naming scheme cannot be +used if POA_M is a class.

The C++ mapping has an alternative option of ‘flattened’ tie class +names, in which the template class is declared at global scope with +the name POA_M_I_tie. i.e. all occurrences of ‘::’ +are replaced by ‘_’. Generate the flattened ties using the +-Wbtf command line argument.

+ +

5.2.1.3  Asynchronous Method Invocation

Generate asynchronous invocation operations and the various types +required by AMI by specifying -Wbami. See +chapter 12 for details.

+ +

5.2.1.4  Example implementations

If you use the -Wbexample flag, omniidl will generate an +example implementation file as well as the stubs and skeletons. For +IDL file foo.idl, the example code is written to +foo_i.cc. The example file contains class and method +declarations for the operations of all interfaces in the IDL file, +along with a main() function which creates an instance of each +object. You still have to fill in the operation implementations, of +course.

+ +

5.2.2  Include file options

IDL files regularly #include other files. By default, if file +a.idl says #include <b/c.idl> then the generated +header a.hh has an include of the form #include +<c.idl>, and aSK.cc and aDynSK.cc contain only code +corresponding to the declarations in a.idl.

If the -Wbinline option is provided, all the +#included declarations are generated in a.hh, +aSK.cc and aDynSK.cc, meaning the application code +should only use that single set of files.

If -Wbuse-quotes is specified, then the directive in +a.hh uses quotes rather than angle brackets: +#include "c.idl".

Normally any path details contained in the IDL #include +directive are removed, leaving just the base name. If +-Wbkeep-inc-path is specified, the directive in +a.hh is #include <b/c.idl>.

+ +

5.2.3  Object reference operations

Some of the C++ mapping’s parameter passing rules are problematic in +terms of memory management. For example, if an IDL operation has a +parameter of type inout string, the standard mapping has a C++ +parameter of type char*&. If application code passes a +String_var for the parameter, some C++ compilers choose the +wrong conversion operator and cause a violation of the memory +management rules1.

To avoid this, omniORB uses some helper classes as the parameter types +in object reference operations, meaning that the correct memory +management rules are always followed. Normally, that is invisible to +application code, but occasionally it becomes problematic. One example +is that if a local interface is derived from a normal +unconstrained interface, the C++ mapping of the local interface +derives from the object reference class, and so the base object +reference class must use the standard mapping rather than omniORB’s +usual enhanced mapping. To choose the standard ‘implementation +mapping’, give the -Wbimpl-mapping option to omniidl.

Similarly, omniidl usually uses non-virtual methods in its object +reference classes, since there is no usual need to override them. The +local interface situation also requires method overrides, so omniidl +must be instructed to generate object references as virtual. Use +-Wbvirtual-objref to achieve this.

More details about the local interface mapping can be found in +section 11.8.

+ +

5.2.4  Module splicing

On ancient C++ compilers without namespace support, IDL modules map to C++ classes, and so cannot be reopened. For some IDL, it is possible to ‘splice’ reopened modules on to the first occurrence of the module, so all module definitions are in a single class. It is possible in -this sort of situation:

module M1 { - interface I {}; -}; -module M2 { - interface J { - attribute M1::I ok; - }; -}; -module M1 { - interface K { - attribute I still_ok; - }; -};

but not if there are cross-module dependencies:

module M1 { - interface I {}; -}; -module M2 { - interface J { - attribute M1::I ok; - }; -}; -module M1 { - interface K { - attribute M2::J oh_dear; - }; -};

In both of these cases, the -Wbsplice-modules +this sort of situation:

module M1 { + interface I {}; +}; +module M2 { + interface J { + attribute M1::I ok; + }; +}; +module M1 { + interface K { + attribute I still_ok; + }; +};

but not if there are cross-module dependencies:

module M1 { + interface I {}; +}; +module M2 { + interface J { + attribute M1::I ok; + }; +}; +module M1 { + interface K { + attribute M2::J oh_dear; + }; +};

In both of these cases, the -Wbsplice-modules option causes omniidl to put all of the definitions for module -M1 into a single C++ class. For the first case, this will work -fine. For the second case, class M1::K will contain a reference -to M2::J, which has not yet been defined; the C++ compiler will -complain.

-

5.2.3  Flattened tie classes

Another problem with mapping IDL modules to C++ classes arises with -tie templates. The C++ mapping says that for the interface -M::I, the C++ tie template class should be named -POA_M::I_tie. However, since template classes cannot be -declared inside other classes, this naming scheme cannot be used with -compilers without namespace support.

The standard solution is to produce ‘flattened’ tie class names, using -the -Wbtf command line argument. With that flag, the -template class is declared at global scope with the name -POA_M_I_tie. i.e. all occurrences of ‘::’ are -replaced by ‘_’.

-

5.2.4  Generating example implementations

If you use the -Wbexample flag, omniidl will generate an -example implementation file as well as the stubs and skeletons. For -IDL file foo.idl, the example code is written to -foo_i.cc. The example file contains class and method -declarations for the operations of all interfaces in the IDL file, -along with a main() function which creates an instance of each -object. You still have to fill in the operation implementations, of -course.

-

5.3  Examples

Generate the C++ headers and stubs for a file a.idl:

-omniidl -bcxx a.idl -

Generate with Any support:

-omniidl -bcxx -Wba a.idl -

As above, but also generate Python stubs (assuming omniORBpy -is installed):

-omniidl -bcxx -Wba -bpython a.idl -

Just check the IDL files for validity, generating no output:

-omniidl a.idl b.idl -
-

Chapter 6  Interoperable Naming Service

-

omniORB supports the Interoperable Naming Service (INS). The following -is a summary of its facilities.

-

6.1  Object URIs

As well as accepting IOR-format strings, ORB::string_to_object() -also supports two Uniform Resource Identifier (URI) [BLFIM98] -formats, which can be used to specify objects in a convenient -human-readable form. IOR-format strings are now also considered URIs.

-

6.1.1  corbaloc

corbaloc URIs allow you to specify object references which -can be contacted by IIOP, or found through -ORB::resolve_initial_references(). To specify an IIOP object -reference, you use a URI of the form:

-corbaloc:iiop:<host>:<port>/<object key> -

for example:

-corbaloc:iiop:myhost.example.com:1234/MyObjectKey -

which specifies an object with key ‘MyObjectKey’ within a -process running on myhost.example.com listening on port 1234. Object -keys containing non-ASCII characters can use the standard URI % -escapes:

-corbaloc:iiop:myhost.example.com:1234/My%efObjectKey -

denotes an object key with the value 239 (hex ef) in the -third octet.

The protocol name ‘iiop’ can be abbreviated to the empty -string, so the original URI can be written:

-corbaloc::myhost.example.com:1234/MyObjectKey -

The IANA has assigned port number 28091 for use by corbaloc, so if -the server is listening on that port, you can leave the port number -out. The following two URIs refer to the same object:

-corbaloc::myhost.example.com:2809/MyObjectKey
-corbaloc::myhost.example.com/MyObjectKey -

You can specify an object which is available at more than -one location by separating the locations with commas:

-corbaloc::myhost.example.com,:localhost:1234/MyObjectKey -

Note that you must restate the protocol for each address, -hence the ‘:’ before ‘localhost’. It could -equally have been written ‘iiop:localhost’.

You can also specify an IIOP version number:

-corbaloc::1.2@myhost.example.com/MyObjectKey -

Specifying IIOP versions above 1.0 is slightly risky since higher -versions make use of various information stored in IORs that is not -present in a corbaloc URI. It is generally best to contact initial -corbaloc objects with IIOP 1.0, and rely on higher versions for all -other object references.

Alternatively, to use resolve_initial_references(), you -use a URI of the form:

-corbaloc:rir:/NameService -
-

6.1.2  corbaname

-

corbaname URIs cause string_to_object() to look-up a -name in a CORBA Naming service. They are an extension of the -corbaloc syntax:

-corbaname:<corbaloc location>/<object key>#<stringified name> -

for example:

-corbaname::myhost/NameService#project/example/echo.obj
-corbaname:rir:/NameService#project/example/echo.obj -

The object found with the corbaloc-style portion -must be of type CosNaming::NamingContext, or something -derived from it. If the object key (or rir name) is -‘NameService’, it can be left out:

-corbaname::myhost#project/example/echo.obj
-corbaname:rir:#project/example/echo.obj -

The stringified name portion can also be left out, in which -case the URI denotes the CosNaming::NamingContext which would -have been used for a look-up:

-corbaname::myhost.example.com
-corbaname:rir: -

The first of these examples is the easiest way of specifying -the location of a naming service.

-

6.2  Configuring resolve_initial_references

-

The INS specifies two standard command line arguments which provide a -portable way of configuring ORB::resolve_initial_references():

-

6.2.1  ORBInitRef

-ORBInitRef takes an argument of the form -<ObjectId>=<ObjectURI>. So, for example, -with command line arguments of:

--ORBInitRef NameService=corbaname::myhost.example.com -

resolve_initial_references("NameService") will -return a reference to the object with key ‘NameService’ available on -myhost.example.com, port 2809. Since IOR-format strings are considered -URIs, you can also say things like:

--ORBInitRef NameService=IOR:00ff... -
-

6.2.2  ORBDefaultInitRef

-ORBDefaultInitRef provides a prefix string which is used to -resolve otherwise unknown names. When -resolve_initial_references() is unable to resolve a name which -has been specifically configured (with -ORBInitRef), it -constructs a string consisting of the default prefix, a ‘/’ -character, and the name requested. The string is then fed to -string_to_object(). So, for example, with a command line of:

--ORBDefaultInitRef corbaloc::myhost.example.com -

a call to resolve_initial_references("MyService") -will return the object reference denoted by -‘corbaloc::myhost.example.com/MyService’.

Similarly, a corbaname prefix can be used to cause -look-ups in the naming service. Note, however, that since a -‘/’ character is always added to the prefix, it is -impossible to specify a look-up in the root context of the naming -service—you have to use a sub-context, like:

--ORBDefaultInitRef corbaname::myhost.example.com#services -
-

6.3  omniNames

-

6.3.1  NamingContextExt

omniNames supports the extended CosNaming::NamingContextExt -interface:

module CosNaming { - interface NamingContextExt : NamingContext { - typedef string StringName; - typedef string Address; - typedef string URLString; - - StringName to_string(in Name n) raises(InvalidName); - Name to_name (in StringName sn) raises(InvalidName); - - exception InvalidAddress {}; - - URLString to_url(in Address addr, in StringName sn) - raises(InvalidAddress, InvalidName); - - Object resolve_str(in StringName n) - raises(NotFound, CannotProceed, InvalidName, AlreadyBound); - }; -};

to_string() and to_name() convert from CosNaming::Name -sequences to flattened strings and vice-versa. Note that calling -these operations involves remote calls to the naming service, so they -are not particularly efficient. You can use the omniORB specific local -omniURI::nameToString() and omniURI::stringToName() -functions instead.

A CosNaming::Name is stringified by separating name components -with ‘/’ characters. The kind and id fields of -each component are separated by ‘.’ characters. If the -kind field is empty, the representation has no trailing -‘.’; if the id is empty, the representation starts -with a ‘.’ character; if both id and kind -are empty, the representation is just a ‘.’. The backslash -‘\’ is used to escape the meaning of -‘/’, ‘.’ and ‘\’ itself.

to_url() takes a corbaloc style address and key string -(but without the corbaloc: part), and a stringified name, -and returns a corbaname URI (incorrectly called a URL) -string, having properly escaped any invalid characters. The -specification does not make it clear whether or not the address string -should also be escaped by the operation; omniORB does not escape -it. For this reason, it is best to avoid calling to_url() if the -address part contains escapable characters. omniORB provides the -equivalent local function omniURI::addrAndNameToURI().

resolve_str() is equivalent to calling to_name() followed by -the inherited resolve() operation. There are no string-based -equivalents of the various bind operations.

-

6.3.2  Use with corbaname

To make it easy to use omniNames with corbaname URIs, it -starts with the default port of 2809, and an object key of -‘NameService’ for the root naming context.

-

6.4  omniMapper

omniMapper is a simple daemon which listens on port 2809 (or any other -port), and redirects IIOP requests for configured object keys to -associated persistent object references. It can be used to make a -naming service (even an old non-INS aware version of omniNames or -other ORB’s naming service) appear on port 2809 with the object key -‘NameService’. The same goes for any other service you may -wish to specify, such as an interface repository. omniMapper is -started with a command line of:

-omniMapper [-port <port>] [-config <config file>] [-v] -

The -port option allows you to choose a port other -than 2809 to listen on. The -config option specifies a -location for the configuration file. The default name is -/etc/omniMapper.cfg, or C:\omniMapper.cfg on -Windows. omniMapper does not normally print anything; the -v -option makes it verbose so it prints configuration information and a -record of the redirections it makes, to standard output.

The configuration file is very simple. Each line contains a string to -be used as an object key, some white space, and an IOR (or any valid -URI) that it will redirect that object key to. Comments should be -prefixed with a ‘#’ character. For example:

-
# Example omniMapper.cfg
-NameService         IOR:000f...
-InterfaceRepository IOR:0100...
-

omniMapper can either be run on a single machine, in much the same way -as omniNames, or it can be run on every machine, with a common -configuration file. That way, each machine’s omniORB configuration -file could contain the line:

-
ORBDefaultInitRef corbaloc::localhost
-
-

6.5  Creating objects with simple object keys

In normal use, omniORB creates object keys containing various -information including POA names and various non-ASCII characters. -Since object keys are supposed to be opaque, this is not usually a -problem. The INS breaks this opacity and requires servers to create -objects with human-friendly keys.

If you wish to make your objects available with human-friendly URIs, -there are two options. The first is to use omniMapper as described -above, in conjunction with a PERSISTENT POA. The second is to -create objects with the required keys yourself. You do this with a -special POA with the name ‘omniINSPOA’, acquired from -resolve_initial_references(). This POA has the USER_ID -and PERSISTENT policies, and the special property that the -object keys it creates contain only the object ids given to the POA, -and no other data. It is a normal POA in all other respects, so you -can activate/deactivate it, create children, and so on, in the usual -way.

Children of the omniINSPOA do not inherit its special properties of -creating simple object keys. If the omniINSPOA’s policies are not -suitable for your application, you cannot create a POA with different -policies (such as single threading, for example), and still generate -simple object keys. Instead, you can activate a servant in the -omniINSPOA that uses location forwarding to redirect requests to -objects in a different POA.

-
-1
Not 2089 as -printed in [OMG00]! -
+M1 into a single C++ class. For the first case, this will work +fine. For the second case, class M1::K will contain a reference +to M2::J, which has not yet been defined; the C++ compiler will +complain.

+ +

5.3  Examples

Generate the C++ headers and stubs for a file a.idl:

+omniidl -bcxx a.idl +

Generate with Any support:

+omniidl -bcxx -Wba a.idl +

As above, but also generate Python stubs (assuming omniORBpy +is installed):

+omniidl -bcxx -Wba -bpython a.idl +

Just check the IDL files for validity, generating no output:

+omniidl a.idl b.idl +
+ +
+1
For this reason, the _var types +define an inout() method that ensures use of the correct +conversion and thus avoids this kind of trouble.
- -

Chapter 7  Interface Type Checking

-

This chapter describes the mechanism used by omniORB to ensure type -safety when object references are exchanged across the network. This -mechanism is handled completely within the ORB. There is no -programming interface visible at the application level. However, for -the sake of diagnosing the problem when there is a type violation, it -is useful to understand the underlying mechanism in order to interpret -the error conditions reported by the ORB.

-

7.1  Introduction

In GIOP/IIOP, an object reference is encoded as an Interoperable -Object Reference (IOR) when it is sent across a network connection. -The IOR contains a Repository ID (RepoId) and one or more -communication profiles. The communication profiles describe where and -how the object can be contacted. The RepoId is a string which uniquely -identifies the IDL interface of the object.

Unless the ID pragma is specified in the IDL, the ORB generates -the RepoId string in the so-called OMG IDL Format1. For instance, the RepoId for the Echo -interface used in the examples of chapter 2 is -IDL:Echo:1.0.

When interface inheritance is used in the IDL, the ORB always sends the -RepoId of the most derived interface. For example:

// IDL - interface A { - ... - }; - interface B : A { - ... - }; - interface C { - void op(in A arg); - };
// C++ - C_ptr server; - B_ptr objB; - A_ptr objA = objB; - server->op(objA); // Send B as A

In the example, the operation C::op() accepts an object reference -of type A. The real type of the reference passed to C::op() -is B, which inherits from A. In this case, the RepoId of -B, and not that of A, is sent across the network.

The GIOP/IIOP specification allows an ORB to send a null string in the -RepoId field of an IOR. It is up to the receiving end to work out the -real type of the object. omniORB never sends out null strings as -RepoIds, but it may receive null RepoIds from other ORBs. In that -case, it will use the mechanism described below to ensure type safety.

-

7.2  Interface Inheritance

When the ORB receives an IOR of interface type B when it expects the -type to be A, it must find out if B inherits from A. When the ORB has -no local knowledge of the type B, it must work out the type of B -dynamically.

The CORBA specification defines an Interface Repository (IR) from -which IDL interfaces can be queried dynamically. In the above -situation, the ORB could contact the IR to find out the type of B. -However, this approach assumes that an IR is always available and -contains the up-to-date information of all the interfaces used in the -domain. This assumption may not be valid in many applications.

An alternative is to use the _is_a() operation to work out the -actual type of an object. This approach is simpler and more robust -than the previous one because no 3rd party is involved, so this is -what omniORB does.

class Object{ - CORBA::Boolean _is_a(const char* type_id); -};

The _is_a() operation is part of the CORBA::Object -interface and must be implemented by every object. The input argument -is a RepoId. The function returns true(1) if the object is really an -instance of that type, including if that type is a base type of the -most derived type of that object.

In the situation above, the ORB would invoke the _is_a() -operation on the object and ask if the object is of type A -before it processes any application invocation on the object.

Notice that the _is_a() call is not performed when the IOR -is unmarshalled. It is performed just prior to the first application -invocation on the object. This leads to some interesting failure modes -if B reports that it is not an A. Consider the following example:

// IDL -interface A { ... }; -interface B : A { ... }; -interface D { ... }; -interface C { - A op1(); - Object op2(); -};
1 // C++ - 2 C_ptr objC; - 3 A_ptr objA; - 4 CORBA::Object_ptr objR; - 5 - 6 objA = objC->op1(); - 7 (void) objA->_non_existent(); - 8 - 9 objR = objC->op2(); - 10 objA = A::_narrow(objR);

If the stubs of A,B,C,D are linked into the executable and:

-Case 1
C::op1() and C::op2() return a B. Lines 6–10 -complete successfully. The remote object is only contacted at line 7.
Case 2
C::op1() and C::op2() return a D. This condition -only occurs if the runtime of the remote end is buggy. Even though the -IDL definitions show that D is not derived from A, omniORB gives it -the benefit of the doubt, in case it actually has a more derived -interface that is derived from both A and D. At line 7, the object is -contacted to ask if it is an A. The answer is no, so a -CORBA::INV_OBJREF exception is raised. At line 10, the narrow -operation will fail, and objA will be set to nil. -

If only the stubs of A are linked into the executable and:

-Case 1
C::op1() and C::op2() return a B. Lines 6–10 -complete successfully. When lines 7 and 10 are executed, the object is -contacted to ask if it is an A.
Case 2
C::op1() and C::op2() return a D. This condition -only occurs if the runtime of the remote end is buggy. Line 6 -completes and no exception is raised. At line 7, the object is -contacted to ask if it is an A. If the answer is no, a -CORBA::INV_OBJREF exception is raised. At line 10, the narrow -operation will fail, and objA will be set to nil. -
-
-1
For further -details of the repository ID formats, see section 10.6 in the CORBA -2.6 specification. -
- - -

Chapter 8  Connection and Thread Management

-

This chapter describes how omniORB manages threads and network -connections.

-

8.1  Background

In CORBA, the ORB is the ‘middleware’ that allows a client to invoke + +

Chapter 6  Connection and Thread Management

+

This chapter describes how omniORB manages threads and network +connections.

+ +

6.1  Background

In CORBA, the ORB is the ‘middleware’ that allows a client to invoke an operation on an object without regard to its implementation or location. In order to invoke an operation on an object, a client needs to ‘bind’ to the object by acquiring its object reference. Such a @@ -2757,40 +2625,43 @@ address space, the binding process involves the ORB building a proxy object in the client’s address space. The ORB arranges for invocations on the proxy object to be transparently mapped to equivalent -invocations on the implementation object.

For the sake of interoperability, CORBA mandates that all ORBs should +invocations on the implementation object.

For the sake of interoperability, CORBA mandates that all ORBs should support IIOP as the means to communicate remote invocations over a -TCP/IP connection. IIOP is usually1 +TCP/IP connection. IIOP is usually1 asymmetric with respect to the roles of the parties at the two ends of a connection. At one end is the client which can only initiate remote invocations. At the other end is the server which can only receive -remote invocations.

Notice that in CORBA, as in most distributed systems, remote bindings +remote invocations.

Notice that in CORBA, as in most distributed systems, remote bindings are established implicitly without application intervention. This provides the illusion that all objects are local, a property known as ‘location transparency’. CORBA does not specify when such bindings should be established or how they should be multiplexed over the underlying network connections. Instead, ORBs are free to implement -implicit binding by a variety of means.

The rest of this chapter describes how omniORB manages network +implicit binding by a variety of means.

The rest of this chapter describes how omniORB manages network connections and the programming interface to fine tune the management -policy.

-

8.2  The model

omniORB is designed from the ground up to be fully multi-threaded. The +policy.

+ +

6.2  The model

omniORB is designed from the ground up to be fully multi-threaded. The objective is to maximise the degree of concurrency and at the same time eliminate any unnecessary thread overhead. Another objective is to minimise the interference by the activities of other threads on the progress of a remote invocation. In other words, thread ‘cross-talk’ should be minimised within the ORB. To achieve these objectives, the -degree of multiplexing at every level is kept to a minimum by default.

Minimising multiplexing works well when the ORB is relatively lightly -loaded. However, when the ORB is under heavy load, it can sometimes be -beneficial to conserve operating system resources such as threads and -network connections by multiplexing at the ORB level. omniORB has -various options that control its multiplexing behaviour.

-

8.3  Client side behaviour

On the client side of a connection, the thread that invokes on a proxy +degree of multiplexing at every level is kept to a minimum by default.

Minimising multiplexing works well when the system is relatively +lightly loaded. However, when the ORB is under heavy load, it can +sometimes be beneficial to conserve operating system resources such as +threads and network connections by multiplexing at the ORB +level. omniORB has various options that control its multiplexing +behaviour.

+ +

6.3  Client side behaviour

On the client side of a connection, the thread that invokes on a proxy object drives the GIOP protocol directly and blocks on the connection to receive the reply. The first time the client makes a call to a particular address space, the ORB opens a suitable connection to the remote address space (based on the client transport rule as described -in section 8.7.1). After the reply has been received, +in section 6.7.1). After the reply has been received, the ORB caches the open network connection, ready for use by another -call.

If two (or more) threads in a multi-threaded client attempt to contact +call.

If two (or more) threads in a multi-threaded client attempt to contact the same address space simultaneously, there are two different ways to proceed. The default way is to open another network connection to the server. This means that neither the client or server ORB has to @@ -2800,55 +2671,56 @@ concurrent requests on a single network connection. This conserves operating system resources (network connections), but means that both the client and server have to deal with multiplexing issues -themselves.

In the default one call per connection mode, there is a limit to the +themselves.

In the default one call per connection mode, there is a limit to the number of concurrent connections that are opened, set with the -maxGIOPConnectionPerServer parameter. To tell the ORB +maxGIOPConnectionPerServer parameter. To tell the ORB that it may multiplex calls on a single connection, set the -oneCallPerConnection parameter to zero. If the -oneCallPerConnection parameter is set to the default +oneCallPerConnection parameter to zero. If the +oneCallPerConnection parameter is set to the default value of one, and there are more concurrent calls than specified by -maxGIOPConnectionPerServer, calls block waiting for connections -to become free.

Note that some server-side ORBs, including omniORB versions before +maxGIOPConnectionPerServer, calls block waiting for connections +to become free.

Note that some server-side ORBs, including omniORB versions before version 4.0, are unable to deal with concurrent calls multiplexed on a single connection, so they serialise the calls. It is usually best to -keep to the default mode of opening multiple connections.

-

8.3.1  Client side timeouts

-

omniORB can associate a timeout with a call, meaning that if the call -takes too long a TRANSIENT exception is thrown. Timeouts can be -set for the whole process, for a specific thread, or for a specific -object reference.

Timeouts are set using this API:

namespace omniORB { - void setClientCallTimeout(CORBA::ULong millisecs); - void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs); - void setClientThreadCallTimeout(CORBA::ULong millisecs); - void setClientConnectTimeout(CORBA::ULong millisecs); -};

setClientCallTimeout() sets either the global timeout or the +keep to the default mode of opening multiple connections.

+ +

6.3.1  Client side timeouts

+

omniORB can associate a timeout with a call, meaning that if the call +takes too long a CORBA::TIMEOUT exception2 is +thrown. Timeouts can be set for the whole process, for a specific +thread, or for a specific object reference.

Timeouts are set using this API:

namespace omniORB { + void setClientCallTimeout(CORBA::ULong millisecs); + void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs); + void setClientThreadCallTimeout(CORBA::ULong millisecs); + void setClientConnectTimeout(CORBA::ULong millisecs); +};

setClientCallTimeout() sets either the global timeout or the timeout for a specific object reference. -setClientThreadCallTimeout() sets the timeout for the calling -thread. The calling thread must have an omni_thread associated -with it. Setting any timeout value to zero disables it.

Accessing per-thread state is a relatively expensive operation, so per +setClientThreadCallTimeout() sets the timeout for the calling +thread. The calling thread must have an omni_thread associated +with it. Setting any timeout value to zero disables it.

Accessing per-thread state is a relatively expensive operation, so per thread timeouts are disabled by default. The -supportPerThreadTimeOut parameter must be set true to enable -them.

To choose the timeout value to use for a call, the ORB first looks to +supportPerThreadTimeOut parameter must be set true to +enable them.

To choose the timeout value to use for a call, the ORB first looks to see if there is a timeout for the object reference, then to the -calling thread, and finally to the global timeout.

When a client has no existing connection to communicate with a server, +calling thread, and finally to the global timeout.

When a client has no existing connection to communicate with a server, it must open a new connection before performing the -call. setClientConnectTimeout() sets an overriding timeout for +call. setClientConnectTimeout() sets an overriding timeout for cases where a new connection must be established. The effect of the connect timeout depends upon whether the connect timeout is greater -or less than the timeout that would otherwise be used.

As an example, imagine that the usual call timeout is 10 seconds:

-

Connect timeout > usual timeout

If the connect timeout is set to 20 seconds, then a call that +or less than the timeout that would otherwise be used.

As an example, imagine that the usual call timeout is 10 seconds:

+

Connect timeout > usual timeout

If the connect timeout is set to 20 seconds, then a call that establishes a new connection will be permitted 20 seconds before it times out. Subsequent calls using the same connection have the normal 10 second timeout. If establishing the connection takes 8 seconds, then the call itself takes 5 seconds, the call succeeds despite having -taken 13 seconds in total, longer than the usual timeout.

This kind of configuration is good when connections are slow to be -established.

If an object reference has multiple possible endpoints available, and +taken 13 seconds in total, longer than the usual timeout.

This kind of configuration is good when connections are slow to be +established.

If an object reference has multiple possible endpoints available, and connecting to the first endpoint times out, only that one endpoint will have been tried before an exception is raised. However, once the timeout has occurred, the object reference will switch to use the next endpoint. If the application attempts to make another call, it will -use the next endpoint.

-

Connect timeout < usual timeout

If the connect timeout is set to 2 seconds, the actual network-level +use the next endpoint.

+

Connect timeout < usual timeout

If the connect timeout is set to 2 seconds, the actual network-level connect is only permitted to take 2 seconds. As long as the connection is established in less than 2 seconds, the call can proceed. The 10 second call timeout still applies to the time taken for the whole call @@ -2857,7 +2729,7 @@ the call will time out because although it met the connection timeout, it exceeded the 10 second total call timeout. On the other hand, if establishing the connection takes 3 seconds, the call will fail after -only 2 seconds, since only 2 seconds are permitted for the connect.

If an object reference has multiple possible endpoints available, the +only 2 seconds, since only 2 seconds are permitted for the connect.

If an object reference has multiple possible endpoints available, the client will attempt to connect to them in turn, until one succeeds. The connect timeout applies to each connection attempt. So with a connect timeout of 2 seconds, the client will spend up to 2 seconds @@ -2865,21 +2737,23 @@ to 2 seconds trying the second address, and so on. The 10 second timeout still applies to the call as a whole, so if the total time taken on timed-out connection attempts exceeds 10 seconds, the call -will time out.

This kind of configuration is useful where calls may take a long time +will time out.

This kind of configuration is useful where calls may take a long time to complete (so call timeouts are long), but a fast indication of -connection failure is required.

-

8.4  Server side behaviour

The server side has two primary modes of operation: thread per +connection failure is required.

+ +

6.4  Server side behaviour

The server side has two primary modes of operation: thread per connection and thread pooling. It is able to dynamically transition between the two modes, and it supports a hybrid scheme that behaves mostly like thread pooling, but has the same fast turn-around for -sequences of calls as thread per connection.

-

8.4.1  Thread per connection mode

In thread per connection mode (the default, and the only option in +sequences of calls as thread per connection.

+ +

6.4.1  Thread per connection mode

In thread per connection mode (the default, and the only option in omniORB versions before 4.0), each connection has a single thread dedicated to it. The thread blocks waiting for a request. When it receives one, it unmarshals the arguments, makes the up-call to the application code, marshals the reply, and goes back to watching the connection. There is thus no thread switching along the call chain, -meaning the call is very efficient.

As explained above, a client can choose to multiplex multiple +meaning the call is very efficient.

As explained above, a client can choose to multiplex multiple concurrent calls on a single connection, so once the server has received the request, and just before it makes the call into application code, it marks the connection as ‘selectable’, meaning @@ -2889,22 +2763,23 @@ multiple calls to be interleaved on a connection, so the unmarshalling code has to handle that too. As soon as any multiplexing occurs on the connection, the aim of removing thread switching cannot be met, and -there is inevitable inefficiency due to thread switching.

The maxServerThreadPerConnection parameter can be set to limit +there is inevitable inefficiency due to thread switching.

The maxServerThreadPerConnection parameter can be set to limit the number of threads that can be allocated to a single connection containing concurrent calls. Setting the parameter to 1 mimics the behaviour of omniORB versions before 4.0, that did not support -calls multiplexed on one connection.

-

8.4.2  Thread pool mode

-

In thread pool mode, selected by setting the -threadPerConnectionPolicy parameter to zero, a single thread +calls multiplexed on one connection.

+ +

6.4.2  Thread pool mode

+

In thread pool mode, selected by setting the +threadPerConnectionPolicy parameter to zero, a single thread watches all incoming connections. When a call arrives on one of them, a thread is chosen from a pool of threads, and set to work unmarshalling the arguments and performing the up-call. There is -therefore at least one thread switch for each call.

The thread pool is not pre-initialised. Instead, threads are started +therefore at least one thread switch for each call.

The thread pool is not pre-initialised. Instead, threads are started on demand, and idle threads are stopped after a period of inactivity. The maximum number of threads that can be started in the pool is set -with the maxServerThreadPoolSize parameter. The default -is 100.

A common pattern in CORBA applications is for a client to make several +with the maxServerThreadPoolSize parameter. The default +is 100.

A common pattern in CORBA applications is for a client to make several calls to a single object in quick succession. To handle this situation most efficiently, the default behaviour is to not return a thread to the pool immediately after a call is finished. Instead, it is set to @@ -2914,29 +2789,30 @@ switching, just as in thread per connection mode. Of course, if the server is supporting a very large number of connections (more than the size of the thread pool), this policy can delay a call coming from -another connection. If the threadPoolWatchConnection +another connection. If the threadPoolWatchConnection parameter is set to zero, connection watching is disabled and threads -return to the pool immediately after finishing a single request.

In the face of multiplexed calls on a single connection, multiple +return to the pool immediately after finishing a single request.

In the face of multiplexed calls on a single connection, multiple threads from the pool can be dispatched for one connection, just as in -thread per connection mode. With threadPoolWatchConnection set +thread per connection mode. With threadPoolWatchConnection set to the default value of 1, only the last thread servicing a connection will watch it when it finishes a request. Setting the parameter to a -larger number allows the last n connections to watch the -connection.

-

8.4.3  Policy transition

If the server is dealing with a relatively small number of +larger number allows the last n connections to watch the +connection.

+ +

6.4.3  Policy transition

If the server is dealing with a relatively small number of connections, it is most efficient to use thread per connection mode. If the number of connections becomes too large, however, operating system limits on the number of threads may cause a significant slowdown, or even prevent the acceptance of new connections -altogether.

To give the most efficient response in all circumstances, omniORB +altogether.

To give the most efficient response in all circumstances, omniORB allows a server to start in thread per connection mode, and transition to thread pooling if many connections arrive. This is controlled with -the threadPerConnectionUpperLimit and -threadPerConnectionLowerLimit parameters. The former must -always be larger than the latter. The upper limit chooses the number -of connections at which time the ORB transitions to thread pool mode; -the lower limit selects the point at which the transition back to -thread per connection is made.

For example, setting the upper limit to 50 and the lower limit to 30 +the threadPerConnectionUpperLimit and +threadPerConnectionLowerLimit parameters. The upper limit must +always be larger than the lower limit. The upper limit chooses the +number of connections at which time the ORB transitions to thread pool +mode; the lower limit selects the point at which the transition back +to thread per connection is made.

For example, setting the upper limit to 50 and the lower limit to 30 would mean that the first 49 connections would receive dedicated threads. The 50th to arrive would trigger thread pooling. All future connections to arrive would make use of threads from the pool. Note @@ -2945,103 +2821,121 @@ connections falls below 30, thread per connection is reactivated and new connections receive their own dedicated threads (up to the limit of 50 again). Once again, existing connections in thread pool mode -stay in that mode until they are closed.

-

8.5  Idle connection shutdown

-

It is wasteful to leave a connection open when it has been left unused +stay in that mode until they are closed.

+ +

6.5  Idle connection shutdown

+

It is wasteful to leave a connection open when it has been left unused for a considerable time. Too many idle connections could block out new -connections when it runs out of spare communication channels. For -example, most platforms have a limit on the number of file handles a -process can open. Many platforms have a very small default limit like -64. The value can often be increased to a maximum of a thousand or -more by changing the ‘ulimit’ in the shell.

Every so often, a thread scans all open connections to see which are +connections when the system runs out of spare communication channels. +For example, most platforms have a limit on the number of file handles +a process can open. Many platforms have a very small default limit +like 64. The value can often be increased to a maximum of a thousand +or more by changing the ‘ulimit’ in the shell.

Every so often, a thread scans all open connections to see which are idle. The scanning period (in seconds) is set with the -scanGranularity parameter. The default is 5 seconds.

Outgoing connections (initiated by clients) and incoming connections +scanGranularity parameter. The default is 5 seconds.

Outgoing connections (initiated by clients) and incoming connections (initiated by servers) have separate idle timeouts. The timeouts are -set with the outConScanPeriod and inConScanPeriod +set with the outConScanPeriod and inConScanPeriod parameters respectively. The values are in seconds, and must be a -multiple of the scan granularity.

Beware that setting outConScanPeriod or inConScanPeriod -to be equal to (or less than) scanGranularity means that +multiple of the scan granularity.

Beware that setting outConScanPeriod or inConScanPeriod +to be equal to (or less than) scanGranularity means that connections are considered candidates for closure immediately after they are opened. That can mean that the connections are closed before any calls have been sent through them. If oneway calls are used, such -connection closure can result in silent loss of calls.

-

8.5.1  Interoperability Considerations

The IIOP specification allows both the client and the server to +connection closure can result in silent loss of calls.

+ +

6.5.1  Interoperability Considerations

The IIOP specification allows both the client and the server to shutdown a connection unilaterally. When one end is about to shutdown -a connection, it should send a CloseConnection message to the other -end. It should also make sure that the message will reach the other -end before it proceeds to shutdown the connection.

The client should distinguish between an orderly and an abnormal -connection shutdown. When a client receives a CloseConnection message -before the connection is closed, the condition is an orderly shutdown. -If the message is not received, the condition is an abnormal shutdown. -In an abnormal shutdown, the ORB should raise a COMM_FAILURE -exception whereas in an orderly shutdown, the ORB should not -raise an exception and should try to re-establish a new connection -transparently.

omniORB implements these semantics completely. However, it is known +a connection, it should send a CloseConnection message to the +other end. It should also make sure that the message will reach the +other end before it proceeds to shutdown the connection.

The client should distinguish between an orderly and an abnormal +connection shutdown. When a client receives a CloseConnection +message before the connection is closed, the condition is an orderly +shutdown. If the message is not received, the condition is an +abnormal shutdown. In an abnormal shutdown, the ORB should raise a +COMM_FAILURE exception whereas in an orderly shutdown, the ORB +should not raise an exception and should try to re-establish a +new connection transparently.

omniORB implements these semantics completely. However, it is known that some ORBs are not (yet) able to distinguish between an orderly and an abnormal shutdown. Usually this is manifested as the client in -these ORBs seeing a COMM_FAILURE occasionally when connected +these ORBs seeing a COMM_FAILURE occasionally when connected to an omniORB server. The work-around is either to catch the exception in the application code and retry, or to turn off the idle connection -shutdown inside the omniORB server.

-

8.6  Transports and endpoints

omniORB can support multiple network transports. All platforms +shutdown inside the omniORB server.

+ +

6.6  Transports and endpoints

+

omniORB can support multiple network transports. All platforms (usually) have a TCP transport available. Unix platforms support a Unix domain socket transport. Platforms with the OpenSSL library -available can support an SSL transport.

Servers must be configured in two ways with regard to transports: the +available can support an SSL transport.

Servers must be configured in two ways with regard to transports: the transports and interfaces on which they listen, and the details that are published in IORs for clients to see. Usually the published details will be the same as the listening details, but there are times -when it is useful to publish different information.

Details are selected with the endPoint family of parameters. -The simplest is plain endPoint, which chooses a transport and +when it is useful to publish different information.

Details are selected with the endPoint family of parameters. +The simplest is plain endPoint, which chooses a transport and interface details, and publishes the information in IORs. Endpoint parameters are in the form of URIs, with a scheme name of -‘giop:’, followed by the transport name. Different transports -have different parameters following the transport.

TCP endpoints have the format:

-giop:tcp:<host>:<port> -

The host must be a valid host name or IP address for the +‘giop:’, followed by the transport name. Different transports +have different parameters following the transport.

TCP endpoints have the format:

+giop:tcp:<host>:<port> +

The host must be a valid host name or IP address for the server machine. It determines the network interface on which the server listens. The port selects the TCP port to listen on, which must be unoccupied. Either the host or port, or both can be left empty. If the host is empty, the ORB publishes the IP address of the first non-loopback network interface it can find (or the loopback if that is -the only interface), but listens on all network interfaces. If -the port is empty, the operating system chooses a port.

Multiple TCP endpoints can be selected, either to specify multiple +the only interface), but listens on all network interfaces. If +the port is empty, the operating system chooses an ephemeral +port.

Multiple TCP endpoints can be selected, either to specify multiple network interfaces on which to listen, or (less usefully) to select -multiple TCP ports on which to listen.

If no endPoint parameters are set, the ORB assumes a single -parameter of giop:tcp::, meaning IORs contain the address of +multiple TCP ports on which to listen.

If no endPoint parameters are set, the ORB assumes a single +parameter of giop:tcp::, meaning IORs contain the address of the first non-loopback network interface, the ORB listens on all -interfaces, and the OS chooses a port number.

SSL endpoints have the same format as TCP ones, except ‘tcp’ -is replaced with ‘ssl’. Unix domain socket endpoints have the -format:

-giop:unix:<filename> -

where the filename is the name of the socket within the +interfaces, and the OS chooses a port number.

SSL endpoints have the same format as TCP ones, except ‘tcp’ +is replaced with ‘ssl’. Unix domain socket endpoints have the +format:

+giop:unix:<filename> +

where the filename is the name of the socket within the filesystem. If the filename is left blank, the ORB chooses a name -based on the process id and a timestamp.

To listen on an endpoint without publishing it in IORs, specify it -with the endPointNoPublish configuration parameter. See below -for more details about endpoint publishing.

-

8.6.1  IPv6

On platforms where it is available, omniORB supports IPv6. On most +based on the process id and a timestamp.

To listen on an endpoint without publishing it in IORs, specify it +with the endPointNoPublish configuration parameter. See below +for more details about endpoint publishing.

+ +

6.6.1  Port ranges

Sometimes it is useful to restrict a server to listen on one of a +range of ports, rather than pinning it to one particular port or +allowing the OS to choose an ephemeral port. omniORB 4.2 introduces +the ability to specify a range of ports using a hyphen. e.g. to +listen on a port between 5000 and 5010 inclusive:

+giop:tcp::5000-5010 +

omniORB randomly chooses a port in the range. If it finds that the +chosen port is already occupied, it keeps trying different ports until +it finds a free one. If all the ports in the range are occupied, it +throws CORBA::INITIALIZE.

+ +

6.6.2  IPv6

On platforms where it is available, omniORB supports IPv6. On most Unix platforms, IPv6 sockets accept both IPv6 and IPv4 connections, so -omniORB’s default giop:tcp:: endpoint accepts both IPv4 and +omniORB’s default giop:tcp:: endpoint accepts both IPv4 and IPv6 connections. On Windows versions before Windows Vista, each socket type only accepts incoming connections of the same type, so an IPv6 socket cannot be used with IPv4 clients. For this reason, the -default giop:tcp:: endpoint only listens for IPv4 connections. +default giop:tcp:: endpoint only listens for IPv4 connections. Since endpoints with a specific host name or address only listen on a single network interface, they are inherently limited to just one -protocol family.

To explicitly ask for just IPv4 or just IPv6, an endpoint with the +protocol family.

To explicitly ask for just IPv4 or just IPv6, an endpoint with the wildcard address for the protocol family should be used. For IPv4, the -wildcard address is ‘0.0.0.0’, and for IPv6 it is ‘::’. +wildcard address is ‘0.0.0.0’, and for IPv6 it is ‘::’. So, to listen for IPv4 connections on all IPv4 network interfaces, use -an endpoint of:

-giop:tcp:0.0.0.0: -

All IPv6 addresses contain colons, so the address portion in -URIs must be contained within [] characters. Therefore, to +an endpoint of:

+giop:tcp:0.0.0.0: +

All IPv6 addresses contain colons, so the address portion in +URIs must be contained within [] characters. Therefore, to listen just for IPv6 connections on all IPv6 interfaces, use the -somewhat cryptic:

-giop:tcp:[::]: -

To listen for both IPv4 and IPv6 connections on Windows -versions prior to Vista, both endpoints must be explicitly provided.

-

8.6.1.1  Link local addresses

In IPv6, all network interfaces are assigned a link local -address, starting with the digits fe80. The link local address +somewhat cryptic:

+giop:tcp:[::]: +

To listen for both IPv4 and IPv6 connections on Windows +versions prior to Vista, both endpoints must be explicitly provided.

+ +

6.6.2.1  Link local addresses

In IPv6, all network interfaces are assigned a link local +address, starting with the digits fe80. The link local address is only valid on the same ‘link’ as the interface, meaning directly connected to the interface, or possibly on the same subnet, depending on how the network is switched. To connect to a server’s link local @@ -3051,170 +2945,573 @@ and in extreme circumstances may even end up contacting the wrong server if it picks the wrong interface, link local addresses are not considered valid. Servers do not publish link local addresses in their -IORs.

-

8.6.2  Endpoint publishing

For clients to be able to connect to a server, the server publishes +IORs.

+ +

6.6.3  Endpoint publishing

For clients to be able to connect to a server, the server publishes endpoint information in its IORs (Interoperable Object References). Normally, omniORB publishes the first available address for each of -the endpoints it is listening on.

The endpoint information to publish is determined by the -endPointPublish configuration parameter. It contains a +the endpoints it is listening on.

The endpoint information to publish is determined by the +endPointPublish configuration parameter. It contains a comma-separated list of publish rules. The rules are applied in turn to each of the configured endpoints; if a rule matches an endpoint, it -causes one or more endpoints to be published.

The following core rules are supported:

- - - - - -
addrthe first natural address of the endpoint
ipv4the first IPv4 address of a TCP or SSL endpoint
ipv6the first IPv6 address of a TCP or SSL endpoint
namethe first address that can be resolved to a name
hostnamethe result of the gethostname() system call
fqdnthe fully-qualified domain name

The core rules can be combined using the vertical bar operator to -try several rules in turn until one succeeds. e.g:

+
name|ipv6|ipv4the name of the endpoint if it has one; +causes one or more endpoints to be published.

The following core rules are supported:

+ + + + + +
addrthe first natural address of the endpoint
ipv4the first IPv4 address of a TCP or SSL endpoint
ipv6the first IPv6 address of a TCP or SSL endpoint
namethe first address that can be resolved to a name
hostnamethe result of the gethostname() system call
fqdnthe fully-qualified domain name

The core rules can be combined using the vertical bar operator to +try several rules in turn until one succeeds. e.g:

-
name|ipv6|ipv4the name of the endpoint if it has one; failing that, its first IPv6 address; - failing that, its first IPv4 address.

Multiple rules can be combined using the comma operator to -publish more than one endpoint. e.g.

-
name,addrthe name of the endpoint (if it has one), -followed by its first address.

For endpoints with multiple addresses (e.g. TCP endpoints on -multi-homed machines), the all() manipulator causes all -addresses to be published. e.g.:

- - - - -
all(addr)all addresses are published
all(name)all addresses that resolve to names are published
all(name|addr)all addresses are published by name if they have -one, address otherwise.
all(name,addr)all addresses are published by name (if they -have one), and by address.
all(name), all(addr)first the names of all addresses are published, -followed by all the addresses.

A specific endpoint can be published by giving its endpoint URI, -even if the server is not listening on that endpoint. e.g.:

- -
giop:tcp:not.my.host:12345
giop:unix:/not/my/socket-file

If the host or port number for a TCP or SSL URI are missed out, + failing that, its first IPv4 address. +

Multiple rules can be combined using the comma operator to +publish more than one endpoint. e.g.

+
name,addrthe name of the endpoint (if it has one), +followed by its first address. +

For endpoints with multiple addresses (e.g. TCP endpoints on +multi-homed machines), the all() manipulator causes all +addresses to be published. e.g.:

+ + + + +
all(addr)all addresses are published
all(name)all addresses that resolve to names are published
all(name|addr)all addresses are published by name if they have +one, address otherwise.
all(name,addr)all addresses are published by name (if they +have one), and by address.
all(name), all(addr)first the names of all addresses are published, +followed by all the addresses.

A specific endpoint can be published by giving its endpoint URI, +even if the server is not listening on that endpoint. e.g.:

+ +
giop:tcp:not.my.host:12345
giop:unix:/not/my/socket-file

If the host or port number for a TCP or SSL URI are missed out, they are filled in with the details from each listening TCP/SSL endpoint. This can be used to publish a different name for a -TCP/SSL endpoint that is using an ephemeral port, for example.

omniORB 4.0 supported two options related to endpoint publishing that -are superseded by the endPointPublish parameter, and so are now -deprecated. Setting endPointPublishAllIFs to 1 is equivalent to -setting endPointPublish to ‘all(addr)’. The -endPointNoListen parameter is equivalent to adding endpoint -URIs to the endPointPublish parameter.

-

8.7  Connection selection and acceptance

In the face of IORs containing details about multiple different +TCP/SSL endpoint that is using an ephemeral port, for example.

omniORB 4.0 supported two options related to endpoint publishing that +are superseded by the endPointPublish parameter, and so are now +deprecated. Setting endPointPublishAllIFs to 1 is equivalent to +setting endPointPublish to ‘all(addr)’. The +endPointNoListen parameter is equivalent to adding endpoint +URIs to the endPointPublish parameter.

+ +

6.7  Connection selection and acceptance

In the face of IORs containing details about multiple different endpoints, clients have to know how to choose the one to use to connect a server. Similarly, servers may wish to restrict which clients can connect to particular transports. This is achieved with -transport rules.

-

8.7.1  Client transport rules

-

The clientTransportRule parameter is used to filter and +transport rules.

+ +

6.7.1  Client transport rules

+

The clientTransportRule parameter is used to filter and prioritise the order in which transports specified in an IOR are -tried. Each rule has the form:

-<address mask> [action]+ -

The address mask can be one of

- + + + +
1.localhostThe address of this machine
-2.w.x.y.z/m1.m2.m3.m4An IPv4 address +tried. Each rule has the form:

+<address mask> [action]+ +

The address mask can be one of

+ - - - -
1.localhostThe address of this machine
+2.w.x.y.z/m1.m2.m3.m4An IPv4 address with bits selected by the mask, e.g. - 172.16.0.0/255.240.0.0
-3.w.x.y.z/prefixlenAn IPv4 address with -prefixlen significant bits, e.g. - 172.16.2.0/24
-4.a:b:c:d:e:f:g:h/prefixlenAn IPv6 -address with prefixlen significant bits, e.g. - 3ffe:505:2:1::/64
-5.*Wildcard that matches any address

The action is one or more of the following:

- - - - -
1.noneDo not use this address
2.tcpUse a TCP transport
3.sslUse an SSL transport
4.unixUse a Unix socket transport
5.bidirConnections to this address can be used -bidirectionally (see section 8.8)

The transport-selecting actions form a prioritised list, so -an action of ‘unix,ssl,tcp’ means to use a Unix transport if -there is one, failing that a SSL transport, failing that a TCP + 172.16.0.0/255.240.0.0

+3.w.x.y.z/prefixlenAn IPv4 address with +prefixlen significant bits, e.g. + 172.16.2.0/24
+4.a:b:c:d:e:f:g:h/prefixlenAn IPv6 +address with prefixlen significant bits, e.g. + 3ffe:505:2:1::/64
+5.*Wildcard that matches any address

The action is one or more of the following:

+ + + + +
1.noneDo not use this address
2.tcpUse a TCP transport
3.sslUse an SSL transport
4.unixUse a Unix socket transport
5.bidirConnections to this address can be used +bidirectionally (see section 6.8)

The transport-selecting actions form a prioritised list, so +an action of ‘unix,ssl,tcp’ means to use a Unix transport if +there is one, failing that a SSL transport, failing that a TCP transport. In the absence of any explicit rules, the client uses the -implicit rule of ‘* unix,ssl,tcp’.

If more than one rule is specified, they are prioritised in the order -they are specified. For example, the configuration file might contain:

  clientTransportRule = 192.168.1.0/255.255.255.0  unix,tcp
+implicit rule of ‘* unix,ssl,tcp’.

If more than one rule is specified, they are prioritised in the order +they are specified. For example, the configuration file might contain:

  clientTransportRule = 192.168.1.0/255.255.255.0  unix,tcp
   clientTransportRule = 172.16.0.0/255.240.0.0     unix,tcp
                       =       *                    none
-

This would be useful if there is a fast network +

This would be useful if there is a fast network (192.168.1.0) which should be used in preference to another network (172.16.0.0), and connections to other networks are not permitted at -all.

In general, the result of filtering the endpoint specifications in an +all.

In general, the result of filtering the endpoint specifications in an IOR with the client transport rule will be a prioritised list of transports and networks. (If the transport rules do not prioritise one endpoint over another, the order the endpoints are listed in the IOR is used.) When trying to contact an object, the ORB tries its possible endpoints in turn, until it finds one with which it can contact the object. Only after it has unsuccessfully tried all -permissible endpoints will it raise a TRANSIENT exception to -indicate that the connect failed.

-

8.7.2  Server transport rules

-

The server transport rules have the same format as client transport +permissible endpoints will it raise a TRANSIENT exception to +indicate that the connect failed.

+ +

6.7.2  Server transport rules

+

Server transport rules have the same format as client transport rules. Rather than being used to select which of a set of ways to contact a machine, they are used to determine whether or not to accept connections from particular clients. In this example, we only allow -connections from our intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
+connections from our intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
                       = 172.16.0.0/255.240.0.0     tcp,ssl
                       = *                          none
-

And in this one, we accept only SSL connections if the -client is not on the intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
+

And in this one, we accept only SSL connections if the +client is not on the intranet:

  serverTransportRule = localhost                  unix,tcp,ssl
                       = 172.16.0.0/255.240.0.0     tcp,ssl
                       = *                          ssl,bidir
-

In the absence of any explicit rules, the server uses the -implicit rule of ‘* unix,ssl,tcp’, meaning any kind of -connection is accepted from any client.

-

8.8  Bidirectional GIOP

-

omniORB supports bidirectional GIOP, which allows callbacks to be made +

In the absence of any explicit rules, the server uses the +implicit rule of ‘* unix,ssl,tcp’, meaning any kind of +connection is accepted from any client.

+ +

6.8  Bidirectional GIOP

+

omniORB supports bidirectional GIOP, which allows callbacks to be made using a connection opened by the original client, rather than the normal model where the server opens a new connection for the callback. This is important for negotiating firewalls, since they tend not to -allow connections back on arbitrary ports.

There are several steps required for bidirectional GIOP to be enabled +allow connections back on arbitrary ports.

There are several steps required for bidirectional GIOP to be enabled for a callback. Both the client and server must be configured -correctly. On the client side, these conditions must be met:

  • The offerBiDirectionalGIOP parameter must be set to true. -
  • The client transport rule for the target server must contain the -bidir action. -
  • The POA containing the callback object (or objects) must have -been created with a BidirectionalPolicy value of -BOTH.

On the server side, these conditions must be met:

  • The acceptBiDirectionalGIOP parameter must be set to true. -
  • The server transport rule for the requesting client must contain -the bidir action. -
  • The POA hosting the object contacted by the client must have -been created with a BidirectionalPolicy value of -BOTH.
-

8.9  SSL transport

omniORB supports an SSL transport, using OpenSSL. It is only built if -OpenSSL is available. On platforms using Autoconf, it is autodetected -in many locations, or its location can be given with the ---with-openssl= argument to configure. On other -platforms, the OPEN_SSL_ROOT make variable must be set in the -platform file.

To use the SSL transport, you must link your application with the -omnisslTP library, and correctly set up certificates. See the -src/examples/ssl_echo directory for an example. That directory -contains a README file with more details.

-
-1
GIOP 1.2 supports -‘bidirectional GIOP’, which permits the rôles to be reversed. -
+correctly. On the client side, these conditions must be met:

  • The offerBiDirectionalGIOP parameter must be set to true. +
  • The client transport rule for the target server must contain the +bidir action. +
  • The POA containing the callback object (or objects) must have +been created with a BidirectionalPolicy value of +BOTH.

On the server side, these conditions must be met:

  • The acceptBiDirectionalGIOP parameter must be set to true. +
  • The server transport rule for the requesting client must contain +the bidir action. +
  • The POA hosting the object contacted by the client must have +been created with a BidirectionalPolicy value of +BOTH.
+ +

6.9  TLS / SSL transport

omniORB supports a TLS / SSL transport, using OpenSSL. It is only +built if OpenSSL is available. On platforms using Autoconf, it is +autodetected in many locations, or its location can be given with the +--with-openssl= argument to configure. On other +platforms, the OPEN_SSL_ROOT make variable must be set in the +platform file.

To use the SSL transport, you must link your application with the +omnisslTP library, and correctly set up certificates. See the +src/examples/ssl_echo directory for an example. That directory +contains a README file with more details.

+ +

6.9.1  Self-signed certificate authority

By default, omniORB configures OpenSSL to require both clients and +servers to have certificates that are signed by a Certificate +Authority (CA). It is possible to use a public CA to obtain keys that +can be independently verified, but for many purposes, it is sufficient +to use a private CA to sign all the keys in use in an application. The +following is a brief description of how to become your own certificate +authority and issue and sign certificates, using the OpenSSL command +line tools.

Before starting, find the default openssl.cnf file that was +installed with OpenSSL, copy it to a suitable location, and edit it as +you feel appropriate. Now, build a certificate directory structure, +authority key and certificate:

  mkdir demoCA demoCA/private demoCA/newcerts
+
+  openssl req -config openssl.cnf -x509 -newkey rsa:2048 \
+     -keyout demoCA/private/cakey.pem -out demoCA/cacert.pem -days 3650
+
+  echo 01 >demoCA/serial
+  touch demoCA/index.txt
+

Next, issue a key request and sign it:

  openssl req -config openssl.cnf -new -keyout server_key.pem \
+     -out server_req.pem -days 3650
+
+  openssl ca -config openssl.cnf -policy policy_anything \
+     -out server_cert.pem -in server_req.pem 
+

Amongst other things, you now have a server key file in +server_key.pem and a certificate in server_cert.pem. To +make a single file containing both the key and the certificate, +suitable for use in omniORB, concatenate the key and certificate files +together. You can skip the human-readable(ish) text in the +certificate file before the -----BEGIN CERTIFICATE----- marker.

If need be, create more certificates for servers and clients in the +same way.

+ +

6.10  ZIOP

omniORB has support for ZIOP, which compresses transmitted +messages. To use it, link with the omniZIOP4 library.

On Unix platforms, ZIOP support is automatically enabled if the +configure script detects zlib. To enable it on Windows, set the +EnableZIOP make variable in the platform configuration file.

omniORB has an almost complete implementation of the ZIOP +specification, with the following extensions and differences:

  1. +To avoid a dependency on CORBA::Any, compression policies +can be obtained with functions in the omniZIOP namespace, +rather than with the standard orb->create_policy(). See +include/omniORB4/omniZIOP.h for details. To use Any +with the standard orb->create_policy(), link with the +omniZIOPDynamic4 library in addition to omniZIOP4.
  2. Client-side policies are global, set with +omniZIOP::setGlobalPolicies(). +CORBA::Object::_set_policy_overrides() is not supported.
  3. POAs can be given ZIOP policies as shown in the +src/examples/ziop/ziop_impl.cc, but they can also use the +global policies set with omniZIOP::setGlobalPolicies(). This +is useful to apply ZIOP policies to the RootPOA or omniINSPOA. +

In addition to the standard policies, whether or not to +enable ZIOP is determined by client and server transport rules. For a +client to use ZIOP, the matching client transport rule must include +‘ziop’; similarly, for a server to use ZIOP, the matching +server transport rule must include ‘ziop’. e.g. to use the +examples:

  ziop_impl -ORBserverTransportRule "* unix,ssl,tcp,ziop"
+
+  ziop_clt -ORBclientTransportRule "* unix,ssl,tcp,ziop" IOR:...
+

This allows you to enable ZIOP for WAN links, but disable it +for LAN communication, for example.

+ +

6.10.1  Forcing ZIOP Policies

The fact that a server supports ZIOP is encoded in its IORs. This +means that if a client uses a corbaloc URI to reference an +object, the object reference does not contain ZIOP details, and thus +the communication cannot use ZIOP. If a client is absolutely certain +that a server supports ZIOP, it can extend an object reference with +ZIOP details using omniZIOP::setServerPolicies(). Using the new +object reference, the client will be able to make ZIOP calls.

namespace omniZIOP { + CORBA::Object_ptr + setServerPolicies(CORBA::Object_ptr obj, const CORBA::PolicyList& policies); +};

Creating a ZIOP-enabling object reference in this way is dangerous! +If the server does not actually support ZIOP, it will receive +compressed messages that it cannot handle. A well-behaved server will +throw a CORBA::MARSHAL exception in response, or perhaps just +drop the invalid connection.

+ +

6.11  Connection Management Extension

The omniConnectionMgmt library provides an omniORB-specific +extension for application-level connection management. Its purpose is +to allow clients and servers to negotiate private GIOP connections, +and to control how the connections are used in multi-threaded +situations.

The omniConnectionMgmt library has two functions, defined in +include/omniORB4/omniConnectionMgmt.h:

namespace omniConnectionMgmt { + + void init(); + + CORBA::Object_ptr + makeRestrictedReference(CORBA::Object_ptr obj, + CORBA::ULong connection_id, + CORBA::ULong max_connections, + CORBA::ULong max_threads, + CORBA::Boolean data_batch, + CORBA::Boolean permit_interleaved, + CORBA::Boolean server_hold_open); +};

The init() function must be called before +CORBA::ORB_init() in every process that is to take part in the +connection management.

The makeRestrictedReference() function is the single entry-point to +the connection management functionality. It builds an annotated object +reference that contains information for the connection management +system. It returns a new reference, leaving the original object +reference unchanged.

+ +

6.11.1  Client-side parameters

These parameters affect the client side of a connection:

connection_id

This number identifies the private connection set. All object +references with the same connection_id will share the same set +of GIOP connections. Object references with different connection ids +are guaranteed to use different connections from each other, and from +object references that have not been annotated with +makeRestrictedReference().

max_connections

This parameter overrides the omniORB maxGIOPConnectionPerServer +configuration parameter for the given connection_id. It +determines the maximum number of separate GIOP connections that will +be opened to the object’s server to service concurrent calls. It is +common to set this value to 1, indicating that only one connection +will be used for the given connection_id. Note that this +parameter can only be used to reduce the default +maxGIOPConnectionPerServer value, not increase it.

data_batch

omniORB usually configures its TCP connections to disable Nagle’s +algorithm, which batches small messages together into single IP +packages, since that is best for the usual CORBA usage pattern of +two-way requests. Setting this parameter to true overrides that, and +enables Nagle’s algorithm on TCP connections or equivalent +functionality on other transports. This can increase throughput if a +client is sending a large number of small oneway calls.

permit_interleaved

This parameter overrides the oneCallPerConnection configuration +parameter that determines whether multi-threaded clients can +interleave calls on a single connection, issuing a new request message +while a previous request is still waiting for a reply. If +permit_interleaved is true, clients can interleave messages; +if it is false, they cannot.

+ +

6.11.2  Server-side parameters

These parameters affect the client side of a connection:

max_threads

This parameter overrides the global +maxServerThreadPerConnection configuration parameter that +determines the maximum number of concurrent threads the server will +use to service requests coming from a connection. Note that this +parameter is only relevant if either the client permits interleaved +calls, or if oneway operations are used, since those are the only +circumstances under which the server can receive a new request on a +connection while already handling a request. As with the +max_connections client-side parameter, this parameter can only +reduce the default number of threads, not increase it.

server_hold_open

Normally, both clients and servers can decide to close a GIOP +connection at any time. When using normal two-way calls, this is no +problem since if a server closes a connection, the client is +guaranteed to notice it when it waits for a reply, and can retry the +call if necessary. With oneway calls, however, if a server closes a +connection just as the client is sending a request, the client will +not know whether the oneway call was received or not, and the call +will potentially be lost. By setting the server_hold_open +parameter to true, the server will not close the connection, relying +on the client to do so. In that case, oneway calls will not be lost +unless there is a network problem that breaks the GIOP connection.

+ +

6.11.3  Usage

The omniConnectionMgmt extension is very easy to use—simply call the +init() method in all processes involved, then restrict references +as required. The makeRestrictedReference() function adds profile +information to the object reference’s IOR, meaning that the parameters +become part of the object reference and are transmitted along with +it. In other words, a server can create a restricted reference and +send it to a client, and the client will automatically make use of the +restricted parameters when it invokes operations on the object +reference. Alternatively, a client can restrict a normal reference it +receives, in order to change its own behaviour.

+ +
+1
GIOP 1.2 supports +‘bidirectional GIOP’, which permits the rôles to be reversed.
2
Or +CORBA::TRANSIENT if the backwards-compatibility +throwTransientOnTimeout parameter is set to 1.
+ + +

Chapter 7  Interoperable Naming Service

+

omniORB supports the Interoperable Naming Service (INS). The following +is a summary of its facilities.

+ +

7.1  Object URIs

As well as accepting IOR-format strings, ORB::string_to_object() +also supports two Uniform Resource Identifier (URI) [BLFIM98] +formats, which can be used to specify objects in a convenient +human-readable form. IOR-format strings are now also considered URIs.

+ +

7.1.1  corbaloc

corbaloc URIs allow you to specify object references which +can be contacted by IIOP, or found through +ORB::resolve_initial_references(). To specify an IIOP object +reference, you use a URI of the form:

+corbaloc:iiop:<host>:<port>/<object key> +

for example:

+corbaloc:iiop:myhost.example.com:1234/MyObjectKey +

which specifies an object with key ‘MyObjectKey’ within a +process running on myhost.example.com listening on port 1234. Object +keys containing non-ASCII characters can use the standard URI % +escapes:

+corbaloc:iiop:myhost.example.com:1234/My%efObjectKey +

denotes an object key with the value 239 (hex ef) in the +third octet.

The protocol name ‘iiop’ can be abbreviated to the empty +string, so the original URI can be written:

+corbaloc::myhost.example.com:1234/MyObjectKey +

The IANA has assigned port number 28091 for use by corbaloc, so if +the server is listening on that port, you can leave the port number +out. The following two URIs refer to the same object:

+corbaloc::myhost.example.com:2809/MyObjectKey
+corbaloc::myhost.example.com/MyObjectKey +

You can specify an object which is available at more than +one location by separating the locations with commas:

+corbaloc::myhost.example.com,:localhost:1234/MyObjectKey +

Note that you must restate the protocol for each address, +hence the ‘:’ before ‘localhost’. It could +equally have been written ‘iiop:localhost’.

You can also specify an IIOP version number:

+corbaloc::1.2@myhost.example.com/MyObjectKey +

Specifying IIOP versions above 1.0 is slightly risky since +higher versions make use of various information stored in IORs that is +not present in a corbaloc URI. It is generally best to contact initial +corbaloc objects with IIOP 1.0, and rely on higher versions for all +other object references.

+ +

7.1.2  Other transports

The only transport specified in the CORBA standard is iiop, +but omniORB also supports the following extensions:

ssliop

+Equivalent semantics to iiop, but the server is contacted +using SSL / TLS. As with iiop, the address details are of +the form host:port.
omniunix

+The omniORB Unix domain socket transport. The address details are of +the form filename.
+ +

7.1.3  Resolve initial references

A corbaloc: can also specify a call to +resolve_initial_references(). This

orb->string_to_object("corbaloc:rir:/NameService");

is identical in behaviour to

orb->resolve_initial_references("NameService");
+ +

7.1.4  corbaname

+

corbaname URIs cause string_to_object() to look-up a +name in a CORBA Naming service. They are an extension of the +corbaloc syntax:

+corbaname:<corbaloc location>/<object key>#<stringified name> +

for example:

+corbaname::myhost/NameService#project/example/echo.obj
+corbaname:rir:/NameService#project/example/echo.obj +

The object found with the corbaloc-style portion +must be of type CosNaming::NamingContext, or something +derived from it. If the object key (or rir name) is +‘NameService’, it can be left out:

+corbaname::myhost#project/example/echo.obj
+corbaname:rir:#project/example/echo.obj +

The stringified name portion can also be left out, in which +case the URI denotes the CosNaming::NamingContext which would +have been used for a look-up:

+corbaname::myhost.example.com
+corbaname:rir: +

The first of these examples is the easiest way of specifying +the location of a naming service.

+ +

7.2  Configuring resolve_initial_references

+

The INS specifies two standard command line arguments which provide a +portable way of configuring ORB::resolve_initial_references():

+ +

7.2.1  ORBInitRef

-ORBInitRef takes an argument of the form +<ObjectId>=<ObjectURI>. So, for example, +with command line arguments of:

+-ORBInitRef NameService=corbaname::myhost.example.com +

resolve_initial_references("NameService") will +return a reference to the object with key ‘NameService’ available on +myhost.example.com, port 2809. Since IOR-format strings are considered +URIs, you can also say things like:

+-ORBInitRef NameService=IOR:00ff... +
+ +

7.2.2  ORBDefaultInitRef

-ORBDefaultInitRef provides a prefix string which is used to +resolve otherwise unknown names. When +resolve_initial_references() is unable to resolve a name which +has been specifically configured (with -ORBInitRef), it +constructs a string consisting of the default prefix, a ‘/’ +character, and the name requested. The string is then fed to +string_to_object(). So, for example, with a command line of:

+-ORBDefaultInitRef corbaloc::myhost.example.com +

a call to resolve_initial_references("MyService") +will return the object reference denoted by +‘corbaloc::myhost.example.com/MyService’.

Similarly, a corbaname prefix can be used to cause +look-ups in the naming service. Note, however, that since a +‘/’ character is always added to the prefix, it is +impossible to specify a look-up in the root context of the naming +service—you have to use a sub-context, like:

+-ORBDefaultInitRef corbaname::myhost.example.com#services +
+ +

7.3  omniNames

+ +

7.3.1  NamingContextExt

omniNames supports the extended CosNaming::NamingContextExt +interface:

module CosNaming { + interface NamingContextExt : NamingContext { + typedef string StringName; + typedef string Address; + typedef string URLString; + + StringName to_string(in Name n) raises(InvalidName); + Name to_name (in StringName sn) raises(InvalidName); + + exception InvalidAddress {}; + + URLString to_url(in Address addr, in StringName sn) + raises(InvalidAddress, InvalidName); + + Object resolve_str(in StringName n) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + }; +};

to_string() and to_name() convert from CosNaming::Name +sequences to flattened strings and vice-versa. Note that calling +these operations involves remote calls to the naming service, so they +are not particularly efficient. You can use the omniORB specific local +omniURI::nameToString() and omniURI::stringToName() +functions instead.

A CosNaming::Name is stringified by separating name components +with ‘/’ characters. The kind and id fields of +each component are separated by ‘.’ characters. If the +kind field is empty, the representation has no trailing +‘.’; if the id is empty, the representation starts +with a ‘.’ character; if both id and kind +are empty, the representation is just a ‘.’. The backslash +‘\’ is used to escape the meaning of +‘/’, ‘.’ and ‘\’ itself.

to_url() takes a corbaloc style address and key string +(but without the corbaloc: part), and a stringified name, +and returns a corbaname URI (incorrectly called a URL) +string, having properly escaped any invalid characters. The +specification does not make it clear whether or not the address string +should also be escaped by the operation; omniORB does not escape +it. For this reason, it is best to avoid calling to_url() if the +address part contains escapable characters. To avoid remote calls, +omniORB provides the equivalent local function +omniURI::addrAndNameToURI().

resolve_str() is equivalent to calling to_name() followed by +the inherited resolve() operation. There are no string-based +equivalents of the various bind operations.

+ +

7.3.2  Use with corbaname

To make it easy to use omniNames with corbaname URIs, it +starts with the default port of 2809, and an object key of +‘NameService’ for the root naming context.

+ +

7.4  omniMapper

omniMapper is a simple daemon which listens on port 2809 (or any other +port), and redirects IIOP requests for configured object keys to +associated persistent object references. It can be used to make a +naming service (even an old non-INS aware version of omniNames or +other ORB’s naming service) appear on port 2809 with the object key +‘NameService’. The same goes for any other service you may +wish to specify, such as an interface repository. omniMapper is +started with a command line of:

+omniMapper [-port <port>] [-config <config file>] [-v] +

The -port option allows you to choose a port other +than 2809 to listen on. The -config option specifies a +location for the configuration file. The default name is +/etc/omniMapper.cfg, or C:\omniMapper.cfg on +Windows. omniMapper does not normally print anything; the -v +option makes it verbose so it prints configuration information and a +record of the redirections it makes, to standard output.

The configuration file is very simple. Each line contains a string to +be used as an object key, some white space, and an IOR (or any valid +URI) that it will redirect that object key to. Comments should be +prefixed with a ‘#’ character. For example:

+
# Example omniMapper.cfg
+NameService         IOR:000f...
+InterfaceRepository IOR:0100...
+

omniMapper can either be run on a single machine, in much the same way +as omniNames, or it can be run on every machine, with a common +configuration file. That way, each machine’s omniORB configuration +file could contain the line:

+
ORBDefaultInitRef corbaloc::localhost
+
+ +

7.5  Creating objects with simple object keys

In normal use, omniORB creates object keys containing various +information including POA names and various non-ASCII characters. +Since object keys are supposed to be opaque, this is not usually a +problem. The INS breaks this opacity and requires servers to create +objects with human-friendly keys.

If you wish to make your objects available with human-friendly URIs, +there are two options. The first is to use omniMapper as described +above, in conjunction with a PERSISTENT POA. The second is to +create objects with the required keys yourself. You do this with a +special POA with the name ‘omniINSPOA’, acquired from +resolve_initial_references(). This POA has the USER_ID +and PERSISTENT policies, and the special property that the +object keys it creates contain only the object ids given to the POA, +and no other data. It is a normal POA in all other respects, so you +can activate/deactivate it, create children, and so on, in the usual +way.

Children of the omniINSPOA do not inherit its special properties of +creating simple object keys. If the omniINSPOA’s policies are not +suitable for your application, you cannot create a POA with different +policies (such as single threading, for example), and still generate +simple object keys. Instead, you can activate a servant in the +omniINSPOA that uses location forwarding to redirect requests to +objects in a different POA.

+ +
+1
Not 2089 as +printed in [OMG00]!
- -

Chapter 9  Code set conversion

-

omniORB supports full code set negotiation, used to select and -translate between different character code sets, for the transmission -of chars, strings, wchars and wstrings. The support is mostly -transparent to application code, but there are a number of options -that can be selected. This chapter covers the options, and also gives -some pointers about how to implement your own code sets, in case the -ones that come with omniORB are not sufficient.

-

9.1  Native code sets

For the ORB to know how to handle strings and wstrings given to it by + +

Chapter 8  Code set conversion

+

omniORB supports full code set negotiation, used to select and +translate between different character code sets when transmitting +chars, strings, wchars and wstrings. The support is mostly transparent +to application code, but there are a number of options that can be +selected. This chapter covers the options, and also gives some +pointers about how to implement your own code sets, in case the ones +that come with omniORB are not sufficient.

+ +

8.1  Native code sets

For the ORB to know how to handle strings and wstrings given to it by the application, it must know what code set they are represented with, so it can properly translate them if need be. The defaults are ISO 8859-1 (Latin 1) for char and string, and UTF-16 for wchar and wstring. Different code sets can be chosen at initialisation time with -the nativeCharCodeSet and nativeWCharCodeSet +the nativeCharCodeSet and nativeWCharCodeSet parameters. The supported code sets are printed out at initialisation -time if the ORB traceLevel is 15 or greater.

For most applications, the defaults are fine. Some applications may +time if the ORB traceLevel is 15 or greater.

For most applications, the defaults are fine. Some applications may need to set the native char code set to UTF-8, allowing the full -Unicode range to be supported in strings.

Note that the default for wchar is always UTF-16, even on Unix +Unicode range to be supported in strings.

Note that the default for wchar is always UTF-16, even on Unix platforms where wchar is a 32-bit type. Select the UCS-4 code set to select characters outside the first plane without having to use UTF-16 -surrogates1.

-

9.2  Code set library

To save space in the main ORB core library, most of the code set +surrogates1.

+ +

8.2  Default code sets

The way code set conversion is meant to work in CORBA communication is +that each client and server has a native code set that it uses +for character data in application code, and supports a number of +transmission code sets that is uses for communication. When a +client connects to a server, the client picks one of the server’s +transmission code sets to use for the interaction. For that to work, +the client plainly has to know the server’s supported transmission +code sets.

Code set information from servers is embedded in IORs. A client with +an IOR from a server should therefore know what transmission code sets +the server supports. This approach can fail for two reasons:

  1. +A corbaloc URI (see chapter 7) does +not contain any code set information.
  2. Some badly-behaved servers that do support code set conversion +fail to put codeset information in their IORs. +

The CORBA standard says that if a server has not specified +transmission code set information, clients must assume that they only +support ISO-8859-1 for char and string, and do not support wchar and +wstring at all. The effect is that client code receives +DATA_CONVERSION or BAD_PARAM exceptions.

To avoid this issue, omniORB allows you to configure default +code sets that are used as a server’s transmission code sets if they +are not otherwise known. Set defaultCharCodeSet for char and +string data, and defaultWCharCodeSet for wchar and wstring data.

+ +

8.3  Code set library

To save space in the main ORB core library, most of the code set implementations are in a separate library named omniCodeSets4. To use the extra code sets, you must link your application with that library. On most platforms, if you are using dynamic linking, @@ -3222,24 +3519,25 @@ to have it initialised, and for the code sets to be available. With static linking, or platforms with less intelligent dynamic linkers, you must force the linker to initialise the library. You do that by -including the omniORB4/optionalFeatures.h header. By default, +including the omniORB4/optionalFeatures.h header. By default, that header enables several optional features. Look at the file -contents to see how to turn off particular features.

-

9.3  Implementing new code sets

It is quite easy to implement new code sets, if you need support for +contents to see how to turn off particular features.

+ +

8.4  Implementing new code sets

It is quite easy to implement new code sets, if you need support for code sets (or marshalling formats) that do not come with the omniORB distribution. There are extensive comments in the headers and ORB code that explain how to implement a code set; this section just serves to -point you in the right direction.

The main definitions for the code set support are in -include/omniORB4/codeSets.h. That defines a set of base classes +point you in the right direction.

The main definitions for the code set support are in +include/omniORB4/codeSets.h. That defines a set of base classes use to implement code sets, plus some derived classes that use look-up -tables to convert simple 8-bit and 16-bit code sets to Unicode.

When sending or receiving string data, there are a total of four code +tables to convert simple 8-bit and 16-bit code sets to Unicode.

When sending or receiving string data, there are a total of four code sets in action: a native char code set, a transmission char code set, a native wchar code set, and a transmission wchar code set. The native code sets are as described above; the transmission code sets are the ones selected to communicate with a remote machine. They are responsible for understanding the GIOP marshalling formats, as well as the code sets themselves. Each of the four code sets has an object -associated with it which contains methods for converting data.

There are two ways in which a string/wstring can be transmitted or +associated with it which contains methods for converting data.

There are two ways in which a string/wstring can be transmitted or received. If the transmission code set in action knows how to deal directly with the native code set (the trivial case being that they are the same code set, but more complex cases are possible too), the @@ -3248,729 +3546,453 @@ set does not know how to handle the native code set, it converts the string/wstring into UTF-16, and passes that to the native code set object (or vice-versa). All code set implementations must therefore -know how to convert to and from UTF-16.

With this explanation, the classes in codeSets.h should be easy +know how to convert to and from UTF-16.

With this explanation, the classes in codeSets.h should be easy to understand. The next place to look is in the various existing code -set implementations, which are files of the form cs-*.cc in the -src/lib/omniORB/orbcore and src/lib/omniORB/codesets. +set implementations, which are files of the form cs-*.cc in the +src/lib/omniORB/orbcore and src/lib/omniORB/codesets. Note how all the 8-bit code sets (the ISO 8859-* family) consist -entirely of data and no code, since they are driven by look-up tables.

-
-1
If you have no idea what this means, don’t -worry—you’re better off not knowing unless you really have -to. -
+entirely of data and no code, since they are driven by look-up tables.

+ +
+1
If you have no idea what this means, don’t +worry—you’re better off not knowing unless you really have +to.
- -

Chapter 10  Interceptors

-

omniORB supports interceptors that allow the application to insert + +

Chapter 9  Interceptors

+

omniORB supports interceptors that allow the application to insert processing in various points along the call chain, and in various other locations. It does not (yet) support the standard Portable -Interceptors API.

The interceptor interfaces are defined in a single header, -include/omniORB4/omniInterceptors.h. Each interception point -consists of a singleton object with add() and remove() methods, -and the definition of an ‘interceptor info’ class. For example:

class omniInterceptors { - ... - class clientSendRequest_T { - public: - - class info_T { - public: - GIOP_C& giop_c; - IOP::ServiceContextList service_contexts; - - info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} - - private: - info_T(); - info_T(const info_T&); - info_T& operator=(const info_T&); - }; - - typedef CORBA::Boolean (*interceptFunc)(info_T& info); - - void add(interceptFunc); - void remove(interceptFunc); - }; - ... -};

You can see that the interceptors themselves are functions -that take the info_T object as their argument and return +Interceptors API.

The interceptor interfaces are defined in a single header, +include/omniORB4/omniInterceptors.h. Each interception point +consists of a singleton object with add() and remove() methods, +and the definition of an ‘interceptor info’ class. For example:

class omniInterceptors { + ... + class clientSendRequest_T { + public: + + class info_T { + public: + GIOP_C& giop_c; + IOP::ServiceContextList service_contexts; + + info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} + + private: + info_T(); + info_T(const info_T&); + info_T& operator=(const info_T&); + }; + + typedef CORBA::Boolean (*interceptFunc)(info_T& info); + + void add(interceptFunc); + void remove(interceptFunc); + }; + ... +};

You can see that the interceptors themselves are functions +that take the info_T object as their argument and return boolean. Interceptors are called in the order they are registered; -normally, all interceptor functions return true, meaning that +normally, all interceptor functions return true, meaning that processing should continue with subsequent interceptors. If an -interceptor returns false, later interceptors are not called. You -should only do that if you really know what you are doing.

Notice that the info_T contains references to omniORB internal +interceptor returns false, later interceptors are not +called. You should only do that if you really know what you are doing.

Notice that the info_T contains references to omniORB internal data types. The definitions of these types can be found in other -header files within include/omniORB4 and -include/omniORB4/internal.

-

10.1  Interceptor registration

All the interceptor singletons are registered within another singleton -object of class omniInterceptors. You retrieve a pointer to the -object with the omniORB::getInterceptors() function, which +header files within include/omniORB4 and +include/omniORB4/internal.

+ +

9.1  Interceptor registration

All the interceptor singletons are registered within another singleton +object of class omniInterceptors. You retrieve a pointer to the +object with the omniORB::getInterceptors() function, which must be called after the ORB has been initialised with -CORBA::ORB_init(), but before the ORB is used. The code to -register an interceptor looks, for example, like:

omniInterceptors* interceptors = omniORB::getInterceptors(); -interceptors->clientSendRequest.add(myInterceptorFunc);
-

10.2  Available interceptors

The following interceptors are available:

encodeIOR

+CORBA::ORB_init(), but before the ORB is used. The code to +register an interceptor looks, for example, like:

omniInterceptors* interceptors = omniORB::getInterceptors(); +interceptors->clientSendRequest.add(myInterceptorFunc);
+ +

9.2  Available interceptors

The following interceptors are available:

encodeIOR

Called when encoding an IOR to represent an object reference. This interception point allows the application to insert extra profile components into IORs. Note that you must understand and adhere to the rules about data stored in IORs, otherwise the IORs created may be invalid. omniORB itself uses this interceptor to insert various items, so you can see an example of its use in the -insertSupportedComponents() function defined in -src/lib/omniORB/orbcore/ior.cc.
decodeIOR

+insertSupportedComponents() function defined in +src/lib/omniORB/orbcore/ior.cc.
decodeIOR

Called when decoding an IOR. The application can use this to get out whatever information they put into IORs with encodeIOR. Again, see -extractSupportedComponents() in -src/lib/omniORB/orbcore/ior.cc for an example.
clientOpenConnection

+extractSupportedComponents() in +src/lib/omniORB/orbcore/ior.cc for an example.
clientOpenConnection

Called as a client opens a new connection to a server, after the connection is opened but before it is used to send a request. The -interceptor function can set the info_T’s reject member -to true to cause the client to immediately close the new connection -and throw CORBA::TRANSIENT to the calling code. In that case, the -interceptor function can also set the why member to provide a -message that is logged.
clientSendRequest

+interceptor function can set the info_T’s reject member +to true to cause the client to immediately close the new +connection and throw CORBA::TRANSIENT to the calling code. In that +case, the interceptor function can also set the why member to +provide a message that is logged.
clientSendRequest

Called just before a request header is sent over the network. The application can use it to insert service contexts in the header. See -setCodeSetServiceContext() in -src/lib/omniORB/orbcore/cdrStream.cc for an example of its use.
clientReceiveReply

+the setCodeSetServiceContext() function in +src/lib/omniORB/orbcore/cdrStream.cc for an example of its use.
clientReceiveReply

Called as the client receives a reply, just after unmarshalling the -reply header. Called for normal replies and exceptions.
serverAcceptConnection

-Called when a server accepts a new incoming connection, but before -it reads any data from it. The interceptor function can set the -info_T’s reject member to true to cause the server to -immediately close the new connection. In that case, the interceptor -function can also set the why member to provide a message -that is logged.
serverReceiveRequest

+reply header. Called for normal replies and exceptions.
serverAcceptConnection

+Called when a server accepts a new incoming connection, but before it +reads any data from it. The interceptor function can set the +info_T’s reject member to true to cause the +server to immediately close the new connection. In that case, the +interceptor function can also set the why member to provide a +message that is logged.
serverReceiveRequest

Called when the server receives a request, just after unmarshalling -the request header. See the getCodeSetServiceContext() function in -src/lib/omniORB/orbcore/cdrStream.cc for an example.
serverSendReply

-Called just before the server marshals a reply header.
serverSendException

-Called just before the server marshals an exception reply header.
createIdentity

+the request header. See the getCodeSetServiceContext() function in +src/lib/omniORB/orbcore/cdrStream.cc for an example.
serverSendReply

+Called just before the server marshals a reply header.
serverSendException

+Called just before the server marshals an exception reply header.
createRope

+Called when the ORB is about to create a ‘rope’ that encapsulates a +bundle of connections (‘strands’) to a remote address space. It allows +application code to override omniORB’s normal connection management.
createIdentity

Called when the ORB is about to create an ‘identity’ object to represent a CORBA object. It allows application code to provide its own identity implementations. It is very unlikely that an application -will need to do this.
createORBServer

+will need to do this.
createORBServer

Used internally by the ORB to register different kinds of server. At present, only a GIOP server is registered. It is very unlikely that -application code will need to do this.
createThread

-Called whenever the ORB creates a thread. The info_T class for -this interceptor is
class info_T { - public: - virtual void run() = 0; - };

The interceptor function is called in the context of the newly created -thread. The function must call the info_T’s run() -method, to pass control to the thread body. run() returns just -before the thread exits. This arrangement allows the interceptor to -initialise some per-thread state before the thread body runs, then -release it just before the thread exits.

assignUpcallThread

+application code will need to do this.
createThread

+Called whenever the ORB creates a thread. The info_T class for +this interceptor is
class info_T { + public: + virtual void run() = 0; + virtual omni_thread* self() = 0; + };

The interceptor is called in the context of the newly created thread. +The function must call the info_T’s run() method, to +pass control to the thread body. run() returns just before the +thread exits. This arrangement allows the interceptor to initialise +some per-thread state before the thread body runs, then release it +just before the thread exits.

The info_T’s self() method returns a pointer to the +omni_thread object for the thread, equivalent to calling +omni_thread::self().

assignUpcallThread

The ORB maintains a general thread pool, from which threads are drawn for various purposes. One purpose is for performing upcalls to application code, in response to incoming CORBA calls. The -assignUpcallThread interceptor is called when a thread is assigned to -perform upcalls. In the thread per connection model, the thread stays -assigned to performing upcalls for the entire lifetime of the -underlying network connection; in the thread pool model, threads are -assigned for upcalls on a per call basis, so this interceptor is -triggered for every incoming call1. As with the -createThread interceptor, the interceptor function must call the -info_T’s run() method to pass control to the upcall.

When a thread finishes its assignment of processing upcalls, it +assignUpcallThread interceptor is called when a thread is +assigned to perform upcalls. In the thread per connection model, the +thread stays assigned to performing upcalls for the entire lifetime of +the underlying network connection; in the thread pool model, threads +are assigned for upcalls on a per call basis, so this interceptor is +triggered for every incoming call1. As with the createThread interceptor, the +interceptor function must call the info_T’s run() method to +pass control to the upcall.

When a thread finishes its assignment of processing upcalls, it returns to the pool (even in thread per connection mode), so the same thread can be reassigned to perform more upcalls, or reused for a -different purpose.

Unlike the other interceptors, the interceptor functions for -createThread and assignUpcallThread have no return value. Interceptor -chaining is performed by calls through the info_T::run() method, -rather than by visiting interceptor functions in turn.

-
-1
Except that with the -threadPoolWatchConnection parameter set true, a thread can perform -multiple upcalls even when thread pool mode is active. -
+different purpose.

assignAMIThread

+Asynchronous Method Invocation (AMI) uses threads to perform outgoing +calls. The assignAMIThread interceptor is called when a thread +is assigned to perform AMI calls. As with the other thread +interceptors, the interceptor function must call the info_T’s +run() method to pass control to the AMI call.

Unlike the other interceptors, the interceptor functions for +createThread, assignUpcallThread and +assignAMIThread have no return values. Interceptor chaining is +performed by calls through the info_T::run() method, rather than +by visiting interceptor functions in turn.

+ +

9.3  Server-side call interceptor

Calls can be intercepted on the server just before the upcall into +application code. This interceptor is registered with omniORB’s +callDescriptor class, which is responsible for encapsulating +the state of a call. Unlike the transport-related +serverReceiveRequest, serverSendReply and +serverSendException interceptors, the callDescriptor +interceptor is invoked for all calls, even ones from colocated +clients in the same address space.

The types used for the call interceptor are defined in +include/omniORB4/callDescriptor.h. The interceptor takes the +form of a bare function with two parameters. The first parameter is a +pointer to the callDescriptor; the second is a pointer to +omniServant, which is the base class of all servant +classes. The interceptor function must call the +callDescriptor’s interceptedCall() method to pass on the +call.

This interception point allows access to various parts of omniORB’s +call machinery. The callDescriptor includes access to the +operation name and, if cast to the concrete subclass defined by the +IDL compiler, the call arguments and return values too.

+ +
+1
Except that with the +threadPoolWatchConnection parameter set true, a thread +can perform multiple upcalls even when thread pool mode is +active.
- -

Chapter 11  Type Any and TypeCode

-

The CORBA specification provides for a type that can hold the value of -any OMG IDL type. This type is known as type Any. The OMG also -specifies a pseudo-object, TypeCode, that can encode a description of -any type specifiable in OMG IDL.

In this chapter, an example demonstrating the use of type Any is -presented. This is followed by sections describing the behaviour of -type Any and TypeCode in omniORB. For further information on type -Any, refer to the C++ Mapping specification., and for more information -on TypeCode, refer to the Interface Repository chapter in the CORBA -core section of the CORBA specification.

-

11.1  Example using type Any

Before going through this example, you should make sure that you have -read and understood the examples in chapter 2. The -source code for this example is included in the omniORB distribution, -in the directory src/examples/anyExample. A listing of the -source code is provided at the end of this chapter.

-

11.1.1  Type Any in IDL

+ +

Chapter 10  Type Any and TypeCode

+

The CORBA specification provides for a type that can hold the value of +any OMG IDL type. This type is known as type Any. The OMG also +specifies a pseudo-object, TypeCode, that can encode a +description of any type specifiable in OMG IDL.

In this chapter, an example demonstrating the use of type Any is +presented. The example code is in the src/examples/anyExample +directory in the omniORB distribution. The example is followed by +sections describing the behaviour of type Any and TypeCode in omniORB. +For further information on type Any, refer to the C++ Mapping +specification., and for more information on TypeCode, refer to the +Interface Repository chapter in the CORBA core section of the CORBA +specification.

+ +

10.1  Example using type Any

Before going through this example, you should make sure that you have +read and understood the examples in chapter 2.

+ +

10.1.1  Type Any in IDL

Type Any allows one to delay the decision on the type used in an operation until run-time. To use type any in IDL, use the keyword -any, as in the following example:

// IDL -interface anyExample { - any testOp(in any mesg); -};

The operation testOp()() in this example can now take any +any, as in the following example:

// IDL +interface anyExample { + any testOp(in any mesg); +};

The operation testOp() in this example can now take any value expressible in OMG IDL as an argument, and can also return any -type expressible in OMG IDL.

Type Any is mapped into C++ as the type CORBA::Any. When passed +type expressible in OMG IDL.

Type Any is mapped into C++ as the type CORBA::Any. When passed as an argument or as a result of an operation, the following rules -apply:

- - -
In InOut Out Return
const CORBA::Any& CORBA::Any& CORBA::Any*& CORBA::Any*

So, the above IDL would map to the following C++:

// C++ - -class anyExample_i : public virtual POA_anyExample { -public: - anyExample_i() { } - virtual ~anyExample_i() { } - virtual CORBA::Any* testOp(const CORBA::Any& a); -};
-

11.1.2  Inserting and Extracting Basic Types from an Any

The question now arises as to how values are inserted into and removed +apply:

+ + +
In InOut Out Return
const CORBA::Any& CORBA::Any& CORBA::Any*& CORBA::Any* +

So, the above IDL would map to the following C++:

// C++ + +class anyExample_i : public virtual POA_anyExample { +public: + anyExample_i() { } + virtual ~anyExample_i() { } + virtual CORBA::Any* testOp(const CORBA::Any& a); +};
+ +

10.1.2  Inserting and Extracting Basic Types from an Any

The question now arises as to how values are inserted into and removed from an Any. This is achieved using two overloaded operators: -<<= and >>=.

To insert a value into an Any, the <<= operator is used, as -in this example:

// C++ -CORBA::Any an_any; -CORBA::Long l = 100; -an_any <<= l;

Note that the overloaded <<= operator has a return -type of void.

To extract a value, the >>= operator is used, as in this -example (where the Any contains a long):

// C++ -CORBA::Long l; -an_any >>= l; - -cout << "This is a long: " << l << endl;

The overloaded >>= operator returns a CORBA::Boolean. +<<= and >>=.

To insert a value into an Any, the <<= operator is used, as +in this example:

// C++ +CORBA::Any an_any; +CORBA::Long l = 100; +an_any <<= l;

Note that the overloaded <<= operator has a return +type of void.

To extract a value, the >>= operator is used, as in this +example (where the Any contains a long):

// C++ +CORBA::Long l; +an_any >>= l; + +cout << "This is a long: " << l << endl;

The overloaded >>= operator returns a CORBA::Boolean. If an attempt is made to extract a value from an Any when it contains a different type of value (e.g. an attempt to extract a long from an -Any containing a double), the overloaded >>= operator will -return False; otherwise it will return True. Thus, a common tactic to -extract values from an Any is as follows:

// C++ -CORBA::Long l; -CORBA::Double d; -const char* str; - -if (an_any >>= l) { - cout << "Long: " << l << endl; -} -else if (an_any >>= d) { - cout << "Double: " << d << endl; -} -else if (an_any >>= str) { - cout << "String: " << str << endl; - // The storage of the extracted string is still owned by the any. -} -else { - cout << "Unknown value." << endl; -}
-

11.1.3  Inserting and Extracting Constructed Types from an Any

It is also possible to insert and extract constructed types and object +Any containing a double), the overloaded >>= operator will +return false; otherwise it will return true. Thus, a +common tactic to extract values from an Any is as follows:

// C++ +CORBA::Long l; +CORBA::Double d; +const char* str; + +if (an_any >>= l) { + cout << "Long: " << l << endl; +} +else if (an_any >>= d) { + cout << "Double: " << d << endl; +} +else if (an_any >>= str) { + cout << "String: " << str << endl; + // The storage of the extracted string is still owned by the any. +} +else { + cout << "Unknown value." << endl; +}
+ +

10.1.3  Inserting and Extracting Constructed Types from an Any

It is also possible to insert and extract constructed types and object references from an Any. omniidl will generate insertion and extraction operators for the constructed type. Note that it is necessary to -specify the -WBa command-line flag when running omniidl in +specify the -Wba command-line flag when running omniidl in order to generate these operators. The following example illustrates -the use of constructed types with type Any:

// IDL -struct testStruct { - long l; - short s; -}; - -interface anyExample { - any testOp(in any mesg); -};

Upon compiling the above IDL with omniidl -bcxx -Wba, the -following overloaded operators are generated:

  1. -void operator<<=(CORBA::Any&, const testStruct&) -
  2. void operator<<=(CORBA::Any&, testStruct*) -
  3. CORBA::Boolean operator>>=(const CORBA::Any&,
    - const testStruct*&) -

Operators of this form are generated for all constructed types, and -for interfaces.

The first operator, (1), copies the constructed type, and -inserts it into the Any. The second operator, (2), inserts the +the use of constructed types with type Any:

// IDL +struct testStruct { + long l; + short s; +}; + +interface anyExample { + any testOp(in any mesg); +};

Upon compiling the above IDL with omniidl -bcxx -Wba, the +following overloaded operators are generated:

  1. +void operator<<=(CORBA::Any&, const testStruct&) +
  2. void operator<<=(CORBA::Any&, testStruct*) +
  3. CORBA::Boolean operator>>=(const CORBA::Any&,
    + const testStruct*&) +

Operators of this form are generated for all constructed types, and +for interfaces.

The first operator, (1), copies the constructed type, and +inserts it into the Any. The second operator, (2), inserts the constructed type into the Any, and then manages it. Note that if the second operator is used, the Any consumes the constructed type, and the caller should not use the pointer to access the data after insertion. The following is an example of how to insert a value into -an Any using operator (1):

// C++ -CORBA::Any an_any; - -testStruct t; -t.l = 456; -t.s = 8; - -an_any <<= t;

The third operator, (3), is used to extract the constructed -type from the Any, and can be used as follows:

const testStruct* tp; - -if (an_any >>= tp) { - cout << "testStruct: l: " << tp->l << endl; - cout << " s: " << tp->s << endl; -} -else { - cout << "Unknown value contained in Any." << endl; -}

As with basic types, if an attempt is made to extract a type from an +an Any using operator (1):

// C++ +CORBA::Any an_any; + +testStruct t; +t.l = 456; +t.s = 8; + +an_any <<= t;

The third operator, (3), is used to extract the constructed +type from the Any, and can be used as follows:

const testStruct* tp; + +if (an_any >>= tp) { + cout << "testStruct: l: " << tp->l << endl; + cout << " s: " << tp->s << endl; +} +else { + cout << "Unknown value contained in Any." << endl; +}

As with basic types, if an attempt is made to extract a type from an Any that does not contain a value of that type, the extraction -operator returns False. If the Any does contain that type, the -extraction operator returns True. If the extraction is successful, the -caller’s pointer will point to memory managed by the Any. The caller -must not delete or otherwise change this storage, and should not use -this storage after the contents of the Any are replaced (either by -insertion or assignment), or after the Any has been destroyed. In -particular, management of the pointer should not be assigned to a -_var type.

If the extraction fails, the caller’s pointer will be set to point to -null.

Note that there are special rules for inserting and extracting arrays -(using the _forany types), and for inserting and extracting +operator returns false. If the Any does contain that type, the +extraction operator returns true. If the extraction is +successful, the caller’s pointer will point to memory managed by the +Any. The caller must not delete or otherwise change this storage, and +should not use this storage after the contents of the Any are replaced +(either by insertion or assignment), or after the Any has been +destroyed. In particular, management of the pointer should not be +assigned to a _var type.

If the extraction fails, the caller’s pointer will be set to point to +null.

Note that there are special rules for inserting and extracting arrays +(using the _forany types), and for inserting and extracting bounded strings, booleans, chars, and octets. Please refer to the C++ -Mapping specification for further information.

-

11.2  Type Any in omniORB

-

This section contains some notes on the use and behaviour of type Any -in omniORB.

-

11.2.1  Generating Insertion and Extraction Operators.

+Mapping specification for further information.

+ +

10.2  Type Any in omniORB

+

This section contains some notes on the use and behaviour of type Any +in omniORB.

+ +

10.2.1  Generating Insertion and Extraction Operators.

To generate type Any insertion and extraction operators for -constructed types and interfaces, the -Wba command line flag -should be specified when running omniidl.

-

11.2.2  TypeCode comparison when extracting from an Any.

+constructed types and interfaces, the -Wba command line flag +should be specified when running omniidl.

+ +

10.2.2  TypeCode comparison when extracting from an Any.

When an attempt is made to extract a type from an Any, the TypeCode of -the type is checked for equivalence with the TypeCode of the -type stored by the Any. The equivalent() test in the TypeCode -interface is used for this purpose.

Examples:

// IDL 1 -typedef double Double1; - -struct Test1 { - Double1 a; -};
// IDL 2 -typedef double Double2; - -struct Test1 { - Double2 a; -};

If an attempt is made to extract the type Test1 defined in IDL -1 from an Any containing the Test1 defined in IDL 2, this will -succeed (and vice-versa), as the two types differ only by an alias.

-

11.2.3  Top-level aliases.

+the type is checked for equivalence with the TypeCode of the +type stored by the Any. The equivalent() test in the TypeCode +interface is used for this purpose. For example:

// IDL 1 +typedef double Double1; + +struct Test1 { + Double1 a; +};
// IDL 2 +typedef double Double2; + +struct Test1 { + Double2 a; +};

If an attempt is made to extract the type Test1 defined in IDL +1 from an Any containing the Test1 defined in IDL 2, this will +succeed (and vice-versa), as the two types differ only by an alias.

+ +

10.2.3  Top-level aliases.

When a type is inserted into an Any, the Any stores both the value of the type and the TypeCode for that type. However, in some cases, a top-level alias can be lost due to the details of the C++ mapping. For -example, consider these IDL definitions:

// IDL 3 -typedef sequence<double> seqDouble1; -typedef sequence<double> seqDouble2; -typedef seqDouble2 seqDouble3;

omniidl generates distinct types for seqDouble1 and -seqDouble2, and therefore each has its own set of C++ operators +example, consider these IDL definitions:

// IDL 3 +typedef sequence<double> seqDouble1; +typedef sequence<double> seqDouble2; +typedef seqDouble2 seqDouble3;

omniidl generates distinct types for seqDouble1 and +seqDouble2, and therefore each has its own set of C++ operators for Any insertion and extraction. That means inserting a -seqDouble1 into an Any sets the Any’s TypeCode to include the -alias ‘seqDouble1’, and inserting a seqDouble2 sets the -TypeCode to the alias ‘seqDouble2’.

However, in the C++ mapping, seqDouble3 is required to be just -a C++ typedef to seqDouble2, so the C++ compiler uses the Any -insertion operator for seqDouble2. Therefore, inserting a -seqDouble3 sets the Any’s TypeCode to the seqDouble2 +seqDouble1 into an Any sets the Any’s TypeCode to include the +alias ‘seqDouble1’, and inserting a seqDouble2 sets the +TypeCode to the alias ‘seqDouble2’.

However, in the C++ mapping, seqDouble3 is required to be just +a C++ typedef to seqDouble2, so the C++ compiler uses the Any +insertion operator for seqDouble2. Therefore, inserting a +seqDouble3 sets the Any’s TypeCode to the seqDouble2 alias. If this is not desirable, you can use the member function -‘void type(TypeCode_ptr)’ of the Any interface to explicitly -set the TypeCode to the correct one.

-

11.2.4  Removing aliases from TypeCodes.

+‘void type(TypeCode_ptr)’ of the Any interface to explicitly +set the TypeCode to the correct one.

+ +

10.2.4  Removing aliases from TypeCodes.

Some ORBs (such as old versions of Orbix) will not accept TypeCodes -containing tk_alias TypeCodes. When using type Any while +containing tk_alias TypeCodes. When using type Any while interoperating with these ORBs, it is necessary to remove -tk_alias TypeCodes from throughout the TypeCode representing a -constructed type.

To remove all tk_alias TypeCodes from TypeCodes transmitted in -Anys, supply the -ORBtcAliasExpand 1 command-line flag when +tk_alias TypeCodes from throughout the TypeCode representing a +constructed type.

To remove all tk_alias TypeCodes from TypeCodes transmitted in +Anys, supply the -ORBtcAliasExpand 1 command-line flag when running an omniORB executable. There will be some (small) performance -penalty when transmitting Any values.

Note that the _tc_ TypeCodes generated for all constructed +penalty when transmitting Any values.

Note that the _tc_ TypeCodes generated for all constructed types will contain the complete TypeCode for the type (including any -tk_alias TypeCodes), regardless of whether the --ORBtcAliasExpand flag is set to 1 or not. It is only when -Anys are transmitted that the aliases are stripped.

-

11.2.5  Recursive TypeCodes.

+tk_alias TypeCodes), regardless of whether the +-ORBtcAliasExpand flag is set to 1 or not. It is only when +Anys are transmitted that the aliases are stripped.

+ +

10.2.5  Recursive TypeCodes.

omniORB supports recursive TypeCodes. This means that types such as -the following can be inserted or extracted from an Any:

// IDL 4 -struct Test4 { - sequence<Test4> a; -};
-

11.2.6  Threads and type Any.

+the following can be inserted or extracted from an Any:

// IDL 4 +struct Test4 { + sequence<Test4> a; +};
+ +

10.2.6  Threads and type Any.

Inserting and extracting simultaneously from the same Any (in 2 -different threads) results in undefined behaviour.

In versions of omniORB before 4.0, extracting simultaneously from the +threads) results in undefined behaviour.

In versions of omniORB before 4.0, extracting simultaneously from the same Any (in 2 or more different threads) also led to undefined behaviour. That is no longer the case—Any extraction is now thread -safe.

-

11.3  TypeCode in omniORB

This section contains some notes on the use and behaviour of TypeCode -in omniORB

-

11.3.1  TypeCodes in IDL.

When using TypeCodes in IDL, note that they are defined in the CORBA -scope. Therefore, CORBA::TypeCode should be used. Example:

// IDL 5 -struct Test5 { - long length; - CORBA::TypeCode desc; -};
-

11.3.2  orb.idl

The CORBA specification says that IDL using CORBA::TypeCode -must include the file orb.idl. That is not required in omniORB, -but a suitable orb.idl is available.

-

11.3.3  Generating TypeCodes for constructed types.

To generate a TypeCode for constructed types, specify the --Wba command-line flag when running omniidl. This will -generate a _tc_ TypeCode describing the type, at the same -scope as the type. Example:

// IDL 6 -struct Test6 { - double a; - sequence<long> b; -};

A TypeCode, _tc_Test6, will be generated to describe the -struct Test6. The operations defined in the TypeCode interface -can be used to query the TypeCode about the type it represents.

-

11.4  Source Listing

-

11.4.1  anyExample_impl.cc

// anyExample_impl.cc - This is the source code of the example used in -// Chapter 9 "Type Any and TypeCode" of the omniORB -// users guide. -// -// This is the object implementation. -// -// Usage: anyExample_impl -// -// On startup, the object reference is printed to cout as a -// stringified IOR. This string should be used as the argument to -// anyExample_clt. -// - -#include <anyExample.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - -class anyExample_i : public POA_anyExample { -public: - inline anyExample_i() {} - virtual ~anyExample_i() {} - virtual CORBA::Any* testOp(const CORBA::Any& a); -}; - - -CORBA::Any* anyExample_i::testOp(const CORBA::Any& a) -{ - cout << "Any received, containing: " << endl; - -#ifndef NO_FLOAT - CORBA::Double d; -#endif - - CORBA::Long l; - const char* str; - - testStruct* tp; - - - if (a >>= l) { - cout << "Long: " << l << endl; - } -#ifndef NO_FLOAT - // XXX - should we provide stream ops for _CORBA_Double_ and - // _CORBA_Float_on VMS?? - else if (a >>= d) { - cout << "Double: " << (double)d << endl; - } -#endif - else if (a >>= str) { - cout << "String: " << str << endl; - } - else if (a >>= tp) { - cout << "testStruct: l: " << tp->l << endl; - cout << " s: " << tp->s << endl; - } - else { - cout << "Unknown value." << endl; - } - - CORBA::Any* ap = new CORBA::Any; - - *ap <<= (CORBA::ULong) 314; - - cout << "Returning Any containing: ULong: 314\n" << endl; - return ap; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - anyExample_i* myobj = new anyExample_i(); - - PortableServer::ObjectId_var myobjid = poa->activate_object(myobj); - - obj = myobj->_this(); - CORBA::String_var sior(orb->object_to_string(obj)); - cout << (char*)sior << endl; - - myobj->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - orb->destroy(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}
-

11.4.2  anyExample_clt.cc

// anyExample_clt.cc - This is the source code of the example used in -// Chapter 9 "Type Any and TypeCode" of the omniORB -// users guide. -// -// This is the client. -// -// Usage: anyExample_clt <object reference> -// - -#include <anyExample.hh> - -#ifdef HAVE_STD -# include <iostream> - using namespace std; -#else -# include <iostream.h> -#endif - - -static void invokeOp(anyExample_ptr& tobj, const CORBA::Any& a) -{ - CORBA::Any_var bp; - - cout << "Invoking operation." << endl; - bp = tobj->testOp(a); - - cout << "Operation completed. Returned Any: "; - CORBA::ULong ul; - - if (bp >>= ul) { - cout << "ULong: " << ul << "\n" << endl; - } - else { - cout << "Unknown value." << "\n" << endl; - } -} - - -static void hello(anyExample_ptr tobj) -{ - CORBA::Any a; - - // Sending Long - CORBA::Long l = 100; - a <<= l; - cout << "Sending Any containing Long: " << l << endl; - invokeOp(tobj,a); - - // Sending Double -#ifndef NO_FLOAT - CORBA::Double d = 1.2345; - a <<= d; - cout << "Sending Any containing Double: " << d << endl; - invokeOp(tobj,a); -#endif - - // Sending String - const char* str = "Hello"; - a <<= str; - cout << "Sending Any containing String: " << str << endl; - invokeOp(tobj,a); - - // Sending testStruct [Struct defined in IDL] - testStruct t; - t.l = 456; - t.s = 8; - a <<= t; - cout << "Sending Any containing testStruct: l: " << t.l << endl; - cout << " s: " << t.s << endl; - invokeOp(tobj,a); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - if( argc != 2 ) { - cerr << "usage: anyExample_clt <object reference>" << endl; - return 1; - } - - { - CORBA::Object_var obj = orb->string_to_object(argv[1]); - anyExample_var ref = anyExample::_narrow(obj); - if( CORBA::is_nil(ref) ) { - cerr << "Can't narrow reference to type anyExample (or it was nil)." - << endl; - return 1; - } - hello(ref); - } - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -}
-

Chapter 12  Packaging stubs into DLLs

-

omniORB’s stubs can be packaged into shared libraries or DLLs. On Unix -platforms this is mostly painless, but on Windows things are slightly -more tricky.

-

12.1  Dynamic loading and unloading

As long as your platform supports running static initialisers and -destructors as libraries are loaded and unloaded, you can package -stubs into shared libraries / DLLs, and load them dynamically at -runtime.

There is one minor problem with this, which is that normally nil -object references are heap allocated, and only deallocated when the -ORB is destroyed. That means that if you unload a stub library from -which nil references have been obtained (just by creating an object -reference _var for example), there is a risk of a segmentation fault -when the ORB is destroyed. To avoid that problem, define the -OMNI_UNLOADABLE_STUBS C pre-processor symbol while you are -compiling the stub files. Unfortunately, with that define set, there -is a risk that object reference _vars at global scope will segfault -as they are unloaded. You must not create _vars at global scope if -you are using OMNI_UNLOADABLE_STUBS.

-

12.2  Windows DLLs

On Unix platforms, the linker figures out how to link the symbols -exported by a library in to the running program. On Windows, -unfortunately, you have to tell the linker where symbols are coming -from. This causes all manner of difficulties.

-

12.2.1  Exporting symbols

To (statically) link with a DLL file in Windows, you link with a LIB -file which references the symbols exported from the DLL. To build the -LIB and DLL files, the correct symbols must be exported. One way to do -that is to decorate the source code with magic tags that tell the -compiler to export the symbols. The alternative is to provide a DEF -file that lists all the symbols to be exported. omniORB uses a DEF -file.

The question is, how do you create the DEF file? The answer is to use -a Python script named makedeffile.py that lives in the -bin\scripts directory in the omniORB distribution. -makedeffile.py runs the dumpbin program that comes with -Visual C++, and processes its output to extract the necessary symbols. -Although it is designed for exporting the symbols from omniORB stub -files, it can actually be used for arbitrary C++ code. To use it to -create a DLL from a single source file, use the following steps:

  1. -Compile the source:

    cl -c -O2 -MD -GX -Fofoo.o -Tpfoo.cc

  2. Build a static library (It probably won’t work on its own due to -the -MD switch to cl, but we just need it to get the symbols -out):

    lib -out:foo_static.lib foo.o

  3. Use the script to build a .def file:

    makedeffile.py foo_static.lib foo 1.0 foo.def

  4. Build the .dll and .lib with the def file.

    link -out:foo.dll -dll -def:foo.def -implib:foo.lib foo.o -

Of course, you can link together many separate C++ files, rather than -just the one shown here.

-

12.2.2  Importing constant symbols

As if exporting the symbols from a DLL was not complicated enough, any -constant values exported by a DLL have to be explicitly -imported into the code using them. omniORB’s stub files declare -a number of such constants. This time, the constant declarations in -the generated header files are decorated in a way that tells the -compiler what to do. When the stub headers are #included, the correct -pre-processor defines must be set. If things are not set correctly, -the code all links without problems, but then mysteriously blows up at -run time.

Depending on how complex your situation is, there are a range of -solutions. Starting with the simplest, here are some scenarios you may -find yourself in:

  1. All stub code, and all code that uses it is wrapped up in a -single DLL.

    Do nothing special.

  2. All stub code is in a single DLL. Code using it is in another -DLL, or not in a DLL at all.

    #define USE_stub_in_nt_dll before #include of -the stub headers.

  3. The stubs for each IDL file are in separate DLLs, one DLL per -IDL file.

    In this case, if the IDL files #include each other, when -the stub files are compiled, import declarations are needed so -that references between the separate DLLs work. To do this, -first compile the IDL files with the -Wbdll_stubs -flag:

    omniidl -bcxx -Wbdll_stubs example.idl

    Then define the INCLUDED_stub_in_nt_dll pre-processor -symbol when compiling the stub files. As above, define -USE_stub_in_nt_dll when including the stub headers -into application code.

  4. Stubs and application code are packaged into multiple DLLs, but -DLLs contain the stubs for more than one IDL file.

    This situation is handled by ‘annotating’ the IDL files to -indicate which DLLs they will be compiled into. The annotation -takes the form of some #ifdefs to be inserted in the -stub headers. For example,

    // one.idl - -#pragma hh #ifndef COMPILING_FIRST_DLL -#pragma hh # ifndef USE_stub_in_nt_dll -#pragma hh # define USE_stub_in_nt_dll -#pragma hh # endif -#pragma hh #endif - -#include <two.idl> - -module ModuleOne { - ... -}; - - -// two.idl - -#pragma hh #ifndef COMPILING_SECOND_DLL -#pragma hh # ifndef USE_stub_in_nt_dll -#pragma hh # define USE_stub_in_nt_dll -#pragma hh # endif -#pragma hh #endif - -#include <three.idl> -...

    Here, one.idl is packaged into first.dll and -two.idl is in second.dll. When compiling -first.dll, the COMPILING_FIRST_DLL define is -set, meaning definitions from one.idl (and any other -files in that DLL) are not imported. Any other module that -includes the stub header for one.idl does not define -COMPILING_FIRST_DLL, and thus imports the necessary -symbols from the DLL.

    Rather than explicitly listing all the pre-processor code, it -can be cleaner to use a C++ header file for each DLL. See the -COS services IDL files in idl/COS for an example.

-

Chapter 13  Objects by value, abstract interfaces and local interfaces

-

omniORB 4.1 supports objects by value, declared with the -valuetype keyword in IDL, and both abstract and local +safe.

+ +

10.3  TypeCode in omniORB

This section contains some notes on the use and behaviour of TypeCode +in omniORB

+ +

10.3.1  TypeCodes in IDL.

When using TypeCodes in IDL, note that they are defined in the CORBA +scope. Therefore, CORBA::TypeCode should be used. Example:

// IDL 5 +struct Test5 { + long length; + CORBA::TypeCode desc; +};
+ +

10.3.2  orb.idl

The CORBA specification says that IDL using CORBA::TypeCode +must include the file orb.idl. That is not required in omniORB, +but a suitable orb.idl is available.

+ +

10.3.3  Generating TypeCodes for constructed types.

To generate a TypeCode for constructed types, specify the +-Wba command-line flag when running omniidl. This will +generate a _tc_ TypeCode describing the type, at the same +scope as the type. Example:

// IDL 6 +struct Test6 { + double a; + sequence<long> b; +};

A TypeCode, _tc_Test6, will be generated to describe the +struct Test6. The operations defined in the TypeCode interface +can be used to query the TypeCode about the type it represents.

+

Chapter 11  Objects by value, abstract interfaces and local interfaces

+

omniORB 4.1 supports objects by value, declared with the +valuetype keyword in IDL, and both abstract and local interfaces. This chapter outlines some issues to do with using these types in omniORB. You are assumed to have read the relevant parts of the CORBA specification, specifically chapters 3, 4, 5 and 6 of the CORBA 2.6 specification, and sections 1.17, 1.18 and 1.35 of the C++ -mapping specification, version 1.1.

-

13.1  Features

omniORB supports the complete objects by value specification, with the +mapping specification, version 1.1.

+ +

11.1  Features

omniORB supports the complete objects by value specification, with the exception of custom valuetypes. All other valuetype features including value boxes, value sharing semantics, abstract valuetypes, and abstract interfaces are supported. Local interfaces are supported, with a number of caveats outlined in -section 13.8.

-

13.2  Reference counting

Values are reference counted. This means that, as long as your +section 11.8.

+ +

11.2  Reference counting

Values are reference counted. This means that, as long as your application properly manages reference counts, values are usually automatically deleted when they are no longer required. However, one of the features of valuetypes is that they support the representation of cyclic graph structures. In that kind of situation, the reference counting garbage collection does not work, because references internal -to the graph prevent the reference counts ever becoming zero.

To avoid memory leaks, application code must explicitly break any +to the graph prevent the reference counts ever becoming zero.

To avoid memory leaks, application code must explicitly break any reference cycles in values it manipulates. This includes graphs of -values received as parameters and return values from CORBA operations.

-

13.3  Value sharing and local calls

When valuetypes are passed as parameters in CORBA calls (i.e. calls -on CORBA objects declared with interface in IDL), the structure +values received as parameters and return values from CORBA operations.

+ +

11.3  Value sharing and local calls

When valuetypes are passed as parameters in CORBA calls (i.e. calls +on CORBA objects declared with interface in IDL), the structure of related values is maintained. Consider, for example, the following IDL definitions (which are from the example code in -src/examples/valuetype/simple:

module ValueTest { - valuetype One { - public string s; - public long l; - }; - - interface Test { - One op1(in One a, in One b); - }; -};

If the client to the Test object passes the same value in both +src/examples/valuetype/simple:

module ValueTest { + valuetype One { + public string s; + public long l; + }; + + interface Test { + One op1(in One a, in One b); + }; +};

If the client to the Test object passes the same value in both parameters, just one value is transmitted, and the object implementation receives a copy of the single value, with references to -it in both parameters.

In the case that the object is remote from the client, there is +it in both parameters.

In the case that the object is remote from the client, there is obviously a copying step involved. In the case that the object is in the same address space as the client, the same copying semantics must be maintained so that the object implementation can modify the values @@ -3978,88 +4000,93 @@ that, omniORB must copy the entire parameter list in one operation, in case there is sharing between different parameters. Such copying is a rather more time-consuming process than the parameter-by-parameter -copy that takes place in calls not involving valuetypes.

To avoid the overhead of copying parameters in this way, applications +copy that takes place in calls not involving valuetypes.

To avoid the overhead of copying parameters in this way, applications can choose to relax the semantics of value copying in local calls, so values are not copied at all, but are passed by reference. In that -case, the client to a call will see any modifications to the +case, the client to a call will see any modifications to the values it passes as parameters (and similarly, the object implementation will see any changes the client makes to returned -values). To choose this option, set the copyValuesInLocalCalls -configuration parameter to zero.

-

13.4  Value box factories

With normal valuetypes, omniidl generates factory classes (with names -ending _init) as required by the C++ mapping specification. +values). To choose this option, set the copyValuesInLocalCalls +configuration parameter to zero.

+ +

11.4  Value box factories

With normal valuetypes, omniidl generates factory classes (with names +ending _init) as required by the C++ mapping specification. The application is responsible for registering the factories with the -ORB.

Unfortunately, the C++ mapping makes no mention of factories for value +ORB.

Unfortunately, the C++ mapping makes no mention of factories for value boxes. In omniORB, factories for value boxes are automatically registered with the ORB, and there are no application-visible factory classes generated for them. Some other CORBA implementations generate -application visible factories, and the application does have to -register the factories with the ORB.

-

13.5  Standard value boxes

The standard CORBA::StringValue and CORBA::WStringValue +application visible factories, and the application does have to +register the factories with the ORB.

+ +

11.5  Standard value boxes

The standard CORBA::StringValue and CORBA::WStringValue value boxes are available to application code. To make the definitions -available in IDL, #include the standard orb.idl.

-

13.6  Covariant returns

As required by the C++ mapping, on C++ compilers that support +available in IDL, #include the standard orb.idl.

+ +

11.6  Covariant returns

As required by the C++ mapping, on C++ compilers that support covariant return types, omniidl generates code for the -_copy_value() function that returns the most derived type of the -value. On older compilers, _copy_value() returns -CORBA::ValueBase.

If you write code that calls _copy_value(), and you need to +_copy_value() function that returns the most derived type of the +value. On older compilers, _copy_value() returns +CORBA::ValueBase.

If you write code that calls _copy_value(), and you need to support older compilers, you should assign the result to a variable of -type CORBA::ValueBase* and downcast to the target type, rather -than using the covariant return.

If you are overriding _copy_value(), you must correctly take -account of the OMNI_HAVE_COVARIANT_RETURNS preprocessor -definition.

-

13.7  Values inside Anys

Valuetypes inserted into Anys cause a number of interesting issues. +type CORBA::ValueBase* and downcast to the target type, rather +than using the covariant return.

If you are overriding _copy_value(), you must correctly take +account of the OMNI_HAVE_COVARIANT_RETURNS preprocessor +definition.

+ +

11.7  Values inside Anys

Valuetypes inserted into Anys cause a number of interesting issues. Even when inside Anys, values are required to support complete sharing -semantics. Take this IDL for example:

module ValueTest { - valuetype One { - public string s; - public long l; - }; - - interface AnyTest { - void op1(in One v, in Any a); - }; -};

Now, suppose the client behaves as follows:

ValueTest::One* v = new One_impl("hello", 123); -CORBA::Any a; -a <<= v; -obj->op1(v, a);

then on the server side:

void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a) -{ - ValueTest::One* v2; - a >>= v2; - assert(v2 == v); -}

This is all very well in this kind of simple situation, but problems +semantics. Take this IDL for example:

module ValueTest { + valuetype One { + public string s; + public long l; + }; + + interface AnyTest { + void op1(in One v, in Any a); + }; +};

Now, suppose the client behaves as follows:

ValueTest::One* v = new One_impl("hello", 123); +CORBA::Any a; +a <<= v; +obj->op1(v, a);

then on the server side:

void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a) +{ + ValueTest::One* v2; + a >>= v2; + assert(v2 == v); +}

This is all very well in this kind of simple situation, but problems can arise if truncatable valuetypes are used. Imagine this derived -value:

module ValueTest { - valuetype Two : truncatable One { - public double d; - }; -};

Now, suppose that the client shown above sends an instance of -valuetype Two in both parameters, and suppose that the server -has not seen the definition of valuetype Two. In this +value:

module ValueTest { + valuetype Two : truncatable One { + public double d; + }; +};

Now, suppose that the client shown above sends an instance of +valuetype Two in both parameters, and suppose that the server +has not seen the definition of valuetype Two. In this situation, as the first parameter is unmarshalled, it will be -truncated to valuetype One, as required. Now, when the Any is +truncated to valuetype One, as required. Now, when the Any is unmarshalled, it refers to the same value, which has been truncated. So, even though the TypeCode in the Any indicates that the value has -type Two, the stored value actually has type One. If the +type Two, the stored value actually has type One. If the receiver of the Any tries to pass it on, transmission will fail -because the Any’s value does not match its TypeCode.

In the opposite situation, where an Any parameter comes before a +because the Any’s value does not match its TypeCode.

In the opposite situation, where an Any parameter comes before a valuetype parameter, a different problem occurs. In that case, as the Any is unmarshalled, there is no type information available for -valuetype Two, so the value inside the Any has an internal +valuetype Two, so the value inside the Any has an internal omniORB type used for unknown valuetypes. As the next parameter is unmarshalled, omniORB sees that the shared value is unknown, and is -able to convert it to the target One valuetype with +able to convert it to the target One valuetype with truncation. In this case, the Any and the plain valuetype both have the correct types and values, but the fact that both should have -referred to the same value has been lost.

Because of these issues, it is best to avoid defining interfaces that +referred to the same value has been lost.

Because of these issues, it is best to avoid defining interfaces that mix valuetypes and Anys in a single operation, and certainly to avoid -trying to share plain values with values inside Anys.

-

13.7.1  Values inside DynAnys

The sharing semantics of valuetypes can also cause difficulties for +trying to share plain values with values inside Anys.

+ +

11.7.1  Values inside DynAnys

The sharing semantics of valuetypes can also cause difficulties for DynAny. The CORBA 2.6 specification does not mention how shared values inside DynAnys should be handled; the CORBA 3.x specification slightly clarifies the situation, but it is still unclear. To write portable code it is best to avoid manipulating DynAnys containing values that -are shared.

In omniORB, when a value inside an Any is converted into a DynAny, the +are shared.

In omniORB, when a value inside an Any is converted into a DynAny, the value’s state is copied into the DynAny, and manipulated there. When converting back to an Any a new value is created. This means that any other references to the original value (whether themselves inside Anys @@ -4069,110 +4096,389 @@ same value can manipulated inside a DynAny without breaking the sharing, provided the value members are not accessed as DynAnys. Extracting the value members as ValueBase will reveal the sharing, for -example.

-

13.8  Local Interfaces

-

Local interfaces are somewhat under-specified in the C++ mapping. This +example.

+ +

11.8  Local Interfaces

+

Local interfaces are somewhat under-specified in the C++ mapping. This section outlines the way local interfaces are supported in omniORB, -and details the limitations and issues.

-

13.8.1  Simple local interfaces

With simple IDL, there are no particular issues:

module Test { - local interface Example { - string hello(in string arg); - }; -};

The IDL compiler generates an abstract base class -Test::Example. The application defines a class derived from it -that implements the abstract hello() member function. Instances of +and details the limitations and issues.

+ +

11.8.1  Simple local interfaces

With simple IDL, there are no particular issues:

module Test { + local interface Example { + string hello(in string arg); + }; +};

The IDL compiler generates an abstract base class +Test::Example. The application defines a class derived from it +that implements the abstract hello() member function. Instances of that class can then be used where the IDL specifies interface -Example.

Note that, by default, local interface implementations have no +Example.

Note that, by default, local interface implementations have no reference counting behaviour. If the local object should be deleted when the last reference is released, the application must implement -the _add_ref() and _remove_ref() virtual member functions +the _add_ref() and _remove_ref() virtual member functions within the implementation class. Make sure that the implementations -are thread safe.

-

13.8.2  Inheritance from unconstrained interfaces

Local interfaces can inherit from unconstrained (i.e. non-local) -interfaces:

module Test { - interface One { - void problem(inout string arg); - }; - local interface Two : One { - }; - - interface Receiver { - void setOne(in One a); - }; -};

IDL like this leads to two issues to do with omniORB’s C++ mapping -implementation.

First, an instance of local interface Two should be suitable to -pass as the argument to the setOne() method of a Receiver +are thread safe.

+ +

11.8.2  Inheritance from unconstrained interfaces

Local interfaces can inherit from unconstrained (i.e. non-local) +interfaces:

module Test { + interface One { + void problem(inout string arg); + }; + local interface Two : One { + }; + + interface Receiver { + void setOne(in One a); + }; +};

IDL like this leads to two issues to do with omniORB’s C++ mapping +implementation.

First, an instance of local interface Two should be suitable to +pass as the argument to the setOne() method of a Receiver object (as long as the object is in the same address space as the -caller). Therefore, the Two abstract base class has to inherit +caller). Therefore, the Two abstract base class has to inherit from the internal class omniORB uses to map object references of type -One. For performance reasons, the class that implements -One object references normally has non-virtual member -functions. That means that the application-supplied problem() -member function for the implementation of local interface Two +One. For performance reasons, the class that implements +One object references normally has non-virtual member +functions. That means that the application-supplied problem() +member function for the implementation of local interface Two will not override the base class’s version. To overcome this, the IDL for the base unconstrained interface must be compiled with the --Wbvirtual_objref switch to omniidl. That makes the member functions -of the mapping of One into virtual functions, so they can be -overridden.

The second problem is that, in some cases, omniORB uses a different +-Wbvirtual-objref switch to omniidl. That makes the member +functions of the mapping of One into virtual functions, so they +can be overridden.

The second problem is that, in some cases, omniORB uses a different mapping for object reference member functions than the mapping used in -servant classes. For example, in the problem() operation, it uses +servant classes. For example, in the problem() operation, it uses an internal type for the inout string argument that avoids memory -issues if the application uses a String_var in the argument. This -means that the abstract member function declared in the Two -class (and implemented by the application) has a different signature -to the member function in the base class. The application-supplied -class will therefore not properly override the base class method. In -all likelihood, the C++ compiler will also complain that the two -member functions are ambiguous. The solution to this problem is to use -the implementation mapping in the base object reference class, rather -than the normal object reference mapping, using the -Wbimpl_mapping -switch to omniidl. The consequence of this is that some uses of _var -types for inout arguments that are normally acceptable in omniORB now -lead to memory problems.

In summary, to use local interfaces derived from normal unconstrained -interfaces, you should compile all your IDL with the omniidl flags:

--Wbvirtual_objref -Wbimpl_mapping -
-

13.8.3  Valuetypes supporting local interfaces

According to the IDL specification, it should be possible to declare a -valuetype that supports a local interface:

local interface I { - void my_operation(); -}; -valuetype V supports I { - public string s; -};

omniidl accepts the IDL, but unfortunately the resulting C++ code does +issues if the application uses a String_var in the argument. +This means that the abstract member function declared in the +Two class (and implemented by the application) has a different +signature to the member function in the base class. The +application-supplied class will therefore not properly override the +base class method. In all likelihood, the C++ compiler will also +complain that the two member functions are ambiguous. The solution to +this problem is to use the implementation mapping in the base object +reference class, rather than the normal object reference mapping, +using the -Wbimpl-mapping switch to omniidl. The consequence +of this is that some uses of _var types for inout arguments +that are normally acceptable in omniORB can now lead to memory +management problems.

In summary, to use local interfaces derived from normal unconstrained +interfaces, you should compile all your IDL with the omniidl flags:

+-Wbvirtual-objref -Wbimpl-mapping +
+ +

11.8.3  Valuetypes supporting local interfaces

According to the IDL specification, it should be possible to declare a +valuetype that supports a local interface:

local interface I { + void my_operation(); +}; +valuetype V supports I { + public string s; +};

omniidl accepts the IDL, but unfortunately the resulting C++ code does not compile. The C++ mapping specification has a problem in that both -the CORBA::LocalObject and CORBA::ValueBase -classes have add_ref() and remove_ref() member functions -defined. The classes generated for the valuetype inherit from both -these base classes, and therefore have an ambiguity. Until the C++ -mapping resolves this conflict, valuetypes supporting local interfaces -cannot be used in omniORB.

-

References

-[BLFIM98]
+the CORBA::LocalObject and CORBA::ValueBase +classes have _add_ref() and _remove_ref() member +functions defined. The classes generated for the valuetype inherit +from both these base classes, and therefore have an ambiguity. Until +the C++ mapping resolves this conflict, valuetypes supporting local +interfaces cannot be used in omniORB.

+ +

Chapter 12  Asynchronous Method Invocation

+

omniORB 4.2 supports Asynchronous Method Invocation, AMI, as defined +in the CORBA Messaging specification. It supports both the polling and +callback models of asynchronous calls. Note that omniORB does not +support the other parts of the Messaging specification such as Quality +of Service, Routing and Persistent requests.

While omniORB mainly targets the 2.6 version of the CORBA +specification, the AMI support follows the CORBA Messaging +specification as described in the CORBA 3.1 specification, chapter +17 [OMG08]. That version of the specification is largely +the same as the one in CORBA 2.6. The only significant difference is +that exception replies in the callback model use a simpler +interface-independent mapping.

+ +

12.1  Implied IDL

AMI works by defining some additional implied IDL for each +interface in the real IDL. The implied IDL contains type and +operation definitions that enable asynchronous calls.

As a guide to the implied IDL, there is a special ami +back-end to omniidl that outputs the implied IDL for the given input +IDL. For example, given the Echo example IDL:

// echo.idl +interface Echo { + string echoString(in string mesg); +};

You can output the implied IDL using

+omniidl -bami echo.idl +

That outputs the following to standard out:

// ReplyHandler for interface Echo +interface AMI_EchoHandler : Messaging::ReplyHandler { + void echoString(in string ami_return_val); + void echoString_excep(in ::Messaging::ExceptionHolder excep_holder); +}; + +// Poller valuetype for interface Echo +abstract valuetype AMI_EchoPoller : Messaging::Poller { + void echoString(in unsigned long ami_timeout, out string ami_return_val); +}; + +// AMI implied operations for interface Echo +interface Echo { + void sendc_echoString(in ::AMI_EchoHandler ami_handler, in string mesg); + ::AMI_EchoPoller sendp_echoString(in string mesg); +};

Alternatively, you can use the -Wbdump option to +output an interleaved version that shows the original IDL and the +implied IDL together.

Note that the implied IDL output is for information only. You should +not compile it, but rather instruct the omniidl C++ back-end to +generate the corresponding C++ definitions.

+ +

12.2  Generating AMI stubs

To generate stub code including AMI types and operations, give the +-Wbami command line option to omniidl’s cxx +back-end:

+omniidl -bcxx -Wbami echo.idl +

That generates the normal C++ stubs and skeletons, plus all +the definitions in the implied IDL.

+ +

12.3  AMI examples

Example AMI clients for the Echo server can be found in +src/examples/ami.

+ +

Chapter 13  Interface Type Checking

+

This chapter describes the mechanism used by omniORB to ensure type +safety when object references are exchanged across the network. This +mechanism is handled completely within the ORB. There is no +programming interface visible at the application level. However, for +the sake of diagnosing the problem when there is a type violation, it +is useful to understand the underlying mechanism in order to interpret +the error conditions reported by the ORB.

+ +

13.1  Introduction

In GIOP/IIOP, an object reference is encoded as an Interoperable +Object Reference (IOR) when it is sent across a network connection. +The IOR contains a Repository ID (RepoId) and one or more +communication profiles. The communication profiles describe where and +how the object can be contacted. The RepoId is a string which uniquely +identifies the IDL interface of the object.

Unless the ID pragma is specified in the IDL, the ORB generates +the RepoId string in the so-called OMG IDL Format1. For instance, the RepoId for the Echo +interface used in the examples of chapter 2 is +IDL:Echo:1.0.

When interface inheritance is used in the IDL, the ORB always sends the +RepoId of the most derived interface. For example:

// IDL + interface A { + ... + }; + interface B : A { + ... + }; + interface C { + void op(in A arg); + };
// C++ + C_ptr server; + B_ptr objB; + A_ptr objA = objB; + server->op(objA); // Send B as A

In the example, the operation C::op() accepts an object reference +of type A. The real type of the reference passed to C::op() +is B, which inherits from A. In this case, the RepoId of +B, and not that of A, is sent across the network.

The GIOP/IIOP specification allows an ORB to send a null string in the +RepoId field of an IOR. It is up to the receiving end to work out the +real type of the object. omniORB never sends out null strings as +RepoIds, but it may receive null RepoIds from other ORBs. In that +case, it will use the mechanism described below to ensure type safety.

+ +

13.2  Interface Inheritance

When the ORB receives an IOR of interface type B when it expects the +type to be A, it must find out if B inherits from A. When the ORB has +no local knowledge of the type B, it must work out the type of B +dynamically.

The CORBA specification defines an Interface Repository (IR) from +which IDL interfaces can be queried dynamically. In the above +situation, the ORB could contact the IR to find out the type of B. +However, this approach assumes that an IR is always available and +contains the up-to-date information of all the interfaces used in the +domain. This assumption may not be valid in many applications.

An alternative is to use the _is_a() operation to work out the +actual type of an object. This approach is simpler and more robust +than the previous one because no 3rd party is involved, so this is +what omniORB does.

class Object{ + CORBA::Boolean _is_a(const char* type_id); +};

The _is_a() operation is part of the CORBA::Object +interface and must be implemented by every object. The input argument +is a RepoId. The function returns true if the object is really +an instance of that type, including if that type is a base type of the +most derived type of that object.

In the situation above, the ORB would invoke the _is_a() +operation on the object and ask if the object is of type A +before it processes any application invocation on the object.

Notice that the _is_a() call is not performed when the IOR +is unmarshalled. It is performed just prior to the first application +invocation on the object. This leads to some interesting failure modes +if B reports that it is not an A. Consider the following example:

// IDL +interface A { ... }; +interface B : A { ... }; +interface D { ... }; +interface C { + A op1(); + Object op2(); +};
1 // C++ + 2 C_ptr objC; + 3 A_ptr objA; + 4 CORBA::Object_ptr objR; + 5 + 6 objA = objC->op1(); + 7 (void) objA->_non_existent(); + 8 + 9 objR = objC->op2(); + 10 objA = A::_narrow(objR);

If the stubs of A,B,C,D are linked into the executable and:

+Case 1
C::op1() and C::op2() return a B. Lines 6–10 +complete successfully. The remote object is only contacted at line 7.
Case 2
C::op1() and C::op2() return a D. This condition +only occurs if the runtime of the remote end is buggy. Even though the +IDL definitions show that D is not derived from A, omniORB gives it +the benefit of the doubt, in case it actually has a more derived +interface that is derived from both A and D. At line 7, the object is +contacted to ask if it is an A. The answer is no, so a +CORBA::INV_OBJREF exception is raised. At line 10, the narrow +operation will fail, and objA will be set to nil. +

If only the stubs of A are linked into the executable and:

+Case 1
C::op1() and C::op2() return a B. Lines 6–10 +complete successfully. When lines 7 and 10 are executed, the object is +contacted to ask if it is an A.
Case 2
C::op1() and C::op2() return a D. This condition +only occurs if the runtime of the remote end is buggy. Line 6 +completes and no exception is raised. At line 7, the object is +contacted to ask if it is an A. If the answer is no, a +CORBA::INV_OBJREF exception is raised. At line 10, the narrow +operation will fail, and objA will be set to nil. +
+ +
+1
For further +details of the repository ID formats, see section 10.6 in the CORBA +2.6 specification.
+ + +

Chapter 14  Packaging stubs into DLLs

+

omniORB’s stubs can be packaged into shared libraries or DLLs. On Unix +platforms this is mostly painless, but on Windows things are slightly +more tricky.

+ +

14.1  Dynamic loading and unloading

As long as your platform supports running static initialisers and +destructors as libraries are loaded and unloaded, you can package +stubs into shared libraries / DLLs, and load them dynamically at +runtime.

There is one minor problem with this, which is that normally nil +object references are heap allocated, and only deallocated when the +ORB is destroyed. That means that if you unload a stub library from +which nil references have been obtained (just by creating an object +reference _var for example), there is a risk of a segmentation fault +when the ORB is destroyed. To avoid that problem, define the +OMNI_UNLOADABLE_STUBS C pre-processor symbol while you are +compiling the stub files. Unfortunately, with that define set, there +is a risk that object reference _vars at global scope will segfault +as they are unloaded. You must not create _vars at global scope if +you are using OMNI_UNLOADABLE_STUBS.

+ +

14.2  Windows DLLs

On Unix platforms, the linker figures out how to link the symbols +exported by a library in to the running program. On Windows, +unfortunately, you have to tell the linker where symbols are coming +from. This causes all manner of difficulties.

+ +

14.2.1  Exporting symbols

To (statically) link with a DLL file in Windows, you link with a LIB +file which references the symbols exported from the DLL. To build the +LIB and DLL files, the correct symbols must be exported. One way to do +that is to decorate the source code with magic tags that tell the +compiler to export the symbols. The alternative is to provide a DEF +file that lists all the symbols to be exported. omniORB uses a DEF +file.

The question is, how do you create the DEF file? The answer is to use +a Python script named makedeffile.py that lives in the +bin\scripts directory in the omniORB distribution. +makedeffile.py runs the dumpbin program that comes with +Visual C++, and processes its output to extract the necessary symbols. +Although it is designed for exporting the symbols from omniORB stub +files, it can actually be used for arbitrary C++ code. To use it to +create a DLL from a single source file, use the following steps:

  1. +Compile the source:

    cl -c -O2 -MD -GX -Fofoo.o -Tpfoo.cc

  2. Build a static library (It probably won’t work on its own due to +the -MD switch to cl, but we just need it to get the symbols +out):

    lib -out:foo_static.lib foo.o

  3. Use the script to build a .def file:

    makedeffile.py foo_static.lib foo 1.0 foo.def

  4. Build the .dll and .lib with the def file.

    link -out:foo.dll -dll -def:foo.def -implib:foo.lib foo.o +

Of course, you can link together many separate C++ files, rather than +just the one shown here.

+ +

14.2.2  Importing constant symbols

As if exporting the symbols from a DLL was not complicated enough, any +constant values exported by a DLL have to be explicitly +imported into the code using them. omniORB’s stub files declare +a number of such constants. This time, the constant declarations in +the generated header files are decorated in a way that tells the +compiler what to do. When the stub headers are #included, the correct +pre-processor defines must be set. If things are not set correctly, +the code all links without problems, but then mysteriously blows up at +run time.

Depending on how complex your situation is, there are a range of +solutions. Starting with the simplest, here are some scenarios you may +find yourself in:

  1. All stub code, and all code that uses it is wrapped up in a +single DLL.

    Do nothing special.

  2. All stub code is in a single DLL. Code using it is in another +DLL, or not in a DLL at all.

    #define USE_stub_in_nt_dll before #include of +the stub headers.

  3. The stubs for each IDL file are in separate DLLs, one DLL per +IDL file.

    In this case, if the IDL files #include each other, then +when the stub files are compiled, import declarations are needed +so that references between the separate DLLs work. To do this, +first compile the IDL files with the -Wbdll_stubs +flag:

    omniidl -bcxx -Wbdll_stubs example.idl

    Then define the INCLUDED_stub_in_nt_dll pre-processor +symbol when compiling the stub files. As above, define +USE_stub_in_nt_dll when including the stub headers +into application code.

  4. Stubs and application code are packaged into multiple DLLs, but +DLLs contain the stubs for more than one IDL file.

    This situation is handled by ‘annotating’ the IDL files to +indicate which DLLs they will be compiled into. The annotation +takes the form of some #ifdefs to be inserted in the +stub headers. For example,

    // one.idl + +#pragma hh #ifndef COMPILING_FIRST_DLL +#pragma hh # ifndef USE_stub_in_nt_dll +#pragma hh # define USE_stub_in_nt_dll +#pragma hh # endif +#pragma hh #endif + +#include <two.idl> + +module ModuleOne { + ... +}; + + +// two.idl + +#pragma hh #ifndef COMPILING_SECOND_DLL +#pragma hh # ifndef USE_stub_in_nt_dll +#pragma hh # define USE_stub_in_nt_dll +#pragma hh # endif +#pragma hh #endif + +#include <three.idl> +...

    Here, one.idl is packaged into first.dll and +two.idl is in second.dll. When compiling +first.dll, the COMPILING_FIRST_DLL define is +set, meaning definitions from one.idl (and any other +files in that DLL) are not imported. Any other module that +includes the stub header for one.idl does not define +COMPILING_FIRST_DLL, and thus imports the necessary +symbols from the DLL.

    Rather than explicitly listing all the pre-processor code, it +can be cleaner to use a C++ header file for each DLL. See the +COS services IDL files in idl/COS for an example.

+ +

Chapter 15  Resources

There are a number of useful online resources related to omniORB:

+

References

+[BLFIM98]
T. Berners-Lee, R. Fielding, U.C. Irvine, and L. Masinter. -Uniform Resource Identifiers (URI): Generic Syntax. -RFC 2396, August 1998.
[HV99]
+Uniform Resource Identifiers (URI): Generic Syntax. +RFC 2396, August 1998.
[HV99]
Michi Henning and Steve Vinoski. -Advanced CORBA Programming with C++. -Addison-Wesley professional computing series, 1999.
[OMG98]
+Advanced CORBA Programming with C++. +Addison-Wesley professional computing series, 1999.
[OMG98]
+Object Management Group. +CORBAServices: Common Object Services Specification, December +1998.
[OMG00]
Object Management Group. -CORBAServices: Common Object Services Specification, December -1998.
[OMG00]
+Interoperable Naming Service revised chapters, August 2000. +From http://www.omg.org/cgi-bin/doc?ptc/00-08-07.
[OMG01]
Object Management Group. -Interoperable Naming Service revised chapters, August 2000. -From http://www.omg.org/cgi-bin/doc?ptc/00-08-07.
[OMG01]
+The Common Object Request Broker: Architecture and +Specification, 2.6 edition, December 2001. +From http://www.omg.org/cgi-bin/doc?formal/01-12-01.
[OMG03]
Object Management Group. -The Common Object Request Broker: Architecture and -Specification, 2.6 edition, December 2001. -From http://www.omg.org/cgi-bin/doc?formal/01-12-01.
[OMG03]
+C++ Language Mapping, 1.1 edition, 2003. +From http://www.omg.org/cgi-bin/doc?formal/03-06-03.
[OMG08]
Object Management Group. -C++ Language Mapping, 1.1 edition, 2003. -From http://www.omg.org/cgi-bin/doc?formal/03-06-03.
[Ric96]
+The Common Object Request Broker: Architecture and +Specification, 3.1 edition, January 2008. +From http://www.omg.org/cgi-bin/doc?formal/08-01-04.
[Ric96]
Tristan Richardson. -The OMNI Thread Abstraction. -AT&T Laboratories Cambridge, October 1996.
+The OMNI Thread Abstraction. +AT&T Laboratories Cambridge, October 1996.
-
This document was translated from LATEX by -HEVEA.
- +
This document was translated from LATEX by +HEVEA.
+ Binary files /tmp/tmpAImAYv/p4jQLK3klS/omniorb-dfsg-4.1.6/doc/omniORB.pdf and /tmp/tmpAImAYv/V3z_zxpzZI/omniorb-dfsg-4.2.2/doc/omniORB.pdf differ diff -Nru omniorb-dfsg-4.1.6/doc/tex/cover.tex omniorb-dfsg-4.2.2/doc/tex/cover.tex --- omniorb-dfsg-4.1.6/doc/tex/cover.tex 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/cover.tex 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -\documentclass[11pt]{article} -\usepackage[]{fontenc} -\usepackage{palatino} -\usepackage{a4} - -\begin{document} -\pagestyle{empty} - -\vspace*{2cm} - -\begin{center} -{\Huge The OMNI Document Set}\\[10mm] -{\Large AT\&T Laboratories Cambridge}\\[5mm] -\end{center} - -\vspace*{3cm} - -\centerline{\rule{5.in}{.02in}} -\vspace*{1cm} -\noindent {\Large \it The OMNI Development Environment}\\[3mm] -{\Large \it The omniORB User's Guide}\\[3mm] -{\Large \it The OMNI Thread Abstraction}\\[3mm] -{\Large \it omniParTcl -- Creating Tcl/Tk GUIs for C++ applications}\\[5mm] -{\Large \it CORBA IDL Syntax ({\small \it reprinted from the CORBA 2.0 specification})}\\[3mm] -{\Large \it CORBA C++ mapping ({\small \it reprinted from the CORBA 2.0 specification})}\\[4mm] -\centerline{\rule{5.in}{.01in}} - - -\end{document} diff -Nru omniorb-dfsg-4.1.6/doc/tex/ode.tex omniorb-dfsg-4.2.2/doc/tex/ode.tex --- omniorb-dfsg-4.1.6/doc/tex/ode.tex 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/ode.tex 1970-01-01 00:00:00.000000000 +0000 @@ -1,1501 +0,0 @@ -\documentclass[11pt,twoside,onecolumn]{article} -\usepackage[]{fontenc} -\usepackage{palatino} -\usepackage{a4} -\addtolength{\oddsidemargin}{-0.2in} -\addtolength{\evensidemargin}{-0.6in} -\addtolength{\textwidth}{0.5in} - -\pagestyle{headings} -\parskip 1ex -\parindent 0pt -\title{The OMNI Development Environment} -\author{Tristan Richardson\\ - ORL\\ - Cambridge} -\date{12 January 1999} - -\begin{document} - -\maketitle - -\vspace{0.2in} - -\tableofcontents - -\newpage - -\section{Introduction} - -The OMNI Development Environment (ODE) provides a mechanism for building -software across all our diverse platforms. - -The idea is that you create a {\em build tree} for a particular platform where -you can ``build'' software using compilers, linkers, etc. To help with this -you can pull in things like header files and libraries from a number of {\em -import trees}. The resulting code can be ``exported'' to an {\em export tree}, -from where others may ``import'' it. A few simple definitions of the different -types of tree may help: - -\begin{itemize} - -\item An {\em import/export tree} is a place for sharing compiled libraries and -binaries, header files, IDL files, {\em make} variables and rules. It has a -standard structure of subdirectories - at present {\tt include}, {\tt idl}, -{\tt mk}, {\tt bin} and {\tt lib} - but a particular tree might have some of -these missing or have other extra subdirectories. Underneath {\tt bin} and -{\tt lib} are platform-dependent subdirectories. - -\item A {\em build tree} is where source code is ``built''. The source code -can be local to the build tree, or it can be pulled in from a source tree which -is shared with other build trees. The results of building, such as libraries -and binaries, can be exported to an {\em export tree}. Such an {\em export -tree} can then be used as an {\em import tree} by another build tree. -Obviously build trees are platform-dependent. - -\item A {\em source tree} has the source code of things which need ``building'' -such as C/C++ source and Java source. Things which don't need to be ``built'' -such as header files and IDL files can just be put directly into an -import/export tree. - -\end{itemize} - -By convention a source tree will often be associated with an import/export -tree and will be placed in the {\tt src} subdirectory of the import/export -tree. Its structure underneath {\tt src} can be anything. - -For each platform there will also often be a build tree under the {\tt build} -subdirectory of the import/export tree. Here source code from the -corresponding source tree is built, and then exported to the import/export -tree. - -Note that when you treat an import/export tree as an import tree, the contents -of its corresponding source and build trees is totally irrelevant. There is no -sense in which you can ``import'' from a build tree.\footnote{This differs from -the old OMNI development environment where, for example, an {\tt appl} build -tree could ``import'' from a {\tt lib} build tree.} - -Every build tree must have a {\em base} OMNI tree from which it imports. -Usually this will be the current {\em release} or {\em develop} OMNI tree. In -addition the build tree can have any number of other import trees. The order -of these import trees is important - if a library, header file or whatever -appears in more than one import tree, the build tree will use the one in the -import tree which is specified first. The {\em base} OMNI tree will always be -searched last. - - -\section{Some example ways of using the ODE} - -There are a number of different ways in which the ODE can be used. Here are -some examples, using various source, build and import/export trees. Don't -worry if the later examples seem complicated - it will all become clear when -you try some building yourself. - -\begin{enumerate} - -\item -\label{buildtreeonly} -The simplest situation is where a user wants to write their own code in -isolation. For a single platform this can be done directly in a build tree -which just imports from the base OMNI tree but has no export tree or source -trees. See the hello world example below. - -\item If the user wants to build the same source code on multiple platforms the -code can be placed in a source tree. Several build trees can then be created -each of which shadow the source tree (i.e. have the same directory structure -but no source files). Again these build trees need not have an export tree. - -\item -\label{twoimporttrees} -To share header files and libraries between several programs, the user needs -their own import/export tree. The build tree(s) will both import from and -export to this import/export tree, as well as importing from the base OMNI -tree. Note that if two programs want to share a library which is built in the -same tree, the recommended way of doing this is to export the library to an -import/export tree, rather than just pulling the library out of the build tree. -This makes it possible to build the same programs in a different tree simply by -importing from this import/export tree. - -\item The base OMNI tree has a source tree and a build tree for each platform. -Each of these build trees shadows the source tree, and both imports from and -exports to the base OMNI import/export tree. It has no other import trees. - -\item If the user wants to build their own version of a standard OMNI library -with just one or two source file changes, this can be done by using the base -OMNI tree as a second {\em source tree}. The user makes a directory with -exactly the same path in their own source tree and build trees as in the base -OMNI source tree. A local file in the user's source tree then just overrides -the same file in the base OMNI source tree. Once the library has been built, -it should be exported to the user's import/export tree, where it can be used to -override the library in the base OMNI import/export tree. - -\item Each project using the ODE will have its own import/export tree with -corresponding source tree and build trees for each platform. Similar to -case~\ref{twoimporttrees} these build trees will import from and export to the -project's import/export tree and also import from the base OMNI tree. - -\item People working on a project will also have personal build trees which -import from the project tree followed by the base OMNI tree. They may also -have their own import/export tree which is imported from first. In this case -there are three levels of import tree. There is theoretically no limit to the -number of trees which may be imported in this way. - -\item Similarly to multiple import trees, a user may have a build tree with -multiple source trees. It could firstly shadow their own source tree followed -by a project source tree followed by the base OMNI source tree. This could be -used to build a different version of a standard OMNI library, a different -version of a standard project library and the user's own programs all in the -same build tree. - -\end{enumerate} - -\section{Writing a Hello World program in C} - -This section introduces the use of the development environment by going through -the steps to build a simple ``hello world'' program on a unix platform. This -will be done using the ODE in the simplest way as in case~\ref{buildtreeonly} -above. - -\subsection{Setting up Your Environment} -\label{settingenv} - -\sloppy{Although not strictly necessary it is advisable to set the environment -variable \verb|OMNI_TREE| to point to the base OMNI tree you wish to use. For -a quick test like this, you can use \verb|/project/omni/release| - this is a -symbolic link to the current release tree. If you want to make a build tree -which is more stable, use the actual directory name -(e.g. \verb|/project/omni/version5.5|) as the base OMNI tree. Doing the latter -means you won't have problems when the release tree is moved on to the next -version. If you really want to be at the cutting edge, you can use -\verb|/project/omni/develop|, but as the name suggests, the develop tree may -change underneath your feet, so you should only do this if you really need to. - -Having decided on your base OMNI tree, add the directories -\verb|$OMNI_TREE/bin/|{\it platform} and \verb|$OMNI_TREE/bin/scripts| to your -path in that order (so that platform-specific binaries will override scripts). -You may also wish to add \verb|$OMNI_TREE/man| to your {\tt MANPATH}. If the -version of make which is on your path is not GNU make then you need to set the -environment variable {\tt GNUMAKE} to specify the command to run for GNU make.} - -\subsection{Creating a build tree} - -You create a build tree by running the script {\tt obuildtree}. It will prompt -you for a number of things. Often there is a sensible default shown in square -brackets which will be used if you just hit RETURN. In this case you want a -build tree for whichever platform you're on with no source or export tree. You -can name the destination directory whatever you like. For example: - -{\footnotesize \begin{verbatim} -$ obuildtree - -Enter the base OMNI tree for this build tree -> [/project/omni/release] - -Enter the platform name from: -alpha_osf1_3.2 -arm_atmos_3.0/atb -i586_linux_2.0 -sun4_sosV_5.5 -x86_nt_3.5 -> [sun4_sosV_5.5] - -Enter the destination directory -> [sun4_sosV_5.5] solaris_hello - -Does this build tree have an export tree ? -> [n] - -The final import tree will be /project/omni/release (the base OMNI tree) -Enter any other import trees in search order -> - -Does this build tree have any source trees ? -> [y] n - -************************************************************************ - -Creating OMNI build tree "solaris_hello" for platform "sun4_sosV_5.5" - -No export tree - -Import trees are: -/project/omni/release - -No source trees - -\end{verbatim}} - -Now go into your new build tree: - -{\footnotesize \begin{verbatim} -$ cd solaris_hello -\end{verbatim}} - -Notice that there is a directory called {\tt config} with files called {\tt -config.mk} and {\tt sources}. Generating these files is all that {\tt -obuildtree} does. - -Now you're ready to write your ``hello world'' program: - -{\footnotesize \begin{verbatim} -$ cat >hello.c -#include -int main() -{ - printf("Hello world!\n"); - return 0; -} -\end{verbatim}} - -Now you need to specify how to make an executable from this C source file. -This is done in a file called {\tt dir.mk}. This is very similar in concept to -an Imakefile except that there is no separate preprocessing stage -- {\tt -dir.mk} is actually processed by {\tt make}. However, to allow it to be a -platform-independent specification, {\tt dir.mk} is not a complete makefile in -itself. Instead a front-end to {\tt make} is used called {\tt omake}. What -{\tt omake} does is to find the {\tt config} directory in your build tree and -run {\tt make} on {\tt config.mk}. This allows for import trees to define -useful {\tt make} variables and rules which can be used in your {\tt dir.mk}. - -So for our example you need a {\tt dir.mk} like this: - -{\footnotesize \begin{verbatim} -$ cat >dir.mk -SRCS = hello.c - -all:: hello - -hello: hello.o - @$(CExecutable) -\end{verbatim}} - -Notice this looks just like a makefile -- except that the rule {\tt -\$(CExecutable)} has been predefined for you so you don't need to worry about -compilers, linkers and their flags. Note also that it is important to use a -TAB rather than spaces in the make rule. The ``@'' is there to tell make not -to generate lots of irrelevant output. - -Now you can run ``{\tt omake}'' to build the executable\footnote{If you get a -``missing separator'' error from make this is probably because you used spaces -instead of a TAB in the rule}: - -{\footnotesize \begin{verbatim} -$ omake - -make -r -f config/config.mk VPATH= TOP=. CURRENT=. OMAKE_TARGET= - -/project/omni/release/mk/afterdir.mk:64: hello.d: No such file or directory -/bin/sh -ec "gcc -M -I. -I/project/omni/release/include -D__sunos__ -D__sp -arc__ -D__OSVERSION__=5 -DSVR4 hello.c | sed 's/hello\\.o/& hello.d/g' > hel -lo.d" -gcc -c -O -fpcc-struct-return -I. -I/project/omni/release/include -D__suno -s__ -D__sparc__ -D__OSVERSION__=5 -DSVR4 -o hello.o hello.c -+ rm -f hello -+ gcc -o hello -L/project/omni/release/lib/sun4_sosV_5.5 hello.o -\end{verbatim}} - -The result should be that three files are generated. The file called -{\tt hello} is the executable which you should be able to run: - -{\footnotesize \begin{verbatim} -$ ./hello -Hello world! -\end{verbatim}} - -There should also be the object file {\tt hello.o}. The third file is called -{\tt hello.d}. This contains the header file dependencies of {\tt hello.c}. -The generation of this file is done automatically whenever {\tt hello.c} -changes -- there is no need for a separate ``make depend'' step. Any C source -file specified in {\tt SRCS} or C++ file specified in {\tt CXXSRCS} will have -this dependency checking done automatically. - -\subsection{Making it portable to NT and ATMos} - -Because different platforms adopt different naming conventions for executables, -the {\tt dir.mk} used above is not suitable for use on non-unix platforms. To -make it truly portable {\tt dir.mk} should look like this: - -{\footnotesize \begin{verbatim} -SRCS = hello.c - -HELLO = $(patsubst %,$(BinPattern),hello) - -all:: $(HELLO) - -$(HELLO): hello.o - @$(CExecutable) - -clean:: - $(RM) $(HELLO) -\end{verbatim}} - -This uses GNU make's {\tt patsubst} feature together with a make variable {\tt -BinPattern} to produce the name of the executable file. For example on NT, -{\tt BinPattern} is set to {\tt \%.exe}, resulting in the executable name {\tt -hello.exe}.\footnote{You may recall this is similar to the old OMNI development -environment's {\tt ProgramTargetName} macro.} For completeness there should -also be a rule for removing the executable when ``{\tt omake clean}'' is done. - -\section{Using a source tree} - -Now assume you want to build the same code on several platforms. Put {\tt -hello.c} and {\tt dir.mk} in a directory called {\tt src}. Create a -directory alongside it called {\tt build} and inside there run ``{\tt -obuildtree}''. This time specify the full path of the {\tt src} directory (or -if you prefer ``{\tt ../../src}'') as a source tree. You should be able to -type ``{\tt omake}'' inside the build tree and have it compile your program -even though the source file is not in the local build directory. - -You will see that on the command line {\tt omake} gives to GNU {\tt make} it -specifies a {\tt -I} flag causing make to search for the {\tt dir.mk} in the -{\tt src} directory, and sets the VPATH variable so that make searches for -source files in that directory. In this way there is no need for symbolic -links from the build tree back to the source tree. - -You can create a similar build tree for another platform using the same source -tree, thereby compiling for both platforms from the same source files. - -\section{Creating an import/export tree} - -There is no magic involved in creating an import/export tree. An empty -directory is a completely valid import/export tree, albeit a not very useful -one. In the conventional case where there are source and build trees -associated with an import/export tree, the import/export tree will be the -directory above the {\tt src} and {\tt build} directories. - -If say you want to put a header file in your import/export tree, simply create -an {\tt include} subdirectory and put the header file in it. Similarly IDL -files can simply be put in an {\tt idl} subdirectory. However, if you want to -put something which needs ``building'' (such as a library or executable binary) -into an import/export tree, this needs to be done by running ``{\tt omake -export}'' inside a build tree. - -Suppose you want to export the {\tt hello} executable to your import/export -tree. When {\tt obuildtree} asks you whether the build tree has an export tree -you should type ``y'' and specify the full path of the import/export tree (with -any luck this will be the default). The export tree will automatically become -the first import tree as well. Now in your {\tt dir.mk} you need a rule which -says how to export the {\tt hello} executable. Add the following: - -{\footnotesize \begin{verbatim} -export:: $(HELLO) - @$(ExportExecutable) -\end{verbatim}} - -When you run ``{\tt omake export}'' inside your build tree it should create a -{\tt bin/}{\it platform} directory in your import/export tree and put the hello -executable there. - -As well as providing header files, IDL files, libraries and executables, an -import/export tree can provide make variables and rules in the {\tt mk} -directory. The {\tt config.mk} in a build tree includes two make files for -each import tree, called {\tt beforedir.mk} and {\tt afterdir.mk}. Whenever -{\tt omake} is run, these get included before and after {\tt dir.mk} -respectively. The most common use of these files is for defining make -variables for libraries (see section~\ref{buildlib} about building libraries). - - -\section{Writing dir.mk} - -The {\tt dir.mk} file is basically just a makefile, so you can put normal make -rules and variable definitions there. However to make full use of the ODE you -will want to use the predefined variables and rules to make your {\tt dir.mk} -platform-independent. As with imakefiles, usually the best thing to do is find -an existing {\tt dir.mk} which does nearly the same thing that you want and -copy it. - -\subsection{Generating library and executable names} - -Since each platform has its own naming conventions for libraries and executable -binaries, you should use the GNU make ``patsubst'' function together with {\tt -LibPattern} and {\tt BinPattern} to generate the appropriate file name. -Assigning a make variable to each library or executable name is probably a good -idea, e.g.: - -{\footnotesize \begin{verbatim} -lib = $(patsubst %,$(LibPattern),my_library) -prog1 = $(patsubst %,$(BinPattern),my_program1) -prog2 = $(patsubst %,$(BinPattern),my_program2) -\end{verbatim}} - -These variables can then be used throughout the rest of {\tt dir.mk}. All -platforms support the extensions {\tt .c} for C source files, {\tt .cc} for C++ -source files and {\tt .o} for object files. - -\subsection{Building C or C++ programs} - -For building C or C++ programs use the ``rules'' CExecutable and CXXExecutable -respectively (``rules'' like these are actually make variables which contain a -canned sequence of shell commands). The general forms are: - -{\footnotesize \begin{verbatim} -$(prog1): - @(libs=""; $(CExecutable)) - -$(prog2): - @(libs=""; $(CXXExecutable)) -\end{verbatim}} - -Here {\tt prog1} and {\tt prog2} have been assigned using BinPattern as -suggested above, {\tt } is a list of object files and {\tt } is -a list of libraries. \verb|| is a list of library dependencies - -for each library provided there should be a make variable both for the library -itself and for putting in the dependencies of a program. For example the -omnithread library provides a variable \verb|OMNITHREAD_LIB| which might -contain something like ``{\tt -lomnithread -lpthreads}'' and a variable -\verb|OMNITHREAD_LIB_DEPEND| which will contain the full pathname of {\tt -libomnithread.a}. By specifying such dependencies programs will automatically -be relinked whenever relevant libraries change. - -In addition to the rules for creating the executables, you also need to specify -what the C and C++ source files are. The variables {\tt SRCS} and {\tt -CXXSRCS} should contain a list of the C and C++ source files respectively. The -main effect of setting these variables is to cause header file dependency -analysis to be performed. The variable {\tt ASSRCS} can be used to specify -assembly language source files. - -To specify the options that get given to the C or C++ compiler there are -several variables you can use. The most common one is \verb|DIR_CPPFLAGS|. -This is used for passing C preprocessor flags (i.e. {\tt -D} and {\tt -I}) to -both the C compiler and the C++ compiler. The ``{\tt DIR}'' signifies that the -flags are specific to this directory. These flags will be used in addition to -the normal flags given to the compiler. If you want to totally override all -the standard CPP flags provided by the import trees you can set the variable -{\tt CPPFLAGS} directly, but this is not recommended unless you know what -you're doing. - -Other variables you can set are: - -\begin{itemize} -\item {\tt CDEBUGFLAGS} or {\tt CXXDEBUGFLAGS} for setting {\tt -O} and {\tt --g} flags to the compiler. -\item {\tt COPTIONS} and {\tt CXXOPTIONS} for setting other options to the -compiler. -\item {\tt CLINKOPTIONS} and {\tt CXXLINKOPTIONS} for setting options to the -linker. -\end{itemize} - -Setting these variables will override any defaults provided by the import -trees. If you want to keep the defaults but add an extra flag you can use GNU -make's ``+='' notation. - -As well as the rule to build the executable you should also have a rule to -remove it when ``{\tt omake clean}'' is done and a rule to export it when -``{\tt omake export}'' is done, e.g.: - -{\footnotesize \begin{verbatim} -clean:: - $(RM) $(prog1) $(prog2) - -export:: $(prog1) $(prog2) - @$(ExportExecutable) -\end{verbatim}} - -\subsection{Building libraries} -\label{buildlib} - -To build a statically-linked (i.e. non-shared) library, use the rule -{\tt StaticLinkLibrary}: - -{\footnotesize \begin{verbatim} -$(lib): - @$(StaticLinkLibrary) -\end{verbatim}} - -Again you can use \verb|DIR_CPPFLAGS|, {\tt CDEBUGFLAGS}, etc for controlling -the flags given to the compiler, and you should put the names of all the source -files in {\tt SRCS} and {\tt CXXSRCS}. To export the library and clean it out -you should also have: - -{\footnotesize \begin{verbatim} -clean:: - $(RM) $(lib) - -export:: $(lib) - @$(ExportLibrary) -\end{verbatim}} - -As well as exporting the library itself, you should provide two MAKE variables -to make it easier for others to use the library. These variables should be of -the form \verb|XXX_LIB| and \verb|XXX_LIB_DEPEND|, as described above for the -omnithread library. You put their definitions in the \verb|mk/beforedir.mk| of -the import/export tree. Assuming your library has the name ``wob'', you need -something like: - -{\footnotesize \begin{verbatim} -WOB_LIB = $(patsubst %,$(LibSearchPattern),wob) -lib_depend := $(patsubst %,$(LibPattern),wob) -WOB_LIB_DEPEND := $(GENERATE_LIB_DEPEND) -\end{verbatim}} - -You don't actually {\em need} to understand what these lines do but they are -worth explaining anyway. {\tt LibSearchPattern} is like {\tt LibPattern} -except it specifies the library in such a way as to cause the linker to search -for the library. For example, on unix platforms this will be ``\verb|-l%|'' -(on ATMos and NT it happens to be the same as {\tt LibPattern}). If your -library requires any other libraries these should be added to \verb|WOB_LIB|. - -The two ``lib\_depend'' lines are slightly more complicated. The variable -\verb|GENERATE_LIB_DEPEND| actually acts more like a function than a -variable. What it does is search through all the import trees for the library -currently specified in the \verb|lib_depend| variable. Since simple assignment -(``{\tt :=}'') is used, the variable \verb|WOB_LIB_DEPEND| gets assigned the -full pathname of the ``wob'' library in whichever import tree it is found. -Hence it can be used in the dependencies of a link rule to cause relinking -whenever that library changes. - -\subsubsection{Building dynamically-linked (shared) libraries} - -At present there are no rules to help you do this. Currently the omnithread -and omniORB2 libraries are built as shared libraries using a custom {\tt -dir.mk}. Proper support for building shared libraries ought to be provided at -some time in the future. - - -\subsection{Building in subdirectories} - -Use the {\tt MakeSubdirs} rule. Normally you just set the {\tt SUBDIRS} -variable like this: - -{\footnotesize \begin{verbatim} -SUBDIRS = wib wob - -all:: - @$(MakeSubdirs) - -export:: - @$(MakeSubdirs) -\end{verbatim}} - -This will cause both ``{\tt omake all}'' and ``{\tt omake export}'' to go down -into the subdirectories {\tt wib} and {\tt wob}. If you want to run {\tt -omake} with a different target in the subdirectories you can set the shell -variable {\tt target}. For example, if you want ``{\tt omake export}'' to -actually perform ``{\tt omake all}'' in each of the subdirectories, do this: - -{\footnotesize \begin{verbatim} -export:: - @(target=all; $(MakeSubdirs)) -\end{verbatim}} - -In fact you can use different subdirectories for different targets as well by -using the {\tt subdirs} shell variable instead of the {\tt SUBDIRS} make -variable: - -{\footnotesize \begin{verbatim} -all:: - @(subdirs="a b"; $(MakeSubdirs)) - -export:: - @(subdirs="c d"; $(MakeSubdirs)) -\end{verbatim}} - -If you want to pass make variable settings down to a subdirectory you can use -the make variable \verb|SUBDIR_MAKEFLAGS| (as with {\tt SUBDIRS} this can be -overridden with a shell variable, in this case \verb|subdir_makeflags|). For -example: - -{\footnotesize \begin{verbatim} -SUBDIR_MAKEFLAGS = CDEBUGFLAGS=-g MY_MAKE_VARIABLE="foo bar" - -all:: - @$(MakeSubdirs) - -export:: - @(subdir_makeflags='MY_MAKE_VARIABLE="wib wob"'; $(MakeSubdirs)) -\end{verbatim}} - - -\subsection{Local include directories} - -One point to note is that when adding local include directories to -\verb|DIR_CPPFLAGS| you need to be aware of the way the VPATH mechanism works. -For example, putting: - -{\footnotesize \begin{verbatim} -DIR_CPPFLAGS = -I../include -\end{verbatim}} - -will probably not do what you want since only this build tree will be searched -for header files. If you want to search through all the source trees for the -equivalent include directories you need a ``patsubst'' expression to add the -same relative path to each element of {\tt VPATH}: - -{\footnotesize \begin{verbatim} -DIR_CPPFLAGS = -I../include $(patsubst %,-I%/../include,$(VPATH)) -\end{verbatim}} - - -\subsection{Platform specific variables} - -There are several make variables which you can test to distinguish between the -various platforms. The variable {\tt platform} contains the full platform name -in the form used by {\tt obuildtree} (e.g. \verb|sun4_sosV_5.5|). More useful -for testing in {\tt dir.mk}, each platform defines two variables to identify -the operating system\footnote{The make variable identifying the operating -system is the same as returned by the ``uname'' command where appropriate.} and -processor. In addition {\tt UnixPlatform} and {\tt Win32Platform} are defined -where appropriate. These variables can be tested using GNU make's {\tt ifdef} -command. Currently supported are: - -\begin{flushleft} -\begin{tabular}{|l|l|} -\hline -Platform & make variables \\ -\hline -Sun Solaris 2.5 & \verb|platform=sun4_sosV_5.5| \\ - & \verb|SparcProcessor SunOS UnixPlatform| \\ -\hline -Digital Unix 3.2 & \verb|platform=alpha_osf1_3.2| \\ - & \verb|AlphaProcessor OSF1 UnixPlatform| \\ -\hline -Linux 2.0 (x86) & \verb|platform=i586_linux_2.0| \\ - & \verb|x86Processor Linux UnixPlatform| \\ -\hline -Windows/NT 3.5 & \verb|platform=x86_nt_3.5| \\ - & \verb|x86Processor WindowsNT Win32Platform| \\ -\hline -ATMos 4.0 & \verb|platform=arm_atmos_3.0/atb| \\ - & \verb|ArmProcessor ATMos| \\ -\hline -\end{tabular} -\end{flushleft} - -In addition to these make variables which can be tested in {\tt dir.mk}, there -are several C/C++ preprocessor defines which can be tested in your program -source to distinguish the various platforms: - -\begin{flushleft} -\begin{tabular}{|l|l|} -\hline -Platform & CPP defines \\ -\hline -Sun Solaris 2.5 & \verb|__sparc__ __sunos__ __OSVERSION__=5| \\ -\hline -Digital Unix 3.2 & \verb|__alpha__ __osf1__ __OSVERSION__=3| \\ -\hline -Linux 2.0 (x86) & \verb|__x86__ __linux__ __OSVERSION__=2| \\ -\hline -Windows/NT 3.5 & \verb|__x86__ __NT__ __OSVERSION__=3 __WIN32__| \\ -\hline -ATMos 4.0 & \verb|__arm__ __atmos__ __OSVERSION__=4| \\ -\hline -\end{tabular} -\end{flushleft} - -To distinguish amongst different compilers, each compiler usually sets its own -CPP defines. The ones you are recommended to test are: - -\begin{flushleft} -\begin{tabular}{|l|l|} -\hline -Compiler & CPP define \\ -\hline -SparcWorks C++ & \verb|__SUNPRO_CC| \\ -\hline -DEC C++ & \verb|__DECCXX| \\ -\hline -GNU g++ & \verb|__GNUG__| \\ -\hline -GNU gcc (C and C++) & \verb|__GNUC__| \\ -\hline -Microsoft Visual C++ & \verb|_MSC_VER| \\ -\hline -\end{tabular} -\end{flushleft} - - - -\section{Creating a New Project Tree} - -To create a new project tree all you need is an import/export tree, a source -tree and a set of build trees, one for each platform. By convention, the -source tree is put in a subdirectory of the import/export tree called {\tt src} -and the build trees are put in subdirectories named {\tt build/}{\it platform}. - -Let's assume for your project that you have some IDL files and header files as -well as some source files. Create your top-level directory, say {\small \tt -/project/wobble/version1.0}. Then make directories {\tt idl}, {\tt include}, -{\tt src} and {\tt build}. Copy your IDL files into {\tt idl} and your header -files into {\tt include}. - -For your source files you must decide on an appropriate directory structure -underneath {\tt src} and put the source files there. You can have any -structure there, but if you want a guide, take a look at the {\tt -/project/omni/release/src} structure. This has (in order of processing by -{\tt omake}): -\begin{itemize} -\item a directory with tools used in the building process (which are probably -unlikely in your project tree). -\item a directory with ATMos interface files (again unlikely unless you are -writing low-level ATMos code). -\item a directory with sources to be made into libraries. -\item a directory with sources to be made into executable programs. -\end{itemize} -In your source tree you'll need an appropriate {\tt dir.mk} file in each -directory (including one in {\tt src} itself). At the top level you may not -want ``{\tt omake all}'' to do anything since it is unlikely to do what people -expect (when it gets to building programs it won't use the libraries which have -just been built). Instead you probably only want an ``{\tt omake export}'' -rule at the top level which will export things as they get built. In this way -executable programs will use the libraries which have just been built and -exported. - -Once you have the structure and the {\tt dir.mk} files, you can now create a -build tree for each platform. Go into the {\tt build} directory and run ``{\tt -obuildtree}''. Nearly all the the defaults should be correct. You should use -the actual directory name of the base OMNI tree -(e.g. \verb|/project/omni/version5.5|) rather than -\verb|/project/omni/release|, so that you don't have problems when the release -tree is moved on to the next version. Make sure that your top-level directory -({\tt /project/wobble/version1.0}) is the export tree as well as the first -import tree, and also that the source tree is the same with {\tt src} appended -({\tt /project/wobble/version1.0/src}). - -Go into the {\it platform} subdirectory and do ``{\tt omake export}''. If you -got your {\tt dir.mk} files correct everything will now build and be exported -to your project import/export tree. - -Once the project import/export tree is set up, users can create their own build -trees which import from the project import/export tree. Note that they should -not export to it from their private build trees -- only the ``official'' -project build trees should be used for this purpose. It may be worth -suggesting to your users that they set the environment variable -\verb|OMNI_IMPORT_TREES| to contain your top-level directory (e.g. {\tt -/project/wobble/version1.0}). Whenever they run {\tt obuildtree} it will by -default import from any trees specified in \verb|OMNI_IMPORT_TREES|, saving -them from having to type the full path out each time they create a build tree. - - -\section{Using CORBA in C++ programs} - -Using CORBA in your C++ programs is easy. In your {\tt dir.mk}: -\begin{itemize} -\item the make variable \verb|CORBA_INTERFACES| should contain a list of the -IDL interfaces which your program uses. -\item \verb|DIR_CPPFLAGS| should include \verb|$(CORBA_CPPFLAGS)|. -\item Your rule for building the executable should have both -\verb|$(CORBA_STUB_OBJS)| and \verb|$(CORBA_LIB_DEPEND)| in the dependencies. -\item The rule should also specify \verb|$(CORBA_LIB)| as one of the libraries. -\end{itemize} -For example: - -{\footnotesize \begin{verbatim} -CXXSRCS = foo.cc -OBJS = foo.o -FOO = $(patsubst %,$(BinPattern),foo) - -DIR_CPPFLAGS = $(CORBA_CPPFLAGS) - -CORBA_INTERFACES = wib wob - -$(FOO): $(OBJS) $(CORBA_STUB_OBJS) $(CORBA_LIB_DEPEND) - @(libs="$(CORBA_LIB)"; $(CXXExecutable)) -\end{verbatim}} - -When you run ``{\tt omake}'' for the first time, a {\tt stub} directory should -be created at the top level of the build tree. The IDL compiler is invoked for -each of the IDL files (in this case {\tt wib.idl} and {\tt wob.idl}), and the -stubs generated are compiled and linked in to your executable binary. - -If your program does not use any of the dynamic features of CORBA -(ie. \verb|Any|, \verb|TypeCode|, \verb|DynAny| or the \emph{Dynamic -Invocation Interface} or \emph{Dynamic Skeleton Interface}) then it is -possible to build a binary without this code: -\begin{itemize} -\item use \verb|CORBA_STATIC_STUB_OBJS| rather than \verb|CORBA_STUB_OBJS| in -the dependency list. -\item specify \verb|CORBA_LIB_NODYN| as the CORBA library instead of -\verb|CORBA_LIB|. -\end{itemize} - -For each platform there should be a default implementation of CORBA to which -the {\tt CorbaImplementation} variable is set. At present this is -{\tt OMNIORB2} on Solaris, Digital UNIX, Linux, ATMos and -NT. Alternatively, {\tt ORBIX2} is available on Solaris, Digital UNIX and NT. -You can override the default simply by setting -{\tt CorbaImplementation} before the first rule in your {\tt dir.mk}. -This can either be done inside {\tt dir.mk} itself (for a one-off hack), or in -the {\tt beforedir.mk} of an import tree. If you change {\tt -CorbaImplementation} in this way you must be careful to make sure that all -relevant libraries and stubs have also been built with the same CORBA -implementation. - - -\section{Building Java Programs} - -Building Java programs is quite different to the way C and C++ programs are -built. In Java there is no link stage, and there are no header files. -Instead, Java imposes constraints on the way files are used and named so that -the compiler or the runtime can find interdependent classes. - -The ``make'' program was designed with the C/C++ model of building in mind. -Java doesn't fit into this model very well in a number of ways: - -\begin{itemize} - -\item There is no simple relationship between Java source (\verb|.java|) and -Java class (\verb|.class|) file names. For example a single \verb|.java| file -can generate multiple \verb|.class| files, whose names may change as the -contents of the \verb|.java| file changes. - -\item Checking dependencies between individual \verb|.java| and \verb|.class| -files is not really worth doing separately - it's as expensive as recompiling -all the \verb|.java| files. - -\item The Java package layout must be reflected in the directory hierarchy. In -particular, the Java compiler must be invoked from the top of this package -directory hierarchy so that it can find classes in different packages. - -\end{itemize} - -In essence, \verb|.class| files are too small a unit for "make" to deal with. -Our solution to these problems is for make to deal with Java archive -(\verb|.jar|) files as targets, rather than \verb|.class| files. We treat -\verb|.class| files as intermediate files which exist temporarily to create a -\verb|.jar| file, but can be removed afterwards. - -So in a {\tt dir.mk} you specify that certain \verb|.java| files produce a -\verb|.jar| file - all \verb|.class| files generated from compiling the -\verb|.java| files will be included in the \verb|.jar| file. Whenever a -\verb|.java| file changes, all the \verb|.java| files making up the same -\verb|.jar| file will be recompiled to produce a new \verb|.jar| file. - -For example, say you have a class \verb|HelloWorld| inside the \verb|Hello| -package. Somewhere in your tree you must have a \verb|Hello| directory with -a \verb|HelloWorld.java| inside it. Don't put a {\tt dir.mk} in the -\verb|Hello| directory itself. Instead, at the level above the \verb|Hello| -directory, make a {\tt dir.mk} with the following: - -{\footnotesize \begin{verbatim} -all:: hello.jar - -hello.jar: Hello/HelloWorld.java - @$(CompileJavaSourcesToJar) -\end{verbatim}} - -When you do an \verb|omake|, this should first run the Java compiler to create -any \verb|.class| files, then run the \verb|jar| program to create the -\verb|hello.jar| file. The \verb|CompileJavaSourcesToJar| rule actually leaves -behind the intermediate \verb|.class| files, so in this case you can run your -Java program something like this: - -{\footnotesize \begin{verbatim} -% java Hello.HelloWorld -\end{verbatim}} - -However, only the \verb|.class| files from the last -\verb|CompileJavaSourcesToJar| rule are left behind, so in general you need to -run your Java program from the \verb|.jar| file, something like this: - -{\footnotesize \begin{verbatim} -% java -classpath hello.jar:/usr/local/java/lib/classes.zip Hello.HelloWorld -\end{verbatim}} - -For completeness there should also be a rule for removing the \verb|.class| -files when ``{\tt omake clean}'' is done: - -{\footnotesize \begin{verbatim} -clean:: - @$(CleanJavaClassFiles) -\end{verbatim}} - -You may also want a rule to export the \verb|.jar| file: - -{\footnotesize \begin{verbatim} -export:: hello.jar - @$(ExportJar) -\end{verbatim}} - -As an extra convenience, you don't need to explicitly specify all of the -\verb|.java| files in your tree if you just want them all combined into a -single \verb|.jar| file. You can get the ODE to automatically find all the -\verb|.java| files by doing the following: - -{\footnotesize \begin{verbatim} -hello.jar: $(JAVA_FIND_ALL_SOURCES) - @$(CompileJavaSourcesToJar) -\end{verbatim}} - -Another difference between C/C++ and Java is that Java is platform-independent, -so you only need to build Java code on a single platform. The easiest way to -ensure this is to put an \verb|ifdef| in the dir.mk above the directory with -your Java code, which builds in that directory only for your chosen platform. For example: - -{\footnotesize \begin{verbatim} -SUBDIRS = wib wob - -ifdef SunOS -SUBDIRS += myjavastuff -endif - -all:: - @$(MakeSubdirs) - -export:: - @$(MakeSubdirs) -\end{verbatim}} - -\subsection{Using CORBA in Java programs} - -CORBA stubs fit into this jar-based scheme well - all Java classes generated -from a \verb|.idl| file are bundled into a \verb|.jar| file of the same name. -These are put into a \verb|java_stub| directory at the top of the build tree, -similar to the \verb|stub| directory for C++ stubs. - -As with C++, your {\tt dir.mk} should set \verb|CORBA_INTERFACES| to the IDL -interfaces which your program uses. The rule to build your \verb|.jar| file -should have both \verb|$(CORBA_STUB_JARS)| and \verb|$(CORBA_ORB_JAR)| in the -dependencies. If you want to generate a complete \verb|.jar| which includes -all the ORB and stub classes, you can use the \verb|$(CombineJars)| rule, e.g.: - -{\footnotesize \begin{verbatim} -CORBA_INTERFACES = mrBook - -mrbook_only.jar: $(CORBA_STUB_JARS) $(CORBA_ORB_JAR) $(JAVA_FIND_ALL_SOURCES) - @$(CompileJavaSourcesToJar) - -mrbook.jar: mrbook_only.jar $(CORBA_STUB_JARS) $(CORBA_ORB_JAR) - @$(CombineJars) -\end{verbatim}} - -Often it's useful to put all the generated stub classes into a separate Java -package to avoid name clashes. This can be done by setting the make variable -\verb|CORBA_INTERFACES_JAVA_PACKAGE|, e.g.: - -{\footnotesize \begin{verbatim} -CORBA_INTERFACES_JAVA_PACKAGE = mrBookPackage -\end{verbatim}} - -In this case, all generated stub classes appear in the package -\verb|mrBookPackage|. - -\section{Building on NT} - -\subsection{Installing the GNU-WIN32 environment} - -It's best to set up the GNU-WIN32 tools on a machine's local disk as this makes -a noticeable difference to the speed at which they operate. The tools are -usually put into \verb|C:\gnuwin32| and take up just over a megabyte. If you -need to install them on a new machine you can use a gzip'd tar file from -\verb|/project/omni/misc/gnu-win32-lite.tar.gz|: - -{\footnotesize \begin{verbatim} -C:\>mkdir gnuwin32 -C:\>cd gnuwin32 -C:\gnuwin32>\\hazel\win32app\x86\bin\gunzip -c \\shallot\omni\misc\gnu-win32-l -ite.tar.gz | \\hazel\win32app\x86\bin\tar xf - -\end{verbatim}} - -This should create the directories \verb|C:\gnuwin32\bin| and -\verb|C:\gnuwin32\tmp|. - -\subsection{Setting your path and mounting directories} - -Having made sure the tools are installed on the local machine you now need to -set up your personal environment. First you need to put \verb|C:\gnuwin32\bin| -on your path. If you also have \verb|\\hazel\win32app\x86\bin| on your path -you should make sure that this is searched after the GNU-WIN32 directories -since it contains several unix-like programs which conflict with the GNU-WIN32 -tools. The next thing to do is ``mount'' the {\tt bin} and {\tt tmp} -directories at the root: - -{\footnotesize \begin{verbatim} -C:\>set path=c:\gnuwin32\bin;%path% -C:\>mount c:/gnuwin32/bin /bin -C:\>mount c:/gnuwin32/tmp /tmp -\end{verbatim}} - -You should now be able to run the shell {\tt sh} and all the other tools. - -The next stage is to ``mount'' any other unix file systems you require. These -should be mounted with the same pathname as on unix machines. For example say -you have drive \verb|O:| connected to \verb|\\shallot\omni|, then do -``\verb|mount o: /project/omni|''. It is possible to mount a directory without -connecting it to a drive letter, by doing for example -``\verb|mount //shallot/omni /project/omni|''. - -As well as \verb|/project/omni| and other project directories, you will also -need Microsoft Visual C++ installed on the machine. This must be accessible as -\verb|/msdev| in the GNU-WIN32 environment (since \verb|C:\| is the GNU-WIN32 -root this is the normal place for it to be installed on a machine). - -Now that you have all the right directories mounted you need to finish off -setting your environment variables. You need to make sure that the Visual C++ -tools are available by adding the \verb|/msdev/bin| directory to your path. -You can either add it to your path inside {\tt sh}, in which case you can use -the unix-style directory names, or inside MSDOS / Control Panel in which case -you need to use NT-style names (either using drive letters or the {\it -\verb|\\|machine\verb|\|directory} form depending on how you've mounted each -directory). You also need to set the {\tt INCLUDE} environment variable to -contain \verb|C:\msdev\include| (or whatever the Visual C++ include directory -is). Note that {\tt INCLUDE} should always use an NT-style name since it is -used by the compiler itself. - -Finally you need to set up the environment variables described in section -\ref{settingenv}. Now you should be able to use {\tt obuildtree}, {\tt omake}, -etc just as on any unix platform. - -\section{Building on ATMos} - -\subsection{Introduction} - -Building programs to run on ATMos is quite different from Unix and NT for a -number of reasons. On ATMos, programs are not started on demand as they are -needed. Instead all programs to run on a particular ATMos machine must be -joined into a single ``image'' which is loaded at boot time and cannot be -changed without rebooting the machine. Another reason is that the development -tools for ATMos are non-native -- programs must be cross-compiled on Unix -platforms. And most significantly ATMos has its own tool called ``{\tt -aconfig}'' which is normally used for compiling code and generating the image -files. - -The approach taken in the ODE is to try to make building on ATMos as similar to -building on Unix and NT as possible. This means using the {\tt aconfig} -utility only when it really can't be avoided. Many features of {\tt aconfig} -are not used because the ODE provides a better way of achieving the same goal. -For example header files are placed in the include directories of import/export -trees rather than being made available using {\tt aconfig}'s {\tt Export -Header} directive. - -Unlike the old imake-based ODE, there is no attempt to generate a final ATMos -image file inside an OMNI build tree. It's best to think of creating an ATMos -image as being more like the first stage of {\em invoking} a program rather -than part of the process of building. - -To get a program to run on an ATMos machine you must first build the program -and export it using ``{\tt omake export}''. The end result of this building -and exporting will most probably be an ATMos ``package'' file. - -\label{imageanywhere} -Once a program has been exported in this way, creating an actual image which -contains the program can be done in any directory -- not necessarily underneath -an OMNI build tree or import/export tree. Generating the image should be -a simple matter of creating an {\tt aconfig} SYSTEM file which includes the -package file. For example, to create an ATMos image which contains the -``diner'' program from the {\tt /project/omni/release} tree, simply write a -SYSTEM file like this: - -{\footnotesize \begin{verbatim} -Hardware atb -Set Pthreads -Package core - -ReleasePath /project/omni/release/bin/arm_atmos_3.0/atb -Path /project/omni/release/bin/arm_atmos_3.0/atb - -Package diner -\end{verbatim}} - -The first three lines are the same for all such SYSTEM files (for the ``atb'' -hardware anyway). The next two lines simply tell aconfig to look in the OMNI -import/export tree, and the last line tells aconfig to actually include the -``diner'' package, which it will find inside the OMNI import/export tree. Run -{\tt aconfig} followed by {\tt make} in the normal ATMos way and you should get -an ATMos image which when booted into a machine runs the diner program. - -To generate an image which also has the example calculator client and server -programs, simply add a line ``{\tt Package calc}'' to the SYSTEM file and again -run {\tt aconfig} followed by {\tt make}. - -\subsection{Hello World Revisited} -\label{atmoshello} - -This section goes through the steps necessary to build and run the simple -``hello world'' example on an ATMos platform. Your environment should be set -up exactly as in section \ref{settingenv}. Run {\tt obuildtree} as for unix, -but this time specify the appropriate ATMos platform and make sure that the -build tree {\em does} have an export tree. For example: - -{\footnotesize \begin{verbatim} -$ cd /home/tjr/hello -$ mkdir build -$ cd build -$ obuildtree - -Enter the base OMNI tree for this build tree -> [/project/omni/release] - -Enter the platform name from: -alpha_osf1_3.2 -arm_atmos_3.0/atb -i586_linux_2.0 -sun4_sosV_5.5 -x86_nt_3.5 -> [alpha_osf1_3.2] arm_atmos_3.0/atb - -Enter the destination directory -> [arm_atmos_3.0/atb] - -Does this build tree have an export tree ? -> [y] - -Enter the export tree -> [/home/tjr/hello] - -The first import tree will be /home/tjr/hello (the export tree) -The final import tree will be /project/omni/release (the base OMNI tree) -Enter any other import trees in search order -> - -Does this build tree have any source trees ? -> [y] n - -************************************************************************ - -Creating OMNI build tree "arm_atmos_3.0/atb" for platform "arm_atmos_3.0/atb" - -Export tree is /home/tjr/hello - -Import trees are: -/home/tjr/hello -/project/omni/release - -No source trees - -************************************************************************ - -\end{verbatim}} - -Now go into your new build tree and write the ``hello world'' program: - -{\footnotesize \begin{verbatim} -$ cd arm_atmos_3.0/atb -$ mkdir hello -$ cd hello -$ cat >hello.c -#include -int main() -{ - printf("Hello world!\n"); - return 0; -} -\end{verbatim}} - -The {\tt dir.mk} is just as before: - -{\footnotesize \begin{verbatim} -$ cat >dir.mk -SRCS = hello.c - -HELLO = $(patsubst %,$(BinPattern),hello) - -all:: $(HELLO) - -$(HELLO): hello.o - @$(CExecutable) - -clean:: - $(RM) $(HELLO) - -export:: $(HELLO) - @$(ExportExecutable) -\end{verbatim}} - -You can now build an ``executable binary'' by running ``{\tt omake all}''. The -form this ``executable binary'' takes is actually an object file called -\verb|hello_exe.o| (on ATMos platforms, {\tt BinPattern} is set to -\verb|%_exe.o|): - -{\footnotesize \begin{verbatim} -$ omake all - -make -r -f config/config.mk VPATH= TOP=. CURRENT=. OMAKE_TARGET='all' 'all' - -/project/omni/release/mk/afterdir.mk:105: hello.d: No such file or directory -/bin/sh -ec "arm-gcc -nostdinc -fno-common -fno-builtin -M -I. -I/home/tjr/he - . - . - . -+ catobj -o hello_exe.o hello.o -\end{verbatim}} - -As previously discussed, before the program can be run on an ATMos machine it -needs to be incorporated into an image file. It is this stage where we cannot -avoid using {\tt aconfig}. To help {\tt aconfig} we need to write a {\em -module} file describing our executable. This module file should not contain -any directives other than {\tt Object}, {\tt Executable} and {\tt ULibrary}. -In particular it should not have any {\tt Make} or {\tt Message} -directives.\footnote{see section \ref{atmosmessages} for information on -defining ATMos messages.} - -For a C program like {\tt hello.c} the module file should look like this: - -{\footnotesize \begin{verbatim} -$ cat >hello.module -Object hello_exe.o -{ - Executable hello - ULibrary llibc.o -} -\end{verbatim}} - -Now we need to put the module file and the \verb|_exe.o| file into a directory -in such a way that {\tt aconfig} can use them. This is done by exporting them -to our export tree: - -{\footnotesize \begin{verbatim} -$ omake export - -make -r -f ../config/config.mk VPATH= TOP=.. CURRENT=hello OMAKE_TARGET='export -' 'export' - -+ mkdirhier /home/tjr/hello/bin/arm_atmos_3.0/atb/hello -+ installbsd -c -m 0644 hello.module /home/tjr/hello/bin/arm_atmos_3.0/atb/hell -o -+ installbsd -c -m 0644 hello_exe.o /home/tjr/hello/bin/arm_atmos_3.0/atb/hello -\end{verbatim}} - -At this stage we could create an image by writing a SYSTEM file with {\tt -Module} and {\tt Process} directives in it, but it's cleaner to provide a -single ``package'' file so that the SYSTEM file is kept as simple as possible. -First we need to write the package file: - -{\footnotesize \begin{verbatim} -$ cat >hello.pkg -Module hello -Process hello is hello/hello -\end{verbatim}} - -Now we need one extra {\tt export} rule in {\tt dir.mk}\footnote{Adding this -rule doesn't make {\tt dir.mk} ATMos-specific -- it is simply ignored on -non-ATMos platforms}: - -{\footnotesize \begin{verbatim} -$ cat >>dir.mk - -export:: - @(packages="hello"; $(ExportATMosPackages)) -\end{verbatim}} - -Now run {\tt omake export} again: - -{\footnotesize \begin{verbatim} -$ omake export - -make -r -f ../config/config.mk VPATH= TOP=.. CURRENT=hello OMAKE_TARGET='export -' 'export' - -File hello.module hasn't changed. -File hello_exe.o hasn't changed. -+ mkdirhier /home/tjr/hello/bin/arm_atmos_3.0/atb/software -+ installbsd -c -m 0644 hello.pkg /home/tjr/hello/bin/arm_atmos_3.0/atb/softwar -e -\end{verbatim}} - -Finally the {\tt hello.pkg} in \verb|/home/tjr/hello/bin/arm_atmos_3.0/atb| can -be used to include the hello world program in an ATMos image. As described in -section \ref{imageanywhere}, this can be done in any directory. For example -you could make a directory {\tt image} inside this build tree and create the -image there: - -{\footnotesize \begin{verbatim} -$ cd .. -$ mkdir image -$ cd image -$ cat >SYSTEM -Hardware atb -Set Pthreads -Package core - -ReleasePath /home/tjr/hello/bin/arm_atmos_3.0/atb -Path /home/tjr/hello/bin/arm_atmos_3.0/atb - -Package hello - -$ aconfig -ATMos Config (Jul 24 1996, 13:24:41) - . - . -Config completed successfully. - -$ make -(cd init; make -f makefile) - . - . -syslink -oimage -T0x00010000 -Ereset -Msyslink.map syslink.input - -\end{verbatim}} - -You should now be able to boot up an ATMos machine with this image and see the -magic words ``Hello world!'' come out on the console. - -\subsection{Building C++ programs} - -When building a C++ program for ATMos the module file needs to be slightly -different. For example: - -{\footnotesize \begin{verbatim} -Object prog_exe.o -{ - Executable prog Qhandler pthread_qhandler - ULibrary libpthreads.o - ULibrary plibc.o - ULibrary llibc++.o -} -\end{verbatim}} - -\subsection{Building libraries} - -Building libraries on ATMos is exactly the same as for any other platform. A -statically-linked library gets built with the \verb|StaticLinkLibrary| rule, -and gets exported using the \verb|ExportLibrary| rule. We do not use {\tt -aconfig}'s {\tt Export ULibrary} feature. This means that libraries built in -an OMNI tree cannot easily be used in ATMos programs built outside the OMNI -development environment. - -\subsection{ATMos messages} -\label{atmosmessages} - -Other than creating an ATMos image there is one other situation in which we -cannot avoid using {\tt aconfig}. This is when writing low-level ATMos code -which uses ATMos messages. ATMos message definitions need to be put in module -files, but in the ODE we do not allow these to be the same module files which -describe executables. Module files which define messages should instead be put -in a separate directory at the top of the source or build tree. - -One way of looking at it is that existing ATMos module files need to broken up -into their three different functions: - -\begin{enumerate} -\item Directives which say how to compile programs and libraries are replaced -by rules in {\tt dir.mk}. -\item Directives describing particular executables are put into a module file -in the same directory as the code and {\tt dir.mk} (as described in section -\ref{atmoshello} for the hello world example). -\item Directives defining {\em interfaces}, i.e. messages (and possibly -hardware configuration), are put into module files in a separate ``ATMos -interface'' directory. -\end{enumerate} - -So say you have a couple of ATMos messages you want to define. Make a -directory called \verb|atmos_if| at the top level of your build tree, and -inside there write a module file which just defines the messages: - -{\footnotesize \begin{verbatim} -$ cd /home/tjr/hello/build/arm_atmos_3.0/atb -$ mkdir atmos_if -$ cd atmos_if -$ cat >mymsg.module -MessageId 0x00200000 - -Message ONE -{ - int a; -} - -Message TWO -{ - char *b -} -\end{verbatim}} - -Note that it's preferable to use the {\tt MessageId} directive rather than -allowing message IDs to be allocated automatically. If you don't use the {\tt -MessageId} directive then automatic allocation of message IDs happens in the -normal way. When you have multiple import trees each defining messages with -automatically allocated IDs, it can be very difficult to ensure consistency -between libraries and programs built in different places. - -Now you need to write a {\tt dir.mk} to specify that the messages in {\tt -mymsg.module} should be exported and then run ``{\tt omake export}'': - -{\footnotesize \begin{verbatim} -$ cat >dir.mk -all:: - @echo - @echo 'No "all" rule here. Do "omake export" to export ATMos' - @echo 'interface files.' - @echo - -export:: - @(modules="mymsg"; $(ExportATMosInterfaces)) -$ omake export - -make -r -f ../config/config.mk VPATH= TOP=.. CURRENT=atmos_if OMAKE_TARGET='exp -ort' 'export' - -echo Module mymsg >> /home/tjr/hello/bin/arm_atmos_3.0/atb/all_interfaces -+ mkdirhier /home/tjr/hello/bin/arm_atmos_3.0/atb/mymsg -+ installbsd -c -m 0644 mymsg.module /home/tjr/hello/bin/arm_atmos_3.0/atb/myms -g -echo Hardware atb > /home/tjr/hello/bin/arm_atmos_3.0/atb/SYSTEM -echo Set Pthreads >> /home/tjr/hello/bin/arm_atmos_3.0/atb/SYSTEM -echo Package core >> /home/tjr/hello/bin/arm_atmos_3.0/atb/SYSTEM -echo Path /home/tjr/hello/bin/arm_atmos_3.0/atb >> /home/tjr/hello/bin/arm_atmo -s_3.0/atb/SYSTEM -cat /home/tjr/hello/bin/arm_atmos_3.0/atb/all_interfaces >> /home/tjr/hello/bin -/arm_atmos_3.0/atb/SYSTEM -+ cd /home/tjr/hello/bin/arm_atmos_3.0/atb -+ aconfig -ATMos Config (Jul 24 1996, 13:24:41) - . - . -Config completed successfully. -\end{verbatim}} - -If you look in the ...\verb|/bin/arm_atmos_3.0/atb| directory you will see that -the message definitions now appear in the \verb|init/messages.h| file. Code in -your build tree which tries to include \verb|messages.h| should find this file, -and thus have access to all message definitions which were exported from the -\verb|atmos_if| directory. - -One other thing to note is that we haven't written a top-level {\tt dir.mk} in -this example yet. It is important that when doing ``{\tt omake export}'' at -the top of the build tree, the \verb|atmos_if| directory is processed before -any directories with code which might use the message definitions. In this -case the top-level {\tt dir.mk} should be something like: - -{\footnotesize \begin{verbatim} -SUBDIRS = atmos_if hello - -export:: - @$(MakeSubdirs) -\end{verbatim}} - -\subsubsection{Multiple import trees defining ATMos messages} - -Any ATMos build tree should pull in the \verb|messages.h| file from the first -import tree it finds which has any message definitions. So if only one import -tree has any message definitions then things work fine. However if two import -trees both have message definitions then somehow all the messages defined in -the two trees need to be combined into a single \verb|messages.h| file. The -{\tt ExportATMosInterfaces} rule should cope with this, but it is worth -explaining how this is done so that potential problems can be avoided. - -Say you have an ATMos build tree which exports to and imports from your own -import/export tree, and also imports from a project tree. When you do ``{\tt -omake export}'' inside the \verb|atmos_if| directory of your build tree, it -generates a {\tt messages.h} file inside the \verb|bin/arm_atmos...| directory -of your import/export tree, as explained above. However, because this build -tree also imports from the project tree, the {\tt messages.h} file generated -contains not only the message definitions from your own \verb|atmos_if| -directory, but also the message definitions from the project tree. - -There are two situations where you have to be careful: - -\begin{itemize} - -\item If someone changes message definitions in the project tree, they will do -``{\tt omake export}'' inside the project build tree, thus updating the {\tt -messages.h} file in the project import/export tree. However, the {\tt -messages.h} file in your import/export tree will continue to have the old -message definitions from the project tree. To keep things consistent you need -to redo ``{\tt omake export}'' in the \verb|atmos_if| directory of your own -build tree, even though none of your message definitions have changed. - -\item If you want to import from two unrelated project trees (say the streams -tree and the spirit tree) then by default you will only get the messages from -whichever tree you import from first. If you want to combine the two sets of -message definitions you will need to create your own import/export tree, and -inside your build tree have an \verb|atmos_if| directory even if you don't -define any messages yourself (the {\tt dir.mk} for such a directory would -simply have an {\tt ExportATMosInterfaces} rule without specifying any module -files). Note that in this case it is imperative that the message definitions -in the two project trees use {\tt MessageId} directives -- otherwise the same -message will have a different ID in your local import/export tree from the ID -it has in the project import/export tree. - -\end{itemize} - -\end{document} diff -Nru omniorb-dfsg-4.1.6/doc/tex/omniidl.tex omniorb-dfsg-4.2.2/doc/tex/omniidl.tex --- omniorb-dfsg-4.1.6/doc/tex/omniidl.tex 2005-07-19 10:34:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/omniidl.tex 2017-05-10 23:52:28.000000000 +0000 @@ -44,20 +44,7 @@ % URL-like things: -\usepackage[T1]{url} -\newcommand{\email}{\begingroup \urlstyle{sf}\Url} -\newcommand{\file}{\begingroup \urlstyle{tt}\Url} -\newcommand{\envvar}{\begingroup \urlstyle{tt}\Url} -\newcommand{\makevar}{\begingroup \urlstyle{tt}\Url} -\newcommand{\corbauri}{\begingroup \urlstyle{tt}\Url} -%BEGIN LATEX -\newcommand{\weburl}{\begingroup \urlstyle{sf}\Url} -%END LATEX -%HEVEA\def\weburl{\begingroup% -%HEVEA\def\UrlLeft##1\UrlRight{\ahrefurl{##1}}% -%HEVEA\urlstyle{tt}% -%HEVEA\Url} - +\usepackage{omniURLDefs} \addtolength{\oddsidemargin}{-0.2in} \addtolength{\evensidemargin}{-0.6in} diff -Nru omniorb-dfsg-4.1.6/doc/tex/omniNames.tex omniorb-dfsg-4.2.2/doc/tex/omniNames.tex --- omniorb-dfsg-4.1.6/doc/tex/omniNames.tex 2008-02-14 11:46:32.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/omniNames.tex 2013-02-22 16:42:44.000000000 +0000 @@ -1,18 +1,30 @@ -\documentclass[a4paper,11pt,twoside]{article} +\documentclass[draft,a4paper,11pt,twoside]{article} \usepackage[T1]{fontenc} -\usepackage{palatino} +\usepackage{textcomp} +\usepackage[scaled=0.9]{DejaVuSansMono} +\usepackage[scaled=0.9]{DejaVuSans} +\usepackage[scaled=0.9]{DejaVuSerif} +\linespread{1.05} + \addtolength{\oddsidemargin}{-0.2in} \addtolength{\evensidemargin}{-0.6in} \addtolength{\textwidth}{0.5in} + \pagestyle{headings} \newcommand{\cmdline}[1]{\texttt{#1}} +\newcommand{\code}[1]{\texttt{#1}} +\usepackage[T1]{url} +\newcommand{\email}{\begingroup \urlstyle{sf}\Url} +\newcommand{\file}{\begingroup \urlstyle{tt}\Url} +\newcommand{\envvar}{\begingroup \urlstyle{tt}\Url} -\title{The OMNI Naming Service} -\date{14 February 2008} +\title{The omniNames CORBA Naming Service} + +\date{omniORB 4.2} \begin{document} @@ -20,63 +32,63 @@ \section{Introduction} -The OMNI Naming Service (\emph{omniNames}) is an omniORB -implementation of the OMG's COS Naming Service Specification. It -offers a way for a client to turn a human-readable name into an object -reference, on which the client can subsequently invoke operations in -the normal way. See the OMG specification for full details of the -functionality provided by the Naming Service. +omniNames is omniORB's implementation of the OMG's COS Naming Service +Specification. It offers a way for a client to turn a human-readable +name into an object reference, on which the client can subsequently +invoke operations in the normal way. See the OMG specification for +full details of the functionality provided by the Naming Service. The Naming Service stores a set of bindings of names to objects. These bindings can be arranged as an arbitrary directed graph, although they are often arranged in a tree hierarchy. Each node in -the graph is a \emph{naming context}. There is a ``root'' context at +the graph is a \emph{naming context}. There is a `root' context at which name lookups usually start. This is the object returned by the -call to \verb|CORBA::ORB::resolve_initial_references("NameService").| +call to \code{CORBA::ORB::resolve\_initial\_references("NameService")}. + +\section{Data file} -\section{`Log' file} +omniNames persists its contents in a data file. The data file takes +the form of a `redo log', to which it writes out an entry every time a +change is made to the naming graph. The directory in which this log +file is written can be specified with the \cmdline{-datadir} command +line option or the \envvar{OMNINAMES_DATADIR} environment variable. +When omniNames is restarted it uses the data file so that it can +regenerate the naming graph. -The Naming Service is often part of the bootstrapping process of other -CORBA programs. For this reason, if an instance of omniNames crashes -(or the machine on which it runs is rebooted), it is important that -certain aspects of its operation persist upon restarting. Firstly the -root context of the Naming Service should always be accessible through -the same object reference. This helps the ORB to implement the -\verb|resolve_initial_references| call by allowing the object -reference to be stored in a configuration file, for example. -Secondly, the naming graph with all its bindings should persist -between invocations. - -To achieve this, omniNames generates a redo log file, to which it -writes out an entry every time a change is made to the naming graph. -The directory in which this log file is written can be specified with -the \verb|OMNINAMES_LOGDIR| environment variable. When omniNames is -restarted it uses the log file so that it can regenerate the naming -graph. - -Periodically the log file is checkpointed, removing unnecessary -entries from the log file. The idle time between checkpoints can be -set with the \verb|OMNINAMES_ITBC| environment variable. It defaults -to 15 minutes. +Periodically the data file is checkpointed, removing unnecessary +entries from the file. The idle time between checkpoints defaults to +15 minutes. That can be overridden by specifying a period in seconds +in the \envvar{OMNINAMES_ITBC} environment variable. -\section{Starting omniNames and setting omniORB.cfg} +The name of the data file name normally includes the hostname, in the +form \file{omninames-}\textit{hostname}\file{.dat}. To suppress +inclusion of the hostname, start omniNames with the +\cmdline{-nohostname} option. + +Previous versions of omniNames referred to the data file as a `log +file', and the file had the extension `\file{.log}'. When omniNames +starts up, it will accept a data file with the extension `\file{.log}' +and replace it with one with the extension `\file{.dat}'. + + +\section{Starting omniNames and configuring omniORB} When starting omniNames for the first time, you can either let it start with the default TCP port of 2809, or you can specify the port -number on which it should listen. This is written to the log file so +number on which it should listen. This is written to the data file so that on subsequent invocations it will listen on the same port number and thus can be accessible through the same object reference. When omniNames starts up successfully it writes the stringified object reference for its root context on standard error. -At startup, omniORB tries to read the configuration file -\verb|omniORB.cfg| to obtain the object reference to the root context -of the Naming Service. This object reference is returned by -\verb|resolve_initial_references("NameService")|. There are a number -of methods of specifying the root naming context in -\verb|omniORB.cfg|---see the omniORB manual for details. - +At startup, omniORB reads its configuration from \file{omniORB.cfg} or +from the Windows registry. Amongst other settings, the configuration +contains the object reference to the root context of the Naming +Service. This object reference is returned by +\code{resolve\_initial\_references("NameService")}. There are a number +of methods of specifying the root naming context---see the omniORB +manual for details. \section{Command line parameters} @@ -84,7 +96,7 @@ \vspace{\baselineskip} -\begin{tabular}{lp{.8\textwidth}} +\noindent\begin{tabular}{lp{.8\textwidth}} %HEVEA\\ \cmdline{-help} & @@ -96,35 +108,31 @@ \cmdline{-always} & In conjunction with \cmdline{-start}, always start up - omniNames, even if its log file already exists.\\[.5\baselineskip] + omniNames, even if its data file already exists.\\[.5\baselineskip] -\cmdline{-logdir }\textit{directory} & - Specifies the directory for the redo log file, overriding the +\cmdline{-datadir }\textit{directory} & + Specifies the directory for the data file, overriding the default.\\[.5\baselineskip] +\cmdline{-logdir }\textit{directory} & + Equivalent to \cmdline{-datadir}, for compatibility with previous + omniNames versions.\\[.5\baselineskip] + \cmdline{-errlog }\textit{filename} & - Causes output that would normally be sent to stderr to go to the + Causes trace output that would normally be sent to stderr to go to the specified file instead.\\[.5\baselineskip] \cmdline{-nohostname} & - Normally, omniNames includes the host name in the name of the redo - log file. This option disables that, meaning the log file can be - used on a different host, or if the host name - changes.\\[.5\baselineskip] - -\cmdline{-ignoreport} & - omniNames normally adds its own endpoint, based on the port - specification (given with \cmdline{-start} or stored in the log - file). This option causes it to ignore the port. It should be used - in conjunction with specific \cmdline{-ORBendPoint} options to - ensure object references are stable.\\[.5\baselineskip] + Normally, omniNames includes the host name in the name of the data + file. This option disables that, meaning the data file can be used + on a different host, or if the host name changes.\\[.5\baselineskip] \cmdline{-install }\textit{[port]} & On Windows, install omniNames service. See below.\\[.5\baselineskip] \cmdline{-manual} & - On Windows, specify that the service should be started - manually. See below.\\[.5\baselineskip] + On Windows, specify that the service should be configured to + require manual start. See below.\\[.5\baselineskip] \cmdline{-remove} & On Windows, uninstall omniNames service. See below.\\[.5\baselineskip] @@ -132,19 +140,47 @@ \end{tabular} +\section{Machines with multiple IP addresses} -\section{Windows service} +The CORBA naming service is a tree (or graph) of \code{NamingContext} +CORBA objects. For each of those CORBA objects, the object reference +contains details about the \emph{endpoint}---i.e.\ the host address +and port---that is used to contact the object. + +When the machine running omniNames has multiple IP addresses, omniORB +listens for incoming connections on all addresses, but it arbitrarily +picks one of the addresses to publish in object references. It might +pick the `wrong' one, meaning that clients connect to the configured +root context successfully, but then fail to connect to the +sub-contexts. To force omniORB to publish the correct IP address, use +the \cmdline{-ORBendPointPublish} command line parameter: + +\begin{quote} +\cmdline{-ORBendPointPublish giop:tcp:}\textit{address}\cmdline{:} +\end{quote} + +\noindent where \textit{address} can be an IP address or a host name. + +Occasionally, it is necessary to limit omniNames to listen on just one +of a machine's IP addresses. To do that, use \cmdline{-ORBendPoint} to +specify the address to listen on. In this case, you should also +specify a port (e.g.\ the standard 2809), otherwise an arbitrary +ephemeral port will be used for the endpoint: + +\begin{quote} +\cmdline{-ORBendPoint giop:tcp:}\textit{address}\cmdline{:2809} +\end{quote} -omniNames can be run as a Windows service. -To install the service, run with the \cmdline{-install} command line -option, with a port to override the default 2809 if necessary. The -command line should include any other parameters of relevance, such as -the log directory and error log file. It is particularly important to -specify an error log file, since the service runs in an environment -where stderr goes nowhere. Similarly, if omniORB tracing is requested -with the various \cmdline{-ORBtrace} options, \cmdline{-ORBtraceFile} -should be specified, otherwise the trace messages vanish. +\section{Windows service} + +omniNames can be run as a Windows service. To install the service, run +with the \cmdline{-install} command line option, with a port to +override the default 2809 if necessary. The command line should +include any other parameters of relevance, such as the data directory +and error log file. It is particularly important to specify an error +log file, since the service runs in an environment where stderr goes +nowhere. The service is normally configured to start at system startup time. Specifying \cmdline{-manual} configures it for manual startup. @@ -157,5 +193,4 @@ with the \cmdline{-remove} option. - \end{document} diff -Nru omniorb-dfsg-4.1.6/doc/tex/omniORB.bib omniorb-dfsg-4.2.2/doc/tex/omniORB.bib --- omniorb-dfsg-4.1.6/doc/tex/omniORB.bib 2005-07-19 10:34:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/omniORB.bib 2012-04-02 09:54:44.000000000 +0000 @@ -10,6 +10,17 @@ note = {From \weburl{http://www.omg.org/cgi-bin/doc?formal/01-12-01}} } +@Manual{corba31-spec, + key = {OMG}, + title = {The {C}ommon {O}bject {R}equest {B}roker: + {A}rchitecture and Specification}, + organization = {Object Management Group}, + edition = {3.1}, + month = {January}, + year = 2008, + note = {From \weburl{http://www.omg.org/cgi-bin/doc?formal/08-01-04}} +} + @Manual{cxxmapping, title = {C++ Language Mapping}, key = {OMG}, diff -Nru omniorb-dfsg-4.1.6/doc/tex/omniORB.tex omniorb-dfsg-4.2.2/doc/tex/omniORB.tex --- omniorb-dfsg-4.1.6/doc/tex/omniORB.tex 2011-06-01 23:11:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/omniORB.tex 2017-05-10 23:52:28.000000000 +0000 @@ -1,22 +1,21 @@ -\documentclass[11pt,twoside,a4paper]{book} +\documentclass[11pt,oneside,a4paper]{book} \usepackage[T1]{fontenc} -\usepackage{palatino} +\usepackage{textcomp} +\usepackage[scaled=0.9]{DejaVuSansMono} +\usepackage[scaled=0.9]{DejaVuSans} +\usepackage[scaled=0.9]{DejaVuSerif} +\linespread{1.05} -% To make the PostScript version: +\usepackage{tocloft} + +% To make the PDF version: % -% $ latex omniORB +% $ pdflatex omniORB % $ bibtex omniORB -% $ latex omniORB -% $ latex omniORB -% $ latex omniORB -% $ dvips omniORB -% -% To make the PDF version (having already made the PS version): -% % $ pdflatex omniORB % $ pdflatex omniORB % -% To make the HTML version, you need HeVeA 1.05. +% To make the HTML version, you need HeVeA % % $ hevea omniORB % $ hacha omniORB.html @@ -62,31 +61,24 @@ {\end{itemize}} % URL-like things: -\usepackage[T1]{url} -\newcommand{\email}{\begingroup \urlstyle{sf}\Url} -\newcommand{\file}{\begingroup \urlstyle{tt}\Url} -\newcommand{\envvar}{\begingroup \urlstyle{tt}\Url} -\newcommand{\makevar}{\begingroup \urlstyle{tt}\Url} -\newcommand{\corbauri}{\begingroup \urlstyle{tt}\Url} -%BEGIN LATEX -\newcommand{\weburl}{\begingroup \urlstyle{sf}\Url} -%END LATEX -%HEVEA\def\weburl{\begingroup% -%HEVEA\def\UrlLeft##1\UrlRight{\ahrefurl{##1}}% -%HEVEA\urlstyle{tt}% -%HEVEA\Url} - +\usepackage{omniURLDefs} % Mark-up for configuration options \newcommand{\confopt}[2] {\vspace{\baselineskip}\par\noindent\code{#1} ~~ \textit{default} = \code{#2}} +\newcommand{\confoptnd}[1] + {\vspace{\baselineskip}\par\noindent\code{#1}} + + %BEGIN LATEX \makeatletter \renewcommand{\confopt}[2] {\vspace{\baselineskip}\par\noindent\code{#1} ~~ \textit{default} = \code{#2}\\[-1ex]\@afterheading} +\renewcommand{\confoptnd}[1] + {\vspace{\baselineskip}\par\noindent\code{#1}\\[-1ex]\@afterheading} \makeatother %END LATEX @@ -129,6 +121,7 @@ abovecaptionskip=0pt, belowcaptionskip=0pt, xleftmargin=\parindent, + escapechar=@, fontadjust} @@ -153,7 +146,7 @@ \pdftrue \fi \ifpdf - \hypersetup{colorlinks,citecolor=red,urlcolor=blue} + \hypersetup{colorlinks,citecolor=blue,urlcolor=blue} \fi @@ -164,86 +157,28 @@ \pagenumbering{roman} \pagestyle{empty} - \begin{center} \vfill { \Huge -The omniORB version 4.1\\[4mm] -User's Guide +The omniORB version 4.2\\[4mm] +Users' Guide } \vfill { \Large Duncan Grisby\\ -{\normalsize (\textit{email: \href{mailto:dgrisby@apasphere.com}% - {\email{dgrisby@apasphere.com}}})}% - \\[2ex] -% -Apasphere Ltd.\\[4ex] -% -Sai-Lai Lo\\[2ex] -% -David Riddoch\\[2ex] -% -AT\&T Laboratories Cambridge\\ +{\normalsize (\textit{\href{mailto:dgrisby@apasphere.com}% + {\email{dgrisby@apasphere.com}}})}% + \\[2ex] } - -\vfill -\vfill -July 2009 \vfill \end{center} -\clearpage - -{\Large \bf Changes and Additions, July 2007} -\begin{itemize} -\item Updates for omniORB 4.1.1. -\end{itemize} - -\vspace{\baselineskip} - -{\Large \bf Changes and Additions, June 2005} -\begin{itemize} -\item New omniORB 4.1 features. -\end{itemize} - -\vspace{\baselineskip} - -{\Large \bf Changes and Additions, October 2004} -\begin{itemize} -\item Packaging stubs into DLLs. -\end{itemize} - -\vspace{\baselineskip} - -{\Large \bf Changes and Additions, July 2004} -\begin{itemize} -\item Minor updates. -\end{itemize} - -\vspace{\baselineskip} - -{\Large \bf Changes and Additions, November 2002} -\begin{itemize} -\item Per thread timeouts. -\item Implement missing interceptors. -\item Minor fixes. -\end{itemize} - -\vspace{\baselineskip} - -{\Large \bf Changes and Additions, June 2002} -\begin{itemize} -\item Updated to omniORB 4.0. -\end{itemize} - - \cleardoublepage %BEGIN LATEX @@ -264,29 +199,71 @@ \chapter{Introduction} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -omniORB is an Object Request Broker (ORB) that implements the 2.6 -specification of the Common Object Request Broker Architecture -(CORBA)~\cite{corba26-spec}\footnote{Most of the 2.6 features have -been implemented. The features still missing in this release are -listed in section~\ref{sec:missing}. Where possible, backward -compatibility has been maintained up to specification 2.0.}. It has -passed the Open Group CORBA compliant testsuite (for CORBA 2.1) and -was one of the three ORBs to be granted the CORBA brand in June -1999\footnote{More information can be found at -\weburl{http://www.opengroup.org/press/7jun99_b.htm}}. +omniORB is an Object Request Broker (ORB) that implements version 2.6 +of the Common Object Request Broker Architecture +(CORBA)~\cite{corba26-spec} specification. Where possible, backward +compatibility has been maintained back to specification 2.0. It passed +the Open Group CORBA compliant testsuite (for CORBA 2.1) and was one +of the three ORBs to be granted the CORBA brand in June 1999. This user guide tells you how to use omniORB to develop CORBA applications. It assumes a basic understanding of CORBA. In this chapter, we give an overview of the main features of omniORB -and what you need to do to setup your environment to run omniORB. +and what you need to do to set up your environment to run omniORB. \section{Features} +omniORB is quite feature-rich, but it does not slavishly implement +every last part of the CORBA specification. The goal is to provide the +most generally useful parts of the specification in a clean and +efficient manner. Highlights are: + +\begin{itemize} + +\item C++ and Python language bindings. + +\item Support for the complete Portable Object Adapter (POA) specification. + +\item Support for the Interoperable Naming Service (INS). + +\item Internet Inter-ORB Protocol (IIOP 1.2) is used as the native + protocol. + +\item The omniORB runtime is fully multithreaded. It uses platform + thread support encapsulated with a small class library, omnithread, + to abstract away from differences in native thread APIs. + +\item TypeCode and type Any are supported. + +\item DynAny is supported. + +\item The Dynamic Invocation and Dynamic Skeleton interfaces are supported. + +\item Valuetype and abstract interfaces are supported. + +\item Asynchronous Method Invocation (AMI) supported, including both + polling and callback models. + +\item Extensive control over connection management. + +\item Soft real-time features including call deadlines and timeouts. + +\item A COS Naming Service, omniNames. + +\item Many platforms are supported, including most Unix platforms and + Windows. + +\item It has been successfully tested for interoperability via IIOP with + other ORBs. + +\end{itemize} + + \subsection{Multithreading} omniORB is fully multithreaded. To achieve low call overhead, -unnecessary call-multiplexing is eliminated. With the default +unnecessary call multiplexing is eliminated. With the default policies, there is at most one call in-flight in each communication channel between two address spaces at any one time. To do this without limiting the level of concurrency, new channels connecting the two @@ -300,26 +277,27 @@ messages are fragmented, so the marshaller can start transmission before it knows how large the entire message will be. -From version 4.0 onwards, omniORB also supports a flexible thread -pooling policy, and supports sending multiple interleaved calls on a -single connection. This policy leads to a small amount of additional -call overhead, compared to the default thread per connection model, -but allows omniORB to scale to extremely large numbers of concurrent -clients. +omniORB also supports a flexible thread pool policy, and supports +sending multiple interleaved calls on a single connection. This policy +leads to a small amount of additional call overhead, compared to the +default thread per connection model, but allows omniORB to scale to +extremely large numbers of concurrent clients. + \subsection{Portability} -omniORB has always been designed to be portable. It runs on many -flavours of Unix, Windows, several embedded operating systems, and -relatively obscure systems such as OpenVMS and Fujitsu-Siemens BS2000. -It is designed to be easy to port to new platforms. The IDL to C++ -mapping for all target platforms is the same. +omniORB runs on many flavours of Unix, Windows, several embedded +operating systems, and relatively obscure systems such as OpenVMS and +Fujitsu-Siemens BS2000. It is designed to be easy to port to new +platforms. The IDL to C++ mapping for all target platforms is the +same. omniORB uses real C++ exceptions and nested classes. It keeps to the CORBA specification's standard mapping as much as possible and does -not use the alternative mappings for C++ dialects. The only exception -is the mapping of IDL modules, which can use either namespaces or -nested classes. +not use the alternative mappings for C++ dialects. The only small +exception is the mapping of IDL modules, which can use either +namespaces according to the standard, or nested classes for truly +ancient C++ compilers without namespace support. omniORB relies on native thread libraries to provide multithreading capability. A small class library (omnithread~\cite{tjr96a}) is used @@ -329,11 +307,17 @@ platform that either supports the POSIX thread standard or has a thread package that supports similar capabilities. +Partly for historical reasons, and partly to support users with +archaic compilers, omniORB does not use the C++ standard library. + +The omniORB IDL compiler, omniidl, requires Python 2.5, 2.6 or 2.7. + + \subsection{Missing features} \label{sec:missing} -omniORB is not (yet) a complete implementation of the CORBA 2.6 core. -The following is a list of the most significant missing features. +omniORB is not a complete implementation of the CORBA 2.6 core. The +following is a list of the most significant missing features. \begin{itemize} @@ -347,40 +331,35 @@ \end{itemize} -These features may be implemented in the short to medium term. It is -best to check out the latest status on the omniORB home page -(\weburl{http://omniorb.sourceforge.net/}). - - \section{Setting up your environment} \label{sec:setup} To get omniORB running, you first need to install omniORB according to -the instructions in the installation notes for your platform. Most -Unix platforms can use the Autoconf \file{configure} script to -automate the configuration process. +the instructions in the installation notes for your platform. See +\file{README.FIRST.txt} at the top of the omniORB tree for +instructions. Most Unix platforms can use the Autoconf +\file{configure} script to automate the configuration process. Once omniORB is installed in a suitable location, you must configure -it according to your required set-up. The configuration can be set -with a configuration file, environment variables, command-line -arguments or, on Windows, the Windows registry. +it according to your required setup. The configuration can be set with +a configuration file, environment variables, command-line arguments +or, on Windows, the Windows registry. \begin{itemize} \item On Unix platforms, the omniORB runtime looks for the environment -variable \envvar{OMNIORB_CONFIG}. If this variable is defined, it -contains the pathname of the omniORB configuration file. If the -variable is not set, omniORB will use the compiled-in pathname to -locate the file (by default \file{/etc/omniORB.cfg}). - -\item On Win32 platforms (Windows NT, 2000, 95, 98), omniORB first -checks the environment variable \envvar{OMNIORB_CONFIG}~to obtain the -pathname of the configuration file. If this is not set, it then -attempts to obtain configuration data in the system registry. It -searches for the data under the key -\file{HKEY_LOCAL_MACHINE\SOFTWARE\omniORB}. + variable \envvar{OMNIORB_CONFIG}. If this variable is defined, it + contains the pathname of the omniORB configuration file. If the + variable is not set, omniORB will use the compiled-in pathname to + locate the file (by default \file{/etc/omniORB.cfg}). + +\item On Win32 / Win64 platforms, omniORB first checks the environment + variable \envvar{OMNIORB_CONFIG} to obtain the pathname of the + configuration file. If this is not set, it then attempts to obtain + configuration data in the system registry. It searches for the data + under the key \file{HKEY_LOCAL_MACHINE\SOFTWARE\omniORB}. \end{itemize} @@ -397,14 +376,15 @@ InitRef = NameService=corbaname::my.host.name \end{verbatim} -See section~\ref{sec:corbaname} for full details of corbaname URIs. +\noindent See section~\ref{sec:corbaname} for full details of +corbaname URIs. \section{Platform specific variables} -To compile omniORB programs correctly, several C++ preprocessor defines -\textbf{must} be specified to identify the target platform. On Unix -platforms where omniORB was configured with Autoconf, the +To compile omniORB programs correctly, several C++ preprocessor +defines \emph{must} be specified to identify the target platform. On +Unix platforms where omniORB was configured with Autoconf, the \file{omniconfig.h} file sets these for you. On other platforms, and Unix platforms when Autoconf is not used, you must specify the following defines: @@ -414,12 +394,10 @@ \hline Platform & CPP defines \\ \hline -Windows NT 4.0,2000,XP & \verb|__x86__ __NT__ __OSVERSION__=4 __WIN32__| \\ +Windows & \verb|__x86__ __NT__ __OSVERSION__=4 __WIN32__| \\ Windows NT 3.5 & \verb|__x86__ __NT__ __OSVERSION__=3 __WIN32__| \\ -Windows 95 & \verb|__x86__ __WIN32__| \\ - Sun Solaris 2.5 & \verb|__sparc__ __sunos__ __OSVERSION__=5| \\ HPUX 10.x & \verb|__hppa__ __hpux__ __OSVERSION__=10| \\ @@ -490,18 +468,17 @@ \begin{enumerate} -\item define the object interface in IDL; -\item use the IDL compiler to generate the stub code\footnote{The stub -code is the C++ code that provides the object mapping as defined in -the CORBA specification.}; -\item provide the \term{servant} object implementation; +\item define the object interface in IDL +\item use the IDL compiler to generate the stub code, which provides + the object mapping as defined in the CORBA specification +\item provide the \term{servant} object implementation \item write the client code. \end{enumerate} These examples are in the \file{src/examples/echo} directory of the -omniORB distribution; there are several other examples one directory -above that in \file{src/examples}. +omniORB distribution; there are several other examples in +\file{src/examples}. \section{Specifying the Echo interface in IDL} @@ -510,11 +487,10 @@ \begin{idllisting} interface Echo { - string echoString(in string mesg); + string echoString(in string mesg); }; \end{idllisting} - If you are new to IDL, you can learn about its syntax in Chapter 3 of the CORBA 2.6 specification~\cite{corba26-spec}. For the moment, you only need to know that the interface consists of a single operation, @@ -522,18 +498,20 @@ a copy of the same string. The interface is written in a file, called \file{echo.idl}. It is part -of the CORBA standard that all IDL files should have the extension -`\file{.idl}', although omniORB does not enforce this. +of the CORBA standard that all IDL files must have the extension +`\file{.idl}', although omniORB does not enforce this. In the omniORB +distribution, this file is in \file{idl/echo.idl}. For simplicity, the interface is defined in the global IDL namespace. -You should avoid this practice for the sake of object reusability. If -every CORBA developer defines their interfaces in the global IDL -namespace, there is a danger of name clashes between two independently -defined interfaces. Therefore, it is better to qualify your interfaces -by defining them inside \code{module} names. Of course, this does not -eliminate the chance of a name clash unless some form of naming -convention is agreed globally. Nevertheless, a well-chosen module name -can help a lot. +You should normally avoid this practice for the sake of object +reusability. If every CORBA developer defines their interfaces in the +global IDL namespace, there is a danger of name clashes between two +independently defined interfaces. Therefore, it is better to qualify +your interfaces by defining them inside \code{module} names. Of +course, this does not eliminate the chance of a name clash unless some +form of naming convention is agreed globally. Nevertheless, a +well-chosen module name can help a lot. + \section{Generating the C++ stubs} @@ -544,8 +522,8 @@ following files are produced: \begin{nsitemize} -\item\file{echo.hh} -\item\file{echoSK.cc} +\item \file{echo.hh} +\item \file{echoSK.cc} \end{nsitemize} \noindent omniidl must be invoked with the \cmdline{-bcxx} argument to @@ -556,16 +534,23 @@ omniidl -bcxx echo.idl \end{makelisting} -\noindent If you are using our make environment (ODE), you don't need -to invoke omniidl explicitly. In the example file \file{dir.mk}, we -have the following line: +Note that the names \file{echo.hh} and \file{echoSK.cc} are not +defined in the C++ mapping standard. Other CORBA implementations may +use different file names. To aid migration omniidl from other +implementations, omniidl has options to override the default output +file names. See section~\ref{sec:cxx_backend} for details. + + +If you are using our make environment, you don't need to invoke +omniidl explicitly. In the example file \file{dir.mk}, we have the +following line: \begin{makelisting} CORBA_INTERFACES = echo \end{makelisting} -\noindent That is all we need to instruct ODE to generate the stubs. -Remember, you won't find the stubs in your working directory because +\noindent That is all we need to instruct the build system to generate +the stubs. You won't find the stubs in your working directory because all stubs are written into the \file{stub} directory at the top level of your build tree. @@ -581,119 +566,129 @@ Object references and servants are quite separate entities, and it is important not to confuse the two. Client code deals purely with object references, so there can be no confusion; object implementation code -must deal with both object references and servants. omniORB 4 uses +must deal with both object references and servants. omniORB uses distinct C++ types for object references and servants, so the C++ compiler will complain if you use a servant when an object reference is expected, or vice-versa. -\begin{statement} -\centerline{\textbf{Warning}} -omniORB 2.x \emph{did not} use distinct types for object references -and servants, and often accepted a pointer to a servant when the CORBA -specification says it should only accept an object reference. If you -have code which relies on this, it will not compile with omniORB 3.x -or 4.x, even under the BOA compatibility mode. -\end{statement} +\section{A quick look at the C++ mapping} + +The C++ stubs conform to the standard mapping defined in the CORBA +specification~\cite{cxxmapping}. Sadly, since it pre-dates the C++ +standard library, the C++ language mapping is quite hard to use, +especially because it has complex memory management rules. + +The best way to understand the mapping is to read either the +specification or, better, a book about using CORBA from C++. Reading +the code generated by omniidl is hard-going, and it is difficult to +distinguish the parts you need to know from the implementation +details. +\subsection{Mapping overview} -\section{A Quick Tour of the C++ stubs} +For interface \type{Echo}, omniidl generates four things of note: -The C++ stubs conform to the standard mapping defined in the CORBA -specification~\cite{cxxmapping}. It is important to understand the -mapping before you start writing any serious CORBA applications. -Before going any further, it is worth knowing what the mapping looks -like. - -For the example interface \intf{Echo}, the C++ mapping for its object -reference is \type{Echo\_ptr}. The type is defined in \file{echo.hh}. -The relevant section of the code is reproduced below. The stub code -produced by other ORBs will be functionally equivalent to omniORB's, -but will almost certainly look very different. - -\begin{cxxlisting} -class Echo; -class _objref_Echo; -class _impl_Echo; -typedef _objref_Echo* Echo_ptr; +\begin{itemize} +\item class \type{Echo}, containing static functions and type + definitions + +\item \type{Echo\_ptr}, an \emph{object reference} type with pointer + semantics +\item \type{Echo\_var}, a memory management helper for + \type{Echo\_ptr} + +\item class \type{POA\_Echo}, the server-side \emph{skeleton} class + +\end{itemize} + + +\subsection{Interface scope type} + +A C++ class \type{Echo} is defined to hold a number of static +functions and type definitions. It looks like this: + +\begin{cxxlisting} class Echo { public: - // Declarations for this interface type. typedef Echo_ptr _ptr_type; typedef Echo_var _var_type; static _ptr_type _duplicate(_ptr_type); static _ptr_type _narrow(CORBA::Object_ptr); static _ptr_type _nil(); - - // ... methods generated for internal use }; +\end{cxxlisting} + +The \type{\_ptr\_type} and \type{\_var\_type} typedefs are there to +facilitate template programming. The static functions are described +below. -class _objref_Echo : - public virtual CORBA::Object, public virtual omniObjRef { -public: - char * echoString(const char* mesg); - // ... methods generated for internal use +\subsection{Object reference pointer type} + +For interface \intf{Echo}, the mapping defines the object reference +type \type{Echo\_ptr} which has pointer semantics. The \type{\_ptr} +type provides access to the interface's operations. The concrete type +of an object reference is opaque, i.e.\ you must not make any +assumptions about how an object reference is implemented. You can +imagine it looks something like this: + +\begin{cxxlisting} +class @\textit{private\_class}@ : public @\textit{some\_base\_class}@ { + char* echoString(const char* mesg); }; + +typedef @\textit{something}@ Echo_ptr; \end{cxxlisting} -In a compliant application, the operations defined in an object -interface should \textbf{only} be invoked via an object reference. -This is done by using arrow (`\code{->}') on an object reference. -For example, the call to the operation \op{echoString} would be -written as \code{obj->echoString(mesg)}. +To use an object reference, you use the arrow operator `\code{->}' to +invoke its operations, but you must not use it as a C++ pointer in any +other respect. It is non-compliant to convert it to \type{void*}, +perform arithmetic or relational operations including testing for +equality using \code{operator==}. + +In some CORBA implementations, \type{Echo\_ptr} is a typedef to +\type{Echo*}. In omniORB, it is not---the object reference type is +distinct from class \type{Echo}. -It should be noted that the concrete type of an object reference is -opaque, i.e.\ you must not make any assumption about how an object -reference is implemented. In our example, even though \type{Echo\_ptr} -is implemented as a pointer to the class \type{\_objref\_Echo}, it -should not be used as a C++ pointer, i.e.\ conversion to \type{void*}, -arithmetic operations, and relational operations including testing for -equality using \code{operator==}, must not be performed on the type. -In addition to class \type{\_objref\_Echo}, the mapping defines three -static member functions in the class \type{Echo}: \op{\_nil}, -\op{\_duplicate}, and \op{\_narrow}. +\subsubsection{Nil object reference} -The \op{\_nil} function returns a nil object reference of the Echo -interface. The following call is guaranteed to return TRUE: +Object references can be \emph{nil}. To obtain a nil object reference +for interface \type{Echo}, call \op{Echo::\_nil}. To test if an +object reference is nil, use \op{CORBA::\_is\_nil}: \begin{cxxlisting} CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil()); \end{cxxlisting} -Remember, \op{CORBA::is\_nil} is the only compliant way to check if an -object reference is nil. You should not use the equality +\op{Echo::\_nil} is the only compliant way to obtain a nil Echo +reference, and \op{CORBA::is\_nil} is the only compliant way to check +if an object reference is nil. You should not use the equality \code{operator==}. Many C++ ORBs use the null pointer to represent a -nil object reference; \emph{omniORB does not}. +nil object reference, but \emph{omniORB does not}. -The \op{\_duplicate} function returns a new object reference of the -\intf{Echo} interface. The new object reference can be used -interchangeably with the old object reference to perform an operation -on the same object. Duplications are required to satisfy the C++ -mapping's reference counting memory management. -All CORBA objects inherit from the generic object -\type{CORBA::Object}. \type{CORBA::\dsc{}Object\_ptr} is the object -reference type for \type{CORBA::Object}. Any \type{\_ptr} object -reference is therefore conceptually inherited from -\type{CORBA::Object\_ptr}. In other words, an object reference such as -\type{Echo\_ptr} can be used in places where a -\type{CORBA::Object\_ptr} is expected. +\subsubsection{Object reference lifecycle} -The \op{\_narrow} function takes an argument of type -\type{CORBA::Object\_ptr} and returns a new object reference of the -\intf{Echo} interface. If the actual (runtime) type of the argument -object reference can be narrowed to \type{Echo\_ptr}, \op{\_narrow} -will return a valid object reference. Otherwise it will return a nil -object reference. Note that \op{\_narrow} performs an implicit -duplication of the object reference, so the result must be released. -Note also that \op{\_narrow} may involve a remote call to check the -type of the object, so it may throw CORBA system exceptions such as -\code{COMM\_FAILURE} or \code{OBJECT\_NOT\_EXIST}. +Object references are reference counted. That is, the opaque C++ +objects on the client side that implement \type{Echo\_ptr} are +reference counted, so they are deleted when the count goes to zero. +The lifetime of an object reference has no bearing at all on the +lifetime of the CORBA object to which it is a reference---when an +object reference is deleted, it has \emph{no effect} on the object in +the server. + +Reference counting for \type{Echo} object references is performed with +\op{Echo::\dsc{}\_duplicate} and \op{CORBA::release}. + +The \op{\_duplicate} function returns a new object reference of the +Echo interface. The new object reference can be used interchangeably +with the old object reference to perform an operation on the same +object. To indicate that an object reference will no longer be accessed, you must call the \op{CORBA::release} operation. Its signature is as @@ -707,56 +702,33 @@ \end{cxxlisting} Once you have called \op{CORBA::release} on an object reference, you -must no longer use that reference. This is because the associated -resources may have been deallocated. Notice that we are referring to -the resources associated with the object reference and \textbf{not the -servant object}. Servant objects are not affected by the lifetimes of -object references. In particular, servants are not deleted when all +may no longer use that reference. This is because the associated +resources may have been deallocated. Remember that we are referring to +the resources associated with the object reference and \emph{not the + servant object}. Servant objects are not affected by the lifetimes +of object references. In particular, servants are not deleted when all references to them have been released---CORBA does not perform distributed garbage collection. -As described above, the equality \code{operator==} should not be used -on object references. To test if two object references are equivalent, -the member function \op{\_is\_equivalent} of the generic object -\type{CORBA::Object} can be used. Here is an example of its usage: - -\begin{cxxlisting} -Echo_ptr A; -... // initialise A to a valid object reference -Echo_ptr B = A; -CORBA::Boolean true_result = A->_is_equivalent(B); -// Note: the above call is guaranteed to be TRUE -\end{cxxlisting} - -You have now been introduced to most of the operations that can be -invoked via \type{Echo\_ptr}. The generic object \type{CORBA::Object} -provides a few more operations and all of them can be invoked via -\type{Echo\_ptr}. These operations deal mainly with CORBA's dynamic -interfaces. You do not have to understand them in order to use the C++ -mapping provided via the stubs. +Nil object references are \emph{not} reference counted, so there is no +need to call \op{\_duplicate} and \op{release} with them, although it +does no harm. Since object references must be released explicitly, their usage is -prone to error and can lead to memory leakage. The mapping defines the -\term{object reference variable} type to make life easier. In our -example, the variable type \type{Echo\_var} is defined\footnote{In -omniORB, all object reference variable types are instantiated from the -template type \type{\_CORBA\_ObjRef\_Var}.}. - -The \type{Echo\_var} is more convenient to use because it will -automatically release its object reference when it is deallocated or -when assigned a new object reference. For many operations, mixing data -of type \type{Echo\_var} and \type{Echo\_ptr} is possible without any -explicit operations or castings\footnote{However, the implementation -of the type conversion operator between \type{Echo\_var} and -\type{Echo\_ptr} varies slightly among different C++ compilers; you -may need to do an explicit cast if the compiler complains about the -conversion being ambiguous.}. For instance, the operation -\op{echoString} can be called using the arrow (`\code{->}') on a +prone to error and can lead to memory leaks or invalid memory +accesses. The mapping defines the \term{object reference variable} +type \type{Echo\_var} to make life somewhat easier. + +The \type{Echo\_var} is more convenient to use because it +automatically releases its object reference when it goes out of scope +or when assigned a new object reference. For many operations, mixing +data of type \type{Echo\_var} and \type{Echo\_ptr} is possible without +any explicit operations or casting. For instance, the \op{echoString} +operation can be called using the arrow (`\code{->}') on a \type{Echo\_var}, as one can do with a \type{Echo\_ptr}. The usage of \type{Echo\_var} is illustrated below: - \begin{cxxlisting} Echo_var a; Echo_ptr p = ... // somehow obtain an object reference @@ -771,20 +743,62 @@ // a now holds a copy of p. \end{cxxlisting} +The mappings of many other IDL data types include \type{\_var} types +with similar semantics. + + +\subsubsection{Object reference inheritance} + +All CORBA objects inherit from the generic object +\type{CORBA::Object}. \type{CORBA::\dsc{}Object\_ptr} is the object +reference type for base \type{CORBA::Object}. Object references can be +implicitly \emph{widened} to base interface types, so this is valid: + +\begin{cxxlisting} +Echo_ptr echo_ref = // get reference from somewhere +CORBA::Object_ptr base_ref = echo_ref; // widen +\end{cxxlisting} + +An object reference such as \type{Echo\_ptr} can be used in places +where a \type{CORBA::\dsc{}Object\_ptr} is expected. Conversely, the +\op{Echo::\_narrow} function takes an argument of type +\type{CORBA::Object\_ptr} and returns a new object reference of the +\intf{Echo} interface. If the actual (runtime) type of the argument +object reference can be narrowed to \type{Echo\_ptr}, \op{\_narrow} +will return a valid object reference. Otherwise it will return a nil +object reference. Note that \op{\_narrow} performs an implicit +duplication of the object reference, so the result must be released. +Note also that \op{\_narrow} may involve a remote call to check the +type of the object, so it may throw CORBA system exceptions such as +\code{TRANSIENT} or \code{OBJECT\_NOT\_EXIST}. + + +\subsubsection{Object reference equivalence} + +As described above, the equality \code{operator==} should not be used +on object references. To test if two object references are equivalent, +the member function \op{\_is\_equivalent} of the generic object +\type{CORBA::Object} can be used. Here is an example of its usage: + +\begin{cxxlisting} +Echo_ptr a; +... // initialise a to a valid object reference +Echo_ptr b = a; +CORBA::Boolean true_result = a->_is_equivalent(a); +// Note: the above call is guaranteed to be true +\end{cxxlisting} + +\op{\_is\_equivalent} does \emph{not} contact the object to check for +equivalence---it uses purely local knowledge, meaning that it is +possible to construct situations in which two object references refer +to the same object, but \op{\_is\_equivalent} does not consider them +equivalent. If you need a strong sense of object identity, you must +implement it with explicit IDL operations. \subsection{Servant Object Implementation} \label{stubobjimpl} -Before the Portable Object Adapter (POA) specification, many of the -details of how servant objects should be implemented and registered -with the system were unspecified, so server-side code was not portable -between ORBs. The POA specification rectifies that. omniORB 4 still -supports the old omniORB 2.x BOA mapping, but you should always use -the POA mapping for new code. BOA code and POA code can coexist within -a single program. See section~\ref{sec:BOAcompat} for details of the -BOA compatibility, and problems you may encounter. - For each object interface, a \term{skeleton} class is generated. In our example, the POA specification says that the skeleton class for interface \intf{Echo} is named \type{POA\_Echo}. A servant @@ -801,8 +815,7 @@ public: Echo_ptr _this(); - virtual char * echoString(const char* mesg) = 0; - // ... + virtual char * echoString(const char* mesg) = 0; }; \end{cxxlisting} @@ -820,29 +833,34 @@ It is through this abstract function that an implementation class provides the implementation of the \op{echoString} operation. Notice that its signature is the same as the \op{echoString} function that -can be invoked via the \type{Echo\_ptr} object reference. +can be invoked via the \type{Echo\_ptr} object reference. This will be +the case most of the time, but object reference operations for certain +parameter types use special helper classes to facilitate correct +memory management. \item[\op{\_this}]\mbox{}\\ % -This function returns an object reference for the target object, -provided the POA policies permit it. The returned value must be -deallocated via \op{CORBA::\dsc{}release}. See section~\ref{objeg1} -for an example of how this function is used. +The \op{\_this} function returns an object reference for the target +object, provided the POA policies permit it. The returned value must +be deallocated via \op{CORBA::\dsc{}release}. See +section~\ref{objeg1} for an example of how this function is used. \end{description} + \section{Writing the servant implementation} \label{objimpl} -You define an implementation class to provide the servant -implementation. There is little constraint on how you design your -implementation class except that it has to inherit from the stubs' -skeleton class and to implement all the abstract functions defined in -the skeleton class. Each of these abstract functions corresponds to an -operation of the interface. They are the hooks for the ORB to perform -upcalls to your implementation. - -Here is a simple implementation of the Echo object. +You define a class to provide the servant implementation. There is +little constraint on how you design your implementation class except +that it has to inherit from the skeleton class\footnote{Rather than + deriving from the skeleton class, an alternative is to use a + \term{tie} template, described in section~\ref{sec:tie}.} and to +implement all the abstract functions defined in the skeleton +class. Each of these abstract functions corresponds to an operation of +the interface. They are the hooks for the ORB to perform upcalls to +your implementation. Here is a simple implementation of the Echo +object. \begin{cxxlisting} class Echo_i : public POA_Echo @@ -859,24 +877,24 @@ } \end{cxxlisting} -There are four points to note here: +\noindent There are four points to note here: \begin{description} \item[Storage Responsibilities]\mbox{}\\ % -A string, which is used both as an in argument and the return value of -\op{echoString}, is a variable size data type. Other examples of -variable size data types include sequences, type `any', etc. For these -data types, you must be clear about whose responsibility it is to -allocate and release the associated storage. As a rule of thumb, the -client (or the caller to the implementation functions) owns the -storage of all IN arguments, the object implementation (or the callee) -must copy the data if it wants to retain a copy. For OUT arguments and -return values, the object implementation allocates the storage and -passes the ownership to the client. The client must release the -storage when the variables will no longer be used. For details, -please refer to the C++ mapping specification. +String, which is used both as an in argument and the return value of +\op{echoString}, is a variable sized data type. Other examples of +variable sized data types include sequences, type `any', etc. For +these data types, you must be clear about whose responsibility it is +to allocate and release the associated storage. As a rule of thumb, +the client (or the caller to the implementation functions) owns the +storage of all \emph{in} arguments, the object implementation (or the +callee) must copy the data if it wants to retain a copy. For +\emph{out} arguments and return values, the object implementation +allocates the storage and passes the ownership to the client. The +client must release the storage when the variables will no longer be +used. For details, see the C++ mapping specification. \item[Multi-threading]\mbox{}\\ % @@ -940,17 +958,17 @@ 14 15 dest = e->echoString(src); 16 -17 cerr << "I said,\"" << src << "\"." +17 cout << "I said,\"" << src << "\"." 18 << " The Object said,\"" << dest <<"\"" << endl; 19 } \end{cxxlisting} \lstset{numbers=none,gobble=0} -Briefly, the \op{hello} function accepts a generic object reference. -The object reference (\code{obj}) is narrowed to \type{Echo\_ptr}. If -the object reference returned by \op{Echo::\_narrow} is not nil, the +The \op{hello} function accepts a generic object reference. The +object reference (\code{obj}) is narrowed to \type{Echo\_ptr}. If the +object reference returned by \op{Echo::\dsc{}\_narrow} is not nil, the operation \op{echoString} is invoked. Finally, both the argument to -and the return value of \op{echoString} are printed to \code{cerr}. +and the return value of \op{echoString} are printed to \code{cout}. The example also illustrates how \type{T\_var} types are used. As was explained in the previous section, \type{T\_var} types take care of @@ -982,13 +1000,12 @@ mapping specification for details of the String\_var mapping.}. Under the C++ mapping, \type{T\_var} types are provided for all the -non-basic data types. It is obvious that one should use automatic -variables whenever possible both to avoid memory leaks and to maximise -performance. However, when one has to allocate data items on the heap, -it is a good practice to use the \type{T\_var} types to manage the -heap storage. +non-basic data types. One should use automatic variables whenever +possible both to avoid memory leaks and to maximise performance. +However, when one has to allocate data items on the heap, it is a good +practice to use the \type{T\_var} types to manage the heap storage. -\section{Example 1 --- Colocated Client and Implementation} +\section{Example 1 --- Colocated Client and Servant} \label{objeg1} Having introduced the client and the object implementation, we can now @@ -1005,25 +1022,24 @@ 1 int 2 main(int argc, char **argv) 3 { - 4 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB4"); + 4 CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv, "omniORB4"); 5 6 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); 7 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); 8 - 9 Echo_i *myecho = new Echo_i(); + 9 PortableServer::Servant_var myecho = new Echo_i(); 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); 11 12 Echo_var myechoref = myecho->_this(); -13 myecho->_remove_ref(); -14 -15 PortableServer::POAManager_var pman = poa->the_POAManager(); -16 pman->activate(); -17 -18 hello(myechoref); -19 -20 orb->destroy(); -21 return 0; -22 } +13 +14 PortableServer::POAManager_var pman = poa->the_POAManager(); +15 pman->activate(); +16 +17 hello(myechoref); +18 +19 orb->destroy(); +20 return 0; +21 } \end{cxxlisting} \lstset{numbers=none,gobble=0} @@ -1084,7 +1100,10 @@ \item[Line 9]\mbox{}\\ % An instance of the Echo servant is initialised using the \code{new} -operator. +operator. The \type{PortableServer::Servant\_var<>} template +automatically is analogous to the \type{T\_var} types generated by the +IDL compiler. It releases our reference to the servant when it goes +out of scope. \item[Line 10]\mbox{}\\ % @@ -1097,8 +1116,8 @@ \item[Line 12]\mbox{}\\ % The object reference is obtained from the servant object by calling -\op{\_this}. Like all object references, the return value of -\op{\_this} must be released by \op{CORBA::release} when it is no +its \op{\_this} method. Like all object references, the return value +of \op{\_this} must be released by \op{CORBA::release} when it is no longer needed. In this case, we assign it to a \type{\_var} type, so the release is implicit at the end of the function. @@ -1116,15 +1135,6 @@ to any object references that are passed around within the same address space or received from other address spaces via remote calls. -\item[Line 13]\mbox{}\\ -% -The server code releases the reference it holds to the servant -object. The only reference to that object is now held by the POA (it -gained the reference on the call to \op{activate\_object}), so when -the object is deactivated (or the POA is destroyed), the servant -object will be deleted automatically. After this point, the code must -no longer use the \code{myecho} pointer. - \end{description} @@ -1193,7 +1203,7 @@ example. In the next example, we shall introduce a better way of passing the object reference using the CORBA Naming Service. -\subsection{Object Implementation: Making a Stringified Object Reference} +\subsection{Making a Stringified Object Reference} The \op{main} function of the server side is reproduced below. The full listing (\file{eg2_impl.cc}) can be found at the end of this @@ -1208,34 +1218,33 @@ 5 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); 6 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); 7 - 8 Echo_i* myecho = new Echo_i(); + 8 PortableServer::Servant_var myecho = new Echo_i(); 9 10 PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); 11 12 obj = myecho->_this(); 13 CORBA::String_var sior(orb->object_to_string(obj)); -14 cerr << (char*)sior << endl; +14 cerr << sior << endl; 15 -16 myecho->_remove_ref(); -17 -18 PortableServer::POAManager_var pman = poa->the_POAManager(); -19 pman->activate(); -20 -21 orb->run(); -22 orb->destroy(); -23 return 0; -24 } +16 PortableServer::POAManager_var pman = poa->the_POAManager(); +17 pman->activate(); +18 +19 orb->run(); +20 orb->destroy(); +21 return 0; +22 } \end{cxxlisting} \lstset{numbers=none,gobble=0} The stringified object reference is obtained by calling the ORB's \op{object\_to\_\dsc{}string} function (line 13). This results in a -string starting with the signature `IOR:' and followed by some -hexadecimal digits. All CORBA 2 compliant ORBs are able to convert the -string into its internal representation of a so-called Interoperable -Object Reference (IOR). The IOR contains the location information and -a key to uniquely identify the object implementation in its own -address space. From the IOR, an object reference can be constructed. +string starting with the signature `\code{IOR:}' and followed by quite +a lot of hexadecimal digits. All CORBA compliant ORBs are able to +convert the string into its internal representation of a so-called +Interoperable Object Reference (IOR). The IOR contains the location +information and a key to uniquely identify the object implementation +in its own address space. From the IOR, an object reference can be +constructed. \subsection{Client: Using a Stringified Object Reference} \label{clnt2} @@ -1252,7 +1261,7 @@ CORBA::Object_var obj = orb->string_to_object(argv[1]); hello(obj); } -catch(CORBA::TRANSIENT&) { +catch (CORBA::TRANSIENT&) { ... // code to handle transient exception... } \end{cxxlisting} @@ -1272,20 +1281,10 @@ which indicates that the object could not be contacted at the time of the call, usually meaning the server is not running. -All system exceptions inherit from \type{CORBA::SystemException}. With -compilers that properly support RTTI\footnote{Run Time Type -Identification}, a single catch of \code{CORBA::SystemException} will -catch all the different system exceptions thrown by omniORB. - -When omniORB detects an internal error such as corrupt data or invalid -conditions, it raises the exception \type{omniORB::fatalException}. -When this exception is raised, it is not sensible to proceed with any -operation that involves the ORB's runtime. It is best to exit the -program immediately. The exception structure carried by -\type{omniORB::fatalException} contains the exact location (the file -name and the line number) where the exception is raised. In most -cases, \type{fatalException}s occur due to incorrect behaviour by the -application code, but they may be caused by bugs in omniORB. +All system exceptions inherit from \type{CORBA::SystemException}. +Unless you have a truly ancient C++ compiler, a single catch of +\code{CORBA::SystemException} will catch all the different system +exceptions. \subsection{Lifetime of a CORBA object} @@ -1296,11 +1295,18 @@ of its servant object. Persistent objects can live beyond the destruction of their servant object, the POA they were created in, and even their process. Persistent objects are, of course, only -contactable when their associated servants are active, or can be -activated by their POA with a servant manager\footnote{The POA itself -can be activated on demand with an adapter activator.}. A reference to -a persistent object can be published, and will remain valid even if -the server process is restarted. +contactable when their associated server processes are running, and +their servants are active or can be activated by their POA with a +servant manager\footnote{The POA itself can be activated on demand + with an adapter activator.}. A reference to a persistent object can +be published, and will remain valid even if the server process is +restarted. + +To support persistent objects, the servants must be activated in their +POA with the same object identifier each time. Also, the server must +be configured with the same \term{endpoint} details so it is +contactable in the same way as previous invocations. See +section~\ref{sec:endpoints} for details. A POA's Lifespan Policy determines whether objects created within it are transient or persistent. The Root POA has the \code{TRANSIENT} @@ -1320,7 +1326,7 @@ In this example, the object implementation uses the Naming Service~\cite{corbaservices} to pass on the object reference to the -client. This method is far more practical than using stringified +client. This method is often more practical than using stringified object references. The full listing of the object implementation (\file{eg3_impl.cc}) and the client (\file{eg3_clt.cc}) can be found at the end of this chapter. @@ -1364,19 +1370,17 @@ \begin{cxxlisting} CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv); - -CORBA::Object_var initServ; -initServ = orb->resolve_initial_references("NameService"); +CORBA::Object_var obj = orb->resolve_initial_references("NameService"); CosNaming::NamingContext_var rootContext; -rootContext = CosNaming::NamingContext::_narrow(initServ); +rootContext = CosNaming::NamingContext::_narrow(obj); \end{cxxlisting} -Remember, omniORB constructs its internal list of initial references -at initialisation time using the information provided in the -configuration file \file{omniORB.cfg}, or given on the command -line. If this file is not present, the internal list will be empty and -\op{resolve\_initial\_references} will raise a +Remember from section~\ref{sec:setup}, omniORB constructs its internal +list of initial references at initialisation time using the +information provided in the configuration file \file{omniORB.cfg}, or +given on the command line. If this file is not present, the internal +list will be empty and \op{resolve\_initial\_references} will raise a \code{CORBA::ORB::\dsc{}InvalidName} exception. \subsection{The Naming Service Interface} @@ -1385,11 +1389,11 @@ Naming Service interface. You should consult the CORBA services specification~\cite{corbaservices} (chapter 3). The code listed in \file{eg3_impl.cc} and \file{eg3_clt.cc} are good examples of how the -service can be used. Please spend time to study the examples -carefully. +service can be used. \section{Example 4 --- Using tie implementation templates} +\label{sec:tie} omniORB supports \term{tie} implementation templates as an alternative way of providing servant classes. If you use the \texttt{-Wbtp} option @@ -1402,7 +1406,7 @@ identical to \file{eg3_impl.cc} with only a few changes. Firstly, the servant class \type{Echo\_i} does not inherit from any -stub classes. This is the main benefit of using the template class +skeleton classes. This is the main benefit of using the template class because there are applications in which it is difficult to require every servant class to derive from CORBA classes. @@ -1426,9 +1430,9 @@ defined in the interface. As used above, the tie template takes ownership of the \type{Echo\_i} instance, and deletes it when the tie object goes out of scope. The tie constructor has an optional boolean -argument (defaulted to true) which indicates whether or not it should -delete the servant object. For full details of using tie templates, -see the CORBA C++ mapping specification. +argument (defaulted to \code{true}) which indicates whether or not it +should delete the servant object. For full details of using tie +templates, see the CORBA C++ mapping specification. \clearpage @@ -1436,899 +1440,91 @@ \subsection{eg1.cc} -\begin{cxxlisting} -// eg1.cc - This is the source code of example 1 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// In this example, both the object implementation and the -// client are in the same process. -// -// Usage: eg1 -// - -#include - -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif - -// This is the object implementation. +\lstinputlisting[language=C++]{../../src/examples/echo/eg1.cc} -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; +\clearpage +\subsection{eg2\_impl.cc} +\lstinputlisting[language=C++]{../../src/examples/echo/eg2_impl.cc} -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} +\clearpage +\subsection{eg2\_clt.cc} +\lstinputlisting[language=C++]{../../src/examples/echo/eg2_clt.cc} -////////////////////////////////////////////////////////////////////// +\clearpage +\subsection{eg3\_impl.cc} -// This function acts as a client to the object. +\lstinputlisting[language=C++]{../../src/examples/echo/eg3_impl.cc} -static void hello(Echo_ptr e) -{ - if( CORBA::is_nil(e) ) { - cerr << "hello: The object reference is nil!\n" << endl; - return; - } +\clearpage +\subsection{eg3\_clt.cc} - CORBA::String_var src = (const char*) "Hello!"; - // String literals are (char*) rather than (const char*) on some - // old compilers. Thus it is essential to cast to (const char*) - // here to ensure that the string is copied, so that the - // CORBA::String_var does not attempt to 'delete' the string - // literal. +\lstinputlisting[language=C++]{../../src/examples/echo/eg3_clt.cc} - CORBA::String_var dest = e->echoString(src); +\clearpage +\subsection{eg3\_tieimpl.cc} - cout << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} +\lstinputlisting[language=C++]{../../src/examples/echo/eg3_tieimpl.cc} -////////////////////////////////////////////////////////////////////// -int main(int argc, char** argv) -{ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{C++ language mapping} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Now that you are familiar with the basics, it is important to +familiarise yourself with the standard IDL to C++ language mapping. +The mapping is described in detail in~\cite{cxxmapping}. If you have +not done so, you should obtain a copy of the document and use that as +the programming guide to omniORB. - try { - // Initialise the ORB. - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - // Obtain a reference to the root POA. - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - // We allocate the object on the heap. Since this is a reference - // counted object, it will be deleted by the POA when it is no - // longer needed. - Echo_i* myecho = new Echo_i(); - - // Activate the object. This tells the POA that this object is - // ready to accept requests. - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object. - Echo_var myechoref = myecho->_this(); - - // Decrement the reference count of the object implementation, so - // that it will be properly cleaned up when the POA has determined - // that it is no longer needed. - myecho->_remove_ref(); - - // Obtain a POAManager, and tell the POA to start accepting - // requests on its objects. - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); +The specification is not an easy read. The alternative is to use one +of the books on CORBA programming. For instance, Henning and Vinoski's +`Advanced CORBA Programming with C++'~\cite{henning1999} includes many +example code fragments to illustrate how to use the C++ mapping. - // Do the client-side call. - hello(myechoref); - // Clean up all the resources. - orb->destroy(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} -\end{cxxlisting} +\section{omniORB 2 BOA compatibility} +\label{sec:BOAcompat} +Before the Portable Object Adapter (POA) specification, many of the +details of how servant objects should be implemented and registered +with the system were unspecified, so server-side code was not portable +between ORBs. The POA specification rectifies that. For compatibility, +omniORB 4 still supports the old omniORB 2.x BOA mapping, but you +should always use the POA mapping for new code. BOA code and POA code +can coexist within a single program. -\clearpage -\subsection{eg2\_impl.cc} +If you use the \cmdline{-WbBOA} option to omniidl, it will generate +skeleton code with (nearly) the same interface as the old omniORB 2 +BOA mapping, as well as code to be used with the POA. Note that since +the major problem with the BOA specification was that server code was +not portable between ORBs, it is unlikely that omniORB's BOA +compatibility will help you much if you are moving from a different +BOA-based ORB. -\begin{cxxlisting} -// eg2_impl.cc - This is the source code of example 2 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the object implementation. -// -// Usage: eg2_impl -// -// On startup, the object reference is printed to cerr as a -// stringified IOR. This string should be used as the argument to -// eg2_clt. -// - -#include - -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif +The BOA compatibility permits the majority of BOA code to compile +without difficulty. However, there are a number of constructs which +relied on omniORB 2 implementation details which no longer work. -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; +\begin{itemize} +\item omniORB 2 did not use distinct types for object references and +servants, and often accepted a pointer to a servant when the CORBA +specification says it should only accept an object reference. Such +code will not compile under omniORB 4. -char* Echo_i::echoString(const char* mesg) -{ - cout << "Upcall " << mesg << endl; - return CORBA::string_dup(mesg); -} +\item The reverse is true for \op{BOA::obj\_is\_ready}. It now only +works when passed a pointer to a servant object, not an object +reference. The more commonly used mechanism of calling +\code{\_obj\_is\_ready(boa)} on the servant object still works as +expected. -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - Echo_i* myecho = new Echo_i(); - - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object, and print it out as a - // stringified IOR. - obj = myecho->_this(); - CORBA::String_var sior(orb->object_to_string(obj)); - cout << (char*)sior << endl; - - myecho->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} -\end{cxxlisting} - - -\clearpage -\subsection{eg2\_clt.cc} - -\begin{cxxlisting} -// eg2_clt.cc - This is the source code of example 2 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the client. The object reference is given as a -// stringified IOR on the command line. -// -// Usage: eg2_clt -// - -#include - -#ifdef HAVE_STD -# include -# include - using namespace std; -#else -# include -#endif - - -static void hello(Echo_ptr e) -{ - CORBA::String_var src = (const char*) "Hello!"; - - CORBA::String_var dest = e->echoString(src); - - cout << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - - - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - if( argc != 2 ) { - cerr << "usage: eg2_clt " << endl; - return 1; - } - - CORBA::Object_var obj = orb->string_to_object(argv[1]); - Echo_var echoref = Echo::_narrow(obj); - if( CORBA::is_nil(echoref) ) { - cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; - return 1; - } - for (CORBA::ULong count=0; count<10; count++) - hello(echoref); - - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} -\end{cxxlisting} - - -\clearpage -\subsection{eg3\_impl.cc} - -\begin{cxxlisting} -// eg3_impl.cc - This is the source code of example 3 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the object implementation. -// -// Usage: eg3_impl -// -// On startup, the object reference is registered with the -// COS naming service. The client uses the naming service to -// locate this object. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// test [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include - -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif - -static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr); - - -class Echo_i : public POA_Echo -{ -public: - inline Echo_i() {} - virtual ~Echo_i() {} - virtual char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int -main(int argc, char **argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - Echo_i* myecho = new Echo_i(); - - PortableServer::ObjectId_var myechoid = poa->activate_object(myecho); - - // Obtain a reference to the object, and register it in - // the naming service. - obj = myecho->_this(); - - CORBA::String_var x; - x = orb->object_to_string(obj); - cout << x << endl; - - if( !bindObjectToName(orb, obj) ) - return 1; - - myecho->_remove_ref(); - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Boolean -bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return 0; - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch (CORBA::ORB::InvalidName&) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return 0; - } - - try { - // Bind a context called "test" to the root context: - - CosNaming::Name contextName; - contextName.length(1); - contextName[0].id = (const char*) "test"; // string copied - contextName[0].kind = (const char*) "my_context"; // string copied - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - CosNaming::NamingContext_var testContext; - try { - // Bind the context to root. - testContext = rootContext->bind_new_context(contextName); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - // If the context already exists, this exception will be raised. - // In this case, just resolve the name and assign testContext - // to the object returned: - CORBA::Object_var obj; - obj = rootContext->resolve(contextName); - testContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(testContext) ) { - cerr << "Failed to narrow naming context." << endl; - return 0; - } - } - - // Bind objref with name Echo to the testContext: - CosNaming::Name objectName; - objectName.length(1); - objectName[0].id = (const char*) "Echo"; // string copied - objectName[0].kind = (const char*) "Object"; // string copied - - try { - testContext->bind(objectName, objref); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - testContext->rebind(objectName, objref); - } - // Note: Using rebind() will overwrite any Object previously bound - // to /test/Echo with obj. - // Alternatively, bind() can be used, which will raise a - // CosNaming::NamingContext::AlreadyBound exception if the name - // supplied is already bound to an object. - - // Amendment: When using OrbixNames, it is necessary to first try bind - // and then rebind, as rebind on it's own will throw a NotFoundexception if - // the Name has not already been bound. [This is incorrect behaviour - - // it should just bind]. - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - return 0; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - return 1; -} -\end{cxxlisting} - - -\clearpage -\subsection{eg3\_clt.cc} - -\begin{cxxlisting} -// eg3_clt.cc - This is the source code of example 3 used in Chapter 2 -// "The Basics" of the omniORB user guide. -// -// This is the client. It uses the COSS naming service -// to obtain the object reference. -// -// Usage: eg3_clt -// -// -// On startup, the client lookup the object reference from the -// COS naming service. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// text [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include - -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif - -static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb); - -static void hello(Echo_ptr e) -{ - if( CORBA::is_nil(e) ) { - cerr << "hello: The object reference is nil!\n" << endl; - return; - } - - CORBA::String_var src = (const char*) "Hello!"; - - CORBA::String_var dest = e->echoString(src); - - cerr << "I said, \"" << (char*)src << "\"." << endl - << "The Echo object replied, \"" << (char*)dest <<"\"." << endl; -} - -////////////////////////////////////////////////////////////////////// - -int -main (int argc, char **argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = getObjectReference(orb); - - Echo_var echoref = Echo::_narrow(obj); - - for (CORBA::ULong count=0; count < 10; count++) - hello(echoref); - - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Object_ptr -getObjectReference(CORBA::ORB_ptr orb) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return CORBA::Object::_nil(); - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch(CORBA::ORB::InvalidName& ex) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return CORBA::Object::_nil(); - } - - // Create a name object, containing the name test/context: - CosNaming::Name name; - name.length(2); - - name[0].id = (const char*) "test"; // string copied - name[0].kind = (const char*) "my_context"; // string copied - name[1].id = (const char*) "Echo"; - name[1].kind = (const char*) "Object"; - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - try { - // Resolve the name to an object reference. - return rootContext->resolve(name); - } - catch(CosNaming::NamingContext::NotFound& ex) { - // This exception is thrown if any of the components of the - // path [contexts or the object] aren't found: - cerr << "Context not found." << endl; - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - - return CORBA::Object::_nil(); -} -\end{cxxlisting} - - -\clearpage -\subsection{eg3\_tieimpl.cc} - -\begin{cxxlisting} -// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that -// the tie implementation skeleton is used. -// -// This is the object implementation. -// -// Usage: eg3_tieimpl -// -// On startup, the object reference is registered with the -// COS naming service. The client uses the naming service to -// locate this object. -// -// The name which the object is bound to is as follows: -// root [context] -// | -// test [context] kind [my_context] -// | -// Echo [object] kind [Object] -// - -#include - -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif - -static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr); - - -// This is the object implementation. Notice that it does not inherit -// from any stub class, and notice that the echoString() member -// function does not have to be virtual. - -class Echo_i { -public: - inline Echo_i() {} - inline ~Echo_i() {} - char* echoString(const char* mesg); -}; - - -char* Echo_i::echoString(const char* mesg) -{ - return CORBA::string_dup(mesg); -} - -////////////////////////////////////////////////////////////////////// - -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); - - // Note that the tie object is constructed on the stack - // here. It will delete its implementation (myimpl) when it it - // itself destroyed (when it goes out of scope). It is essential - // however to ensure that such servants are not deleted whilst - // still activated. - // - // Tie objects can of course be allocated on the heap using new, - // in which case they are deleted when their reference count - // becomes zero, as with any other servant object. - Echo_i* myimpl = new Echo_i(); - POA_Echo_tie myecho(myimpl); - - PortableServer::ObjectId_var myechoid = poa->activate_object(&myecho); - - // Obtain a reference to the object, and register it in - // the naming service. - obj = myecho._this(); - if( !bindObjectToName(orb, obj) ) - return 1; - - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); - - orb->run(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} - -////////////////////////////////////////////////////////////////////// - -static CORBA::Boolean -bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref) -{ - CosNaming::NamingContext_var rootContext; - - try { - // Obtain a reference to the root context of the Name service: - CORBA::Object_var obj; - obj = orb->resolve_initial_references("NameService"); - - // Narrow the reference returned. - rootContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(rootContext) ) { - cerr << "Failed to narrow the root naming context." << endl; - return 0; - } - } - catch (CORBA::NO_RESOURCES&) { - cerr << "Caught NO_RESOURCES exception. You must configure omniORB " - << "with the location" << endl - << "of the naming service." << endl; - return 0; - } - catch (CORBA::ORB::InvalidName&) { - // This should not happen! - cerr << "Service required is invalid [does not exist]." << endl; - return 0; - } - - try { - // Bind a context called "test" to the root context: - - CosNaming::Name contextName; - contextName.length(1); - contextName[0].id = (const char*) "test"; // string copied - contextName[0].kind = (const char*) "my_context"; // string copied - // Note on kind: The kind field is used to indicate the type - // of the object. This is to avoid conventions such as that used - // by files (name.type -- e.g. test.ps = postscript etc.) - - CosNaming::NamingContext_var testContext; - try { - // Bind the context to root. - testContext = rootContext->bind_new_context(contextName); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - // If the context already exists, this exception will be raised. - // In this case, just resolve the name and assign testContext - // to the object returned: - CORBA::Object_var obj; - obj = rootContext->resolve(contextName); - testContext = CosNaming::NamingContext::_narrow(obj); - if( CORBA::is_nil(testContext) ) { - cerr << "Failed to narrow naming context." << endl; - return 0; - } - } - - // Bind objref with name Echo to the testContext: - CosNaming::Name objectName; - objectName.length(1); - objectName[0].id = (const char*) "Echo"; // string copied - objectName[0].kind = (const char*) "Object"; // string copied - - try { - testContext->bind(objectName, objref); - } - catch(CosNaming::NamingContext::AlreadyBound& ex) { - testContext->rebind(objectName, objref); - } - // Note: Using rebind() will overwrite any Object previously bound - // to /test/Echo with obj. - // Alternatively, bind() can be used, which will raise a - // CosNaming::NamingContext::AlreadyBound exception if the name - // supplied is already bound to an object. - - // Amendment: When using OrbixNames, it is necessary to first try bind - // and then rebind, as rebind on it's own will throw a NotFoundexception if - // the Name has not already been bound. [This is incorrect behaviour - - // it should just bind]. - } - catch(CORBA::TRANSIENT& ex) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "naming service." << endl - << "Make sure the naming server is running and that omniORB is " - << "configured correctly." << endl; - - return 0; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() - << " while using the naming service." << endl; - return 0; - } - return 1; -} -\end{cxxlisting} - - - - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{C++ language mapping} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -Now that you are familiar with the basics, it is important to -familiarise yourself with the standard IDL to C++ language mapping. -The mapping is described in detail in~\cite{cxxmapping}. If you have -not done so, you should obtain a copy of the document and use that as -the programming guide to omniORB. - -The specification is not an easy read. The alternative is to use one -of the books on CORBA programming that has begun to appear. For -instance, Henning and Vinoski's `Advanced CORBA Programming with -C++'~\cite{henning1999} includes many example code bits to illustrate -how to use the C++ mapping. - - -\section{omniORB 2 BOA compatibility} -\label{sec:BOAcompat} - -If you use the \cmdline{-WbBOA} option to omniidl, it will generate -skeleton code with the same interface as the old omniORB 2 BOA -mapping, as well as code to be used with the POA. Note that since the -major problem with the BOA specification was that server code was not -portable between ORBs, it is unlikely that omniORB 4.1's BOA -compatibility will help you much if you are moving from a different -BOA-based ORB. - -The BOA compatibility permits the majority of BOA code to compile -without difficulty. However, there are a number of constructs which -relied on omniORB 2 implementation details which no longer work. - -\begin{itemize} - -\item omniORB 2 did not use distinct types for object references and -servants, and often accepted a pointer to a servant when the CORBA -specification says it should only accept an object reference. Such -code will not compile under omniORB 4.1. - -\item The reverse is true for \op{BOA::obj\_is\_ready}. It now only -works when passed a pointer to a servant object, not an object -reference. The more commonly used mechanism of calling -\code{\_obj\_is\_ready(boa)} on the servant object still works as -expected. - -\item It used to be the case that the skeleton class for interface -\intf{I} (\type{\_sk\_I}) was derived from class \type{I}. This meant -that the names of any types declared in the interface were available -in the scope of the skeleton class. This is no longer true. If you -have an interface: +\item It used to be the case that the skeleton class for interface +\intf{I} (\type{\_sk\_I}) was derived from class \type{I}. This meant +that the names of any types declared in the interface were available +in the scope of the skeleton class. This is no longer true. If you +have an interface: \begin{idllisting} interface I { @@ -2376,7 +1572,7 @@ \section{omniORB 3.0 compatibility} -omniORB 4.1 is almost completely source-code compatible with omniORB +omniORB 4 is almost completely source-code compatible with omniORB 3.0. There are two main cases where code may have to change. The first is code that uses the omniORB API, some aspects of which have changed. The omniORB configuration file also has a new format. See the @@ -2385,13 +1581,13 @@ The second case of code that may have to change is code using the Dynamic Any interfaces. The standard changed quite significantly between CORBA 2.2 and CORBA 2.3; omniORB 3.0 supported the old CORBA -2.2 interfaces; omniORB 4.1 uses the new mapping. The changes are +2.2 interfaces; omniORB 4 uses the new mapping. The changes are largely syntax changes, rather than semantic differences. \section{omniORB 4.0 compatibility} -omniORB 4.1 is source-code compatible with omniORB 4.0, with four +omniORB 4.2 is source-code compatible with omniORB 4.0, with four exceptions: \begin{enumerate} @@ -2424,7 +1620,7 @@ For most uses, this change is not visible to application code. However, if a sequence is constructed using an application-supplied - buffer with the release flag set to false (meaning that the + buffer with the release flag set to \code{false} (meaning that the application continues to own the buffer), it is now important that the buffer is not deleted or modified while the Any exists, since the Any continues to refer to the buffer contents. This change @@ -2437,18 +1633,38 @@ \end{enumerate} +\section{omniORB 4.1 compatibility} + +omniORB 4.2 is source-code compatible with omniORB 4.1 with one +exception: + +\begin{enumerate} + +\item When omniORB 4.1 and earlier detected a timeout condition, they + would throw the \code{CORBA::TRANSIENT} system exception. omniORB + 4.2 supports the \code{CORBA::TIMEOUT} system exception that was + introduced with the CORBA Messaging specification. Application code + that caught \code{CORBA::TRANSIENT} to handle timeout situations + should be updated to catch \code{CORBA::TIMEOUT} + instead. Alternatively, to avoid code changes, omniORB can be + configured to throw \code{CORBA::TRANSIENT} for timeouts, by setting + the \code{throwTransient\dsc{}OnTimeout} parameter to \code{1}. See + section~\ref{sec:clientconf}. + +\end{enumerate} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{omniORB configuration and API} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \label{chap:config} -omniORB 4.1 has a wide range of parameters that can be -configured. They can be set in the configuration file / Windows -registry, as environment variables, on the command line, or within a -proprietary extra argument to \op{CORBA::ORB\_init}. A few parameters -can be configured at run time. This chapter lists all the -configuration parameters, and how they are used. +omniORB has a wide range of parameters that can be configured. They +can be set in the configuration file / Windows registry, as +environment variables, on the command line, or within a proprietary +extra argument to \op{CORBA::ORB\_init}. A few parameters can be +configured at run time. This chapter lists all the configuration +parameters, and how they are used. \section{Setting parameters} @@ -2514,10 +1730,9 @@ \begin{statement} -Note how command line arguments and environment variables prefix -parameter names with `-ORB' and `ORB' respectively, but the -configuration file and the extra argument to \op{ORB\_init} do not use -a prefix. +Command line arguments and environment variables prefix parameter +names with `-ORB' and `ORB' respectively, but the configuration file +and the extra argument to \op{ORB\_init} do not use a prefix. \end{statement} @@ -2554,9 +1769,9 @@ created and communication endpoints are shutdown\\ level 10 & execution and exception traces\\ -level 25 & trace each send or receive of a giop message\\ -level 30 & dump up to 128 bytes of each giop message\\ -level 40 & dump complete contents of each giop message\\ +level 25 & trace each send or receive of a GIOP message\\ +level 30 & dump up to 128 bytes of each GIOP message\\ +level 40 & dump complete contents of each GIOP message\\ \end{tabular} \vspace{\baselineskip} @@ -2567,7 +1782,7 @@ \confopt{traceExceptions}{0} -If the \code{traceExceptions} parameter is set true, all system +If the \code{traceExceptions} parameter is set \code{true}, all system exceptions are logged as they are thrown, along with details about where the exception is thrown from. This parameter is enabled by default if the traceLevel is set to 10 or more. @@ -2575,38 +1790,38 @@ \confopt{traceInvocations}{0} -If the \code{traceInvocations} parameter is set true, all local and -remote invocations are logged, in addition to any logging that may +If the \code{traceInvocations} parameter is set \code{true}, all local +and remote invocations are logged, in addition to any logging that may have been selected with \code{traceLevel}. \confopt{traceInvocationReturns}{0} -If the \code{traceInvocationReturns} parameter is set true, a log -message is output as an operation invocation returns. In conjunction -with \code{traceInvocations} and \code{traceTime} (described below), -this provides a simple way of timing CORBA calls within your -application. +If the \code{traceInvocationReturns} parameter is set \code{true}, a +log message is output as an operation invocation returns. In +conjunction with \code{traceInvocations} and \code{traceTime} +(described below), this provides a simple way of timing CORBA calls +within your application. -\confopt{traceThreadId}{0} +\confopt{traceThreadId}{1} -If \code{traceThreadId} is set true, all trace messages are prefixed -with the id of the thread outputting the message. This can be handy -for tracking down race conditions, but it adds significant overhead to -the logging function so it is turned off by default. +If \code{traceThreadId} is set \code{true}, all trace messages are +prefixed with the id of the thread outputting the message. This can be +handy for making sense of multi-threaded code, but it adds overhead to +the logging so it can be disabled. -\confopt{traceTime}{0} +\confopt{traceTime}{1} -If \code{traceTime} is set true, all trace messages are prefixed with -the time. This is useful, but on some platforms it adds a very large -overhead, so it is turned off by default. +If \code{traceTime} is set \code{true}, all trace messages are +prefixed with the time. This is useful, but on some platforms it adds +a very large overhead, so it can be turned off. \confopt{traceFile}{} -omniORB's tracing is normally sent to stderr. if \code{traceFile} it +omniORB's tracing is normally sent to stderr. If \code{traceFile} it set, the specified file name is used for trace messages. @@ -2652,8 +1867,8 @@ \confopt{dumpConfiguration}{0} -If set true, the ORB dumps the values of all configuration parameters -at start-up. +If set \code{true}, the ORB dumps the values of all configuration +parameters at start-up. \confopt{scanGranularity}{5} @@ -2676,6 +1891,20 @@ \type{wstring}. See chapter~\ref{chap:codesets}. +\confopt{defaultCharCodeSet}{\textit{none}} + +The default code set used for \type{char} and \type{string} if the +server does not specify it in its IORs. See +chapter~\ref{chap:codesets}. + + +\confopt{defaultWCharCodeSet}{\textit{none}} + +The default code set used for \type{wchar} and \type{wstring} if the +server does not specify it in its IORs. See +chapter~\ref{chap:codesets}. + + \confopt{copyValuesInLocalCalls}{1} Determines whether valuetype parameters in local calls are copied or @@ -2684,17 +1913,17 @@ \confopt{abortOnInternalError}{0} -If this is set true, internal fatal errors will abort immediately, -rather than throwing the \type{omniORB::fatalException} exception. -This can be helpful for tracking down bugs, since it leaves the call -stack intact. +If this is set \code{true}, internal fatal errors will abort +immediately, rather than throwing the \type{omniORB::fatalException} +exception. This can be helpful for tracking down bugs, since it +leaves the call stack intact. \confopt{abortOnNativeException}{0} On Windows, `native' exceptions such as segmentation faults and divide by zero appear as C++ exceptions that can be caught with \code{catch -(...)}. Setting this parameter to true causes such exceptions to -abort the process instead. + (...)}. Setting this parameter to \code{true} causes such exceptions +to abort the process instead. \vspace{\baselineskip}\par @@ -2731,11 +1960,12 @@ When transmitting a string that is supposed to be UTF-8, omniORB usually passes it directly, assuming that it is valid. With this -parameter set true, omniORB checks that all UTF-8 strings are valid, -and throws DATA\_CONVERSION if not. +parameter set \code{true}, omniORB checks that all UTF-8 strings are +valid, and throws DATA\_CONVERSION if not. \section{Client side options} +\label{sec:clientconf} These options control aspects of client-side behaviour. @@ -2787,17 +2017,28 @@ \confopt{supportPerThreadTimeOut}{0} -If this parameter is set true, timeouts can be set on a per thread -basis, as well as globally and per object. Checking per-thread storage -has a noticeable performance impact, so it is turned off by default. +If this parameter is set \code{true}, timeouts can be set on a per +thread basis, as well as globally and per object. Checking per-thread +storage has a noticeable performance impact, so it is turned off by +default. \confopt{resetTimeoutOnRetries}{0} -If true, the call timeout is reset when an exception handler causes a -call to be retried. If false, the timeout is not reset, and therefore -applies to the call as a whole, rather than to each individual call -attempt. +If \code{true}, the call timeout is reset when an exception handler +causes a call to be retried. If \code{false}, the timeout is not +reset, and therefore applies to the call as a whole, rather than to +each individual call attempt. + +\confopt{throwTransientOnTimeout}{0} + +omniORB 4.2 supports the \code{CORBA::TIMEOUT} exception that is part +of the CORBA Messaging specification. By default, that is the +exception thrown when timeouts occur. Previous omniORB releases did +not have the \code{CORBA::TIMEOUT} exception, and instead used +\code{CORBA::TRANSIENT}. If this parameter is set \code{true}, omniORB +follows the old behaviour of throwing \code{CORBA::TRANSIENT} when a +timeout occurs. \confopt{outConScanPeriod}{120} @@ -2818,16 +2059,16 @@ \confopt{oneCallPerConnection}{1} -When this parameter is set to true (the default), the ORB will only -send a single call on a connection at a time. If multiple client +When this parameter is set to \code{true} (the default), the ORB will +only send a single call on a connection at a time. If multiple client threads invoke on the same server, multiple connections are opened, up to the limit specified by -\code{maxGIOPConnection\dsc{}PerServer}. With this parameter set to -false, the ORB will allow concurrent calls on a single +\code{maxGIOP\dsc{}ConnectionPerServer}. With this parameter set to +\code{false}, the ORB will allow concurrent calls on a single connection. This saves connection resources, but requires slightly more management work for both client and server. Some server-side ORBs -(including omniORB versions before 4.0) serialise all calls on a -single connection. +(including omniORB versions before 4.0) serialise all incoming calls +on a single connection. \confopt{maxInterleavedCallsPerConnection}{5} @@ -2837,16 +2078,16 @@ \confopt{offerBiDirectionalGIOP}{0} -If set true, the client will indicate to servers that it is willing to -accept callbacks on client-initiated connections using bidirectional -GIOP, provided the relevant POA policies are set. See +If set \code{true}, the client will indicate to servers that it is +willing to accept callbacks on client-initiated connections using +bidirectional GIOP, provided the relevant POA policies are set. See section~\ref{sec:bidir}. \confopt{diiThrowsSysExceptions}{0} -If this is true, DII functions throw system exceptions; if it is -false, system exceptions that occur are passed through the +If this is \code{true}, DII functions throw system exceptions; if it +is \code{false}, system exceptions that occur are passed through the \type{Environment} object. @@ -2857,7 +2098,7 @@ the case that the full type of the object is not known, it instead calls the \op{\_is\_a} operation to check the object's type. Some ORBs have bugs that mean one or other of these operations fail. Setting -this parameter false prevents omniORB from making these calls. +this parameter \code{false} prevents omniORB from making these calls. \confopt{giopTargetAddressMode}{0} @@ -2870,9 +2111,10 @@ \confopt{immediateAddressSwitch}{0} -If true, the client will immediately switch to use a new address to -contact an object after a failure. If false (the default), the current -address will be retried in certain circumstances. +If \code{true}, the client will immediately switch to use a new +address to contact an object after a failure. If \code{false} (the +default), the current address will be retried in certain +circumstances. \confopt{bootstrapAgentHostname}{\textit{none}} @@ -2937,16 +2179,16 @@ \confopt{inConScanPeriod}{180} -Idle timeout in seconds for incoming. If a connection has been idle -for this amount of time, the ORB closes it. See +Idle timeout in seconds for incoming connections. If a connection has +been idle for this amount of time, the ORB closes it. See section~\ref{sec:connShutdown}. \confopt{threadPerConnectionPolicy}{1} -If true (the default), the ORB dedicates one server thread to each -incoming connection. Setting it false means the server should use a -thread pool. +If \code{true} (the default), the ORB dedicates one server thread to +each incoming connection. Setting it \code{false} means the server +should use a thread pool. \confopt{maxServerThreadPerConnection}{100} @@ -2967,11 +2209,11 @@ \confopt{threadPerConnectionUpperLimit}{10000} -If the \code{threadPerConnectionPolicy} parameter is true, the ORB can -automatically transition to thread pool mode if too many connections -arrive. This parameter sets the number of connections at which thread -pooling is started. The default of 10000 is designed to mean that it -never happens. +If the \code{threadPerConnectionPolicy} parameter is \code{true}, the +ORB can automatically transition to thread pool mode if too many +connections arrive. This parameter sets the number of connections at +which thread pooling is started. The default of 10000 is designed to +mean that it never happens. \confopt{threadPerConnectionLowerLimit}{9000} @@ -2988,13 +2230,12 @@ before returning to the pool. This leads to less thread switching for a series of calls from a single client, but is less fair if there are concurrent clients. The connection is watched if the number of threads -concurrently handling the connection is <= the value of this -parameter. i.e.\ if the parameter is zero, the connection is never -watched; if it is 1, the last thread managing a connection watches it; -if 2, the connection is still watched if there is one other thread -still in an upcall for the connection, and so on. - -See section~\ref{sec:watchConn}. +concurrently handling the connection is less than or equal to the +value of this parameter. i.e.\ if the parameter is zero, the +connection is never watched; if it is 1, the last thread managing a +connection watches it; if 2, the connection is still watched if there +is one other thread still in an upcall for the connection, and so +on. See section~\ref{sec:watchConn}. \confopt{connectionWatchPeriod}{50000} @@ -3011,10 +2252,10 @@ When a thread handles an incoming call, it unmarshals the arguments then marks the connection as watchable by the connection watching thread, in case the client sends a concurrent call on the same -connection. If this parameter is set to the default false, the +connection. If this parameter is set to the default \code{false}, the connection is not actually watched until the next connection watch period (determined by the \code{connectionWatchPeriod} parameter). If -this parameter is set true, the connection watching thread is +this parameter is set \code{true}, the connection watching thread is immediately signalled to watch the connection. That leads to faster interactive response to clients that multiplex calls, but adds significant overhead along the call chain. @@ -3066,15 +2307,16 @@ If a POA is put in the \code{HOLDING} state, calls to it will be timed out after the specified number of milliseconds, by raising a -\code{TRANSIENT} exception. Zero means no timeout. +\code{CORBA::TIMEOUT} exception. Zero means no timeout. \confopt{poaUniquePersistentSystemIds}{1} The POA specification requires that object ids in POAs with the PERSISTENT and SYSTEM\_ID policies are unique between instantiations of the POA. Older versions of omniORB did not comply with that, and -reused object ids. With this value true, the POA has the correct -behaviour; with false, the POA uses the old scheme for compatibility. +reused object ids. With this value \code{true}, the POA has the +correct behaviour; with \code{false}, the POA uses the old scheme for +compatibility. \confopt{idleThreadTimeout}{10} @@ -3084,7 +2326,7 @@ \confopt{supportBootstrapAgent}{0} -If set true, servers support the Sun bootstrap agent protocol. +If set \code{true}, servers support the Sun bootstrap agent protocol. \subsection{Main thread selection} @@ -3134,13 +2376,13 @@ \confopt{strictIIOP}{1} -If true, be strict about interpretation of the IIOP specification; if -false, permit some buggy behaviour to pass. +If \code{true}, be strict about interpretation of the IIOP +specification; if \code{false}, permit some buggy behaviour to pass. \confopt{lcdMode}{0} -If true, select `Lowest Common Denominator' mode. This disables +If \code{true}, select `Lowest Common Denominator' mode. This disables various IIOP and GIOP features that are known to cause problems with some ORBs. @@ -3150,27 +2392,24 @@ This flag is used to indicate whether TypeCodes associated with Anys should have aliases removed. This functionality is included because some ORBs will not recognise an Any containing a TypeCode with aliases -to be the same as the actual type contained in the Any. Note that -omniORB will always remove top-level aliases, but will not remove -aliases from TypeCodes that are members of other TypeCodes (e.g.\ -TypeCodes for members of structs etc.), unless \code{tcAliasExpand} is -set to 1. There is a performance penalty when inserting into an Any if -\code{tcAliasExpand} is set to 1. +to be the same as the actual type contained in the Any. There is a +performance penalty when inserting into an Any if \code{tcAliasExpand} +is set to 1. \confopt{useTypeCodeIndirections}{1} TypeCode Indirections reduce the size of marshalled TypeCodes, and are essential for recursive types, but some old ORBs do not support them. -Setting this flag to false prevents the use of indirections (and, -therefore, recursive TypeCodes). +Setting this flag to \code{false} prevents the use of indirections +(and, therefore, prevents the use of recursive TypeCodes). \confopt{acceptMisalignedTcIndirections}{0} -If true, try to fix a mis-aligned indirection in a typecode. This is -used to work around a bug in some old versions of Visibroker's Java -ORB. +If \code{true}, try to fix a mis-aligned indirection in a +typecode. This is used to work around a bug in some old versions of +Visibroker's Java ORB. \vspace{2\baselineskip} @@ -3192,9 +2431,10 @@ Once they are installed, proxy objects will call these handlers when the associated system exceptions are raised by the ORB runtime. Handlers can be installed for \code{CORBA::\dsc{}TRANSIENT}, -\code{CORBA::COMM\_FAILURE} and \code{CORBA::SystemException}. This -last handler covers all system exceptions other than the two covered -by the first two handlers. An exception handler can be installed for +\code{CORBA::\dsc{}TIMEOUT}, \code{CORBA::COMM\_FAILURE} and +\code{CORBA::\dsc{}SystemException}. This last handler covers all +system exceptions other than the three specific ones covered by the +first three handlers. An exception handler can be installed for individual proxy objects, or it can be installed for all proxy objects in the address space. @@ -3281,14 +2521,14 @@ } \end{cxxlisting} -The overloaded function \op{installTransientExceptionHandler} can be -used to install the exception handlers for \code{CORBA::TRANSIENT}. -Two forms are available: the first form installs an exception handler -for all object references except for those which have an exception -handler installed by the second form, which takes an additional -argument to identify the target object reference. The argument -\code{cookie} is an opaque pointer which will be passed on by the ORB -when it calls the exception handler. +The overloaded \op{installTransientExceptionHandler} function is used +to install the exception handlers for \code{CORBA::TRANSIENT}. Two +forms are available: the first form installs an exception handler for +all object references except for those which have an exception handler +installed by the second form, which takes an additional argument to +identify the target object reference. The argument \code{cookie} is an +opaque pointer which will be passed on by the ORB when it calls the +exception handler. An exception handler will be called by proxy objects with three arguments. The \code{cookie} is the opaque pointer registered by @@ -3297,35 +2537,35 @@ handler for the same invocation. The argument \code{ex} is the value of the exception caught. The exception handler is expected to do whatever is appropriate and return a boolean value. If the return -value is TRUE(1), the proxy object retries the operation. If the -return value is FALSE(0), the original exception is propagated into -the application code. In the case of a \code{TRANSIENT} exception due -to a failed location forward, the exception propagated to the +value is \code{true}, the proxy object retries the operation. If the +return value is \code{false}, the original exception is propagated +into the application code. In the case of a \code{TRANSIENT} exception +due to a failed location forward, the exception propagated to the application is the \emph{original} exception that caused the \code{TRANSIENT} (e.g.\ a \code{COMM\_FAILURE} or \code{OBJECT\_NOT\_EXIST}), rather than the \code{TRANSIENT} -exception\footnote{This is a change from omniORB 4.0 and earlier, -where it was the \code{TRANSIENT} exception that was propagated to the -application.}. +exception\footnote{This is different from omniORB 4.0 and earlier, + where it was the \code{TRANSIENT} exception that was propagated to + the application.}. The following sample code installs a simple exception handler for all objects and for a specific object: \begin{cxxlisting} -CORBA::Boolean my_transient_handler1 (void* cookie, - CORBA::ULong retries, - const CORBA::TRANSIENT& ex) +CORBA::Boolean my_transient_handler1(void* cookie, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex) { cerr << "transient handler 1 called." << endl; - return 1; // retry immediately. + return true; // retry immediately. } -CORBA::Boolean my_transient_handler2 (void* cookie, - CORBA::ULong retries, - const CORBA::TRANSIENT& ex) +CORBA::Boolean my_transient_handler2(void* cookie, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex) { cerr << "transient handler 2 called." << endl; - return 1; // retry immediately. + return false; // do not retry. } @@ -3333,36 +2573,76 @@ void installhandlers() { - omniORB::installTransientExceptionHandler(0,my_transient_handler1); + omniORB::installTransientExceptionHandler(0, my_transient_handler1); // All proxy objects will call my_transient_handler1 from now on. - omniORB::installTransientExceptionHandler(myobj,0,my_transient_handler2); + omniORB::installTransientExceptionHandler(myobj, 0, my_transient_handler2); // The proxy object of myobj will call my_transient_handler2 from now on. } \end{cxxlisting} -\subsection{CORBA::COMM\_FAILURE} - -If the ORB has successfully contacted an object at some point, and -access to it subsequently fails (and the condition for -\code{TRANSIENT} described above does not occur), the ORB raises a -\code{CORBA::COMM\_\dsc{}FAILURE} exception. +\subsection{CORBA::TIMEOUT} -The default behaviour of the proxy objects is to propagate this -exception to the application. Applications can override the default -behaviour by installing their own exception handlers. The API to do so -is summarised below: +When a call timeout occurs, by default the ORB throws +\code{CORBA::TIMEOUT}. The default behaviour of the proxy objects is +to propagate this exception to the application. Applications can +override the default behaviour by installing their own exception +handlers. The API to do so is summarised below: \begin{cxxlisting} typedef CORBA::Boolean -(*commFailureExceptionHandler_t)(void* cookie, - CORBA::ULong n_retries, - const CORBA::COMM_FAILURE& ex); +(*timeoutExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TIMEOUT& ex); void -installCommFailureExceptionHandler(void* cookie, - commFailureExceptionHandler_t fn); +installTimeoutExceptionHandler(void* cookie, + timeoutExceptionHandler_t fn); + +void +installTimeoutExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + timeoutExceptionHandler_t fn); +\end{cxxlisting} + +The functions are equivalent to their counterparts for +\code{CORBA::TRANSIENT}. + +omniORB version 4.1 and earlier did not have the \code{CORBA::TIMEOUT} +exception, and threw \code{CORBA::TRANSIENT} instead. If the +\code{throwTransientOnTimeout} configuration parameter is set to +\code{1}, omniORB 4.2 reverts to this behaviour, and calls the +transient exception handler instead of the timeout exception handler. + +The timeout exception handler is used when a CORBA call times out. It +is \emph{not} called when an AMI poller operation throws +\code{CORBA::TIMEOUT}. In that situation, the exception is always +propagated to the caller. + + + +\subsection{CORBA::COMM\_FAILURE} + +If the ORB has successfully contacted a server at some point, and +access to it subsequently fails (and the condition for +\code{TRANSIENT} described above does not occur), the ORB raises a +\code{CORBA::COMM\_\dsc{}FAILURE} exception. + +The default behaviour of the proxy objects is to propagate this +exception to the application. Applications can override the default +behaviour by installing their own exception handlers. The API to do so +is summarised below: + +\begin{cxxlisting} +typedef CORBA::Boolean +(*commFailureExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::COMM_FAILURE& ex); + +void +installCommFailureExceptionHandler(void* cookie, + commFailureExceptionHandler_t fn); void installCommFailureExceptionHandler(CORBA::Object_ptr obj, @@ -3376,7 +2656,7 @@ \subsection{CORBA::SystemException} -If a system exceptions other than \code{TRANSIENT} or +If a system exceptions other than \code{TRANSIENT}, \code{TIMEOUT} or \code{COMM\_FAILURE} occurs, the default behaviour of the proxy objects is to propagate this exception to the application. Applications can override the default behaviour by installing their @@ -3404,6 +2684,44 @@ +\subsection{Extended exception handlers} + +New in omniORB 4.2, each of the exception handlers described above +also has an `extended' form in which the exception handler takes two +additional parameters, the object reference being invoked upon, and a +string containing the name of the operation invoked. e.g.: + +\begin{cxxlisting} +namespace omniORB { + + typedef CORBA::Boolean + (*transientExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex, + CORBA::Object_ptr obj, + const char* op); + + void + installTransientExceptionHandlerExt(void* cookie, + transientExceptionHandlerExt_t fn); + + void + installTransientExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandlerExt_t fn); +} +\end{cxxlisting} + +Note that the operation parameter can sometimes be null. By default, +omniORB sends a \code{LocateRequest} message prior to the first +operation invocation on an object reference. That \code{LocateRequest} +is subject to the same exception handling mechanism as a normal +operation invocation, but it is represented with a null operation +name. Exception handler code that uses the operation name must +correctly handle a null operation name pointer. + + + \section{Location forwarding} \label{sec:locationForward} @@ -3448,8 +2766,7 @@ \begin{quote} % Not the clearest bit of mark-up ever... :-) \cmdline{omniidl }[\textit{options}]\cmdline{ -b}% <\textit{back-end}>\cmdline{ }[\textit{back-end options}]% -\cmdline{ }<\textit{file 1}>\cmdline{ }<\textit{file 2}>% -\cmdline{ }\dots +\cmdline{ }<\textit{file}> \end{quote} \section{Common options} @@ -3535,7 +2852,7 @@ directives inserted by other preprocessors are likely to confuse omniidl. -\subsubsection{Windows 9x} +\subsubsection{Ancient history: Windows 9x} The output from the C preprocessor is normally fed to the omniidl parser through a pipe. On some Windows 98 machines (but not all!) the @@ -3598,6 +2915,7 @@ \section{C++ back-end options} +\label{sec:cxx_backend} When you specify the C++ back-end (with \cmdline{-bcxx}), the following \cmdline{-Wb} options are available. Note that the @@ -3624,24 +2942,38 @@ \cmdline{-Wba} \> Generate stubs for TypeCode and Any.\\ -\cmdline{-Wbinline} - \> Output stubs for \code{\#include}d IDL files in line with the - main file.\\ - \cmdline{-Wbtp} \> Generate `tie' implementation skeletons.\\ \cmdline{-Wbtf} \> Generate flattened `tie' implementation skeletons.\\ -\cmdline{-Wbsplice-modules} - \> Splice together multiply-opened modules into one.\\ +\cmdline{-Wbami} + \> Generate AMI types and operations.\\ \cmdline{-Wbexample} \> Generate example implementation code.\\ -\cmdline{-WbF} - \> Generate code fragments (for experts only).\\ +\cmdline{-Wbinline} + \> Output stubs for \code{\#include}d IDL files in line with the + main file.\\ + +\cmdline{-Wbuse-quotes} + \> Use quotes in `\code{\#include}' directives + (e.g.\ \code{"foo"} rather than \code{}.)\\ + +\cmdline{-Wbkeep-inc-path} + \> Preserve IDL `\code{\#include}' paths in generated + `\code{\#include}' directives.\\ + +\cmdline{-Wbvirtual-objref} + \> Use virtual functions for object reference operations.\\ + +\cmdline{-Wbimpl-mapping} + \> Use the `implementation' mapping for object reference methods.\\ + +\cmdline{-Wbsplice-modules} + \> Splice together multiply-opened modules into one.\\ \cmdline{-WbBOA} \> Generate BOA compatible skeletons.\\ @@ -3649,33 +2981,35 @@ \cmdline{-Wbold} \> Generate old CORBA 2.1 signatures for skeletons.\\ -\cmdline{-Wbold\_prefix} +\cmdline{-Wbold-prefix} \> Map C++ reserved words with prefix `\code{\_}' rather than `\code{\_cxx\_}'.\\ -\cmdline{-Wbkeep\_inc\_path} - \> Preserve IDL `\code{\#include}' paths in generated - `\code{\#include}' directives.\\ +\cmdline{-WbF} + \> Generate code fragments (only for use during omniORB build).\\ -\cmdline{-Wbuse\_quotes} - \> Use quotes in `\code{\#include}' directives - (e.g.\ \code{"foo"} rather than \code{}.)\\ +\end{tabbing} +\subsection{Optional code generation options} -\end{tabbing} +By default, omniidl generates the minimum code required to provide all +the IDL-defined types and interfaces, which is sufficient for the +majority of applications. Additional code can also be generated, for +various purposes: -\noindent Again, most of these are self-explanatory. +\subsubsection{Any and TypeCode} -\subsection{Stub / skeleton files} +To generate TypeCodes and Any insertion operators, give the +\cmdline{-Wba} option. See chapter~\ref{chap:any} for details. By default, omniidl separates the normal stub and skeleton file (the -\file{SK.cc} file) from the `dynamic' stubs (the \file{DynSK.cc} +\file{SK.cc} file) from these `dynamic' stubs (the \file{DynSK.cc} file), so applications that do not need support for Any and TypeCode for a particular IDL file do not waste space with unnecessary -definitions. It is possible to output both the normal stubs \emph{and} -the dynamic stubs to a single file, by simply specifying the same +definitions. It is possible to output both the normal stubs and the +dynamic stubs to a single file, by simply specifying the same extension for both files. This command places both the normal stubs and the dynamic stubs in \file{aSK.cc}: @@ -3684,6 +3018,102 @@ \end{quote} +\subsubsection{Tie templates} + +As described in section~\ref{sec:tie}, tie templates can be used to +provide servant implementations, instead of using inheritance from the +normal skeleton classes. To generate tie templates, give the +\cmdline{-Wbtp} option to omniidl. + +When using a pre-namespace C++ compiler, IDL modules are mapped to C++ +classes, which causes a problem with tie templates. The C++ mapping +says that for the interface \intf{M::I}, the C++ tie template class +should be named \type{POA\_M::I\_tie}. However, since template classes +cannot be declared inside other classes, this naming scheme cannot be +used if \type{POA\_M} is a class. + +The C++ mapping has an alternative option of `flattened' tie class +names, in which the template class is declared at global scope with +the name \type{POA\_M\_I\_tie}. i.e.\ all occurrences of `\type{::}' +are replaced by `\type{\_}'. Generate the flattened ties using the +\cmdline{-Wbtf} command line argument. + + +\subsubsection{Asynchronous Method Invocation} + +Generate asynchronous invocation operations and the various types +required by AMI by specifying \cmdline{-Wbami}. See +chapter~\ref{chap:ami} for details. + + +\subsubsection{Example implementations} + +If you use the \cmdline{-Wbexample} flag, omniidl will generate an +example implementation file as well as the stubs and skeletons. For +IDL file \file{foo.idl}, the example code is written to +\file{foo_i.cc}. The example file contains class and method +declarations for the operations of all interfaces in the IDL file, +along with a \op{main} function which creates an instance of each +object. You still have to fill in the operation implementations, of +course. + + +\subsection{Include file options} + +IDL files regularly \code{\#include} other files. By default, if file +\file{a.idl} says \code{\#include } then the generated +header \file{a.hh} has an include of the form \code{\#include + }, and \file{aSK.cc} and \file{aDynSK.cc} contain only code +corresponding to the declarations in \file{a.idl}. + +If the \cmdline{-Wbinline} option is provided, all the +\code{\#include}d declarations are generated in \file{a.hh}, +\file{aSK.cc} and \file{aDynSK.cc}, meaning the application code +should only use that single set of files. + +If \cmdline{-Wbuse-quotes} is specified, then the directive in +\file{a.hh} uses quotes rather than angle brackets: +\code{\#include "c.idl"}. + +Normally any path details contained in the IDL \code{\#include} +directive are removed, leaving just the base name. If +\cmdline{-Wbkeep-inc-path} is specified, the directive in +\file{a.hh} is \code{\#include }. + + + +\subsection{Object reference operations} + +Some of the C++ mapping's parameter passing rules are problematic in +terms of memory management. For example, if an IDL operation has a +parameter of type \type{inout string}, the standard mapping has a C++ +parameter of type \type{char*\&}. If application code passes a +\type{String\_var} for the parameter, some C++ compilers choose the +wrong conversion operator and cause a violation of the memory +management rules\footnote{For this reason, the \type{\_var} types + define an \op{inout} method that ensures use of the correct + conversion and thus avoids this kind of trouble.}. + +To avoid this, omniORB uses some helper classes as the parameter types +in object reference operations, meaning that the correct memory +management rules are always followed. Normally, that is invisible to +application code, but occasionally it becomes problematic. One example +is that if a \type{local interface} is derived from a normal +unconstrained interface, the C++ mapping of the local interface +derives from the object reference class, and so the base object +reference class must use the standard mapping rather than omniORB's +usual enhanced mapping. To choose the standard `implementation +mapping', give the \cmdline{-Wbimpl-mapping} option to omniidl. + +Similarly, omniidl usually uses non-virtual methods in its object +reference classes, since there is no usual need to override them. The +local interface situation also requires method overrides, so omniidl +must be instructed to generate object references as virtual. Use +\cmdline{-Wbvirtual-objref} to achieve this. + +More details about the local interface mapping can be found in +section~\ref{sec:LocalInterfaces}. + \subsection{Module splicing} @@ -3735,35 +3165,6 @@ complain. -\subsection{Flattened tie classes} - -Another problem with mapping IDL modules to C++ classes arises with -tie templates. The C++ mapping says that for the interface -\intf{M::I}, the C++ tie template class should be named -\type{POA\_M::I\_tie}. However, since template classes cannot be -declared inside other classes, this naming scheme cannot be used with -compilers without namespace support. - -The standard solution is to produce `flattened' tie class names, using -the \cmdline{-Wbtf} command line argument. With that flag, the -template class is declared at global scope with the name -\type{POA\_M\_I\_tie}. i.e.\ all occurrences of `\type{::}' are -replaced by `\type{\_}'. - - -\subsection{Generating example implementations} - -If you use the \cmdline{-Wbexample} flag, omniidl will generate an -example implementation file as well as the stubs and skeletons. For -IDL file \file{foo.idl}, the example code is written to -\file{foo_i.cc}. The example file contains class and method -declarations for the operations of all interfaces in the IDL file, -along with a \op{main} function which creates an instance of each -object. You still have to fill in the operation implementations, of -course. - - - \section{Examples} Generate the C++ headers and stubs for a file \file{a.idl}: @@ -3795,2211 +3196,2781 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{Interoperable Naming Service} +\chapter{Connection and Thread Management} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{chap:ins} - -omniORB supports the Interoperable Naming Service (INS). The following -is a summary of its facilities. - +\label{chap:connections} -\section{Object URIs} -As well as accepting IOR-format strings, \op{ORB::string\_to\_object} -also supports two Uniform Resource Identifier (URI)~\cite{rfc2396} -formats, which can be used to specify objects in a convenient -human-readable form. IOR-format strings are now also considered URIs. +This chapter describes how omniORB manages threads and network +connections. -\subsection{corbaloc} +\section{Background} -\corbauri{corbaloc} URIs allow you to specify object references which -can be contacted by IIOP, or found through -\op{ORB::resolve\_initial\_references}. To specify an IIOP object -reference, you use a URI of the form: +In CORBA, the ORB is the `middleware' that allows a client to invoke +an operation on an object without regard to its implementation or +location. In order to invoke an operation on an object, a client needs +to `bind' to the object by acquiring its object reference. Such a +reference may be obtained as the result of an operation on another +object (such as a naming service or factory object) or by conversion +from a stringified representation. If the object is in a different +address space, the binding process involves the ORB building a proxy +object in the client's address space. The ORB arranges for invocations +on the proxy object to be transparently mapped to equivalent +invocations on the implementation object. -\begin{quote} -\corbauri{corbaloc:iiop:}<\textit{host}>\corbauri{:}<\textit{port}>% -\corbauri{/}<\textit{object key}> -\end{quote} +For the sake of interoperability, CORBA mandates that all ORBs should +support IIOP as the means to communicate remote invocations over a +TCP/IP connection. IIOP is usually\footnote{GIOP 1.2 supports +`bidirectional GIOP', which permits the r\^oles to be reversed.} +asymmetric with respect to the roles of the parties at the two ends of +a connection. At one end is the client which can only initiate remote +invocations. At the other end is the server which can only receive +remote invocations. -\noindent for example: +Notice that in CORBA, as in most distributed systems, remote bindings +are established implicitly without application intervention. This +provides the illusion that all objects are local, a property known as +`location transparency'. CORBA does not specify when such bindings +should be established or how they should be multiplexed over the +underlying network connections. Instead, ORBs are free to implement +implicit binding by a variety of means. -\begin{quote} -\corbauri{corbaloc:iiop:myhost.example.com:1234/MyObjectKey} -\end{quote} +The rest of this chapter describes how omniORB manages network +connections and the programming interface to fine tune the management +policy. -\noindent which specifies an object with key `MyObjectKey' within a -process running on myhost.example.com listening on port 1234. Object -keys containing non-ASCII characters can use the standard URI \% -escapes: -\begin{quote} -\corbauri{corbaloc:iiop:myhost.example.com:1234/My}% -\texttt{\%}% -\corbauri{efObjectKey} -\end{quote} +\section{The model} -\noindent denotes an object key with the value 239 (hex ef) in the -third octet. +omniORB is designed from the ground up to be fully multi-threaded. The +objective is to maximise the degree of concurrency and at the same +time eliminate any unnecessary thread overhead. Another objective is +to minimise the interference by the activities of other threads on the +progress of a remote invocation. In other words, thread `cross-talk' +should be minimised within the ORB. To achieve these objectives, the +degree of multiplexing at every level is kept to a minimum by default. -The protocol name `\corbauri{iiop}' can be abbreviated to the empty -string, so the original URI can be written: +Minimising multiplexing works well when the system is relatively +lightly loaded. However, when the ORB is under heavy load, it can +sometimes be beneficial to conserve operating system resources such as +threads and network connections by multiplexing at the ORB +level. omniORB has various options that control its multiplexing +behaviour. -\begin{quote} -\corbauri{corbaloc::myhost.example.com:1234/MyObjectKey} -\end{quote} -\noindent The IANA has assigned port number 2809\footnote{Not 2089 as -printed in \cite{inschapters}!} for use by \corbauri{corbaloc}, so if -the server is listening on that port, you can leave the port number -out. The following two URIs refer to the same object: +\section{Client side behaviour} -\begin{quote} -\corbauri{corbaloc::myhost.example.com:2809/MyObjectKey}\\ -\corbauri{corbaloc::myhost.example.com/MyObjectKey} -\end{quote} +On the client side of a connection, the thread that invokes on a proxy +object drives the GIOP protocol directly and blocks on the connection +to receive the reply. The first time the client makes a call to a +particular address space, the ORB opens a suitable connection to the +remote address space (based on the client transport rule as described +in section~\ref{sec:clientRule}). After the reply has been received, +the ORB caches the open network connection, ready for use by another +call. -\noindent You can specify an object which is available at more than -one location by separating the locations with commas: +If two (or more) threads in a multi-threaded client attempt to contact +the same address space simultaneously, there are two different ways to +proceed. The default way is to open another network connection to the +server. This means that neither the client or server ORB has to +perform any multiplexing on the network connections---multiplexing is +performed by the operating system, which has to deal with multiplexing +anyway. The second possibility is for the client to multiplex the +concurrent requests on a single network connection. This conserves +operating system resources (network connections), but means that both +the client and server have to deal with multiplexing issues +themselves. -\begin{quote} -\corbauri{corbaloc::myhost.example.com,:localhost:1234/MyObjectKey} -\end{quote} +In the default one call per connection mode, there is a limit to the +number of concurrent connections that are opened, set with the +\code{maxGIOPConnection\dsc{}PerServer} parameter. To tell the ORB +that it may multiplex calls on a single connection, set the +\code{oneCallPerConnection} parameter to zero. If the +\code{oneCallPer\dsc{}Connection} parameter is set to the default +value of one, and there are more concurrent calls than specified by +\code{maxGIOPConnectionPerServer}, calls block waiting for connections +to become free. -\noindent Note that you must restate the protocol for each address, -hence the `\corbauri{:}' before `\corbauri{localhost}'. It could -equally have been written `\corbauri{iiop:localhost}'. +Note that some server-side ORBs, including omniORB versions before +version 4.0, are unable to deal with concurrent calls multiplexed on a +single connection, so they serialise the calls. It is usually best to +keep to the default mode of opening multiple connections. -You can also specify an IIOP version number: -\begin{quote} -\corbauri{corbaloc::1.2@myhost.example.com/MyObjectKey} -\end{quote} +\subsection{Client side timeouts} +\label{sec:timeoutAPI} -Specifying IIOP versions above 1.0 is slightly risky since higher -versions make use of various information stored in IORs that is not -present in a corbaloc URI. It is generally best to contact initial -corbaloc objects with IIOP 1.0, and rely on higher versions for all -other object references. +omniORB can associate a timeout with a call, meaning that if the call +takes too long a \code{CORBA::TIMEOUT} exception\footnote{Or + \code{CORBA::TRANSIENT} if the backwards-compatibility + \code{throwTransientOnTimeout} parameter is set to \code{1}.} is +thrown. Timeouts can be set for the whole process, for a specific +thread, or for a specific object reference. +Timeouts are set using this API: -\vspace{\baselineskip} +\begin{cxxlisting} +namespace omniORB { + void setClientCallTimeout(CORBA::ULong millisecs); + void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs); + void setClientThreadCallTimeout(CORBA::ULong millisecs); + void setClientConnectTimeout(CORBA::ULong millisecs); +}; +\end{cxxlisting} + +\op{setClientCallTimeout} sets either the global timeout or the +timeout for a specific object reference. +\op{setClientThreadCallTimeout} sets the timeout for the calling +thread. The calling thread must have an \code{omni\_thread} associated +with it. Setting any timeout value to zero disables it. + +Accessing per-thread state is a relatively expensive operation, so per +thread timeouts are disabled by default. The +\code{supportPerThreadTimeOut} parameter must be set \code{true} to +enable them. + +To choose the timeout value to use for a call, the ORB first looks to +see if there is a timeout for the object reference, then to the +calling thread, and finally to the global timeout. + +When a client has no existing connection to communicate with a server, +it must open a new connection before performing the +call. \op{setClientConnect\dsc{}Timeout} sets an overriding timeout for +cases where a new connection must be established. The effect of the +connect timeout depends upon whether the connect timeout is greater +or less than the timeout that would otherwise be used. + +\vspace{\baselineskip}\noindent +As an example, imagine that the usual call timeout is 10 seconds: + +\subsubsection*{Connect timeout > usual timeout} + +If the connect timeout is set to 20 seconds, then a call that +establishes a new connection will be permitted 20 seconds before it +times out. Subsequent calls using the same connection have the normal +10 second timeout. If establishing the connection takes 8 seconds, +then the call itself takes 5 seconds, the call succeeds despite having +taken 13 seconds in total, longer than the usual timeout. + +This kind of configuration is good when connections are slow to be +established. + +If an object reference has multiple possible endpoints available, and +connecting to the first endpoint times out, only that one endpoint +will have been tried before an exception is raised. However, once the +timeout has occurred, the object reference will switch to use the next +endpoint. If the application attempts to make another call, it will +use the next endpoint. + + +\subsubsection*{Connect timeout < usual timeout} + +If the connect timeout is set to 2 seconds, the actual network-level +connect is only permitted to take 2 seconds. As long as the connection +is established in less than 2 seconds, the call can proceed. The 10 +second call timeout still applies to the time taken for the whole call +(including the connection establishment). So, if establishing the +connection takes 1.5 seconds, and the call itself takes 9.5 seconds, +the call will time out because although it met the connection timeout, +it exceeded the 10 second total call timeout. On the other hand, if +establishing the connection takes 3 seconds, the call will fail after +only 2 seconds, since only 2 seconds are permitted for the connect. + +If an object reference has multiple possible endpoints available, the +client will attempt to connect to them in turn, until one succeeds. +The connect timeout applies to each connection attempt. So with a +connect timeout of 2 seconds, the client will spend up to 2 seconds +attempting to connect to the first address and then, if that fails, up +to 2 seconds trying the second address, and so on. The 10 second +timeout still applies to the call as a whole, so if the total time +taken on timed-out connection attempts exceeds 10 seconds, the call +will time out. + +This kind of configuration is useful where calls may take a long time +to complete (so call timeouts are long), but a fast indication of +connection failure is required. + + +\section{Server side behaviour} + +The server side has two primary modes of operation: thread per +connection and thread pooling. It is able to dynamically transition +between the two modes, and it supports a hybrid scheme that behaves +mostly like thread pooling, but has the same fast turn-around for +sequences of calls as thread per connection. + +\subsection{Thread per connection mode} + +In thread per connection mode (the default, and the only option in +omniORB versions before 4.0), each connection has a single thread +dedicated to it. The thread blocks waiting for a request. When it +receives one, it unmarshals the arguments, makes the up-call to the +application code, marshals the reply, and goes back to watching the +connection. There is thus no thread switching along the call chain, +meaning the call is very efficient. + +As explained above, a client can choose to multiplex multiple +concurrent calls on a single connection, so once the server has +received the request, and just before it makes the call into +application code, it marks the connection as `selectable', meaning +that another thread should watch it to see if any other requests +arrive. If they do, extra threads are dispatched to handle the +concurrent calls. GIOP 1.2 actually allows the argument data for +multiple calls to be interleaved on a connection, so the unmarshalling +code has to handle that too. As soon as any multiplexing occurs on the +connection, the aim of removing thread switching cannot be met, and +there is inevitable inefficiency due to thread switching. + +The \code{maxServerThreadPerConnection} parameter can be set to limit +the number of threads that can be allocated to a single connection +containing concurrent calls. Setting the parameter to 1 mimics the +behaviour of omniORB versions before 4.0, that did not support +calls multiplexed on one connection. + + +\subsection{Thread pool mode} +\label{sec:watchConn} + +In thread pool mode, selected by setting the +\code{threadPerConnectionPolicy} parameter to zero, a single thread +watches all incoming connections. When a call arrives on one of them, +a thread is chosen from a pool of threads, and set to work +unmarshalling the arguments and performing the up-call. There is +therefore at least one thread switch for each call. + +The thread pool is not pre-initialised. Instead, threads are started +on demand, and idle threads are stopped after a period of inactivity. +The maximum number of threads that can be started in the pool is set +with the \code{maxServer\dsc{}ThreadPoolSize} parameter. The default +is 100. + +A common pattern in CORBA applications is for a client to make several +calls to a single object in quick succession. To handle this situation +most efficiently, the default behaviour is to not return a thread to +the pool immediately after a call is finished. Instead, it is set to +watch the connection it has just served for a short while, mimicking +the behaviour in thread per connection mode. If a new call comes in +during the watching period, the call is dispatched without any thread +switching, just as in thread per connection mode. Of course, if the +server is supporting a very large number of connections (more than the +size of the thread pool), this policy can delay a call coming from +another connection. If the \code{threadPoolWatch\dsc{}Connection} +parameter is set to zero, connection watching is disabled and threads +return to the pool immediately after finishing a single request. + +In the face of multiplexed calls on a single connection, multiple +threads from the pool can be dispatched for one connection, just as in +thread per connection mode. With \code{threadPoolWatchConnection} set +to the default value of 1, only the last thread servicing a connection +will watch it when it finishes a request. Setting the parameter to a +larger number allows the last \emph{n} connections to watch the +connection. + + +\subsection{Policy transition} + +If the server is dealing with a relatively small number of +connections, it is most efficient to use thread per connection mode. +If the number of connections becomes too large, however, operating +system limits on the number of threads may cause a significant +slowdown, or even prevent the acceptance of new connections +altogether. + +To give the most efficient response in all circumstances, omniORB +allows a server to start in thread per connection mode, and transition +to thread pooling if many connections arrive. This is controlled with +the \code{threadPerConnection\dsc{}UpperLimit} and +\code{threadPerConnectionLowerLimit} parameters. The upper limit must +always be larger than the lower limit. The upper limit chooses the +number of connections at which time the ORB transitions to thread pool +mode; the lower limit selects the point at which the transition back +to thread per connection is made. + +For example, setting the upper limit to 50 and the lower limit to 30 +would mean that the first 49 connections would receive dedicated +threads. The 50th to arrive would trigger thread pooling. All future +connections to arrive would make use of threads from the pool. Note +that the existing dedicated threads continue to service their +connections until the connections are closed. If the number of +connections falls below 30, thread per connection is reactivated and +new connections receive their own dedicated threads (up to the limit +of 50 again). Once again, existing connections in thread pool mode +stay in that mode until they are closed. + + +\section{Idle connection shutdown} +\label{sec:connShutdown} + +It is wasteful to leave a connection open when it has been left unused +for a considerable time. Too many idle connections could block out new +connections when the system runs out of spare communication channels. +For example, most platforms have a limit on the number of file handles +a process can open. Many platforms have a very small default limit +like 64. The value can often be increased to a maximum of a thousand +or more by changing the `ulimit' in the shell. + +Every so often, a thread scans all open connections to see which are +idle. The scanning period (in seconds) is set with the +\code{scanGranularity} parameter. The default is 5 seconds. + +Outgoing connections (initiated by clients) and incoming connections +(initiated by servers) have separate idle timeouts. The timeouts are +set with the \code{outConScan\dsc{}Period} and \code{inConScanPeriod} +parameters respectively. The values are in seconds, and must be a +multiple of the scan granularity. + +Beware that setting \code{outConScanPeriod} or \code{inConScanPeriod} +to be equal to (or less than) \code{scanGranularity} means that +connections are considered candidates for closure immediately after +they are opened. That can mean that the connections are closed before +any calls have been sent through them. If oneway calls are used, such +connection closure can result in silent loss of calls. + + +\subsection{Interoperability Considerations} + +The IIOP specification allows both the client and the server to +shutdown a connection unilaterally. When one end is about to shutdown +a connection, it should send a \code{CloseConnection} message to the +other end. It should also make sure that the message will reach the +other end before it proceeds to shutdown the connection. + +The client should distinguish between an orderly and an abnormal +connection shutdown. When a client receives a \code{CloseConnection} +message before the connection is closed, the condition is an orderly +shutdown. If the message is not received, the condition is an +abnormal shutdown. In an abnormal shutdown, the ORB should raise a +\code{COMM\_FAILURE} exception whereas in an orderly shutdown, the ORB +should \emph{not} raise an exception and should try to re-establish a +new connection transparently. + +omniORB implements these semantics completely. However, it is known +that some ORBs are not (yet) able to distinguish between an orderly +and an abnormal shutdown. Usually this is manifested as the client in +these ORBs seeing a \code{COMM\_FAILURE} occasionally when connected +to an omniORB server. The work-around is either to catch the exception +in the application code and retry, or to turn off the idle connection +shutdown inside the omniORB server. + + + +\section{Transports and endpoints} +\label{sec:endpoints} + +omniORB can support multiple network transports. All platforms +(usually) have a TCP transport available. Unix platforms support a +Unix domain socket transport. Platforms with the OpenSSL library +available can support an SSL transport. + +Servers must be configured in two ways with regard to transports: the +transports and interfaces on which they listen, and the details that +are published in IORs for clients to see. Usually the published +details will be the same as the listening details, but there are times +when it is useful to publish different information. + +Details are selected with the \code{endPoint} family of parameters. +The simplest is plain \code{endPoint}, which chooses a transport and +interface details, and publishes the information in IORs. Endpoint +parameters are in the form of URIs, with a scheme name of +`\code{giop:}', followed by the transport name. Different transports +have different parameters following the transport. -\noindent Alternatively, to use \op{resolve\_initial\_references}, you -use a URI of the form: +TCP endpoints have the format: \begin{quote} -\corbauri{corbaloc:rir:/NameService} +\code{giop:tcp:}\textit{}\code{:}\textit{} \end{quote} +\noindent The host must be a valid host name or IP address for the +server machine. It determines the network interface on which the +server listens. The port selects the TCP port to listen on, which must +be unoccupied. Either the host or port, or both can be left empty. If +the host is empty, the ORB publishes the IP address of the first +non-loopback network interface it can find (or the loopback if that is +the only interface), but listens on \emph{all} network interfaces. If +the port is empty, the operating system chooses an \term{ephemeral} +port. -\subsection{corbaname} -\label{sec:corbaname} +Multiple TCP endpoints can be selected, either to specify multiple +network interfaces on which to listen, or (less usefully) to select +multiple TCP ports on which to listen. -\corbauri{corbaname} URIs cause \op{string\_to\_object} to look-up a -name in a CORBA Naming service. They are an extension of the -\corbauri{corbaloc} syntax: +If no \code{endPoint} parameters are set, the ORB assumes a single +parameter of \code{giop:tcp::}, meaning IORs contain the address of +the first non-loopback network interface, the ORB listens on all +interfaces, and the OS chooses a port number. + +SSL endpoints have the same format as TCP ones, except `\code{tcp}' +is replaced with `\code{ssl}'. Unix domain socket endpoints have the +format: \begin{quote} -\corbauri{corbaname:}% -<\textit{corbaloc location}>% -\corbauri{/}% -<\textit{object key}>% -\corbauri{#}% -<\textit{stringified name}> +\code{giop:unix:}\textit{} \end{quote} -\noindent for example: +\noindent where the filename is the name of the socket within the +filesystem. If the filename is left blank, the ORB chooses a name +based on the process id and a timestamp. + +To listen on an endpoint without publishing it in IORs, specify it +with the \code{endPointNoPublish} configuration parameter. See below +for more details about endpoint publishing. + + +\subsection{Port ranges} + +Sometimes it is useful to restrict a server to listen on one of a +range of ports, rather than pinning it to one particular port or +allowing the OS to choose an ephemeral port. omniORB 4.2 introduces +the ability to specify a range of ports using a hyphen. e.g.\ to +listen on a port between 5000 and 5010 inclusive: \begin{quote} -\corbauri{corbaname::myhost/NameService#project/example/echo.obj}\\ -\corbauri{corbaname:rir:/NameService#project/example/echo.obj} +\code{giop:tcp::5000-5010} \end{quote} -\noindent The object found with the \corbauri{corbaloc}-style portion -must be of type \intf{CosNaming::\dsc{}NamingContext}, or something -derived from it. If the object key (or \corbauri{rir} name) is -`\corbauri{NameService}', it can be left out: +omniORB randomly chooses a port in the range. If it finds that the +chosen port is already occupied, it keeps trying different ports until +it finds a free one. If all the ports in the range are occupied, it +throws \code{CORBA::INITIALIZE}. + + +\subsection{IPv6} + +On platforms where it is available, omniORB supports IPv6. On most +Unix platforms, IPv6 sockets accept both IPv6 and IPv4 connections, so +omniORB's default \code{giop:tcp::} endpoint accepts both IPv4 and +IPv6 connections. On Windows versions before Windows Vista, each +socket type only accepts incoming connections of the same type, so an +IPv6 socket cannot be used with IPv4 clients. For this reason, the +default \code{giop:tcp::} endpoint only listens for IPv4 connections. +Since endpoints with a specific host name or address only listen on a +single network interface, they are inherently limited to just one +protocol family. + +To explicitly ask for just IPv4 or just IPv6, an endpoint with the +wildcard address for the protocol family should be used. For IPv4, the +wildcard address is `\code{0.0.0.0}', and for IPv6 it is `\code{::}'. +So, to listen for IPv4 connections on all IPv4 network interfaces, use +an endpoint of: \begin{quote} -\corbauri{corbaname::myhost#project/example/echo.obj}\\ -\corbauri{corbaname:rir:#project/example/echo.obj} +\code{giop:tcp:0.0.0.0:} \end{quote} -\noindent The stringified name portion can also be left out, in which -case the URI denotes the \intf{CosNaming::NamingContext} which would -have been used for a look-up: +\noindent All IPv6 addresses contain colons, so the address portion in +URIs must be contained within \code{[]} characters. Therefore, to +listen just for IPv6 connections on all IPv6 interfaces, use the +somewhat cryptic: \begin{quote} -\corbauri{corbaname::myhost.example.com}\\ -\corbauri{corbaname:rir:} +\code{giop:tcp:[::]:} +\end{quote} + +\noindent To listen for both IPv4 and IPv6 connections on Windows +versions prior to Vista, both endpoints must be explicitly provided. + +\subsubsection{Link local addresses} + +In IPv6, all network interfaces are assigned a \term{link local} +address, starting with the digits \code{fe80}. The link local address +is only valid on the same `link' as the interface, meaning directly +connected to the interface, or possibly on the same subnet, depending +on how the network is switched. To connect to a server's link local +address, a client has to know which of its network interfaces is on +the same link as the server. Since there is no way for omniORB to know +which local interface a remote link local address may be connected to, +and in extreme circumstances may even end up contacting the wrong +server if it picks the wrong interface, link local addresses are not +considered valid. Servers do not publish link local addresses in their +IORs. + + +\subsection{Endpoint publishing} + +For clients to be able to connect to a server, the server publishes +endpoint information in its IORs (Interoperable Object References). +Normally, omniORB publishes the first available address for each of +the endpoints it is listening on. + +The endpoint information to publish is determined by the +\code{endPointPublish} configuration parameter. It contains a +comma-separated list of publish rules. The rules are applied in turn +to each of the configured endpoints; if a rule matches an endpoint, it +causes one or more endpoints to be published. + +The following core rules are supported: + +\vspace{\baselineskip} + +\begin{tabular}{p{.25\textwidth}p{.75\textwidth}} +\code{addr} & the first natural address of the endpoint\\ +\code{ipv4} & the first IPv4 address of a TCP or SSL endpoint\\ +\code{ipv6} & the first IPv6 address of a TCP or SSL endpoint\\ +\code{name} & the first address that can be resolved to a name\\ +\code{hostname} & the result of the gethostname() system call\\ +\code{fqdn} & the fully-qualified domain name\\ +\end{tabular} + +\vspace{\baselineskip} + +\noindent +The core rules can be combined using the vertical bar operator to +try several rules in turn until one succeeds. e.g: + +\vspace{\baselineskip} + +\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} +\code{name|ipv6|ipv4} & the name of the endpoint if it has one; + failing that, its first IPv6 address; + failing that, its first IPv4 address. +\end{tabular} + +\vspace{\baselineskip} + +\noindent +Multiple rules can be combined using the comma operator to +publish more than one endpoint. e.g. + +\vspace{\baselineskip} + +\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} +\code{name,addr} & the name of the endpoint (if it has one), + followed by its first address. +\end{tabular} + +\vspace{\baselineskip} + +\noindent +For endpoints with multiple addresses (e.g. TCP endpoints on +multi-homed machines), the \code{all()} manipulator causes all +addresses to be published. e.g.: + +\vspace{\baselineskip} + +\begin{tabular}{p{.3\textwidth}p{.7\textwidth}} +\code{all(addr)} & all addresses are published\\ +\code{all(name)} & all addresses that resolve to names are published\\ +\code{all(name|addr)} & all addresses are published by name if they have + one, address otherwise.\\ +\code{all(name,addr)} & all addresses are published by name (if they + have one), and by address.\\ +\code{all(name), all(addr)} & first the names of all addresses are published, + followed by all the addresses.\\ +\end{tabular} + +\vspace{\baselineskip} + +\noindent +A specific endpoint can be published by giving its endpoint URI, +even if the server is not listening on that endpoint. e.g.: + +\vspace{\baselineskip} + +\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} +\code{giop:tcp:not.my.host:12345}\\ +\code{giop:unix:/not/my/socket-file}\\ +\end{tabular} + +\vspace{\baselineskip} + +\noindent +If the host or port number for a TCP or SSL URI are missed out, +they are filled in with the details from each listening TCP/SSL +endpoint. This can be used to publish a different name for a +TCP/SSL endpoint that is using an ephemeral port, for example. + +omniORB 4.0 supported two options related to endpoint publishing that +are superseded by the \code{endPointPublish} parameter, and so are now +deprecated. Setting \code{endPointPublishAllIFs} to 1 is equivalent to +setting \code{endPointPublish} to `\code{all(addr)}'. The +\code{endPointNoListen} parameter is equivalent to adding endpoint +URIs to the \code{endPointPublish} parameter. + + + +\section{Connection selection and acceptance} + +In the face of IORs containing details about multiple different +endpoints, clients have to know how to choose the one to use to +connect a server. Similarly, servers may wish to restrict which +clients can connect to particular transports. This is achieved with +\term{transport rules}. + + +\subsection{Client transport rules} +\label{sec:clientRule} + +The \code{clientTransportRule} parameter is used to filter and +prioritise the order in which transports specified in an IOR are +tried. Each rule has the form: + +\begin{quote} +\textit{
[action]+} \end{quote} -\noindent The first of these examples is the easiest way of specifying -the location of a naming service. +\noindent The address mask can be one of + +\vspace{\baselineskip} + +\begin{tabular}{llp{.5\textwidth}} +1. & \code{localhost} & The address of this machine\\ + +2. & \textit{w.x.y.z}\code{/}\textit{m1.m2.m3.m4} & An IPv4 address + with bits selected by the mask, e.g.\ + \code{172.16.0.0/255.240.0.0}\\ + +3. & \textit{w.x.y.z}\code{/}\textit{prefixlen} & An IPv4 address with + \textit{prefixlen} significant bits, e.g.\ + \code{172.16.2.0/24}\\ +4. & \textit{a:b:c:d:e:f:g:h}\code{/}\textit{prefixlen} & An IPv6 + address with \textit{prefixlen} significant bits, e.g.\ + \code{3ffe:505:2:1::/64}\\ -\section{Configuring resolve\_initial\_references} -\label{sec:insargs} +5. & \code{*} & Wildcard that matches any address\\ +\end{tabular} -The INS specifies two standard command line arguments which provide a -portable way of configuring \op{ORB::resolve\_initial\_references}: +\vspace{\baselineskip} +\noindent The action is one or more of the following: -\subsection{ORBInitRef} +\vspace{\baselineskip} -\cmdline{-ORBInitRef} takes an argument of the form -<\textit{ObjectId}>\cmdline{=}<\textit{ObjectURI}>. So, for example, -with command line arguments of: +\begin{tabular}{llp{.5\textwidth}} +1. & \code{none} & Do not use this address\\ +2. & \code{tcp} & Use a TCP transport\\ +3. & \code{ssl} & Use an SSL transport\\ +4. & \code{unix} & Use a Unix socket transport\\ +5. & \code{bidir}& Connections to this address can be used + bidirectionally (see section~\ref{sec:bidir})\\ +\end{tabular} -\begin{quote} -\cmdline{-ORBInitRef NameService=corbaname::myhost.example.com} -\end{quote} +\vspace{\baselineskip} -\noindent \code{resolve\_initial\_references("NameService")} will -return a reference to the object with key `NameService' available on -myhost.example.com, port 2809. Since IOR-format strings are considered -URIs, you can also say things like: +\noindent The transport-selecting actions form a prioritised list, so +an action of `\code{unix,ssl,\dsc{}tcp}' means to use a Unix transport if +there is one, failing that a SSL transport, failing \emph{that} a TCP +transport. In the absence of any explicit rules, the client uses the +implicit rule of `\code{* unix,ssl,tcp}'. -\begin{quote} -\cmdline{-ORBInitRef NameService=IOR:00ff...} -\end{quote} +If more than one rule is specified, they are prioritised in the order +they are specified. For example, the configuration file might contain: +\begin{verbatim} + clientTransportRule = 192.168.1.0/255.255.255.0 unix,tcp + clientTransportRule = 172.16.0.0/255.240.0.0 unix,tcp + = * none +\end{verbatim} -\subsection{ORBDefaultInitRef} +\noindent This would be useful if there is a fast network +(192.168.1.0) which should be used in preference to another network +(172.16.0.0), and connections to other networks are not permitted at +all. -\cmdline{-ORBDefaultInitRef} provides a prefix string which is used to -resolve otherwise unknown names. When -\op{resolve\_initial\_references} is unable to resolve a name which -has been specifically configured (with \cmdline{-ORBInitRef}), it -constructs a string consisting of the default prefix, a `\corbauri{/}' -character, and the name requested. The string is then fed to -\op{string\_to\_object}. So, for example, with a command line of: +In general, the result of filtering the endpoint specifications in an +IOR with the client transport rule will be a prioritised list of +transports and networks. (If the transport rules do not prioritise one +endpoint over another, the order the endpoints are listed in the IOR +is used.) When trying to contact an object, the ORB tries its +possible endpoints in turn, until it finds one with which it can +contact the object. Only after it has unsuccessfully tried all +permissible endpoints will it raise a \code{TRANSIENT} exception to +indicate that the connect failed. -\begin{quote} -\cmdline{-ORBDefaultInitRef corbaloc::myhost.example.com} -\end{quote} -\noindent a call to \code{resolve\_initial\_references("MyService")} -will return the object reference denoted by -`\corbauri{corbaloc::myhost.example.com/MyService}'. -Similarly, a \corbauri{corbaname} prefix can be used to cause -look-ups in the naming service. Note, however, that since a -`\corbauri{/}' character is always added to the prefix, it is -impossible to specify a look-up in the root context of the naming -service---you have to use a sub-context, like: +\subsection{Server transport rules} +\label{sec:serverRule} -\begin{quote} -\cmdline{-ORBDefaultInitRef corbaname::myhost.example.com\#services} -\end{quote} +Server transport rules have the same format as client transport +rules. Rather than being used to select which of a set of ways to +contact a machine, they are used to determine whether or not to accept +connections from particular clients. In this example, we only allow +connections from our intranet: +\begin{verbatim} + serverTransportRule = localhost unix,tcp,ssl + = 172.16.0.0/255.240.0.0 tcp,ssl + = * none +\end{verbatim} +\noindent And in this one, we accept only SSL connections if the +client is not on the intranet: -\section{omniNames} +\begin{verbatim} + serverTransportRule = localhost unix,tcp,ssl + = 172.16.0.0/255.240.0.0 tcp,ssl + = * ssl,bidir +\end{verbatim} -\subsection{NamingContextExt} +\noindent In the absence of any explicit rules, the server uses the +implicit rule of `\code{* unix,\dsc{}ssl,tcp}', meaning any kind of +connection is accepted from any client. -omniNames supports the extended \intf{CosNaming::NamingContextExt} -interface: -\begin{idllisting} -module CosNaming { - interface NamingContextExt : NamingContext { - typedef string StringName; - typedef string Address; - typedef string URLString; +\section{Bidirectional GIOP} +\label{sec:bidir} - StringName to_string(in Name n) raises(InvalidName); - Name to_name (in StringName sn) raises(InvalidName); +omniORB supports bidirectional GIOP, which allows callbacks to be made +using a connection opened by the original client, rather than the +normal model where the server opens a new connection for the callback. +This is important for negotiating firewalls, since they tend not to +allow connections back on arbitrary ports. - exception InvalidAddress {}; +There are several steps required for bidirectional GIOP to be enabled +for a callback. Both the client and server must be configured +correctly. On the client side, these conditions must be met: - URLString to_url(in Address addr, in StringName sn) - raises(InvalidAddress, InvalidName); +\begin{itemize} - Object resolve_str(in StringName n) - raises(NotFound, CannotProceed, InvalidName, AlreadyBound); - }; -}; -\end{idllisting} +\item The \code{offerBiDirectionalGIOP} parameter must be set to \code{true}. +\item The client transport rule for the target server must contain the + \code{bidir} action. +\item The POA containing the callback object (or objects) must have + been created with a \code{BidirectionalPolicy} value of + \code{BOTH}. -\op{to\_string} and \op{to\_name} convert from \type{CosNaming::Name} -sequences to flattened strings and vice-versa. Note that calling -these operations involves remote calls to the naming service, so they -are not particularly efficient. You can use the omniORB specific local -\op{omniURI::nameToString} and \op{omniURI::\dsc{}stringToName} -functions instead. +\end{itemize} -A \type{CosNaming::Name} is stringified by separating name components -with `\texttt{/}' characters. The \code{kind} and \code{id} fields of -each component are separated by `\texttt{.}' characters. If the -\code{kind} field is empty, the representation has no trailing -`\texttt{.}'; if the \code{id} is empty, the representation starts -with a `\texttt{.}' character; if both \texttt{id} and \texttt{kind} -are empty, the representation is just a `\texttt{.}'. The backslash -`\texttt{\textbackslash}' is used to escape the meaning of -`\texttt{/}', `\texttt{.}' and `\texttt{\textbackslash}' itself. +\noindent On the server side, these conditions must be met: -\op{to\_url} takes a \corbauri{corbaloc} style address and key string -(but without the \corbauri{corbaloc:} part), and a stringified name, -and returns a \corbauri{corbaname} URI (incorrectly called a URL) -string, having properly escaped any invalid characters. The -specification does not make it clear whether or not the address string -should also be escaped by the operation; omniORB does not escape -it. For this reason, it is best to avoid calling \op{to\_url} if the -address part contains escapable characters. omniORB provides the -equivalent local function \op{omniURI::addrAndNameToURI}. +\begin{itemize} -\op{resolve\_str} is equivalent to calling \op{to\_name} followed by -the inherited \op{resolve} operation. There are no string-based -equivalents of the various bind operations. +\item The \code{acceptBiDirectionalGIOP} parameter must be set to \code{true}. +\item The server transport rule for the requesting client must contain + the \code{bidir} action. +\item The POA hosting the object contacted by the client must have + been created with a \code{BidirectionalPolicy} value of + \code{BOTH}. +\end{itemize} -\subsection{Use with corbaname} -To make it easy to use omniNames with \corbauri{corbaname} URIs, it -starts with the default port of 2809, and an object key of -`\texttt{NameService}' for the root naming context. +\section{TLS / SSL transport} +omniORB supports a TLS / SSL transport, using OpenSSL. It is only +built if OpenSSL is available. On platforms using Autoconf, it is +autodetected in many locations, or its location can be given with the +\code{-{}-with-openssl=} argument to \code{configure}. On other +platforms, the \code{OPEN\_SSL\_ROOT} make variable must be set in the +platform file. -\section{omniMapper} -\hyphenation{omni-Mapper} +To use the SSL transport, you must link your application with the +\file{omnisslTP} library, and correctly set up certificates. See the +\file{src/examples/ssl_echo} directory for an example. That directory +contains a \file{README} file with more details. -omniMapper is a simple daemon which listens on port 2809 (or any other -port), and redirects IIOP requests for configured object keys to -associated persistent object references. It can be used to make a -naming service (even an old non-INS aware version of omniNames or -other ORB's naming service) appear on port 2809 with the object key -`\texttt{NameService}'. The same goes for any other service you may -wish to specify, such as an interface repository. omniMapper is -started with a command line of: +\subsection{Self-signed certificate authority} -\begin{quote} -\cmdline{omniMapper [-port }<\textit{port}>% -\cmdline{] [-config }<\textit{config file}>% -\cmdline{] [-v]} -\end{quote} +By default, omniORB configures OpenSSL to require both clients and +servers to have certificates that are signed by a Certificate +Authority (CA). It is possible to use a public CA to obtain keys that +can be independently verified, but for many purposes, it is sufficient +to use a private CA to sign all the keys in use in an application. The +following is a brief description of how to become your own certificate +authority and issue and sign certificates, using the OpenSSL command +line tools. + +Before starting, find the default \file{openssl.cnf} file that was +installed with OpenSSL, copy it to a suitable location, and edit it as +you feel appropriate. Now, build a certificate directory structure, +authority key and certificate: -\noindent The \cmdline{-port} option allows you to choose a port other -than 2809 to listen on. The \cmdline{-config} option specifies a -location for the configuration file. The default name is -\file{/etc/omniMapper.cfg}, or \file{C:\omniMapper.cfg} on -Windows. omniMapper does not normally print anything; the \cmdline{-v} -option makes it verbose so it prints configuration information and a -record of the redirections it makes, to standard output. +\begin{verbatim} + mkdir demoCA demoCA/private demoCA/newcerts -The configuration file is very simple. Each line contains a string to -be used as an object key, some white space, and an IOR (or any valid -URI) that it will redirect that object key to. Comments should be -prefixed with a `\texttt{\#}' character. For example: + openssl req -config openssl.cnf -x509 -newkey rsa:2048 \ + -keyout demoCA/private/cakey.pem -out demoCA/cacert.pem -days 3650 -\begin{quote} -\begin{verbatim} -# Example omniMapper.cfg -NameService IOR:000f... -InterfaceRepository IOR:0100... + echo 01 >demoCA/serial + touch demoCA/index.txt \end{verbatim} -\end{quote} -omniMapper can either be run on a single machine, in much the same way -as omniNames, or it can be run on \emph{every} machine, with a common -configuration file. That way, each machine's omniORB configuration -file could contain the line: +\noindent Next, issue a key request and sign it: -\begin{quote} \begin{verbatim} -ORBDefaultInitRef corbaloc::localhost -\end{verbatim} -\end{quote} - + openssl req -config openssl.cnf -new -keyout server_key.pem \ + -out server_req.pem -days 3650 + openssl ca -config openssl.cnf -policy policy_anything \ + -out server_cert.pem -in server_req.pem +\end{verbatim} -\section{Creating objects with simple object keys} +\noindent Amongst other things, you now have a server key file in +\file{server_key.pem} and a certificate in \file{server_cert.pem}. To +make a single file containing both the key and the certificate, +suitable for use in omniORB, concatenate the key and certificate files +together. You can skip the human-readable(ish) text in the +certificate file before the \verb|-----BEGIN CERTIFICATE-----| marker. -In normal use, omniORB creates object keys containing various -information including POA names and various non-ASCII characters. -Since object keys are supposed to be opaque, this is not usually a -problem. The INS breaks this opacity and requires servers to create -objects with human-friendly keys. +If need be, create more certificates for servers and clients in the +same way. -If you wish to make your objects available with human-friendly URIs, -there are two options. The first is to use omniMapper as described -above, in conjunction with a \code{PERSISTENT} POA. The second is to -create objects with the required keys yourself. You do this with a -special POA with the name `\texttt{omniINSPOA}', acquired from -\op{resolve\_initial\_references}. This POA has the \code{USER\_ID} -and \code{PERSISTENT} policies, and the special property that the -object keys it creates contain only the object ids given to the POA, -and no other data. It is a normal POA in all other respects, so you -can activate/deactivate it, create children, and so on, in the usual -way. -Children of the omniINSPOA do not inherit its special properties of -creating simple object keys. If the omniINSPOA's policies are not -suitable for your application, you cannot create a POA with different -policies (such as single threading, for example), and still generate -simple object keys. Instead, you can activate a servant in the -omniINSPOA that uses location forwarding to redirect requests to -objects in a different POA. +\section{ZIOP} +omniORB has support for ZIOP, which compresses transmitted +messages. To use it, link with the \code{omniZIOP4} library. +On Unix platforms, ZIOP support is automatically enabled if the +configure script detects zlib. To enable it on Windows, set the +\code{EnableZIOP} make variable in the platform configuration file. +omniORB has an almost complete implementation of the ZIOP +specification, with the following extensions and differences: -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{Interface Type Checking} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{ch_intf} +\begin{enumerate} +\item To avoid a dependency on \code{CORBA::Any}, compression policies + can be obtained with functions in the \code{omniZIOP} namespace, + rather than with the standard \op{orb->create\_policy}. See + \file{include/omniORB4/omniZIOP.h} for details. To use \code{Any} + with the standard \op{orb->create\_policy}, link with the + \code{omniZIOPDynamic4} library in addition to \code{omniZIOP4}. + +\item Client-side policies are global, set with + \op{omniZIOP::setGlobalPolicies}. + \op{CORBA::Object::\_set\_policy\_overrides} is not supported. + +\item POAs can be given ZIOP policies as shown in the + \file{src/examples/ziop/ziop_impl.cc}, but they can also use the + global policies set with \op{omniZIOP::\dsc{}setGlobalPolicies}. This + is useful to apply ZIOP policies to the RootPOA or omniINSPOA. +\end{enumerate} -This chapter describes the mechanism used by omniORB to ensure type -safety when object references are exchanged across the network. This -mechanism is handled completely within the ORB. There is no -programming interface visible at the application level. However, for -the sake of diagnosing the problem when there is a type violation, it -is useful to understand the underlying mechanism in order to interpret -the error conditions reported by the ORB. +\noindent In addition to the standard policies, whether or not to +enable ZIOP is determined by client and server transport rules. For a +client to use ZIOP, the matching client transport rule must include +`\code{ziop}'; similarly, for a server to use ZIOP, the matching +server transport rule must include `\code{ziop}'. e.g.\ to use the +examples: -\section{Introduction} +\begin{verbatim} + ziop_impl -ORBserverTransportRule "* unix,ssl,tcp,ziop" -In GIOP/IIOP, an object reference is encoded as an Interoperable -Object Reference (IOR) when it is sent across a network connection. -The IOR contains a Repository ID (RepoId) and one or more -communication profiles. The communication profiles describe where and -how the object can be contacted. The RepoId is a string which uniquely -identifies the IDL interface of the object. + ziop_clt -ORBclientTransportRule "* unix,ssl,tcp,ziop" IOR:... +\end{verbatim} -Unless the \code{ID} pragma is specified in the IDL, the ORB generates -the RepoId string in the so-called OMG IDL Format\footnote{For further -details of the repository ID formats, see section 10.6 in the CORBA -2.6 specification.}. For instance, the RepoId for the \intf{Echo} -interface used in the examples of chapter~\ref{chap:basic} is -\texttt{IDL:Echo:1.0}. +\noindent This allows you to enable ZIOP for WAN links, but disable it +for LAN communication, for example. -When interface inheritance is used in the IDL, the ORB always sends the -RepoId of the most derived interface. For example: -\begin{idllisting} - // IDL - interface A { - ... - }; - interface B : A { - ... - }; - interface C { - void op(in A arg); - }; -\end{idllisting} +\subsection{Forcing ZIOP Policies} + +The fact that a server supports ZIOP is encoded in its IORs. This +means that if a client uses a \corbauri{corbaloc} URI to reference an +object, the object reference does not contain ZIOP details, and thus +the communication cannot use ZIOP. If a client is absolutely certain +that a server supports ZIOP, it can extend an object reference with +ZIOP details using \op{omniZIOP::setServerPolicies}. Using the new +object reference, the client will be able to make ZIOP calls. \begin{cxxlisting} - // C++ - C_ptr server; - B_ptr objB; - A_ptr objA = objB; - server->op(objA); // Send B as A +namespace omniZIOP { + CORBA::Object_ptr + setServerPolicies(CORBA::Object_ptr obj, const CORBA::PolicyList& policies); +}; \end{cxxlisting} -In the example, the operation \op{C::op} accepts an object reference -of type \type{A}. The real type of the reference passed to \op{C::op} -is \type{B}, which inherits from \type{A}. In this case, the RepoId of -\type{B}, and not that of \type{A}, is sent across the network. - -The GIOP/IIOP specification allows an ORB to send a null string in the -RepoId field of an IOR. It is up to the receiving end to work out the -real type of the object. omniORB never sends out null strings as -RepoIds, but it may receive null RepoIds from other ORBs. In that -case, it will use the mechanism described below to ensure type safety. +Creating a ZIOP-enabling object reference in this way is dangerous! +If the server does not actually support ZIOP, it will receive +compressed messages that it cannot handle. A well-behaved server will +throw a \code{CORBA::MARSHAL} exception in response, or perhaps just +drop the invalid connection. -\section{Interface Inheritance} -When the ORB receives an IOR of interface type B when it expects the -type to be A, it must find out if B inherits from A. When the ORB has -no local knowledge of the type B, it must work out the type of B -dynamically. +\section{Connection Management Extension} -The CORBA specification defines an Interface Repository (IR) from -which IDL interfaces can be queried dynamically. In the above -situation, the ORB could contact the IR to find out the type of B. -However, this approach assumes that an IR is always available and -contains the up-to-date information of all the interfaces used in the -domain. This assumption may not be valid in many applications. +The \code{omniConnectionMgmt} library provides an omniORB-specific +extension for application-level connection management. Its purpose is +to allow clients and servers to negotiate private GIOP connections, +and to control how the connections are used in multi-threaded +situations. -An alternative is to use the \op{\_is\_a} operation to work out the -actual type of an object. This approach is simpler and more robust -than the previous one because no 3rd party is involved, so this is -what omniORB does. +The \code{omniConnectionMgmt} library has two functions, defined in +\file{include/omniORB4/omniConnectionMgmt.h}: \begin{cxxlisting} -class Object{ - CORBA::Boolean _is_a(const char* type_id); +namespace omniConnectionMgmt { + + void init(); + + CORBA::Object_ptr + makeRestrictedReference(CORBA::Object_ptr obj, + CORBA::ULong connection_id, + CORBA::ULong max_connections, + CORBA::ULong max_threads, + CORBA::Boolean data_batch, + CORBA::Boolean permit_interleaved, + CORBA::Boolean server_hold_open); }; \end{cxxlisting} -The \op{\_is\_a} operation is part of the \intf{CORBA::Object} -interface and must be implemented by every object. The input argument -is a RepoId. The function returns true(1) if the object is really an -instance of that type, including if that type is a base type of the -most derived type of that object. +\noindent The \op{init} function must be called before +\op{CORBA::ORB\_init} in every process that is to take part in the +connection management. -In the situation above, the ORB would invoke the \op{\_is\_a} -operation on the object and ask if the object is of type A -\emph{before} it processes any application invocation on the object. +The \op{makeRestrictedReference} function is the single entry-point to +the connection management functionality. It builds an annotated object +reference that contains information for the connection management +system. It returns a new reference, leaving the original object +reference unchanged. -Notice that the \op{\_is\_a} call is \emph{not} performed when the IOR -is unmarshalled. It is performed just prior to the first application -invocation on the object. This leads to some interesting failure modes -if B reports that it is not an A. Consider the following example: +\subsection{Client-side parameters} -\begin{idllisting} -// IDL -interface A { ... }; -interface B : A { ... }; -interface D { ... }; -interface C { - A op1(); - Object op2(); -}; -\end{idllisting} +These parameters affect the client side of a connection: -\lstset{numbers=left,gobble=4} -\begin{cxxlisting} - 1 // C++ - 2 C_ptr objC; - 3 A_ptr objA; - 4 CORBA::Object_ptr objR; - 5 - 6 objA = objC->op1(); - 7 (void) objA->_non_existent(); - 8 - 9 objR = objC->op2(); -10 objA = A::_narrow(objR); -\end{cxxlisting} -\lstset{numbers=none,gobble=0} +\confoptnd{connection\_id} -\noindent If the stubs of A,B,C,D are linked into the executable and: +This number identifies the private connection set. All object +references with the same \code{connection\_id} will share the same set +of GIOP connections. Object references with different connection ids +are guaranteed to use different connections from each other, and from +object references that have not been annotated with +\op{makeRestrictedReference}. -\begin{description} -\item[Case 1] \op{C::op1} and \op{C::op2} return a B. Lines 6--10 -complete successfully. The remote object is only contacted at line 7. +\confoptnd{max\_connections} -\item[Case 2] \op{C::op1} and \op{C::op2} return a D. This condition -only occurs if the runtime of the remote end is buggy. Even though the -IDL definitions show that D is not derived from A, omniORB gives it -the benefit of the doubt, in case it actually has a more derived -interface that is derived from both A and D. At line 7, the object is -contacted to ask if it is an A. The answer is no, so a -\code{CORBA::INV\_OBJREF} exception is raised. At line 10, the narrow -operation will fail, and objA will be set to nil. -\end{description} +This parameter overrides the omniORB \code{maxGIOPConnectionPerServer} +configuration parameter for the given \code{connection\_id}. It +determines the maximum number of separate GIOP connections that will +be opened to the object's server to service concurrent calls. It is +common to set this value to 1, indicating that only one connection +will be used for the given \code{connection\_id}. Note that this +parameter can only be used to reduce the default +\code{maxGIOPConnectionPerServer} value, not increase it. -\noindent If only the stubs of A are linked into the executable and: +\confoptnd{data\_batch} -\begin{description} -\item[Case 1] \op{C::op1} and \op{C::op2} return a B. Lines 6--10 -complete successfully. When lines 7 and 10 are executed, the object is -contacted to ask if it is an A. +omniORB usually configures its TCP connections to disable Nagle's +algorithm, which batches small messages together into single IP +packages, since that is best for the usual CORBA usage pattern of +two-way requests. Setting this parameter to true overrides that, and +enables Nagle's algorithm on TCP connections or equivalent +functionality on other transports. This can increase throughput if a +client is sending a large number of small oneway calls. -\item[Case 2] \op{C::op1} and \op{C::op2} return a D. This condition -only occurs if the runtime of the remote end is buggy. Line 6 -completes and no exception is raised. At line 7, the object is -contacted to ask if it is an A. If the answer is no, a -\code{CORBA::INV\_OBJREF} exception is raised. At line 10, the narrow -operation will fail, and objA will be set to nil. -\end{description} +\confoptnd{permit\_interleaved} + +This parameter overrides the \code{oneCallPerConnection} configuration +parameter that determines whether multi-threaded clients can +interleave calls on a single connection, issuing a new request message +while a previous request is still waiting for a reply. If +\code{permit\_interleaved} is true, clients can interleave messages; +if it is false, they cannot. + + +\subsection{Server-side parameters} + +These parameters affect the client side of a connection: + +\confoptnd{max\_threads} + +This parameter overrides the global +\code{maxServerThreadPerConnection} configuration parameter that +determines the maximum number of concurrent threads the server will +use to service requests coming from a connection. Note that this +parameter is only relevant if either the client permits interleaved +calls, or if oneway operations are used, since those are the only +circumstances under which the server can receive a new request on a +connection while already handling a request. As with the +\code{max\_connections} client-side parameter, this parameter can only +reduce the default number of threads, not increase it. + +\confoptnd{server\_hold\_open} +Normally, both clients and servers can decide to close a GIOP +connection at any time. When using normal two-way calls, this is no +problem since if a server closes a connection, the client is +guaranteed to notice it when it waits for a reply, and can retry the +call if necessary. With oneway calls, however, if a server closes a +connection just as the client is sending a request, the client will +not know whether the oneway call was received or not, and the call +will potentially be lost. By setting the \code{server\_hold\_open} +parameter to true, the server will not close the connection, relying +on the client to do so. In that case, oneway calls will not be lost +unless there is a network problem that breaks the GIOP connection. +\subsection{Usage} +The omniConnectionMgmt extension is very easy to use---simply call the +\op{init} method in all processes involved, then restrict references +as required. The \op{makeRestrictedReference} function adds profile +information to the object reference's IOR, meaning that the parameters +become part of the object reference and are transmitted along with +it. In other words, a server can create a restricted reference and +send it to a client, and the client will automatically make use of the +restricted parameters when it invokes operations on the object +reference. Alternatively, a client can restrict a normal reference it +receives, in order to change its own behaviour. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{Connection and Thread Management} +\chapter{Interoperable Naming Service} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{chap:connections} +\label{chap:ins} +omniORB supports the Interoperable Naming Service (INS). The following +is a summary of its facilities. -This chapter describes how omniORB manages threads and network -connections. -\section{Background} +\section{Object URIs} -In CORBA, the ORB is the `middleware' that allows a client to invoke -an operation on an object without regard to its implementation or -location. In order to invoke an operation on an object, a client needs -to `bind' to the object by acquiring its object reference. Such a -reference may be obtained as the result of an operation on another -object (such as a naming service or factory object) or by conversion -from a stringified representation. If the object is in a different -address space, the binding process involves the ORB building a proxy -object in the client's address space. The ORB arranges for invocations -on the proxy object to be transparently mapped to equivalent -invocations on the implementation object. +As well as accepting IOR-format strings, \op{ORB::string\_to\_object} +also supports two Uniform Resource Identifier (URI)~\cite{rfc2396} +formats, which can be used to specify objects in a convenient +human-readable form. IOR-format strings are now also considered URIs. -For the sake of interoperability, CORBA mandates that all ORBs should -support IIOP as the means to communicate remote invocations over a -TCP/IP connection. IIOP is usually\footnote{GIOP 1.2 supports -`bidirectional GIOP', which permits the r\^oles to be reversed.} -asymmetric with respect to the roles of the parties at the two ends of -a connection. At one end is the client which can only initiate remote -invocations. At the other end is the server which can only receive -remote invocations. +\subsection{corbaloc} -Notice that in CORBA, as in most distributed systems, remote bindings -are established implicitly without application intervention. This -provides the illusion that all objects are local, a property known as -`location transparency'. CORBA does not specify when such bindings -should be established or how they should be multiplexed over the -underlying network connections. Instead, ORBs are free to implement -implicit binding by a variety of means. +\corbauri{corbaloc} URIs allow you to specify object references which +can be contacted by IIOP, or found through +\op{ORB::resolve\_initial\_references}. To specify an IIOP object +reference, you use a URI of the form: -The rest of this chapter describes how omniORB manages network -connections and the programming interface to fine tune the management -policy. +\begin{quote} +\corbauri{corbaloc:iiop:}<\textit{host}>\corbauri{:}<\textit{port}>% +\corbauri{/}<\textit{object key}> +\end{quote} +\noindent for example: -\section{The model} +\begin{quote} +\corbauri{corbaloc:iiop:myhost.example.com:1234/MyObjectKey} +\end{quote} -omniORB is designed from the ground up to be fully multi-threaded. The -objective is to maximise the degree of concurrency and at the same -time eliminate any unnecessary thread overhead. Another objective is -to minimise the interference by the activities of other threads on the -progress of a remote invocation. In other words, thread `cross-talk' -should be minimised within the ORB. To achieve these objectives, the -degree of multiplexing at every level is kept to a minimum by default. +\noindent which specifies an object with key `MyObjectKey' within a +process running on myhost.example.com listening on port 1234. Object +keys containing non-ASCII characters can use the standard URI \% +escapes: + +\begin{quote} +\corbauri{corbaloc:iiop:myhost.example.com:1234/My}% +\texttt{\%}% +\corbauri{efObjectKey} +\end{quote} + +\noindent denotes an object key with the value 239 (hex ef) in the +third octet. + +The protocol name `\corbauri{iiop}' can be abbreviated to the empty +string, so the original URI can be written: + +\begin{quote} +\corbauri{corbaloc::myhost.example.com:1234/MyObjectKey} +\end{quote} + +\noindent The IANA has assigned port number 2809\footnote{Not 2089 as +printed in \cite{inschapters}!} for use by \corbauri{corbaloc}, so if +the server is listening on that port, you can leave the port number +out. The following two URIs refer to the same object: + +\begin{quote} +\corbauri{corbaloc::myhost.example.com:2809/MyObjectKey}\\ +\corbauri{corbaloc::myhost.example.com/MyObjectKey} +\end{quote} + +\noindent You can specify an object which is available at more than +one location by separating the locations with commas: + +\begin{quote} +\corbauri{corbaloc::myhost.example.com,:localhost:1234/MyObjectKey} +\end{quote} + +\noindent Note that you must restate the protocol for each address, +hence the `\corbauri{:}' before `\corbauri{localhost}'. It could +equally have been written `\corbauri{iiop:localhost}'. + +You can also specify an IIOP version number: + +\begin{quote} +\corbauri{corbaloc::1.2@myhost.example.com/MyObjectKey} +\end{quote} + +\noindent Specifying IIOP versions above 1.0 is slightly risky since +higher versions make use of various information stored in IORs that is +not present in a corbaloc URI. It is generally best to contact initial +corbaloc objects with IIOP 1.0, and rely on higher versions for all +other object references. -Minimising multiplexing works well when the ORB is relatively lightly -loaded. However, when the ORB is under heavy load, it can sometimes be -beneficial to conserve operating system resources such as threads and -network connections by multiplexing at the ORB level. omniORB has -various options that control its multiplexing behaviour. -\section{Client side behaviour} +\subsection{Other transports} -On the client side of a connection, the thread that invokes on a proxy -object drives the GIOP protocol directly and blocks on the connection -to receive the reply. The first time the client makes a call to a -particular address space, the ORB opens a suitable connection to the -remote address space (based on the client transport rule as described -in section~\ref{sec:clientRule}). After the reply has been received, -the ORB caches the open network connection, ready for use by another -call. +The only transport specified in the CORBA standard is \corbauri{iiop}, +but omniORB also supports the following extensions: -If two (or more) threads in a multi-threaded client attempt to contact -the same address space simultaneously, there are two different ways to -proceed. The default way is to open another network connection to the -server. This means that neither the client or server ORB has to -perform any multiplexing on the network connections---multiplexing is -performed by the operating system, which has to deal with multiplexing -anyway. The second possibility is for the client to multiplex the -concurrent requests on a single network connection. This conserves -operating system resources (network connections), but means that both -the client and server have to deal with multiplexing issues -themselves. +\begin{description} -In the default one call per connection mode, there is a limit to the -number of concurrent connections that are opened, set with the -\code{maxGIOPConnection\dsc{}PerServer} parameter. To tell the ORB -that it may multiplex calls on a single connection, set the -\code{oneCallPerConnection} parameter to zero. If the -\code{oneCallPer\dsc{}Connection} parameter is set to the default -value of one, and there are more concurrent calls than specified by -\code{maxGIOPConnectionPerServer}, calls block waiting for connections -to become free. +\item[\corbauri{ssliop}]\mbox{}\\ +Equivalent semantics to \corbauri{iiop}, but the server is contacted +using SSL / TLS. As with \corbauri{iiop}, the address details are of +the form \code{\textit{host}:\textit{port}}. + +\item[\corbauri{omniunix}]\mbox{}\\ +The omniORB Unix domain socket transport. The address details are of +the form \code{\textit{filename}}. -Note that some server-side ORBs, including omniORB versions before -version 4.0, are unable to deal with concurrent calls multiplexed on a -single connection, so they serialise the calls. It is usually best to -keep to the default mode of opening multiple connections. +\end{description} -\subsection{Client side timeouts} -\label{sec:timeoutAPI} -omniORB can associate a timeout with a call, meaning that if the call -takes too long a \code{TRANSIENT} exception is thrown. Timeouts can be -set for the whole process, for a specific thread, or for a specific -object reference. +\subsection{Resolve initial references} -Timeouts are set using this API: +A \corbauri{corbaloc:} can also specify a call to +\op{resolve\_initial\_references}. This \begin{cxxlisting} -namespace omniORB { - void setClientCallTimeout(CORBA::ULong millisecs); - void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs); - void setClientThreadCallTimeout(CORBA::ULong millisecs); - void setClientConnectTimeout(CORBA::ULong millisecs); -}; +orb->string_to_object("corbaloc:rir:/NameService"); \end{cxxlisting} -\op{setClientCallTimeout} sets either the global timeout or the -timeout for a specific object reference. -\op{setClientThreadCallTimeout} sets the timeout for the calling -thread. The calling thread must have an \code{omni\_thread} associated -with it. Setting any timeout value to zero disables it. +\noindent is identical in behaviour to -Accessing per-thread state is a relatively expensive operation, so per -thread timeouts are disabled by default. The -\code{supportPerThreadTimeOut} parameter must be set true to enable -them. +\begin{cxxlisting} +orb->resolve_initial_references("NameService"); +\end{cxxlisting} -To choose the timeout value to use for a call, the ORB first looks to -see if there is a timeout for the object reference, then to the -calling thread, and finally to the global timeout. -When a client has no existing connection to communicate with a server, -it must open a new connection before performing the -call. \op{setClientConnect\dsc{}Timeout} sets an overriding timeout for -cases where a new connection must be established. The effect of the -connect timeout depends upon whether the connect timeout is greater -or less than the timeout that would otherwise be used. -\vspace{\baselineskip}\noindent -As an example, imagine that the usual call timeout is 10 seconds: -\subsubsection*{Connect timeout > usual timeout} -If the connect timeout is set to 20 seconds, then a call that -establishes a new connection will be permitted 20 seconds before it -times out. Subsequent calls using the same connection have the normal -10 second timeout. If establishing the connection takes 8 seconds, -then the call itself takes 5 seconds, the call succeeds despite having -taken 13 seconds in total, longer than the usual timeout. -This kind of configuration is good when connections are slow to be -established. +\subsection{corbaname} +\label{sec:corbaname} -If an object reference has multiple possible endpoints available, and -connecting to the first endpoint times out, only that one endpoint -will have been tried before an exception is raised. However, once the -timeout has occurred, the object reference will switch to use the next -endpoint. If the application attempts to make another call, it will -use the next endpoint. +\corbauri{corbaname} URIs cause \op{string\_to\_object} to look-up a +name in a CORBA Naming service. They are an extension of the +\corbauri{corbaloc} syntax: +\begin{quote} +\corbauri{corbaname:}% +<\textit{corbaloc location}>% +\corbauri{/}% +<\textit{object key}>% +\corbauri{#}% +<\textit{stringified name}> +\end{quote} -\subsubsection*{Connect timeout < usual timeout} +\noindent for example: -If the connect timeout is set to 2 seconds, the actual network-level -connect is only permitted to take 2 seconds. As long as the connection -is established in less than 2 seconds, the call can proceed. The 10 -second call timeout still applies to the time taken for the whole call -(including the connection establishment). So, if establishing the -connection takes 1.5 seconds, and the call itself takes 9.5 seconds, -the call will time out because although it met the connection timeout, -it exceeded the 10 second total call timeout. On the other hand, if -establishing the connection takes 3 seconds, the call will fail after -only 2 seconds, since only 2 seconds are permitted for the connect. +\begin{quote} +\corbauri{corbaname::myhost/NameService#project/example/echo.obj}\\ +\corbauri{corbaname:rir:/NameService#project/example/echo.obj} +\end{quote} -If an object reference has multiple possible endpoints available, the -client will attempt to connect to them in turn, until one succeeds. -The connect timeout applies to each connection attempt. So with a -connect timeout of 2 seconds, the client will spend up to 2 seconds -attempting to connect to the first address and then, if that fails, up -to 2 seconds trying the second address, and so on. The 10 second -timeout still applies to the call as a whole, so if the total time -taken on timed-out connection attempts exceeds 10 seconds, the call -will time out. +\noindent The object found with the \corbauri{corbaloc}-style portion +must be of type \intf{CosNaming::\dsc{}NamingContext}, or something +derived from it. If the object key (or \corbauri{rir} name) is +`\corbauri{NameService}', it can be left out: -This kind of configuration is useful where calls may take a long time -to complete (so call timeouts are long), but a fast indication of -connection failure is required. +\begin{quote} +\corbauri{corbaname::myhost#project/example/echo.obj}\\ +\corbauri{corbaname:rir:#project/example/echo.obj} +\end{quote} +\noindent The stringified name portion can also be left out, in which +case the URI denotes the \intf{CosNaming::NamingContext} which would +have been used for a look-up: -\section{Server side behaviour} +\begin{quote} +\corbauri{corbaname::myhost.example.com}\\ +\corbauri{corbaname:rir:} +\end{quote} -The server side has two primary modes of operation: thread per -connection and thread pooling. It is able to dynamically transition -between the two modes, and it supports a hybrid scheme that behaves -mostly like thread pooling, but has the same fast turn-around for -sequences of calls as thread per connection. +\noindent The first of these examples is the easiest way of specifying +the location of a naming service. -\subsection{Thread per connection mode} -In thread per connection mode (the default, and the only option in -omniORB versions before 4.0), each connection has a single thread -dedicated to it. The thread blocks waiting for a request. When it -receives one, it unmarshals the arguments, makes the up-call to the -application code, marshals the reply, and goes back to watching the -connection. There is thus no thread switching along the call chain, -meaning the call is very efficient. +\section{Configuring resolve\_initial\_references} +\label{sec:insargs} -As explained above, a client can choose to multiplex multiple -concurrent calls on a single connection, so once the server has -received the request, and just before it makes the call into -application code, it marks the connection as `selectable', meaning -that another thread should watch it to see if any other requests -arrive. If they do, extra threads are dispatched to handle the -concurrent calls. GIOP 1.2 actually allows the argument data for -multiple calls to be interleaved on a connection, so the unmarshalling -code has to handle that too. As soon as any multiplexing occurs on the -connection, the aim of removing thread switching cannot be met, and -there is inevitable inefficiency due to thread switching. +The INS specifies two standard command line arguments which provide a +portable way of configuring \op{ORB::resolve\_initial\_references}: -The \code{maxServerThreadPerConnection} parameter can be set to limit -the number of threads that can be allocated to a single connection -containing concurrent calls. Setting the parameter to 1 mimics the -behaviour of omniORB versions before 4.0, that did not support -calls multiplexed on one connection. +\subsection{ORBInitRef} -\subsection{Thread pool mode} -\label{sec:watchConn} +\cmdline{-ORBInitRef} takes an argument of the form +<\textit{ObjectId}>\cmdline{=}<\textit{ObjectURI}>. So, for example, +with command line arguments of: -In thread pool mode, selected by setting the -\code{threadPerConnectionPolicy} parameter to zero, a single thread -watches all incoming connections. When a call arrives on one of them, -a thread is chosen from a pool of threads, and set to work -unmarshalling the arguments and performing the up-call. There is -therefore at least one thread switch for each call. +\begin{quote} +\cmdline{-ORBInitRef NameService=corbaname::myhost.example.com} +\end{quote} -The thread pool is not pre-initialised. Instead, threads are started -on demand, and idle threads are stopped after a period of inactivity. -The maximum number of threads that can be started in the pool is set -with the \code{maxServerThreadPool\dsc{}Size} parameter. The default -is 100. +\noindent \code{resolve\_initial\_references("NameService")} will +return a reference to the object with key `NameService' available on +myhost.example.com, port 2809. Since IOR-format strings are considered +URIs, you can also say things like: -A common pattern in CORBA applications is for a client to make several -calls to a single object in quick succession. To handle this situation -most efficiently, the default behaviour is to not return a thread to -the pool immediately after a call is finished. Instead, it is set to -watch the connection it has just served for a short while, mimicking -the behaviour in thread per connection mode. If a new call comes in -during the watching period, the call is dispatched without any thread -switching, just as in thread per connection mode. Of course, if the -server is supporting a very large number of connections (more than the -size of the thread pool), this policy can delay a call coming from -another connection. If the \code{threadPoolWatch\dsc{}Connection} -parameter is set to zero, connection watching is disabled and threads -return to the pool immediately after finishing a single request. +\begin{quote} +\cmdline{-ORBInitRef NameService=IOR:00ff...} +\end{quote} -In the face of multiplexed calls on a single connection, multiple -threads from the pool can be dispatched for one connection, just as in -thread per connection mode. With \code{threadPoolWatchConnection} set -to the default value of 1, only the last thread servicing a connection -will watch it when it finishes a request. Setting the parameter to a -larger number allows the last \emph{n} connections to watch the -connection. +\subsection{ORBDefaultInitRef} -\subsection{Policy transition} +\cmdline{-ORBDefaultInitRef} provides a prefix string which is used to +resolve otherwise unknown names. When +\op{resolve\_initial\_references} is unable to resolve a name which +has been specifically configured (with \cmdline{-ORBInitRef}), it +constructs a string consisting of the default prefix, a `\corbauri{/}' +character, and the name requested. The string is then fed to +\op{string\_to\_object}. So, for example, with a command line of: -If the server is dealing with a relatively small number of -connections, it is most efficient to use thread per connection mode. -If the number of connections becomes too large, however, operating -system limits on the number of threads may cause a significant -slowdown, or even prevent the acceptance of new connections -altogether. +\begin{quote} +\cmdline{-ORBDefaultInitRef corbaloc::myhost.example.com} +\end{quote} -To give the most efficient response in all circumstances, omniORB -allows a server to start in thread per connection mode, and transition -to thread pooling if many connections arrive. This is controlled with -the \code{threadPerConnection\dsc{}UpperLimit} and -\code{threadPerConnectionLowerLimit} parameters. The former must -always be larger than the latter. The upper limit chooses the number -of connections at which time the ORB transitions to thread pool mode; -the lower limit selects the point at which the transition back to -thread per connection is made. +\noindent a call to \code{resolve\_initial\_references("MyService")} +will return the object reference denoted by +`\corbauri{corbaloc::myhost.example.com/MyService}'. + +Similarly, a \corbauri{corbaname} prefix can be used to cause +look-ups in the naming service. Note, however, that since a +`\corbauri{/}' character is always added to the prefix, it is +impossible to specify a look-up in the root context of the naming +service---you have to use a sub-context, like: + +\begin{quote} +\cmdline{-ORBDefaultInitRef corbaname::myhost.example.com\#services} +\end{quote} -For example, setting the upper limit to 50 and the lower limit to 30 -would mean that the first 49 connections would receive dedicated -threads. The 50th to arrive would trigger thread pooling. All future -connections to arrive would make use of threads from the pool. Note -that the existing dedicated threads continue to service their -connections until the connections are closed. If the number of -connections falls below 30, thread per connection is reactivated and -new connections receive their own dedicated threads (up to the limit -of 50 again). Once again, existing connections in thread pool mode -stay in that mode until they are closed. -\section{Idle connection shutdown} -\label{sec:connShutdown} +\section{omniNames} -It is wasteful to leave a connection open when it has been left unused -for a considerable time. Too many idle connections could block out new -connections when it runs out of spare communication channels. For -example, most platforms have a limit on the number of file handles a -process can open. Many platforms have a very small default limit like -64. The value can often be increased to a maximum of a thousand or -more by changing the `ulimit' in the shell. +\subsection{NamingContextExt} -Every so often, a thread scans all open connections to see which are -idle. The scanning period (in seconds) is set with the -\code{scanGranularity} parameter. The default is 5 seconds. +omniNames supports the extended \intf{CosNaming::NamingContextExt} +interface: -Outgoing connections (initiated by clients) and incoming connections -(initiated by servers) have separate idle timeouts. The timeouts are -set with the \code{outConScan\dsc{}Period} and \code{inConScanPeriod} -parameters respectively. The values are in seconds, and must be a -multiple of the scan granularity. +\begin{idllisting} +module CosNaming { + interface NamingContextExt : NamingContext { + typedef string StringName; + typedef string Address; + typedef string URLString; -Beware that setting \code{outConScanPeriod} or \code{inConScanPeriod} -to be equal to (or less than) \code{scanGranularity} means that -connections are considered candidates for closure immediately after -they are opened. That can mean that the connections are closed before -any calls have been sent through them. If oneway calls are used, such -connection closure can result in silent loss of calls. + StringName to_string(in Name n) raises(InvalidName); + Name to_name (in StringName sn) raises(InvalidName); + exception InvalidAddress {}; -\subsection{Interoperability Considerations} + URLString to_url(in Address addr, in StringName sn) + raises(InvalidAddress, InvalidName); -The IIOP specification allows both the client and the server to -shutdown a connection unilaterally. When one end is about to shutdown -a connection, it should send a CloseConnection message to the other -end. It should also make sure that the message will reach the other -end before it proceeds to shutdown the connection. + Object resolve_str(in StringName n) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + }; +}; +\end{idllisting} -The client should distinguish between an orderly and an abnormal -connection shutdown. When a client receives a CloseConnection message -before the connection is closed, the condition is an orderly shutdown. -If the message is not received, the condition is an abnormal shutdown. -In an abnormal shutdown, the ORB should raise a \code{COMM\_FAILURE} -exception whereas in an orderly shutdown, the ORB should \emph{not} -raise an exception and should try to re-establish a new connection -transparently. +\op{to\_string} and \op{to\_name} convert from \type{CosNaming::Name} +sequences to flattened strings and vice-versa. Note that calling +these operations involves remote calls to the naming service, so they +are not particularly efficient. You can use the omniORB specific local +\op{omniURI::nameToString} and \op{omniURI::\dsc{}stringToName} +functions instead. -omniORB implements these semantics completely. However, it is known -that some ORBs are not (yet) able to distinguish between an orderly -and an abnormal shutdown. Usually this is manifested as the client in -these ORBs seeing a \code{COMM\_FAILURE} occasionally when connected -to an omniORB server. The work-around is either to catch the exception -in the application code and retry, or to turn off the idle connection -shutdown inside the omniORB server. +A \type{CosNaming::Name} is stringified by separating name components +with `\texttt{/}' characters. The \code{kind} and \code{id} fields of +each component are separated by `\texttt{.}' characters. If the +\code{kind} field is empty, the representation has no trailing +`\texttt{.}'; if the \code{id} is empty, the representation starts +with a `\texttt{.}' character; if both \texttt{id} and \texttt{kind} +are empty, the representation is just a `\texttt{.}'. The backslash +`\texttt{\textbackslash}' is used to escape the meaning of +`\texttt{/}', `\texttt{.}' and `\texttt{\textbackslash}' itself. +\op{to\_url} takes a \corbauri{corbaloc} style address and key string +(but without the \corbauri{corbaloc:} part), and a stringified name, +and returns a \corbauri{corbaname} URI (incorrectly called a URL) +string, having properly escaped any invalid characters. The +specification does not make it clear whether or not the address string +should also be escaped by the operation; omniORB does not escape +it. For this reason, it is best to avoid calling \op{to\_url} if the +address part contains escapable characters. To avoid remote calls, +omniORB provides the equivalent local function +\op{omniURI::\dsc{}addrAndNameToURI}. +\op{resolve\_str} is equivalent to calling \op{to\_name} followed by +the inherited \op{resolve} operation. There are no string-based +equivalents of the various bind operations. -\section{Transports and endpoints} -omniORB can support multiple network transports. All platforms -(usually) have a TCP transport available. Unix platforms support a -Unix domain socket transport. Platforms with the OpenSSL library -available can support an SSL transport. +\subsection{Use with corbaname} -Servers must be configured in two ways with regard to transports: the -transports and interfaces on which they listen, and the details that -are published in IORs for clients to see. Usually the published -details will be the same as the listening details, but there are times -when it is useful to publish different information. +To make it easy to use omniNames with \corbauri{corbaname} URIs, it +starts with the default port of 2809, and an object key of +`\texttt{NameService}' for the root naming context. -Details are selected with the \code{endPoint} family of parameters. -The simplest is plain \code{endPoint}, which chooses a transport and -interface details, and publishes the information in IORs. Endpoint -parameters are in the form of URIs, with a scheme name of -`\code{giop:}', followed by the transport name. Different transports -have different parameters following the transport. -TCP endpoints have the format: +\section{omniMapper} +\hyphenation{omni-Mapper} + +omniMapper is a simple daemon which listens on port 2809 (or any other +port), and redirects IIOP requests for configured object keys to +associated persistent object references. It can be used to make a +naming service (even an old non-INS aware version of omniNames or +other ORB's naming service) appear on port 2809 with the object key +`\texttt{NameService}'. The same goes for any other service you may +wish to specify, such as an interface repository. omniMapper is +started with a command line of: \begin{quote} -\code{giop:tcp:}\textit{}\code{:}\textit{} +\cmdline{omniMapper [-port }<\textit{port}>% +\cmdline{] [-config }<\textit{config file}>% +\cmdline{] [-v]} \end{quote} -\noindent The host must be a valid host name or IP address for the -server machine. It determines the network interface on which the -server listens. The port selects the TCP port to listen on, which must -be unoccupied. Either the host or port, or both can be left empty. If -the host is empty, the ORB publishes the IP address of the first -non-loopback network interface it can find (or the loopback if that is -the only interface), but listens on \emph{all} network interfaces. If -the port is empty, the operating system chooses a port. +\noindent The \cmdline{-port} option allows you to choose a port other +than 2809 to listen on. The \cmdline{-config} option specifies a +location for the configuration file. The default name is +\file{/etc/omniMapper.cfg}, or \file{C:\omniMapper.cfg} on +Windows. omniMapper does not normally print anything; the \cmdline{-v} +option makes it verbose so it prints configuration information and a +record of the redirections it makes, to standard output. -Multiple TCP endpoints can be selected, either to specify multiple -network interfaces on which to listen, or (less usefully) to select -multiple TCP ports on which to listen. +The configuration file is very simple. Each line contains a string to +be used as an object key, some white space, and an IOR (or any valid +URI) that it will redirect that object key to. Comments should be +prefixed with a `\texttt{\#}' character. For example: -If no \code{endPoint} parameters are set, the ORB assumes a single -parameter of \code{giop:tcp::}, meaning IORs contain the address of -the first non-loopback network interface, the ORB listens on all -interfaces, and the OS chooses a port number. +\begin{quote} +\begin{verbatim} +# Example omniMapper.cfg +NameService IOR:000f... +InterfaceRepository IOR:0100... +\end{verbatim} +\end{quote} -SSL endpoints have the same format as TCP ones, except `\code{tcp}' -is replaced with `\code{ssl}'. Unix domain socket endpoints have the -format: +omniMapper can either be run on a single machine, in much the same way +as omniNames, or it can be run on \emph{every} machine, with a common +configuration file. That way, each machine's omniORB configuration +file could contain the line: \begin{quote} -\code{giop:unix:}\textit{} +\begin{verbatim} +ORBDefaultInitRef corbaloc::localhost +\end{verbatim} \end{quote} -\noindent where the filename is the name of the socket within the -filesystem. If the filename is left blank, the ORB chooses a name -based on the process id and a timestamp. -To listen on an endpoint without publishing it in IORs, specify it -with the \code{endPointNoPublish} configuration parameter. See below -for more details about endpoint publishing. +\section{Creating objects with simple object keys} -\subsection{IPv6} +In normal use, omniORB creates object keys containing various +information including POA names and various non-ASCII characters. +Since object keys are supposed to be opaque, this is not usually a +problem. The INS breaks this opacity and requires servers to create +objects with human-friendly keys. -On platforms where it is available, omniORB supports IPv6. On most -Unix platforms, IPv6 sockets accept both IPv6 and IPv4 connections, so -omniORB's default \code{giop:tcp::} endpoint accepts both IPv4 and -IPv6 connections. On Windows versions before Windows Vista, each -socket type only accepts incoming connections of the same type, so an -IPv6 socket cannot be used with IPv4 clients. For this reason, the -default \code{giop:tcp::} endpoint only listens for IPv4 connections. -Since endpoints with a specific host name or address only listen on a -single network interface, they are inherently limited to just one -protocol family. +If you wish to make your objects available with human-friendly URIs, +there are two options. The first is to use omniMapper as described +above, in conjunction with a \code{PERSISTENT} POA. The second is to +create objects with the required keys yourself. You do this with a +special POA with the name `\texttt{omniINSPOA}', acquired from +\op{resolve\_initial\_references}. This POA has the \code{USER\_ID} +and \code{PERSISTENT} policies, and the special property that the +object keys it creates contain only the object ids given to the POA, +and no other data. It is a normal POA in all other respects, so you +can activate/deactivate it, create children, and so on, in the usual +way. -To explicitly ask for just IPv4 or just IPv6, an endpoint with the -wildcard address for the protocol family should be used. For IPv4, the -wildcard address is `\code{0.0.0.0}', and for IPv6 it is `\code{::}'. -So, to listen for IPv4 connections on all IPv4 network interfaces, use -an endpoint of: +Children of the omniINSPOA do not inherit its special properties of +creating simple object keys. If the omniINSPOA's policies are not +suitable for your application, you cannot create a POA with different +policies (such as single threading, for example), and still generate +simple object keys. Instead, you can activate a servant in the +omniINSPOA that uses location forwarding to redirect requests to +objects in a different POA. -\begin{quote} -\code{giop:tcp:0.0.0.0:} -\end{quote} -\noindent All IPv6 addresses contain colons, so the address portion in -URIs must be contained within \code{[]} characters. Therefore, to -listen just for IPv6 connections on all IPv6 interfaces, use the -somewhat cryptic: -\begin{quote} -\code{giop:tcp:[::]:} -\end{quote} -\noindent To listen for both IPv4 and IPv6 connections on Windows -versions prior to Vista, both endpoints must be explicitly provided. -\subsubsection{Link local addresses} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{Code set conversion} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{chap:codesets} -In IPv6, all network interfaces are assigned a \term{link local} -address, starting with the digits \code{fe80}. The link local address -is only valid on the same `link' as the interface, meaning directly -connected to the interface, or possibly on the same subnet, depending -on how the network is switched. To connect to a server's link local -address, a client has to know which of its network interfaces is on -the same link as the server. Since there is no way for omniORB to know -which local interface a remote link local address may be connected to, -and in extreme circumstances may even end up contacting the wrong -server if it picks the wrong interface, link local addresses are not -considered valid. Servers do not publish link local addresses in their -IORs. +omniORB supports full code set negotiation, used to select and +translate between different character code sets when transmitting +chars, strings, wchars and wstrings. The support is mostly transparent +to application code, but there are a number of options that can be +selected. This chapter covers the options, and also gives some +pointers about how to implement your own code sets, in case the ones +that come with omniORB are not sufficient. -\subsection{Endpoint publishing} +\section{Native code sets} + +For the ORB to know how to handle strings and wstrings given to it by +the application, it must know what code set they are represented +with, so it can properly translate them if need be. The defaults are +ISO 8859-1 (Latin 1) for char and string, and UTF-16 for wchar and +wstring. Different code sets can be chosen at initialisation time with +the \code{nativeCharCodeSet} and \code{nativeWCharCodeSet} +parameters. The supported code sets are printed out at initialisation +time if the ORB traceLevel is 15 or greater. + +For most applications, the defaults are fine. Some applications may +need to set the native char code set to UTF-8, allowing the full +Unicode range to be supported in strings. + +Note that the default for wchar is always UTF-16, even on Unix +platforms where wchar is a 32-bit type. Select the UCS-4 code set to +select characters outside the first plane without having to use UTF-16 +surrogates\footnote{If you have no idea what this means, don't +worry---you're better off not knowing unless you \emph{really} have +to.}. -For clients to be able to connect to a server, the server publishes -endpoint information in its IORs (Interoperable Object References). -Normally, omniORB publishes the first available address for each of -the endpoints it is listening on. -The endpoint information to publish is determined by the -\code{endPointPublish} configuration parameter. It contains a -comma-separated list of publish rules. The rules are applied in turn -to each of the configured endpoints; if a rule matches an endpoint, it -causes one or more endpoints to be published. +\section{Default code sets} -The following core rules are supported: +The way code set conversion is meant to work in CORBA communication is +that each client and server has a \term{native} code set that it uses +for character data in application code, and supports a number of +\term{transmission} code sets that is uses for communication. When a +client connects to a server, the client picks one of the server's +transmission code sets to use for the interaction. For that to work, +the client plainly has to know the server's supported transmission +code sets. + +Code set information from servers is embedded in IORs. A client with +an IOR from a server should therefore know what transmission code sets +the server supports. This approach can fail for two reasons: -\vspace{\baselineskip} +\begin{enumerate} + \item A \corbauri{corbaloc} URI (see chapter~\ref{chap:ins}) does + not contain any code set information. -\begin{tabular}{p{.25\textwidth}p{.75\textwidth}} -\code{addr} & the first natural address of the endpoint\\ -\code{ipv4} & the first IPv4 address of a TCP or SSL endpoint\\ -\code{ipv6} & the first IPv6 address of a TCP or SSL endpoint\\ -\code{name} & the first address that can be resolved to a name\\ -\code{hostname} & the result of the gethostname() system call\\ -\code{fqdn} & the fully-qualified domain name\\ -\end{tabular} + \item Some badly-behaved servers that do support code set conversion + fail to put codeset information in their IORs. +\end{enumerate} -\vspace{\baselineskip} +The CORBA standard says that if a server has not specified +transmission code set information, clients must assume that they only +support ISO-8859-1 for char and string, and do not support wchar and +wstring at all. The effect is that client code receives +\code{DATA\_CONVERSION} or \code{BAD\_PARAM} exceptions. + +To avoid this issue, omniORB allows you to configure \term{default} +code sets that are used as a server's transmission code sets if they +are not otherwise known. Set \code{defaultCharCodeSet} for char and +string data, and \code{defaultWCharCodeSet} for wchar and wstring data. -\noindent -The core rules can be combined using the vertical bar operator to -try several rules in turn until one succeeds. e.g: -\vspace{\baselineskip} +\section{Code set library} -\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} -\code{name|ipv6|ipv4} & the name of the endpoint if it has one; - failing that, its first IPv6 address; - failing that, its first IPv4 address. -\end{tabular} +To save space in the main ORB core library, most of the code set +implementations are in a separate library named omniCodeSets4. To use +the extra code sets, you must link your application with that +library. On most platforms, if you are using dynamic linking, +specifying the omniCodeSets4 library in the link command is sufficient +to have it initialised, and for the code sets to be available. With +static linking, or platforms with less intelligent dynamic linkers, +you must force the linker to initialise the library. You do that by +including the \file{omniORB4/optionalFeatures.h} header. By default, +that header enables several optional features. Look at the file +contents to see how to turn off particular features. -\vspace{\baselineskip} -\noindent -Multiple rules can be combined using the comma operator to -publish more than one endpoint. e.g. +\section{Implementing new code sets} -\vspace{\baselineskip} +It is quite easy to implement new code sets, if you need support for +code sets (or marshalling formats) that do not come with the omniORB +distribution. There are extensive comments in the headers and ORB code +that explain how to implement a code set; this section just serves to +point you in the right direction. -\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} -\code{name,addr} & the name of the endpoint (if it has one), - followed by its first address. -\end{tabular} +The main definitions for the code set support are in +\file{include/omniORB4/codeSets.h}. That defines a set of base classes +use to implement code sets, plus some derived classes that use look-up +tables to convert simple 8-bit and 16-bit code sets to Unicode. -\vspace{\baselineskip} +When sending or receiving string data, there are a total of four code +sets in action: a native char code set, a transmission char code set, +a native wchar code set, and a transmission wchar code set. The native +code sets are as described above; the transmission code sets are the +ones selected to communicate with a remote machine. They are +responsible for understanding the GIOP marshalling formats, as well as +the code sets themselves. Each of the four code sets has an object +associated with it which contains methods for converting data. -\noindent -For endpoints with multiple addresses (e.g. TCP endpoints on -multi-homed machines), the \code{all()} manipulator causes all -addresses to be published. e.g.: +There are two ways in which a string/wstring can be transmitted or +received. If the transmission code set in action knows how to deal +directly with the native code set (the trivial case being that they +are the same code set, but more complex cases are possible too), the +transmission code set object can directly marshal or unmarshal the +data into or out of the application buffer. If the transmission code +set does not know how to handle the native code set, it converts the +string/wstring into UTF-16, and passes that to the native code set +object (or vice-versa). All code set implementations must therefore +know how to convert to and from UTF-16. -\vspace{\baselineskip} +With this explanation, the classes in \file{codeSets.h} should be easy +to understand. The next place to look is in the various existing code +set implementations, which are files of the form \file{cs-*.cc} in the +\file{src/lib/omniORB/orbcore} and \file{src/lib/omniORB/codesets}. +Note how all the 8-bit code sets (the ISO 8859-* family) consist +entirely of data and no code, since they are driven by look-up tables. -\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} -\code{all(addr)} & all addresses are published\\ -\code{all(name)} & all addresses that resolve to names are published\\ -\code{all(name|addr)} & all addresses are published by name if they have - one, address otherwise.\\ -\code{all(name,addr)} & all addresses are published by name (if they - have one), and by address.\\ -\code{all(name), all(addr)} & first the names of all addresses are published, - followed by all the addresses.\\ -\end{tabular} -\vspace{\baselineskip} -\noindent -A specific endpoint can be published by giving its endpoint URI, -even if the server is not listening on that endpoint. e.g.: +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{Interceptors} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{chap:interceptors} -\vspace{\baselineskip} +omniORB supports interceptors that allow the application to insert +processing in various points along the call chain, and in various +other locations. It does not (yet) support the standard Portable +Interceptors API. -\begin{tabular}{p{.25\textwidth}p{.65\textwidth}} -\code{giop:tcp:not.my.host:12345}\\ -\code{giop:unix:/not/my/socket-file}\\ -\end{tabular} +The interceptor interfaces are defined in a single header, +\file{include/omniORB4/omniInterceptors.h}. Each interception point +consists of a singleton object with \op{add} and \op{remove} methods, +and the definition of an `interceptor info' class. For example: -\vspace{\baselineskip} +\begin{cxxlisting} +class omniInterceptors { + ... + class clientSendRequest_T { + public: -\noindent -If the host or port number for a TCP or SSL URI are missed out, -they are filled in with the details from each listening TCP/SSL -endpoint. This can be used to publish a different name for a -TCP/SSL endpoint that is using an ephemeral port, for example. + class info_T { + public: + GIOP_C& giop_c; + IOP::ServiceContextList service_contexts; -omniORB 4.0 supported two options related to endpoint publishing that -are superseded by the \code{endPointPublish} parameter, and so are now -deprecated. Setting \code{endPointPublishAllIFs} to 1 is equivalent to -setting \code{endPointPublish} to `\code{all(addr)}'. The -\code{endPointNoListen} parameter is equivalent to adding endpoint -URIs to the \code{endPointPublish} parameter. + info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} + private: + info_T(); + info_T(const info_T&); + info_T& operator=(const info_T&); + }; + typedef CORBA::Boolean (*interceptFunc)(info_T& info); -\section{Connection selection and acceptance} + void add(interceptFunc); + void remove(interceptFunc); + }; + ... +}; +\end{cxxlisting} -In the face of IORs containing details about multiple different -endpoints, clients have to know how to choose the one to use to -connect a server. Similarly, servers may wish to restrict which -clients can connect to particular transports. This is achieved with -\term{transport rules}. +\noindent You can see that the interceptors themselves are functions +that take the \code{info\_T} object as their argument and return +boolean. Interceptors are called in the order they are registered; +normally, all interceptor functions return \code{true}, meaning that +processing should continue with subsequent interceptors. If an +interceptor returns \code{false}, later interceptors are not +called. You should only do that if you really know what you are doing. +Notice that the \code{info\_T} contains references to omniORB internal +data types. The definitions of these types can be found in other +header files within \file{include/omniORB4} and +\file{include/omniORB4/internal}. -\subsection{Client transport rules} -\label{sec:clientRule} -The \code{clientTransportRule} parameter is used to filter and -prioritise the order in which transports specified in an IOR are -tried. Each rule has the form: +\section{Interceptor registration} -\begin{quote} -\textit{
[action]+} -\end{quote} +All the interceptor singletons are registered within another singleton +object of class \code{omniInterceptors}. You retrieve a pointer to the +object with the \op{omniORB::\dsc{}getInterceptors} function, which +must be called after the ORB has been initialised with +\op{CORBA::ORB\_init}, but before the ORB is used. The code to +register an interceptor looks, for example, like: -\noindent The address mask can be one of +\begin{cxxlisting} +omniInterceptors* interceptors = omniORB::getInterceptors(); +interceptors->clientSendRequest.add(myInterceptorFunc); +\end{cxxlisting} -\vspace{\baselineskip} -\begin{tabular}{llp{.5\textwidth}} -1. & \code{localhost} & The address of this machine\\ +\section{Available interceptors} -2. & \textit{w.x.y.z}\code{/}\textit{m1.m2.m3.m4} & An IPv4 address - with bits selected by the mask, e.g.\ - \code{172.16.0.0/255.240.0.0}\\ +The following interceptors are available: -3. & \textit{w.x.y.z}\code{/}\textit{prefixlen} & An IPv4 address with - \textit{prefixlen} significant bits, e.g.\ - \code{172.16.2.0/24}\\ +\begin{description} -4. & \textit{a:b:c:d:e:f:g:h}\code{/}\textit{prefixlen} & An IPv6 - address with \textit{prefixlen} significant bits, e.g.\ - \code{3ffe:505:2:1::/64}\\ +\item[encodeIOR]\mbox{}\\ +% +Called when encoding an IOR to represent an object reference. This +interception point allows the application to insert extra profile +components into IORs. Note that you must understand and adhere to the +rules about data stored in IORs, otherwise the IORs created may be +invalid. omniORB itself uses this interceptor to insert various items, +so you can see an example of its use in the +\op{insertSupportedComponents} function defined in +\file{src/lib/omniORB/orbcore/ior.cc}. -5. & \code{*} & Wildcard that matches any address\\ -\end{tabular} -\vspace{\baselineskip} +\item[decodeIOR]\mbox{}\\ +% +Called when decoding an IOR. The application can use this to get out +whatever information they put into IORs with encodeIOR. Again, see +\op{extract\dsc{}SupportedComponents} in +\file{src/lib/omniORB/orbcore/ior.cc} for an example. -\noindent The action is one or more of the following: -\vspace{\baselineskip} +\item[clientOpenConnection]\mbox{}\\ +% +Called as a client opens a new connection to a server, after the +connection is opened but before it is used to send a request. The +interceptor function can set the \code{info\_T}'s \code{reject} member +to \code{true} to cause the client to immediately close the new +connection and throw CORBA::TRANSIENT to the calling code. In that +case, the interceptor function can also set the \code{why} member to +provide a message that is logged. -\begin{tabular}{llp{.5\textwidth}} -1. & \code{none} & Do not use this address\\ -2. & \code{tcp} & Use a TCP transport\\ -3. & \code{ssl} & Use an SSL transport\\ -4. & \code{unix} & Use a Unix socket transport\\ -5. & \code{bidir}& Connections to this address can be used - bidirectionally (see section~\ref{sec:bidir})\\ -\end{tabular} -\vspace{\baselineskip} +\item[clientSendRequest]\mbox{}\\ +% +Called just before a request header is sent over the network. The +application can use it to insert service contexts in the header. See +the \op{setCodeSet\dsc{}ServiceContext} function in +\file{src/lib/omniORB/orbcore/cdrStream.cc} for an example of its use. -\noindent The transport-selecting actions form a prioritised list, so -an action of `\code{unix,ssl,\dsc{}tcp}' means to use a Unix transport if -there is one, failing that a SSL transport, failing \emph{that} a TCP -transport. In the absence of any explicit rules, the client uses the -implicit rule of `\code{* unix,ssl,tcp}'. -If more than one rule is specified, they are prioritised in the order -they are specified. For example, the configuration file might contain: +\item[clientReceiveReply]\mbox{}\\ +% +Called as the client receives a reply, just after unmarshalling the +reply header. Called for normal replies and exceptions. -\begin{verbatim} - clientTransportRule = 192.168.1.0/255.255.255.0 unix,tcp - clientTransportRule = 172.16.0.0/255.240.0.0 unix,tcp - = * none -\end{verbatim} -\noindent This would be useful if there is a fast network -(192.168.1.0) which should be used in preference to another network -(172.16.0.0), and connections to other networks are not permitted at -all. +\item[serverAcceptConnection]\mbox{}\\ +% +Called when a server accepts a new incoming connection, but before it +reads any data from it. The interceptor function can set the +\code{info\_T}'s \code{reject} member to \code{true} to cause the +server to immediately close the new connection. In that case, the +interceptor function can also set the \code{why} member to provide a +message that is logged. -In general, the result of filtering the endpoint specifications in an -IOR with the client transport rule will be a prioritised list of -transports and networks. (If the transport rules do not prioritise one -endpoint over another, the order the endpoints are listed in the IOR -is used.) When trying to contact an object, the ORB tries its -possible endpoints in turn, until it finds one with which it can -contact the object. Only after it has unsuccessfully tried all -permissible endpoints will it raise a \code{TRANSIENT} exception to -indicate that the connect failed. +\item[serverReceiveRequest]\mbox{}\\ +% +Called when the server receives a request, just after unmarshalling +the request header. See the \op{getCodeSetServiceContext} function in +\file{src/lib/omniORB/orbcore/cdrStream.cc} for an example. -\subsection{Server transport rules} -\label{sec:serverRule} +\item[serverSendReply]\mbox{}\\ +% +Called just before the server marshals a reply header. -The server transport rules have the same format as client transport -rules. Rather than being used to select which of a set of ways to -contact a machine, they are used to determine whether or not to accept -connections from particular clients. In this example, we only allow -connections from our intranet: -\begin{verbatim} - serverTransportRule = localhost unix,tcp,ssl - = 172.16.0.0/255.240.0.0 tcp,ssl - = * none -\end{verbatim} +\item[serverSendException]\mbox{}\\ +% +Called just before the server marshals an exception reply header. -\noindent And in this one, we accept only SSL connections if the -client is not on the intranet: -\begin{verbatim} - serverTransportRule = localhost unix,tcp,ssl - = 172.16.0.0/255.240.0.0 tcp,ssl - = * ssl,bidir -\end{verbatim} +\item[createRope]\mbox{}\\ +% +Called when the ORB is about to create a `rope' that encapsulates a +bundle of connections (`strands') to a remote address space. It allows +application code to override omniORB's normal connection management. -\noindent In the absence of any explicit rules, the server uses the -implicit rule of `\code{* unix,\dsc{}ssl,tcp}', meaning any kind of -connection is accepted from any client. +\item[createIdentity]\mbox{}\\ +% +Called when the ORB is about to create an `identity' object to +represent a CORBA object. It allows application code to provide its +own identity implementations. It is very unlikely that an application +will need to do this. -\section{Bidirectional GIOP} -\label{sec:bidir} -omniORB supports bidirectional GIOP, which allows callbacks to be made -using a connection opened by the original client, rather than the -normal model where the server opens a new connection for the callback. -This is important for negotiating firewalls, since they tend not to -allow connections back on arbitrary ports. +\item[createORBServer]\mbox{}\\ +% +Used internally by the ORB to register different kinds of server. At +present, only a GIOP server is registered. It is very unlikely that +application code will need to do this. -There are several steps required for bidirectional GIOP to be enabled -for a callback. Both the client and server must be configured -correctly. On the client side, these conditions must be met: -\begin{itemize} +\item[createThread]\mbox{}\\ +% +Called whenever the ORB creates a thread. The \type{info\_T} class for +this interceptor is -\item The \code{offerBiDirectionalGIOP} parameter must be set to true. -\item The client transport rule for the target server must contain the - \code{bidir} action. -\item The POA containing the callback object (or objects) must have - been created with a \code{BidirectionalPolicy} value of - \code{BOTH}. +\begin{cxxlisting} + class info_T { + public: + virtual void run() = 0; + virtual omni_thread* self() = 0; + }; +\end{cxxlisting} -\end{itemize} +\noindent +The interceptor is called in the context of the newly created thread. +The function \emph{must} call the \type{info\_T}'s \op{run} method, to +pass control to the thread body. \op{run} returns just before the +thread exits. This arrangement allows the interceptor to initialise +some per-thread state before the thread body runs, then release it +just before the thread exits. + +The \type{info\_T}'s \op{self} method returns a pointer to the +\type{omni\_thread} object for the thread, equivalent to calling +\op{omni\_thread::self}. -\noindent On the server side, these conditions must be met: -\begin{itemize} +\item[assignUpcallThread]\mbox{}\\ +% +The ORB maintains a general thread pool, from which threads are drawn +for various purposes. One purpose is for performing upcalls to +application code, in response to incoming CORBA calls. The +\code{assignUpcallThread} interceptor is called when a thread is +assigned to perform upcalls. In the thread per connection model, the +thread stays assigned to performing upcalls for the entire lifetime of +the underlying network connection; in the thread pool model, threads +are assigned for upcalls on a per call basis, so this interceptor is +triggered for every incoming call\footnote{Except that with the + \code{threadPoolWatchConnection} parameter set \code{true}, a thread + can perform multiple upcalls even when thread pool mode is + active.}. As with the \code{createThread} interceptor, the +interceptor function must call the \type{info\_T}'s \op{run} method to +pass control to the upcall. -\item The \code{acceptBiDirectionalGIOP} parameter must be set to true. -\item The server transport rule for the requesting client must contain - the \code{bidir} action. -\item The POA hosting the object contacted by the client must have - been created with a \code{BidirectionalPolicy} value of - \code{BOTH}. +When a thread finishes its assignment of processing upcalls, it +returns to the pool (even in thread per connection mode), so the same +thread can be reassigned to perform more upcalls, or reused for a +different purpose. -\end{itemize} +\item[assignAMIThread]\mbox{}\\ +% +Asynchronous Method Invocation (AMI) uses threads to perform outgoing +calls. The \code{assignAMIThread} interceptor is called when a thread +is assigned to perform AMI calls. As with the other thread +interceptors, the interceptor function must call the \type{info\_T}'s +\op{run} method to pass control to the AMI call. -\section{SSL transport} +Unlike the other interceptors, the interceptor functions for +\code{createThread}, \code{assignUpcallThread} and +\code{assignAMIThread} have no return values. Interceptor chaining is +performed by calls through the \op{info\_T::run} method, rather than +by visiting interceptor functions in turn. -omniORB supports an SSL transport, using OpenSSL. It is only built if -OpenSSL is available. On platforms using Autoconf, it is autodetected -in many locations, or its location can be given with the -\code{-{}-with-openssl=} argument to \code{configure}. On other -platforms, the \code{OPEN\_SSL\_ROOT} make variable must be set in the -platform file. +\end{description} -To use the SSL transport, you must link your application with the -\file{omnisslTP} library, and correctly set up certificates. See the -\file{src/examples/ssl_echo} directory for an example. That directory -contains a \file{README} file with more details. +\section{Server-side call interceptor} +Calls can be intercepted on the server just before the upcall into +application code. This interceptor is registered with omniORB's +\type{callDescriptor} class, which is responsible for encapsulating +the state of a call. Unlike the transport-related +\code{serverReceiveRequest}, \code{serverSendReply} and +\code{serverSendException} interceptors, the \type{callDescriptor} +interceptor is invoked for \emph{all} calls, even ones from colocated +clients in the same address space. + +The types used for the call interceptor are defined in +\file{include/omniORB4/callDescriptor.h}. The interceptor takes the +form of a bare function with two parameters. The first parameter is a +pointer to the \type{callDescriptor}; the second is a pointer to +\type{omniServant}, which is the base class of all servant +classes. The interceptor function must call the +\type{callDescriptor}'s \op{interceptedCall} method to pass on the +call. +This interception point allows access to various parts of omniORB's +call machinery. The \type{callDescriptor} includes access to the +operation name and, if cast to the concrete subclass defined by the +IDL compiler, the call arguments and return values too. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{Code set conversion} +\chapter{Type Any and TypeCode} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{chap:codesets} +\label{chap:any} -omniORB supports full code set negotiation, used to select and -translate between different character code sets, for the transmission -of chars, strings, wchars and wstrings. The support is mostly -transparent to application code, but there are a number of options -that can be selected. This chapter covers the options, and also gives -some pointers about how to implement your own code sets, in case the -ones that come with omniORB are not sufficient. +The CORBA specification provides for a type that can hold the value of +any OMG IDL type. This type is known as type \type{Any}. The OMG also +specifies a pseudo-object, \type{TypeCode}, that can encode a +description of any type specifiable in OMG IDL. +In this chapter, an example demonstrating the use of type Any is +presented. The example code is in the \file{src/examples/anyExample} +directory in the omniORB distribution. The example is followed by +sections describing the behaviour of type Any and TypeCode in omniORB. +For further information on type Any, refer to the C++ Mapping +specification., and for more information on TypeCode, refer to the +Interface Repository chapter in the CORBA core section of the CORBA +specification. -\section{Native code sets} -For the ORB to know how to handle strings and wstrings given to it by -the application, it must know what code set they are represented -with, so it can properly translate them if need be. The defaults are -ISO 8859-1 (Latin 1) for char and string, and UTF-16 for wchar and -wstring. Different code sets can be chosen at initialisation time with -the \code{nativeCharCodeSet} and \code{nativeWCharCodeSet} -parameters. The supported code sets are printed out at initialisation -time if the ORB traceLevel is 15 or greater. -For most applications, the defaults are fine. Some applications may -need to set the native char code set to UTF-8, allowing the full -Unicode range to be supported in strings. +\section{Example using type Any} -Note that the default for wchar is always UTF-16, even on Unix -platforms where wchar is a 32-bit type. Select the UCS-4 code set to -select characters outside the first plane without having to use UTF-16 -surrogates\footnote{If you have no idea what this means, don't -worry---you're better off not knowing unless you \emph{really} have -to.}. +Before going through this example, you should make sure that you have +read and understood the examples in chapter~\ref{chap:basic}. +\subsection{Type Any in IDL} +Type Any allows one to delay the decision on the type used in an +operation until run-time. To use type any in IDL, use the keyword +\code{any}, as in the following example: -\section{Code set library} +\begin{idllisting} +// IDL +interface anyExample { + any testOp(in any mesg); +}; +\end{idllisting} -To save space in the main ORB core library, most of the code set -implementations are in a separate library named omniCodeSets4. To use -the extra code sets, you must link your application with that -library. On most platforms, if you are using dynamic linking, -specifying the omniCodeSets4 library in the link command is sufficient -to have it initialised, and for the code sets to be available. With -static linking, or platforms with less intelligent dynamic linkers, -you must force the linker to initialise the library. You do that by -including the \file{omniORB4/optionalFeatures.h} header. By default, -that header enables several optional features. Look at the file -contents to see how to turn off particular features. +\noindent The operation \op{testOp} in this example can now take any +value expressible in OMG IDL as an argument, and can also return any +type expressible in OMG IDL. -\section{Implementing new code sets} +Type Any is mapped into C++ as the type \type{CORBA::Any}. When passed +as an argument or as a result of an operation, the following rules +apply: -It is quite easy to implement new code sets, if you need support for -code sets (or marshalling formats) that do not come with the omniORB -distribution. There are extensive comments in the headers and ORB code -that explain how to implement a code set; this section just serves to -point you in the right direction. +\mbox{} -The main definitions for the code set support are in -\file{include/omniORB4/codeSets.h}. That defines a set of base classes -use to implement code sets, plus some derived classes that use look-up -tables to convert simple 8-bit and 16-bit code sets to Unicode. +{\small +\begin{tabular}{llll} +{\bf In } & {\bf InOut } & {\bf Out } & +{\bf Return } \\ \hline +{\tt const CORBA::Any\& }& {\tt CORBA::Any\& }& {\tt CORBA::Any*\& } & +{\tt CORBA::Any* } +\end{tabular} +} -When sending or receiving string data, there are a total of four code -sets in action: a native char code set, a transmission char code set, -a native wchar code set, and a transmission wchar code set. The native -code sets are as described above; the transmission code sets are the -ones selected to communicate with a remote machine. They are -responsible for understanding the GIOP marshalling formats, as well as -the code sets themselves. Each of the four code sets has an object -associated with it which contains methods for converting data. +\mbox{} -There are two ways in which a string/wstring can be transmitted or -received. If the transmission code set in action knows how to deal -directly with the native code set (the trivial case being that they -are the same code set, but more complex cases are possible too), the -transmission code set object can directly marshal or unmarshal the -data into or out of the application buffer. If the transmission code -set does not know how to handle the native code set, it converts the -string/wstring into UTF-16, and passes that to the native code set -object (or vice-versa). All code set implementations must therefore -know how to convert to and from UTF-16. +\noindent So, the above IDL would map to the following C++: -With this explanation, the classes in \file{codeSets.h} should be easy -to understand. The next place to look is in the various existing code -set implementations, which are files of the form \file{cs-*.cc} in the -\file{src/lib/omniORB/orbcore} and \file{src/lib/omniORB/codesets}. -Note how all the 8-bit code sets (the ISO 8859-* family) consist -entirely of data and no code, since they are driven by look-up tables. +\begin{cxxlisting} +// C++ + +class anyExample_i : public virtual POA_anyExample { +public: + anyExample_i() { } + virtual ~anyExample_i() { } + virtual CORBA::Any* testOp(const CORBA::Any& a); +}; +\end{cxxlisting} + + +\subsection{Inserting and Extracting Basic Types from an Any} + +The question now arises as to how values are inserted into and removed +from an Any. This is achieved using two overloaded operators: +\code{<{}<=} and \code{>{}>=}. + +To insert a value into an Any, the \code{<{}<=} operator is used, as +in this example: + +\begin{cxxlisting} +// C++ +CORBA::Any an_any; +CORBA::Long l = 100; +an_any <<= l; +\end{cxxlisting} + +\noindent Note that the overloaded \code{<{}<=} operator has a return +type of \type{void}. +To extract a value, the \code{>{}>=} operator is used, as in this +example (where the Any contains a long): +\begin{cxxlisting} +// C++ +CORBA::Long l; +an_any >>= l; -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{Interceptors} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{chap:interceptors} +cout << "This is a long: " << l << endl; +\end{cxxlisting} -omniORB supports interceptors that allow the application to insert -processing in various points along the call chain, and in various -other locations. It does not (yet) support the standard Portable -Interceptors API. -The interceptor interfaces are defined in a single header, -\file{include/omniORB4/omniInterceptors.h}. Each interception point -consists of a singleton object with \op{add} and \op{remove} methods, -and the definition of an `interceptor info' class. For example: +The overloaded \code{>{}>=} operator returns a \type{CORBA::Boolean}. +If an attempt is made to extract a value from an Any when it contains +a different type of value (e.g.\ an attempt to extract a long from an +Any containing a double), the overloaded \code{>{}>=} operator will +return \code{false}; otherwise it will return \code{true}. Thus, a +common tactic to extract values from an Any is as follows: \begin{cxxlisting} -class omniInterceptors { - ... - class clientSendRequest_T { - public: +// C++ +CORBA::Long l; +CORBA::Double d; +const char* str; - class info_T { - public: - GIOP_C& giop_c; - IOP::ServiceContextList service_contexts; +if (an_any >>= l) { + cout << "Long: " << l << endl; +} +else if (an_any >>= d) { + cout << "Double: " << d << endl; +} +else if (an_any >>= str) { + cout << "String: " << str << endl; + // The storage of the extracted string is still owned by the any. +} +else { + cout << "Unknown value." << endl; +} +\end{cxxlisting} - info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} - private: - info_T(); - info_T(const info_T&); - info_T& operator=(const info_T&); - }; +\subsection{Inserting and Extracting Constructed Types from an Any} - typedef CORBA::Boolean (*interceptFunc)(info_T& info); +It is also possible to insert and extract constructed types and object +references from an Any. omniidl will generate insertion and extraction +operators for the constructed type. Note that it is necessary to +specify the \texttt{-Wba} command-line flag when running omniidl in +order to generate these operators. The following example illustrates +the use of constructed types with type Any: - void add(interceptFunc); - void remove(interceptFunc); - }; - ... +\begin{idllisting} +// IDL +struct testStruct { + long l; + short s; }; -\end{cxxlisting} -\noindent You can see that the interceptors themselves are functions -that take the \code{info\_T} object as their argument and return -boolean. Interceptors are called in the order they are registered; -normally, all interceptor functions return true, meaning that -processing should continue with subsequent interceptors. If an -interceptor returns false, later interceptors are not called. You -should only do that if you really know what you are doing. +interface anyExample { + any testOp(in any mesg); +}; +\end{idllisting} -Notice that the \code{info\_T} contains references to omniORB internal -data types. The definitions of these types can be found in other -header files within \file{include/omniORB4} and -\file{include/omniORB4/internal}. +Upon compiling the above IDL with \texttt{omniidl -bcxx -Wba}, the +following overloaded operators are generated: +\begin{enumerate} +\item \verb|void operator<<=(CORBA::Any&, const testStruct&)| +\item \verb|void operator<<=(CORBA::Any&, testStruct*)| +\item \verb|CORBA::Boolean operator>>=(const CORBA::Any&,|\\ + \verb|const testStruct*&)| +\end{enumerate} -\section{Interceptor registration} +Operators of this form are generated for all constructed types, and +for interfaces. -All the interceptor singletons are registered within another singleton -object of class \code{omniInterceptors}. You retrieve a pointer to the -object with the \op{omniORB::\dsc{}getInterceptors} function, which -must be called after the ORB has been initialised with -\op{CORBA::ORB\_init}, but before the ORB is used. The code to -register an interceptor looks, for example, like: +The first operator, \emph{(1)}, copies the constructed type, and +inserts it into the Any. The second operator, \emph{(2)}, inserts the +constructed type into the Any, and then manages it. Note that if the +second operator is used, the Any consumes the constructed type, and +the caller should not use the pointer to access the data after +insertion. The following is an example of how to insert a value into +an Any using operator \emph{(1)}: \begin{cxxlisting} -omniInterceptors* interceptors = omniORB::getInterceptors(); -interceptors->clientSendRequest.add(myInterceptorFunc); +// C++ +CORBA::Any an_any; + +testStruct t; +t.l = 456; +t.s = 8; + +an_any <<= t; \end{cxxlisting} -\section{Available interceptors} +The third operator, \emph{(3)}, is used to extract the constructed +type from the Any, and can be used as follows: -The following interceptors are available: +\begin{cxxlisting} +const testStruct* tp; -\begin{description} +if (an_any >>= tp) { + cout << "testStruct: l: " << tp->l << endl; + cout << " s: " << tp->s << endl; +} +else { + cout << "Unknown value contained in Any." << endl; +} +\end{cxxlisting} -\item[encodeIOR]\mbox{}\\ -% -Called when encoding an IOR to represent an object reference. This -interception point allows the application to insert extra profile -components into IORs. Note that you must understand and adhere to the -rules about data stored in IORs, otherwise the IORs created may be -invalid. omniORB itself uses this interceptor to insert various items, -so you can see an example of its use in the -\op{insertSupportedComponents} function defined in -\file{src/lib/omniORB/orbcore/ior.cc}. +As with basic types, if an attempt is made to extract a type from an +Any that does not contain a value of that type, the extraction +operator returns \code{false}. If the Any does contain that type, the +extraction operator returns \code{true}. If the extraction is +successful, the caller's pointer will point to memory managed by the +Any. The caller must not delete or otherwise change this storage, and +should not use this storage after the contents of the Any are replaced +(either by insertion or assignment), or after the Any has been +destroyed. In particular, management of the pointer should not be +assigned to a \type{\_var} type. +If the extraction fails, the caller's pointer will be set to point to +null. -\item[decodeIOR]\mbox{}\\ -% -Called when decoding an IOR. The application can use this to get out -whatever information they put into IORs with encodeIOR. Again, see -\op{extract\dsc{}SupportedComponents} in -\file{src/lib/omniORB/orbcore/ior.cc} for an example. +Note that there are special rules for inserting and extracting arrays +(using the \type{\_forany} types), and for inserting and extracting +bounded strings, booleans, chars, and octets. Please refer to the C++ +Mapping specification for further information. -\item[clientOpenConnection]\mbox{}\\ -% -Called as a client opens a new connection to a server, after the -connection is opened but before it is used to send a request. The -interceptor function can set the \code{info\_T}'s \code{reject} member -to true to cause the client to immediately close the new connection -and throw CORBA::TRANSIENT to the calling code. In that case, the -interceptor function can also set the \code{why} member to provide a -message that is logged. +\section{Type Any in omniORB} +\label{anyOmniORB} -\item[clientSendRequest]\mbox{}\\ -% -Called just before a request header is sent over the network. The -application can use it to insert service contexts in the header. See -\op{setCodeSetService\dsc{}Context} in -\file{src/lib/omniORB/orbcore/cdrStream.cc} for an example of its use. +This section contains some notes on the use and behaviour of type Any +in omniORB. +\subsection{Generating Insertion and Extraction Operators.} +To generate type Any insertion and extraction operators for +constructed types and interfaces, the \texttt{-Wba} command line flag +should be specified when running omniidl. -\item[clientReceiveReply]\mbox{}\\ -% -Called as the client receives a reply, just after unmarshalling the -reply header. Called for normal replies and exceptions. +\subsection{TypeCode comparison when extracting from an Any.} +When an attempt is made to extract a type from an Any, the TypeCode of +the type is checked for \emph{equivalence} with the TypeCode of the +type stored by the Any. The \op{equivalent} test in the TypeCode +interface is used for this purpose. For example: +\begin{idllisting} +// IDL 1 +typedef double Double1; -\item[serverAcceptConnection]\mbox{}\\ -% -Called when a server accepts a new incoming connection, but before -it reads any data from it. The interceptor function can set the -\code{info\_T}'s \code{reject} member to true to cause the server to -immediately close the new connection. In that case, the interceptor -function can also set the \code{why} member to provide a message -that is logged. +struct Test1 { + Double1 a; +}; +\end{idllisting} +\begin{idllisting} +// IDL 2 +typedef double Double2; -\item[serverReceiveRequest]\mbox{}\\ -% -Called when the server receives a request, just after unmarshalling -the request header. See the \op{getCodeSetServiceContext} function in -\file{src/lib/omniORB/orbcore/cdrStream.cc} for an example. +struct Test1 { + Double2 a; +}; +\end{idllisting} + +If an attempt is made to extract the type \type{Test1} defined in IDL +1 from an Any containing the \type{Test1} defined in IDL 2, this will +succeed (and vice-versa), as the two types differ only by an alias. +\subsection{Top-level aliases.} +When a type is inserted into an Any, the Any stores both the value of +the type and the TypeCode for that type. However, in some cases, a +top-level alias can be lost due to the details of the C++ mapping. For +example, consider these IDL definitions: -\item[serverSendReply]\mbox{}\\ -% -Called just before the server marshals a reply header. +\begin{idllisting} +// IDL 3 +typedef sequence seqDouble1; +typedef sequence seqDouble2; +typedef seqDouble2 seqDouble3; +\end{idllisting} + +omniidl generates distinct types for \type{seqDouble1} and +\type{seqDouble2}, and therefore each has its own set of C++ operators +for Any insertion and extraction. That means inserting a +\type{seqDouble1} into an Any sets the Any's TypeCode to include the +alias `seqDouble1', and inserting a \type{seqDouble2} sets the +TypeCode to the alias `seqDouble2'. + +However, in the C++ mapping, \type{seqDouble3} is required to be just +a C++ typedef to \type{seqDouble2}, so the C++ compiler uses the Any +insertion operator for \type{seqDouble2}. Therefore, inserting a +\type{seqDouble3} sets the Any's TypeCode to the \type{seqDouble2} +alias. If this is not desirable, you can use the member function +`\code{void type(TypeCode\_ptr)}' of the Any interface to explicitly +set the TypeCode to the correct one. + + +\subsection{Removing aliases from TypeCodes.} +Some ORBs (such as old versions of Orbix) will not accept TypeCodes +containing \code{tk\_alias} TypeCodes. When using type Any while +interoperating with these ORBs, it is necessary to remove +\code{tk\_alias} TypeCodes from throughout the TypeCode representing a +constructed type. + +To remove all \code{tk\_alias} TypeCodes from TypeCodes transmitted in +Anys, supply the \texttt{-ORBtcAliasExpand 1} command-line flag when +running an omniORB executable. There will be some (small) performance +penalty when transmitting Any values. + +Note that the \code{\_tc\_} TypeCodes generated for all constructed +types will contain the complete TypeCode for the type (including any +\code{tk\_alias} TypeCodes), regardless of whether the +\texttt{-ORBtcAliasExpand} flag is set to 1 or not. It is only when +Anys are transmitted that the aliases are stripped. +\subsection{Recursive TypeCodes.} +omniORB supports recursive TypeCodes. This means that types such as +the following can be inserted or extracted from an Any: -\item[serverSendException]\mbox{}\\ -% -Called just before the server marshals an exception reply header. +\begin{idllisting} +// IDL 4 +struct Test4 { + sequence a; +}; +\end{idllisting} -\item[createIdentity]\mbox{}\\ -% -Called when the ORB is about to create an `identity' object to -represent a CORBA object. It allows application code to provide its -own identity implementations. It is very unlikely that an application -will need to do this. +\subsection{Threads and type Any.} +Inserting and extracting simultaneously from the same Any (in 2 +threads) results in undefined behaviour. +In versions of omniORB before 4.0, extracting simultaneously from the +same Any (in 2 or more different threads) also led to undefined +behaviour. That is no longer the case---Any extraction is now thread +safe. -\item[createORBServer]\mbox{}\\ -% -Used internally by the ORB to register different kinds of server. At -present, only a GIOP server is registered. It is very unlikely that -application code will need to do this. +\section{TypeCode in omniORB} -\item[createThread]\mbox{}\\ -% -Called whenever the ORB creates a thread. The \type{info\_T} class for -this interceptor is +This section contains some notes on the use and behaviour of TypeCode +in omniORB -\begin{cxxlisting} - class info_T { - public: - virtual void run() = 0; - }; -\end{cxxlisting} +\subsection{TypeCodes in IDL.} -\noindent -The interceptor function is called in the context of the newly created -thread. The function \emph{must} call the \type{info\_T}'s \op{run} -method, to pass control to the thread body. \op{run} returns just -before the thread exits. This arrangement allows the interceptor to -initialise some per-thread state before the thread body runs, then -release it just before the thread exits. +When using TypeCodes in IDL, note that they are defined in the CORBA +scope. Therefore, \type{CORBA::TypeCode} should be used. Example: +\begin{idllisting} +// IDL 5 +struct Test5 { + long length; + CORBA::TypeCode desc; +}; +\end{idllisting} -\item[assignUpcallThread]\mbox{}\\ -% -The ORB maintains a general thread pool, from which threads are drawn -for various purposes. One purpose is for performing upcalls to -application code, in response to incoming CORBA calls. The -assignUpcallThread interceptor is called when a thread is assigned to -perform upcalls. In the thread per connection model, the thread stays -assigned to performing upcalls for the entire lifetime of the -underlying network connection; in the thread pool model, threads are -assigned for upcalls on a per call basis, so this interceptor is -triggered for every incoming call\footnote{Except that with the -threadPoolWatchConnection parameter set true, a thread can perform -multiple upcalls even when thread pool mode is active.}. As with the -createThread interceptor, the interceptor function must call the -\type{info\_T}'s \op{run} method to pass control to the upcall. +\subsection{orb.idl} -When a thread finishes its assignment of processing upcalls, it -returns to the pool (even in thread per connection mode), so the same -thread can be reassigned to perform more upcalls, or reused for a -different purpose. +The CORBA specification says that IDL using \type{CORBA::TypeCode} +must include the file \file{orb.idl}. That is not required in omniORB, +but a suitable \file{orb.idl} is available. -Unlike the other interceptors, the interceptor functions for -createThread and assignUpcallThread have no return value. Interceptor -chaining is performed by calls through the \op{info\_T::run} method, -rather than by visiting interceptor functions in turn. +\subsection{Generating TypeCodes for constructed types.} +To generate a TypeCode for constructed types, specify the +\texttt{-Wba} command-line flag when running omniidl. This will +generate a \code{\_tc\_} TypeCode describing the type, at the same +scope as the type. Example: -\end{description} +\begin{idllisting} +// IDL 6 +struct Test6 { + double a; + sequence b; +}; +\end{idllisting} +A TypeCode, \code{\_tc\_Test6}, will be generated to describe the +struct \type{Test6}. The operations defined in the TypeCode interface +can be used to query the TypeCode about the type it represents. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter{Type Any and TypeCode} +\chapter[Objects by value, etc.] + {Objects by value, abstract interfaces and local interfaces} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{chap:any} - -The CORBA specification provides for a type that can hold the value of -any OMG IDL type. This type is known as type Any. The OMG also -specifies a pseudo-object, TypeCode, that can encode a description of -any type specifiable in OMG IDL. +\label{chap:valuetype} -In this chapter, an example demonstrating the use of type Any is -presented. This is followed by sections describing the behaviour of -type Any and TypeCode in omniORB. For further information on type -Any, refer to the C++ Mapping specification., and for more information -on TypeCode, refer to the Interface Repository chapter in the CORBA -core section of the CORBA specification. +omniORB 4.1 supports objects by value, declared with the +\code{valuetype} keyword in IDL, and both abstract and local +interfaces. This chapter outlines some issues to do with using these +types in omniORB. You are assumed to have read the relevant parts of +the CORBA specification, specifically chapters 3, 4, 5 and 6 of the +CORBA 2.6 specification, and sections 1.17, 1.18 and 1.35 of the C++ +mapping specification, version 1.1. +\section{Features} -\section{Example using type Any} +omniORB supports the complete objects by value specification, with the +exception of custom valuetypes. All other valuetype features including +value boxes, value sharing semantics, abstract valuetypes, and +abstract interfaces are supported. Local interfaces are supported, +with a number of caveats outlined in +section~\ref{sec:LocalInterfaces}. -Before going through this example, you should make sure that you have -read and understood the examples in chapter~\ref{chap:basic}. The -source code for this example is included in the omniORB distribution, -in the directory \file{src/examples/anyExample}. A listing of the -source code is provided at the end of this chapter. -\subsection{Type Any in IDL} -Type Any allows one to delay the decision on the type used in an -operation until run-time. To use type any in IDL, use the keyword -\code{any}, as in the following example: +\section{Reference counting} -\begin{idllisting} -// IDL -interface anyExample { - any testOp(in any mesg); -}; -\end{idllisting} +Values are reference counted. This means that, as long as your +application properly manages reference counts, values are usually +automatically deleted when they are no longer required. However, one +of the features of valuetypes is that they support the representation +of cyclic graph structures. In that kind of situation, the reference +counting garbage collection does not work, because references internal +to the graph prevent the reference counts ever becoming zero. +To avoid memory leaks, application code must explicitly break any +reference cycles in values it manipulates. This includes graphs of +values received as parameters and return values from CORBA operations. -\noindent The operation \op{testOp()} in this example can now take any -value expressible in OMG IDL as an argument, and can also return any -type expressible in OMG IDL. -Type Any is mapped into C++ as the type \type{CORBA::Any}. When passed -as an argument or as a result of an operation, the following rules -apply: +\section{Value sharing and local calls} -\mbox{} +When valuetypes are passed as parameters in CORBA calls (i.e.\ calls +on CORBA objects declared with \code{interface} in IDL), the structure +of related values is maintained. Consider, for example, the following +IDL definitions (which are from the example code in +\file{src/examples/valuetype/simple}: -{\small -\begin{tabular}{llll} -{\bf In } & {\bf InOut } & {\bf Out } & -{\bf Return } \\ \hline -{\tt const CORBA::Any\& }& {\tt CORBA::Any\& }& {\tt CORBA::Any*\& } & -{\tt CORBA::Any* } -\end{tabular} -} +\begin{idllisting} +module ValueTest { + valuetype One { + public string s; + public long l; + }; -\mbox{} + interface Test { + One op1(in One a, in One b); + }; +}; +\end{idllisting} -\noindent So, the above IDL would map to the following C++: +If the client to the \type{Test} object passes the same value in both +parameters, just one value is transmitted, and the object +implementation receives a copy of the single value, with references to +it in both parameters. -\begin{cxxlisting} -// C++ +In the case that the object is remote from the client, there is +obviously a copying step involved. In the case that the object is in +the same address space as the client, the same copying semantics must +be maintained so that the object implementation can modify the values +it receives without the client seeing the modifications. To support +that, omniORB must copy the entire parameter list in one operation, in +case there is sharing between different parameters. Such copying is a +rather more time-consuming process than the parameter-by-parameter +copy that takes place in calls not involving valuetypes. -class anyExample_i : public virtual POA_anyExample { -public: - anyExample_i() { } - virtual ~anyExample_i() { } - virtual CORBA::Any* testOp(const CORBA::Any& a); -}; -\end{cxxlisting} +To avoid the overhead of copying parameters in this way, applications +can choose to relax the semantics of value copying in local calls, so +values are not copied at all, but are passed by reference. In that +case, the client to a call \emph{will} see any modifications to the +values it passes as parameters (and similarly, the object +implementation will see any changes the client makes to returned +values). To choose this option, set the \code{copyValuesInLocalCalls} +configuration parameter to zero. -\subsection{Inserting and Extracting Basic Types from an Any} +\section{Value box factories} -The question now arises as to how values are inserted into and removed -from an Any. This is achieved using two overloaded operators: -\code{<{}<=} and \code{>{}>=}. +With normal valuetypes, omniidl generates factory classes (with names +ending \code{\_init}) as required by the C++ mapping specification. +The application is responsible for registering the factories with the +ORB. -To insert a value into an Any, the \code{<{}<=} operator is used, as -in this example: +Unfortunately, the C++ mapping makes no mention of factories for value +boxes. In omniORB, factories for value boxes are automatically +registered with the ORB, and there are no application-visible factory +classes generated for them. Some other CORBA implementations generate +application visible factories, and the application \emph{does} have to +register the factories with the ORB. -\begin{cxxlisting} -// C++ -CORBA::Any an_any; -CORBA::Long l = 100; -an_any <<= l; -\end{cxxlisting} -\noindent Note that the overloaded \code{<{}<=} operator has a return -type of \type{void}. +\section{Standard value boxes} -To extract a value, the \code{>{}>=} operator is used, as in this -example (where the Any contains a long): +The standard \type{CORBA::StringValue} and \type{CORBA::WStringValue} +value boxes are available to application code. To make the definitions +available in IDL, \#include the standard \file{orb.idl}. -\begin{cxxlisting} -// C++ -CORBA::Long l; -an_any >>= l; -cout << "This is a long: " << l << endl; -\end{cxxlisting} +\section{Covariant returns} +As required by the C++ mapping, on C++ compilers that support +covariant return types, omniidl generates code for the +\op{\_copy\_value} function that returns the most derived type of the +value. On older compilers, \op{\_copy\_value} returns +\type{CORBA::ValueBase}. -The overloaded \code{>{}>=} operator returns a \type{CORBA::Boolean}. -If an attempt is made to extract a value from an Any when it contains -a different type of value (e.g.\ an attempt to extract a long from an -Any containing a double), the overloaded \code{>{}>=} operator will -return False; otherwise it will return True. Thus, a common tactic to -extract values from an Any is as follows: +If you write code that calls \op{\_copy\_value}, and you need to +support older compilers, you should assign the result to a variable of +type \type{CORBA::ValueBase*} and downcast to the target type, rather +than using the covariant return. -\begin{cxxlisting} -// C++ -CORBA::Long l; -CORBA::Double d; -const char* str; +If you are overriding \op{\_copy\_value}, you must correctly take +account of the \code{OMNI\_HAVE\_COVARIANT\_RETURNS} preprocessor +definition. -if (an_any >>= l) { - cout << "Long: " << l << endl; -} -else if (an_any >>= d) { - cout << "Double: " << d << endl; -} -else if (an_any >>= str) { - cout << "String: " << str << endl; - // The storage of the extracted string is still owned by the any. -} -else { - cout << "Unknown value." << endl; -} -\end{cxxlisting} -\subsection{Inserting and Extracting Constructed Types from an Any} +\section{Values inside Anys} -It is also possible to insert and extract constructed types and object -references from an Any. omniidl will generate insertion and extraction -operators for the constructed type. Note that it is necessary to -specify the \texttt{-WBa} command-line flag when running omniidl in -order to generate these operators. The following example illustrates -the use of constructed types with type Any: +Valuetypes inserted into Anys cause a number of interesting issues. +Even when inside Anys, values are required to support complete sharing +semantics. Take this IDL for example: \begin{idllisting} -// IDL -struct testStruct { - long l; - short s; -}; +module ValueTest { + valuetype One { + public string s; + public long l; + }; -interface anyExample { - any testOp(in any mesg); + interface AnyTest { + void op1(in One v, in Any a); + }; }; \end{idllisting} -Upon compiling the above IDL with \texttt{omniidl -bcxx -Wba}, the -following overloaded operators are generated: - -\begin{enumerate} -\item \verb|void operator<<=(CORBA::Any&, const testStruct&)| -\item \verb|void operator<<=(CORBA::Any&, testStruct*)| -\item \verb|CORBA::Boolean operator>>=(const CORBA::Any&,|\\ - \verb|const testStruct*&)| -\end{enumerate} - -Operators of this form are generated for all constructed types, and -for interfaces. - -The first operator, \emph{(1)}, copies the constructed type, and -inserts it into the Any. The second operator, \emph{(2)}, inserts the -constructed type into the Any, and then manages it. Note that if the -second operator is used, the Any consumes the constructed type, and -the caller should not use the pointer to access the data after -insertion. The following is an example of how to insert a value into -an Any using operator \emph{(1)}: +\noindent Now, suppose the client behaves as follows: \begin{cxxlisting} -// C++ -CORBA::Any an_any; - -testStruct t; -t.l = 456; -t.s = 8; - -an_any <<= t; +ValueTest::One* v = new One_impl("hello", 123); +CORBA::Any a; +a <<= v; +obj->op1(v, a); \end{cxxlisting} - -The third operator, \emph{(3)}, is used to extract the constructed -type from the Any, and can be used as follows: +\noindent then on the server side: \begin{cxxlisting} -const testStruct* tp; - -if (an_any >>= tp) { - cout << "testStruct: l: " << tp->l << endl; - cout << " s: " << tp->s << endl; -} -else { - cout << "Unknown value contained in Any." << endl; +void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a) +{ + ValueTest::One* v2; + a >>= v2; + assert(v2 == v); } \end{cxxlisting} -As with basic types, if an attempt is made to extract a type from an -Any that does not contain a value of that type, the extraction -operator returns False. If the Any does contain that type, the -extraction operator returns True. If the extraction is successful, the -caller's pointer will point to memory managed by the Any. The caller -must not delete or otherwise change this storage, and should not use -this storage after the contents of the Any are replaced (either by -insertion or assignment), or after the Any has been destroyed. In -particular, management of the pointer should not be assigned to a -\type{\_var} type. - -If the extraction fails, the caller's pointer will be set to point to -null. +\noindent +This is all very well in this kind of simple situation, but problems +can arise if truncatable valuetypes are used. Imagine this derived +value: -Note that there are special rules for inserting and extracting arrays -(using the \type{\_forany} types), and for inserting and extracting -bounded strings, booleans, chars, and octets. Please refer to the C++ -Mapping specification for further information. +\begin{idllisting} +module ValueTest { + valuetype Two : truncatable One { + public double d; + }; +}; +\end{idllisting} +\noindent +Now, suppose that the client shown above sends an instance of +valuetype \type{Two} in both parameters, and suppose that the server +has not seen the definition of valuetype \type{Two}. In this +situation, as the first parameter is unmarshalled, it will be +truncated to valuetype \type{One}, as required. Now, when the Any is +unmarshalled, it refers to the same value, which has been truncated. +So, even though the TypeCode in the Any indicates that the value has +type \type{Two}, the stored value actually has type \type{One}. If the +receiver of the Any tries to pass it on, transmission will fail +because the Any's value does not match its TypeCode. +In the opposite situation, where an Any parameter comes before a +valuetype parameter, a different problem occurs. In that case, as the +Any is unmarshalled, there is no type information available for +valuetype \type{Two}, so the value inside the Any has an internal +omniORB type used for unknown valuetypes. As the next parameter is +unmarshalled, omniORB sees that the shared value is unknown, and is +able to convert it to the target \type{One} valuetype with +truncation. In this case, the Any and the plain valuetype both have +the correct types and values, but the fact that both should have +referred to the same value has been lost. -\section{Type Any in omniORB} -\label{anyOmniORB} +Because of these issues, it is best to avoid defining interfaces that +mix valuetypes and Anys in a single operation, and certainly to avoid +trying to share plain values with values inside Anys. -This section contains some notes on the use and behaviour of type Any -in omniORB. -\subsection{Generating Insertion and Extraction Operators.} -To generate type Any insertion and extraction operators for -constructed types and interfaces, the \texttt{-Wba} command line flag -should be specified when running omniidl. +\subsection{Values inside DynAnys} -\subsection{TypeCode comparison when extracting from an Any.} -When an attempt is made to extract a type from an Any, the TypeCode of -the type is checked for \emph{equivalence} with the TypeCode of the -type stored by the Any. The \op{equivalent} test in the TypeCode -interface is used for this purpose. +The sharing semantics of valuetypes can also cause difficulties for +DynAny. The CORBA 2.6 specification does not mention how shared values +inside DynAnys should be handled; the CORBA 3.x specification slightly +clarifies the situation, but it is still unclear. To write portable +code it is best to avoid manipulating DynAnys containing values that +are shared. -Examples: +In omniORB, when a value inside an Any is converted into a DynAny, the +value's state is copied into the DynAny, and manipulated there. When +converting back to an Any a new value is created. This means that any +other references to the original value (whether themselves inside Anys +of not) still relate to the original value, with unchanged state. +However, this copying only occurs when a DynValue is actually created, +so for example a structure with two value members referring to the +same value can manipulated inside a DynAny without breaking the +sharing, provided the value members are not accessed as DynAnys. +Extracting the value members as ValueBase will reveal the sharing, for +example. -\begin{idllisting} -// IDL 1 -typedef double Double1; -struct Test1 { - Double1 a; -}; -\end{idllisting} +\section{Local Interfaces} +\label{sec:LocalInterfaces} -\begin{idllisting} -// IDL 2 -typedef double Double2; +Local interfaces are somewhat under-specified in the C++ mapping. This +section outlines the way local interfaces are supported in omniORB, +and details the limitations and issues. -struct Test1 { - Double2 a; -}; -\end{idllisting} - -If an attempt is made to extract the type \type{Test1} defined in IDL -1 from an Any containing the \type{Test1} defined in IDL 2, this will -succeed (and vice-versa), as the two types differ only by an alias. +\subsection{Simple local interfaces} -\subsection{Top-level aliases.} -When a type is inserted into an Any, the Any stores both the value of -the type and the TypeCode for that type. However, in some cases, a -top-level alias can be lost due to the details of the C++ mapping. For -example, consider these IDL definitions: +With simple IDL, there are no particular issues: \begin{idllisting} -// IDL 3 -typedef sequence seqDouble1; -typedef sequence seqDouble2; -typedef seqDouble2 seqDouble3; +module Test { + local interface Example { + string hello(in string arg); + }; +}; \end{idllisting} -omniidl generates distinct types for \type{seqDouble1} and -\type{seqDouble2}, and therefore each has its own set of C++ operators -for Any insertion and extraction. That means inserting a -\type{seqDouble1} into an Any sets the Any's TypeCode to include the -alias `seqDouble1', and inserting a \type{seqDouble2} sets the -TypeCode to the alias `seqDouble2'. - -However, in the C++ mapping, \type{seqDouble3} is required to be just -a C++ typedef to \type{seqDouble2}, so the C++ compiler uses the Any -insertion operator for \type{seqDouble2}. Therefore, inserting a -\type{seqDouble3} sets the Any's TypeCode to the \type{seqDouble2} -alias. If this is not desirable, you can use the member function -`\code{void type(TypeCode\_ptr)}' of the Any interface to explicitly -set the TypeCode to the correct one. - +The IDL compiler generates an abstract base class +\type{Test::Example}. The application defines a class derived from it +that implements the abstract \op{hello} member function. Instances of +that class can then be used where the IDL specifies interface +\type{Example}. -\subsection{Removing aliases from TypeCodes.} -Some ORBs (such as old versions of Orbix) will not accept TypeCodes -containing \code{tk\_alias} TypeCodes. When using type Any while -interoperating with these ORBs, it is necessary to remove -\code{tk\_alias} TypeCodes from throughout the TypeCode representing a -constructed type. +Note that, by default, local interface implementations have no +reference counting behaviour. If the local object should be deleted +when the last reference is released, the application must implement +the \op{\_add\_ref} and \op{\_remove\_ref} virtual member functions +within the implementation class. Make sure that the implementations +are thread safe. -To remove all \code{tk\_alias} TypeCodes from TypeCodes transmitted in -Anys, supply the \texttt{-ORBtcAliasExpand 1} command-line flag when -running an omniORB executable. There will be some (small) performance -penalty when transmitting Any values. -Note that the \code{\_tc\_} TypeCodes generated for all constructed -types will contain the complete TypeCode for the type (including any -\code{tk\_alias} TypeCodes), regardless of whether the -\texttt{-ORBtcAliasExpand} flag is set to 1 or not. It is only when -Anys are transmitted that the aliases are stripped. +\subsection{Inheritance from unconstrained interfaces} -\subsection{Recursive TypeCodes.} -omniORB supports recursive TypeCodes. This means that types such as -the following can be inserted or extracted from an Any: +Local interfaces can inherit from unconstrained (i.e.\ non-local) +interfaces: \begin{idllisting} -// IDL 4 -struct Test4 { - sequence a; +module Test { + interface One { + void problem(inout string arg); + }; + local interface Two : One { + }; + + interface Receiver { + void setOne(in One a); + }; }; \end{idllisting} +IDL like this leads to two issues to do with omniORB's C++ mapping +implementation. -\subsection{Threads and type Any.} -Inserting and extracting simultaneously from the same Any (in 2 -different threads) results in undefined behaviour. +First, an instance of local interface \type{Two} should be suitable to +pass as the argument to the \op{setOne} method of a \type{Receiver} +object (as long as the object is in the same address space as the +caller). Therefore, the \type{Two} abstract base class has to inherit +from the internal class omniORB uses to map object references of type +\type{One}. For performance reasons, the class that implements +\type{One} object references normally has non-virtual member +functions. That means that the application-supplied \op{problem} +member function for the implementation of local interface \type{Two} +will not override the base class's version. To overcome this, the IDL +for the base unconstrained interface must be compiled with the +\cmdline{-Wbvirtual-objref} switch to omniidl. That makes the member +functions of the mapping of \type{One} into virtual functions, so they +can be overridden. -In versions of omniORB before 4.0, extracting simultaneously from the -same Any (in 2 or more different threads) also led to undefined -behaviour. That is no longer the case---Any extraction is now thread -safe. +The second problem is that, in some cases, omniORB uses a different +mapping for object reference member functions than the mapping used in +servant classes. For example, in the \op{problem} operation, it uses +an internal type for the inout string argument that avoids memory +issues if the application uses a \type{String\_var} in the argument. +This means that the abstract member function declared in the +\type{Two} class (and implemented by the application) has a different +signature to the member function in the base class. The +application-supplied class will therefore not properly override the +base class method. In all likelihood, the C++ compiler will also +complain that the two member functions are ambiguous. The solution to +this problem is to use the implementation mapping in the base object +reference class, rather than the normal object reference mapping, +using the \cmdline{-Wbimpl-mapping} switch to omniidl. The consequence +of this is that some uses of \code{\_var} types for inout arguments +that are normally acceptable in omniORB can now lead to memory +management problems. +In summary, to use local interfaces derived from normal unconstrained +interfaces, you should compile all your IDL with the omniidl flags: -\section{TypeCode in omniORB} +\begin{quote} +\cmdline{-Wbvirtual-objref -Wbimpl-mapping} +\end{quote} -This section contains some notes on the use and behaviour of TypeCode -in omniORB -\subsection{TypeCodes in IDL.} +\subsection{Valuetypes supporting local interfaces} -When using TypeCodes in IDL, note that they are defined in the CORBA -scope. Therefore, \type{CORBA::TypeCode} should be used. Example: +According to the IDL specification, it should be possible to declare a +valuetype that supports a local interface: \begin{idllisting} -// IDL 5 -struct Test5 { - long length; - CORBA::TypeCode desc; +local interface I { + void my_operation(); +}; +valuetype V supports I { + public string s; }; \end{idllisting} -\subsection{orb.idl} +omniidl accepts the IDL, but unfortunately the resulting C++ code does +not compile. The C++ mapping specification has a problem in that both +the \type{CORBA::\dsc{}LocalObject} and \type{CORBA::ValueBase} +classes have \op{\_add\_ref} and \op{\_remove\_\dsc{}ref} member +functions defined. The classes generated for the valuetype inherit +from both these base classes, and therefore have an ambiguity. Until +the C++ mapping resolves this conflict, valuetypes supporting local +interfaces cannot be used in omniORB. -The CORBA specification says that IDL using \type{CORBA::TypeCode} -must include the file \file{orb.idl}. That is not required in omniORB, -but a suitable \file{orb.idl} is available. -\subsection{Generating TypeCodes for constructed types.} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{Asynchronous Method Invocation} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{chap:ami} -To generate a TypeCode for constructed types, specify the -\texttt{-Wba} command-line flag when running omniidl. This will -generate a \code{\_tc\_} TypeCode describing the type, at the same -scope as the type. Example: +omniORB 4.2 supports Asynchronous Method Invocation, AMI, as defined +in the CORBA Messaging specification. It supports both the polling and +callback models of asynchronous calls. Note that omniORB does not +support the other parts of the Messaging specification such as Quality +of Service, Routing and Persistent requests. + +While omniORB mainly targets the 2.6 version of the CORBA +specification, the AMI support follows the CORBA Messaging +specification as described in the CORBA 3.1 specification, chapter +17~\cite{corba31-spec}. That version of the specification is largely +the same as the one in CORBA 2.6. The only significant difference is +that exception replies in the callback model use a simpler +interface-independent mapping. + +\section{Implied IDL} + +AMI works by defining some additional \term{implied IDL} for each +interface in the real IDL. The implied IDL contains type and +operation definitions that enable asynchronous calls. + +As a guide to the implied IDL, there is a special \cmdline{ami} +back-end to omniidl that outputs the implied IDL for the given input +IDL. For example, given the Echo example IDL: \begin{idllisting} -// IDL 6 -struct Test6 { - double a; - sequence b; +// echo.idl +interface Echo { + string echoString(in string mesg); }; \end{idllisting} -A TypeCode, \code{\_tc\_Test6}, will be generated to describe the -struct \type{Test6}. The operations defined in the TypeCode interface -can be used to query the TypeCode about the type it represents. +\noindent You can output the implied IDL using +\begin{quote} +\cmdline{omniidl -bami echo.idl} +\end{quote} +\noindent That outputs the following to standard out: +\begin{idllisting} +// ReplyHandler for interface Echo +interface AMI_EchoHandler : Messaging::ReplyHandler { + void echoString(in string ami_return_val); + void echoString_excep(in ::Messaging::ExceptionHolder excep_holder); +}; -\clearpage +// Poller valuetype for interface Echo +abstract valuetype AMI_EchoPoller : Messaging::Poller { + void echoString(in unsigned long ami_timeout, out string ami_return_val); +}; -\section{Source Listing} +// AMI implied operations for interface Echo +interface Echo { + void sendc_echoString(in ::AMI_EchoHandler ami_handler, in string mesg); + ::AMI_EchoPoller sendp_echoString(in string mesg); +}; +\end{idllisting} -\subsection{anyExample\_impl.cc} +\noindent Alternatively, you can use the \cmdline{-Wbdump} option to +output an interleaved version that shows the original IDL and the +implied IDL together. -\begin{cxxlisting} -// anyExample_impl.cc - This is the source code of the example used in -// Chapter 9 "Type Any and TypeCode" of the omniORB -// users guide. -// -// This is the object implementation. -// -// Usage: anyExample_impl -// -// On startup, the object reference is printed to cout as a -// stringified IOR. This string should be used as the argument to -// anyExample_clt. -// - -#include - -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif +Note that the implied IDL output is for information only. You should +not compile it, but rather instruct the omniidl C++ back-end to +generate the corresponding C++ definitions. -class anyExample_i : public POA_anyExample { -public: - inline anyExample_i() {} - virtual ~anyExample_i() {} - virtual CORBA::Any* testOp(const CORBA::Any& a); -}; +\section{Generating AMI stubs} -CORBA::Any* anyExample_i::testOp(const CORBA::Any& a) -{ - cout << "Any received, containing: " << endl; +To generate stub code including AMI types and operations, give the +\cmdline{-Wbami} command line option to omniidl's \cmdline{cxx} +back-end: -#ifndef NO_FLOAT - CORBA::Double d; -#endif +\begin{quote} +\cmdline{omniidl -bcxx -Wbami echo.idl} +\end{quote} - CORBA::Long l; - const char* str; +\noindent That generates the normal C++ stubs and skeletons, plus all +the definitions in the implied IDL. - testStruct* tp; +\section{AMI examples} - if (a >>= l) { - cout << "Long: " << l << endl; - } -#ifndef NO_FLOAT - // XXX - should we provide stream ops for _CORBA_Double_ and - // _CORBA_Float_on VMS?? - else if (a >>= d) { - cout << "Double: " << (double)d << endl; - } -#endif - else if (a >>= str) { - cout << "String: " << str << endl; - } - else if (a >>= tp) { - cout << "testStruct: l: " << tp->l << endl; - cout << " s: " << tp->s << endl; - } - else { - cout << "Unknown value." << endl; - } +Example AMI clients for the \intf{Echo} server can be found in +\file{src/examples/ami}. - CORBA::Any* ap = new CORBA::Any; - *ap <<= (CORBA::ULong) 314; - cout << "Returning Any containing: ULong: 314\n" << endl; - return ap; -} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\chapter{Interface Type Checking} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\label{ch_intf} -////////////////////////////////////////////////////////////////////// +This chapter describes the mechanism used by omniORB to ensure type +safety when object references are exchanged across the network. This +mechanism is handled completely within the ORB. There is no +programming interface visible at the application level. However, for +the sake of diagnosing the problem when there is a type violation, it +is useful to understand the underlying mechanism in order to interpret +the error conditions reported by the ORB. -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); +\section{Introduction} - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); +In GIOP/IIOP, an object reference is encoded as an Interoperable +Object Reference (IOR) when it is sent across a network connection. +The IOR contains a Repository ID (RepoId) and one or more +communication profiles. The communication profiles describe where and +how the object can be contacted. The RepoId is a string which uniquely +identifies the IDL interface of the object. - anyExample_i* myobj = new anyExample_i(); +Unless the \code{ID} pragma is specified in the IDL, the ORB generates +the RepoId string in the so-called OMG IDL Format\footnote{For further +details of the repository ID formats, see section 10.6 in the CORBA +2.6 specification.}. For instance, the RepoId for the \intf{Echo} +interface used in the examples of chapter~\ref{chap:basic} is +\texttt{IDL:Echo:1.0}. - PortableServer::ObjectId_var myobjid = poa->activate_object(myobj); +When interface inheritance is used in the IDL, the ORB always sends the +RepoId of the most derived interface. For example: - obj = myobj->_this(); - CORBA::String_var sior(orb->object_to_string(obj)); - cout << (char*)sior << endl; +\begin{idllisting} + // IDL + interface A { + ... + }; + interface B : A { + ... + }; + interface C { + void op(in A arg); + }; +\end{idllisting} - myobj->_remove_ref(); +\begin{cxxlisting} + // C++ + C_ptr server; + B_ptr objB; + A_ptr objA = objB; + server->op(objA); // Send B as A +\end{cxxlisting} - PortableServer::POAManager_var pman = poa->the_POAManager(); - pman->activate(); +In the example, the operation \op{C::op} accepts an object reference +of type \type{A}. The real type of the reference passed to \op{C::op} +is \type{B}, which inherits from \type{A}. In this case, the RepoId of +\type{B}, and not that of \type{A}, is sent across the network. - orb->run(); - orb->destroy(); - } - catch(CORBA::SystemException& ex) { - cerr << "Caught CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} -\end{cxxlisting} +The GIOP/IIOP specification allows an ORB to send a null string in the +RepoId field of an IOR. It is up to the receiving end to work out the +real type of the object. omniORB never sends out null strings as +RepoIds, but it may receive null RepoIds from other ORBs. In that +case, it will use the mechanism described below to ensure type safety. -\clearpage +\section{Interface Inheritance} -\subsection{anyExample\_clt.cc} +When the ORB receives an IOR of interface type B when it expects the +type to be A, it must find out if B inherits from A. When the ORB has +no local knowledge of the type B, it must work out the type of B +dynamically. -\begin{cxxlisting} -// anyExample_clt.cc - This is the source code of the example used in -// Chapter 9 "Type Any and TypeCode" of the omniORB -// users guide. -// -// This is the client. -// -// Usage: anyExample_clt -// +The CORBA specification defines an Interface Repository (IR) from +which IDL interfaces can be queried dynamically. In the above +situation, the ORB could contact the IR to find out the type of B. +However, this approach assumes that an IR is always available and +contains the up-to-date information of all the interfaces used in the +domain. This assumption may not be valid in many applications. -#include +An alternative is to use the \op{\_is\_a} operation to work out the +actual type of an object. This approach is simpler and more robust +than the previous one because no 3rd party is involved, so this is +what omniORB does. -#ifdef HAVE_STD -# include - using namespace std; -#else -# include -#endif +\begin{cxxlisting} +class Object{ + CORBA::Boolean _is_a(const char* type_id); +}; +\end{cxxlisting} +The \op{\_is\_a} operation is part of the \intf{CORBA::Object} +interface and must be implemented by every object. The input argument +is a RepoId. The function returns \code{true} if the object is really +an instance of that type, including if that type is a base type of the +most derived type of that object. -static void invokeOp(anyExample_ptr& tobj, const CORBA::Any& a) -{ - CORBA::Any_var bp; +In the situation above, the ORB would invoke the \op{\_is\_a} +operation on the object and ask if the object is of type A +\emph{before} it processes any application invocation on the object. - cout << "Invoking operation." << endl; - bp = tobj->testOp(a); +Notice that the \op{\_is\_a} call is \emph{not} performed when the IOR +is unmarshalled. It is performed just prior to the first application +invocation on the object. This leads to some interesting failure modes +if B reports that it is not an A. Consider the following example: - cout << "Operation completed. Returned Any: "; - CORBA::ULong ul; +\begin{idllisting} +// IDL +interface A { ... }; +interface B : A { ... }; +interface D { ... }; +interface C { + A op1(); + Object op2(); +}; +\end{idllisting} - if (bp >>= ul) { - cout << "ULong: " << ul << "\n" << endl; - } - else { - cout << "Unknown value." << "\n" << endl; - } -} +\lstset{numbers=left,gobble=4} +\begin{cxxlisting} + 1 // C++ + 2 C_ptr objC; + 3 A_ptr objA; + 4 CORBA::Object_ptr objR; + 5 + 6 objA = objC->op1(); + 7 (void) objA->_non_existent(); + 8 + 9 objR = objC->op2(); +10 objA = A::_narrow(objR); +\end{cxxlisting} +\lstset{numbers=none,gobble=0} +\noindent If the stubs of A,B,C,D are linked into the executable and: -static void hello(anyExample_ptr tobj) -{ - CORBA::Any a; +\begin{description} +\item[Case 1] \op{C::op1} and \op{C::op2} return a B. Lines 6--10 +complete successfully. The remote object is only contacted at line 7. - // Sending Long - CORBA::Long l = 100; - a <<= l; - cout << "Sending Any containing Long: " << l << endl; - invokeOp(tobj,a); - - // Sending Double -#ifndef NO_FLOAT - CORBA::Double d = 1.2345; - a <<= d; - cout << "Sending Any containing Double: " << d << endl; - invokeOp(tobj,a); -#endif - - // Sending String - const char* str = "Hello"; - a <<= str; - cout << "Sending Any containing String: " << str << endl; - invokeOp(tobj,a); - - // Sending testStruct [Struct defined in IDL] - testStruct t; - t.l = 456; - t.s = 8; - a <<= t; - cout << "Sending Any containing testStruct: l: " << t.l << endl; - cout << " s: " << t.s << endl; - invokeOp(tobj,a); -} +\item[Case 2] \op{C::op1} and \op{C::op2} return a D. This condition +only occurs if the runtime of the remote end is buggy. Even though the +IDL definitions show that D is not derived from A, omniORB gives it +the benefit of the doubt, in case it actually has a more derived +interface that is derived from both A and D. At line 7, the object is +contacted to ask if it is an A. The answer is no, so a +\code{CORBA::INV\_OBJREF} exception is raised. At line 10, the narrow +operation will fail, and objA will be set to nil. +\end{description} -////////////////////////////////////////////////////////////////////// +\noindent If only the stubs of A are linked into the executable and: + +\begin{description} +\item[Case 1] \op{C::op1} and \op{C::op2} return a B. Lines 6--10 +complete successfully. When lines 7 and 10 are executed, the object is +contacted to ask if it is an A. + +\item[Case 2] \op{C::op1} and \op{C::op2} return a D. This condition +only occurs if the runtime of the remote end is buggy. Line 6 +completes and no exception is raised. At line 7, the object is +contacted to ask if it is an A. If the answer is no, a +\code{CORBA::INV\_OBJREF} exception is raised. At line 10, the narrow +operation will fail, and objA will be set to nil. +\end{description} -int main(int argc, char** argv) -{ - try { - CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - if( argc != 2 ) { - cerr << "usage: anyExample_clt " << endl; - return 1; - } - - { - CORBA::Object_var obj = orb->string_to_object(argv[1]); - anyExample_var ref = anyExample::_narrow(obj); - if( CORBA::is_nil(ref) ) { - cerr << "Can't narrow reference to type anyExample (or it was nil)." - << endl; - return 1; - } - hello(ref); - } - orb->destroy(); - } - catch(CORBA::TRANSIENT&) { - cerr << "Caught system exception TRANSIENT -- unable to contact the " - << "server." << endl; - } - catch(CORBA::SystemException& ex) { - cerr << "Caught a CORBA::" << ex._name() << endl; - } - catch(CORBA::Exception& ex) { - cerr << "Caught CORBA::Exception: " << ex._name() << endl; - } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } - return 0; -} -\end{cxxlisting} @@ -6046,488 +6017,162 @@ To (statically) link with a DLL file in Windows, you link with a LIB file which references the symbols exported from the DLL. To build the LIB and DLL files, the correct symbols must be exported. One way to do -that is to decorate the source code with magic tags that tell the -compiler to export the symbols. The alternative is to provide a DEF -file that lists all the symbols to be exported. omniORB uses a DEF -file. - -The question is, how do you create the DEF file? The answer is to use -a Python script named \cmdline{makedeffile.py} that lives in the -\file{bin\scripts} directory in the omniORB distribution. -\cmdline{makedeffile.py} runs the dumpbin program that comes with -Visual C++, and processes its output to extract the necessary symbols. -Although it is designed for exporting the symbols from omniORB stub -files, it can actually be used for arbitrary C++ code. To use it to -create a DLL from a single source file, use the following steps: - -\begin{enumerate} -\item Compile the source: - - \cmdline{cl -c -O2 -MD -GX -Fofoo.o -Tpfoo.cc} - -\item Build a static library (It probably won't work on its own due to - the -MD switch to cl, but we just need it to get the symbols - out): - - \cmdline{lib -out:foo\_static.lib foo.o} - -\item Use the script to build a .def file: - - \cmdline{makedeffile.py foo\_static.lib foo 1.0 foo.def} - -\item Build the .dll and .lib with the def file. - - \cmdline{link -out:foo.dll -dll -def:foo.def -implib:foo.lib foo.o} -\end{enumerate} - -Of course, you can link together many separate C++ files, rather than -just the one shown here. - - -\subsection{Importing constant symbols} - -As if exporting the symbols from a DLL was not complicated enough, any -constant values exported by a DLL have to be explicitly -\emph{imported} into the code using them. omniORB's stub files declare -a number of such constants. This time, the constant declarations in -the generated header files are decorated in a way that tells the -compiler what to do. When the stub headers are \#included, the correct -pre-processor defines must be set. If things are not set correctly, -the code all links without problems, but then mysteriously blows up at -run time. - -Depending on how complex your situation is, there are a range of -solutions. Starting with the simplest, here are some scenarios you may -find yourself in: - -\begin{enumerate} - -\item All stub code, and all code that uses it is wrapped up in a - single DLL. - - Do nothing special. - -\item All stub code is in a single DLL. Code using it is in another - DLL, or not in a DLL at all. - - \code{\#define USE\_stub\_in\_nt\_dll} before \code{\#include} of - the stub headers. - -\item The stubs for each IDL file are in separate DLLs, one DLL per - IDL file. - - In this case, if the IDL files \code{\#include} each other, when - the stub files are compiled, import declarations are needed so - that references between the separate DLLs work. To do this, - first compile the IDL files with the \cmdline{-Wbdll\_stubs} - flag: - - \cmdline{omniidl -bcxx -Wbdll\_stubs example.idl} - - Then define the \code{INCLUDED\_stub\_in\_nt\_dll} pre-processor - symbol when compiling the stub files. As above, define - \code{USE\_stub\_in\_nt\_dll} when including the stub headers - into application code. - -\item Stubs and application code are packaged into multiple DLLs, but - DLLs contain the stubs for more than one IDL file. - - This situation is handled by `annotating' the IDL files to - indicate which DLLs they will be compiled into. The annotation - takes the form of some \code{\#ifdefs} to be inserted in the - stub headers. For example, - -\begin{idllisting} -// one.idl - -#pragma hh #ifndef COMPILING_FIRST_DLL -#pragma hh # ifndef USE_stub_in_nt_dll -#pragma hh # define USE_stub_in_nt_dll -#pragma hh # endif -#pragma hh #endif - -#include - -module ModuleOne { - ... -}; - - -// two.idl - -#pragma hh #ifndef COMPILING_SECOND_DLL -#pragma hh # ifndef USE_stub_in_nt_dll -#pragma hh # define USE_stub_in_nt_dll -#pragma hh # endif -#pragma hh #endif - -#include -... -\end{idllisting} - - Here, \file{one.idl} is packaged into \file{first.dll} and - \file{two.idl} is in \file{second.dll}. When compiling - \file{first.dll}, the \code{COMPILING\_FIRST\_DLL} define is - set, meaning definitions from \file{one.idl} (and any other - files in that DLL) are not imported. Any other module that - includes the stub header for \file{one.idl} does not define - \code{COMPILING\_FIRST\_DLL}, and thus imports the necessary - symbols from the DLL. - - Rather than explicitly listing all the pre-processor code, it - can be cleaner to use a C++ header file for each DLL. See the - COS services IDL files in \file{idl/COS} for an example. - -\end{enumerate} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\chapter[Objects by value, etc.] - {Objects by value, abstract interfaces and local interfaces} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\label{chap:valuetype} - -omniORB 4.1 supports objects by value, declared with the -\code{valuetype} keyword in IDL, and both abstract and local -interfaces. This chapter outlines some issues to do with using these -types in omniORB. You are assumed to have read the relevant parts of -the CORBA specification, specifically chapters 3, 4, 5 and 6 of the -CORBA 2.6 specification, and sections 1.17, 1.18 and 1.35 of the C++ -mapping specification, version 1.1. - - -\section{Features} - -omniORB supports the complete objects by value specification, with the -exception of custom valuetypes. All other valuetype features including -value boxes, value sharing semantics, abstract valuetypes, and -abstract interfaces are supported. Local interfaces are supported, -with a number of caveats outlined in -section~\ref{sec:LocalInterfaces}. - - -\section{Reference counting} - -Values are reference counted. This means that, as long as your -application properly manages reference counts, values are usually -automatically deleted when they are no longer required. However, one -of the features of valuetypes is that they support the representation -of cyclic graph structures. In that kind of situation, the reference -counting garbage collection does not work, because references internal -to the graph prevent the reference counts ever becoming zero. - -To avoid memory leaks, application code must explicitly break any -reference cycles in values it manipulates. This includes graphs of -values received as parameters and return values from CORBA operations. - - -\section{Value sharing and local calls} - -When valuetypes are passed as parameters in CORBA calls (i.e.\ calls -on CORBA objects declared with \code{interface} in IDL), the structure -of related values is maintained. Consider, for example, the following -IDL definitions (which are from the example code in -\file{src/examples/valuetype/simple}: - -\begin{idllisting} -module ValueTest { - valuetype One { - public string s; - public long l; - }; - - interface Test { - One op1(in One a, in One b); - }; -}; -\end{idllisting} - -If the client to the \type{Test} object passes the same value in both -parameters, just one value is transmitted, and the object -implementation receives a copy of the single value, with references to -it in both parameters. - -In the case that the object is remote from the client, there is -obviously a copying step involved. In the case that the object is in -the same address space as the client, the same copying semantics must -be maintained so that the object implementation can modify the values -it receives without the client seeing the modifications. To support -that, omniORB must copy the entire parameter list in one operation, in -case there is sharing between different parameters. Such copying is a -rather more time-consuming process than the parameter-by-parameter -copy that takes place in calls not involving valuetypes. - -To avoid the overhead of copying parameters in this way, applications -can choose to relax the semantics of value copying in local calls, so -values are not copied at all, but are passed by reference. In that -case, the client to a call \emph{will} see any modifications to the -values it passes as parameters (and similarly, the object -implementation will see any changes the client makes to returned -values). To choose this option, set the \code{copyValuesInLocalCalls} -configuration parameter to zero. - - -\section{Value box factories} - -With normal valuetypes, omniidl generates factory classes (with names -ending \code{\_init}) as required by the C++ mapping specification. -The application is responsible for registering the factories with the -ORB. - -Unfortunately, the C++ mapping makes no mention of factories for value -boxes. In omniORB, factories for value boxes are automatically -registered with the ORB, and there are no application-visible factory -classes generated for them. Some other CORBA implementations generate -application visible factories, and the application \emph{does} have to -register the factories with the ORB. - - -\section{Standard value boxes} - -The standard \type{CORBA::StringValue} and \type{CORBA::WStringValue} -value boxes are available to application code. To make the definitions -available in IDL, \#include the standard \file{orb.idl}. - - -\section{Covariant returns} - -As required by the C++ mapping, on C++ compilers that support -covariant return types, omniidl generates code for the -\op{\_copy\_value} function that returns the most derived type of the -value. On older compilers, \op{\_copy\_value} returns -\type{CORBA::ValueBase}. - -If you write code that calls \op{\_copy\_value}, and you need to -support older compilers, you should assign the result to a variable of -type \type{CORBA::ValueBase*} and downcast to the target type, rather -than using the covariant return. +that is to decorate the source code with magic tags that tell the +compiler to export the symbols. The alternative is to provide a DEF +file that lists all the symbols to be exported. omniORB uses a DEF +file. -If you are overriding \op{\_copy\_value}, you must correctly take -account of the \code{OMNI\_HAVE\_COVARIANT\_RETURNS} preprocessor -definition. +The question is, how do you create the DEF file? The answer is to use +a Python script named \cmdline{makedeffile.py} that lives in the +\file{bin\scripts} directory in the omniORB distribution. +\cmdline{makedeffile.py} runs the dumpbin program that comes with +Visual C++, and processes its output to extract the necessary symbols. +Although it is designed for exporting the symbols from omniORB stub +files, it can actually be used for arbitrary C++ code. To use it to +create a DLL from a single source file, use the following steps: +\begin{enumerate} +\item Compile the source: + \cmdline{cl -c -O2 -MD -GX -Fofoo.o -Tpfoo.cc} -\section{Values inside Anys} +\item Build a static library (It probably won't work on its own due to + the -MD switch to cl, but we just need it to get the symbols + out): -Valuetypes inserted into Anys cause a number of interesting issues. -Even when inside Anys, values are required to support complete sharing -semantics. Take this IDL for example: + \cmdline{lib -out:foo\_static.lib foo.o} -\begin{idllisting} -module ValueTest { - valuetype One { - public string s; - public long l; - }; +\item Use the script to build a .def file: - interface AnyTest { - void op1(in One v, in Any a); - }; -}; -\end{idllisting} + \cmdline{makedeffile.py foo\_static.lib foo 1.0 foo.def} -\noindent Now, suppose the client behaves as follows: +\item Build the .dll and .lib with the def file. -\begin{cxxlisting} -ValueTest::One* v = new One_impl("hello", 123); -CORBA::Any a; -a <<= v; -obj->op1(v, a); -\end{cxxlisting} + \cmdline{link -out:foo.dll -dll -def:foo.def -implib:foo.lib foo.o} +\end{enumerate} -\noindent then on the server side: +Of course, you can link together many separate C++ files, rather than +just the one shown here. -\begin{cxxlisting} -void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a) -{ - ValueTest::One* v2; - a >>= v2; - assert(v2 == v); -} -\end{cxxlisting} -\noindent -This is all very well in this kind of simple situation, but problems -can arise if truncatable valuetypes are used. Imagine this derived -value: +\subsection{Importing constant symbols} -\begin{idllisting} -module ValueTest { - valuetype Two : truncatable One { - public double d; - }; -}; -\end{idllisting} +As if exporting the symbols from a DLL was not complicated enough, any +constant values exported by a DLL have to be explicitly +\emph{imported} into the code using them. omniORB's stub files declare +a number of such constants. This time, the constant declarations in +the generated header files are decorated in a way that tells the +compiler what to do. When the stub headers are \#included, the correct +pre-processor defines must be set. If things are not set correctly, +the code all links without problems, but then mysteriously blows up at +run time. -\noindent -Now, suppose that the client shown above sends an instance of -valuetype \type{Two} in both parameters, and suppose that the server -has not seen the definition of valuetype \type{Two}. In this -situation, as the first parameter is unmarshalled, it will be -truncated to valuetype \type{One}, as required. Now, when the Any is -unmarshalled, it refers to the same value, which has been truncated. -So, even though the TypeCode in the Any indicates that the value has -type \type{Two}, the stored value actually has type \type{One}. If the -receiver of the Any tries to pass it on, transmission will fail -because the Any's value does not match its TypeCode. +Depending on how complex your situation is, there are a range of +solutions. Starting with the simplest, here are some scenarios you may +find yourself in: -In the opposite situation, where an Any parameter comes before a -valuetype parameter, a different problem occurs. In that case, as the -Any is unmarshalled, there is no type information available for -valuetype \type{Two}, so the value inside the Any has an internal -omniORB type used for unknown valuetypes. As the next parameter is -unmarshalled, omniORB sees that the shared value is unknown, and is -able to convert it to the target \type{One} valuetype with -truncation. In this case, the Any and the plain valuetype both have -the correct types and values, but the fact that both should have -referred to the same value has been lost. +\begin{enumerate} -Because of these issues, it is best to avoid defining interfaces that -mix valuetypes and Anys in a single operation, and certainly to avoid -trying to share plain values with values inside Anys. +\item All stub code, and all code that uses it is wrapped up in a + single DLL. + Do nothing special. -\subsection{Values inside DynAnys} +\item All stub code is in a single DLL. Code using it is in another + DLL, or not in a DLL at all. -The sharing semantics of valuetypes can also cause difficulties for -DynAny. The CORBA 2.6 specification does not mention how shared values -inside DynAnys should be handled; the CORBA 3.x specification slightly -clarifies the situation, but it is still unclear. To write portable -code it is best to avoid manipulating DynAnys containing values that -are shared. + \code{\#define USE\_stub\_in\_nt\_dll} before \code{\#include} of + the stub headers. -In omniORB, when a value inside an Any is converted into a DynAny, the -value's state is copied into the DynAny, and manipulated there. When -converting back to an Any a new value is created. This means that any -other references to the original value (whether themselves inside Anys -of not) still relate to the original value, with unchanged state. -However, this copying only occurs when a DynValue is actually created, -so for example a structure with two value members referring to the -same value can manipulated inside a DynAny without breaking the -sharing, provided the value members are not accessed as DynAnys. -Extracting the value members as ValueBase will reveal the sharing, for -example. +\item The stubs for each IDL file are in separate DLLs, one DLL per + IDL file. + In this case, if the IDL files \code{\#include} each other, then + when the stub files are compiled, import declarations are needed + so that references between the separate DLLs work. To do this, + first compile the IDL files with the \cmdline{-Wbdll\_stubs} + flag: -\section{Local Interfaces} -\label{sec:LocalInterfaces} + \cmdline{omniidl -bcxx -Wbdll\_stubs example.idl} -Local interfaces are somewhat under-specified in the C++ mapping. This -section outlines the way local interfaces are supported in omniORB, -and details the limitations and issues. + Then define the \code{INCLUDED\_stub\_in\_nt\_dll} pre-processor + symbol when compiling the stub files. As above, define + \code{USE\_stub\_in\_nt\_dll} when including the stub headers + into application code. -\subsection{Simple local interfaces} +\item Stubs and application code are packaged into multiple DLLs, but + DLLs contain the stubs for more than one IDL file. -With simple IDL, there are no particular issues: + This situation is handled by `annotating' the IDL files to + indicate which DLLs they will be compiled into. The annotation + takes the form of some \code{\#ifdefs} to be inserted in the + stub headers. For example, \begin{idllisting} -module Test { - local interface Example { - string hello(in string arg); - }; -}; -\end{idllisting} +// one.idl -The IDL compiler generates an abstract base class -\type{Test::Example}. The application defines a class derived from it -that implements the abstract \op{hello} member function. Instances of -that class can then be used where the IDL specifies interface -\type{Example}. +#pragma hh #ifndef COMPILING_FIRST_DLL +#pragma hh # ifndef USE_stub_in_nt_dll +#pragma hh # define USE_stub_in_nt_dll +#pragma hh # endif +#pragma hh #endif -Note that, by default, local interface implementations have no -reference counting behaviour. If the local object should be deleted -when the last reference is released, the application must implement -the \op{\_add\_ref} and \op{\_remove\_ref} virtual member functions -within the implementation class. Make sure that the implementations -are thread safe. +#include +module ModuleOne { + ... +}; -\subsection{Inheritance from unconstrained interfaces} -Local interfaces can inherit from unconstrained (i.e.\ non-local) -interfaces: +// two.idl -\begin{idllisting} -module Test { - interface One { - void problem(inout string arg); - }; - local interface Two : One { - }; +#pragma hh #ifndef COMPILING_SECOND_DLL +#pragma hh # ifndef USE_stub_in_nt_dll +#pragma hh # define USE_stub_in_nt_dll +#pragma hh # endif +#pragma hh #endif - interface Receiver { - void setOne(in One a); - }; -}; +#include +... \end{idllisting} -IDL like this leads to two issues to do with omniORB's C++ mapping -implementation. + Here, \file{one.idl} is packaged into \file{first.dll} and + \file{two.idl} is in \file{second.dll}. When compiling + \file{first.dll}, the \code{COMPILING\_FIRST\_DLL} define is + set, meaning definitions from \file{one.idl} (and any other + files in that DLL) are not imported. Any other module that + includes the stub header for \file{one.idl} does not define + \code{COMPILING\_FIRST\_DLL}, and thus imports the necessary + symbols from the DLL. -First, an instance of local interface \type{Two} should be suitable to -pass as the argument to the \op{setOne} method of a \type{Receiver} -object (as long as the object is in the same address space as the -caller). Therefore, the \type{Two} abstract base class has to inherit -from the internal class omniORB uses to map object references of type -\type{One}. For performance reasons, the class that implements -\type{One} object references normally has non-virtual member -functions. That means that the application-supplied \op{problem} -member function for the implementation of local interface \type{Two} -will not override the base class's version. To overcome this, the IDL -for the base unconstrained interface must be compiled with the --Wbvirtual\_objref switch to omniidl. That makes the member functions -of the mapping of \type{One} into virtual functions, so they can be -overridden. + Rather than explicitly listing all the pre-processor code, it + can be cleaner to use a C++ header file for each DLL. See the + COS services IDL files in \file{idl/COS} for an example. -The second problem is that, in some cases, omniORB uses a different -mapping for object reference member functions than the mapping used in -servant classes. For example, in the \op{problem} operation, it uses -an internal type for the inout string argument that avoids memory -issues if the application uses a String\_var in the argument. This -means that the abstract member function declared in the \type{Two} -class (and implemented by the application) has a different signature -to the member function in the base class. The application-supplied -class will therefore not properly override the base class method. In -all likelihood, the C++ compiler will also complain that the two -member functions are ambiguous. The solution to this problem is to use -the implementation mapping in the base object reference class, rather -than the normal object reference mapping, using the -Wbimpl\_mapping -switch to omniidl. The consequence of this is that some uses of \_var -types for inout arguments that are normally acceptable in omniORB now -lead to memory problems. +\end{enumerate} -In summary, to use local interfaces derived from normal unconstrained -interfaces, you should compile all your IDL with the omniidl flags: -\begin{quote} -\cmdline{-Wbvirtual\_objref -Wbimpl\_mapping} -\end{quote} +\chapter{Resources} -\subsection{Valuetypes supporting local interfaces} +There are a number of useful online resources related to omniORB: -According to the IDL specification, it should be possible to declare a -valuetype that supports a local interface: +\begin{itemize} -\begin{idllisting} -local interface I { - void my_operation(); -}; -valuetype V supports I { - public string s; -}; -\end{idllisting} +\item \url{http://omniorb.sourceforge.net/} is the main omniORB web + site. -omniidl accepts the IDL, but unfortunately the resulting C++ code does -not compile. The C++ mapping specification has a problem in that both -the \type{CORBA::\dsc{}LocalObject} and \type{CORBA::ValueBase} -classes have \op{add\_ref} and \op{remove\_\dsc{}ref} member functions -defined. The classes generated for the valuetype inherit from both -these base classes, and therefore have an ambiguity. Until the C++ -mapping resolves this conflict, valuetypes supporting local interfaces -cannot be used in omniORB. +\item The omniORB FAQ is at \url{http://omniorb.sourceforge.net/faq.html} + +\item The omniORB mailing list is the first port of call for questions + that are not answered in this document or in the FAQ. Subscription + information and archives are at + \url{http://omniorb.sourceforge.net/list.html} +\item Commercial support is available from + \url{http://www.omniorb-support.com/} + +\end{itemize} \backmatter diff -Nru omniorb-dfsg-4.1.6/doc/tex/omniURLDefs.hva omniorb-dfsg-4.2.2/doc/tex/omniURLDefs.hva --- omniorb-dfsg-4.1.6/doc/tex/omniURLDefs.hva 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/omniURLDefs.hva 2017-05-10 23:52:28.000000000 +0000 @@ -0,0 +1,10 @@ +\usepackage[T1]{url} +\newcommand{\email}{\begingroup \urlstyle{sf}\Url} +\newcommand{\file}{\begingroup \urlstyle{tt}\Url} +\newcommand{\envvar}{\begingroup \urlstyle{tt}\Url} +\newcommand{\makevar}{\begingroup \urlstyle{tt}\Url} +\newcommand{\corbauri}{\begingroup \urlstyle{tt}\Url} +\def\weburl{\begingroup% +\def\UrlLeft##1\UrlRight{\ahrefurl{##1}}% +\urlstyle{tt}% +\Url} diff -Nru omniorb-dfsg-4.1.6/doc/tex/omniURLDefs.sty omniorb-dfsg-4.2.2/doc/tex/omniURLDefs.sty --- omniorb-dfsg-4.1.6/doc/tex/omniURLDefs.sty 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/doc/tex/omniURLDefs.sty 2017-05-10 23:52:28.000000000 +0000 @@ -0,0 +1,7 @@ +\usepackage[T1]{url} +\newcommand{\email}{\begingroup \urlstyle{sf}\Url} +\newcommand{\file}{\begingroup \urlstyle{tt}\Url} +\newcommand{\envvar}{\begingroup \urlstyle{tt}\Url} +\newcommand{\makevar}{\begingroup \urlstyle{tt}\Url} +\newcommand{\corbauri}{\begingroup \urlstyle{tt}\Url} +\newcommand{\weburl}{\begingroup \urlstyle{sf}\Url} diff -Nru omniorb-dfsg-4.1.6/etc/init.d/omniNames.in omniorb-dfsg-4.2.2/etc/init.d/omniNames.in --- omniorb-dfsg-4.1.6/etc/init.d/omniNames.in 2005-03-02 12:39:41.000000000 +0000 +++ omniorb-dfsg-4.2.2/etc/init.d/omniNames.in 2017-02-15 23:32:52.000000000 +0000 @@ -14,14 +14,15 @@ # Modified: Duncan Grisby # - Put omniNames files under /var/omniNames, since they are not log files + # Standard functions . /etc/rc.d/init.d/functions # Program options -GENIOR=@prefix@/bin/genior OMNINAMES=@prefix@/bin/omniNames OMNINAMES_DIR=/var/omniNames -OMNIMAPPER_DIR=/var/lib/omniMapper +OMNINAMES_LOG_DIR=/var/log/omniNames +OMNINAMES_DEBUG_LOG=$OMNINAMES_LOG_DIR/omniNames.log # Make sure libraries are found if we're installed in a non-standard location prefix=@prefix@ @@ -31,85 +32,75 @@ # Registered port number for CORBA naming service is 2809. # Should be preferred but may conflict with other ORBs running concurrently. TCPPORT=2809 +OPTIONS="-always -nohostname" if [ -f /etc/sysconfig/omniNames ];then - . /etc/sysconfig/omniNames + . /etc/sysconfig/omniNames fi case "$1" in start) - # Make sure directories exist - [ -d $OMNINAMES_DIR ] || mkdir -p $OMNINAMES_DIR - [ -d $OMNIMAPPER_DIR ] || mkdir -p $OMNIMAPPER_DIR - - if [ -x $OMNINAMES ]; then - echo -n "Starting omniNames" - - if [ ! -z "`pidofproc omniNames`" ]; then - echo " impossible: already running (pid `pidofproc omniNames`)" - else - OMNINAMES_OPTIONS="-errlog $OMNINAMES_DIR/error.log -logdir $OMNINAMES_DIR" - - if [ ! -f $OMNINAMES_DIR/omninames-*.log ]; then - OMNINAMES_OPTIONS="$OMNINAMES_OPTIONS -start $TCPPORT" - - echo -n " for the first time" - fi - - # Run it - su omni -c "$OMNINAMES $OMNINAMES_OPTIONS" &> /dev/null & - OMNINAMES_PID=$! - - # Sleep a while, and then check if omniNames is still running - sleep 2 - - if [ ! -z "`pidofproc omniNames`" ]; then - success "Starting omniNames" - echo $OMNINAMES_PID > /var/run/omniNames.pid - - $GENIOR IDL:omg.org/CosNaming/NamingContextExt:1.0 `hostname` $TCPPORT NameService > $OMNIMAPPER_DIR/NameService - else - failure "Starting omniNames" - - rm -f $OMNIMAPPER_DIR/NameService - rm -f /var/run/omniNames.pid - fi - - echo - fi - fi - - if [ ! -z "`pidofproc omniNames`" ]; then - touch /var/lock/subsys/omniNames - fi - ;; + # Make sure directories exist + [ -d $OMNINAMES_DIR ] || (mkdir -p $OMNINAMES_DIR; chown omni:omni $OMNINAMES_DIR) + [ -d $OMNINAMES_LOG_DIR ] || (mkdir -p $OMNINAMES_LOG_DIR; chown omni:omni $OMNINAMES_LOG_DIR) + + if [ -x $OMNINAMES ]; then + echo -n "Starting omniNames" + + if [ ! -z "`pidofproc omniNames`" ]; then + echo ": already running (pid `pidofproc omniNames`)" + else + OMNINAMES_OPTIONS="-errlog $OMNINAMES_DEBUG_LOG -logdir $OMNINAMES_DIR -start $TCPPORT $OPTIONS" + + # Run it + OMNINAMES_PID=$(su - omni -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH $OMNINAMES $OMNINAMES_OPTIONS &> /dev/null & echo \$!") + + # Sleep a while, and then check if omniNames is still running + sleep 2 + + if [ ! -z "`pidofproc omniNames`" ]; then + success "Starting omniNames" + echo $OMNINAMES_PID > /var/run/omniNames.pid + else + failure "Starting omniNames" + rm -f /var/run/omniNames.pid + fi + + echo + fi + fi + + if [ ! -z "`pidofproc omniNames`" ]; then + touch /var/lock/subsys/omniNames + fi + ;; stop) - echo -n "Stopping omniNames" - killproc omniNames - echo - - rm -f $OMNIMAPPER_DIR/NameService - - while [ -n "`pidofproc omniNames`" ]; do - sleep 1 - done - - rm -f /var/lock/subsys/omniNames - ;; + echo -n "Stopping omniNames" + killproc omniNames + echo + + while [ -n "`pidofproc omniNames`" ]; do + sleep 1 + done + + rm -f /var/lock/subsys/omniNames + rm -f /var/run/omniNames.pid + ;; restart) - $0 stop - $0 start - ;; + $0 stop + $0 start + ;; status) - status omniNames - ;; + status omniNames + exit $? + ;; *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 + echo "Usage: $0 {start|stop|restart|status}" + exit 1 esac exit 0 diff -Nru omniorb-dfsg-4.1.6/etc/init.d/omniNames.SuSE.in omniorb-dfsg-4.2.2/etc/init.d/omniNames.SuSE.in --- omniorb-dfsg-4.1.6/etc/init.d/omniNames.SuSE.in 2008-12-12 12:13:19.000000000 +0000 +++ omniorb-dfsg-4.2.2/etc/init.d/omniNames.SuSE.in 2012-12-31 14:57:16.000000000 +0000 @@ -53,8 +53,8 @@ case "$1" in start) # Make sure directories exist - [ -d $OMNINAMES_DIR ] || mkdir -p $OMNINAMES_DIR - [ -d $OMNIMAPPER_DIR ] || mkdir -p $OMNIMAPPER_DIR + [ -d $OMNINAMES_DIR ] || (mkdir -p $OMNINAMES_DIR; chown omni:omni $OMNINAMES_DIR) + [ -d $OMNIMAPPER_DIR ] || (mkdir -p $OMNIMAPPER_DIR; chown omni:omni $OMNIMAPPER_DIR) echo -n "Starting omniNames" OMNINAMES_OPTIONS="-errlog $OMNINAMES_DIR/error.log -logdir $OMNINAMES_DIR" diff -Nru omniorb-dfsg-4.1.6/idl/compression.idl omniorb-dfsg-4.2.2/idl/compression.idl --- omniorb-dfsg-4.1.6/idl/compression.idl 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/compression.idl 2012-12-31 14:57:16.000000000 +0000 @@ -0,0 +1,94 @@ +// compression.idl +// +// Compression definitions for ZIOP. From the ZIOP 1.0 specification. +// +// http://www.omg.org/spec/ZIOP/ + +#ifndef _omniorb_compression_idl_ +#define _omniorb_compression_idl_ + +#include + +#pragma prefix "omg.org" + +module Compression { + exception CompressionException { + long reason; + string description; + }; + exception FactoryAlreadyRegistered { }; + exception UnknownCompressorId { }; + + typedef unsigned short CompressorId; + + const CompressorId COMPRESSORID_NONE = 0; + const CompressorId COMPRESSORID_GZIP = 1; + const CompressorId COMPRESSORID_PKZIP = 2; + const CompressorId COMPRESSORID_BZIP2 = 3; + const CompressorId COMPRESSORID_ZLIB = 4; + const CompressorId COMPRESSORID_LZMA = 5; + const CompressorId COMPRESSORID_LZO = 6; + const CompressorId COMPRESSORID_RZIP = 7; + const CompressorId COMPRESSORID_7X = 8; + const CompressorId COMPRESSORID_XAR = 9; + + typedef unsigned short CompressionLevel; + typedef float CompressionRatio; + + struct CompressorIdLevel { + CompressorId compressor_id; + CompressionLevel compression_level; + }; + + typedef sequence CompressorIdLevelList; + + typedef CORBA::OctetSeq Buffer; + + local interface CompressorFactory; + + local interface Compressor { + + void compress(in Buffer source, + inout Buffer target) + raises (CompressionException); + + void decompress(in Buffer source, + inout Buffer target) + raises (CompressionException); + + readonly attribute CompressorFactory compressor_factory; + readonly attribute CompressionLevel compression_level; + readonly attribute unsigned long long compressed_bytes; + readonly attribute unsigned long long uncompressed_bytes; + readonly attribute CompressionRatio compression_ratio; + }; + + typedef sequence CompressorSeq; // omniORB extension + + local interface CompressorFactory { + readonly attribute CompressorId compressor_id; + Compressor get_compressor(in CompressionLevel compression_level); + }; + + typedef sequence CompressorFactorySeq; + + local interface CompressionManager { + void register_factory(in CompressorFactory compressor_factory) + raises (FactoryAlreadyRegistered); + + void unregister_factory(in CompressorId compressor_id) + raises (UnknownCompressorId); + + CompressorFactory get_factory(in CompressorId compressor_id) + raises (UnknownCompressorId); + + Compressor get_compressor(in CompressorId compressor_id, + in CompressionLevel compression_level) + raises (UnknownCompressorId); + + CompressorFactorySeq get_factories(); + }; +}; + + +#endif // _omniorb_compression_idl_ diff -Nru omniorb-dfsg-4.1.6/idl/GNUmakefile.in omniorb-dfsg-4.2.2/idl/GNUmakefile.in --- omniorb-dfsg-4.1.6/idl/GNUmakefile.in 2005-01-17 14:33:25.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/GNUmakefile.in 2012-12-31 14:57:16.000000000 +0000 @@ -7,7 +7,8 @@ INSTALLDIR = $(INSTALLIDLDIR)/omniORB FILES = Naming.idl bootstrap.idl corbaidl.idl echo.idl ir.idl orb.idl \ - poa.idl poa_include.idl boxes.idl + poa.idl poa_include.idl boxes.idl pollable.idl \ + messaging.idl messaging_policy.idl ziop.idl compression.idl SUBDIRS = COS diff -Nru omniorb-dfsg-4.1.6/idl/messaging.idl omniorb-dfsg-4.2.2/idl/messaging.idl --- omniorb-dfsg-4.1.6/idl/messaging.idl 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/messaging.idl 2012-12-31 14:57:16.000000000 +0000 @@ -0,0 +1,56 @@ +// messaging.idl +// +// A subset of the standard Messaging module with AMI definitions. + +#ifndef _omniorb_messaging_idl_ +#define _omniorb_messaging_idl_ + +#include "corbaidl.idl" +#include "pollable.idl" + +#pragma prefix "omg.org" + +module Messaging { + + // + // Base ReplyHandler + + interface ReplyHandler {}; + + + // + // Standard Poller valuetype + + abstract valuetype Poller : CORBA::Pollable { + readonly attribute Object operation_target; + readonly attribute string operation_name; + attribute ReplyHandler associated_handler; + readonly attribute boolean is_from_poller; + }; + + + // + // Subset of ExceptionHolder valuetype. + // Commented-out parts are from the standard, but not implemented here. + + /* + typedef CORBA::OctetSeq MarshaledException; + native UserExceptionBase; + */ + + valuetype ExceptionHolder { + void raise_exception() /* raises (UserExceptionBase) */; + + /* + void raise_exception_with_list(in CORBA::ExceptionList exc_list) + raises (UserExceptionBase); + + private boolean is_system_exception; + private boolean byte_order; + private MarshaledException marshaled_exception; + */ + }; + +}; + +#endif // _omniorb_messaging_idl_ diff -Nru omniorb-dfsg-4.1.6/idl/messaging_policy.idl omniorb-dfsg-4.2.2/idl/messaging_policy.idl --- omniorb-dfsg-4.1.6/idl/messaging_policy.idl 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/messaging_policy.idl 2012-12-31 14:57:16.000000000 +0000 @@ -0,0 +1,25 @@ +// messaging_policy.idl +// +// A subset of the standard Messaging module with policy-related definitions. + +#ifndef _omniorb_messaging_policy_idl_ +#define _omniorb_messaging_policy_idl_ + +#include "corbaidl.idl" + +#pragma prefix "omg.org" + +module Messaging { + + typedef CORBA::OctetSeq PolicyData; + + struct PolicyValue { + unsigned long ptype; // really CORBA::PolicyType + PolicyData pvalue; + }; + typedef sequence PolicyValueSeq; + +}; + + +#endif // _omniorb_messaging_policy_idl_ diff -Nru omniorb-dfsg-4.1.6/idl/omniConnectionData.idl omniorb-dfsg-4.2.2/idl/omniConnectionData.idl --- omniorb-dfsg-4.1.6/idl/omniConnectionData.idl 2006-07-18 16:21:26.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/omniConnectionData.idl 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/idl/omniTypedefs.idl omniorb-dfsg-4.2.2/idl/omniTypedefs.idl --- omniorb-dfsg-4.1.6/idl/omniTypedefs.idl 2006-07-18 16:21:26.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/omniTypedefs.idl 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/idl/poa.idl omniorb-dfsg-4.2.2/idl/poa.idl --- omniorb-dfsg-4.1.6/idl/poa.idl 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/poa.idl 2012-02-24 10:45:34.000000000 +0000 @@ -5,60 +5,58 @@ #include - #pragma prefix "omg.org" - -////////////////////////////////////////////////////////////////////// module PortableServer { -////////////////////////////////////////////////////////////////////// #pragma version PortableServer 2.3 exception ForwardRequest { Object forward_reference; }; #pragma version ForwardRequest 2.3 - // ************************************************** // // AdapterActivator interface - // - // ************************************************** - interface AdapterActivator { + /*local*/ interface AdapterActivator { boolean unknown_adapter(in POA parent, in string name); }; #pragma version AdapterActivator 2.3 - // ************************************************** // // ServantManager interface - // - // ************************************************** - interface ServantManager {}; + /*local*/ interface ServantManager {}; #pragma version ServantManager 2.3 - interface ServantActivator : ServantManager { + + // + // ServantActivator interface + + /*local*/ interface ServantActivator : ServantManager { Servant incarnate(in ObjectId oid, in POA adapter) - raises ( ForwardRequest ); + raises (ForwardRequest); void etherealize(in ObjectId oid, in POA adapter, in Servant serv, in boolean cleanup_in_progress, - in boolean remaining_activations ); + in boolean remaining_activations); }; #pragma version ServantActivator 2.3 - interface ServantLocator : ServantManager { - //??native Cookie; + // + // ServantLocator interface + + /*local*/ interface ServantLocator : ServantManager { + + // native Cookie; typedef short Cookie; Servant preinvoke(in ObjectId oid, in POA adapter, in CORBA::Identifier operation, - out Cookie the_cookie ) - raises ( ForwardRequest ); + out Cookie the_cookie) + raises (ForwardRequest); void postinvoke(in ObjectId oid, in POA adapter, in CORBA::Identifier operation, @@ -66,9 +64,7 @@ }; #pragma version ServantLocator 2.3 -////////////////////////////////////////////////////////////////////// }; -////////////////////////////////////////////////////////////////////// #pragma prefix "" diff -Nru omniorb-dfsg-4.1.6/idl/poa_include.idl omniorb-dfsg-4.2.2/idl/poa_include.idl --- omniorb-dfsg-4.1.6/idl/poa_include.idl 2005-01-06 23:11:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/poa_include.idl 2012-02-24 10:45:34.000000000 +0000 @@ -6,25 +6,18 @@ #include - -////////////////////////////////////////////////////////////////////// module PortableServer { -////////////////////////////////////////////////////////////////////// - // forward reference - interface POA; + /*local*/ interface POA; typedef sequence POAList; - //??native Servant; + // native Servant; typedef short Servant; typedef sequence ObjectId; - -////////////////////////////////////////////////////////////////////// }; -////////////////////////////////////////////////////////////////////// #endif // _omniorb_poa_include_idl_ diff -Nru omniorb-dfsg-4.1.6/idl/pollable.idl omniorb-dfsg-4.2.2/idl/pollable.idl --- omniorb-dfsg-4.1.6/idl/pollable.idl 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/pollable.idl 2011-02-09 14:36:20.000000000 +0000 @@ -0,0 +1,39 @@ +// pollable.idl +// +// Definitions of standard CORBA::Pollable and related types. + +#ifndef _omniorb_pollable_idl_ +#define _omniorb_pollable_idl_ + +#pragma prefix "omg.org" + + +module CORBA { + local interface PollableSet; + + abstract valuetype Pollable { + boolean is_ready(in unsigned long timeout); + PollableSet create_pollable_set(); + }; + + abstract valuetype DIIPollable : Pollable { }; + + local interface PollableSet { + exception NoPossiblePollable { }; + exception UnknownPollable { }; + + DIIPollable create_dii_pollable(); + + void add_pollable(in Pollable potential); + + Pollable get_ready_pollable(in unsigned long timeout) + raises (NoPossiblePollable); + + void remove(in Pollable potential) + raises (UnknownPollable); + + unsigned short number_left(); + }; +}; + +#endif // _omniorb_pollable_idl_ diff -Nru omniorb-dfsg-4.1.6/idl/ziop.idl omniorb-dfsg-4.2.2/idl/ziop.idl --- omniorb-dfsg-4.1.6/idl/ziop.idl 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/idl/ziop.idl 2012-12-31 14:57:16.000000000 +0000 @@ -0,0 +1,57 @@ +// ziop.idl +// +// Definitions for ZIOP. From the ZIOP 1.0 specification. +// +// http://www.omg.org/spec/ZIOP/ + +#ifndef _omniorb_ziop_idl_ +#define _omniorb_ziop_idl_ + +#include + +#pragma prefix "omg.org" + +module ZIOP { + typedef unsigned long PolicyType; // Really CORBA::PolicyType + + struct CompressedData { + Compression::CompressorId compressorid; + unsigned long original_length; + Compression::Buffer data; + }; + + typedef boolean CompressionEnablingPolicyValue; + typedef Compression::CompressorIdLevelList CompressionIdLevelListPolicyValue; + typedef unsigned long CompressionLowValuePolicyValue; + typedef Compression::CompressionRatio CompressionMinRatioPolicyValue; + + const PolicyType COMPRESSION_ENABLING_POLICY_ID = 64; + const PolicyType COMPRESSOR_ID_LEVEL_LIST_POLICY_ID = 65; + const PolicyType COMPRESSION_LOW_VALUE_POLICY_ID = 66; + const PolicyType COMPRESSION_MIN_RATIO_POLICY_ID = 67; + + // Policy interface classes are provided by hand-written code. + /* + local interface CompressionEnablingPolicy: CORBA::Policy + { + readonly attribute CompressionEnablingPolicyValue compression_enabled; + }; + + local interface CompressionIdLevelListPolicy: CORBA::Policy + { + readonly attribute Compression::CompressorIdLevelList compressor_ids; + }; + + local interface CompressionLowValuePolicy: CORBA::Policy + { + readonly attribute CompressionLowValuePolicyValue low_value; + }; + + local interface CompressionMinRatioPolicy: CORBA::Policy + { + readonly attribute CompressionMinRatioPolicyValue ratio; + }; + */ +}; + +#endif // _omniorb_ziop_idl_ diff -Nru omniorb-dfsg-4.1.6/include/omniconfig.h omniorb-dfsg-4.2.2/include/omniconfig.h --- omniorb-dfsg-4.1.6/include/omniconfig.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniconfig.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ * This file is part of the omniORB library * * The omniORB library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library 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 - * Library General Public License for more details. + * Lesser General Public License for more details. * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see http://www.gnu.org/licenses/ * * * Description: diff -Nru omniorb-dfsg-4.1.6/include/omniconfig.h.in omniorb-dfsg-4.2.2/include/omniconfig.h.in --- omniorb-dfsg-4.1.6/include/omniconfig.h.in 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniconfig.h.in 2017-02-20 22:45:59.000000000 +0000 @@ -8,27 +8,24 @@ * This file is part of the omniORB library * * The omniORB library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public + * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see http://www.gnu.org/licenses/ * * * Description: * *** PROPRIETARY INTERFACE *** * - * omniconfig.h used when using autoconf. Nothing in this file is - * replaced by autoconf, but the copying of this file over the - * non-autoconf version selects the autoconf setup. + * omniconfig.h used when using autoconf. Copying of this file + * over the non-autoconf version selects the autoconf setup. */ #ifndef __omniconfig_h__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/acconfig.h.in omniorb-dfsg-4.2.2/include/omniORB4/acconfig.h.in --- omniorb-dfsg-4.1.6/include/omniORB4/acconfig.h.in 2010-11-22 23:00:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/acconfig.h.in 2013-01-11 17:44:01.000000000 +0000 @@ -105,6 +105,9 @@ /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL +/* Define to 1 if you have the `rand_r' function. */ +#undef HAVE_RAND_R + /* define if the compiler supports reinterpret_cast<> */ #undef HAVE_REINTERPRET_CAST @@ -171,10 +174,10 @@ /* Define to 1 if the system has the type `struct sockaddr_in6'. */ #undef HAVE_STRUCT_SOCKADDR_IN6 -/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ +/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */ #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN -/* Define to 1 if `sin_zero' is member of `struct sockaddr_in'. */ +/* Define to 1 if `sin_zero' is a member of `struct sockaddr_in'. */ #undef HAVE_STRUCT_SOCKADDR_IN_SIN_ZERO /* Define to 1 if the system has the type `struct sockaddr_storage'. */ @@ -222,12 +225,18 @@ /* define if you want mutexes to be traced */ #undef OMNIORB_ENABLE_LOCK_TRACES +/* define if you want to disable atomic operations */ +#undef OMNI_DISABLE_ATOMIC_OPS + /* define if you want to disable IPv6 support */ #undef OMNI_DISABLE_IPV6 /* define if the compiler supports covariant return types */ #undef OMNI_HAVE_COVARIANT_RETURNS +/* define if __sync_add_and_fetch and __sync_sub_and_fetch are available */ +#undef OMNI_HAVE_SYNC_ADD_AND_FETCH + /* define if long is the same type as int */ #undef OMNI_LONG_IS_INT @@ -249,6 +258,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -313,3 +325,6 @@ # undef WORDS_BIGENDIAN # endif #endif + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/ami.h omniorb-dfsg-4.2.2/include/omniORB4/ami.h --- omniorb-dfsg-4.1.6/include/omniORB4/ami.h 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/ami.h 2017-02-20 22:45:59.000000000 +0000 @@ -0,0 +1,239 @@ +// -*- Mode: C++; -*- +// Package : omniORB +// ami.h Created on: 2012-02-06 +// Author : Duncan Grisby (dgrisby) +// +// Copyright (C) 2012 Apasphere Ltd +// +// This file is part of the omniORB library. +// +// The omniORB library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ +// +// Description: +// +// AMI support + +#ifndef _OMNIORB_AMI_H_ +#define _OMNIORB_AMI_H_ + +#include +#include + + +#ifdef _dyn_attr +# error "A local CPP macro _dyn_attr has already been defined." +#endif + +#if defined(_OMNIORB_DYNAMIC_LIBRARY) +# define _dyn_attr +#else +# define _dyn_attr _OMNIORB_NTDLL_IMPORT +#endif + + +_CORBA_MODULE omniAMI +_CORBA_MODULE_BEG + + +// +// Implementation of standard Messaging::ExceptionHolder valuetype + +class ExceptionHolder + : public virtual ::Messaging::ExceptionHolder, + public virtual ::CORBA::DefaultValueRefCountBase +{ +public: + inline ExceptionHolder(omniAsyncCallDescriptor* cd) + : pd_cd(cd) + {} + + virtual ~ExceptionHolder(); + + virtual void raise_exception(); + +private: + omniAsyncCallDescriptor* pd_cd; + + // Not implemented + ExceptionHolder(const ExceptionHolder&); + ExceptionHolder& operator=(const ExceptionHolder&); +}; + + +// +// Mixin class implementing base Messaging::Poller methods + +class PollerImpl + : public virtual ::Messaging::Poller, + public virtual ::CORBA::DefaultValueRefCountBase +{ +public: + PollerImpl(omniAsyncCallDescriptor* _cd) + : _pd_cd(_cd), _pd_is_from_poller(0), _pd_retrieved(0) + {} + + ~PollerImpl(); + + // Standard interface + + ::CORBA::Boolean is_ready(::CORBA::ULong timeout); + ::CORBA::PollableSet_ptr create_pollable_set(); + ::CORBA::Object_ptr operation_target(); + char* operation_name(); + + ::Messaging::ReplyHandler_ptr associated_handler(); + void associated_handler(::Messaging::ReplyHandler_ptr v); + + ::CORBA::Boolean is_from_poller(); + + // omniORB internal + inline omniAsyncCallDescriptor* _PR_cd() { return _pd_cd; } + inline ::CORBA::Boolean _PR_retrieved() { return _pd_retrieved; } + + static _dyn_attr const char* _PD_repoId; + +protected: + void _wrongOperation(); + void _checkResult(const char* op, ::CORBA::ULong timeout); + + omniAsyncCallDescriptor* _pd_cd; + ::CORBA::Boolean _pd_is_from_poller; + ::CORBA::Boolean _pd_retrieved; +}; + + +// +// DIIPollable implementation + +class DIIPollableImpl + : public virtual ::CORBA::DIIPollable +{ +public: + DIIPollableImpl() + : pd_cond(&omniAsyncCallDescriptor::sd_lock, "DIIPollableImpl::pd_cond"), + pd_set_cond(0), + pd_ready(0) + {} + + ~DIIPollableImpl(); + + void _add_ref(); + void _remove_ref(); + ::CORBA::ULong _refcount_value(); + + // Standard interface + ::CORBA::Boolean is_ready(::CORBA::ULong timeout); + ::CORBA::PollableSet_ptr create_pollable_set(); + + inline ::CORBA::Boolean _addToSet(omni_tracedcondition* set_cond) + { + ASSERT_OMNI_TRACEDMUTEX_HELD(omniAsyncCallDescriptor::sd_lock, 1); + + if (pd_set_cond) + return 0; + + pd_set_cond = set_cond; + return 1; + } + + inline ::CORBA::Boolean _remFromSet(omni_tracedcondition* set_cond) + { + ASSERT_OMNI_TRACEDMUTEX_HELD(omniAsyncCallDescriptor::sd_lock, 1); + + if (pd_set_cond) + return 0; + + pd_set_cond = set_cond; + return 1; + } + + inline void _replyReady() + { + omni_tracedmutex_lock l(omniAsyncCallDescriptor::sd_lock); + ++pd_ready; + pd_cond.broadcast(); + if (pd_set_cond) + pd_set_cond->signal(); + } + + inline void _replyCollected() + { + omni_tracedmutex_lock l(omniAsyncCallDescriptor::sd_lock); + --pd_ready; + } + + inline ::CORBA::Boolean _lockedIsReady() + { + ASSERT_OMNI_TRACEDMUTEX_HELD(omniAsyncCallDescriptor::sd_lock, 1); + return pd_ready ? 1 : 0; + } + + static _dyn_attr DIIPollableImpl _PD_instance; + +private: + omni_tracedcondition pd_cond; + omni_tracedcondition* pd_set_cond; + CORBA::ULong pd_ready; +}; + + +// +// PollableSet implementation + +typedef _CORBA_Value_Element< + PollerImpl, ::Messaging::Poller_Helper> PollerImplElmt; + +typedef _CORBA_Unbounded_Sequence_Value< + PollerImpl, PollerImplElmt, ::Messaging::Poller_Helper> PollerImplSeq; + + +class PollableSetImpl + : public virtual ::CORBA::PollableSet +{ +public: + PollableSetImpl(PollerImpl* poller); + PollableSetImpl(DIIPollableImpl* dii_pollable); + + ~PollableSetImpl(); + + // Standard interface + + ::CORBA::DIIPollable* create_dii_pollable(); + void add_pollable(::CORBA::Pollable* potential); + ::CORBA::Pollable* get_ready_pollable(::CORBA::ULong timeout); + void remove(::CORBA::Pollable* potential); + ::CORBA::UShort number_left(); + + void _add_ref(); + void _remove_ref(); + +private: + omni_tracedcondition pd_cond; + PollerImplSeq pd_ami_pollers; + DIIPollableImpl* pd_dii_pollable; + omni_refcount pd_ref_count; + + ::CORBA::Pollable* getAndRemoveReadyPollable(); + + // Not implemented + PollableSetImpl(const PollableSetImpl&); + PollableSetImpl& operator=(const PollableSetImpl&); +}; + + +_CORBA_MODULE_END // omniAMI + + + +#endif // _OMNIORB_AMI_H_ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/anyStream.h omniorb-dfsg-4.2.2/include/omniORB4/anyStream.h --- omniorb-dfsg-4.1.6/include/omniORB4/anyStream.h 2004-07-23 10:31:47.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/anyStream.h 2017-02-20 22:45:59.000000000 +0000 @@ -4,24 +4,22 @@ // Author : Duncan Grisby // // -// Copyright (C) 2004 Apasphere Ltd. +// Copyright (C) 2004-2011 Apasphere Ltd. // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -53,13 +51,13 @@ virtual ~cdrAnyMemoryStream(); - cdrAnyMemoryStream& operator=(const cdrMemoryStream&); - virtual void* ptrToClass(int* cptr); + static inline cdrAnyMemoryStream* downcast(cdrStream* s) { return (cdrAnyMemoryStream*)s->ptrToClass(&_classid); } static _dyn_attr int _classid; + static _dyn_attr cdrAnyMemoryStream* _empty; inline omniTypedefs::ValueBaseSeq& valueSeq() { @@ -73,6 +71,23 @@ pd_values = 0; } + inline _CORBA_Boolean hasValues() + { + return pd_values.operator->() != 0; + } + + inline void add_ref() + { + pd_refCount.inc(); + } + + inline void remove_ref() + { + if (pd_refCount.dec() == 0) + delete this; + } + + private: // ValueTypes inside Anys cannot be stored inside the marshalled // stream like other types, because to do so would not have the @@ -81,6 +96,11 @@ // representing an index into this sequence. The sequence is only // allocated if there are values inside the Any. omniTypedefs::ValueBaseSeq_var pd_values; + + omni_refcount pd_refCount; + + // Not implemented + cdrAnyMemoryStream& operator=(const cdrAnyMemoryStream&); }; #undef _dyn_attr diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/BiDirPolicy.h omniorb-dfsg-4.2.2/include/omniORB4/BiDirPolicy.h --- omniorb-dfsg-4.1.6/include/omniORB4/BiDirPolicy.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/BiDirPolicy.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.2.3 2001/08/17 15:00:47 dpg1 - Fixes for pre-historic compilers. - - Revision 1.1.2.2 2001/08/16 09:54:44 sll - Hardwired the policy number instead of using the constant in the - declaration of BidirectionalPolicy because the latter does not work for - compilers without namespace support. - - Revision 1.1.2.1 2001/07/31 16:10:39 sll - Added GIOP BiDir support. - - */ - - #ifndef __BIDIRPOLICY_H__ #define __BIDIRPOLICY_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/boa.h omniorb-dfsg-4.2.2/include/omniORB4/boa.h --- omniorb-dfsg-4.1.6/include/omniORB4/boa.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/boa.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,43 +8,22 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.2.2.2 2000/11/09 12:27:49 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.2.2.1 2000/07/17 10:35:34 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.2 2000/03/03 14:29:16 djr - Improvement to BOA skeletons (less generated code). - - Revision 1.1.2.1 1999/09/24 09:51:42 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNIORB_BOA_H__ #define __OMNIORB_BOA_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/callDescriptor.h omniorb-dfsg-4.2.2/include/omniORB4/callDescriptor.h --- omniorb-dfsg-4.1.6/include/omniORB4/callDescriptor.h 2010-09-07 13:34:40.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/callDescriptor.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,111 +1,45 @@ // -*- Mode: C++; -*- // Package : omniORB -// callDescriptor.h Created on: 12/98 +// callDescriptor.h Created on: 12/1998 // Author : David Riddoch (djr) +// Author : Duncan Grisby (dgrisby) // -// Copyright (C) 2003-2008 Apasphere Ltd +// Copyright (C) 2003-2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // -// Description: +// Object that encapsulates a call to be performed // -/* - $Log$ - Revision 1.4.2.5 2008/10/28 15:33:42 dgrisby - Undeclared user exceptions not caught in local calls. - - Revision 1.4.2.4 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.4.2.3 2006/06/05 11:27:01 dgrisby - Accessor method to change oneway-ness of a call descriptor. - - Revision 1.4.2.2 2003/11/06 11:56:55 dgrisby - Yet more valuetype. Plain valuetype and abstract valuetype are now working. - - Revision 1.4.2.1 2003/03/23 21:04:17 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.15 2003/01/16 12:47:08 dgrisby - Const cast macro. Thanks Matej Kenda. - - Revision 1.2.2.14 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.2.2.13 2001/11/06 15:41:35 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.2.2.12 2001/09/03 16:49:43 sll - Added the deadline parameter and access functions. - - Revision 1.2.2.11 2001/09/03 13:28:09 sll - In the calldescriptor, in addition to the first address, record the current - address in use. - - Revision 1.2.2.10 2001/08/17 17:01:16 sll - Removed assert existent flag in the call descriptor. - - Revision 1.2.2.9 2001/08/17 13:42:48 dpg1 - callDescriptor::userException() no longer has to throw an exception. - - Revision 1.2.2.8 2001/08/15 10:26:07 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.2.2.7 2001/06/07 16:24:07 dpg1 - PortableServer::Current support. - - Revision 1.2.2.6 2001/05/29 17:03:47 dpg1 - In process identity. - - Revision 1.2.2.5 2001/04/18 17:50:44 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.4 2000/11/03 19:00:26 sll - Removed Suppress_Spurious_gcc_Warnings cpp macro. - - Revision 1.2.2.3 2000/10/06 16:47:26 sll - Removed inline marshal function from the client and server marshaller. - - Revision 1.2.2.2 2000/09/27 17:18:35 sll - Updated to use the new cdrStream abstraction. - Added new member unmarshalArguments(), marshalReturnedValues() and modified - the ctor arguments to make the omniCallDescriptor class suitable for use in - the upcalls on the server side. - - Revision 1.2.2.1 2000/07/17 10:35:34 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:43 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNIORB_CALLDESCRIPTOR_H__ #define __OMNIORB_CALLDESCRIPTOR_H__ +#ifdef _core_attr +# error "A local CPP macro _core_attr has already been defined." +#endif + +#if defined(_OMNIORB_LIBRARY) +# define _core_attr +#else +# define _core_attr _OMNIORB_NTDLL_IMPORT +#endif + + class omniObjRef; class omniServant; class omniCurrent; @@ -123,12 +57,31 @@ public: typedef void (*LocalCallFn)(omniCallDescriptor*, omniServant*); - inline omniCallDescriptor(LocalCallFn lcfn, const char* op_, - int op_len_, _CORBA_Boolean oneway, + struct InterceptorFn { + LocalCallFn fn; + InterceptorFn* next; + }; + + // Call descriptor constructor. + // + // lcfn -- function used to perform a local call on a servant + // op -- operation name. Null represents a LocateRequest + // rather than a normal call + // op_len -- length of operation name + // oneway -- true if a oneway call + // user_excns -- set of valid user exceptions or null if not known + // n_user_excns -- number of user exceptions + // is_upcall -- true if this is an upcall to a servant + + inline omniCallDescriptor(LocalCallFn lcfn, + const char* op_, + size_t op_len_, + _CORBA_Boolean oneway, const char*const* user_excns_, - int n_user_excns_, - _CORBA_Boolean is_upcall_) - : pd_localCall(lcfn), + int n_user_excns_, + _CORBA_Boolean is_upcall_) + : pd_do_call(sd_interceptor_call ? sd_interceptor_call : lcfn), + pd_local_call(lcfn), pd_op(op_), pd_oplen(op_len_), pd_user_excns(user_excns_), pd_n_user_excns(n_user_excns_), @@ -139,9 +92,8 @@ pd_current_address(0), pd_objref(0), pd_poa(0), - pd_localId(0), - pd_deadline_secs(0), - pd_deadline_nanosecs(0) {} + pd_localId(0) + {} virtual ~omniCallDescriptor() {} @@ -172,33 +124,54 @@ // CORBA::UNKNOWN. If the exception is valid, or the call descriptor // does not know, returns. - ////////////////////////////////////////////////// // Methods to implement call on the server side // ////////////////////////////////////////////////// + virtual void unmarshalArguments(cdrStream&); // Defaults to no arguments. virtual void marshalReturnedValues(cdrStream&); // Defaults to no arguments and returns void. + //////////////// + // Invocation // + //////////////// + + // Called by stub code to perform a local call. + inline void doLocalCall(omniServant* servant) { + pd_do_call(this, servant); + } + + // Interceptor functions *must* call this to continue the call. + inline void interceptedCall(omniServant* servant) { + LocalCallFn lcfn; + if (pd_interceptor_stack) { + lcfn = pd_interceptor_stack->fn; + pd_interceptor_stack = pd_interceptor_stack->next; + } + else + lcfn = pd_local_call; + + lcfn(this, servant); + } + /////////////// // Accessors // /////////////// - inline const char* op() const { return pd_op; } - inline size_t op_len() const { return pd_oplen; } - inline _CORBA_Boolean is_oneway() const { return pd_is_oneway; } - - inline void set_oneway(_CORBA_Boolean o) { pd_is_oneway = o; } + inline const char* op() const { return pd_op; } + inline size_t op_len() const { return pd_oplen; } + inline _CORBA_Boolean is_oneway() const { return pd_is_oneway; } + inline void set_oneway(_CORBA_Boolean o) { pd_is_oneway = o; } + inline const char* const* user_excns() { return pd_user_excns; } + inline int n_user_excns() { return pd_n_user_excns; } + inline _CORBA_Boolean is_upcall() const { return pd_is_upcall; } - inline void doLocalCall(omniServant* servant) { - pd_localCall(this, servant); + inline _CORBA_Boolean haslocalCallFn() const { + return (pd_local_call) ? 1 : 0; } - inline const char*const* user_excns() { return pd_user_excns; } - inline int n_user_excns() { return pd_n_user_excns; } - inline _CORBA_Boolean is_upcall() const { return pd_is_upcall; } - inline _CORBA_Boolean haslocalCallFn() const { return (pd_localCall)?1:0; } + inline const _OMNI_NS(giopAddress)* firstAddressUsed() { return pd_first_address_used; } @@ -215,14 +188,12 @@ pd_current_address = a; } - inline void getDeadline(unsigned long& secs, unsigned long& nanosecs) const { - secs = pd_deadline_secs; - nanosecs = pd_deadline_nanosecs; + inline const omni_time_t& getDeadline() const { + return pd_deadline; } - inline void setDeadline(unsigned long secs, unsigned long nanosecs) { - pd_deadline_secs = secs; - pd_deadline_nanosecs = nanosecs; + inline void setDeadline(const omni_time_t& deadline) { + pd_deadline = deadline; } inline void containsValues(_CORBA_Boolean v) { @@ -251,8 +222,18 @@ inline void localId(omniLocalIdentity* lid) { pd_localId = lid; } inline omniLocalIdentity* localId() { return pd_localId; } + + ////////////////////////////// + // Interceptor registration // + ////////////////////////////// + + static void addInterceptor(LocalCallFn func); + static void removeInterceptor(LocalCallFn func); + + private: - LocalCallFn pd_localCall; + LocalCallFn pd_do_call; + LocalCallFn pd_local_call; const char* pd_op; size_t pd_oplen; const char*const* pd_user_excns; @@ -293,10 +274,32 @@ //////////////////////////// // Deadline for this call // //////////////////////////// + // This is a state holder for the call. Not manipulated by this class // other than the access functions. Initialised to 0 in ctor. - unsigned long pd_deadline_secs; - unsigned long pd_deadline_nanosecs; + omni_time_t pd_deadline; + + + /////////////////////// + // Call interceptors // + /////////////////////// + + static _core_attr LocalCallFn sd_interceptor_call; + // Function used in place of the normal local call function if + // interceptors are registered. Initialises the interceptor stack + // and calls the first interceptor in the stack. + + static void setupInterception(omniCallDescriptor* cd, omniServant* servant); + // Function assigned to sd_interceptor_call when interceptors are registered. + + static _core_attr InterceptorFn* sd_interceptor_stack; + InterceptorFn* pd_interceptor_stack; + // Global interceptor stack and this call descriptor's pointer into it. + + + ///////////////////// + // Not implemented // + ///////////////////// omniCallDescriptor(const omniCallDescriptor&); omniCallDescriptor& operator = (const omniCallDescriptor&); @@ -305,6 +308,195 @@ ////////////////////////////////////////////////////////////////////// +///////////////////////// omniAsyncCallDescriptor //////////////////// +////////////////////////////////////////////////////////////////////// + +class omniAsyncCallDescriptor : public omniCallDescriptor +{ +public: + // Constructor for normal synchronous calls. Created on the stack. + inline omniAsyncCallDescriptor(LocalCallFn lcfn, + const char* op_, + size_t op_len_, + _CORBA_Boolean oneway, + const char*const* user_excns_, + int n_user_excns_, + _CORBA_Boolean is_upcall_) + : omniCallDescriptor(lcfn, op_, op_len_, oneway, + user_excns_, n_user_excns_, + is_upcall_), + pd_exception(0), + pd_cond(0), + pd_set_cond(0) + {} + + // Constructor for asynchronous calls. Created on the heap. + // + // In callback AMI, completeCallback() makes the callback to the + // ReplyHandler, then deletes this; in polling AMI, the poller + // valuetype owns the call descriptor and deletes it when the poller + // is deleted. + inline omniAsyncCallDescriptor(LocalCallFn lcfn, + const char* op_, + size_t op_len_, + _CORBA_Boolean oneway, + const char*const* user_excns_, + int n_user_excns_) + : omniCallDescriptor(lcfn, op_, op_len_, oneway, + user_excns_, n_user_excns_, 0), + pd_exception(0), + pd_cond(0), + pd_set_cond(0), + pd_complete(0), + pd_do_callback(1) + {} + + virtual ~omniAsyncCallDescriptor(); + + virtual void completeCallback(); + + // Handler set / get. Object reference is a Messaging::ReplyHandler + // subclass. + virtual void setHandler(omniObjRef* objref); + virtual omniObjRef* getHandler(); + + + inline void setComplete() + { + _CORBA_Boolean do_callback; + { + omni_tracedmutex_lock l(sd_lock); + do_callback = pd_do_callback; + pd_complete = 1; + + if (pd_cond) + pd_cond->broadcast(); + + if (pd_set_cond) + pd_set_cond->signal(); + } + if (do_callback) + completeCallback(); + } + + inline _CORBA_Boolean isComplete() + { + omni_tracedmutex_lock l(sd_lock); + return pd_complete; + } + + inline _CORBA_Boolean lockedIsComplete() + { + ASSERT_OMNI_TRACEDMUTEX_HELD(sd_lock, 1); + return pd_complete; + } + + inline void wait() + { + omni_tracedmutex_lock l(sd_lock); + + if (pd_complete) + return; + + if (!pd_cond) + pd_cond = new omni_tracedcondition(&sd_lock, + "omniAsyncCallDescriptor::pd_cond"); + + while (!pd_complete) + pd_cond->wait(); + } + + inline _CORBA_Boolean wait(const omni_time_t& t) + { + omni_tracedmutex_lock l(sd_lock); + + if (pd_complete) + return 1; + + if (!pd_cond) + pd_cond = new omni_tracedcondition(&sd_lock, + "omniAsyncCallDescriptor::pd_cond"); + + pd_cond->timedwait(t); + return pd_complete; + } + + inline _CORBA_Boolean isReady(CORBA::ULong timeout) + { + if (timeout == 0) + return isComplete(); + + if (timeout == 0xffffffff) { + wait(); + return 1; + } + + omni_time_t timeout_tt(timeout / 1000, (timeout % 1000) * 1000000); + omni_time_t deadline; + omni_thread::get_time(deadline, timeout_tt); + + return wait(deadline); + } + + + inline void storeException(const CORBA::Exception& ex) + { + pd_exception = CORBA::Exception::_duplicate(&ex); + } + + inline _CORBA_Boolean exceptionOccurred() + { + return pd_exception ? 1 : 0; + } + + inline void raiseException() + { + if (pd_exception) + pd_exception->_raise(); + } + + inline CORBA::Exception* getException() + { + CORBA::Exception* ex = pd_exception; + pd_exception = 0; + return ex; + } + + inline _CORBA_Boolean addToSet(omni_tracedcondition* set_cond) + { + ASSERT_OMNI_TRACEDMUTEX_HELD(sd_lock, 1); + + if (pd_set_cond) + return 0; + + pd_set_cond = set_cond; + return 1; + } + + inline void remFromSet(omni_tracedcondition* set_cond) + { + ASSERT_OMNI_TRACEDMUTEX_HELD(sd_lock, 1); + OMNIORB_ASSERT(pd_set_cond == set_cond); + + pd_set_cond = 0; + } + + static _core_attr omni_tracedmutex sd_lock; + +protected: + CORBA::Exception* pd_exception; + omni_tracedcondition* pd_cond; + omni_tracedcondition* pd_set_cond; + _CORBA_Boolean pd_complete; + _CORBA_Boolean pd_do_callback; + + // Not implemented + omniAsyncCallDescriptor(const omniAsyncCallDescriptor&); + omniAsyncCallDescriptor& operator=(const omniAsyncCallDescriptor&); +}; + + +////////////////////////////////////////////////////////////////////// /////////////////////////// omniStdCallDesc ////////////////////////// ////////////////////////////////////////////////////////////////////// @@ -322,12 +514,12 @@ inline _cCORBA_mObject_i_cstring(LocalCallFn lcfn, const char* op_, size_t oplen, const char* a_0, _CORBA_Boolean upcall=0) : - omniCallDescriptor(lcfn, op_, (int)oplen, 0, 0, 0, upcall), + omniCallDescriptor(lcfn, op_, oplen, 0, 0, 0, upcall), arg_0( OMNI_CONST_CAST(char*, a_0) ) {} inline ~_cCORBA_mObject_i_cstring() { if (is_upcall()) { - _CORBA_String_helper::free(arg_0); + _CORBA_String_helper::dealloc(arg_0); } } @@ -349,14 +541,14 @@ ///////////////////// omniLocalOnlyCallDescriptor //////////////////// ////////////////////////////////////////////////////////////////////// -// This class is needed to support calls to objects which -// may only reside in the local address space. -// eg. ServantLocator, ServantActivator, AdapterActivator. +// This class is needed to support calls to objects which may only +// reside in the local address space. eg. ServantLocator, +// ServantActivator, AdapterActivator. class omniLocalOnlyCallDescriptor : public omniCallDescriptor { public: omniLocalOnlyCallDescriptor(LocalCallFn lcfn, const char* op_, - int op_len_, _CORBA_Boolean is_oneway_ = 0) + size_t op_len_, _CORBA_Boolean is_oneway_ = 0) : omniCallDescriptor(lcfn, op_, op_len_, is_oneway_, 0, 0, 0) {} // Only useful as client side descriptor. No set up for server side upcall. @@ -366,4 +558,6 @@ void marshalArguments(cdrStream&); }; +#undef _core_attr + #endif // __OMNIORB_CALLDESCRIPTOR_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/callHandle.h omniorb-dfsg-4.2.2/include/omniORB4/callHandle.h --- omniorb-dfsg-4.1.6/include/omniORB4/callHandle.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/callHandle.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,60 +3,29 @@ // callHandle.h Created on: 16/05/2001 // Author : Duncan Grisby (dpg1) // -// Copyright (C) 2006 Apasphere Ltd +// Copyright (C) 2006-2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // // Call handle used during remote or in-process operation dispatch. -/* - $Log$ - Revision 1.1.4.3 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.1.4.2 2005/07/22 17:18:40 dgrisby - Another merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:04:17 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.5 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.4 2001/08/15 10:26:07 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.2.3 2001/08/01 10:08:19 dpg1 - Main thread policy. - - Revision 1.1.2.2 2001/06/07 16:24:08 dpg1 - PortableServer::Current support. - - Revision 1.1.2.1 2001/05/29 17:03:48 dpg1 - In process identity. - -*/ - #ifndef __OMNIORB_CALLHANDLE_H__ #define __OMNIORB_CALLHANDLE_H__ @@ -65,6 +34,7 @@ OMNI_NAMESPACE_BEGIN(omni) class omniOrbPOA; +class giopConnection; OMNI_NAMESPACE_END(omni) class omniLocalIdentity; @@ -102,6 +72,15 @@ inline omniCallDescriptor* call_desc() const { return pd_call_desc; } inline _CORBA_Boolean try_direct() const { return pd_try_direct; } + // Accessors for connection details. Return zero in the case of an + // in-process call. + _OMNI_NS(giopConnection)* connection(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + + // Call entry-point void upcall(omniServant* servant, omniCallDescriptor& desc); // Class PostInvokeHook is used to insert extra processing after the diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/cdrStream.h omniorb-dfsg-4.2.2/include/omniORB4/cdrStream.h --- omniorb-dfsg-4.1.6/include/omniORB4/cdrStream.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/cdrStream.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,217 +3,35 @@ // cdrStream.h Created on: 11/1/99 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2007 Apasphere Ltd +// Copyright (C) 2003-2013 Apasphere Ltd // Copyright (C) 1999 AT&T Laboratories, Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.17 2007/04/12 19:50:33 dgrisby - A few cases of sizeof(bool) > 1 were not handled correctly. - - Revision 1.1.4.16 2007/02/11 23:44:59 dgrisby - Value chunk stream looked at wrong byteswap flag in getLength. - - Revision 1.1.4.15 2006/06/06 16:39:37 dgrisby - marshalRawString and chunking stream did not byte-swap length fields - when required to. - - Revision 1.1.4.14 2006/05/21 17:43:24 dgrisby - Remove obsolete pd_chunked flag. - - Revision 1.1.4.13 2006/05/20 16:23:37 dgrisby - Minor cdrMemoryStream and TypeCode performance tweaks. - - Revision 1.1.4.12 2006/05/15 10:13:00 dgrisby - Data was overwritten when a chunk ended with an array; make - declareArrayLength() virtual. - - Revision 1.1.4.11 2006/04/28 18:40:46 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.10 2005/12/08 14:22:31 dgrisby - Better string marshalling performance; other minor optimisations. - - Revision 1.1.4.9 2005/07/22 17:18:40 dgrisby - Another merge from omni4_0_develop. - - Revision 1.1.4.8 2005/01/06 23:08:09 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.7 2005/01/06 17:31:07 dgrisby - Changes (mainly from omni4_0_develop) to compile on gcc 3.4. - - Revision 1.1.4.6 2004/07/23 10:29:56 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.1.4.5 2004/07/04 23:53:35 dgrisby - More ValueType TypeCode and Any support. - - Revision 1.1.4.4 2003/11/06 11:56:55 dgrisby - Yet more valuetype. Plain valuetype and abstract valuetype are now working. - - Revision 1.1.4.3 2003/07/10 21:52:31 dgrisby - Value chunks should start after URL / repoids. - - Revision 1.1.4.2 2003/05/20 16:53:12 dgrisby - Valuetype marshalling support. - - Revision 1.1.4.1 2003/03/23 21:04:17 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.20 2003/03/02 17:10:41 dgrisby - AIX patches integrated in main tree. - - Revision 1.1.2.19 2002/03/14 14:39:44 dpg1 - Obscure bug in objref creation with unaligned buffers. - - Revision 1.1.2.18 2002/03/11 12:23:03 dpg1 - Tweaks to avoid compiler warnings. - - Revision 1.1.2.17 2001/11/14 17:13:41 dpg1 - Long double support. - - Revision 1.1.2.16 2001/10/17 16:33:27 dpg1 - New downcast mechanism for cdrStreams. - - Revision 1.1.2.15 2001/09/19 17:29:04 dpg1 - Cosmetic changes. - - Revision 1.1.2.14 2001/08/22 13:29:45 dpg1 - Re-entrant Any marshalling. - - Revision 1.1.2.13 2001/08/17 17:02:22 sll - Removed static variables ncs_c, ncs_w, default_tcs_c, default_tcs_w. - - Revision 1.1.2.12 2001/07/31 16:32:02 sll - Added virtual function is_giopStream to check if a cdrStream is a giopStream. - That is, a poor man's substitute for dynamic_cast. - - Revision 1.1.2.11 2001/06/13 19:58:37 sll - Added omni namespace scoping for omniCodeSet. - - Revision 1.1.2.10 2001/05/10 15:03:50 dpg1 - Update cdrStreamAdapter to modified cdrStream interface. - - Revision 1.1.2.9 2001/04/18 17:50:44 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.1.2.8 2001/01/09 17:16:59 dpg1 - New cdrStreamAdapter class to allow omniORBpy to intercept buffer - management. - - Revision 1.1.2.7 2000/12/05 17:39:31 dpg1 - New cdrStream functions to marshal and unmarshal raw strings. - - Revision 1.1.2.6 2000/11/22 14:37:58 dpg1 - Code set marshalling functions now take a string length argument. - - Revision 1.1.2.5 2000/11/15 17:16:23 sll - Added char, wchar codeset convertor support to cdrStream. - - Revision 1.1.2.4 2000/11/09 12:27:49 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.1.2.3 2000/11/03 18:49:16 sll - Separate out the marshalling of byte, octet and char into 3 set of distinct - marshalling functions. - Renamed put_char_array and get_char_array to put_octet_array and - get_octet_array. - New string marshal member functions. - - Revision 1.1.2.2 2000/10/10 10:14:27 sll - Extra ctor for cdrEncapsulationStream which initialise the buffer by - fetching data from the argument cdrStream. - - Revision 1.1.2.1 2000/09/27 16:54:08 sll - *** empty log message *** - -*/ - #ifndef __CDRSTREAM_H__ #define __CDRSTREAM_H__ #include -#ifndef Swap16 -#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) -#else -#error "Swap16 has already been defined" -#endif - -#ifndef Swap32 -#define Swap32(l) ((((l) & 0xff000000) >> 24) | \ - (((l) & 0x00ff0000) >> 8) | \ - (((l) & 0x0000ff00) << 8) | \ - (((l) & 0x000000ff) << 24)) -#else -#error "Swap32 has already been defined" -#endif - -#ifdef HAS_LongLong -#ifndef Swap64 -#define Swap64(l) \ - ((((l) & _CORBA_LONGLONG_CONST(0xff00000000000000)) >> 56) | \ - (((l) & _CORBA_LONGLONG_CONST(0x00ff000000000000)) >> 40) | \ - (((l) & _CORBA_LONGLONG_CONST(0x0000ff0000000000)) >> 24) | \ - (((l) & _CORBA_LONGLONG_CONST(0x000000ff00000000)) >> 8) | \ - (((l) & _CORBA_LONGLONG_CONST(0x00000000ff000000)) << 8) | \ - (((l) & _CORBA_LONGLONG_CONST(0x0000000000ff0000)) << 24) | \ - (((l) & _CORBA_LONGLONG_CONST(0x000000000000ff00)) << 40) | \ - (((l) & _CORBA_LONGLONG_CONST(0x00000000000000ff)) << 56)) -#else -#error "Swap64 has already been defined" -#endif -#endif - -// Technically, we have to declare friend functions outside of the -// class to put them into the global scope (this is pretty esoteric: -// friend functions are not in class scope but if they are first -// declared inside the class they aren't in global scope either...or -// something like that...) It is too bad we have to have operators in -// global scope but some compilers don't handle Koenig lookup -// correctly. - class cdrStream; -inline void operator>>= (_CORBA_Short a, cdrStream& s); -inline void operator<<= (_CORBA_Short& a, cdrStream& s); -inline void operator>>= (_CORBA_UShort a, cdrStream& s); -inline void operator<<= (_CORBA_UShort& a, cdrStream& s); -inline void operator>>= (_CORBA_Long a, cdrStream& s); -inline void operator<<= (_CORBA_Long& a, cdrStream& s); -inline void operator>>= (_CORBA_ULong a, cdrStream& s); -inline void operator<<= (_CORBA_ULong& a, cdrStream& s); -#ifdef HAS_LongLong -inline void operator>>= (_CORBA_LongLong a, cdrStream& s); -inline void operator<<= (_CORBA_LongLong& a, cdrStream& s); -inline void operator>>= (_CORBA_ULongLong a, cdrStream& s); -inline void operator<<= (_CORBA_ULongLong& a, cdrStream& s); -#endif - - class cdrStreamAdapter; class cdrValueChunkStream; @@ -225,6 +43,9 @@ OMNI_NAMESPACE_END(omni) +// +// cdrStream abstract base class + class cdrStream { public: @@ -232,69 +53,56 @@ virtual ~cdrStream(); -#ifndef CdrMarshal -#define CdrMarshal(s,type,align,arg) do {\ - again: \ - omni::ptr_arith_t p1 = omni::align_to((omni::ptr_arith_t)s.pd_outb_mkr,align);\ - omni::ptr_arith_t p2 = p1 + sizeof(type);\ - if( (void*)p2 > s.pd_outb_end ) {\ - if (s.reserveOutputSpaceForPrimitiveType(align,sizeof(type)))\ - goto again;\ - else {\ - s.pd_outb_mkr = (void*) p2;\ - break;\ - }\ - }\ - s.pd_outb_mkr = (void*) p2;\ - *((type*)p1) = arg;\ -} while(0) -#else -#error "CdrMarshal has already been defined" -#endif - -#ifndef CdrUnMarshal -#define CdrUnMarshal(s,type,align,arg) do {\ - again: \ - omni::ptr_arith_t p1 = omni::align_to((omni::ptr_arith_t)s.pd_inb_mkr,align);\ - omni::ptr_arith_t p2 = p1 + sizeof(type);\ - if ((void *)p2 > s.pd_inb_end) {\ - s.fetchInputData(align,sizeof(type));\ - goto again;\ - }\ - s.pd_inb_mkr = (void*) p2;\ - arg = *((type*)p1);\ -} while(0) -#else -#error "CdrUnMarshal has already been defined" -#endif - - // Macros to convert floats to integers or arrays of integers so they - // may be byte-swapped. The default version uses a union to do the - // conversion, but that fails for VMS which uses classes to represent - // float types. The version with reinterpret_cast<> fails on some - // platforms with strict aliasing. - -#ifndef USING_PROXY_FLOAT - -#define convertFromFloat(float_t, int_t) \ - union { float_t a; int_t l; } u; \ - u.a = a; \ - int_t l = u.l - -#define convertToFloat(float_t, int_t) \ - union { float_t a; int_t l; } u; \ - u.l = l; \ - a = u.a + // + // Byte swapping functions -#else + static inline _CORBA_Short byteSwap(_CORBA_Short s) { + return (((s & 0xff00) >> 8 | + (s & 0x00ff) << 8)); + } + static inline _CORBA_UShort byteSwap(_CORBA_UShort s) { + return (((s & 0xff00) >> 8 | + (s & 0x00ff) << 8)); + } + static inline _CORBA_Long byteSwap(_CORBA_Long l) { + return (((l & 0xff000000) >> 24) | + ((l & 0x00ff0000) >> 8) | + ((l & 0x0000ff00) << 8) | + ((l & 0x000000ff) << 24)); + } + static inline _CORBA_ULong byteSwap(_CORBA_ULong l) { + return (((l & 0xff000000) >> 24) | + ((l & 0x00ff0000) >> 8) | + ((l & 0x0000ff00) << 8) | + ((l & 0x000000ff) << 24)); + } -#define convertFromFloat(float_t, int_t) \ - int_t l = OMNI_REINTERPRET_CAST(int_t, a) +#ifdef HAS_LongLong + static inline _CORBA_LongLong byteSwap(_CORBA_LongLong l) { + return (((l & _CORBA_LONGLONG_CONST(0xff00000000000000)) >> 56) | + ((l & _CORBA_LONGLONG_CONST(0x00ff000000000000)) >> 40) | + ((l & _CORBA_LONGLONG_CONST(0x0000ff0000000000)) >> 24) | + ((l & _CORBA_LONGLONG_CONST(0x000000ff00000000)) >> 8) | + ((l & _CORBA_LONGLONG_CONST(0x00000000ff000000)) << 8) | + ((l & _CORBA_LONGLONG_CONST(0x0000000000ff0000)) << 24) | + ((l & _CORBA_LONGLONG_CONST(0x000000000000ff00)) << 40) | + ((l & _CORBA_LONGLONG_CONST(0x00000000000000ff)) << 56)); + } + static inline _CORBA_ULongLong byteSwap(_CORBA_ULongLong l) { + return (((l & _CORBA_LONGLONG_CONST(0xff00000000000000)) >> 56) | + ((l & _CORBA_LONGLONG_CONST(0x00ff000000000000)) >> 40) | + ((l & _CORBA_LONGLONG_CONST(0x0000ff0000000000)) >> 24) | + ((l & _CORBA_LONGLONG_CONST(0x000000ff00000000)) >> 8) | + ((l & _CORBA_LONGLONG_CONST(0x00000000ff000000)) << 8) | + ((l & _CORBA_LONGLONG_CONST(0x0000000000ff0000)) << 24) | + ((l & _CORBA_LONGLONG_CONST(0x000000000000ff00)) << 40) | + ((l & _CORBA_LONGLONG_CONST(0x00000000000000ff)) << 56)); + } +#endif -#define convertToFloat(float_t, int_t) \ - a = OMNI_REINTERPRET_CAST(float_t, l) -#endif + // + // Marshalling methods : char, wchar, bool, octet inline void marshalChar(_CORBA_Char a) { pd_ncs_c->marshalChar(*this,pd_tcs_c,a); @@ -314,276 +122,333 @@ inline void marshalOctet(_CORBA_Octet a) { // No need to align here - do { - again: - omni::ptr_arith_t p1 = (omni::ptr_arith_t)pd_outb_mkr; - omni::ptr_arith_t p2 = p1 + 1; - if( (void*)p2 > pd_outb_end ) { - if (reserveOutputSpaceForPrimitiveType(omni::ALIGN_1, 1)) - goto again; - else { - pd_outb_mkr = (void*) p2; - break; - } - } - pd_outb_mkr = (void*) p2; + omni::ptr_arith_t p1 = outMkr(); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Octet); + if ((void*)p2 <= pd_outb_end) { + pd_outb_mkr = (void*)p2; *((_CORBA_Octet*)p1) = a; - } while (0); + } + else { + reserveAndMarshalOctet(a); + } } inline _CORBA_Octet unmarshalOctet() { _CORBA_Octet a; - do { - again: - omni::ptr_arith_t p1 = (omni::ptr_arith_t)pd_inb_mkr; - omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Octet); - if ((void *)p2 > pd_inb_end) { - fetchInputData(omni::ALIGN_1,sizeof(_CORBA_Octet)); - goto again; - } - pd_inb_mkr = (void*) p2; + omni::ptr_arith_t p1 = inMkr(); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Octet); + if ((void*)p2 <= pd_inb_end) { + pd_inb_mkr = (void*)p2; a = *((_CORBA_Octet*)p1); - } while(0); + } + else { + a = fetchAndUnmarshalOctet(); + } return a; } inline void marshalBoolean(_CORBA_Boolean b) { - _CORBA_Char c = b ? 1 : 0; - CdrMarshal((*this),_CORBA_Char,omni::ALIGN_1,c); + _CORBA_Octet o = b ? 1 : 0; + marshalOctet(o); } inline _CORBA_Boolean unmarshalBoolean() { - _CORBA_Char c; - CdrUnMarshal((*this),_CORBA_Char,omni::ALIGN_1,c); + _CORBA_Octet o = unmarshalOctet(); #ifdef HAS_Cplusplus_Bool - return c ? true : false; + return o ? true : false; #else - return c; + return (_CORBA_Boolean)o; #endif } -#ifndef OMNI_NO_INLINE_FRIENDS - friend inline void operator>>= (_CORBA_Short a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_Short t = Swap16(a); - a = t; - } - CdrMarshal(s,_CORBA_Short,omni::ALIGN_2,a); - } - friend inline void operator<<= (_CORBA_Short& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_Short,omni::ALIGN_2,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_Short t = Swap16(a); - a = t; - } - } + // + // Marshalling methods : integer types - friend inline void operator>>= (_CORBA_UShort a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_UShort t = Swap16(a); - a = t; - } - CdrMarshal(s,_CORBA_UShort,omni::ALIGN_2,a); - } +#define intMarshalFns(type,align) \ + inline void marshal ## type(_CORBA_ ## type arg) {\ + omni::ptr_arith_t p1 = outMkr(omni::align);\ + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_ ## type);\ + if ((void*)p2 <= pd_outb_end) {\ + pd_outb_mkr = (void*) p2;\ + if (!pd_marshal_byte_swap) {\ + *((_CORBA_ ## type*)p1) = arg;\ + }\ + else {\ + *((_CORBA_ ## type*)p1) = byteSwap(arg);\ + }\ + }\ + else {\ + reserveAndMarshal ## type(arg);\ + }\ + } \ + inline _CORBA_ ## type unmarshal ## type() { \ + _CORBA_ ## type arg;\ + omni::ptr_arith_t p1 = inMkr(omni::align);\ + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_ ## type);\ + if ((void*)p2 <= pd_inb_end) {\ + pd_inb_mkr = (void*) p2;\ + if (!pd_unmarshal_byte_swap) {\ + arg = *((_CORBA_ ## type*)p1);\ + }\ + else {\ + arg = byteSwap(*((_CORBA_ ## type*)p1));\ + }\ + }\ + else {\ + arg = fetchAndUnmarshal ## type();\ + }\ + return arg; \ + } + + intMarshalFns(Short, ALIGN_2) + intMarshalFns(UShort, ALIGN_2) + intMarshalFns(Long, ALIGN_4) + intMarshalFns(ULong, ALIGN_4) - friend inline void operator<<= (_CORBA_UShort& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_UShort,omni::ALIGN_2,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_UShort t = Swap16(a); - a = t; - } - } +#ifdef HAS_LongLong + intMarshalFns(LongLong, ALIGN_8) + intMarshalFns(ULongLong, ALIGN_8) +#endif - friend inline void operator>>= (_CORBA_Long a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_Long t = Swap32(a); - a = t; - } - CdrMarshal(s,_CORBA_Long,omni::ALIGN_4,a); - } +#undef intMarshalFns - friend inline void operator<<= (_CORBA_Long& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_Long,omni::ALIGN_4,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_Long t = Swap32(a); - a = t; - } - } - friend inline void operator>>= (_CORBA_ULong a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_ULong t = Swap32(a); - a = t; - } - CdrMarshal(s,_CORBA_ULong,omni::ALIGN_4,a); + // + // Marshalling methods : float types + +#ifndef NO_FLOAT + +# ifndef USING_PROXY_FLOAT + + inline void marshalFloat(_CORBA_Float a) { + union { _CORBA_Float a; _CORBA_ULong l; } u; + u.a = a; + marshalULong(u.l); + } + inline _CORBA_Float unmarshalFloat() { + union { _CORBA_Float a; _CORBA_ULong l; } u; + u.l = unmarshalULong(); + return u.a; } - friend inline void operator<<= (_CORBA_ULong& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_ULong,omni::ALIGN_4,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_ULong t = Swap32(a); - a = t; - } +# if defined(HAS_LongLong) && !defined(OMNI_MIXED_ENDIAN_DOUBLE) + + inline void marshalDouble(_CORBA_Double a) { + union { _CORBA_Double a; _CORBA_ULongLong l; } u; + u.a = a; + marshalULongLong(u.l); + } + inline _CORBA_Double unmarshalDouble() { + union { _CORBA_Double a; _CORBA_ULongLong l; } u; + u.l = unmarshalULongLong(); + return u.a; } -# ifdef HAS_LongLong - friend inline void operator>>= (_CORBA_LongLong a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_LongLong t = Swap64(a); - a = t; +# else // No longlong or mixed endian + + inline void marshalDouble(_CORBA_Double a) { + omni::ptr_arith_t p1 = outMkr(omni::ALIGN_8); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Double); + if ((void*)p2 <= pd_outb_end) { + pd_outb_mkr = (void*) p2; + + struct LongArray2 { _CORBA_ULong l[2]; }; + union { _CORBA_Double a; LongArray2 l; } u; + u.a = a; + +#ifdef OMNI_MIXED_ENDIAN_DOUBLE + { + _CORBA_ULong v = u.l.l[0]; + u.l.l[0] = u.l.l[1]; + u.l.l[1] = v; + } +#endif + if (!pd_marshal_byte_swap) { + *((LongArray2*)p1) = u.l; + } + else { + LongArray2 m; + m.l[0] = byteSwap(u.l.l[1]); + m.l[1] = byteSwap(u.l.l[0]); + *((LongArray2*)p1) = m; + } + } + else { + reserveAndMarshalDouble(a); } - CdrMarshal(s,_CORBA_LongLong,omni::ALIGN_8,a); } - friend inline void operator<<= (_CORBA_LongLong& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_LongLong,omni::ALIGN_8,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_LongLong t = Swap64(a); - a = t; + inline _CORBA_Double unmarshalDouble() { + omni::ptr_arith_t p1 = inMkr(omni::ALIGN_8); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Double); + if ((void*)p2 <= pd_inb_end) { + pd_inb_mkr = (void*) p2; + + struct LongArray2 { _CORBA_ULong l[2]; }; + union { _CORBA_Double a; LongArray2 l; } u; + + if (!pd_unmarshal_byte_swap) { + u.l = *((LongArray2*)p1); + } + else { + LongArray2 m = *((LongArray2*)p1); + u.l.l[0] = byteSwap(m.l[1]); + u.l.l[1] = byteSwap(m.l[0]); + } + +#ifdef OMNI_MIXED_ENDIAN_DOUBLE + { + _CORBA_ULong v = u.l.l[0]; + u.l.l[0] = u.l.l[1]; + u.l.l[1] = v; + } +#endif + return u.a; + } + else { + return fetchAndUnmarshalDouble(); } } - friend inline void operator>>= (_CORBA_ULongLong a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_ULongLong t = Swap64(a); - a = t; - } - CdrMarshal(s,_CORBA_ULongLong,omni::ALIGN_8,a); +# endif // No longlong or mixed endian + +# else // USING_PROXY_FLOAT + + // _CORBA_Float and _CORBA_Double are classes with constructors, so + // we cannot use a union to convert it to an array of ulong. We use + // reinterpret_cast instead. + + inline void marshalFloat(_CORBA_Float a) { + _CORBA_ULong l = OMNI_REINTERPRET_CAST(_CORBA_ULong, a); + marshalULong(l); } + inline _CORBA_Float unmarshalFloat() { + _CORBA_ULong l = unmarshalULong(); + return OMNI_REINTERPRET_CAST(_CORBA_Float, l); + } + + inline void marshalDouble(_CORBA_Double a) { + omni::ptr_arith_t p1 = outMkr(omni::ALIGN_8); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Double); + if ((void*)p2 <= pd_outb_end) { + pd_outb_mkr = (void*) p2; + + struct LongArray2 { _CORBA_ULong l[2]; }; - friend inline void operator<<= (_CORBA_ULongLong& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_ULongLong,omni::ALIGN_8,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_ULongLong t = Swap64(a); - a = t; + LongArray2 l = OMNI_REINTERPRET_CAST(LongArray2, a); + + if (!pd_marshal_byte_swap) { + *((LongArray2*)p1) = l; + } + else { + LongArray2 m; + m[0] = byteSwap(l[1]); + m[1] = byteSwap(l[0]); + *((LongArray2*)p1) = m; + } + } + else { + reserveAndMarshalDouble(a); } } -# endif -#else - friend inline void operator>>= (_CORBA_Short a, cdrStream& s); - friend inline void operator<<= (_CORBA_Short& a, cdrStream& s); - friend inline void operator>>= (_CORBA_UShort a, cdrStream& s); - friend inline void operator<<= (_CORBA_UShort& a, cdrStream& s); - friend inline void operator>>= (_CORBA_Long a, cdrStream& s); - friend inline void operator<<= (_CORBA_Long& a, cdrStream& s); - friend inline void operator>>= (_CORBA_ULong a, cdrStream& s); - friend inline void operator<<= (_CORBA_ULong& a, cdrStream& s); -# ifdef HAS_LongLong - friend inline void operator>>= (_CORBA_LongLong a, cdrStream& s); - friend inline void operator<<= (_CORBA_LongLong& a, cdrStream& s); - friend inline void operator>>= (_CORBA_ULongLong a, cdrStream& s); - friend inline void operator<<= (_CORBA_ULongLong& a, cdrStream& s); -# endif -#endif -#if !defined(NO_FLOAT) + inline _CORBA_Double unmarshalDouble() { + omni::ptr_arith_t p1 = inMkr(omni::ALIGN_8); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_Double); + if ((void*)p2 <= pd_inb_end) { + pd_inb_mkr = (void*) p2; + + struct LongArray2 { _CORBA_ULong l[2]; }; -#ifndef OMNI_NO_INLINE_FRIENDS - friend inline void operator>>= (_CORBA_Float a, cdrStream& s) { - convertFromFloat(_CORBA_Float, _CORBA_ULong); - if (s.pd_marshal_byte_swap) { - l = Swap32(l); - } - CdrMarshal(s,_CORBA_ULong,omni::ALIGN_4,l); - } - - friend inline void operator<<= (_CORBA_Float& a, cdrStream& s) { - _CORBA_ULong l; - CdrUnMarshal(s,_CORBA_ULong,omni::ALIGN_4,l); - if (s.pd_unmarshal_byte_swap) { - l = Swap32(l); - } - convertToFloat(_CORBA_Float, _CORBA_ULong); - } - - friend inline void operator>>= (_CORBA_Double a, cdrStream& s) { - struct LongArray2 { _CORBA_ULong l[2]; }; - convertFromFloat(_CORBA_Double, LongArray2); - if (s.pd_marshal_byte_swap) { - LongArray2 m; - m.l[0] = Swap32(l.l[1]); - m.l[1] = Swap32(l.l[0]); - l = m; + LongArray2 l; + + if (!pd_unmarshal_byte_swap) { + l = *((LongArray2*)p1); + } + else { + LongArray2 m = *((LongArray2*)p1); + l.l[0] = byteSwap(m.l[1]); + l.l[1] = byteSwap(m.l[0]); + } + return OMNI_REINTERPRET_CAST(_CORBA_Double, l); } -#ifdef OMNI_MIXED_ENDIAN_DOUBLE - { - _CORBA_ULong v = l.l[0]; - l.l[0] = l.l[1]; - l.l[1] = v; + else { + return fetchAndUnmarshalDouble(); } -#endif - CdrMarshal(s,LongArray2,omni::ALIGN_8,l); } - friend inline void operator<<= (_CORBA_Double& a, cdrStream& s) { - struct LongArray2 { _CORBA_ULong l[2]; } l; - CdrUnMarshal(s,LongArray2,omni::ALIGN_8,l); - if (s.pd_unmarshal_byte_swap) { - LongArray2 m; - m.l[0] = Swap32(l.l[1]); - m.l[1] = Swap32(l.l[0]); - l = m; +# endif // USING_PROXY_FLOAT + + +# if defined(HAS_LongDouble) && defined(HAS_LongLong) + + // We only support LongDouble if we also have LongLong. + +# if SIZEOF_LONG_DOUBLE == 16 + + inline void marshalLongDouble(_CORBA_LongDouble a) { + omni::ptr_arith_t p1 = outMkr(omni::ALIGN_8); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_LongDouble); + if ((void*)p2 <= pd_outb_end) { + pd_outb_mkr = (void*) p2; + + struct LongLongArray2 { _CORBA_ULongLong l[2]; }; + union { _CORBA_LongDouble a; LongLongArray2 l; } u; + u.a = a; + + if (!pd_marshal_byte_swap) { + *((LongLongArray2*)p1) = u.l; + } + else { + LongLongArray2 m; + m.l[0] = byteSwap(u.l.l[1]); + m.l[1] = byteSwap(u.l.l[0]); + *((LongLongArray2*)p1) = m; + } } -#ifdef OMNI_MIXED_ENDIAN_DOUBLE - { - _CORBA_ULong v = l.l[0]; - l.l[0] = l.l[1]; - l.l[1] = v; + else { + reserveAndMarshalLongDouble(a); } -#endif - convertToFloat(_CORBA_Double, LongArray2); } -#else - friend inline void operator>>= (_CORBA_Float a, cdrStream& s); - friend inline void operator<<= (_CORBA_Float& a, cdrStream& s); - friend inline void operator>>= (_CORBA_Double a, cdrStream& s); - friend inline void operator<<= (_CORBA_Double& a, cdrStream& s); -#endif -#endif -#ifdef HAS_LongDouble + inline _CORBA_LongDouble unmarshalLongDouble() { + omni::ptr_arith_t p1 = inMkr(omni::ALIGN_8); + omni::ptr_arith_t p2 = p1 + sizeof(_CORBA_LongDouble); + if ((void*)p2 <= pd_inb_end) { + pd_inb_mkr = (void*) p2; -#if SIZEOF_LONG_DOUBLE == 16 + struct LongLongArray2 { _CORBA_ULongLong l[2]; }; + union { _CORBA_LongDouble a; LongLongArray2 l; } u; -#ifndef OMNI_NO_INLINE_FRIENDS - friend inline void operator>>= (_CORBA_LongDouble a, cdrStream& s) { - struct LongArray4 { _CORBA_ULong l[4]; }; - convertFromFloat(_CORBA_LongDouble, LongArray4); - if (s.pd_marshal_byte_swap) { - LongArray4 m; - m.l[0] = Swap32(l.l[3]); - m.l[1] = Swap32(l.l[2]); - m.l[2] = Swap32(l.l[1]); - m.l[3] = Swap32(l.l[0]); - l = m; - } - CdrMarshal(s,LongArray4,omni::ALIGN_8,l); - } - - friend inline void operator<<= (_CORBA_LongDouble& a, cdrStream& s) { - struct LongArray4 { _CORBA_ULong l[4]; } l; - CdrUnMarshal(s,LongArray4,omni::ALIGN_8,l); - if (s.pd_unmarshal_byte_swap) { - LongArray4 m; - m.l[0] = Swap32(l.l[3]); - m.l[1] = Swap32(l.l[2]); - m.l[2] = Swap32(l.l[1]); - m.l[3] = Swap32(l.l[0]); - l = m; + if (!pd_unmarshal_byte_swap) { + u.l = *((LongLongArray2*)p1); + } + else { + LongLongArray2 m = *((LongLongArray2*)p1); + u.l.l[0] = byteSwap(m.l[1]); + u.l.l[1] = byteSwap(m.l[0]); + } + return u.a; + } + else { + return fetchAndUnmarshalLongDouble(); } - convertToFloat(_CORBA_LongDouble, LongArray4); } -#else - friend inline void operator>>= (_CORBA_LongDouble a, cdrStream& s); - friend inline void operator<<= (_CORBA_LongDouble& a, cdrStream& s); -#endif -#else + +# else // Code for long double < 16 bytes is too painful to put inline - friend void operator>>= (_CORBA_LongDouble a, cdrStream& s); - friend void operator<<= (_CORBA_LongDouble& a, cdrStream& s); -#endif -#endif + void marshalLongDouble(_CORBA_LongDouble a); + _CORBA_LongDouble unmarshalLongDouble(); +# endif + +# endif // HAS_LongDouble + +#endif // NO_FLOAT + + + // + // Marshalling methods : string types inline void marshalString(const char* s,int bounded=0) { OMNIORB_USER_CHECK(s); @@ -614,12 +479,28 @@ return s; } + + // + // Pure virtual functions + virtual void put_octet_array(const _CORBA_Octet* b, int size, omni::alignment_t align=omni::ALIGN_1) = 0; + // Align output then put array of octets. // must be a multiple of . // For instance, if == omni::ALIGN_8 then % 8 == 0. - void put_small_octet_array(const _CORBA_Octet* b, int size); + inline void put_small_octet_array(const _CORBA_Octet* b, int size) { + omni::ptr_arith_t p1 = (omni::ptr_arith_t)pd_outb_mkr; + omni::ptr_arith_t p2 = p1 + size; + + if ((void*)p2 <= pd_outb_end) { + memcpy(pd_outb_mkr, b, size); + pd_outb_mkr = (void*)p2; + } + else { + put_octet_array(b, size); + } + } // Put a small octet array which must have ALIGN_1. Since it is // small, we expect it to fit in the stream's current buffer without // having to allocate more space. @@ -668,142 +549,45 @@ // default. - inline - void alignInput(omni::alignment_t align) + inline void alignInput(omni::alignment_t align) // Align the buffer of the input stream to . - { - again: - omni::ptr_arith_t p1 = omni::align_to((omni::ptr_arith_t)pd_inb_mkr, - align); - if ((void*)p1 > pd_inb_end) { - fetchInputData(align,0); - goto again; - } - pd_inb_mkr = (void*)p1; + { + again: + omni::ptr_arith_t p1 = inMkr(align); + if ((void*)p1 > pd_inb_end) { + fetchInputData(align,0); + goto again; } + pd_inb_mkr = (void*)p1; + } - inline - void alignOutput(omni::alignment_t align) + inline void alignOutput(omni::alignment_t align) // Align the buffer of the output stream to . - { - again: - omni::ptr_arith_t p1 = omni::align_to((omni::ptr_arith_t)pd_outb_mkr, - align); - if ((void*)p1 > pd_outb_end) { - if (reserveOutputSpaceForPrimitiveType(align,0)) - goto again; - } - pd_outb_mkr = (void*)p1; + { + again: + omni::ptr_arith_t p1 = outMkr(align); + if ((void*)p1 > pd_outb_end) { + if (reserveOutputSpaceForPrimitiveType(align,0)) + goto again; } + pd_outb_mkr = (void*)p1; + } - inline - _CORBA_Boolean unmarshal_byte_swap() const { return pd_unmarshal_byte_swap; } + inline _CORBA_Boolean + unmarshal_byte_swap() const { return pd_unmarshal_byte_swap; } // Return TRUE(1) if unmarshalled data have to be byte-swapped. - inline - _CORBA_Boolean marshal_byte_swap() const { return pd_marshal_byte_swap; } - - inline - void* PR_get_outb_mkr() { return pd_outb_mkr; } - // internal function used by cdrStream implementations - -protected: - - _CORBA_Boolean pd_unmarshal_byte_swap; - // TRUE(1) if unmarshalled data have to be byte-swapped. - - _CORBA_Boolean pd_marshal_byte_swap; - // TRUE(1) if marshalled data have to be byte-swapped. I.e. data are not - // going into the stream with the host endian. + inline _CORBA_Boolean + marshal_byte_swap() const { return pd_marshal_byte_swap; } - // Input buffer pointers, the region (*p) containing valid data - // is pd_inb_mkr <= p < pd_inb_end. - // pd_inb_end and pd_inb_mkr are initialised by fetchInputData(). - // pd_inb_mkr is also updated by the unmarshalling operators between - // calls to fetchInputData(). - void* pd_inb_end; - void* pd_inb_mkr; - - virtual void fetchInputData(omni::alignment_t align, - size_t required) = 0; - // Fetch at least bytes into the input buffer. - // must be no more than 8 bytes && align == required!! - // The data block should start at alignment . - // If the space available is less than specified, raise a - // MARSHAL system exception. - - // Output buffer pointers, the region (*p) that can be written - // into is pd_outb_mkr <= p < pd_outb_end. - // pd_outb_end and pd_outb_mkr are initialised by reserveOutputSpace(). - // pd_outb_mkr is also updated by the marshalling operators between - // calls to reserveOutputSpace(). - void* pd_outb_end; - void* pd_outb_mkr; - - virtual - _CORBA_Boolean reserveOutputSpaceForPrimitiveType(omni::alignment_t align, - size_t required) = 0; - // Allocate at least bytes in the output buffer. - // The data block should start at alignment . - // must be no more than 8 bytes && align == required!! - // Returns TRUE(1) if at least bytes with the starting - // alignment as specified has been allocated. - // Returns FALSE(0) if the required space cannot be allocated. - // When the return value is FALSE, the cdrStream would skip writing - // the current argument quietly. - // If the derived class do not want the cdrStream to skip writing - // quietly, it should raise a MARSHAL system exception instead of - // returning FALSE. - - virtual _CORBA_Boolean maybeReserveOutputSpace(omni::alignment_t align, - size_t required) = 0; - // Same as reserveOutputSpaceForPrimitiveType, except the following: - // 1. The required size can be any size. - // 2. The implementation of this function can throw CORBA::BAD_PARAM - // if the nature of the stream makes it impossible to fullfil this - // request. The caller should fall back to use put_octet_array or - // other means instead. - _OMNI_NS(omniCodeSet::TCS_C)* pd_tcs_c; - // Transmission code set convertor for char and string - - _OMNI_NS(omniCodeSet::TCS_W)* pd_tcs_w; - // Transmission code set convertor for wchar and wstring - - _OMNI_NS(omniCodeSet::NCS_C)* pd_ncs_c; - _OMNI_NS(omniCodeSet::NCS_W)* pd_ncs_w; - - _OMNI_NS(ValueIndirectionTracker)* pd_valueTracker; - // Object used to track offsets of indirections in valuetypes. - -public: - - // Access functions to the char and wchar code set convertors - inline _OMNI_NS(omniCodeSet::TCS_C)* TCS_C() const { return pd_tcs_c; } - inline void TCS_C(_OMNI_NS(omniCodeSet::TCS_C)* c) { pd_tcs_c = c; } - inline _OMNI_NS(omniCodeSet::TCS_W)* TCS_W() const { return pd_tcs_w; } - inline void TCS_W(_OMNI_NS(omniCodeSet::TCS_W)* c) { pd_tcs_w = c; } - - // Access functions to the value indirection tracker - inline _OMNI_NS(ValueIndirectionTracker)* valueTracker() const { - return pd_valueTracker; - } - inline void valueTracker(_OMNI_NS(ValueIndirectionTracker)* v) { - pd_valueTracker = v; - } - inline void clearValueTracker() { - if (pd_valueTracker) { - delete pd_valueTracker; - pd_valueTracker = 0; - } - } - - virtual void declareArrayLength(omni::alignment_t align, size_t size); + // + // Marshalling methods: array types inline void - unmarshalArrayChar(_CORBA_Short* a, int length) + unmarshalArrayChar(_CORBA_Char* a, int length) { - for( int i = 0; i < length; i++ ) + for (int i = 0; i < length; i++) a[i] = unmarshalChar(); } @@ -813,7 +597,7 @@ #if !defined(HAS_Cplusplus_Bool) || (SIZEOF_BOOL == 1) get_octet_array((_CORBA_Char*)a, length, omni::ALIGN_1); #else - for( int i = 0; i < length; i++ ) + for (int i = 0; i < length; i++) a[i] = unmarshalBoolean(); #endif } @@ -821,63 +605,63 @@ inline void unmarshalArrayShort(_CORBA_Short* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 2, omni::ALIGN_2); + get_octet_array((_CORBA_Char*)a, length * 2, omni::ALIGN_2); - if( unmarshal_byte_swap() ) - for( int i = 0; i < length; i++ ) - a[i] = Swap16(a[i]); + if (unmarshal_byte_swap()) + for (int i = 0; i < length; i++) + a[i] = byteSwap(a[i]); } inline void unmarshalArrayUShort(_CORBA_UShort* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 2, omni::ALIGN_2); + get_octet_array((_CORBA_Char*)a, length * 2, omni::ALIGN_2); - if( unmarshal_byte_swap() ) - for( int i = 0; i < length; i++ ) - a[i] = Swap16(a[i]); + if (unmarshal_byte_swap()) + for (int i = 0; i < length; i++) + a[i] = byteSwap(a[i]); } inline void unmarshalArrayLong(_CORBA_Long* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 4, omni::ALIGN_4); + get_octet_array((_CORBA_Char*)a, length * 4, omni::ALIGN_4); - if( unmarshal_byte_swap() ) - for( int i = 0; i < length; i++ ) - a[i] = Swap32(a[i]); + if (unmarshal_byte_swap()) + for (int i = 0; i < length; i++) + a[i] = byteSwap(a[i]); } inline void unmarshalArrayULong(_CORBA_ULong* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 4, omni::ALIGN_4); + get_octet_array((_CORBA_Char*)a, length * 4, omni::ALIGN_4); - if( unmarshal_byte_swap() ) - for( int i = 0; i < length; i++ ) - a[i] = Swap32(a[i]); + if (unmarshal_byte_swap()) + for (int i = 0; i < length; i++) + a[i] = byteSwap(a[i]); } #ifdef HAS_LongLong inline void unmarshalArrayLongLong(_CORBA_LongLong* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 8, omni::ALIGN_8); + get_octet_array((_CORBA_Char*)a, length * 8, omni::ALIGN_8); - if( unmarshal_byte_swap() ) - for( int i = 0; i < length; i++ ) - a[i] = Swap64(a[i]); + if (unmarshal_byte_swap()) + for (int i = 0; i < length; i++) + a[i] = byteSwap(a[i]); } inline void unmarshalArrayULongLong(_CORBA_ULongLong* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 8, omni::ALIGN_8); + get_octet_array((_CORBA_Char*)a, length * 8, omni::ALIGN_8); - if( unmarshal_byte_swap() ) - for( int i = 0; i < length; i++ ) - a[i] = Swap64(a[i]); + if (unmarshal_byte_swap()) + for (int i = 0; i < length; i++) + a[i] = byteSwap(a[i]); } #endif @@ -885,12 +669,12 @@ inline void unmarshalArrayFloat(_CORBA_Float* a, int length) { - get_octet_array((_CORBA_Char*) a, length * 4, omni::ALIGN_4); + get_octet_array((_CORBA_Char*)a, length * 4, omni::ALIGN_4); - if( unmarshal_byte_swap() ) { + if (unmarshal_byte_swap()) { _CORBA_ULong* p=(_CORBA_ULong*)a; for( int i = 0; i < length; i++ ) { - p[i] = Swap32(p[i]); + p[i] = byteSwap(p[i]); } } } @@ -901,19 +685,27 @@ { get_octet_array((_CORBA_Char*) a, length * 8, omni::ALIGN_8); - if( unmarshal_byte_swap() ) { + if (unmarshal_byte_swap()) { + +# if defined(Has_Longlong) && !defined (OMNI_MIXED_ENDIAN_DOUBLE) + _CORBA_ULongLong* p=(_CORBA_ULongLong*)a; + for( int i = 0; i < length; i++ ) { + p[i] = byteSwap(p[i]); + } +# else struct LongArray2 { _CORBA_ULong l[2]; }; LongArray2* p=(LongArray2*)a; - for( int i = 0; i < length; i++ ) { + for (int i = 0; i < length; i++) { LongArray2 l; - l.l[0] = Swap32(p[i].l[1]); - l.l[1] = Swap32(p[i].l[0]); + l.l[0] = byteSwap(p[i].l[1]); + l.l[1] = byteSwap(p[i].l[0]); p[i] = l; } +# endif } -#ifdef OMNI_MIXED_ENDIAN_DOUBLE +# ifdef OMNI_MIXED_ENDIAN_DOUBLE { struct LongArray2 { _CORBA_ULong l[2]; @@ -925,11 +717,173 @@ p[i].l[1] = v; } } +# endif + } #endif + + inline void* inPtr() const { return pd_inb_mkr; } + inline void* outPtr() const { return pd_outb_mkr; } + + inline void* inData(_CORBA_ULong size) + { + omni::ptr_arith_t p1 = inMkr(); + omni::ptr_arith_t p2 = p1 + size; + + if ((void*)p2 <= pd_inb_end) { + pd_inb_mkr = (void*)p2; + return (void*)p1; + } + else + return 0; } + // If there is enough data in the buffer, return pointer to + // bytes of input data, and skip the input pointer forwards + // accordingly. If there is insufficient data, return zero. + + +protected: + + _CORBA_Boolean pd_unmarshal_byte_swap; + // TRUE(1) if unmarshalled data have to be byte-swapped. + + _CORBA_Boolean pd_marshal_byte_swap; + // TRUE(1) if marshalled data have to be byte-swapped. i.e. data are not + // going into the stream with the host endian. + + // Input buffer pointers, the region (*p) containing valid data + // is pd_inb_mkr <= p < pd_inb_end. + // pd_inb_end and pd_inb_mkr are initialised by fetchInputData(). + // pd_inb_mkr is also updated by the unmarshalling operators between + // calls to fetchInputData(). + void* pd_inb_end; + void* pd_inb_mkr; + + inline omni::ptr_arith_t inEnd() { return (omni::ptr_arith_t)pd_inb_end; } + inline omni::ptr_arith_t inMkr() { return (omni::ptr_arith_t)pd_inb_mkr; } + + inline omni::ptr_arith_t inMkr(omni::alignment_t align) + { + return omni::align_to((omni::ptr_arith_t)pd_inb_mkr, align); + } + + virtual void fetchInputData(omni::alignment_t align, size_t required) = 0; + // Fetch at least bytes into the input buffer. + // must be no more than 8 bytes && align == required!! + // The data block should start at alignment . + // If the space available is less than specified, raise a + // MARSHAL system exception. + + // Output buffer pointers, the region (*p) that can be written + // into is pd_outb_mkr <= p < pd_outb_end. + // pd_outb_end and pd_outb_mkr are initialised by reserveOutputSpace(). + // pd_outb_mkr is also updated by the marshalling operators between + // calls to reserveOutputSpace(). + void* pd_outb_end; + void* pd_outb_mkr; + + inline omni::ptr_arith_t outEnd() { return (omni::ptr_arith_t)pd_outb_end; } + inline omni::ptr_arith_t outMkr() { return (omni::ptr_arith_t)pd_outb_mkr; } + + inline omni::ptr_arith_t outMkr(omni::alignment_t align) + { + return omni::align_to((omni::ptr_arith_t)pd_outb_mkr, align); + } + + virtual + _CORBA_Boolean reserveOutputSpaceForPrimitiveType(omni::alignment_t align, + size_t required) = 0; + // Allocate at least bytes in the output buffer. + // The data block should start at alignment . + // must be no more than 8 bytes && align == required!! + // Returns TRUE(1) if at least bytes with the starting + // alignment as specified has been allocated. + // Returns FALSE(0) if the required space cannot be allocated. + // When the return value is FALSE, the cdrStream would skip writing + // the current argument quietly. + // If the derived class do not want the cdrStream to skip writing + // quietly, it should raise a MARSHAL system exception instead of + // returning FALSE. + + virtual _CORBA_Boolean maybeReserveOutputSpace(omni::alignment_t align, + size_t required) = 0; + // Same as reserveOutputSpaceForPrimitiveType, except the following: + // 1. The required size can be any size. + // 2. The implementation of this function can throw CORBA::BAD_PARAM + // if the nature of the stream makes it impossible to fullfil this + // request. The caller should fall back to use put_octet_array or + // other means instead. + + _OMNI_NS(omniCodeSet::TCS_C)* pd_tcs_c; + // Transmission code set convertor for char and string + + _OMNI_NS(omniCodeSet::TCS_W)* pd_tcs_w; + // Transmission code set convertor for wchar and wstring + + _OMNI_NS(omniCodeSet::NCS_C)* pd_ncs_c; + _OMNI_NS(omniCodeSet::NCS_W)* pd_ncs_w; + + _OMNI_NS(ValueIndirectionTracker)* pd_valueTracker; + // Object used to track offsets of indirections in valuetypes. + + +private: + // + // Marshalling functions used when there is not enough buffer space + // for the inline versions. + +#define fetchReserveMarshalFns(type) \ + void reserveAndMarshal ## type(_CORBA_ ## type a); \ + _CORBA_ ## type fetchAndUnmarshal ## type() + + fetchReserveMarshalFns(Octet); + fetchReserveMarshalFns(Short); + fetchReserveMarshalFns(UShort); + fetchReserveMarshalFns(Long); + fetchReserveMarshalFns(ULong); +#ifdef HAS_LongLong + fetchReserveMarshalFns(LongLong); + fetchReserveMarshalFns(ULongLong); +#endif +#ifndef NO_FLOAT + fetchReserveMarshalFns(Double); +# if defined(HAS_LongDouble) && defined(HAS_LongLong) + fetchReserveMarshalFns(LongDouble); +# endif #endif +#undef fetchReserveMarshalFns + public: + + // Access functions to the char and wchar code set convertors + inline _OMNI_NS(omniCodeSet::TCS_C)* TCS_C() const { return pd_tcs_c; } + inline void TCS_C(_OMNI_NS(omniCodeSet::TCS_C)* c) { pd_tcs_c = c; } + inline _OMNI_NS(omniCodeSet::TCS_W)* TCS_W() const { return pd_tcs_w; } + inline void TCS_W(_OMNI_NS(omniCodeSet::TCS_W)* c) { pd_tcs_w = c; } + + + // + // Valuetype related methods + + inline _OMNI_NS(ValueIndirectionTracker)* valueTracker() const { + return pd_valueTracker; + } + inline void valueTracker(_OMNI_NS(ValueIndirectionTracker)* v) { + pd_valueTracker = v; + } + inline void clearValueTracker() { + if (pd_valueTracker) { + delete pd_valueTracker; + pd_valueTracker = 0; + } + } + + virtual void declareArrayLength(omni::alignment_t align, size_t size); + // Declare that an array of size octets, alignment is + // about to be marshalled. This allows chunked streams to + // pre-allocate a suitable sized chunk. + + ///////////////////////////////////////////////////////////////////// virtual _CORBA_ULong completion(); // If an error occurs when a value is marshalled or unmarshalled, a @@ -965,216 +919,93 @@ // pointers and virtual functions. }; -#ifdef OMNI_NO_INLINE_FRIENDS - -inline void operator>>= (_CORBA_Short a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_Short t = Swap16(a); - a = t; - } - CdrMarshal(s,_CORBA_Short,omni::ALIGN_2,a); -} - -inline void operator<<= (_CORBA_Short& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_Short,omni::ALIGN_2,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_Short t = Swap16(a); - a = t; - } -} - -inline void operator>>= (_CORBA_UShort a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_UShort t = Swap16(a); - a = t; - } - CdrMarshal(s,_CORBA_UShort,omni::ALIGN_2,a); -} - -inline void operator<<= (_CORBA_UShort& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_UShort,omni::ALIGN_2,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_UShort t = Swap16(a); - a = t; - } -} - -inline void operator>>= (_CORBA_Long a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_Long t = Swap32(a); - a = t; - } - CdrMarshal(s,_CORBA_Long,omni::ALIGN_4,a); -} -inline void operator<<= (_CORBA_Long& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_Long,omni::ALIGN_4,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_Long t = Swap32(a); - a = t; - } -} +// +// Marshalling operators -inline void operator>>= (_CORBA_ULong a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_ULong t = Swap32(a); - a = t; - } - CdrMarshal(s,_CORBA_ULong,omni::ALIGN_4,a); -} - -inline void operator<<= (_CORBA_ULong& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_ULong,omni::ALIGN_4,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_ULong t = Swap32(a); - a = t; - } +#define marshallingOperators(type) \ +inline void operator>>= (_CORBA_ ## type a, cdrStream& s) {\ + s.marshal ## type(a);\ +} \ +inline void operator<<= (_CORBA_ ## type& a, cdrStream& s) {\ + a = s.unmarshal ## type();\ } +marshallingOperators(Short) +marshallingOperators(UShort) +marshallingOperators(Long) +marshallingOperators(ULong) #ifdef HAS_LongLong -inline void operator>>= (_CORBA_LongLong a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_LongLong t = Swap64(a); - a = t; - } - CdrMarshal(s,_CORBA_LongLong,omni::ALIGN_8,a); -} - -inline void operator<<= (_CORBA_LongLong& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_LongLong,omni::ALIGN_8,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_LongLong t = Swap64(a); - a = t; - } -} - -inline void operator>>= (_CORBA_ULongLong a, cdrStream& s) { - if (s.pd_marshal_byte_swap) { - _CORBA_ULongLong t = Swap64(a); - a = t; - } - CdrMarshal(s,_CORBA_ULongLong,omni::ALIGN_8,a); -} - -inline void operator<<= (_CORBA_ULongLong& a, cdrStream& s) { - CdrUnMarshal(s,_CORBA_ULongLong,omni::ALIGN_8,a); - if (s.pd_unmarshal_byte_swap) { - _CORBA_ULongLong t = Swap64(a); - a = t; - } -} +marshallingOperators(LongLong) +marshallingOperators(ULongLong) #endif - #if !defined(NO_FLOAT) +marshallingOperators(Float) +marshallingOperators(Double) +# if defined(HAS_LongDouble) && defined(HAS_LongLong) +marshallingOperators(LongDouble) +# endif +#endif -inline void operator>>= (_CORBA_Float a, cdrStream& s) { - convertFromFloat(_CORBA_Float, _CORBA_ULong); - if (s.pd_marshal_byte_swap) { - l = Swap32(l); - } - CdrMarshal(s,_CORBA_ULong,omni::ALIGN_4,l); -} +#undef marshallingOperators -inline void operator<<= (_CORBA_Float& a, cdrStream& s) { - _CORBA_ULong l; - CdrUnMarshal(s,_CORBA_ULong,omni::ALIGN_4,l); - if (s.pd_unmarshal_byte_swap) { - l = Swap32(l); - } - convertToFloat(_CORBA_Float, _CORBA_ULong); -} +// +// These are not implemented. They are here to cause linker errors in +// code that accidentally tries to use them. -inline void operator>>= (_CORBA_Double a, cdrStream& s) { - struct LongArray2 { _CORBA_ULong l[2]; }; - convertFromFloat(_CORBA_Double, LongArray2); - if (s.pd_marshal_byte_swap) { - LongArray2 m; - m.l[0] = Swap32(l.l[1]); - m.l[1] = Swap32(l.l[0]); - l = m; - } -#ifdef OMNI_MIXED_ENDIAN_DOUBLE - { - _CORBA_ULong v = l.l[0]; - l.l[0] = l.l[1]; - l.l[1] = v; - } -#endif - CdrMarshal(s,LongArray2,omni::ALIGN_8,l); -} +void operator>>=(char a, cdrStream& s); +void operator<<=(char& a, cdrStream& s); -inline void operator<<= (_CORBA_Double& a, cdrStream& s) { - struct LongArray2 { _CORBA_ULong l[2]; } l; - CdrUnMarshal(s,LongArray2,omni::ALIGN_8,l); - if (s.pd_unmarshal_byte_swap) { - LongArray2 m; - m.l[0] = Swap32(l.l[1]); - m.l[1] = Swap32(l.l[0]); - l = m; - } -#ifdef OMNI_MIXED_ENDIAN_DOUBLE - { - _CORBA_ULong v = l.l[0]; - l.l[0] = l.l[1]; - l.l[1] = v; - } -#endif - convertToFloat(_CORBA_Double, LongArray2); -} +void operator>>=(unsigned char a, cdrStream& s); +void operator<<=(unsigned char& a, cdrStream& s); -#endif +#ifdef HAS_Cplusplus_Bool -#ifdef HAS_LongDouble -#if SIZEOF_LONG_DOUBLE == 16 -inline void operator>>= (_CORBA_LongDouble a, cdrStream& s) { - struct LongArray4 { _CORBA_ULong l[4]; }; - convertFromFloat(_CORBA_LongDouble, LongArray4); - if (s.pd_marshal_byte_swap) { - LongArray4 m; - m.l[0] = Swap32(l.l[3]); - m.l[1] = Swap32(l.l[2]); - m.l[2] = Swap32(l.l[1]); - m.l[3] = Swap32(l.l[0]); - l = m; - } - CdrMarshal(s,LongArray4,omni::ALIGN_8,l); -} +void operator>>=(bool a, cdrStream& s); +void operator<<=(bool& a, cdrStream& s); -inline void operator<<= (_CORBA_LongDouble& a, cdrStream& s) { - struct LongArray4 { _CORBA_ULong l[4]; } l; - CdrUnMarshal(s,LongArray4,omni::ALIGN_8,l); - if (s.pd_unmarshal_byte_swap) { - LongArray4 m; - m.l[0] = Swap32(l.l[3]); - m.l[1] = Swap32(l.l[2]); - m.l[2] = Swap32(l.l[1]); - m.l[3] = Swap32(l.l[0]); - l = m; - } - convertToFloat(_CORBA_LongDouble, LongArray4); -} -#endif -#endif - #endif + +// +// Memory buffered stream + class cdrMemoryStream : public cdrStream { public: cdrMemoryStream(_CORBA_ULong initialBufsize = 0, _CORBA_Boolean clearMemory = 0); virtual ~cdrMemoryStream(); - void rewindInputPtr(); + inline void rewindInputPtr() + { + pd_inb_mkr = pd_bufp_8; + pd_inb_end = (pd_readonly_and_external_buffer) ? pd_inb_end : pd_outb_mkr; + } // Rewind the input pointer to the beginning of the buffer - void rewindPtrs(); + inline void rewindPtrs() + { + if (!pd_readonly_and_external_buffer) { + pd_outb_mkr = pd_inb_mkr = pd_inb_end = pd_bufp_8; + } + else { + pd_outb_mkr = pd_outb_end = 0; + pd_inb_mkr = pd_bufp; + } + } // Rewind the both input and output pointers to the beginning of the buffer // bufSize() returns 0 after this call. - _CORBA_ULong bufSize() const; + inline _CORBA_ULong bufSize() const + { + return (_CORBA_ULong)((omni::ptr_arith_t)pd_outb_mkr - + (omni::ptr_arith_t)pd_bufp_8); + } // Returns the size of the buffer containing valid data. - void* bufPtr() const; + inline void* bufPtr() const { + return pd_bufp_8; + } // Returns a pointer to the beginning of the buffer. void setByteSwapFlag(_CORBA_Boolean littleendian); @@ -1238,6 +1069,12 @@ _CORBA_Boolean reserveOutputSpace(omni::alignment_t,size_t); }; + +// +// Specialisation of memory stream to handle CDR encapsulations + +class _CORBA_Unbounded_Sequence_Octet; + class cdrEncapsulationStream : public cdrMemoryStream { public: cdrEncapsulationStream(_CORBA_ULong initialBufsize = 0, @@ -1247,12 +1084,21 @@ _CORBA_ULong bufsize, _CORBA_Boolean allowAlign4 = 0); + cdrEncapsulationStream(const _CORBA_Unbounded_Sequence_Octet& seq, + _CORBA_Boolean allowAlign4 = 0); + cdrEncapsulationStream(cdrStream& s,_CORBA_ULong fetchsize); // copy from bytes of data. - void getOctetStream(_CORBA_Octet*& databuffer, _CORBA_ULong& max, - _CORBA_ULong& len); + void getOctetStream(_CORBA_Octet*& databuffer, + _CORBA_ULong& max, + _CORBA_ULong& len); + // Return stream's buffer. Takes ownership of the buffer. + + void setOctetSeq(_CORBA_Unbounded_Sequence_Octet& seq); + // Set octet sequence from the stream's buffer. Ownership of the + // buffer is passed to the sequence. virtual void* ptrToClass(int* cptr); static inline cdrEncapsulationStream* downcast(cdrStream* s) { @@ -1261,6 +1107,10 @@ static _core_attr int _classid; }; + +// +// Fake stream that counts how many octets are marshalled + class cdrCountingStream : public cdrStream { public: cdrCountingStream(_OMNI_NS(omniCodeSet::TCS_C)* tcs_c, @@ -1318,6 +1168,9 @@ }; +// +// Stream adapter + // In some circumstances, for example in omniORBpy, it is necessary to // perform some extra work around operations which manage a // cdrStream's buffers. cdrStreamAdapter provides a wrapper around a @@ -1404,6 +1257,9 @@ }; +// +// Valuetype support + // cdrValueChunkStream is similar to cdrStreamAdapter. It implements // chunked encoding of valuetypes by wrapping an existing stream. // @@ -1540,12 +1396,12 @@ inline void setLength(_CORBA_ULong len) { - *pd_lengthPtr = pd_marshal_byte_swap ? Swap32(len) : len; + *pd_lengthPtr = pd_marshal_byte_swap ? byteSwap(len) : len; } inline _CORBA_ULong getLength() { - return pd_unmarshal_byte_swap ? Swap32(*pd_lengthPtr) : *pd_lengthPtr; + return pd_unmarshal_byte_swap ? byteSwap(*pd_lengthPtr) : *pd_lengthPtr; } cdrStream& pd_actual; // Stream being wrapped @@ -1564,10 +1420,5 @@ #undef CdrMarshal #undef CdrUnMarshal -#undef convertFromFloat -#undef convertToFloat -#undef Swap16 -#undef Swap32 -#undef Swap64 #endif /* __CDRSTREAM_H__ */ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/codeSets.h omniorb-dfsg-4.2.2/include/omniORB4/codeSets.h --- omniorb-dfsg-4.1.6/include/omniORB4/codeSets.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/codeSets.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,65 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.3 2008/08/08 18:45:49 dgrisby - Add missing ISO-8859 and Windows code sets. - - Revision 1.1.4.2 2005/12/08 14:22:31 dgrisby - Better string marshalling performance; other minor optimisations. - - Revision 1.1.4.1 2003/03/23 21:04:17 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.9 2003/03/03 12:32:32 dgrisby - EBCDIC code sets. Thanks Coleman Corrigan. - - Revision 1.1.2.8 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.7 2002/12/19 13:56:58 dgrisby - New Windows 1251 code set. (Thanks Vasily Tchekalkin). - - Revision 1.1.2.6 2001/06/13 20:06:18 sll - Minor fix to make the ORB compile with MSVC++. - - Revision 1.1.2.5 2000/11/22 14:37:58 dpg1 - Code set marshalling functions now take a string length argument. - - Revision 1.1.2.4 2000/11/16 12:33:43 dpg1 - Minor fixes to permit use of UShort as WChar. - - Revision 1.1.2.3 2000/11/15 17:15:42 sll - Added definition for the TAG_CODE_SETS component. - - Revision 1.1.2.2 2000/11/09 12:23:04 dpg1 - Update to compile on Solaris - - Revision 1.1.2.1 2000/10/27 15:42:03 dpg1 - Initial code set conversion support. Not yet enabled or fully tested. - -*/ - #ifndef __CODESETS_H__ #define __CODESETS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_AbstractBase.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_AbstractBase.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_AbstractBase.h 2004-10-13 18:00:33.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_AbstractBase.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,33 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // AbstractBase definitions // -/* - $Log$ - Revision 1.1.2.1 2004/04/02 13:26:25 dgrisby - Start refactoring TypeCode to support value TypeCodes, start of - abstract interfaces support. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Any.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Any.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Any.h 2006-11-02 17:33:08.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Any.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,62 +3,29 @@ // CORBA_Any.h Created on: 2001/08/17 // Author : Duncan Grisby (dgrisby) // -// Copyright (C) 2004 Apasphere Ltd. +// Copyright (C) 2004-2011 Apasphere Ltd. // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Any // -/* - $Log$ - Revision 1.1.4.4 2004/10/13 17:58:18 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.1.4.3 2004/07/23 10:29:56 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.1.4.2 2004/02/16 10:10:28 dgrisby - More valuetype, including value boxes. C++ mapping updates. - - Revision 1.1.4.1 2003/03/23 21:04:25 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.5 2003/01/16 12:47:08 dgrisby - Const cast macro. Thanks Matej Kenda. - - Revision 1.1.2.4 2002/03/11 12:23:03 dpg1 - Tweaks to avoid compiler warnings. - - Revision 1.1.2.3 2002/01/09 11:37:46 dpg1 - Platform, constness fixes. - - Revision 1.1.2.2 2001/10/17 16:43:59 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/08/17 13:39:44 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -255,7 +222,36 @@ // - // Deprecated non-typesafe functions. Do not use. + // omniORB non-portable extensions + // + + TypeCode_ptr NP_type() const; + // Non-portable equivalent of type() that borrows a reference to the + // TypeCode. + + inline void NP_swap(CORBA::Any& other) + { + CORBA::TypeCode_ptr tc = pd_tc; + cdrAnyMemoryStream* mbuf = pd_mbuf; + void* data = pd_data; + pr_marshal_fn marshal = pd_marshal; + pr_destructor_fn destructor = pd_destructor; + + pd_tc = other.pd_tc; + pd_mbuf = other.pd_mbuf; + pd_data = other.pd_data; + pd_marshal = other.pd_marshal; + pd_destructor = other.pd_destructor; + + other.pd_tc = tc; + other.pd_mbuf = mbuf; + other.pd_data = data; + other.pd_marshal = marshal; + other.pd_destructor = destructor; + } + + // + // Non-typesafe functions. // Any(TypeCode_ptr tc, void* value, Boolean release = 0); @@ -325,7 +321,7 @@ Boolean operator>>=(unsigned char&) const; // Not implemented. - TypeCode_member pd_tc; + TypeCode_ptr pd_tc; // The Any contents can be stored in marshalled form, or as a // pointer to the unmarshalled data, or both. When stored as a diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Any_vartypes.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Any_vartypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Any_vartypes.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Any_vartypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,44 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Any_var, etc. // -/* - $Log$ - Revision 1.1.4.3 2004/10/13 17:58:18 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.1.4.2 2004/07/23 10:29:56 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.1.4.1 2003/03/23 21:04:25 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.2 2001/10/17 16:43:59 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/08/17 13:39:44 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -80,19 +59,21 @@ } inline Any_var& operator= (const Any_var& p) { - if (p.pd_data) { - if (!pd_data) { - pd_data = new Any; - if (!pd_data) { - _CORBA_new_operator_return_null(); - // never reach here - } + if (&p != this) { + if (p.pd_data) { + if (!pd_data) { + pd_data = new Any; + if (!pd_data) { + _CORBA_new_operator_return_null(); + // never reach here + } + } + *pd_data = *p.pd_data; + } + else { + if (pd_data) delete pd_data; + pd_data = 0; } - *pd_data = *p.pd_data; - } - else { - if (pd_data) delete pd_data; - pd_data = 0; } return *this; } diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_basetypes.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_basetypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_basetypes.h 2005-01-06 23:11:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_basetypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,95 +3,27 @@ // CORBA_basetypes.h Created on: 30/1/96 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories - Cambridge Ltd // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** - -/* - $Log$ - Revision 1.5.2.1 2003/03/23 21:04:22 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.7 2002/02/18 11:59:12 dpg1 - Full autoconf support. - - Revision 1.2.2.6 2002/01/15 16:38:09 dpg1 - On the road to autoconf. Dependencies refactored, configure.ac - written. No makefiles yet. - - Revision 1.2.2.5 2001/08/03 17:46:39 sll - Replace _CORBA_marshal_error with _CORBA_marshal_sequence_range_check_error. - - Revision 1.2.2.4 2001/03/13 10:32:05 dpg1 - Fixed point support. - - Revision 1.2.2.3 2000/11/15 19:16:30 sll - Added provision to override default mapping of CORBA::WChar to C++ wchar_t. - - Revision 1.2.2.2 2000/10/27 15:42:02 dpg1 - Initial code set conversion support. Not yet enabled or fully tested. - - Revision 1.2.2.1 2000/07/17 10:35:33 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:06 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:37 djr - Moved from omniORB2 + some new files. - - Revision 1.12 1999/08/15 13:52:17 sll - New VMS float implementation. - - Revision 1.11 1999/06/18 21:11:24 sll - Updated copyright notice. - - Revision 1.10 1999/06/18 20:34:22 sll - New function _CORBA_bad_param_freebuf(). - - Revision 1.9 1999/01/07 18:11:58 djr - New functions: _CORBA_invoked_nil_pseudo_ref() - and _CORBA_use_nil_ptr_as_nil_pseudo_objref() - - Revision 1.8 1998/08/11 16:34:47 sll - Changed Float and Double representation on VMS. - - Revision 1.7 1998/03/02 14:05:02 ewc - Patch to fix IDL unions containing structs which contain floats or doubles - (was broken on OpenVMS). - - * Revision 1.6 1998/01/21 12:12:17 sll - * New function _CORBA_null_string_ptr. - * - * Revision 1.5 1998/01/20 16:45:45 sll - * Added support for OpenVMS. - * - Revision 1.4 1997/08/21 22:21:38 sll - New extern function _CORBA_use_nil_ptr_as_nil_objref(). - - * Revision 1.3 1997/05/06 16:05:20 sll - * Public release. - * - */ +// *** PROPRIETARY INTERFACE *** #ifndef __CORBA_BASETYPES_H__ #define __CORBA_BASETYPES_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_BOA.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_BOA.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_BOA.h 2010-05-07 22:48:29.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_BOA.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::BOA // -/* - $Log$ - Revision 1.1.4.1 2003/03/23 21:04:25 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.1 2001/08/17 13:39:44 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Context.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Context.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Context.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Context.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,44 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Context, ContextList // -/* - $Log$ - Revision 1.1.4.2 2004/07/23 10:29:56 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.1.4.1 2003/03/23 21:04:24 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2001/11/27 14:35:07 dpg1 - Context, DII fixes. - - Revision 1.1.2.2 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/08/17 13:39:44 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -128,6 +107,9 @@ class ContextList { public: + typedef ContextList_ptr _ptr_type; + typedef ContextList_var _var_type; + virtual ~ContextList(); virtual ULong count() const = 0; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Current.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Current.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Current.h 2010-05-07 22:48:29.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Current.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Current // -/* - $Log$ - Revision 1.1.2.1 2001/08/17 13:39:45 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_DomainManager.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_DomainManager.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_DomainManager.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_DomainManager.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::DomainManager // -/* - $Log$ - Revision 1.1.2.1 2001/08/17 13:39:45 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Environment.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Environment.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Environment.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Environment.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Environment // -/* - $Log$ - Revision 1.1.2.1 2001/08/17 13:39:45 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Exception.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Exception.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Exception.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Exception.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,46 +3,29 @@ // CORBA_Exception.h Created on: 2001/08/17 // Author : Duncan Grisby (dpg1) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Exception, SystemException, UserException // -/* - $Log$ - Revision 1.1.2.4 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.3 2001/11/01 12:04:31 dpg1 - Function in SystemException to return minor code string. - - Revision 1.1.2.2 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/08/17 13:39:46 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -71,7 +54,7 @@ // returning a pointer to the descendant's type. // NOTE: deprecated function from CORBA 2.2. Same as _downcast. - static Exception* _duplicate(Exception* e); + static Exception* _duplicate(const Exception* e); virtual const char* _name() const; virtual const char* _rep_id() const; @@ -272,16 +255,21 @@ ////////////////////////// PolicyError ////////////////////////// ////////////////////////////////////////////////////////////////////// typedef _CORBA_Short PolicyErrorCode; -_CORBA_MODULE_VARINT const PolicyErrorCode -BAD_POLICY _init_in_decl_( = 0 ); -_CORBA_MODULE_VARINT const PolicyErrorCode -UNSUPPORTED_POLICY _init_in_decl_( = 1 ); -_CORBA_MODULE_VARINT const PolicyErrorCode -BAD_POLICY_TYPE _init_in_decl_( = 2 ); -_CORBA_MODULE_VARINT const PolicyErrorCode -BAD_POLICY_VALUE _init_in_decl_( = 3 ); -_CORBA_MODULE_VARINT const PolicyErrorCode -UNSUPPORTED_POLICY_VALUE _init_in_decl_( = 4 ); + +_CORBA_MODULE_VARINT +const PolicyErrorCode BAD_POLICY _init_in_decl_( = 0 ); + +_CORBA_MODULE_VARINT +const PolicyErrorCode UNSUPPORTED_POLICY _init_in_decl_( = 1 ); + +_CORBA_MODULE_VARINT +const PolicyErrorCode BAD_POLICY_TYPE _init_in_decl_( = 2 ); + +_CORBA_MODULE_VARINT +const PolicyErrorCode BAD_POLICY_VALUE _init_in_decl_( = 3 ); + +_CORBA_MODULE_VARINT +const PolicyErrorCode UNSUPPORTED_POLICY_VALUE _init_in_decl_( = 4 ); _CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_PolicyErrorCode; @@ -307,10 +295,10 @@ void operator>>=(cdrStream&) const; void operator<<=(cdrStream&); - static _dyn_attr insertExceptionToAny insertToAnyFn; - static _dyn_attr insertExceptionToAnyNCP insertToAnyFnNCP; + static _core_attr insertExceptionToAny insertToAnyFn; + static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP; - static _dyn_attr const char* _PD_repoId; + static _core_attr const char* _PD_repoId; private: virtual CORBA::Exception* _NP_duplicate() const; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ExceptionList.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ExceptionList.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ExceptionList.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ExceptionList.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::ExceptionList // -/* - $Log$ - Revision 1.1.2.2 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/08/17 13:39:46 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -53,6 +41,9 @@ class ExceptionList { public: + typedef ExceptionList_ptr _ptr_type; + typedef ExceptionList_var _var_type; + virtual ~ExceptionList(); virtual ULong count() const = 0; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Fixed.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Fixed.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Fixed.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Fixed.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Fixed // -/* - $Log$ - Revision 1.1.2.4 2002/11/25 21:06:59 dgrisby - Add new to_string() function to Fixed. - - Revision 1.1.2.3 2002/10/15 23:24:14 dgrisby - Avoid clash with Solaris defining truncate to truncate64. - - Revision 1.1.2.2 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/08/17 13:39:46 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,313 +3,29 @@ // CORBA.h Created on: 30/1/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2007 Apasphere Ltd +// Copyright (C) 2003-2011 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // A complete set of C++ definitions for the CORBA module. // -/* - $Log$ - Revision 1.5.2.11 2007/03/09 15:34:09 dgrisby - Define __CosNaming_hh__ to prevent application code from including a - clashing header. - - Revision 1.5.2.10 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.5.2.9 2005/11/09 12:22:18 dgrisby - Local interfaces support. - - Revision 1.5.2.8 2005/01/17 14:33:22 dgrisby - Standard StringValue and WStringValue typedefs. - - Revision 1.5.2.7 2004/10/13 17:58:18 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.5.2.6 2004/07/23 10:29:56 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.5.2.5 2004/04/02 13:26:25 dgrisby - Start refactoring TypeCode to support value TypeCodes, start of - abstract interfaces support. - - Revision 1.5.2.4 2004/02/16 10:10:28 dgrisby - More valuetype, including value boxes. C++ mapping updates. - - Revision 1.5.2.3 2003/10/23 11:25:54 dgrisby - More valuetype support. - - Revision 1.5.2.2 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - - Revision 1.5.2.1 2003/03/23 21:04:26 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.22 2002/01/09 11:35:20 dpg1 - Remove separate omniAsyncInvoker library to save library overhead. - - Revision 1.2.2.21 2001/11/08 16:33:49 dpg1 - Local servant POA shortcut policy. - - Revision 1.2.2.20 2001/10/17 16:43:59 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.2.2.19 2001/08/17 13:39:43 dpg1 - Split CORBA.h into separate bits. - - Revision 1.2.2.18 2001/08/15 10:19:29 dpg1 - _name and _rep_id methods in CORBA::Exception. - - Revision 1.2.2.17 2001/08/03 17:45:39 sll - Added minorCode.h - - Revision 1.2.2.16 2001/07/31 16:04:07 sll - Added ORB::create_policy() and associated types and operators. - - Revision 1.2.2.15 2001/06/18 20:30:51 sll - Only define 1 conversion operator from T_var to T* if the compiler is - gcc. Previously, this is only done for gcc 2.7.2. It seems that gcc 3.0 - requires this to be the case. This is the default for all versions of - gcc. - - Revision 1.2.2.14 2001/06/08 17:12:07 dpg1 - Merge all the bug fixes from omni3_develop. - - Revision 1.2.2.13 2001/04/18 17:50:45 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.12 2001/04/09 15:18:46 dpg1 - Tweak fixed point to make life easier for omniORBpy. - - Revision 1.2.2.11 2001/03/13 10:32:04 dpg1 - Fixed point support. - - Revision 1.2.2.10 2001/01/08 12:35:41 dpg1 - _duplicate in CORBA::Object::_narrow - - Revision 1.2.2.9 2000/11/20 14:40:03 sll - Added TypeCode::PR_wstring_tc(CORBA::ULong bound). - - Revision 1.2.2.8 2000/11/17 19:09:36 dpg1 - Support codeset conversion in any. - - Revision 1.2.2.7 2000/11/15 17:03:14 sll - Moved include codeSets.h to omniInternal.h - - Revision 1.2.2.6 2000/11/09 12:27:48 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.2.2.5 2000/11/07 18:18:47 sll - Added external guard in CORBA.h to ensure that any idl that include - CosNaming.idl will compile as expected. - - Revision 1.2.2.4 2000/11/03 18:58:46 sll - Unbounded sequence of octet got a new type name. - - Revision 1.2.2.3 2000/10/27 15:42:02 dpg1 - Initial code set conversion support. Not yet enabled or fully tested. - - Revision 1.2.2.2 2000/09/27 17:19:12 sll - Updated to use the new cdrStream abstraction. - Replace include/omniORB3 with include/omniORB4. - - Revision 1.2.2.1 2000/07/17 10:35:32 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:06 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.9 2000/07/10 13:06:44 dpg1 - Initialisation of Any insertion functions was missing from system - exceptions. - - Revision 1.1.2.8 2000/06/27 16:15:07 sll - New classes: _CORBA_String_element, _CORBA_ObjRef_Element, - _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a - sequence of string and a sequence of object reference. - - Revision 1.1.2.7 2000/06/02 14:15:17 dpg1 - SystemException constructors now public so exceptions caught by base - class can be rethrown - - Revision 1.1.2.6 2000/03/03 14:29:15 djr - Improvement to BOA skeletons (less generated code). - - Revision 1.1.2.5 1999/10/21 11:04:59 djr - Added _core_attr to declarations of _PD_repoId in interfaces. - - Revision 1.1.2.4 1999/10/18 17:28:17 djr - Fixes for building MSVC dlls. - - Revision 1.1.2.3 1999/10/18 11:27:36 djr - Centralised list of system exceptions. - - Revision 1.1.2.2 1999/10/16 13:22:51 djr - Changes to support compiling on MSVC. - - Revision 1.1.2.1 1999/09/24 09:51:36 djr - Moved from omniORB2 + some new files. - - Revision 1.46 1999/08/30 18:45:58 sll - Made #include ir stubs conditional on ENABLE_CLIENT_IR_SUPPORT. - Application code has to define ENABLE_CLIENT_IR_SUPPORT in order to act - as a client for an interface repository. - - Revision 1.45 1999/08/30 17:40:22 sll - Removed use of _T and _T_var. - - Revision 1.44 1999/08/24 12:36:44 djr - PR_structMember now uses 'const char*'. - - Revision 1.43 1999/08/16 19:33:24 sll - New method NP_destroy() in class CORBA::ORB. - - Revision 1.42 1999/08/15 13:51:33 sll - Define ImplmentationDef as an empty class to keep some compilers happy. - - Revision 1.41 1999/06/27 16:44:42 sll - enclose Any extraction operator for string with test for macro - _NO_ANY_STRING_EXTRACTION_. Define this macro as compiler option would - remove the operators from the declaration. This make it easier to - find the code in the source where the operators are used. Hence make it - easier to fix old code which uses the pre-2.8.0 semantics. - - Revision 1.40 1999/06/25 13:54:17 sll - Removed Any::operator>>=(Object_ptr&) const. - - Revision 1.39 1999/06/22 15:04:29 sll - Put back pre CORBA-2.3 operator>>=(Any&a) in Any_var. - - Revision 1.38 1999/06/18 20:32:59 sll - Updated to CORBA 2.3 mapping. - - Revision 1.37 1999/06/03 17:10:32 sll - Added T_out types and updated T_var types to CORBA 2.2 - - Revision 1.36 1999/06/02 16:07:44 sll - Enabled IR client support for all platforms. Previously, IR client is - not available with compilers that do not support namespace. - - Revision 1.35 1999/05/26 12:21:35 sll - Use ENABLE_CLIENT_IR_SUPPORT alone to enable IR support. - - Revision 1.34 1999/05/25 13:37:44 sll - Added missing CORBA 2.1 definitions. - Added pd_magic field, PR_is_valid() static member functions to pseudo - objects so that at runtime static member functions of these objects - can check if the argument pointer is valid. - - Revision 1.33 1999/04/21 15:23:51 djr - CORBA::ORB::ObjectIdList corrected to use new string sequence class. - - Revision 1.32 1999/04/21 13:41:10 djr - Added marshalling methods to CORBA::Context. - String types are now defined in stringtypes.h, and typedef inside the - CORBA module. - - Revision 1.31 1999/02/18 15:23:29 djr - New type CORBA::Request_member. Corrected CORBA::ORB::RequestSeq to use - this. CORBA::ORB::get_next_response now has Request_out parameter. - - Revision 1.30 1999/01/11 16:39:51 djr - Added guard to prevent attempt to include corbaidl.hh from ir.hh. This - fails as it is in omniORB2/corbaidl.hh. It doesn't need to be included - from ir.hh, since it has already been included into CORBA.h. - - Revision 1.29 1999/01/07 18:14:11 djr - Changes to support - - New implementation of TypeCode and Any - - New implementation of DynAny - - DII and DSI - - Other minor changes. - - Revision 1.28 1998/08/25 18:55:33 sll - Added dummy marshalling functions in DynAny_member to keep gcc-2.7.2 happy. - - Revision 1.27 1998/08/21 19:26:48 sll - New private function _omni_set_NameService. - - Revision 1.26 1998/08/19 15:59:00 sll - All <<= and >>= operators are now defined in the global namespace. - In particular, the operator>>= and <<= for DefinitionKind have been - moved out of the namespace CORBA. This change should have no effect - on platforms which do not support C++ namespace. On platforms with - C++ namespace, the new code is expected to work whether or not the - compiler supports koenig lookup rule. - - Revision 1.25 1998/08/15 15:07:08 sll - *** empty log message *** - - Revision 1.24 1998/08/15 14:22:04 sll - Remove inline member implementations in _nil_TypeCode and IRObject. - - Revision 1.23 1998/08/05 18:10:39 sll - Added DynAny. - - Revision 1.22 1998/04/18 10:07:28 sll - Renamed __e with _0RL_e in operator<<=() of DefinitionKind. - - Revision 1.21 1998/04/08 13:56:47 sll - Minor change to the ctor of _nil_TypeCode to help some compiler to find - the right TypeCode ctor. - - Revision 1.20 1998/04/07 19:55:53 sll - Updated to use namespace if available. - Moved inline functions of Any and TypeCode out of this header file. - - * Revision 1.19 1998/02/20 14:44:44 ewc - * Changed to compile with aCC on HPUX - * - * Revision 1.18 1998/02/03 16:47:09 ewc - * Updated some interfaces. - * - * Revision 1.17 1998/01/27 16:02:34 ewc - * Added TypeCode and type Any - * - Revision 1.16 1997/12/18 17:37:20 sll - Added (const char*) type casting to help strcpy(). - - Revision 1.15 1997/12/09 20:35:16 sll - New members BOA::impl_shutdown, BOA::destroy. - - Revision 1.14 1997/08/21 22:20:17 sll - - String_member copy ctor bug fix. - - New system exception TRANSACTION_REQUIRED, TRANSACTION_ROLLEDBACK, - INVALID_TRANSACTION and WRONG_TRANSACTION. - - Correct ORB_init() signature. - - CORBA::is_nil(Object_ptr) is now more sympathetic to applications - treating a nil pointer as a nil object reference. - - * Revision 1.13 1997/05/21 15:01:40 sll - * Added typedef _ptr Ref; - * - * Revision 1.12 1997/05/06 16:04:43 sll - * Public release. - * -*/ - #ifndef __CORBA_H__ #define __CORBA_H__ @@ -341,7 +57,7 @@ #endif #ifndef USE_omniORB_logStream -#define USE_omniORB_logStream +# define USE_omniORB_logStream #endif #include @@ -403,21 +119,7 @@ ////////////////////// Generated from corbaidl.idl /////////////////// ////////////////////////////////////////////////////////////////////// -# if defined(_OMNIORB_LIBRARY) -# undef _core_attr -# define _core_attr _OMNIORB_NTDLL_IMPORT -# include -# undef _core_attr -# define _core_attr -# elif defined(_OMNIORB_DYNAMIC_LIBRARY) -# undef _core_attr -# define _core_attr -# include -# undef _core_attr -# define _core_attr _OMNIORB_NTDLL_IMPORT -# else # include -# endif ////////////////////////////////////////////////////////////////////// ////////////////////// More Definitions ////////////////////////////// @@ -440,47 +142,39 @@ # include "CORBA_vartypes.h" ////////////////////////////////////////////////////////////////////// - ////////////////////// Generated from ir.idl ///////////////////////// + ////////////////////// Generated code //////////////////////////////// ////////////////////////////////////////////////////////////////////// -#if defined(ENABLE_CLIENT_IR_SUPPORT) -#if defined(_OMNIORB_LIBRARY) + // "core" attributes in these headers are exported by the dynamic library + +# if defined(_OMNIORB_LIBRARY) # undef _core_attr # define _core_attr _OMNIORB_NTDLL_IMPORT -#include +# elif defined(_OMNIORB_DYNAMIC_LIBRARY) # undef _core_attr # define _core_attr -#elif defined(_OMNIORB_DYNAMIC_LIBRARY) +# endif + +# if defined(ENABLE_CLIENT_IR_SUPPORT) +# include +# endif + +# include +# include + +# if defined(_OMNIORB_LIBRARY) # undef _core_attr # define _core_attr -#include +# elif defined(_OMNIORB_DYNAMIC_LIBRARY) # undef _core_attr # define _core_attr _OMNIORB_NTDLL_IMPORT -#else -#include -#endif -#endif +# endif + ////////////////////////////////////////////////////////////////////// - ////////////////////// Generated from boxes.idl ////////////////////// + ////////////////////// End of CORBA module /////////////////////////// ////////////////////////////////////////////////////////////////////// -#if defined(_OMNIORB_LIBRARY) -# undef _core_attr -# define _core_attr _OMNIORB_NTDLL_IMPORT -#include -# undef _core_attr -# define _core_attr -#elif defined(_OMNIORB_DYNAMIC_LIBRARY) -# undef _core_attr -# define _core_attr -#include -# undef _core_attr -# define _core_attr _OMNIORB_NTDLL_IMPORT -#else -#include -#endif - # undef INSIDE_OMNIORB_CORBA_MODULE _CORBA_MODULE_END @@ -488,15 +182,25 @@ //?? These really want to be renamed and put elsewhere. extern CORBA::Boolean -_omni_callTransientExceptionHandler(omniObjRef* obj, CORBA::ULong retries, - const CORBA::TRANSIENT& ex); +_omni_callTransientExceptionHandler(omniObjRef* obj, + CORBA::ULong retries, + const CORBA::TRANSIENT& ex, + const char* op); +extern CORBA::Boolean +_omni_callTimeoutExceptionHandler(omniObjRef* obj, + CORBA::ULong retries, + const CORBA::TIMEOUT& ex, + const char* op); extern CORBA::Boolean -_omni_callCommFailureExceptionHandler(omniObjRef* obj, - CORBA::ULong retries, - const CORBA::COMM_FAILURE& ex); +_omni_callCommFailureExceptionHandler(omniObjRef* obj, + CORBA::ULong retries, + const CORBA::COMM_FAILURE& ex, + const char* op); extern CORBA::Boolean -_omni_callSystemExceptionHandler(omniObjRef* obj, CORBA::ULong retries, - const CORBA::SystemException& ex); +_omni_callSystemExceptionHandler(omniObjRef* obj, + CORBA::ULong retries, + const CORBA::SystemException& ex, + const char* op); extern void _omni_set_NameService(CORBA::Object_ptr); @@ -525,6 +229,7 @@ #endif #include +#include _CORBA_MODULE POA_CORBA @@ -535,6 +240,7 @@ # include #endif #include +#include _CORBA_MODULE_END @@ -543,25 +249,46 @@ #undef _core_attr #undef _dyn_attr +// Define external guards for CORBA module IDL files. +#ifndef __corbaidl_hh_EXTERNAL_GUARD__ +# define __corbaidl_hh_EXTERNAL_GUARD__ +#endif -#if !defined(_OMNIORB_LIBRARY) && !defined(_OMNIORB_DYNAMIC_LIBRARY) -#ifndef USE_core_stub_in_nt_dll -#define USE_core_stub_in_nt_dll -#define USE_core_stub_in_nt_dll_NOT_DEFINED -#endif -#ifndef USE_dyn_stub_in_nt_dll -#define USE_dyn_stub_in_nt_dll -#define USE_dyn_stub_in_nt_dll_NOT_DEFINED -#endif -#include -#ifdef USE_core_stub_in_nt_dll_NOT_DEFINED -#undef USE_core_stub_in_nt_dll -#undef USE_core_stub_in_nt_dll_NOT_DEFINED -#endif -#ifdef USE_dyn_stub_in_nt_dll_NOT_DEFINED -#undef USE_dyn_stub_in_nt_dll -#undef USE_dyn_stub_in_nt_dll_NOT_DEFINED +#ifdef ENABLE_CLIENT_IR_SUPPORT +# ifndef __ir_hh_EXTERNAL_GUARD__ +# define __ir_hh_EXTERNAL_GUARD__ +# endif +#endif + +#ifndef __boxes_hh_EXTERNAL_GUARD__ +# define __boxes_hh_EXTERNAL_GUARD__ #endif + +#ifndef __pollable_hh_EXTERNAL_GUARD__ +# define __pollable_hh_EXTERNAL_GUARD__ +#endif + +// Include headers for generated code outside the CORBA module + +#if !defined(_OMNIORB_LIBRARY) && !defined(_OMNIORB_DYNAMIC_LIBRARY) +# ifndef USE_core_stub_in_nt_dll +# define USE_core_stub_in_nt_dll +# define USE_core_stub_in_nt_dll_NOT_DEFINED +# endif +# ifndef USE_dyn_stub_in_nt_dll +# define USE_dyn_stub_in_nt_dll +# define USE_dyn_stub_in_nt_dll_NOT_DEFINED +# endif +# include +# include +# ifdef USE_core_stub_in_nt_dll_NOT_DEFINED +# undef USE_core_stub_in_nt_dll +# undef USE_core_stub_in_nt_dll_NOT_DEFINED +# endif +# ifdef USE_dyn_stub_in_nt_dll_NOT_DEFINED +# undef USE_dyn_stub_in_nt_dll +# undef USE_dyn_stub_in_nt_dll_NOT_DEFINED +# endif #endif // OMG COS IDLs refer to CosNaming IDL as "CosNaming.idl". @@ -571,26 +298,17 @@ // any effect. This works because the stubs generated by omniidl // put external guards around the include. #ifndef __CosNaming_hh_EXTERNAL_GUARD__ -#define __CosNaming_hh_EXTERNAL_GUARD__ +# define __CosNaming_hh_EXTERNAL_GUARD__ #endif // Define __CosNaming_hh__ in case application code tries to import a // header generated from CosNaming.idl. #ifndef __CosNaming_hh__ -#define __CosNaming_hh__ +# define __CosNaming_hh__ #endif -// Define external guards for CORBA module IDL files. -#ifndef __corbaidl_hh_EXTERNAL_GUARD__ -#define __corbaidl_hh_EXTERNAL_GUARD__ -#endif -#ifdef ENABLE_CLIENT_IR_SUPPORT -#ifndef __ir_hh_EXTERNAL_GUARD__ -#define __ir_hh_EXTERNAL_GUARD__ -#endif -#endif -#ifndef __boxes_hh_EXTERNAL_GUARD__ -#define __boxes_hh_EXTERNAL_GUARD__ +#ifndef __messaging_hh_EXTERNAL_GUARD__ +# define __messaging_hh_EXTERNAL_GUARD__ #endif #endif // __CORBA_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_LocalObject.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_LocalObject.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_LocalObject.h 2005-11-09 12:22:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_LocalObject.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,29 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::LocalObject // -/* - $Log$ -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_LocalObject_vartypes.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_LocalObject_vartypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_LocalObject_vartypes.h 2005-11-09 12:22:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_LocalObject_vartypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,25 +8,19 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // -/* - $Log$ -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_NamedValue.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_NamedValue.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_NamedValue.h 2004-07-23 10:31:47.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_NamedValue.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::NamedValue, NVList // -/* - $Log$ - Revision 1.1.4.1 2003/03/23 21:04:24 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2001/11/13 14:11:43 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.1.2.2 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/08/17 13:39:46 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Object.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Object.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Object.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Object.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Object // -/* - $Log$ - Revision 1.1.2.4 2002/02/25 11:15:14 dpg1 - Typo in _unchecked_narrow(). - - Revision 1.1.2.3 2001/11/12 13:46:07 dpg1 - _unchecked_narrow, improved _narrow. - - Revision 1.1.2.2 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/08/17 13:39:47 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Object_vartypes.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Object_vartypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Object_vartypes.h 2009-10-29 11:43:50.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Object_vartypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,40 +9,22 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.4.3 2005/11/09 12:16:46 dgrisby - Remove obsolete tcDesc helper classes. - - Revision 1.1.4.2 2004/02/16 10:10:28 dgrisby - More valuetype, including value boxes. C++ mapping updates. - - Revision 1.1.4.1 2003/03/23 21:04:23 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.1 2001/08/17 13:39:47 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/corba_operators.h omniorb-dfsg-4.2.2/include/omniORB4/corba_operators.h --- omniorb-dfsg-4.1.6/include/omniORB4/corba_operators.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/corba_operators.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,23 +8,21 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** #ifndef __CORBA_OPERATORS_H__ #define __CORBA_OPERATORS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ORB.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ORB.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ORB.h 2010-05-07 22:48:29.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ORB.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,60 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::ORB // -/* - $Log$ - Revision 1.1.4.4 2005/01/06 23:08:06 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.3 2004/04/02 13:26:25 dgrisby - Start refactoring TypeCode to support value TypeCodes, start of - abstract interfaces support. - - Revision 1.1.4.2 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - - Revision 1.1.4.1 2003/03/23 21:04:24 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.6 2001/11/13 14:11:43 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.1.2.5 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.4 2001/10/29 17:42:35 dpg1 - Support forward-declared structs/unions, ORB::create_recursive_tc(). - - Revision 1.1.2.3 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.2 2001/08/17 17:00:50 sll - ORB_init now takes an extra options argument. - - Revision 1.1.2.1 2001/08/17 13:39:47 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Policy.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Policy.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Policy.h 2005-01-25 11:17:50.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Policy.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,47 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Policy // -/* - $Log$ - Revision 1.1.4.2 2005/01/06 23:08:07 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:04:23 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.4 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.3 2002/01/02 18:13:43 dpg1 - Platform fixes/additions. - - Revision 1.1.2.2 2001/11/12 13:47:09 dpg1 - Minor fixes. - - Revision 1.1.2.1 2001/08/17 13:39:47 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -220,13 +196,3 @@ }; \ \ typedef _CORBA_PseudoObj_Var name##_var; - -#ifdef OMNIORB_DECLARE_POLICY_OBJECT_OPERATORS -#error OMNIORB_DECLARE_POLICY_OBJECT_OPERATORS is already defined! -#endif - -#define OMNIORB_POLICY_VALUE(policy) policy##Value - -#define OMNIORB_DECLARE_POLICY_OBJECT_OPERATORS(name) \ -void operator<<=(CORBA::Any &, name); \ -CORBA::Boolean operator>>=(const CORBA::Any&, name& ); diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_primitive_types.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_primitive_types.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_primitive_types.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_primitive_types.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Primitive types // -/* - $Log$ - Revision 1.1.2.2 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/08/17 13:39:49 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Principal.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Principal.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Principal.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Principal.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Principal // -/* - $Log$ - Revision 1.1.2.1 2001/08/17 13:39:48 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Request.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Request.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_Request.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_Request.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::Request // -/* - $Log$ - Revision 1.1.2.2 2001/11/06 15:41:34 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/08/17 13:39:48 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ServerRequest.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ServerRequest.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ServerRequest.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ServerRequest.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::ServerRequest // -/* - $Log$ - Revision 1.1.2.1 2001/08/17 13:39:48 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_static_fns.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_static_fns.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_static_fns.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_static_fns.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Static is_nil() and release() functions // -/* - $Log$ - Revision 1.1.2.2 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/08/17 13:39:49 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_String.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_String.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_String.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_String.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::String and CORBA::WString // -/* - $Log$ - Revision 1.1.2.1 2001/08/17 13:39:48 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_sysdep_auto.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_sysdep_auto.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_sysdep_auto.h 2010-11-22 23:00:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_sysdep_auto.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -28,20 +26,6 @@ // // Define various symbols based on things detected by autoconf -/* - $Log$ - Revision 1.1.4.1 2003/03/23 21:04:21 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.2 2002/02/18 11:59:12 dpg1 - Full autoconf support. - - Revision 1.1.2.1 2002/01/15 16:38:10 dpg1 - On the road to autoconf. Dependencies refactored, configure.ac - written. No makefiles yet. - -*/ - #ifndef __CORBA_SYSDEP_AUTO_H__ #define __CORBA_SYSDEP_AUTO_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_sysdep.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_sysdep.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_sysdep.h 2011-07-01 13:47:41.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_sysdep.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,25 +3,23 @@ // CORBA_sysdep.h Created on: 30/1/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2008 Apasphere Ltd +// Copyright (C) 2003-2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -31,62 +29,6 @@ // about the system and the compiler used. // -/* - $Log$ - Revision 1.5.2.10 2008/03/24 20:17:20 dgrisby - Sun's compiler doesn't like the <: in const_cast<::CORBA...>. - - Revision 1.5.2.9 2007/02/05 17:39:17 dgrisby - Later Sun compilers require a dummy return. - - Revision 1.5.2.8 2007/01/12 10:19:51 dgrisby - Support for MontaVista ARM Linux. - - Revision 1.5.2.7 2006/04/28 18:40:46 dgrisby - Merge from omni4_0_develop. - - Revision 1.5.2.6 2006/01/10 12:24:04 dgrisby - Merge from omni4_0_develop pre 4.0.7 release. - - Revision 1.5.2.5 2005/11/17 17:03:27 dgrisby - Merge from omni4_0_develop. - - Revision 1.5.2.4 2005/07/22 17:18:40 dgrisby - Another merge from omni4_0_develop. - - Revision 1.5.2.3 2005/07/11 17:47:31 dgrisby - VMS changes from Bruce Visscher. - - Revision 1.5.2.2 2005/01/06 23:08:07 dgrisby - Big merge from omni4_0_develop. - - Revision 1.5.2.1 2003/03/23 21:04:22 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.23 2003/03/02 17:10:40 dgrisby - AIX patches integrated in main tree. - - Revision 1.2.2.22 2003/02/17 02:03:07 dgrisby - vxWorks port. (Thanks Michael Sturm / Acterna Eningen GmbH). - - Revision 1.2.2.21 2003/01/16 12:47:08 dgrisby - Const cast macro. Thanks Matej Kenda. - - Revision 1.2.2.20 2003/01/16 11:08:26 dgrisby - Patches to support Digital Mars C++. Thanks Christof Meerwald. - - Revision 1.2.2.19 2002/02/18 11:59:12 dpg1 - Full autoconf support. - - Revision 1.2.2.18 2002/01/15 16:38:09 dpg1 - On the road to autoconf. Dependencies refactored, configure.ac - written. No makefiles yet. - - - Log truncated. - -*/ - #ifndef __CORBA_SYSDEP_H__ #define __CORBA_SYSDEP_H__ @@ -115,6 +57,21 @@ // +// Pointer arithmetic type +// + +#if SIZEOF_PTR == SIZEOF_LONG +typedef unsigned long omni_ptr_arith_t; +#elif SIZEOF_PTR == SIZEOF_INT +typedef unsigned int omni_ptr_arith_t; +#elif defined (_WIN64) +typedef size_t omni_ptr_arith_t; +#else +#error "No suitable type to do pointer arithmetic" +#endif + + +// // Dependencies that are always hard-coded // @@ -160,7 +117,6 @@ #if defined(__GNUG__) // GNU G++ compiler -# define EGCS_WORKAROUND # define NEED_DUMMY_RETURN #endif @@ -174,7 +130,6 @@ // this pragma wasn't implemented until 6.something on Unix). # ifdef __VMS # pragma message disable CANTCOMPLETE -# define OMNIORB_THROW_VISIBLE_THROW # endif # define NEED_DUMMY_RETURN # define OMNI_OPERATOR_REFPTR_REQUIRES_TYPEDEF @@ -228,6 +183,12 @@ #if defined(__aix__) && defined(__xlC__) # define OMNI_NO_INLINE_FRIENDS +# define NEED_DUMMY_RETURN +#endif + + +#if defined(__clang__) +# define OMNI_NO_INLINE_FRIENDS #endif @@ -316,92 +277,96 @@ // Module mapping using namespaces or classes // -#ifdef HAS_Cplusplus_Namespace +#ifdef _CORBA_MODULE +# error "Name conflict: _CORBA_MODULE is already defined." +#endif -#ifndef _CORBA_MODULE -#define _CORBA_MODULE namespace -#else -#error "Name conflict: _CORBA_MODULE is already defined." +#ifdef _CORBA_MODULE_BEG +# error "Name conflict: _CORBA_MODULE_BEG is already defined." #endif -#ifndef _CORBA_MODULE_BEG -#define _CORBA_MODULE_BEG { -#else -#error "Name conflict: _CORBA_MODULE_BEG is already defined." +#ifdef _CORBA_MODULE_END +# error "Name conflict: _CORBA_MODULE_END is already defined." #endif -#ifndef _CORBA_MODULE_END -#define _CORBA_MODULE_END } -#else -#error "Name conflict: _CORBA_MODULE_END is already defined." +#ifdef _CORBA_MODULE_OP +# error "Name conflict: _CORBA_MODULE_OP is already defined." #endif -#ifndef _CORBA_MODULE_OP -#define _CORBA_MODULE_OP -#else -#error "Name conflict: _CORBA_MODULE_OP is already defined." +#ifdef _CORBA_MODULE_FN +# error "Name conflict: _CORBA_MODULE_FN is already defined." #endif -#ifndef _CORBA_MODULE_FN -#define _CORBA_MODULE_FN -#else -#error "Name conflict: _CORBA_MODULE_FN is already defined." +#ifdef _CORBA_MODULE_VAR +# error "Name conflict: _CORBA_MODULE_VAR is already defined." #endif -#ifndef _CORBA_MODULE_VAR -#define _CORBA_MODULE_VAR extern -#else -#error "Name conflict: _CORBA_MODULE_VAR is already defined." +#ifdef _CORBA_MODULE_INLINE +# error "Name conflict: _CORBA_MODULE_INLINE is already defined." #endif -#ifndef _CORBA_MODULE_INLINE -#define _CORBA_MODULE_INLINE inline -#else -#error "Name conflict: _CORBA_MODULE_INLINE is already defined." +#ifdef _CORBA_GLOBAL_VAR +# error "Name conflict: _CORBA_GLOBAL_VAR is already defined." #endif -#ifndef _CORBA_GLOBAL_VAR -#define _CORBA_GLOBAL_VAR extern -#else -#error "Name conflict: _CORBA_GLOBAL_VAR is already defined." +#ifdef _CORBA_MODULE_VARINT +# error "Name conflict: _CORBA_MODULE_VARINT is already defined." #endif -#ifndef _CORBA_MODULE_VARINT -#define _CORBA_MODULE_VARINT -#else -#error "Name conflict: _CORBA_MODULE_VARINT is already defined." +#ifdef _CORBA_GLOBAL_VARINT +# error "Name conflict: _CORBA_GLOBAL_VARINT is already defined." #endif -#ifndef _CORBA_GLOBAL_VARINT -#define _CORBA_GLOBAL_VARINT -#else -#error "Name conflict: _CORBA_GLOBAL_VARINT is already defined." +#ifdef OMNI_NAMESPACE_BEGIN +# error "Name conflict: OMNI_NAMESPACE_BEGIN is already defined." #endif -#ifndef OMNI_NAMESPACE_BEGIN -#define OMNI_NAMESPACE_BEGIN(name) namespace name { -#else -#error "Name conflict: OMNI_NAMESPACE_BEGIN is already defined." +#ifdef OMNI_NAMESPACE_END +# error "Name conflict: OMNI_NAMESPACE_END is already defined." #endif -#ifndef OMNI_NAMESPACE_END -#define OMNI_NAMESPACE_END(name) } -#else -#error "Name conflict: OMNI_NAMESPACE_END is already defined." +#ifdef OMNI_USING_NAMESPACE +# error "Name conflict: OMNI_USING_NAMESPACE is already defined." #endif -#ifndef OMNI_USING_NAMESPACE -#define OMNI_USING_NAMESPACE(name) using namespace name; -#else -#error "Name conflict: OMNI_USING_NAMESPACE is already defined." +#ifdef _OMNI_NS +# error "Name conflict: _OMNI_NS is already defined." #endif -#ifndef _OMNI_NS -#define _OMNI_NS(x) omni::x -#else -#error "Name conflict: _OMNI_NS is already defined." +#ifdef _init_in_decl_ +# error "Name conflict: _init_in_decl_ is already defined." #endif +#ifdef _init_in_def_ +# error "Name conflict: _init_in_def_ is already defined." +#endif + +#ifdef _init_in_cldecl_ +# error "Name conflict: _init_in_cldecl_ is already defined." +#endif + +#ifdef _init_in_cldef_ +# error "Name conflict: _init_in_cldef_ is already defined." +#endif + + +#ifdef HAS_Cplusplus_Namespace + +# define _CORBA_MODULE namespace +# define _CORBA_MODULE_BEG { +# define _CORBA_MODULE_END } +# define _CORBA_MODULE_OP +# define _CORBA_MODULE_FN +# define _CORBA_MODULE_VAR extern +# define _CORBA_MODULE_INLINE inline +# define _CORBA_GLOBAL_VAR extern +# define _CORBA_MODULE_VARINT +# define _CORBA_GLOBAL_VARINT +# define OMNI_NAMESPACE_BEGIN(name) namespace name { +# define OMNI_NAMESPACE_END(name) } +# define OMNI_USING_NAMESPACE(name) using namespace name; +# define _OMNI_NS(x) omni::x + // Integral and enumeration constants are declared in the stub headers as: // e.g. class A { // static const CORBA::Long AA _init_in_cldecl_( = 4 ); @@ -417,174 +382,68 @@ // be specified with a constant-initializer whereas ARM does not. // The _init_in_decl_ and _init_in_def_ macros are defined so that the same // stub will compile on both FD and ARM compilers. -// MSVC++ 5.0 (and 6.0) is somewhere between FD and ARM. +// Older MSVC++ are somewhere between FD and ARM. // _MSC_VER = 1100 for 5.0, 1200 for 6.0. -// -#ifndef _init_in_decl_ -#define _init_in_decl_(x) x -#else -#error "Name conflict: _init_in_decl_ is already defined." -#endif -#ifndef _init_in_def_ -#define _init_in_def_(x) -#else -#error "Name conflict: _init_in_def_ is already defined." -#endif +# define _init_in_decl_(x) x +# define _init_in_def_(x) -#ifndef _init_in_cldecl_ -# if !defined(_MSC_VER) || defined(__INTEL_COMPILER) -# define _init_in_cldecl_(x) x +# if defined(__INTEL_COMPILER) +# define _init_in_cldecl_(x) +# define _init_in_cldef_(x) x +# elif defined (_MSC_VER) && (_MSC_VER < 1500) +# define _init_in_cldecl_(x) +# define _init_in_cldef_(x) x # else -# define _init_in_cldecl_(x) -# endif -#else -#error "Name conflict: _init_in_cldecl_ is already defined." -#endif - -#ifndef _init_in_cldef_ -# if !defined(_MSC_VER) || defined(__INTEL_COMPILER) +# define _init_in_cldecl_(x) x # define _init_in_cldef_(x) -# else -# define _init_in_cldef_(x) x # endif -#else -#error "Name conflict: _init_in_cldef_ is already defined." -#endif - -#else - -#ifndef _CORBA_MODULE -#define _CORBA_MODULE class -#else -#error "Name conflict: _CORBA_MODULE is already defined." -#endif - -#ifndef _CORBA_MODULE_BEG -#define _CORBA_MODULE_BEG { public: -#else -#error "Name conflict: _CORBA_MODULE_BEG is already defined." -#endif - -#ifndef _CORBA_MODULE_END -#define _CORBA_MODULE_END }; -#else -#error "Name conflict: _CORBA_MODULE_END is already defined." -#endif - -#ifndef _CORBA_MODULE_OP -#define _CORBA_MODULE_OP friend -#else -#error "Name conflict: _CORBA_MODULE_OP is already defined." -#endif - -#ifndef _CORBA_MODULE_FN -#define _CORBA_MODULE_FN static -#else -#error "Name conflict: _CORBA_MODULE_FN is already defined." -#endif - -#ifndef _CORBA_MODULE_VAR -#define _CORBA_MODULE_VAR static -#else -#error "Name conflict: _CORBA_MODULE_VAR is already defined." -#endif - -#ifndef _CORBA_MODULE_INLINE -#define _CORBA_MODULE_INLINE static inline -#else -#error "Name conflict: _CORBA_MODULE_INLINE is already defined." -#endif -#ifndef _CORBA_GLOBAL_VAR -#define _CORBA_GLOBAL_VAR extern -#else -#error "Name conflict: _CORBA_GLOBAL_VAR is already defined." -#endif - -#ifndef _CORBA_MODULE_VARINT -#define _CORBA_MODULE_VARINT static _core_attr -#else -#error "Name conflict: _CORBA_MODULE_VARINT is already defined." -#endif - -#ifndef _CORBA_GLOBAL_VARINT -#define _CORBA_GLOBAL_VARINT extern _core_attr -#else -#error "Name conflict: _CORBA_GLOBAL_VARINT is already defined." -#endif +#else // No namespace support -#ifndef OMNI_NAMESPACE_BEGIN -#define OMNI_NAMESPACE_BEGIN(name) -#else -#error "Name conflict: OMNI_NAMESPACE_BEGIN is already defined." -#endif - -#ifndef OMNI_NAMESPACE_END -#define OMNI_NAMESPACE_END(name) -#else -#error "Name conflict: OMNI_NAMESPACE_END is already defined." -#endif - -#ifndef OMNI_USING_NAMESPACE -#define OMNI_USING_NAMESPACE(name) -#else -#error "Name conflict: OMNI_USING_NAMESPACE is already defined." -#endif - -#ifndef _OMNI_NS -#define _OMNI_NS(x) x -#else -#error "Name conflict: _OMNI_NS is already defined." -#endif - -#ifndef _init_in_decl_ -#define _init_in_decl_(x) -#else -#error "Name conflict: _init_in_decl_ is already defined." -#endif - -#ifndef _init_in_def_ -#define _init_in_def_(x) x -#else -#error "Name conflict: _init_in_def_ is already defined." -#endif - -#ifndef _init_in_cldecl_ -#define _init_in_cldecl_(x) -#else -#error "Name conflict: _init_in_cldecl_ is already defined." -#endif - -#ifndef _init_in_cldef_ -#define _init_in_cldef_(x) x -#else -#error "Name conflict: _init_in_cldef_ is already defined." -#endif +# define _CORBA_MODULE class +# define _CORBA_MODULE_BEG { public: +# define _CORBA_MODULE_END }; +# define _CORBA_MODULE_OP friend +# define _CORBA_MODULE_FN static +# define _CORBA_MODULE_VAR static +# define _CORBA_MODULE_INLINE static inline +# define _CORBA_GLOBAL_VAR extern +# define _CORBA_MODULE_VARINT static _core_attr +# define _CORBA_GLOBAL_VARINT extern _core_attr +# define OMNI_NAMESPACE_BEGIN(name) +# define OMNI_NAMESPACE_END(name) +# define OMNI_USING_NAMESPACE(name) +# define _OMNI_NS(x) x + +# define _init_in_decl_(x) +# define _init_in_def_(x) x +# define _init_in_cldecl_(x) +# define _init_in_cldef_(x) x #endif // HAS_Cplusplus_Namespace #ifdef OMNI_REQUIRES_FQ_BASE_CTOR -# define OMNIORB_BASE_CTOR(a) a +# define OMNIORB_BASE_CTOR(a) a #else -# define OMNIORB_BASE_CTOR(a) +# define OMNIORB_BASE_CTOR(a) #endif #ifndef OMNI_OPERATOR_REFPTR // Only used when the source tree is patched with DEC C++ 5.6 workarounds -#define OMNI_OPERATOR_REFPTR(T) inline operator T*&() +# define OMNI_OPERATOR_REFPTR(T) inline operator T*&() #endif #ifndef OMNI_CONSTRTYPE_FIX_VAR_MEMBER // Only used when the source tree is patched with DEC C++ 5.6 workarounds -#define OMNI_CONSTRTYPE_FIX_VAR_MEMBER(T) \ +# define OMNI_CONSTRTYPE_FIX_VAR_MEMBER(T) \ typedef _CORBA_ConstrType_Fix_Var _var_type; #endif #ifndef OMNI_CONSTRTYPE_FIX_VAR // Only used when the source tree is patched with DEC C++ 5.6 workarounds -#define OMNI_CONSTRTYPE_FIX_VAR(T) typedef T::_var_type T##_var; +# define OMNI_CONSTRTYPE_FIX_VAR(T) typedef T::_var_type T##_var; #endif // #define ENABLE_CLIENT_IR_SUPPORT diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_sysdep_trad.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_sysdep_trad.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_sysdep_trad.h 2011-06-20 22:13:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_sysdep_trad.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,25 +3,23 @@ // CORBA_sysdep.h Created on: 30/1/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2007 Apasphere Ltd +// Copyright (C) 2002-2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,74 +27,6 @@ // // Traditional-style hard-coded system dependencies. -/* - $Log$ - Revision 1.1.4.11 2007/06/22 17:28:25 dgrisby - Definitions for Darwin traditional compile. - - Revision 1.1.4.10 2007/01/12 10:19:51 dgrisby - Support for MontaVista ARM Linux. - - Revision 1.1.4.9 2006/11/28 14:17:13 dgrisby - This is omniORB 4.1.0. - - Revision 1.1.4.8 2006/11/20 15:04:54 dgrisby - IA64 is usually little endian; only big endian on HPUX. - - Revision 1.1.4.7 2006/03/25 18:54:04 dgrisby - Initial IPv6 support. - - Revision 1.1.4.6 2005/11/17 17:03:27 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.5 2005/04/14 00:04:00 dgrisby - New traceInvocationReturns and traceTime options; remove logf function. - - Revision 1.1.4.4 2005/01/25 11:17:49 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.3 2005/01/13 21:09:57 dgrisby - New SocketCollection implementation, using poll() where available and - select() otherwise. Windows specific version to follow. - - Revision 1.1.4.2 2005/01/06 23:08:09 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:04:21 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.9 2003/03/12 14:07:44 dgrisby - MacOS port. Thanks Wolfgang Textor. - - Revision 1.1.2.8 2003/02/21 15:56:09 dgrisby - Silence macro redefinition warnings on Windows. - - Revision 1.1.2.7 2003/02/17 02:03:07 dgrisby - vxWorks port. (Thanks Michael Sturm / Acterna Eningen GmbH). - - Revision 1.1.2.6 2003/01/16 11:08:26 dgrisby - Patches to support Digital Mars C++. Thanks Christof Meerwald. - - Revision 1.1.2.5 2002/11/06 11:58:28 dgrisby - Partial AIX patches. - - Revision 1.1.2.4 2002/10/14 15:09:58 dgrisby - Cope with platforms where sizeof(bool) != 1. - - Revision 1.1.2.3 2002/03/13 16:05:38 dpg1 - Transport shutdown fixes. Reference count SocketCollections to avoid - connections using them after they are deleted. Properly close - connections when in thread pool mode. - - Revision 1.1.2.2 2002/01/31 10:16:33 dpg1 - Missing define in traditional sysdep. - - Revision 1.1.2.1 2002/01/15 16:38:10 dpg1 - On the road to autoconf. Dependencies refactored, configure.ac - written. No makefiles yet. - -*/ - #ifndef __CORBA_SYSDEP_TRAD_H__ #define __CORBA_SYSDEP_TRAD_H__ @@ -133,7 +63,9 @@ #define HAVE_LOCALTIME 1 // Unset if no localtime() function -#define HAVE_STRFTIME 1 +#ifndef HAVE_STRFTIME +# define HAVE_STRFTIME 1 +#endif // Unset if no strftime() function #define HAVE_GETTIMEOFDAY 1 diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_TypeCode.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_TypeCode.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_TypeCode.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_TypeCode.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,54 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::TypeCode // -/* - $Log$ - Revision 1.1.4.4 2004/05/25 14:20:50 dgrisby - ValueType TypeCode support. - - Revision 1.1.4.3 2004/04/02 13:26:25 dgrisby - Start refactoring TypeCode to support value TypeCodes, start of - abstract interfaces support. - - Revision 1.1.4.2 2003/05/20 16:53:12 dgrisby - Valuetype marshalling support. - - Revision 1.1.4.1 2003/03/23 21:04:23 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.4 2001/10/29 17:42:35 dpg1 - Support forward-declared structs/unions, ORB::create_recursive_tc(). - - Revision 1.1.2.3 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.2 2001/09/19 17:29:04 dpg1 - Cosmetic changes. - - Revision 1.1.2.1 2001/08/17 13:39:48 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_TypeCode_member.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_TypeCode_member.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_TypeCode_member.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_TypeCode_member.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,38 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::TypeCode_member // -/* - $Log$ - Revision 1.1.4.2 2006/06/14 10:34:19 dgrisby - Add missing TypeCode_member in(), inout(), out(). - - Revision 1.1.4.1 2003/03/23 21:04:22 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.1 2001/08/17 13:39:49 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -72,6 +57,12 @@ TypeCode_ptr _ptr; + inline void NP_swap(TypeCode_member& other) { + TypeCode_ptr tmp = _ptr; + _ptr = other._ptr; + other._ptr = tmp; + } + void operator>>=(cdrStream&) const; void operator<<=(cdrStream&); }; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_UnknownUserException.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_UnknownUserException.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_UnknownUserException.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_UnknownUserException.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // CORBA::UnknownUserException // -/* - $Log$ - Revision 1.1.2.2 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/08/17 13:39:49 dpg1 - Split CORBA.h into separate bits. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ValueBase.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ValueBase.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ValueBase.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ValueBase.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,60 +3,28 @@ // CORBA_ValueBase.h Created on: 2003/08/11 // Author : Duncan Grisby // -// Copyright (C) 2003-2006 Apasphere Ltd. +// Copyright (C) 2003-2012 Apasphere Ltd. // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // ValueType definitions // -/* - $Log$ - Revision 1.1.2.8 2006/10/23 15:08:31 dgrisby - Suppress GCC warnings about missing base class constructor calls. - Thanks Tamas Kerecsen. Somehow, this patch works on VC++ 6, where - before a similar change failed. - - Revision 1.1.2.7 2006/01/19 17:21:59 dgrisby - Avoid member name conflict in DefaultValueRefCountBase. - - Revision 1.1.2.6 2005/08/16 13:51:21 dgrisby - Problems with valuetype / abstract interface C++ mapping. - - Revision 1.1.2.5 2005/01/17 18:08:41 dgrisby - Small tweaks to compile with Sun CC. - - Revision 1.1.2.4 2005/01/06 16:39:23 dgrisby - DynValue and DynValueBox implementations; misc small fixes. - - Revision 1.1.2.3 2004/07/04 23:53:35 dgrisby - More ValueType TypeCode and Any support. - - Revision 1.1.2.2 2003/11/06 11:56:55 dgrisby - Yet more valuetype. Plain valuetype and abstract valuetype are now working. - - Revision 1.1.2.1 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif @@ -185,7 +153,7 @@ void operator=(const DefaultValueRefCountBase&); // Not implemented. - ULong _pd__refCount; + omni_refcount _pd__refCount; }; @@ -208,7 +176,7 @@ private: virtual ValueBase* create_for_unmarshal() = 0; - ULong _pd_refCount; + omni_refcount _pd_refCount; ////////////////////// // omniORB internal // diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ValueBase_vartypes.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ValueBase_vartypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_ValueBase_vartypes.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_ValueBase_vartypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // ValueType _var definitions // -/* - $Log$ - Revision 1.1.2.4 2005/11/09 12:16:46 dgrisby - Remove obsolete tcDesc helper classes. - - Revision 1.1.2.3 2004/10/13 17:58:18 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.1.2.2 2003/11/06 11:56:55 dgrisby - Yet more valuetype. Plain valuetype and abstract valuetype are now working. - - Revision 1.1.2.1 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/CORBA_vartypes.h omniorb-dfsg-4.2.2/include/omniORB4/CORBA_vartypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/CORBA_vartypes.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/CORBA_vartypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,54 +8,22 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.2.2.4 2001/10/17 16:44:00 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.2.2.3 2001/08/17 13:39:49 dpg1 - Split CORBA.h into separate bits. - - Revision 1.2.2.2 2000/09/27 17:07:25 sll - Updated to use the new cdrStream abstraction. - - Revision 1.2.2.1 2000/07/17 10:35:33 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.3 2000/06/27 16:15:08 sll - New classes: _CORBA_String_element, _CORBA_ObjRef_Element, - _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a - sequence of string and a sequence of object reference. - - Revision 1.1.2.2 1999/10/13 12:44:35 djr - Added definition of TypeCode_out. - - Revision 1.1.2.1 1999/09/24 09:51:39 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef INSIDE_OMNIORB_CORBA_MODULE # error "Must only be #included by CORBA.h" #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/dynAny.h omniorb-dfsg-4.2.2/include/omniORB4/dynAny.h --- omniorb-dfsg-4.1.6/include/omniORB4/dynAny.h 2005-01-06 23:11:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/dynAny.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,40 +8,22 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // DynamicAny module -/* - $Log$ - Revision 1.1.4.2 2005/01/06 16:39:23 dgrisby - DynValue and DynValueBox implementations; misc small fixes. - - Revision 1.1.4.1 2003/03/23 21:04:16 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.2 2003/01/16 11:08:26 dgrisby - Patches to support Digital Mars C++. Thanks Christof Meerwald. - - Revision 1.1.2.1 2001/10/17 16:44:01 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - -*/ - #ifndef __OMNIDYNANY_H__ #define __OMNIDYNANY_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/finalCleanup.h omniorb-dfsg-4.2.2/include/omniORB4/finalCleanup.h --- omniorb-dfsg-4.1.6/include/omniORB4/finalCleanup.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/finalCleanup.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/fixed.h omniorb-dfsg-4.2.2/include/omniORB4/fixed.h --- omniorb-dfsg-4.1.6/include/omniORB4/fixed.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/fixed.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,32 +8,25 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // // Global definitions and operators for the Fixed type -// $Log$ -// Revision 1.1.2.1 2001/03/13 10:32:05 dpg1 -// Fixed point support. -// - -#ifndef __fixed_h__ -#define __fixed_h__ +#ifndef __omniorb_fixed_h__ +#define __omniorb_fixed_h__ // @@ -111,4 +104,4 @@ CORBA::Fixed(val) { PR_setLimits(idl_digits, idl_scale); } }; -#endif // __fixed_h__ +#endif // __omniorb_fixed_h__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/giopEndpoint.h omniorb-dfsg-4.2.2/include/omniORB4/giopEndpoint.h --- omniorb-dfsg-4.1.6/include/omniORB4/giopEndpoint.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/giopEndpoint.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,91 +1,31 @@ // -*- Mode: C++; -*- // Package : omniORB -// giopEndpoint.h Created on: 20 Dec 2000 +// giopEndpoint.h Created on: 20 Dec 2000 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2006 Apasphere Ltd +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 2000 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.8 2006/06/22 13:53:49 dgrisby - Add flags to strand. - - Revision 1.1.6.7 2006/06/05 13:34:31 dgrisby - Make connection thread limit a per-connection value. - - Revision 1.1.6.6 2006/04/09 19:52:31 dgrisby - More IPv6, endPointPublish parameter. - - Revision 1.1.6.5 2005/09/05 17:12:20 dgrisby - Merge again. Mainly SSL transport changes. - - Revision 1.1.6.4 2005/03/02 12:10:50 dgrisby - setSelectable / Peek fixes. - - Revision 1.1.6.3 2005/01/13 21:09:57 dgrisby - New SocketCollection implementation, using poll() where available and - select() otherwise. Windows specific version to follow. - - Revision 1.1.6.2 2005/01/06 23:08:09 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:04:16 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.8 2002/08/21 06:23:15 dgrisby - Properly clean up bidir connections and ropes. Other small tweaks. - - Revision 1.1.4.7 2002/03/19 15:42:03 dpg1 - Use list of IP addresses to pick a non-loopback interface if there is one. - - Revision 1.1.4.6 2001/12/03 13:39:54 dpg1 - Explicit socket shutdown flag for Windows. - - Revision 1.1.4.5 2001/08/23 16:00:34 sll - Added method in giopTransportImpl to return the addresses of the host - interfaces. - - Revision 1.1.4.4 2001/07/31 16:16:27 sll - New transport interface to support the monitoring of active connections. - - Revision 1.1.4.3 2001/07/13 15:15:04 sll - Replaced giopEndpoint::Accept with giopEndpoint::AcceptAndMonitor. - giopConnection is now reference counted. - Added setSelectable, clearSelectable and Peek to giopConnection. - - Revision 1.1.4.2 2001/06/20 18:35:18 sll - Upper case send,recv,connect,shutdown to avoid silly substutition by - macros defined in socket.h to rename these socket functions - to something else. - - Revision 1.1.4.1 2001/04/18 17:26:29 sll - Big checkin with the brand new internal APIs. - -*/ - #ifndef __GIOPENDPOINT_H__ #define __GIOPENDPOINT_H__ @@ -100,6 +40,9 @@ class giopActiveCollection; // Singleton to act on a bunch of // giopActiveConnection. class giopServer; +class giopStrand; + +class IORPublish; // Information to publish in IORs class giopConnection { public: @@ -108,11 +51,11 @@ // None of the members raise an exception. virtual int Send(void* buf, size_t sz, - unsigned long deadline_secs = 0, - unsigned long deadline_nanosecs = 0) = 0; + const omni_time_t& deadline) = 0; + virtual int Recv(void* buf, size_t sz, - unsigned long deadline_secs = 0, - unsigned long deadline_nanosecs = 0) = 0; + const omni_time_t& deadline) = 0; + virtual void Shutdown() = 0; virtual const char* myaddress() = 0; @@ -123,6 +66,22 @@ // connection type. By default returns zero to indicate no peer // identification is possible. + virtual void* peerdetails(); + // Return connection-specific details about the peer. For SSL + // connections, the void* may be cast to an X509*. Returns zero to + // indicate no peer details are available. The connection retains + // ownership of the returned data. + + + _CORBA_Boolean gatekeeperCheck(giopStrand* strand); + // For a passive connection, check if the peer is permitted to + // connect. Returns true if permitted; false if not. + + virtual _CORBA_Boolean gatekeeperCheckSpecific(giopStrand* strand); + // Transport-specific additional gatekeeper check. Called by + // gatekeeperCheck(). + + virtual void setSelectable(int now = 0, _CORBA_Boolean data_in_buffer = 0) = 0; // Indicates that this connection should be watched by a select() @@ -232,22 +191,32 @@ // Returns 0 if no suitable endpoint can be created. virtual const char* type() const = 0; - // return the transport identifier, e.g. "giop:tcp","giop:ssl", etc. + // Return the transport identifier, e.g. "giop:tcp","giop:ssl", etc. virtual const char* address() const = 0; - // return the string that describe this remote address. + // Return the string that describes this remote address. // The string format is described in str2Address(). + virtual const char* host() const; + // Return a string containing the host name or IP address for the + // address, if that is meaningful for the address type. Returns 0 if + // not relevant. + virtual giopActiveConnection* - Connect(unsigned long deadline_secs = 0, - unsigned long deadline_nanosecs = 0, - _CORBA_ULong strand_flags = 0) const = 0; + Connect(const omni_time_t& deadline, + _CORBA_ULong strand_flags, + _CORBA_Boolean& timed_out) const = 0; // Connect to the remote address. - // Return 0 if no connection can be established. + // Returns 0 if no connection can be established. Sets timed_out to + // true if the connection attempt failed due to timeout. virtual giopAddress* duplicate() const = 0; // Return an identical instance. + virtual giopAddress* duplicate(const char* host) const; + // Return an instance that is identical except with a different + // host. Used when resolving a host name into an address. + giopAddress() {} virtual ~giopAddress() {} @@ -293,7 +262,8 @@ // Return true if endpoint is syntactically correct as described // in str2Endpoint(). None of the fields are optional. - static _CORBA_Boolean addToIOR(const char* endpoint); + static _CORBA_Boolean addToIOR(const char* endpoint, + IORPublish* eps = 0); // Return true if the endpoint has been sucessfully registered so that // all IORs generated by the ORB will include this endpoint. @@ -420,7 +390,7 @@ virtual _CORBA_Boolean isValid(const char* param) = 0; // Returns 1 if the address/endpoint is recognised by this transport - virtual _CORBA_Boolean addToIOR(const char* param) = 0; + virtual _CORBA_Boolean addToIOR(const char* param, IORPublish* eps) = 0; // Make this endpoint part of the IORs created by this ORB. virtual const omnivector* getInterfaceAddress() = 0; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/GIOP.h omniorb-dfsg-4.2.2/include/omniORB4/GIOP.h --- omniorb-dfsg-4.1.6/include/omniORB4/GIOP.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/GIOP.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,31 +27,6 @@ // // -/* - $Log$ - Revision 1.2.2.3 2000/11/03 18:58:46 sll - Unbounded sequence of octet got a new type name. - - Revision 1.2.2.2 2000/09/27 17:07:07 sll - Updated to include definitions for GIOP 1.1 and 1.2. - - Revision 1.2.2.1 2000/07/17 10:35:33 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:40 djr - Moved from omniORB2 + some new files. - - Revision 1.3 1999/06/18 21:12:56 sll - Updated copyright notice. - - Revision 1.2 1997/05/06 16:06:27 sll - Public release. - -*/ - #ifndef __OMNIORB_GIOP_H__ #define __OMNIORB_GIOP_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/GNUmakefile.in omniorb-dfsg-4.2.2/include/omniORB4/GNUmakefile.in --- omniorb-dfsg-4.1.6/include/omniORB4/GNUmakefile.in 2007-02-26 12:41:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/GNUmakefile.in 2012-12-31 14:57:16.000000000 +0000 @@ -6,7 +6,7 @@ INSTALLDIR = $(INSTALLINCDIR)/omniORB4 -HEADERS = acconfig.h BiDirPolicy.h CORBA.h CORBA_AbstractBase.h \ +HEADERS = acconfig.h ami.h BiDirPolicy.h CORBA.h CORBA_AbstractBase.h \ CORBA_Any.h CORBA_Any_vartypes.h \ CORBA_BOA.h CORBA_Context.h CORBA_Current.h \ CORBA_DomainManager.h \ @@ -34,7 +34,7 @@ templatedefns.h tracedthread.h userexception.h \ valueFactoryManager.h valueType.h valueTemplatedecls.h \ valueTemplatedefns.h wstringtypes.h \ - omniConnectionMgmt.h + omniConnectionMgmt.h omniZIOP.h ziopStubs.h SUBDIRS = internal diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/IIOP.h omniorb-dfsg-4.2.2/include/omniORB4/IIOP.h --- omniorb-dfsg-4.1.6/include/omniORB4/IIOP.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/IIOP.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,70 +27,6 @@ // // -/* - $Log$ - Revision 1.2.2.7 2001/07/31 16:06:15 sll - Added marshalling operators for IIOP::Address. - - Revision 1.2.2.6 2001/05/09 16:59:08 sll - Added unmarshalObjectKey() to allow quick extraction of the object key. - - Revision 1.2.2.5 2001/04/18 17:52:46 sll - Rationalise marshalling and unmarshalling routines. - - Revision 1.2.2.4 2000/11/15 17:01:59 sll - Default ProfileBody ctor set components max to 2. - - Revision 1.2.2.3 2000/10/04 16:50:06 sll - Updated header comment. - - Revision 1.2.2.2 2000/09/27 17:06:43 sll - New helper functions to decode an IOR. - - Revision 1.2.2.1 2000/07/17 10:35:34 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.4 2000/05/25 08:45:54 dpg1 - Forgot _core_attr onn IIOP::DEFAULT_CORBALOC_PORT - - Revision 1.1.2.3 2000/05/24 17:10:57 dpg1 - Rename IIOP::DEFAULT_PORT IIOP::DEFAULT_CORBALOC_PORT - - Revision 1.1.2.2 2000/04/27 10:35:49 dpg1 - Interoperable Naming Service - - Added IIOP default port constant. - - Revision 1.1.2.1 1999/09/24 09:51:40 djr - Moved from omniORB2 + some new files. - - Revision 1.10 1999/06/18 21:13:24 sll - Updted to copyright notice. - - Revision 1.9 1999/06/18 20:35:53 sll - Replaced _LC_attr with _core_attr - - Revision 1.8 1999/01/07 18:20:05 djr - Replaced _OMNIORB_NTDLL_IMPORT with _LC_attr. - - Revision 1.7 1998/04/07 19:57:16 sll - Replace _OMNIORB2_NTDLL_ specification on class IIOP with - _OMNIORB_NTDLL_IMPORT on static member constants. - - Revision 1.6 1997/12/09 20:39:38 sll - Removed profileToEncapStream and EncapStreamToProfile. - - Revision 1.5 1997/08/21 22:21:19 sll - ProfileBody now has a dtor to deallocate the storage for the host field. - - * Revision 1.4 1997/05/06 16:06:55 sll - * Public release. - * - */ - #ifndef __OMNIORB_IIOP_H__ #define __OMNIORB_IIOP_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/anonObject.h omniorb-dfsg-4.2.2/include/omniORB4/internal/anonObject.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/anonObject.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/anonObject.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -28,39 +26,6 @@ // of the interface). // -/* - $Log$ - Revision 1.1.4.3 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.2 2001/05/31 16:21:13 dpg1 - object references optionally just store a pointer to their repository - id string rather than copying it. - - Revision 1.1.4.1 2001/04/18 17:18:19 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.2 2000/09/27 17:43:55 sll - Updated to match the changes in the proxyFactory class. - - Revision 1.2.2.1 2000/07/17 10:35:50 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:59 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.3 1999/10/16 13:22:52 djr - Changes to support compiling on MSVC. - - Revision 1.1.2.2 1999/10/04 17:08:30 djr - Some more fixes/MSVC work-arounds. - - Revision 1.1.2.1 1999/09/22 14:26:42 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __ANONOBJECT_H__ #define __ANONOBJECT_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/codeSetUtil.h omniorb-dfsg-4.2.2/include/omniORB4/internal/codeSetUtil.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/codeSetUtil.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/codeSetUtil.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,43 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.3 2002/04/26 20:23:54 dgrisby - codeSetUtil didn't do the _core_attr thing for the GIOP version constants. - - Revision 1.1.4.2 2001/10/17 16:47:08 dpg1 - New minor codes - - Revision 1.1.4.1 2001/04/18 17:18:18 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - - Revision 1.1.2.1 2000/10/27 15:42:04 dpg1 - Initial code set conversion support. Not yet enabled or fully tested. - -*/ - #ifndef __CODESETUTIL_H__ #define __CODESETUTIL_H__ @@ -86,7 +66,7 @@ } static inline void freeC(char* buf) { - _CORBA_String_helper::free(buf); + _CORBA_String_helper::dealloc(buf); } static inline char* reallocC(char* oldbuf, @@ -111,7 +91,7 @@ static inline void freeU(omniCodeSet::UniChar* buf) { #if (SIZEOF_WCHAR == 2) - _CORBA_WString_helper::free(buf); + _CORBA_WString_helper::dealloc(buf); #else delete [] buf; #endif @@ -134,7 +114,7 @@ } static inline void freeW(_CORBA_WChar* buf) { - _CORBA_WString_helper::free(buf); + _CORBA_WString_helper::dealloc(buf); } static inline _CORBA_WChar* reallocW(_CORBA_WChar* oldbuf, @@ -284,23 +264,29 @@ GIOP::Version v = gs->version(); \ if (v.major == 1 && v.minor == 0) { \ if (GIOP_S::downcast(&stream)) \ - OMNIORB_THROW(MARSHAL, MARSHAL_WCharSentByGIOP10Server, \ + OMNIORB_THROW(MARSHAL, MARSHAL_WCharSentByGIOP10Client, \ (CORBA::CompletionStatus)stream.completion()); \ if (GIOP_C::downcast(&stream)) \ - OMNIORB_THROW(MARSHAL, MARSHAL_WCharSentByGIOP10Client, \ + OMNIORB_THROW(MARSHAL, MARSHAL_WCharSentByGIOP10Server, \ (CORBA::CompletionStatus)stream.completion()); \ } \ } \ - OMNIORB_THROW(BAD_PARAM,BAD_PARAM_WCharTCSNotKnown, \ - (CORBA::CompletionStatus)stream.completion()); \ + if (GIOP_C::downcast(&stream)) \ + OMNIORB_THROW(INV_OBJREF, INV_OBJREF_WCharNotSupported, \ + (CORBA::CompletionStatus)stream.completion()); \ + OMNIORB_THROW(BAD_PARAM,BAD_PARAM_WCharTCSNotKnown, \ + (CORBA::CompletionStatus)stream.completion()); \ } \ } while(0) #define OMNIORB_CHECK_TCS_W_FOR_MARSHAL(tcs, stream) \ do { \ if (!tcs) { \ - OMNIORB_THROW(BAD_PARAM,BAD_PARAM_WCharTCSNotKnown, \ - (CORBA::CompletionStatus)stream.completion()); \ + if (GIOP_C::downcast(&stream)) \ + OMNIORB_THROW(INV_OBJREF, INV_OBJREF_WCharNotSupported, \ + (CORBA::CompletionStatus)stream.completion()); \ + OMNIORB_THROW(BAD_PARAM,BAD_PARAM_WCharTCSNotKnown, \ + (CORBA::CompletionStatus)stream.completion()); \ } \ } while(0) diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/context.h omniorb-dfsg-4.2.2/include/omniORB4/internal/context.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/context.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/context.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,61 +3,28 @@ // context.h Created on: 9/1998 // Author : David Riddoch (djr) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.2.3 2001/11/27 14:35:08 dpg1 - Context, DII fixes. - - Revision 1.1.2.2 2001/11/06 15:41:36 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.1 2001/04/18 17:18:18 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.5.2.2 2000/09/27 17:25:40 sll - Changed include/omniORB3 to include/omniORB4. - - Revision 1.5.2.1 2000/07/17 10:35:40 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.6 2000/07/13 15:26:02 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.4.6.1 1999/09/22 14:26:29 djr - Major rewrite of orbcore to support POA. - - Revision 1.4 1999/05/25 17:48:50 sll - Now use _CORBA_PseudoValue_Sequence. - - Revision 1.3 1999/04/21 11:22:14 djr - CORBA::Context is a friend of ContextImpl - -*/ - #ifndef __CONTEXT_H__ #define __CONTEXT_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/corbaBoa.h omniorb-dfsg-4.2.2/include/omniORB4/internal/corbaBoa.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/corbaBoa.h 2010-05-07 22:48:29.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/corbaBoa.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,58 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Implementation of the BOA interface, built upon the POA interface. // -/* - $Log$ - Revision 1.1.6.1 2003/03/23 21:03:52 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.3 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.2 2001/05/29 17:03:49 dpg1 - In process identity. - - Revision 1.1.4.1 2001/04/18 17:18:18 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.1 2000/07/17 10:35:51 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:58 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.3 2000/06/02 14:20:15 dpg1 - Using boa_lock for the nil BOA's condition variable caused an - assertion failure on exit. - - Revision 1.1.2.2 1999/09/28 10:54:33 djr - Removed pretty-printing of object keys from object adapters. - - Revision 1.1.2.1 1999/09/22 14:26:45 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __CORBABOA_H__ #define __CORBABOA_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/corbaOrb.h omniorb-dfsg-4.2.2/include/omniORB4/internal/corbaOrb.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/corbaOrb.h 2010-05-07 22:48:29.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/corbaOrb.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,61 +8,23 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Implementation of the ORB interface. // -/* - $Log$ - Revision 1.1.4.5 2001/11/13 14:11:44 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.1.4.4 2001/11/06 15:41:37 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.4.3 2001/09/19 17:26:46 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.4.2 2001/08/01 10:08:20 dpg1 - Main thread policy. - - Revision 1.1.4.1 2001/04/18 17:18:18 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.1 2000/07/17 10:35:52 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:58 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.3 2000/02/04 18:11:02 djr - Minor mods for IRIX (casting pointers to ulong instead of int). - - Revision 1.1.2.2 2000/01/20 11:51:34 djr - (Most) Pseudo objects now used omni::poRcLock for ref counting. - New assertion check OMNI_USER_CHECK. - - Revision 1.1.2.1 1999/09/22 14:26:46 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __CORBAORB_H__ #define __CORBAORB_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/deferredRequest.h omniorb-dfsg-4.2.2/include/omniORB4/internal/deferredRequest.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/deferredRequest.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/deferredRequest.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -// -*- Mode: C++; -*- -// Package : omniORB -// deferredRequest.h Created on: 10/1998 -// Author : David Riddoch (djr) -// -// Copyright (C) 1996-1999 AT&T Laboratories Cambridge -// -// This file is part of the omniORB library -// -// The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library 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 -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA -// -// -// Description: -// An invoker task used to implement deferred requests for the -// Dynamic Invocation Interface. -// - -#ifndef __DEFERREDREQUEST_H__ -#define __DEFERREDREQUEST_H__ - -#include -#include - - -OMNI_NAMESPACE_BEGIN(omni) - -class DeferredRequest : public omniTask { - -public: - DeferredRequest(RequestImpl* request); - // Inserts task in the ORB invoker as an AnyTime task. - - inline CORBA::Boolean poll_response() { - omni_tracedmutex_lock lock(pd_readyMutex); - return pd_ready; - } - // Returns true if the operation has completed, false otherwise. - - inline void get_response() { - omni_tracedmutex_lock lock(pd_readyMutex); - while( !pd_ready ) pd_readyCondition.wait(); - } - // Blocks until the operation has completed. - - inline CORBA::Exception* get_exception() { - CORBA::Exception* e = pd_exception; - pd_exception = 0; - return e; - } - // If there is one, transfer ownership of a stored - // exception to the caller. - - inline void die() { OMNIORB_ASSERT(pd_ready); delete this; } - - virtual void execute(); - -protected: - virtual ~DeferredRequest(); - - RequestImpl* pd_request; - CORBA::Boolean pd_ready; - omni_tracedmutex pd_readyMutex; - omni_tracedcondition pd_readyCondition; - CORBA::Exception* pd_exception; -}; - -OMNI_NAMESPACE_END(omni) - -#endif // __DEFERREDREQUEST_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/dynamicImplementation.h omniorb-dfsg-4.2.2/include/omniORB4/internal/dynamicImplementation.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/dynamicImplementation.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/dynamicImplementation.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/dynamicLib.h omniorb-dfsg-4.2.2/include/omniORB4/internal/dynamicLib.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/dynamicLib.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/dynamicLib.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,54 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Hook to allow orbcore to access dynamic library when linked. // -/* - $Log$ - Revision 1.1.4.3 2001/11/06 15:41:37 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.4.2 2001/08/17 17:09:39 sll - Use LinkHack. - - Revision 1.1.4.1 2001/04/18 17:18:17 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.2 2000/09/27 17:42:38 sll - Updated to use the new cdrStream abstraction - - Revision 1.2.2.1 2000/07/17 10:35:39 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:03 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.2 2000/02/08 13:25:24 djr - Added a couple of missing _core_attr. - - Revision 1.1.2.1 1999/09/22 14:26:25 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __DYNAMICLIB_H__ #define __DYNAMICLIB_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/dynAnyImpl.h omniorb-dfsg-4.2.2/include/omniORB4/internal/dynAnyImpl.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/dynAnyImpl.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/dynAnyImpl.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,79 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Implementation of CORBA::DynAny. // -/* - $Log$ - Revision 1.1.4.4 2005/01/06 16:39:23 dgrisby - DynValue and DynValueBox implementations; misc small fixes. - - Revision 1.1.4.3 2004/07/23 10:29:57 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.1.4.2 2004/07/04 23:53:35 dgrisby - More ValueType TypeCode and Any support. - - Revision 1.1.4.1 2003/03/23 21:03:51 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2001/10/19 11:04:03 dpg1 - Avoid confusing (to gcc 2.95) inheritance of refcount functions. - - Revision 1.1.2.2 2001/10/17 18:51:51 dpg1 - Fix inevitable Windows problems. - - Revision 1.1.2.1 2001/10/17 16:44:05 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.2.1 2001/04/18 17:18:17 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.5.2.5 2000/11/17 19:09:37 dpg1 - Support codeset conversion in any. - - Revision 1.5.2.4 2000/11/09 12:27:53 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.5.2.3 2000/10/06 16:40:53 sll - Changed to use cdrStream. - - Revision 1.5.2.2 2000/09/27 17:25:41 sll - Changed include/omniORB3 to include/omniORB4. - - Revision 1.5.2.1 2000/07/17 10:35:41 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.6 2000/07/13 15:26:02 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.2.8.3 1999/10/26 20:18:20 sll - DynAny no longer do alias expansion on the typecode. In other words, all - aliases in the typecode are preserved. - - Revision 1.2.8.2 1999/09/22 16:15:59 djr - Removed MT locking. - -*/ - #ifndef __DYNANYIMPL_H__ #define __DYNANYIMPL_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/excepthandler.h omniorb-dfsg-4.2.2/include/omniORB4/internal/excepthandler.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/excepthandler.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/excepthandler.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,71 +3,53 @@ // excepthandler.h Created on: 13/5/97 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2011-2014 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.4.2 2002/02/25 11:17:11 dpg1 - Use tracedmutexes everywhere. - - Revision 1.1.4.1 2001/04/18 17:18:17 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.3.2.1 2000/07/17 10:35:53 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.4 2000/07/13 15:25:58 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.2.8.1 1999/09/22 14:26:48 djr - Major rewrite of orbcore to support POA. - - Revision 1.1 1997/12/09 18:43:07 sll - Initial revision - - */ - #ifndef __EXCEPTHANDLER_H__ #define __EXCEPTHANDLER_H__ - class omniExHandlers_iterator; - class omniExHandlers { public: void* transient_hdr; void* transient_cookie; + void* timeout_hdr; + void* timeout_cookie; void* commfail_hdr; void* commfail_cookie; void* sysexcpt_hdr; void* sysexcpt_cookie; + CORBA::Boolean transient_ext; + CORBA::Boolean timeout_ext; + CORBA::Boolean commfail_ext; + CORBA::Boolean sysexcpt_ext; + static omniExHandlers** Table; static omni_tracedmutex TableLock; friend class omniExHandlers_iterator; + private: omniExHandlers(); omniObjRef* objptr; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/exceptiondefs.h omniorb-dfsg-4.2.2/include/omniORB4/internal/exceptiondefs.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/exceptiondefs.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/exceptiondefs.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,72 +8,22 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.4.3 2001/10/17 16:44:05 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.4.2 2001/08/03 17:45:09 sll - Moved OMNIORB_THROW so that it can be used in stub headers - - Revision 1.1.4.1 2001/04/18 17:18:17 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.4 2000/10/09 16:21:26 sll - Removed reference to omniConnectionBroken. - - Revision 1.2.2.3 2000/10/06 16:36:07 sll - Removed omniConnectionBroken. Has been superceded by raiseException() in - the strand interface. - - Revision 1.2.2.2 2000/09/27 17:42:38 sll - Updated to use the new cdrStream abstraction - - Revision 1.2.2.1 2000/07/17 10:35:39 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:03 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 2000/06/22 10:37:49 dpg1 - Transport code now throws omniConnectionBroken exception rather than - CORBA::COMM_FAILURE when things go wrong. This allows the invocation - code to distinguish between transport problems and COMM_FAILURES - propagated from the server side. - - exception.h renamed to exceptiondefs.h to avoid name clash on some - platforms. - - Revision 1.1.2.3 1999/10/18 11:27:37 djr - Centralised list of system exceptions. - - Revision 1.1.2.2 1999/10/14 16:21:54 djr - Implemented logging when system exceptions are thrown. - - Revision 1.1.2.1 1999/09/22 14:26:25 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __OMNIORB_EXCEPTION_H__ #define __OMNIORB_EXCEPTION_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopBiDir.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopBiDir.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopBiDir.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopBiDir.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,51 +3,29 @@ // giopBiDir.h Created on: 17/7/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2005 Apasphere Ltd +// Copyright (C) 2005-2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.2 2005/03/02 12:39:38 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:03:49 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2002/01/02 18:15:41 dpg1 - Platform fixes/additions. - - Revision 1.1.2.2 2001/08/03 17:43:19 sll - Make sure dll import spec for win32 is properly done. - - Revision 1.1.2.1 2001/07/31 16:28:02 sll - Added GIOP BiDir support. - - */ - - #ifndef __GIOPBIDIR_H__ #define __GIOPBIDIR_H__ @@ -68,7 +46,7 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class BiDirInfo : public omniIOR::IORExtraInfo { - public: +public: BiDirInfo(char* s) : OMNIORB_BASE_CTOR(omniIOR::)IORExtraInfo(IOP::TAG_OMNIORB_BIDIR), sendfrom(s) {} @@ -77,7 +55,7 @@ ~BiDirInfo() {} - private: +private: BiDirInfo(); BiDirInfo(const BiDirInfo&); BiDirInfo& operator=(const BiDirInfo&); @@ -86,9 +64,9 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class BiDirServerRope : public giopRope { - public: +public: - static int selectRope(const giopAddressList&,omniIOR::IORInfo*,Rope*&); + static int selectRope(const giopAddressList&, omniIOR::IORInfo*, Rope*&); // Look into the IORInfo, if bidirectional giop is suitable for this ior // (i.e. the IOP component TAG_OMNIORB_BIDIR exists and its GIOP version // is >= 1.2), search the list and return the BiDirServerRope whose @@ -99,7 +77,7 @@ // Thread Safety preconditions: // Caller *must* hold omniTransportLock. - static BiDirServerRope* addRope(giopStrand*,const giopAddressList&); + static BiDirServerRope* addRope(giopStrand*, const giopAddressList&); // Add a BiDirServerRope for the bidirectional strand if one has not // been created already. Add the list of redirection addresses to // this rope. Return the rope instance. Notice that the reference @@ -126,7 +104,7 @@ protected: virtual void realIncrRefCount(); - private: +private: CORBA::String_var pd_sendfrom; giopAddressList pd_redirect_addresses; @@ -142,17 +120,18 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class BiDirClientRope : public giopRope { - public: +public: - BiDirClientRope(const giopAddressList& addrlist, - const omnivector& preferred); + BiDirClientRope(const giopAddressList& addrlist, omniIOR::IORInfo* info); - IOP_C* acquireClient(const omniIOR*, + IOP_C* acquireClient(const omniIOR* ior, const CORBA::Octet* key, - CORBA::ULong keysize, - omniCallDescriptor*); // override giopRope - private: + CORBA::ULong keysize, + omniCallDescriptor* cd); // override giopRope +protected: + void filterAndSortAddressList(); +private: omni_tracedmutex pd_lock; BiDirClientRope(); diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/GIOP_C.h omniorb-dfsg-4.2.2/include/omniORB4/internal/GIOP_C.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/GIOP_C.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/GIOP_C.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,60 +3,29 @@ // GIOP_C.h Created on: 05/01/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2006 Apasphere Ltd +// Copyright (C) 2006-2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.3 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.6.2 2006/06/05 13:33:25 dgrisby - Inline declarations; operation() access function. - - Revision 1.1.6.1 2003/03/23 21:03:56 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.4 2001/10/17 16:33:27 dpg1 - New downcast mechanism for cdrStreams. - - Revision 1.1.4.3 2001/09/04 14:38:08 sll - Added the boolean argument to notifyCommFailure to indicate if - omniTransportLock is held by the caller. - - Revision 1.1.4.2 2001/05/01 16:07:33 sll - All GIOP implementations should now work with fragmentation and abitrary - sizes non-copy transfer. - - Revision 1.1.4.1 2001/04/18 17:19:01 sll - Big checkin with the brand new internal APIs. - - */ - - #ifndef __GIOP_C_H__ #define __GIOP_C_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopMonitor.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopMonitor.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopMonitor.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopMonitor.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.2.2 2002/08/21 06:23:15 dgrisby - Properly clean up bidir connections and ropes. Other small tweaks. - - Revision 1.1.2.1 2001/07/31 16:28:02 sll - Added GIOP BiDir support. - -*/ - #ifndef __GIOPMONITOR_H__ #define __GIOPMONITOR_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopRendezvouser.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopRendezvouser.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopRendezvouser.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopRendezvouser.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,38 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.2 2001/07/13 15:18:17 sll - New internal function notifyReadable. - - Revision 1.1.4.1 2001/04/18 17:19:00 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:05 sll - Added new files. - -*/ - #ifndef __GIOPRENDEZVOUSER_H__ #define __GIOPRENDEZVOUSER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopRope.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopRope.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopRope.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopRope.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,74 +1,31 @@ // -*- Mode: C++; -*- -// Package : omniORB2 -// giopRope.h Created on: 05/01/2001 +// Package : omniORB +// giopRope.h Created on: 05/01/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2009 Apasphere Ltd +// Copyright (C) 2003-2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.3 2009/05/05 14:44:39 dgrisby - Ropes rememeber the bidir configuration set at the time of their - creation, meaning it can safely be changed at run time. - - Revision 1.1.6.2 2006/03/26 20:59:28 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:48 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.7 2002/08/21 06:23:15 dgrisby - Properly clean up bidir connections and ropes. Other small tweaks. - - Revision 1.1.4.6 2001/09/19 17:26:46 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.4.5 2001/09/04 14:38:09 sll - Added the boolean argument to notifyCommFailure to indicate if - omniTransportLock is held by the caller. - - Revision 1.1.4.4 2001/08/03 17:43:19 sll - Make sure dll import spec for win32 is properly done. - - Revision 1.1.4.3 2001/07/31 16:24:23 sll - Moved filtering and sorting of available addresses into a separate - function. Make acquireClient, decrRefCount and notifyCommFailure virtual. - - Revision 1.1.4.2 2001/06/13 20:11:37 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.1 2001/04/18 17:19:00 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:04 sll - Added new files. - - */ - - #ifndef __GIOPROPE_H__ #define __GIOPROPE_H__ @@ -94,47 +51,45 @@ //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class giopRope : public Rope, public RopeLink { - public: +public: - static int selectRope(const giopAddressList&, - omniIOR::IORInfo*, - Rope*&, - CORBA::Boolean& is_local); + static int selectRope(const giopAddressList& addrlist, + omniIOR::IORInfo* info, + Rope*& rope, + CORBA::Boolean& is_local); // Given an address list, return a rope that can be used to talk to // remote objects in that address space. If the address list is in fact - // points to ourselves, set to TRUE(1). - // Returns TRUE(1) if either the addresses are local or the rope is found. - // Returns FALSE(0) if no suitable rope is find. + // pointing to ourselves, set to true. + // Returns true if either the addresses are local or the rope is found. + // Returns false if no suitable rope is found. // If a rope is returned, the reference count on the rope is already // incremented by 1. // // This is normally the entry function that causes a rope to be created // in the first place. // - // // Thread Safety preconditions: // Caller must not hold omniTransportLock, it is used internally for // synchronisation. - giopRope(const giopAddressList& addrlist, - const omnivector& preferred); - // & are copied. + giopRope(const giopAddressList& addrlist, omniIOR::IORInfo* info); + // is copied. // Reference count is initialised to 0. // No thread safety precondition - giopRope(giopAddress* addr, int i = 0); + giopRope(giopAddress* addr); + // Construct with a single address. Used for server-side bidir. // is consumed by this instance. - // Reference count is initialised to // No thread safety precondition virtual ~giopRope(); // No thread safety precondition - virtual IOP_C* acquireClient(const omniIOR*, + virtual IOP_C* acquireClient(const omniIOR* ior, const CORBA::Octet* key, - CORBA::ULong keysize, - omniCallDescriptor*); + CORBA::ULong keysize, + omniCallDescriptor* cd); // Acquire a GIOP_C from this rope. // // Thread Safety preconditions: @@ -166,6 +121,13 @@ // Caller must not hold omniTransportLock, it is used internally for // synchronisation. + void disconnect(); + // Forcibly disconnect all strands. + // + // Thread Safety preconditions: + // Caller must not hold omniTransportLock, it is used internally for + // synchronisation. + CORBA::Boolean hasAddress(const giopAddress*); // Returns true if the address is in this rope's address list; false // otherwise. @@ -190,7 +152,7 @@ // // Thread Safety preconditions: // Internally, omniTransportLock is used for synchronisation, if - // is TRUE(1), the caller already hold the lock. + // is true, the caller already holds the lock. // Access functions to change the rope parameters. Notice that these // functions does not perform any mutual exclusion internally. It is @@ -210,7 +172,7 @@ } void oneCallPerConnection(CORBA::Boolean yes) { - // No thread safety precondition, use with extreme care + // No thread safety precondition, use with extreme care pd_oneCallPerConnection = yes; } @@ -233,16 +195,21 @@ friend class omni_giopbidir_initialiser; protected: - int pd_refcount; // reference count - giopAddressList pd_addresses; // Addresses of the remote address space - omnivector pd_addresses_order; - omnivector::size_type pd_address_in_use; - CORBA::ULong pd_maxStrands; - CORBA::Boolean pd_oneCallPerConnection; - int pd_nwaiting; - omni_tracedcondition pd_cond; - CORBA::Boolean pd_offerBiDir; // State of orbParameters::offerBiDir... - // at time of creation. + int pd_refcount; + giopAddressList pd_addresses; // Addresses of the remote server + size_t pd_ior_addr_size; // Number of addresses in IOR + omnivector pd_addresses_order; + size_t pd_address_in_use; + CORBA::ULong pd_maxStrands; + CORBA::Boolean pd_oneCallPerConnection; + int pd_nwaiting; + omni_tracedcondition pd_cond; + CORBA::ULong pd_flags; // Selected flags in use + CORBA::ULong pd_ior_flags; // Flags requested in IOR + CORBA::Boolean pd_offerBiDir; // State of orbParameters:: + // offerBiDir... at time of creation. + CORBA::Boolean pd_addrs_filtered; + CORBA::Boolean pd_filtering; static _core_attr RopeLink ropes; // All ropes created by selectRope are linked together by this list. @@ -253,18 +220,20 @@ // Thread Safety preconditions: // Caller must hold omniTransportLock. - CORBA::Boolean match(const giopAddressList&) const; - // Return TRUE(1) if the address list matches EXACTLY those of this rope. + virtual CORBA::Boolean match(const giopAddressList&, + omniIOR::IORInfo* info) const; + // Return true if the address list matches EXACTLY those of this + // rope, and the IORInfo policies match. // No thread safety precondition - static void filterAndSortAddressList(const giopAddressList& list, - omnivector& ordered_list, - CORBA::Boolean& use_bidir); - // Consult the configuration table, filter out the addresses in that - // should not be used. Sort the remaining ones in the order of preference. - // Write out the *index* of the sorted addresses into . - // Set use_bidir to 1 if bidirection GIOP is to be used for the sorted - // addresses. + virtual void filterAndSortAddressList(); + // Use the clientTransportRules to filter and sort the address list + // in pd_addresses, storing the resulting order in + // pd_addresses_order, and set pd_flags appropriately. Any names in + // pd_addresses are resolved and the resulting addresses are added + // to pd_addresses. + // + // Called with no locks held, but serialised for a particular rope. private: giopRope(); diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopServer.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopServer.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopServer.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopServer.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,73 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.5 2006/10/09 09:47:12 dgrisby - Only delete giopServer if all threads are successfully shut down. - - Revision 1.1.6.4 2006/06/22 13:53:49 dgrisby - Add flags to strand. - - Revision 1.1.6.3 2006/04/09 19:52:31 dgrisby - More IPv6, endPointPublish parameter. - - Revision 1.1.6.2 2005/11/17 17:03:26 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:47 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.8 2002/02/13 16:02:38 dpg1 - Stability fixes thanks to Bastiaan Bakker, plus threading - optimisations inspired by investigating Bastiaan's bug reports. - - Revision 1.1.4.7 2001/12/03 18:48:14 dpg1 - Clean up strange indentation. - - Revision 1.1.4.6 2001/09/20 13:26:13 dpg1 - Allow ORB_init() after orb->destroy(). - - Revision 1.1.4.5 2001/08/17 15:00:47 dpg1 - Fixes for pre-historic compilers. - - Revision 1.1.4.4 2001/07/31 16:28:01 sll - Added GIOP BiDir support. - - Revision 1.1.4.3 2001/07/13 15:19:30 sll - Manage the state of each connection internally. Added new callback - functions. - - Revision 1.1.4.2 2001/06/13 20:11:37 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.1 2001/04/18 17:19:00 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:04 sll - Added new files. - -*/ - #ifndef __GIOPSERVER_H__ #define __GIOPSERVER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/GIOP_S.h omniorb-dfsg-4.2.2/include/omniORB4/internal/GIOP_S.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/GIOP_S.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/GIOP_S.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,76 +3,29 @@ // GIOP_S.h Created on: 05/01/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2005-2007 Apasphere Ltd +// Copyright (C) 2005-2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.5 2007/04/05 15:06:45 dgrisby - Handle CancelRequest without starting a new giopWorker. - - Revision 1.1.6.4 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.1.6.3 2006/06/05 11:27:20 dgrisby - Comment tweak. - - Revision 1.1.6.2 2005/01/06 23:08:23 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:56 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.7 2002/11/26 14:51:48 dgrisby - Implement missing interceptors. - - Revision 1.1.4.6 2001/10/17 16:33:27 dpg1 - New downcast mechanism for cdrStreams. - - Revision 1.1.4.5 2001/09/04 14:38:09 sll - Added the boolean argument to notifyCommFailure to indicate if - omniTransportLock is held by the caller. - - Revision 1.1.4.4 2001/07/13 15:17:38 sll - Ctor takes a giopWorker rather than a giopServer. - - Revision 1.1.4.3 2001/05/02 14:22:05 sll - Cannot rely on the calldescriptor still being there when a user exception - is raised. - - Revision 1.1.4.2 2001/05/01 16:07:32 sll - All GIOP implementations should now work with fragmentation and abitrary - sizes non-copy transfer. - - Revision 1.1.4.1 2001/04/18 17:19:01 sll - Big checkin with the brand new internal APIs. - - */ - - #ifndef __GIOP_S_H__ #define __GIOP_S_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStrandFlags.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStrandFlags.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStrandFlags.h 2006-06-22 13:54:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStrandFlags.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -45,15 +43,23 @@ // Allocated flag bits // -#define GIOPSTRAND_ENABLE_TRANSPORT_BATCHING (1 << 0) +#define GIOPSTRAND_BIDIR (1 << 0) +// Strand supports bidirectional GIOP. + +#define GIOPSTRAND_ENABLE_TRANSPORT_BATCHING (1 << 1) // Normally omniORB sets connections to send data as soon as possible, // e.g. with the TCP_NODELAY socket option. This flag means that // message batching in the transport should be enabled. -#define GIOPSTRAND_HOLD_OPEN (1 << 1) +#define GIOPSTRAND_HOLD_OPEN (1 << 2) // If set, the connection is held open, rather than being scavenged // when idle. +#define GIOPSTRAND_COMPRESSION (1 << 3) +// If set, the connection supports ZIOP compression. + +#define GIOPSTRAND_CONNECTION_MANAGEMENT (1 << 4) +// If set, the connection is managed by the omniConnectionMgmt extension. #endif // __GIOPSTRANDFLAGS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStrand.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStrand.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStrand.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStrand.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,88 +3,34 @@ // giopStrand.h Created on: 05/01/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2006 Apasphere Ltd +// Copyright (C) 2002-2012 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.4 2006/07/18 16:21:23 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.6.3 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.1.6.2 2006/06/22 13:53:49 dgrisby - Add flags to strand. - - Revision 1.1.6.1 2003/03/23 21:03:46 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.10 2002/08/21 06:23:15 dgrisby - Properly clean up bidir connections and ropes. Other small tweaks. - - Revision 1.1.4.9 2001/09/19 17:26:46 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.4.8 2001/09/10 17:43:11 sll - Replaced the non-thread safe resetIdleCounter with startIdleCounter and - stopIdleCounter. Added orderly_closed to indicate that a stand is orderly - closed because a GIOP CloseConnection message has been received. - - Revision 1.1.4.7 2001/08/29 17:51:06 sll - Updated description for gatekeeper_checked. - - Revision 1.1.4.6 2001/08/17 17:10:05 sll - Modularise ORB configuration parameters. - - Revision 1.1.4.5 2001/08/03 17:43:19 sll - Make sure dll import spec for win32 is properly done. - - Revision 1.1.4.4 2001/07/31 16:28:01 sll - Added GIOP BiDir support. - - Revision 1.1.4.3 2001/07/13 15:20:56 sll - New member safeDelete is now the only method to delete a strand. - - Revision 1.1.4.2 2001/06/13 20:11:37 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.1 2001/04/18 17:19:00 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:04 sll - Added new files. - - */ - #ifndef __GIOPSTRAND_H__ #define __GIOPSTRAND_H__ #include +#include "giopStrandFlags.h" #ifdef _core_attr # error "A local CPP macro _core_attr has already been defined." @@ -103,9 +49,11 @@ class giopStreamImpl; class giopWorker; class giopServer; +class giopCompressor; class GIOP_S; struct giopStream_Buffer; + //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class giopStreamList { @@ -161,8 +109,6 @@ // No thread safety precondition -public: - CORBA::Boolean safeDelete(CORBA::Boolean forced = 0); // This should be the *ONLY* method to call to delete a strand. // Return TRUE if the strand can be considered deleted. @@ -240,7 +186,7 @@ // convenient time. TIMEDOUT // This strand can still be used when required but - // it can also be removed if resources is scarce. + // it can also be removed if resources are scarce. }; State state() const { return pd_state; } @@ -278,7 +224,7 @@ giopStreamList servers; giopStreamList clients; - // a strand may have more than one giopStream instances associated with + // a strand may have more than one giopStream instance associated with // it. Mostly this is because from GIOP 1.2 onwards, requests can be // interleaved on associated connection. Each of these request is // represented by a giopStream instance. They are linked together by @@ -289,13 +235,16 @@ // Except when a strand is used to support bidirectional GIOP, only one of // the list will be populated (because plain GIOP is asymetric and one // end is either a client or a server but not both). With bidirectional GIOP, - // both list may be populated. + // both lists may be populated. inline CORBA::Boolean isClient() { return (address != 0); } // Return TRUE if this is an active strand on the client side. Unless // biDir is TRUE, only those messages expected by a GIOP client can be // received from this connection. + inline CORBA::Boolean isBiDir() { return (flags & GIOPSTRAND_BIDIR) ? 1 : 0; } + // Return TRUE if this is a bidirectional strand. + const giopAddress* address; // address is provided as ctor arg if this is a active strand, otherwise // it is 0. @@ -313,9 +262,6 @@ // allocated flags values. // Initialised to 0 in the constructor. - CORBA::Boolean biDir; - // Indicate if the strand is used for bidirectional GIOP. - CORBA::Boolean gatekeeper_checked; // only applies to passive strand. TRUE(1) means that the serverTransportRule // has been checked. This flag is set by giopWorker and is @@ -352,11 +298,13 @@ // This flag is initialised to 0 by ctor and set to 1 by // omniObjRef::_marshal. + //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // The following are data structures used by the giopStream instances // associated with this strand AND SHOULD NOT BE manipulated by the Strand // class!!! + CORBA::Boolean tcs_selected; omniCodeSet::TCS_C* tcs_c; omniCodeSet::TCS_W* tcs_w; @@ -370,8 +318,10 @@ // , and records the chosen code set convertors // and the GIOP version for which the convertors apply. + giopCompressor* compressor; + // Compressor used for ZIOP. - // conditional variables and counters to implement giopStream locking + // Condition variables and counters to implement giopStream locking // functions. omni_tracedcondition rdcond; int rd_nwaiting; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStream.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStream.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStream.h 2011-06-01 23:11:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStream.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,73 +3,29 @@ // giopStream.h Created on: 05/01/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2006 Apasphere Ltd +// Copyright (C) 2003-2012 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.3 2006/09/20 13:36:31 dgrisby - Descriptive logging for connection and GIOP errors. - - Revision 1.1.6.2 2005/11/17 17:03:26 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:46 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.7 2001/10/17 16:44:05 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.4.6 2001/09/04 14:38:09 sll - Added the boolean argument to notifyCommFailure to indicate if - omniTransportLock is held by the caller. - - Revision 1.1.4.5 2001/09/03 16:50:43 sll - Added the deadline parameter and access functions. All member functions - that previously had deadline arguments now use the per-object deadline - implicitly. - - Revision 1.1.4.4 2001/08/03 17:43:19 sll - Make sure dll import spec for win32 is properly done. - - Revision 1.1.4.3 2001/07/31 16:20:30 sll - New primitives to acquire read lock on a connection. - - Revision 1.1.4.2 2001/05/01 16:07:32 sll - All GIOP implementations should now work with fragmentation and abitrary - sizes non-copy transfer. - - Revision 1.1.4.1 2001/04/18 17:18:59 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:04 sll - Added new files. - - */ - - #ifndef __GIOPSTREAM_H__ #define __GIOPSTREAM_H__ @@ -97,12 +53,70 @@ CORBA::ULong last; // offset to the last data byte CORBA::ULong size; // GIOP message size. giopStream_Buffer* next; // next Buffer in a chain - // buffer data to follows. + // buffer data follows. + void alignStart(omni::alignment_t); static void deleteBuffer(giopStream_Buffer*); static giopStream_Buffer* newBuffer(CORBA::ULong sz=0); + + inline omni::ptr_arith_t bufStart() + { + return (omni::ptr_arith_t)this + start; + } + + inline omni::ptr_arith_t bufLast() + { + return (omni::ptr_arith_t)this + last; + } + + inline omni::ptr_arith_t bufEnd() + { + return (omni::ptr_arith_t)this + end; + } + + inline void setLast(void* mkr) + { + last = (omni::ptr_arith_t)mkr - (omni::ptr_arith_t)this; + } + + inline CORBA::ULong dataSize() + { + return last - start; + } }; +class giopStream; + + +// +// ZIOP support + +class giopCompressor { +public: + virtual ~giopCompressor() = 0; + + virtual giopStream_Buffer* compressBuffer(giopStream* stream, + giopStream_Buffer* buf) = 0; + // Compress buf, which must contain a complete GIOP message. + // Consumes buf, or returns it unchanged if the data was not + // compressible. + + virtual giopStream_Buffer* decompressBuffer(giopStream* stream, + giopStream_Buffer* buf) = 0; + // Decompress buf, reading more data from the stream if need be. + // Consumes buf. +}; + +class giopCompressorFactory { +public: + virtual ~giopCompressorFactory() = 0; + virtual giopCompressor* newCompressor() = 0; +}; + + +// +// GIOP stream + class giopStream : public cdrStream { public: @@ -123,25 +137,27 @@ GIOP::Version version(); // No thread safety precondition - operator giopStrand& () { return *pd_strand; } inline giopStrand& strand() { return *pd_strand; } // No thread safety precondition - giopStreamImpl* impl() const { return pd_impl; } + inline giopStreamImpl* impl() const { return pd_impl; } // No thread safety precondition - void impl(giopStreamImpl* impl) { pd_impl = impl; } + inline void impl(giopStreamImpl* impl) { pd_impl = impl; } // No thread safety precondition - inline void getDeadline(unsigned long& secs, unsigned long& nanosecs) const { - secs = pd_deadline_secs; - nanosecs = pd_deadline_nanosecs; + inline const omni_time_t& getDeadline() const { + return pd_deadline; } // No thread safety precondition - inline void setDeadline(unsigned long secs, unsigned long nanosecs) { - pd_deadline_secs = secs; - pd_deadline_nanosecs = nanosecs; + inline void setDeadline(const omni_time_t& deadline) { + pd_deadline = deadline; + } + // No thread safety precondition + + inline void clearDeadline() { + pd_deadline.assign(0,0); } // No thread safety precondition @@ -308,14 +324,16 @@ CORBA::Boolean pd_rdlocked; CORBA::Boolean pd_wrlocked; giopStreamImpl* pd_impl; - unsigned long pd_deadline_secs; - unsigned long pd_deadline_nanosecs; + omni_time_t pd_deadline; private: giopStream(); giopStream(const giopStream&); giopStream& operator=(const giopStream&); + operator giopStrand&(); + // Not implemented. Use the strand() member function instead. + public: // These tunable parameters are used to determine at what size an // octet array will be sent/received directly to/from the network @@ -323,8 +341,14 @@ static _core_attr CORBA::ULong directSendCutOff; static _core_attr CORBA::ULong directReceiveCutOff; - static _core_attr CORBA::ULong bufferSize; + // When performing a direct send, ensure that the previous chunk + // contains at least this much data. Must be a multiple of 8. + static _core_attr CORBA::ULong minChunkBeforeDirectSend; + // Allocate this number of bytes for each giopStream_Buffer. + static _core_attr CORBA::ULong bufferSize; + + static _core_attr giopCompressorFactory* compressorFactory; public: // The following implement the abstract functions defined in cdrStream @@ -335,27 +359,35 @@ void put_octet_array(const _CORBA_Octet* b, int size, omni::alignment_t align=omni::ALIGN_1); + void get_octet_array(_CORBA_Octet* b,int size, omni::alignment_t align=omni::ALIGN_1); + void skipInput(_CORBA_ULong); + _CORBA_Boolean checkInputOverrun(_CORBA_ULong, _CORBA_ULong, omni::alignment_t align=omni::ALIGN_1); + _CORBA_Boolean checkOutputOverrun(_CORBA_ULong,_CORBA_ULong, omni::alignment_t align=omni::ALIGN_1); + void fetchInputData(omni::alignment_t,size_t); + _CORBA_Boolean reserveOutputSpaceForPrimitiveType(omni::alignment_t,size_t); + _CORBA_Boolean maybeReserveOutputSpace(omni::alignment_t,size_t); _CORBA_Boolean is_giopStream(); _CORBA_ULong currentInputPtr() const; + _CORBA_ULong currentOutputPtr() const; friend class giopImpl10; friend class giopImpl11; friend class giopImpl12; - + friend class giopCompressorImpl; //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -364,18 +396,11 @@ // inputMessage() and inputChunk(). Both functions return a // giopStream_Buffer. The buffer should be returned to the strand using // the releaseInputBuffer() function. - // - // struct giopStream_Buffer { - // CORBA::ULong start; /* offset to the beginning of data */ - // CORBA::ULong end; /* offset to the end of buffer */ - // CORBA::ULong last; /* offset to the last data byte */ - // CORBA::ULong size; /* GIOP message size. */ - // inputBuffer* next; /* next inputBuffer in a chain */ - // buffer data to follows. - // static void deleteBuffer(inputBuffer*); - // }; + giopStream_Buffer* newInputBuffer(CORBA::ULong sz=0); - // Return a giopStream_Buffer. Should be deleted by calling + // Return a giopStream_Buffer. Should be deleted by calling its + // deleteBuffer() method. + private: // The following variables must be initialised to 0 by reset(). @@ -402,7 +427,7 @@ return pd_inputExpectAnotherFragment; } - inline void inputExpectAnotherFragment(CORBA::Boolean yes ) { + inline void inputExpectAnotherFragment(CORBA::Boolean yes) { pd_inputExpectAnotherFragment = yes; } @@ -410,7 +435,7 @@ return pd_inputMatchedId; } - inline void inputMatchedId(CORBA::Boolean yes ) { + inline void inputMatchedId(CORBA::Boolean yes) { pd_inputMatchedId = yes; } @@ -430,6 +455,22 @@ pd_inputFragmentToCome = fsz; } + inline omni::ptr_arith_t inputBufferStart() { + return pd_currentInputBuffer->bufStart(); + } + + inline omni::ptr_arith_t inputBufferLast() { + return pd_currentInputBuffer->bufLast(); + } + + inline CORBA::ULong inputBufferMsgSize() { + return pd_currentInputBuffer->size; + } + + inline CORBA::ULong inputBufferDataSize() { + return pd_currentInputBuffer->dataSize(); + } + giopStream_Buffer* inputMessage(); // Read the next GIOP message from the connection. This function does the // basic sanity check on the message header. @@ -509,7 +550,24 @@ pd_outputFragmentSize = fsz; } - // GIOP message are sent via these member functions + inline omni::ptr_arith_t outputBufferStart() { + return pd_currentOutputBuffer->bufStart(); + } + + inline omni::ptr_arith_t outputBufferEnd() { + return pd_currentOutputBuffer->bufEnd(); + } + + inline CORBA::ULong bufferedOutputSize() { + return (omni::ptr_arith_t)pd_outb_mkr - pd_currentOutputBuffer->bufStart(); + } + + inline void setOutputLastOffset() { + pd_currentOutputBuffer->setLast(pd_outb_mkr); + } + + + // GIOP messages are sent via these member functions void sendChunk(giopStream_Buffer*); // Send the buffer to the strand. @@ -520,7 +578,7 @@ // Thread Safety preconditions: // Caller must have acquired the write lock on the strand. - void sendCopyChunk(void*,CORBA::ULong size); + void sendCopyChunk(void*, CORBA::ULong size); // Same as sendChunk() except that the data is copied directly from // the application buffer. // @@ -530,6 +588,10 @@ void errorOnSend(int,const char*,CORBA::ULong,CORBA::Boolean,const char*); // internal helper function, do not use outside this class +public: + giopActiveConnection* openConnection(); + // For a client-side stream, open the connection. + protected: ////////////////////////////////////////////////////////////////// inline CORBA::ULong requestId() const { return pd_request_id; } diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStreamImpl.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStreamImpl.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopStreamImpl.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopStreamImpl.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,42 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.2 2008/08/08 16:52:56 dgrisby - Option to validate untransformed UTF-8; correct data conversion minor - codes; better logging for MessageErrors. - - Revision 1.1.6.1 2003/03/23 21:03:46 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.1 2001/04/18 17:18:59 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:03 sll - Added new files. - -*/ - #ifndef __GIOPSTREAMIMPL_H__ #define __GIOPSTREAMIMPL_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/giopWorker.h omniorb-dfsg-4.2.2/include/omniORB4/internal/giopWorker.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/giopWorker.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/giopWorker.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,48 +1,31 @@ // -*- Mode: C++; -*- // Package : omniORB -// giopWorker.h Created on: 20 Dec 2000 +// giopWorker.h Created on: 20 Dec 2000 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 2000 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.3 2002/09/10 23:17:11 dgrisby - Thread interceptors. - - Revision 1.1.4.2 2001/07/13 15:21:22 sll - Added access functions. - - Revision 1.1.4.1 2001/04/18 17:18:59 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:03 sll - Added new files. - -*/ - #ifndef __GIOPWORKER_H__ #define __GIOPWORKER_H__ @@ -54,7 +37,6 @@ CORBA::Boolean singleshot=0); void execute(); - void real_execute(); void terminate(); // finish off this task, call by another thread. diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/GNUmakefile.in omniorb-dfsg-4.2.2/include/omniORB4/internal/GNUmakefile.in --- omniorb-dfsg-4.1.6/include/omniORB4/internal/GNUmakefile.in 2006-06-22 13:54:06.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/GNUmakefile.in 2015-06-26 10:32:49.000000000 +0000 @@ -8,7 +8,7 @@ HEADERS = GIOP_C.h GIOP_S.h SocketCollection.h anonObject.h \ codeSetUtil.h context.h corbaBoa.h corbaOrb.h \ - deferredRequest.h dynAnyImpl.h dynamicImplementation.h \ + dynAnyImpl.h dynamicImplementation.h \ dynamicLib.h excepthandler.h exceptiondefs.h giopBiDir.h \ giopMonitor.h giopRendezvouser.h giopRope.h giopServer.h \ giopStrand.h giopStrandFlags.h giopStream.h giopStreamImpl.h \ @@ -17,7 +17,8 @@ objectStub.h objectTable.h omniCurrent.h omniIdentity.h \ orbOptions.h orbParameters.h poacurrentimpl.h poaimpl.h \ poamanager.h pseudo.h remoteIdentity.h request.h rmutex.h \ - shutdownIdentity.h tcParser.h transportRules.h typecode.h + shutdownIdentity.h tcParser.h transportRules.h typecode.h \ + interceptors.h tcpSocket.h unknownValue.h valueTrackerImpl.h include $(TOP)/mk/beforeauto.mk diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/initialiser.h omniorb-dfsg-4.2.2/include/omniORB4/internal/initialiser.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/initialiser.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/initialiser.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,50 +8,22 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.4.2 2001/06/11 17:57:14 sll - External libraries can now hook-up to the orb initialiser list irrespective - of whether the global variables in the external libraries are initialised - before the core library. - - Revision 1.1.4.1 2001/04/18 17:18:16 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.1 2000/07/17 10:35:40 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:03 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.2 2000/06/02 14:17:05 dpg1 - Add static install() method to initialiser so extra initialisers / - deinitialisers can be added at run time (needed by omniORBpy). - - Revision 1.1.2.1 1999/09/24 15:01:32 djr - Added module initialisers, and sll's new scavenger implementation. - -*/ - #ifndef __INITIALISER_H__ #define __INITIALISER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/initRefs.h omniorb-dfsg-4.2.2/include/omniORB4/internal/initRefs.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/initRefs.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/initRefs.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,79 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.4 2001/11/13 14:11:44 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.1.4.3 2001/10/17 16:44:05 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.1.4.2 2001/05/29 17:03:49 dpg1 - In process identity. - - Revision 1.1.4.1 2001/04/18 17:18:16 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.2 2000/09/27 17:38:58 sll - Updated include/omniORB3 to include/omniORB4 - - Revision 1.2.2.1 2000/07/17 10:35:39 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:03 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.2 2000/06/27 15:33:53 sll - Changed #include to match the new location of the stubs. - - Revision 1.1.2.1 2000/04/27 10:39:18 dpg1 - Interoperable Naming Service - - Moved from bootstrap_i.h, and extended. - - Revision 1.4.6.2 1999/09/27 08:48:31 djr - Minor corrections to get rid of warnings. - - Revision 1.4.6.1 1999/09/22 14:26:24 djr - Major rewrite of orbcore to support POA. - - Revision 1.4 1999/05/25 18:10:46 sll - Now CORBA::ORB::ObjectIdList and CORBA_InitialReference::ObjIdList - are different types. - - Revision 1.3 1999/03/11 16:25:51 djr - Updated copyright notice - - Revision 1.2 1998/08/25 18:52:09 sll - Added dummy marshalling functions in serviceRecord to make gcc-2.7.2 happy. - - Revision 1.1 1998/08/21 19:28:15 sll - Initial revision - -*/ - - #ifndef __INITREFS_H__ #define __INITREFS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/inProcessIdentity.h omniorb-dfsg-4.2.2/include/omniORB4/internal/inProcessIdentity.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/inProcessIdentity.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/inProcessIdentity.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,19 +9,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -31,38 +29,6 @@ // yet, because they are using DSI, or because they are in a // different language to the caller. -/* - $Log$ - Revision 1.1.4.2 2007/04/14 17:56:53 dgrisby - Identity downcasting mechanism was broken by VC++ 8's - over-enthusiastic optimiser. - - Revision 1.1.4.1 2003/03/23 21:03:46 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.7 2002/11/29 14:03:41 dgrisby - Rearrange declarations to make Code Warrior happy. - - Revision 1.1.2.6 2001/11/27 14:36:17 dpg1 - Local _is_equivalent fix. - - Revision 1.1.2.5 2001/09/19 17:26:46 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.2.4 2001/09/03 16:52:04 sll - New signature for locateRequest. Now accept a calldescriptor argument. - - Revision 1.1.2.3 2001/08/22 13:31:31 dpg1 - Christof's fixes for gcc 3.0.1. - - Revision 1.1.2.2 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.2.1 2001/05/29 17:03:49 dpg1 - In process identity. - -*/ - #ifndef __OMNIORB_INPROCESSIDENTITY_H__ #define __OMNIORB_INPROCESSIDENTITY_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/interceptors.h omniorb-dfsg-4.2.2/include/omniORB4/internal/interceptors.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/interceptors.h 2011-06-01 23:11:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/interceptors.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,51 +3,29 @@ // interceptors.h Created on: 2002/03/21 // Author : Duncan Grisby (dpg1) // -// Copyright (C) 2006-2011 Apasphere Ltd +// Copyright (C) 2006-2013 Apasphere Ltd // Copyright (C) 2002 AT&T Laboratories, Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.2 2006/07/18 16:21:23 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.4.1 2003/03/23 21:03:46 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2002/11/26 14:51:49 dgrisby - Implement missing interceptors. - - Revision 1.1.2.2 2002/09/10 23:17:11 dgrisby - Thread interceptors. - - Revision 1.1.2.1 2002/03/27 11:44:51 dpg1 - Check in interceptors things left over from last week. - -*/ - #ifndef __INTERCEPTORS_H__ #define __INTERCEPTORS_H__ @@ -80,11 +58,13 @@ static _core_attr elmT* serverReceiveRequest; static _core_attr elmT* serverSendReply; static _core_attr elmT* serverSendException; + static _core_attr elmT* createRope; static _core_attr elmT* createIdentity; static _core_attr elmT* createORBServer; static _core_attr elmT* createPolicy; static _core_attr elmT* createThread; static _core_attr elmT* assignUpcallThread; + static _core_attr elmT* assignAMIThread; #define VISIT_FUNCTION(name) \ static inline void visit(omniInterceptors::name##_T::info_T& info) { \ @@ -103,6 +83,7 @@ VISIT_FUNCTION(serverReceiveRequest) VISIT_FUNCTION(serverSendReply) VISIT_FUNCTION(serverSendException) + VISIT_FUNCTION(createRope) VISIT_FUNCTION(createIdentity) VISIT_FUNCTION(createORBServer) VISIT_FUNCTION(createPolicy) diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/invoker.h omniorb-dfsg-4.2.2/include/omniORB4/internal/invoker.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/invoker.h 2005-01-06 23:11:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/invoker.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,49 +3,29 @@ // invoker.h Created on: 20 Dec 2000 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 2000 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.1 2003/03/23 21:03:45 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.3 2002/01/09 11:35:22 dpg1 - Remove separate omniAsyncInvoker library to save library overhead. - - Revision 1.1.4.2 2001/08/01 10:08:20 dpg1 - Main thread policy. - - Revision 1.1.4.1 2001/04/18 17:18:59 sll - Big checkin with the brand new internal APIs. - - Revision 1.1.2.1 2001/02/23 16:47:02 sll - Added new files. - -*/ - #ifndef __INVOKER_H__ #define __INVOKER_H__ @@ -61,22 +41,7 @@ OMNI_NAMESPACE_BEGIN(omni) - class ORBAsyncInvoker : public omniAsyncInvoker { - public: - ORBAsyncInvoker(unsigned int max=10000) - : omniAsyncInvoker(max) {} - - virtual ~ORBAsyncInvoker(); - - int work_pending(); - void perform(unsigned long secs = 0, unsigned long nanosecs = 0); - - protected: - int insert_dedicated(omniTask*); - int cancel_dedicated(omniTask*); - }; - - extern _core_attr ORBAsyncInvoker* orbAsyncInvoker; + extern _core_attr omniAsyncInvoker* orbAsyncInvoker; OMNI_NAMESPACE_END(omni) diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/libcWrapper.h omniorb-dfsg-4.2.2/include/omniORB4/internal/libcWrapper.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/libcWrapper.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/libcWrapper.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,97 +3,29 @@ // LibcWrapper.h Created on: 19/3/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2006 Apasphere Ltd +// Copyright (C) 2003-2010 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// Wrapper for libc functions which are non-reentrant +// Wrapper for libc functions which are non-reentrant / non-portable // -/* - $Log$ - Revision 1.1.6.6 2006/04/21 14:38:35 dgrisby - Typo in comment. - - Revision 1.1.6.5 2006/04/09 19:52:31 dgrisby - More IPv6, endPointPublish parameter. - - Revision 1.1.6.4 2006/03/25 18:54:03 dgrisby - Initial IPv6 support. - - Revision 1.1.6.3 2006/02/22 14:56:37 dgrisby - New endPointPublishHostname and endPointResolveNames parameters. - - Revision 1.1.6.2 2005/01/06 23:08:25 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:45 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.8 2003/01/06 11:11:55 dgrisby - New AddrInfo instead of gethostbyname. - - Revision 1.1.4.7 2002/11/06 11:31:21 dgrisby - Old ETS patches that got lost; updates patches README. - - Revision 1.1.4.6 2002/09/08 22:12:22 dgrisby - Last checkin broke it. - - Revision 1.1.4.5 2002/02/25 11:17:12 dpg1 - Use tracedmutexes everywhere. - - Revision 1.1.4.4 2002/02/11 17:09:48 dpg1 - Fix Windows brokenness caused by autoconf stuff. - - Revision 1.1.4.3 2001/08/24 16:43:25 sll - Switch to use Winsock 2. Removed reference to winsock.h. Let the pre-processor - define _WIN32_WINNT=0x0400 to select the right header. - - Revision 1.1.4.2 2001/06/13 20:11:37 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.1 2001/04/18 17:18:16 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.7.2.1 2000/07/17 10:35:54 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.8 2000/07/13 15:25:57 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.6.8.1 1999/09/22 14:26:52 djr - Major rewrite of orbcore to support POA. - - Revision 1.6 1999/03/11 16:25:54 djr - Updated copyright notice - - Revision 1.5 1997/12/09 18:25:28 sll - Use __WIN32__ instead of __NT__ - - * Revision 1.4 1997/05/06 15:23:10 sll - * Public release. - * - */ - #ifndef __LIBCWRAPPER_H__ #define __LIBCWRAPPER_H__ @@ -110,6 +42,12 @@ public: class AddrInfo; + static unsigned int Rand(); + // Thread-safe pseudo-random number + + static void SRand(unsigned int seed); + // Set seed for Rand(). + static CORBA::Boolean isip4addr(const char* node); // True if node is an IPv4 address. diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/localIdentity.h omniorb-dfsg-4.2.2/include/omniORB4/internal/localIdentity.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/localIdentity.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/localIdentity.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,87 +3,29 @@ // localIdentity.h Created on: 16/6/99 // Author : David Riddoch (djr) // -// Copyright (C) 2003-2007 Apasphere Ltd +// Copyright (C) 2003-2010 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Encapsulation of the identity of a local object implementation. // -/* - $Log$ - Revision 1.1.6.2 2007/04/14 17:56:53 dgrisby - Identity downcasting mechanism was broken by VC++ 8's - over-enthusiastic optimiser. - - Revision 1.1.6.1 2003/03/23 21:03:45 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.9 2002/11/29 14:03:41 dgrisby - Rearrange declarations to make Code Warrior happy. - - Revision 1.1.4.8 2001/11/27 14:36:17 dpg1 - Local _is_equivalent fix. - - Revision 1.1.4.7 2001/11/08 16:33:50 dpg1 - Local servant POA shortcut policy. - - Revision 1.1.4.6 2001/09/03 16:52:05 sll - New signature for locateRequest. Now accept a calldescriptor argument. - - Revision 1.1.4.5 2001/08/22 13:31:31 dpg1 - Christof's fixes for gcc 3.0.1. - - Revision 1.1.4.4 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.3 2001/06/13 20:11:37 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.2 2001/05/29 17:03:49 dpg1 - In process identity. - - Revision 1.1.4.1 2001/04/18 17:18:16 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.1 2000/07/17 10:35:55 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:57 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.3 2000/06/02 16:09:59 dpg1 - If an object is deactivated while its POA is in the HOLDING state, - clients which were held now receive a TRANSIENT exception when the POA - becomes active again. - - Revision 1.1.2.2 1999/10/27 17:32:12 djr - omni::internalLock and objref_rc_lock are now pointers. - - Revision 1.1.2.1 1999/09/22 14:26:53 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __OMNIORB_LOCALIDENTITY_H__ #define __OMNIORB_LOCALIDENTITY_H__ @@ -141,7 +83,6 @@ virtual void dispatch(omniCallDescriptor&); virtual void gainRef(omniObjRef* obj = 0); virtual void loseRef(omniObjRef* obj = 0); - virtual void locateRequest(omniCallDescriptor&); protected: virtual omniIdentity::equivalent_fn get_real_is_equivalent() const; // Override omniIdentity. diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/objectAdapter.h omniorb-dfsg-4.2.2/include/omniORB4/internal/objectAdapter.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/objectAdapter.h 2010-05-07 22:48:29.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/objectAdapter.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,98 +3,28 @@ // objectAdapter.h Created on: 5/3/99 // Author : David Riddoch (djr) // -// Copyright (C) 2002-2006 Apasphere Ltd +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 1996,1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.6.7 2006/07/18 16:21:23 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.6.6 2006/04/10 12:50:35 dgrisby - More endPointPublish; support for deprecated endPointNoListen, - endPointPublishAllIFs. - - Revision 1.1.6.5 2006/04/09 19:52:31 dgrisby - More IPv6, endPointPublish parameter. - - Revision 1.1.6.4 2006/03/26 20:59:28 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.6.3 2006/02/22 14:56:37 dgrisby - New endPointPublishHostname and endPointResolveNames parameters. - - Revision 1.1.6.2 2005/11/17 17:03:26 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:45 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.7 2002/08/21 19:55:42 dgrisby - Add endPointPublishAllIFs option. - - Revision 1.1.4.6 2001/09/20 09:27:43 dpg1 - Remove assertion failure on exit if not all POAs are deleted. - - Revision 1.1.4.5 2001/08/17 17:10:28 sll - Removed option noBootStrapAgent. - - Revision 1.1.4.4 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.3 2001/07/31 16:34:53 sll - New function listMyEndpoints(). Remove explicit instantiation of - giopServer, do it via interceptor. - - Revision 1.1.4.2 2001/05/29 17:03:49 dpg1 - In process identity. - - Revision 1.1.4.1 2001/04/18 17:18:16 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.2 2000/11/09 12:27:57 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.2.2.1 2000/07/17 10:35:55 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:56 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.3 1999/10/27 17:32:13 djr - omni::internalLock and objref_rc_lock are now pointers. - - Revision 1.1.2.2 1999/09/28 10:54:34 djr - Removed pretty-printing of object keys from object adapters. - - Revision 1.1.2.1 1999/09/22 14:26:56 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __OMNI_OBJECTADAPTER_H__ #define __OMNI_OBJECTADAPTER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/objectStub.h omniorb-dfsg-4.2.2/include/omniORB4/internal/objectStub.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/objectStub.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/objectStub.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,35 +8,22 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.4.1 2001/04/18 17:18:15 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.1.2.1 2000/09/27 17:30:30 sll - *** empty log message *** - -*/ - OMNI_NAMESPACE_BEGIN(omni) ////////////////////////////////////////////////////////////////////// @@ -50,7 +37,7 @@ {} inline ~omni_is_a_CallDesc() { - if (is_upcall()) { _CORBA_String_helper::free(a_1); } + if (is_upcall()) { _CORBA_String_helper::dealloc(a_1); } } void marshalArguments(cdrStream&); diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/objectTable.h omniorb-dfsg-4.2.2/include/omniORB4/internal/objectTable.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/objectTable.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/objectTable.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,48 +9,23 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Definitions for object table entries // -/* - $Log$ - Revision 1.1.4.3 2007/04/14 17:56:52 dgrisby - Identity downcasting mechanism was broken by VC++ 8's - over-enthusiastic optimiser. - - Revision 1.1.4.2 2005/01/06 23:08:25 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:03:44 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2003/01/16 11:08:26 dgrisby - Patches to support Digital Mars C++. Thanks Christof Meerwald. - - Revision 1.1.2.2 2001/08/22 13:31:31 dpg1 - Christof's fixes for gcc 3.0.1. - - Revision 1.1.2.1 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - -*/ - #ifndef __OMNIORB_OBJECTTABLE_H__ #define __OMNIORB_OBJECTTABLE_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/omniCurrent.h omniorb-dfsg-4.2.2/include/omniORB4/internal/omniCurrent.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/omniCurrent.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/omniCurrent.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,54 +3,29 @@ // omniCurrent.h Created on: 2001/06/01 // Author : Duncan Grisby (dpg1) // -// Copyright (C) 2002-2006 Apasphere Ltd +// Copyright (C) 2002-2011 Apasphere Ltd // Copyright (C) 2001 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Generic support for the kinds of Current interface. // -/* - $Log$ - Revision 1.1.4.3 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.1.4.2 2005/01/06 23:08:25 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:03:44 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2002/10/14 20:06:41 dgrisby - Per objref / per thread timeouts. - - Revision 1.1.2.2 2001/08/17 17:12:34 sll - Modularise ORB configuration parameters. - - Revision 1.1.2.1 2001/06/07 16:24:08 dpg1 - PortableServer::Current support. - -*/ - #ifndef __OMNICURRENT_H__ #define __OMNICURRENT_H__ @@ -103,10 +78,9 @@ } // Accessors - inline omniCallDescriptor* callDescriptor() { return pd_callDescriptor; } - inline unsigned long timeout_secs() { return pd_timeout_secs; } - inline unsigned long timeout_nanosecs() { return pd_timeout_nanosecs; } - inline CORBA::Boolean timeout_absolute() { return pd_timeout_absolute; } + inline omniCallDescriptor* callDescriptor() { return pd_callDescriptor; } + inline const omni_time_t& timeout() { return pd_timeout; } + inline CORBA::Boolean timeout_absolute() { return pd_timeout_absolute; } // Stack manipulation inline void setCallDescriptor(omniCallDescriptor* desc) @@ -115,14 +89,25 @@ } // Timeout setting - inline void setTimeout(unsigned long secs, unsigned long ns) { - pd_timeout_secs = secs; - pd_timeout_nanosecs = ns; + inline void setTimeout(unsigned long secs, unsigned long ns) + { + pd_timeout.assign(secs, ns); pd_timeout_absolute = 0; } - inline void setDeadline(unsigned long secs, unsigned long ns) { - pd_timeout_secs = secs; - pd_timeout_nanosecs = ns; + inline void setTimeout(const omni_time_t& t) + { + pd_timeout = t; + pd_timeout_absolute = 0; + } + + inline void setDeadline(unsigned long secs, unsigned long ns) + { + pd_timeout.assign(secs, ns); + pd_timeout_absolute = 1; + } + inline void setDeadline(const omni_time_t& t) + { + pd_timeout = t; pd_timeout_absolute = 1; } @@ -132,8 +117,7 @@ omniCallDescriptor* pd_callDescriptor; // Stack of call descriptors - unsigned long pd_timeout_secs; - unsigned long pd_timeout_nanosecs; + omni_time_t pd_timeout; // Per-thread timeout CORBA::Boolean pd_timeout_absolute; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/omniIdentity.h omniorb-dfsg-4.2.2/include/omniORB4/internal/omniIdentity.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/omniIdentity.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/omniIdentity.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,19 +9,17 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,51 +27,6 @@ // may be local or remote). // -/* - $Log$ - Revision 1.1.6.3 2007/04/14 17:56:52 dgrisby - Identity downcasting mechanism was broken by VC++ 8's - over-enthusiastic optimiser. - - Revision 1.1.6.2 2006/09/17 23:21:49 dgrisby - Properly import identity_count for Windows DLL hell. - - Revision 1.1.6.1 2003/03/23 21:03:44 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.5 2001/09/19 17:26:46 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.4.4 2001/09/03 16:52:05 sll - New signature for locateRequest. Now accept a calldescriptor argument. - - Revision 1.1.4.3 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.2 2001/06/13 20:11:37 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.1 2001/04/18 17:18:15 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.3 2000/11/03 19:08:52 sll - Use virtual dtor with gcc. - - Revision 1.2.2.2 2000/09/27 17:39:28 sll - Updated include/omniORB3 to include/omniORB4 - - Revision 1.2.2.1 2000/07/17 10:35:40 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:03 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/22 14:26:26 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __OMNIIDENTITY_H__ #define __OMNIIDENTITY_H__ @@ -116,13 +69,6 @@ // default zero objref. // Must hold . - virtual void locateRequest(omniCallDescriptor&) = 0; - // If this returns normally, then the object exists. - // Throws OBJECT_NOT_EXIST, or omniORB::LOCATION_FORWARD - // otherwise. - // Caller must hold . On return or raised - // exception, the lock is released. - inline _CORBA_Boolean is_equivalent(const omniIdentity* id) { // Returns TRUE(1) if the two identity objects refer to the same CORBA // Object. This function does not raise any exceptions. @@ -143,6 +89,11 @@ // space. + virtual void disconnect(); + // Disconnect any associated network connections. + // Caller must hold . On return the lock is released. + + static void waitForLastIdentity(); // Block until all traced omniIdentity objects have been deleted. // Must not hold diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/orbOptions.h omniorb-dfsg-4.2.2/include/omniORB4/internal/orbOptions.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/orbOptions.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/orbOptions.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,77 +3,34 @@ // orbOptions.h Created on: 13/8/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2007 Apasphere Ltd +// Copyright (C) 2003-2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.5 2007/02/26 15:16:31 dgrisby - New socketSendBuffer parameter, defaulting to 16384 on Windows. - Avoids a bug in Windows where select() on send waits for all sent data - to be acknowledged. - - Revision 1.1.4.4 2005/09/19 18:26:33 dgrisby - Merge from omni4_0_develop again. - - Revision 1.1.4.3 2005/09/08 14:49:40 dgrisby - Merge -ORBconfigFile argument. - - Revision 1.1.4.2 2005/01/06 23:08:26 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:03:44 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.6 2002/03/18 15:13:07 dpg1 - Fix bug with old-style ORBInitRef in config file; look for - -ORBtraceLevel arg before anything else; update Windows registry - key. Correct error message. - - Revision 1.1.2.5 2002/02/11 15:15:50 dpg1 - Things for ETS kernel. - - Revision 1.1.2.4 2001/08/21 11:02:12 sll - orbOptions handlers are now told where an option comes from. This - is necessary to process DefaultInitRef and InitRef correctly. - - Revision 1.1.2.3 2001/08/20 10:46:48 sll - New orb configuration parsing now works with NT registry. - - Revision 1.1.2.2 2001/08/20 08:19:22 sll - Read the new ORB configuration file format. Can still read old format. - Can also set configuration parameters from environment variables. - - Revision 1.1.2.1 2001/08/17 17:12:34 sll - Modularise ORB configuration parameters. - -*/ - #ifndef __ORBOPTIONS_H__ #define __ORBOPTIONS_H__ +#include + OMNI_NAMESPACE_BEGIN(omni) class orbOptions; @@ -82,7 +39,8 @@ public: //////////////////////////////////////////////////////////////////////// - class sequenceString; + typedef CORBA::StringSeq sequenceString; + typedef CORBA::StringSeq_var sequenceString_var; //////////////////////////////////////////////////////////////////////// class BadParam { @@ -325,85 +283,6 @@ static const char* expect_ulong_msg; static const char* expect_greater_than_zero_ulong_msg; - //////////////////////////////////////////////////////////////////////// - class sequenceString_var; - - class sequenceString : public _CORBA_Unbounded_Sequence_String { - public: - typedef sequenceString_var _var_type; - inline sequenceString() {} - inline sequenceString(const sequenceString& s) - : _CORBA_Unbounded_Sequence_String(s) {} - - inline sequenceString(_CORBA_ULong _max) - : _CORBA_Unbounded_Sequence_String(_max) {} - inline sequenceString(_CORBA_ULong _max, _CORBA_ULong _len, char** _val, _CORBA_Boolean _rel=0) - : _CORBA_Unbounded_Sequence_String(_max, _len, _val, _rel) {} - - - - inline sequenceString& operator = (const sequenceString& s) { - _CORBA_Unbounded_Sequence_String::operator=(s); - return *this; - } - }; - - //////////////////////////////////////////////////////////////////////// - class sequenceString_var { - public: - typedef sequenceString T; - typedef sequenceString_var T_var; - - inline sequenceString_var() : _pd_seq(0) {} - inline sequenceString_var(T* s) : _pd_seq(s) {} - inline sequenceString_var(const T_var& s) { - if( s._pd_seq ) _pd_seq = new T(*s._pd_seq); - else _pd_seq = 0; - } - inline ~sequenceString_var() { if( _pd_seq ) delete _pd_seq; } - - inline T_var& operator = (T* s) { - if( _pd_seq ) delete _pd_seq; - _pd_seq = s; - return *this; - } - inline T_var& operator = (const T_var& s) { - if( s._pd_seq ) { - if( !_pd_seq ) _pd_seq = new T; - *_pd_seq = *s._pd_seq; - } else if( _pd_seq ) { - delete _pd_seq; - _pd_seq = 0; - } - return *this; - } - - inline _CORBA_String_element operator [] (_CORBA_ULong s) { - return (*_pd_seq)[s]; - } - - inline T* operator -> () { return _pd_seq; } -#if defined(__GNUG__) - inline operator T& () const { return *_pd_seq; } -#else - inline operator const T& () const { return *_pd_seq; } - inline operator T& () { return *_pd_seq; } -#endif - - inline const T& in() const { return *_pd_seq; } - inline T& inout() { return *_pd_seq; } - inline T*& out() { - if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } - return _pd_seq; - } - inline T* _retn() { T* tmp = _pd_seq; _pd_seq = 0; return tmp; } - - private: - T* _pd_seq; - }; - - - #ifdef __GNUG__ friend class _keep_gcc_quiet_; #endif diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/orbParameters.h omniorb-dfsg-4.2.2/include/omniORB4/internal/orbParameters.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/orbParameters.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/orbParameters.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,80 +3,29 @@ // orbParameters.h Created on: 15/8/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2008 Apasphere Ltd +// Copyright (C) 2002-2011 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.10 2008/02/14 12:37:50 dgrisby - New immediateAddressSwitch parameter. - - Revision 1.1.4.9 2007/07/31 16:38:31 dgrisby - New resetTimeOutOnRetries parameter. - - Revision 1.1.4.8 2007/02/26 15:16:31 dgrisby - New socketSendBuffer parameter, defaulting to 16384 on Windows. - Avoids a bug in Windows where select() on send waits for all sent data - to be acknowledged. - - Revision 1.1.4.7 2006/01/10 13:59:37 dgrisby - New clientConnectTimeOutPeriod configuration parameter. - - Revision 1.1.4.6 2005/11/17 17:03:26 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.5 2005/09/01 14:52:12 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.4 2005/03/02 12:39:23 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.3 2005/01/06 23:08:26 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.2 2003/11/06 11:56:55 dgrisby - Yet more valuetype. Plain valuetype and abstract valuetype are now working. - - Revision 1.1.4.1 2003/03/23 21:03:43 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.4 2002/10/14 20:06:41 dgrisby - Per objref / per thread timeouts. - - Revision 1.1.2.3 2002/03/18 16:50:17 dpg1 - New threadPoolWatchConnection parameter. - - Revision 1.1.2.2 2001/08/21 11:02:12 sll - orbOptions handlers are now told where an option comes from. This - is necessary to process DefaultInitRef and InitRef correctly. - - Revision 1.1.2.1 2001/08/17 17:12:34 sll - Modularise ORB configuration parameters. - -*/ - #ifndef __ORBPARAMETERS_H__ #define __ORBPARAMETERS_H__ @@ -96,11 +45,6 @@ _CORBA_MODULE_BEG -struct timeValue { - unsigned long secs; - unsigned long nanosecs; -}; - /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// @@ -163,6 +107,15 @@ // set the preferred code set for wchar data inside anys // +_CORBA_MODULE_VAR _core_attr omniCodeSet::TCS_C* defaultCharCodeSet; +// set the code set for char data sent to servers that have not specified one +// + +_CORBA_MODULE_VAR _core_attr omniCodeSet::TCS_W* defaultWCharCodeSet; +// set the code set for wchar data sent to servers that have not specified one +// + + _CORBA_MODULE_VAR _core_attr CORBA::Boolean lcdMode; // Set to 1 to enable 'Lowest Common Denominator' Mode. // This will disable various features of IIOP and GIOP which are @@ -280,6 +233,13 @@ // // Valid values = 0 or 1 +_CORBA_MODULE_VAR _core_attr CORBA::Boolean throwTransientOnTimeOut; +// If true, CORBA::TRANSIENT is thrown when a timeout occurs. If +// false (the default), CORBA::TIMEOUT is thrown. +// +// Valid values = 0 or 1 + + /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// @@ -351,7 +311,7 @@ // Valid values = (n >= 0 in seconds) // 0 --> do not close idle connections. -_CORBA_MODULE_VAR _core_attr timeValue clientCallTimeOutPeriod; +_CORBA_MODULE_VAR _core_attr omni_time_t clientCallTimeOutPeriod; // Call timeout. On the client side, if a remote call takes longer // than the timeout value, the ORB will shutdown the connection and // raise a COMM_FAILURE. @@ -359,7 +319,7 @@ // Valid values = (n >= 0 in milliseconds) // 0 --> no timeout. Block till a reply comes back -_CORBA_MODULE_VAR _core_attr timeValue clientConnectTimeOutPeriod; +_CORBA_MODULE_VAR _core_attr omni_time_t clientConnectTimeOutPeriod; // Connect timeout. When a client has no existing connection to // communicate with a server, it must open a new connection before // performing the call. If this parameter is non-zero, it sets a @@ -450,7 +410,13 @@ _CORBA_MODULE_VAR _core_attr CORBA::ULong maxServerThreadPoolSize; // The max. no. of threads the server will allocate to do various // ORB tasks. This number does not include the dedicated thread -// per connection when the threadPerConnectionPolicy is in effect +// per connection when the threadPerConnectionPolicy is in effect. +// +// Valid values = (n >= 1) + +_CORBA_MODULE_VAR _core_attr CORBA::ULong maxClientThreadPoolSize; +// The max. no. of threads a client will allocate to do asynchronous +// calls. // // Valid values = (n >= 1) @@ -494,7 +460,7 @@ // 0 --> do not close idle connections. -_CORBA_MODULE_VAR _core_attr timeValue serverCallTimeOutPeriod; +_CORBA_MODULE_VAR _core_attr omni_time_t serverCallTimeOutPeriod; // Call timeout. On the server side, if the ORB cannot completely // unmarshal a call's arguments in the defined timeout, it shutdown the // connection. @@ -539,6 +505,9 @@ // handled; otherwise, they are not watched until the // SocketCollection next scans the connection list. +_CORBA_MODULE_VAR _core_attr CORBA::ULong listenBacklog; +// Allows setting of listen backlog size. The default value is SOMAXCONN. + _CORBA_MODULE_END OMNI_NAMESPACE_END(omni) diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/poacurrentimpl.h omniorb-dfsg-4.2.2/include/omniORB4/internal/poacurrentimpl.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/poacurrentimpl.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/poacurrentimpl.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,48 +9,23 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Internal implementation of PortableServer::Current // -/* - $Log$ - Revision 1.1.4.2 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.1.4.1 2003/03/23 21:03:43 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.4 2001/08/17 17:12:34 sll - Modularise ORB configuration parameters. - - Revision 1.1.2.3 2001/08/01 10:08:20 dpg1 - Main thread policy. - - Revision 1.1.2.2 2001/06/11 11:38:17 dpg1 - Failed to initialise refcount in Current object. - - Revision 1.1.2.1 2001/06/07 16:24:09 dpg1 - PortableServer::Current support. - -*/ - #include #include #include @@ -115,8 +90,10 @@ pd_old_cd = pd_current->callDescriptor(); pd_current->setCallDescriptor(desc); } - else + else { pd_current = 0; + pd_old_cd = 0; + } } inline ~poaCurrentStackInsert() { diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/poaimpl.h omniorb-dfsg-4.2.2/include/omniORB4/internal/poaimpl.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/poaimpl.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/poaimpl.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,115 +9,23 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Internal implementation of the POA. // -/* - $Log$ - Revision 1.1.6.4 2007/03/23 14:36:46 dgrisby - Use one etherealisation queue per POA, rather than one global one. - Thanks Teemu Torma. - - Revision 1.1.6.3 2006/07/18 16:21:23 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.6.2 2005/07/22 17:18:39 dgrisby - Another merge from omni4_0_develop. - - Revision 1.1.6.1 2003/03/23 21:03:43 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.12 2002/11/08 17:26:25 dgrisby - Hang on shutdown with servant locators. - - Revision 1.1.4.11 2002/10/14 15:14:54 dgrisby - Fix create_POA / destroy deadlock, unique persistent system ids. - - Revision 1.1.4.10 2001/11/13 14:11:44 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.1.4.9 2001/11/08 16:33:50 dpg1 - Local servant POA shortcut policy. - - Revision 1.1.4.8 2001/08/17 15:00:48 dpg1 - Fixes for pre-historic compilers. - - Revision 1.1.4.7 2001/08/15 10:26:09 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.6 2001/08/01 10:08:21 dpg1 - Main thread policy. - - Revision 1.1.4.5 2001/07/31 16:10:38 sll - Added GIOP BiDir support. - - Revision 1.1.4.4 2001/06/29 16:24:47 dpg1 - Support re-entrancy in single thread policy POAs. - - Revision 1.1.4.3 2001/06/07 16:24:09 dpg1 - PortableServer::Current support. - - Revision 1.1.4.2 2001/05/29 17:03:49 dpg1 - In process identity. - - Revision 1.1.4.1 2001/04/18 17:18:15 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.1 2000/07/17 10:35:57 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:56 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.8 2000/06/02 16:09:59 dpg1 - If an object is deactivated while its POA is in the HOLDING state, - clients which were held now receive a TRANSIENT exception when the POA - becomes active again. - - Revision 1.1.2.7 2000/04/27 10:51:44 dpg1 - Interoperable Naming Service - - Add magic INS POA. - - Revision 1.1.2.6 2000/02/09 12:04:53 djr - Fixed memory allocation bug in Any insertion/extraction of strings. - Optimisation for insertion/extraction of sequence of simple types. - - Revision 1.1.2.5 1999/10/04 17:08:33 djr - Some more fixes/MSVC work-arounds. - - Revision 1.1.2.4 1999/09/30 11:52:32 djr - Implemented use of AdapterActivators in POAs. - - Revision 1.1.2.3 1999/09/28 10:54:35 djr - Removed pretty-printing of object keys from object adapters. - - Revision 1.1.2.2 1999/09/24 10:28:52 djr - Added POA_Helper and POA::the_children(). - - Revision 1.1.2.1 1999/09/22 14:27:01 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __POAIMPL_H__ #define __POAIMPL_H__ @@ -139,7 +47,7 @@ OMNI_NAMESPACE_BEGIN(omni) -#define PS_VERSION ":2.4" +#define PS_VERSION ":1.0" class omniOrbPOAManager; class omniServantActivatorTaskQueue; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/poamanager.h omniorb-dfsg-4.2.2/include/omniORB4/internal/poamanager.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/poamanager.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/poamanager.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,58 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Internal implementation of the PortableServer::POAManager. // -/* - $Log$ - Revision 1.1.4.2 2001/11/13 14:11:44 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.1.4.1 2001/04/18 17:18:15 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.2 2000/09/27 17:41:41 sll - Updated include/omniORB3 to include/omniORB4 - - Revision 1.2.2.1 2000/07/17 10:35:57 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:25:56 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.4 2000/01/27 10:55:47 djr - Mods needed for powerpc_aix. New macro OMNIORB_BASE_CTOR to provide - fqname for base class constructor for some compilers. - - Revision 1.1.2.3 1999/10/04 17:08:34 djr - Some more fixes/MSVC work-arounds. - - Revision 1.1.2.2 1999/09/30 11:52:33 djr - Implemented use of AdapterActivators in POAs. - - Revision 1.1.2.1 1999/09/22 14:27:02 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __POAMANAGER_H__ #define __POAMANAGER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/pseudo.h omniorb-dfsg-4.2.2/include/omniORB4/internal/pseudo.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/pseudo.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/pseudo.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,24 +3,23 @@ // pseudo.h Created on: 9/1998 // Author : David Riddoch (djr) // +// Copyright (C) 2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -44,14 +43,14 @@ PseudoObjBase() : pd_refCount(1) {} virtual ~PseudoObjBase(); - void incrRefCount() { pd_refCount++; } + inline void incrRefCount() { pd_refCount.inc(); } void decrRefCount(); private: PseudoObjBase(const PseudoObjBase&); // not implemented PseudoObjBase& operator=(const PseudoObjBase&); // not implemented - unsigned pd_refCount; + omni_refcount pd_refCount; }; ////////////////////////////////////////////////////////////////////// diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/remoteIdentity.h omniorb-dfsg-4.2.2/include/omniORB4/internal/remoteIdentity.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/remoteIdentity.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/remoteIdentity.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,70 +9,23 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Encapsulation of the identity of a remote object implementation. // -/* - $Log$ - Revision 1.1.6.2 2007/04/14 17:56:52 dgrisby - Identity downcasting mechanism was broken by VC++ 8's - over-enthusiastic optimiser. - - Revision 1.1.6.1 2003/03/23 21:03:42 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.6 2002/11/29 14:03:41 dgrisby - Rearrange declarations to make Code Warrior happy. - - Revision 1.1.4.5 2001/09/19 17:26:47 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.4.4 2001/09/03 16:52:05 sll - New signature for locateRequest. Now accept a calldescriptor argument. - - Revision 1.1.4.3 2001/08/22 13:31:31 dpg1 - Christof's fixes for gcc 3.0.1. - - Revision 1.1.4.2 2001/08/15 10:26:10 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.4.1 2001/04/18 17:18:14 sll - Big checkin with the brand new internal APIs. - These files were relocated and scoped with the omni namespace. - - Revision 1.2.2.3 2000/10/03 17:41:45 sll - Make sure object key is copied in ctor. - - Revision 1.2.2.2 2000/09/27 17:46:29 sll - New data member pd_ior and the new ctor signature to match. - - Revision 1.2.2.1 2000/07/17 10:35:40 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:03 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/22 14:26:26 djr - Major rewrite of orbcore to support POA. - -*/ - #ifndef __OMNIORB_REMOTEIDENTITY_H__ #define __OMNIORB_REMOTEIDENTITY_H__ @@ -131,6 +84,9 @@ virtual _CORBA_Boolean inThisAddressSpace(); // Override omniIdentity. + void disconnect(); + // Override omniIdentity. + virtual void* ptrToClass(int* cptr); static inline omniRemoteIdentity* downcast(omniIdentity* i) { diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/request.h omniorb-dfsg-4.2.2/include/omniORB4/internal/request.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/request.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/request.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,26 +1,25 @@ // -*- Mode: C++; -*- -// Package : omniORB2 +// Package : omniORB // request.h Created on: 9/1998 // Author : David Riddoch (djr) // +// Copyright (C) 2003-2013 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,27 +28,100 @@ #ifndef __REQUEST_H__ #define __REQUEST_H__ -#ifndef __PSEUDO_H__ +#include #include -#endif + OMNI_NAMESPACE_BEGIN(omni) -class DeferredRequest; +class RequestImpl; + +class DIICallDescriptor : public omniAsyncCallDescriptor { +public: + DIICallDescriptor(RequestImpl* req, + const char* op, + CORBA::NVList_ptr arguments, + CORBA::NamedValue_ptr result, + CORBA::ExceptionList_ptr exceptions, + CORBA::ContextList_ptr contexts, + CORBA::Context_ptr context); + + void marshalArguments(cdrStream& stream); + void unmarshalReturnedValues(cdrStream& stream); + void userException(cdrStream& stream, IOP_C* iop_client, const char* repoid); + void completeCallback(); + + inline CORBA::NVList_ptr arguments() const { return pd_arguments; } + inline CORBA::NamedValue_ptr result() const { return pd_result; } + inline CORBA::Environment_ptr environment() const { return pd_environment; } + inline CORBA::Context_ptr context() const { return pd_context; } + + inline CORBA::ExceptionList_ptr exceptions() + { + if (CORBA::is_nil(pd_exceptions)) pd_exceptions = new ExceptionListImpl; + return pd_exceptions; + } + + inline CORBA::ContextList_ptr contexts() + { + if (CORBA::is_nil(pd_contexts)) pd_contexts = new ContextListImpl; + return pd_contexts; + } + + inline void context(CORBA::Context_ptr ctx) + { + pd_context = CORBA::Context::_duplicate(ctx); + } + + inline _CORBA_Boolean isCalledBack() + { + omni_tracedmutex_lock l(sd_lock); + return !pd_do_callback; + } + + inline void waitForCallback() + { + omni_tracedmutex_lock l(sd_lock); + + if (!pd_do_callback) + return; + + if (!pd_cond) + pd_cond = new omni_tracedcondition(&sd_lock, + "DIICallDescriptor::pd_cond"); + + while (pd_do_callback) + pd_cond->wait(); + } + +private: + RequestImpl* pd_req; + CORBA::NVList_var pd_arguments; + CORBA::NamedValue_var pd_result; + CORBA::Environment_var pd_environment; + CORBA::ExceptionList_var pd_exceptions; // may be nil + CORBA::ContextList_var pd_contexts; // may be nil + CORBA::Context_var pd_context; // may be nil +}; + class RequestImpl : public CORBA::Request, public PseudoObjBase { public: RequestImpl(CORBA::Object_ptr target, const char* operation); - RequestImpl(CORBA::Object_ptr target, const char* operation, - CORBA::Context_ptr context, CORBA::NVList_ptr arguments, + RequestImpl(CORBA::Object_ptr target, + const char* operation, + CORBA::Context_ptr context, + CORBA::NVList_ptr arguments, CORBA::NamedValue_ptr result); - RequestImpl(CORBA::Object_ptr target, const char* operation, - CORBA::Context_ptr context, CORBA::NVList_ptr arguments, - CORBA::NamedValue_ptr result, + RequestImpl(CORBA::Object_ptr target, + const char* operation, + CORBA::Context_ptr context, + CORBA::NVList_ptr arguments, + CORBA::NamedValue_ptr result, CORBA::ExceptionList_ptr exceptions, - CORBA::ContextList_ptr contexts); + CORBA::ContextList_ptr contexts); virtual ~RequestImpl(); @@ -62,59 +134,50 @@ virtual CORBA::ContextList_ptr contexts(); virtual CORBA::Context_ptr ctx() const; virtual void ctx(CORBA::Context_ptr); + virtual CORBA::Any& add_in_arg(); virtual CORBA::Any& add_in_arg(const char* name); virtual CORBA::Any& add_inout_arg(); virtual CORBA::Any& add_inout_arg(const char* name); virtual CORBA::Any& add_out_arg(); virtual CORBA::Any& add_out_arg(const char* name); + virtual void set_return_type(CORBA::TypeCode_ptr tc); virtual CORBA::Any& return_value(); + virtual void invoke(); virtual void send_oneway(); virtual void send_deferred(); virtual void get_response(); - virtual CORBA::Boolean poll_response(); - virtual CORBA::Boolean NP_is_nil() const; + + virtual CORBA::Boolean poll_response(); + virtual CORBA::Boolean NP_is_nil() const; virtual CORBA::Request_ptr NP_duplicate(); inline void storeExceptionInEnv() { - pd_environment->exception(pd_sysExceptionToThrow); + pd_cd.environment()->exception(pd_sysExceptionToThrow); pd_sysExceptionToThrow = 0; } - void marshalArgs(cdrStream&); - void unmarshalResults(cdrStream&); - CORBA::Boolean unmarshalUserException(cdrStream&, const char* repoId); - - void deferred_invoke(); - private: enum State { - RS_READY, // Not used yet - RS_DONE, // Result got - RS_DEFERRED, // Sent deferred - RS_POLLED_DONE // Found to be done by poll_response() but not yet got + RS_READY, // Not used yet + RS_DONE, // Result got synchronously + RS_DEFERRED, // Sent deferred + RS_POLLED_DONE_DEFERRED, // Result got with poll_response + RS_DONE_DEFERRED // Result got with get_response }; - CORBA::Object_var pd_target; - CORBA::String_var pd_operation; - CORBA::NVList_var pd_arguments; - CORBA::Boolean pd_i_own_arguments; - CORBA::NamedValue_var pd_result; - CORBA::Boolean pd_i_own_result; - CORBA::Environment_var pd_environment; - CORBA::ExceptionList_var pd_exceptions; // may be nil - CORBA::ContextList_var pd_contexts; // may be nil - CORBA::Context_var pd_context; // may be nil - State pd_state; - DeferredRequest* pd_deferredRequest; - - CORBA::Exception* pd_sysExceptionToThrow; + CORBA::Object_var pd_target; + CORBA::String_var pd_operation; + State pd_state; + DIICallDescriptor pd_cd; + CORBA::Exception* pd_sysExceptionToThrow; // If non-zero, then the exception should be thrown next // time one of the public methods (other than poll_response) // is called. + friend class DIICallDescriptor; }; OMNI_NAMESPACE_END(omni) diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/rmutex.h omniorb-dfsg-4.2.2/include/omniORB4/internal/rmutex.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/rmutex.h 2005-01-06 23:11:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/rmutex.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/shutdownIdentity.h omniorb-dfsg-4.2.2/include/omniORB4/internal/shutdownIdentity.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/shutdownIdentity.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/shutdownIdentity.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,19 +9,17 @@ // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,20 +27,6 @@ // ORB is shutting down. // -/* - $Log$ - Revision 1.1.4.2 2007/04/14 17:56:52 dgrisby - Identity downcasting mechanism was broken by VC++ 8's - over-enthusiastic optimiser. - - Revision 1.1.4.1 2003/03/23 21:03:42 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.1 2001/09/19 17:26:47 dpg1 - Full clean-up after orb->destroy(). - -*/ - #ifndef __OMNIORB_SHUTDOWNIDENTITY_H__ #define __OMNIORB_SHUTDOWNIDENTITY_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/SocketCollection.h omniorb-dfsg-4.2.2/include/omniORB4/internal/SocketCollection.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/SocketCollection.h 2011-07-01 14:53:57.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/SocketCollection.h 2017-02-20 22:45:59.000000000 +0000 @@ -4,337 +4,39 @@ // Author : Sai Lai Lo (sll) // Author : Duncan Grisby // -// Copyright (C) 2005-2009 Apasphere Ltd. +// Copyright (C) 2005-2013 Apasphere Ltd. // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.18 2009/03/13 13:42:33 dgrisby - Need an extra include on Win2K. Thanks Sampo Ahokas. - - Revision 1.1.4.17 2008/04/03 08:53:53 dgrisby - Define EBADF diferently for VxWorks. Thanks Ingo Thiele. - - Revision 1.1.4.16 2007/07/31 16:36:50 dgrisby - Hard-code define of IPV6_V6ONLY on Windows. - - Revision 1.1.4.15 2007/07/31 14:23:43 dgrisby - If the platform does not accept IPv4 connections on IPv6 sockets by - default, try to enable it by turning the IPV6_V6ONLY socket option - off. Should work for BSDs and Windows Vista. - - Revision 1.1.4.14 2006/11/20 14:16:21 dgrisby - FreeBSD doesn't listen for IPv4 on IPv6 sockets. Thanks Arno Klaassen. - - Revision 1.1.4.13 2006/10/09 13:08:58 dgrisby - Rename SOCKADDR_STORAGE define to OMNI_SOCKADDR_STORAGE, to avoid - clash on Win32 2003 SDK. - - Revision 1.1.4.12 2006/05/16 15:43:52 dgrisby - Make sure IPv6 definitions are available on Win32. - - Revision 1.1.4.11 2006/05/02 13:07:13 dgrisby - Idle giopMonitor SocketCollections would not exit at shutdown. - - Revision 1.1.4.10 2006/03/25 18:54:03 dgrisby - Initial IPv6 support. - - Revision 1.1.4.9 2005/11/18 18:25:57 dgrisby - Race condition between connection deletion and Select. - - Revision 1.1.4.8 2005/09/07 16:15:03 dgrisby - poll() does not work on Mac OS X. - - Revision 1.1.4.7 2005/08/02 09:42:53 dgrisby - Two threads could be dispatched for one call, one by Peek, one by Select. - - Revision 1.1.4.6 2005/06/24 14:31:31 dgrisby - Allow multiple threads to Peek() without clashing. Not yet tested on - Windows. - - Revision 1.1.4.5 2005/03/02 12:10:50 dgrisby - setSelectable / Peek fixes. - - Revision 1.1.4.4 2005/01/17 14:46:19 dgrisby - Windows SocketCollection implementation. - - Revision 1.1.4.3 2005/01/13 21:09:57 dgrisby - New SocketCollection implementation, using poll() where available and - select() otherwise. Windows specific version to follow. - - Revision 1.1.4.2 2005/01/06 23:08:25 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:03:55 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.16 2003/02/17 01:45:50 dgrisby - Pipe to kick select thread (on Unix). - - Revision 1.1.2.15 2002/10/04 11:11:45 dgrisby - Transport fixes: ENOTSOCK for Windows, SOMAXCONN in listen(). - - Revision 1.1.2.14 2002/09/08 22:12:22 dgrisby - Last checkin broke it. - - Revision 1.1.2.13 2002/09/08 21:58:49 dgrisby - Support for MSVC 7. (Untested.) - - Revision 1.1.2.12 2002/08/21 06:23:15 dgrisby - Properly clean up bidir connections and ropes. Other small tweaks. - - Revision 1.1.2.11 2002/05/07 12:54:38 dgrisby - Fix inevitable Windows header brokenness. - - Revision 1.1.2.10 2002/04/28 20:43:25 dgrisby - Windows, FreeBSD, ETS fixes. - - Revision 1.1.2.9 2002/03/13 16:05:38 dpg1 - Transport shutdown fixes. Reference count SocketCollections to avoid - connections using them after they are deleted. Properly close - connections when in thread pool mode. - - Revision 1.1.2.8 2002/02/26 14:06:44 dpg1 - Recent changes broke Windows. - - Revision 1.1.2.7 2002/02/13 16:02:38 dpg1 - Stability fixes thanks to Bastiaan Bakker, plus threading - optimisations inspired by investigating Bastiaan's bug reports. - - Revision 1.1.2.6 2002/01/15 16:38:11 dpg1 - On the road to autoconf. Dependencies refactored, configure.ac - written. No makefiles yet. - - Revision 1.1.2.5 2001/12/03 13:39:54 dpg1 - Explicit socket shutdown flag for Windows. - - Revision 1.1.2.4 2001/08/24 16:43:25 sll - Switch to use Winsock 2. Removed reference to winsock.h. Let the pre-processor - define _WIN32_WINNT=0x0400 to select the right header. - - Revision 1.1.2.3 2001/08/23 16:03:29 sll - Corrected typo __win32__, should be __WIN32__. - - Revision 1.1.2.2 2001/08/23 10:13:14 sll - Cope with the different length type for getsockname and friends on - different solaris versions. - - Revision 1.1.2.1 2001/07/31 16:16:26 sll - New transport interface to support the monitoring of active connections. - -*/ - #ifndef __SOCKETCOLLECTION_H__ #define __SOCKETCOLLECTION_H__ -//////////////////////////////////////////////////////////////////////// -// Platform feature selection - -#if !defined(OMNI_DISABLE_IPV6) && defined(HAVE_STRUCT_SOCKADDR_IN6) && defined(HAVE_STRUCT_SOCKADDR_STORAGE) && defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO) -# define OMNI_SUPPORT_IPV6 -# define OMNI_SOCKADDR_STORAGE sockaddr_storage -#else -# define OMNI_SOCKADDR_STORAGE sockaddr_in -#endif - -#define SOCKNAME_SIZE_T OMNI_SOCKNAME_SIZE_T -#define USE_NONBLOCKING_CONNECT -#define OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS -#define OMNIORB_HOSTNAME_MAX 512 - -#ifdef HAVE_POLL -# define USE_POLL -#endif - -// Darwin implementation of poll() appears to be broken -#if defined(__darwin__) -# undef USE_POLL -#endif - -#if defined(__hpux__) -# if __OSVERSION__ < 11 -# undef USE_POLL -# endif -# define USE_FAKE_INTERRUPTABLE_RECV -#endif - -#if defined(__WIN32__) -# define USE_FAKE_INTERRUPTABLE_RECV -# undef OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS -#endif - -#if defined(__freebsd__) || defined(__netbsd__) -# undef OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS -#endif - -// By default, Linux does accept IPv4 connections on IPv6, but some -// distributions misconfigure it not to. -#if defined(__linux__) || defined(IPV6_V6ONLY) -# undef OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS -#endif - - -//////////////////////////////////////////////////////////////////////// - - -//////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////// -// win32 API -// -#if defined(__WIN32__) +#include -# include -# include - -# if defined(OMNI_SUPPORT_IPV6) -# include -# include -# if !defined(IPV6_V6ONLY) -# define IPV6_V6ONLY 27 // Defined to this on Vista -# endif -# endif - -# define RC_INADDR_NONE INADDR_NONE -# define RC_INVALID_SOCKET INVALID_SOCKET -# define RC_SOCKET_ERROR SOCKET_ERROR -# define INETSOCKET PF_INET -# define CLOSESOCKET(sock) closesocket(sock) -# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) -# define ERRNO ::WSAGetLastError() -# define RC_EINPROGRESS WSAEWOULDBLOCK -# define RC_EINTR WSAEINTR -# define RC_EBADF WSAENOTSOCK - -OMNI_NAMESPACE_BEGIN(omni) - -typedef SOCKET SocketHandle_t; - -OMNI_NAMESPACE_END(omni) - -#else - -//////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////// -// unix(ish) -// -# if defined(__vxWorks__) -# include -# include -# include -# include -# include -# else -# include -# endif -# include -# include -# include -# include -# include -# include -# include -# include - -# if defined(USE_POLL) -# include -# endif - -# include - -# if defined (__uw7__) -# ifdef shutdown -# undef shutdown -# endif -# endif - -# if defined(__VMS) && defined(USE_tcpSocketVaxRoutines) -# include "tcpSocketVaxRoutines.h" -# undef accept -# undef recv -# undef send -# define accept(a,b,c) tcpSocketVaxAccept(a,b,c) -# define recv(a,b,c,d) tcpSocketVaxRecv(a,b,c,d) -# define send(a,b,c,d) tcpSocketVaxSend(a,b,c,d) -# endif - -# ifdef __rtems__ -extern "C" int select (int,fd_set*,fd_set*,fd_set*,struct timeval *); -# endif - -# define RC_INADDR_NONE ((CORBA::ULong)-1) -# define RC_INVALID_SOCKET (-1) -# define RC_SOCKET_ERROR (-1) -# define INETSOCKET AF_INET -# define CLOSESOCKET(sock) close(sock) - -# if defined(__sunos__) && defined(__sparc__) && __OSVERSION__ >= 5 -# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) -# elif defined(__osf1__) && defined(__alpha__) -# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) -# else - // XXX none of the above, calling shutdown() may not have the - // desired effect. -# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) -# endif - -# define ERRNO errno -# define RC_EINTR EINTR -# define RC_EINPROGRESS EINPROGRESS -# if defined (__vxWorks__) -# define RC_EBADF S_iosLib_INVALID_FILE_DESCRIPTOR -# else -# define RC_EBADF EBADF -# endif -# define RC_EAGAIN EAGAIN - - -OMNI_NAMESPACE_BEGIN(omni) - -typedef int SocketHandle_t; - -OMNI_NAMESPACE_END(omni) - -#endif - -#if defined(NEED_GETHOSTNAME_PROTOTYPE) -extern "C" int gethostname(char *name, int namelen); -#endif OMNI_NAMESPACE_BEGIN(omni) class SocketCollection; -extern void SocketSetTimeOut(unsigned long abs_sec, - unsigned long abs_nsec,struct timeval& t); - -extern int SocketSetnonblocking(SocketHandle_t sock); - -extern int SocketSetblocking(SocketHandle_t sock); - -extern int SocketSetCloseOnExec(SocketHandle_t sock); - // // Class SocketHolder holds a socket inside a collection. It contains @@ -352,6 +54,7 @@ pd_data_in_buffer(0), pd_peeking(0), pd_peek_go(0), + pd_nonblocking(0), pd_peek_cond(0), pd_fd_index(-1), pd_next(0), @@ -388,6 +91,25 @@ // return true if the socket becomes readable, otherwise return // false. + inline void + setBlocking() + { + if (pd_nonblocking) { + tcpSocket::setBlocking(pd_socket); + pd_nonblocking = 0; + } + } + + inline void + setNonBlocking() + { + if (!pd_nonblocking) { + tcpSocket::setNonBlocking(pd_socket); + pd_nonblocking = 1; + } + } + + friend class SocketCollection; protected: @@ -403,6 +125,7 @@ CORBA::Boolean pd_peek_go; // True if the peeking thread // should return true, even if it // did not see data to read + CORBA::Boolean pd_nonblocking; // True if the socket is nonblocking omni_tracedcondition* pd_peek_cond; // Condition to signal a waiting // peeker int pd_fd_index; // -1 if select thread is not @@ -456,8 +179,7 @@ // Remove the socket from this collection. Returns the socket which // has been removed. Decrements this collection's refcount. - static unsigned long scan_interval_sec; - static unsigned long scan_interval_nsec; + static omni_time_t scan_interval; static unsigned idle_scans; private: @@ -466,8 +188,7 @@ // Absolute time at which we scan through the socket list choosing // the selectable ones. - unsigned long pd_abs_sec; - unsigned long pd_abs_nsec; + omni_time_t pd_abs_time; // On platforms that support it, we use a pipe to wake up the select. int pd_pipe_read; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/tcParser.h omniorb-dfsg-4.2.2/include/omniORB4/internal/tcParser.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/tcParser.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/tcParser.h 2017-02-20 22:45:59.000000000 +0000 @@ -10,19 +10,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/tcpSocket.h omniorb-dfsg-4.2.2/include/omniORB4/internal/tcpSocket.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/tcpSocket.h 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/tcpSocket.h 2017-02-20 22:45:59.000000000 +0000 @@ -0,0 +1,419 @@ +// -*- Mode: C++; -*- +// Package : omniORB +// tcpSocket.h Created on: 4 June 2010 +// Author : Duncan Grisby +// +// Copyright (C) 2010-2011 Apasphere Ltd. +// +// This file is part of the omniORB library +// +// The omniORB library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ +// +// +// Description: +// *** PROPRIETARY INTERFACE *** +// Utility functions for managing TCP sockets + +#ifndef __TCPSOCKET_h__ +#define __TCPSOCKET_h__ + +#include +#include +#include + +//////////////////////////////////////////////////////////////////////// +// Platform feature selection + +#if !defined(OMNI_DISABLE_IPV6) && defined(HAVE_STRUCT_SOCKADDR_IN6) && defined(HAVE_STRUCT_SOCKADDR_STORAGE) && defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO) +# define OMNI_SUPPORT_IPV6 +# define OMNI_SOCKADDR_STORAGE sockaddr_storage +#else +# define OMNI_SOCKADDR_STORAGE sockaddr_in +#endif + +#define SOCKNAME_SIZE_T OMNI_SOCKNAME_SIZE_T +#define USE_NONBLOCKING_CONNECT +#define OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS +#define OMNIORB_HOSTNAME_MAX 512 + +#ifdef HAVE_POLL +# define USE_POLL +#endif + +// Darwin implementation of poll() appears to be broken +#if defined(__darwin__) +# undef USE_POLL +#endif + +#if defined(__hpux__) +# if __OSVERSION__ < 11 +# undef USE_POLL +# endif +# define USE_FAKE_INTERRUPTABLE_RECV +#endif + +#if defined(__WIN32__) +# define USE_FAKE_INTERRUPTABLE_RECV +# undef OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS +#endif + +#if defined(__freebsd__) || defined(__netbsd__) +# undef OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS +#endif + +// By default, Linux does accept IPv4 connections on IPv6, but some +// distributions misconfigure it not to. +#if defined(__linux__) || defined(IPV6_V6ONLY) +# undef OMNI_IPV6_SOCKETS_ACCEPT_IPV4_CONNECTIONS +#endif + + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +// win32 API +// +#if defined(__WIN32__) + +# include + +# if defined(OMNI_SUPPORT_IPV6) +# include +# include +# if !defined(IPV6_V6ONLY) +# define IPV6_V6ONLY 27 // Defined to this on Vista +# endif +# endif + +# define RC_INADDR_NONE INADDR_NONE +# define RC_INVALID_SOCKET INVALID_SOCKET +# define RC_SOCKET_ERROR SOCKET_ERROR +# define INETSOCKET PF_INET +# define CLOSESOCKET(sock) closesocket(sock) +# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) +# define ERRNO ::WSAGetLastError() +# define RC_EINPROGRESS WSAEWOULDBLOCK +# define RC_EINTR WSAEINTR +# define RC_EBADF WSAENOTSOCK + +# define RC_TRY_AGAIN(err) ((err == WSAEINTR) || (err == WSAEWOULDBLOCK)) + +#else + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// +// unix(ish) +// +# if defined(__vxWorks__) +# include +# include +# include +# include +# include +# else +# include +# endif +# include +# include +# include +# include +# include +# include +# include +# include + +# if defined(USE_POLL) +# include +# endif + +# include + +# if defined (__uw7__) +# ifdef shutdown +# undef shutdown +# endif +# endif + +# if defined(__VMS) && defined(USE_tcpSocketVaxRoutines) +# include "tcpSocketVaxRoutines.h" +# undef accept +# undef recv +# undef send +# define accept(a,b,c) tcpSocketVaxAccept(a,b,c) +# define recv(a,b,c,d) tcpSocketVaxRecv(a,b,c,d) +# define send(a,b,c,d) tcpSocketVaxSend(a,b,c,d) +# endif + +# ifdef __rtems__ +extern "C" int select (int,fd_set*,fd_set*,fd_set*,struct timeval *); +# endif + +# define RC_INADDR_NONE ((CORBA::ULong)-1) +# define RC_INVALID_SOCKET (-1) +# define RC_SOCKET_ERROR (-1) +# define INETSOCKET AF_INET +# define CLOSESOCKET(sock) close(sock) + +# if defined(__sunos__) && defined(__sparc__) && __OSVERSION__ >= 5 +# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) +# elif defined(__osf1__) && defined(__alpha__) +# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) +# else + // XXX none of the above, calling shutdown() may not have the + // desired effect. +# define SHUTDOWNSOCKET(sock) ::shutdown(sock,2) +# endif + +# define ERRNO errno +# define RC_EINTR EINTR +# define RC_EINPROGRESS EINPROGRESS +# if defined (__vxWorks__) +# define RC_EBADF S_iosLib_INVALID_FILE_DESCRIPTOR +# else +# define RC_EBADF EBADF +# endif +# define RC_EAGAIN EAGAIN + +# define RC_TRY_AGAIN(err) ((err == EINTR) ||\ + (err == EWOULDBLOCK) ||\ + (err == EAGAIN)) + +#endif + +#if defined(NEED_GETHOSTNAME_PROTOTYPE) +extern "C" int gethostname(char *name, int namelen); +#endif + + +//////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// + +OMNI_NAMESPACE_BEGIN(omni) + +#if defined(__WIN32__) +typedef SOCKET SocketHandle_t; +#else +typedef int SocketHandle_t; +#endif + +class tcpSocket { +public: + + static SocketHandle_t Bind(const char* host, + CORBA::UShort port_min, + CORBA::UShort port_max, + const char* transport_type, + char*& bound_host, + CORBA::UShort& bound_port, + orbServer::EndpointList& endpoints); + // Create a socket and bind() and listen(). + // + // If host is null or empty string, bind to all interfaces; + // otherwise bind to the specified interface. + // + // If port_min and port_max are zero, bind to an ephemeral port; if + // they are non-zero and equal, bind to the specified port, setting + // the SO_REUSEADDR socket option; if port_max > port_min, bind to + // one of the ports in the specified range. + // + // transport_type is the URI prefix for the requesting transport, + // e.g. giop:tcp + // + // Returns the bound socket, or RC_INVALID_SOCKET on error. + // + // bound_host is set to the chosen host address. Caller frees. + // + // bound_port is set to the chosen port. + // + // endpoints is populated with all the endpoints that result from + // the socket. + + + static SocketHandle_t Connect(const char* host, + CORBA::UShort port, + const omni_time_t& deadline, + CORBA::ULong strand_flags, + CORBA::Boolean& timed_out); + // Connect to specified host and port. + // + // If deadline is set, connect attempt can time out. + // + // strand_flags contains additional requirements on the connection. + // See giopStrandFlags.h. + // + // Returns bound socket, or RC_INVALID_SOCKET on error or timeout. + // On timeout, timed_out is set true. + + + static inline void + logConnectFailure(const char* message, + LibcWrapper::AddrInfo* ai) + { + if (omniORB::trace(25)) { + omniORB::logger log; + CORBA::String_var addr = ai->asString(); + log << message << ": " << addr; + + CORBA::UShort port = addrToPort(ai->addr()); + if (port) + log << ":" << port; + + log << "\n"; + } + } + + static inline void + logConnectFailure(const char* message, + const char* host, + CORBA::UShort port=0) + { + if (omniORB::trace(25)) { + omniORB::logger log; + log << message << ": " << host; + if (port) + log << ":" << port; + log << "\n"; + } + } + + + static inline int setAndCheckTimeout(const omni_time_t& deadline, + struct timeval& t) + { + if (deadline) { + if (setTimeout(deadline, t)) { + // Already timed out. + return 1; + } +#if defined(USE_FAKE_INTERRUPTABLE_RECV) + if (t.tv_sec > orbParameters::scanGranularity) { + t.tv_sec = orbParameters::scanGranularity; + } +#endif + } + else { +#if defined(USE_FAKE_INTERRUPTABLE_RECV) + t.tv_sec = orbParameters::scanGranularity; + t.tv_usec = 0; +#else + t.tv_sec = t.tv_usec = 0; +#endif + } + return 0; + } + + + static inline int waitWrite(SocketHandle_t sock, struct timeval& t) + { + int rc; + +#if defined(USE_POLL) + struct pollfd fds; + fds.fd = sock; + fds.events = POLLOUT; + int timeout = t.tv_sec*1000+((t.tv_usec+999)/1000); + if (timeout == 0) timeout = -1; + rc = poll(&fds, 1, timeout); + if (rc > 0 && fds.revents & POLLERR) { + rc = RC_SOCKET_ERROR; + } +#else + fd_set fds, efds; + FD_ZERO(&fds); + FD_ZERO(&efds); + FD_SET(sock,&fds); + FD_SET(sock,&efds); + struct timeval* tp = &t; + if (t.tv_sec == 0 && t.tv_usec == 0) tp = 0; + rc = select(sock+1, 0, &fds, &efds, tp); +#endif + return rc; + } + + static inline int waitRead(SocketHandle_t sock, struct timeval& t) + { + int rc; + +#if defined(USE_POLL) + struct pollfd fds; + fds.fd = sock; + fds.events = POLLIN; + int timeout = t.tv_sec*1000+((t.tv_usec+999)/1000); + if (timeout == 0) timeout = -1; + rc = poll(&fds, 1, timeout); + if (rc > 0 && fds.revents & POLLERR) { + rc = RC_SOCKET_ERROR; + } +#else + fd_set fds, efds; + FD_ZERO(&fds); + FD_ZERO(&efds); + FD_SET(sock,&fds); + FD_SET(sock,&efds); + struct timeval* tp = &t; + if (t.tv_sec == 0 && t.tv_usec == 0) tp = 0; + rc = select(sock+1, &fds, 0, &efds, tp); +#endif + return rc; + } + + static inline CORBA::Boolean + setTimeout(const omni_time_t& deadline, struct timeval& t) + { + if (!deadline) { + // Avoid get_time call which is expensive on some platforms. + t.tv_sec = t.tv_usec = 0; + return 0; + } + + omni_time_t now; + omni_thread::get_time(now); + + if (deadline <= now) { + t.tv_sec = t.tv_usec = 0; + return 1; + } + else { + omni_time_t diff(deadline); + diff -= now; + t.tv_sec = diff.s; + t.tv_usec = diff.ns / 1000; + return 0; + } + } + + static int setBlocking(SocketHandle_t sock); + static int setNonBlocking(SocketHandle_t sock); + static int setCloseOnExec(SocketHandle_t sock); + + + static char* addrToString(sockaddr* addr); + // Return string form of an IP address in dotted decimal or + // colon-separated hex. + + static char* addrToURI(sockaddr* addr, const char* prefix); + // Return URI for address, with specified prefix. + + static CORBA::UShort addrToPort(sockaddr* addr); + // Return port number in address. + + static char* peerToURI(SocketHandle_t sock, const char* prefix); + // Return URI for peer on socket. + +}; + + +OMNI_NAMESPACE_END(omni); + + +#endif // __TCPSOCKET_h__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/transportRules.h omniorb-dfsg-4.2.2/include/omniORB4/internal/transportRules.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/transportRules.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/transportRules.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,59 +3,44 @@ // transportRule.h Created on: 21/08/2001 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.1.2.3 2001/09/03 13:27:12 sll - Minor update to comments. - - Revision 1.1.2.2 2001/08/29 17:50:39 sll - New method dumpRule. - - Revision 1.1.2.1 2001/08/23 16:00:35 sll - Added method in giopTransportImpl to return the addresses of the host - interfaces. +#ifndef __TRANSPORTRULES_H__ +#define __TRANSPORTRULES_H__ -*/ +#include -#ifndef __TRANSPORTRULE_H__ -#define __TRANSPORTRULE_H__ OMNI_NAMESPACE_BEGIN(omni) class transportRules { - public: +public: //////////////////////////////////////////////////////////////////////// static transportRules& serverRules(); static transportRules& clientRules(); //////////////////////////////////////////////////////////////////////// - class sequenceString; - - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class Rule { public: @@ -73,15 +58,16 @@ Rule& operator=(const Rule&); }; - void addRule(Rule*,sequenceString*); - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// class RuleType { public: - virtual Rule* createRule(const char* address_mask) = 0; - // If is recognised by this RuleType instance, return - // a Rule instance to handle this . Otherwise return 0. + virtual CORBA::Boolean createRules(const char* address_mask, + const CORBA::StringSeq& actions, + transportRules& tr) = 0; + // If is recognised by this RuleType instance, add + // one or more rules to the transportRules and return true; if not + // recognised, return false. RuleType() {} virtual ~RuleType() {} @@ -91,12 +77,14 @@ RuleType& operator=(const RuleType&); }; + typedef omnivector RuleTypes; + static void addRuleType(RuleType*); //////////////////////////////////////////////////////////////////////// CORBA::Boolean match(const char* endpoint, - sequenceString& actions/* return arg */, + CORBA::StringSeq& actions/* return arg */, CORBA::ULong& priority/* return arg */); // Return true if matches one of the transport rules. // The action list of the matched rule is returned in . @@ -111,115 +99,40 @@ // by match() is used as in this function, the string representation // of the rule that match() matches is returned. - //////////////////////////////////////////////////////////////////////// - class sequenceString_var; - - class sequenceString : public _CORBA_Unbounded_Sequence_String { - public: - typedef sequenceString_var _var_type; - inline sequenceString() {} - inline sequenceString(const sequenceString& s) - : _CORBA_Unbounded_Sequence_String(s) {} - - inline sequenceString(_CORBA_ULong _max) - : _CORBA_Unbounded_Sequence_String(_max) {} - inline sequenceString(_CORBA_ULong _max, _CORBA_ULong _len, char** _val, _CORBA_Boolean _rel=0) - : _CORBA_Unbounded_Sequence_String(_max, _len, _val, _rel) {} - - - - inline sequenceString& operator = (const sequenceString& s) { - _CORBA_Unbounded_Sequence_String::operator=(s); - return *this; - } - }; //////////////////////////////////////////////////////////////////////// - class sequenceString_var { - public: - typedef sequenceString T; - typedef sequenceString_var T_var; - - inline sequenceString_var() : _pd_seq(0) {} - inline sequenceString_var(T* s) : _pd_seq(s) {} - inline sequenceString_var(const T_var& s) { - if( s._pd_seq ) _pd_seq = new T(*s._pd_seq); - else _pd_seq = 0; - } - inline ~sequenceString_var() { if( _pd_seq ) delete _pd_seq; } - - inline T_var& operator = (T* s) { - if( _pd_seq ) delete _pd_seq; - _pd_seq = s; - return *this; - } - inline T_var& operator = (const T_var& s) { - if( s._pd_seq ) { - if( !_pd_seq ) _pd_seq = new T; - *_pd_seq = *s._pd_seq; - } else if( _pd_seq ) { - delete _pd_seq; - _pd_seq = 0; - } - return *this; - } - - inline _CORBA_String_element operator [] (_CORBA_ULong s) { - return (*_pd_seq)[s]; - } - - inline T* operator -> () { return _pd_seq; } -#if defined(__GNUG__) - inline operator T& () const { return *_pd_seq; } -#else - inline operator const T& () const { return *_pd_seq; } - inline operator T& () { return *_pd_seq; } -#endif - - inline const T& in() const { return *_pd_seq; } - inline T& inout() { return *_pd_seq; } - inline T*& out() { - if( _pd_seq ) { delete _pd_seq; _pd_seq = 0; } - return _pd_seq; - } - inline T* _retn() { T* tmp = _pd_seq; _pd_seq = 0; return tmp; } - - private: - T* _pd_seq; - }; - -#ifdef __GNUG__ - friend class _keep_gcc_quiet_; -#endif - friend class omni_transportRules_initialiser; friend class clientTransportRuleHandler; friend class serverTransportRuleHandler; struct RuleActionPair { + RuleActionPair(Rule* r, const CORBA::StringSeq& a) + : rule_(r), action_(a) {} - RuleActionPair(Rule* r,sequenceString& a) : rule_(r) { - CORBA::ULong max = a.maximum(); - CORBA::ULong len = a.length(); - action_.replace(max,len,a.get_buffer(1),1); - } ~RuleActionPair() { if (rule_) delete rule_; } - Rule* rule_; - sequenceString action_; + Rule* rule_; + CORBA::StringSeq action_; }; - transportRules(); - ~transportRules(); + typedef omnivector RuleActionPairs; - private: + inline void addRule(Rule* r, const CORBA::StringSeq& a) + { + pd_rules.push_back(new RuleActionPair(r, a)); + } - omnivector pd_ruletypes; - omnivector pd_rules; + + transportRules(); + ~transportRules(); void reset(); +private: + + RuleTypes pd_ruletypes; + RuleActionPairs pd_rules; transportRules(const transportRules&); transportRules& operator=(const transportRules&); @@ -227,4 +140,4 @@ OMNI_NAMESPACE_END(omni) -#endif // __TRANSPORTRULE_H__ +#endif // __TRANSPORTRULES_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/typecode.h omniorb-dfsg-4.2.2/include/omniORB4/internal/typecode.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/typecode.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/typecode.h 2017-02-20 22:45:59.000000000 +0000 @@ -11,118 +11,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Internal typecode classes. // -/* - * $Log$ - * Revision 1.1.4.5 2006/11/28 00:09:42 dgrisby - * TypeCode collector could access deleted data when freeing TypeCodes - * with multiple loops. - * - * Revision 1.1.4.4 2006/05/20 16:23:37 dgrisby - * Minor cdrMemoryStream and TypeCode performance tweaks. - * - * Revision 1.1.4.3 2004/05/25 14:20:50 dgrisby - * ValueType TypeCode support. - * - * Revision 1.1.4.2 2004/04/02 13:26:24 dgrisby - * Start refactoring TypeCode to support value TypeCodes, start of - * abstract interfaces support. - * - * Revision 1.1.4.1 2003/03/23 21:03:42 dgrisby - * Start of omniORB 4.1.x development branch. - * - * Revision 1.1.2.4 2002/12/18 15:58:52 dgrisby - * Proper clean-up of recursive TypeCodes. - * - * Revision 1.1.2.3 2001/10/29 17:42:38 dpg1 - * Support forward-declared structs/unions, ORB::create_recursive_tc(). - * - * Revision 1.1.2.2 2001/06/08 17:12:10 dpg1 - * Merge all the bug fixes from omni3_develop. - * - * Revision 1.1.2.1 2001/04/18 17:18:13 sll - * Big checkin with the brand new internal APIs. - * These files were relocated and scoped with the omni namespace. - * - * Revision 1.10.2.6 2001/03/13 10:32:06 dpg1 - * Fixed point support. - * - * Revision 1.10.2.5 2000/11/17 19:09:39 dpg1 - * Support codeset conversion in any. - * - * Revision 1.10.2.4 2000/11/09 12:27:55 dpg1 - * Huge merge from omni3_develop, plus full long long from omni3_1_develop. - * - * Revision 1.10.2.3 2000/10/06 16:40:55 sll - * Changed to use cdrStream. - * - * Revision 1.10.2.2 2000/09/27 17:25:45 sll - * Changed include/omniORB3 to include/omniORB4. - * - * Revision 1.10.2.1 2000/07/17 10:35:43 sll - * Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - * - * Revision 1.11 2000/07/13 15:26:02 dpg1 - * Merge from omni3_develop for 3.0 release. - * - * Revision 1.8.6.5 2000/06/22 10:40:13 dpg1 - * exception.h renamed to exceptiondefs.h to avoid name clash on some - * platforms. - * - * Revision 1.8.6.4 2000/02/15 13:43:43 djr - * Fixed bug in create_union_tc() -- problem if discriminator was an alias. - * - * Revision 1.8.6.3 1999/10/14 17:31:34 djr - * Minor corrections. - * - * Revision 1.8.6.2 1999/10/14 16:22:04 djr - * Implemented logging when system exceptions are thrown. - * - * Revision 1.8.6.1 1999/09/22 14:26:39 djr - * Major rewrite of orbcore to support POA. - * - * Revision 1.7 1999/07/01 10:28:14 djr - * Added two methods to TypeCode_pairlist. - * Declare inline methods as inline. - * - * Revision 1.6 1999/06/18 21:00:31 sll - * Updated to CORBA 2.3 mapping. - * - * Revision 1.5 1999/05/25 17:47:09 sll - * Changed to use _CORBA_PseudoValue_Sequence. - * - * Revision 1.4 1999/03/11 16:25:59 djr - * Updated copyright notice - * - * Revision 1.3 1999/02/18 15:49:30 djr - * Simplified NP_namesEqualOrNull() - * - * Revision 1.2 1999/01/18 13:56:20 djr - * Fixed bug in TypeCode_union. - * - * Revision 1.1 1999/01/07 17:12:37 djr - * Initial revision - * - */ - #ifndef __TYPECODE_H__ #define __TYPECODE_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/unknownValue.h omniorb-dfsg-4.2.2/include/omniORB4/internal/unknownValue.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/unknownValue.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/unknownValue.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,19 +27,6 @@ // this class. // -/* - $Log$ - Revision 1.1.2.3 2005/01/17 14:44:46 dgrisby - Surprisingly few changes to compile on Windows. - - Revision 1.1.2.2 2004/10/13 17:58:19 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.1.2.1 2004/07/26 22:56:38 dgrisby - Support valuetypes in Anys. - -*/ - #ifndef __OMNI_UNKNOWNVALUE_H__ #define __OMNI_UNKNOWNVALUE_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/internal/valueTrackerImpl.h omniorb-dfsg-4.2.2/include/omniORB4/internal/valueTrackerImpl.h --- omniorb-dfsg-4.1.6/include/omniORB4/internal/valueTrackerImpl.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/internal/valueTrackerImpl.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,43 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Value tracker implementation classes for C++ // -// $Log$ -// Revision 1.1.2.5 2005/01/17 14:44:46 dgrisby -// Surprisingly few changes to compile on Windows. -// -// Revision 1.1.2.4 2004/07/04 23:53:35 dgrisby -// More ValueType TypeCode and Any support. -// -// Revision 1.1.2.3 2004/04/02 13:26:24 dgrisby -// Start refactoring TypeCode to support value TypeCodes, start of -// abstract interfaces support. -// -// Revision 1.1.2.2 2003/11/06 11:56:55 dgrisby -// Yet more valuetype. Plain valuetype and abstract valuetype are now working. -// -// Revision 1.1.2.1 2003/09/26 16:12:54 dgrisby -// Start of valuetype support. -// - #ifndef __VALUETRACKERIMPL_H__ #define __VALUETRACKERIMPL_H__ @@ -105,12 +85,23 @@ // nested value away, but later receives an indirection to it. private: + void resizeTable(); + + inline void add() + { + if (++pd_table_count == pd_table_limit) + resizeTable(); + } + static _dyn_attr const CORBA::ULong PD_MAGIC; // "C+OV" - CORBA::ULong pd_magic; + CORBA::ULong pd_magic; CORBA::ULong pd_in_truncatable; OutputTableEntry** pd_table; + CORBA::ULong pd_table_count; CORBA::ULong pd_table_size; + CORBA::ULong pd_table_limit; + CORBA::ULong pd_table_next_idx; }; class InputValueTracker : public ValueIndirectionTracker { @@ -152,12 +143,23 @@ // As above for list of repoIds. private: + void resizeTable(); + + inline void add() + { + if (++pd_table_count == pd_table_limit) + resizeTable(); + } + static _dyn_attr const CORBA::ULong PD_MAGIC; // "C+IV" - CORBA::ULong pd_magic; + CORBA::ULong pd_magic; CORBA::ULong pd_in_truncatable; InputTableEntry** pd_table; + CORBA::ULong pd_table_count; CORBA::ULong pd_table_size; + CORBA::ULong pd_table_limit; + CORBA::ULong pd_table_next_idx; }; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/IOP_C.h omniorb-dfsg-4.2.2/include/omniORB4/IOP_C.h --- omniorb-dfsg-4.1.6/include/omniORB4/IOP_C.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/IOP_C.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,36 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.2.2 2001/05/02 14:20:15 sll - Make sure that getStream() is used instead of casting to get a cdrStream - from a IOP_C and IOP_S. - - Revision 1.1.2.1 2001/04/18 17:26:29 sll - Big checkin with the brand new internal APIs. - - */ - #ifndef __IOP_C_H__ #define __IOP_C_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/IOP.h omniorb-dfsg-4.2.2/include/omniORB4/IOP.h --- omniorb-dfsg-4.1.6/include/omniORB4/IOP.h 2007-11-28 12:24:26.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/IOP.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,96 +3,29 @@ // IOP.h Created on: 8/2/96 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // C++ mapping of the OMG IOP module // Reference: CORBA V2.0 10.6.2 // -// - -/* - $Log$ - Revision 1.4.2.3 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.4.2.2 2005/01/06 23:08:09 dgrisby - Big merge from omni4_0_develop. - - Revision 1.4.2.1 2003/03/23 21:04:20 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.8 2001/08/06 15:49:16 sll - Added IOP component TAG_OMNIORB_UNIX_TRANS for omniORB specific local - transport using the unix domain socket. - - Revision 1.2.2.7 2001/07/31 16:10:39 sll - Added GIOP BiDir support. - - Revision 1.2.2.6 2001/04/18 17:52:19 sll - Added FT specification constants. - - Revision 1.2.2.5 2000/11/15 17:00:55 sll - Added marshalling operators for ServiceContext. - - Revision 1.2.2.4 2000/11/03 18:58:46 sll - Unbounded sequence of octet got a new type name. - - Revision 1.2.2.3 2000/10/04 16:52:04 sll - New helper function dumpComponent(). - - Revision 1.2.2.2 2000/09/27 17:06:09 sll - Updated to use the new cdrStream abstraction. - Updated to include the latest componentID, service context ID etc. - - Revision 1.2.2.1 2000/07/17 10:35:34 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:41 djr - Moved from omniORB2 + some new files. - - Revision 1.7 1999/06/18 21:13:56 sll - Updated copyright notice. - - Revision 1.6 1999/06/18 20:36:05 sll - Replaced _LC_attr with _core_attr. - - Revision 1.5 1999/01/07 18:22:25 djr - Replaced _OMNIORB_NTDLL_IMPORT with _LC_attr. - - Revision 1.4 1998/04/07 19:59:00 sll - Replace _OMNIORB2_NTDLL_ specification on class IOP with - _OMNIORB_NTDLL_IMPORT on static member constants. - - Revision 1.3 1997/12/09 20:36:28 sll - Added TaggedProfileList_var class. - - * Revision 1.2 1997/05/06 16:07:17 sll - * Public release. - * - */ #ifndef __OMNIORB_IOP_H__ #define __OMNIORB_IOP_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/IOP_S.h omniorb-dfsg-4.2.2/include/omniORB4/IOP_S.h --- omniorb-dfsg-4.1.6/include/omniORB4/IOP_S.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/IOP_S.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,46 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.2.4 2001/09/20 11:30:59 sll - On the server, the final state of a GIOP_S is ReplyCompleted instead of - Idle. This is necessary because the idle connection management code - treats Idle as a state where the idle counter can be restarted. - - Revision 1.1.2.3 2001/09/10 17:41:30 sll - Added WaitForRequestHeader in IOP_S::State. Reorder the enum labels inside - IOP_S::State, any label that is larger than WaitForRequestHeader now - indicates that the IOP_S is actively processing a request. - - Revision 1.1.2.2 2001/05/02 14:20:15 sll - Make sure that getStream() is used instead of casting to get a cdrStream - from a IOP_C and IOP_S. - - Revision 1.1.2.1 2001/04/18 17:26:29 sll - Big checkin with the brand new internal APIs. - - */ - #ifndef __IOP_S_H__ #define __IOP_S_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/linkHacks.h omniorb-dfsg-4.2.2/include/omniORB4/linkHacks.h --- omniorb-dfsg-4.1.6/include/omniORB4/linkHacks.h 2009-09-03 17:56:22.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/linkHacks.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/minorCode.h omniorb-dfsg-4.2.2/include/omniORB4/minorCode.h --- omniorb-dfsg-4.1.6/include/omniORB4/minorCode.h 2010-05-07 12:04:15.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/minorCode.h 2017-03-30 13:54:10.000000000 +0000 @@ -3,107 +3,29 @@ // minorCode.h Created on: 05/01/2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2006 Apasphere Ltd +// Copyright (C) 2002-2012 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.6.7 2006/04/10 12:50:35 dgrisby - More endPointPublish; support for deprecated endPointNoListen, - endPointPublishAllIFs. - - Revision 1.1.6.6 2005/09/19 18:26:33 dgrisby - Merge from omni4_0_develop again. - - Revision 1.1.6.5 2005/09/19 15:36:35 dgrisby - Refcount shortcut now throws INV_OBJREF when the servant is - deactivated, rather than deactivating the shortcut, which could lead - to a race condition. - - Revision 1.1.6.4 2005/01/06 23:08:09 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.6.3 2004/07/23 10:29:56 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.1.6.2 2003/05/20 16:53:12 dgrisby - Valuetype marshalling support. - - Revision 1.1.6.1 2003/03/23 21:04:16 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.15 2003/03/10 11:13:17 dgrisby - BAD_PARAM with invalid fixed limits. - - Revision 1.1.4.14 2002/11/22 18:11:58 dgrisby - Correct COMM_FAILURE minor code check. - - Revision 1.1.4.13 2002/02/26 14:08:34 dpg1 - Minor codes for omniORBpy. - - Revision 1.1.4.12 2002/01/21 11:51:52 dpg1 - Add TRANSIENT minor code for Python exception. - - Revision 1.1.4.11 2001/10/29 17:42:35 dpg1 - Support forward-declared structs/unions, ORB::create_recursive_tc(). - - Revision 1.1.4.10 2001/10/17 16:47:07 dpg1 - New minor codes - - Revision 1.1.4.9 2001/09/24 10:41:07 dpg1 - Minor codes for Dynamic library and omniORBpy. - - Revision 1.1.4.8 2001/09/12 19:44:27 sll - Added back MARSHAL_MessageSizeExceedLimit to report the error when it is - not possible to tell whether this is the client or the server side. - - Revision 1.1.4.7 2001/08/15 10:15:45 dpg1 - New minor codes for POA and DSI errors. - - Revision 1.1.4.6 2001/08/03 17:49:33 sll - New minor code and lookup table for translating a minor code to its memonic - names. - - Revision 1.1.4.5 2001/07/31 16:38:43 sll - Added GIOP BiDir related error code. - - Revision 1.1.4.4 2001/06/11 17:59:21 sll - New minor code to indicate error in initialising a transport. - - Revision 1.1.4.3 2001/06/08 17:12:08 dpg1 - Merge all the bug fixes from omni3_develop. - - Revision 1.1.4.2 2001/05/11 14:28:14 sll - Separate minor code MARSHAL_MessageSizeExceedLimit into distinct client and - server side codes. - - Revision 1.1.4.1 2001/04/18 17:26:29 sll - Big checkin with the brand new internal APIs. - - */ - #ifndef __MINORCODE__ #define __MINORCODE__ @@ -238,6 +160,14 @@ #define OMNIORBMinorCode_121 OMNIORBMinorCode(121) #define OMNIORBMinorCode_122 OMNIORBMinorCode(122) #define OMNIORBMinorCode_123 OMNIORBMinorCode(123) +#define OMNIORBMinorCode_124 OMNIORBMinorCode(124) +#define OMNIORBMinorCode_125 OMNIORBMinorCode(125) +#define OMNIORBMinorCode_126 OMNIORBMinorCode(126) +#define OMNIORBMinorCode_127 OMNIORBMinorCode(127) +#define OMNIORBMinorCode_128 OMNIORBMinorCode(128) +#define OMNIORBMinorCode_129 OMNIORBMinorCode(129) +#define OMNIORBMinorCode_130 OMNIORBMinorCode(130) +#define OMNIORBMinorCode_131 OMNIORBMinorCode(131) #define OMNI_COMMA , #define DeclareValue(name,value) name = value @@ -256,6 +186,7 @@ DECLARE_UNKNOWN_minors(DeclareValue,OMNI_COMMA) }; + // BAD_PARAM #define DECLARE_BAD_PARAM_minors(code,sep) \ \ @@ -289,6 +220,8 @@ code( BAD_PARAM_InvalidComponentId , OMGMinorCode(28) ) sep \ code( BAD_PARAM_InvalidProfileId , OMGMinorCode(29) ) sep \ code( BAD_PARAM_DuplicatePolicyType , OMGMinorCode(30) ) sep \ +code( BAD_PARAM_PollableAlreadyInPollableSet , OMGMinorCode(43) ) sep \ +code( BAD_PARAM_InvalidCompressionLevel , OMGMinorCode(44) ) sep \ code( BAD_PARAM_IndexOutOfRange , OMNIORBMinorCode_21 ) sep \ code( BAD_PARAM_InvalidUnionDiscValue , OMNIORBMinorCode_27 ) sep \ code( BAD_PARAM_InvalidInitialSize , OMNIORBMinorCode_29 ) sep \ @@ -323,13 +256,25 @@ code( BAD_PARAM_SequenceIsTooLong , OMNIORBMinorCode_101 ) sep \ code( BAD_PARAM_WrongUnionMemberSelected , OMNIORBMinorCode_107 ) sep \ code( BAD_PARAM_InvalidFixedPointLimits , OMNIORBMinorCode_109 ) sep \ -code( BAD_PARAM_AttemptToMarshalAbstractValue, OMNIORBMinorCode_115 ) - +code( BAD_PARAM_AttemptToMarshalAbstractValue, OMNIORBMinorCode_115 ) sep \ +code( BAD_PARAM_InvalidPollerType , OMNIORBMinorCode_127 ) sep \ +code( BAD_PARAM_PerThreadTimeoutWithNoCurrent, OMNIORBMinorCode_131 ) enum BAD_PARAM_minor { DECLARE_BAD_PARAM_minors(DeclareValue,OMNI_COMMA) }; + +// NO_MEMORY +#define DECLARE_NO_MEMORY_minors(code,sep) \ +\ +code( NO_MEMORY_BadAlloc, OMNIORBMinorCode_121 ) + +enum NO_MEMORY_minor { + DECLARE_NO_MEMORY_minors(DeclareValue,OMNI_COMMA) +}; + + // IMP_LIMIT #define DECLARE_IMP_LIMIT_minors(code,sep) \ \ @@ -339,6 +284,21 @@ DECLARE_IMP_LIMIT_minors(DeclareValue,OMNI_COMMA) }; + +// COMM_FAILURE +#define DECLARE_COMM_FAILURE_minors(code,sep) \ +\ +code( COMM_FAILURE_MarshalArguments , OMNIORBMinorCode_3 ) sep \ +code( COMM_FAILURE_UnMarshalArguments , OMNIORBMinorCode_4 ) sep \ +code( COMM_FAILURE_MarshalResults , OMNIORBMinorCode_5 ) sep \ +code( COMM_FAILURE_UnMarshalResults , OMNIORBMinorCode_6 ) sep \ +code( COMM_FAILURE_WaitingForReply , OMNIORBMinorCode_7 ) + +enum COMM_FAILURE_minor { + DECLARE_COMM_FAILURE_minors(DeclareValue,OMNI_COMMA) +}; + + // INV_OBJREF #define DECLARE_INV_OBJREF_minors(code,sep) \ \ @@ -349,14 +309,16 @@ code( INV_OBJREF_CorruptedObjRef , OMNIORBMinorCode_54 ) sep \ code( INV_OBJREF_InterfaceMisMatch , OMNIORBMinorCode_55 ) sep \ code( INV_OBJREF_NoPythonTypeForPseudoObj , OMNIORBMinorCode_104 ) sep \ -code( INV_OBJREF_ShortcutServantDeactivated,OMNIORBMinorCode_117 ) - +code( INV_OBJREF_ShortcutServantDeactivated,OMNIORBMinorCode_117 ) sep \ +code( INV_OBJREF_IncorrectReplyHandler , OMNIORBMinorCode_125 ) sep \ +code( INV_OBJREF_InvalidPseudoObject , OMNIORBMinorCode_129 ) sep \ +code( INV_OBJREF_UnsuitableGIOPVersion , OMNIORBMinorCode_130 ) - enum INV_OBJREF_minor { DECLARE_INV_OBJREF_minors(DeclareValue,OMNI_COMMA) }; + // MARSHAL #define DECLARE_MARSHAL_minors(code,sep) \ \ @@ -389,14 +351,48 @@ code( MARSHAL_InvalidChunkedEncoding , OMNIORBMinorCode_111 ) sep \ code( MARSHAL_InvalidValueTag , OMNIORBMinorCode_112 ) sep \ code( MARSHAL_NoRepoIdInValueType , OMNIORBMinorCode_113 ) sep \ -code( MARSHAL_TypeIsNotAValueType , OMNIORBMinorCode_114 ) - - +code( MARSHAL_TypeIsNotAValueType , OMNIORBMinorCode_114 ) sep \ +code( MARSHAL_InvalidCompressedData , OMNIORBMinorCode_128 ) enum MARSHAL_minor { DECLARE_MARSHAL_minors(DeclareValue,OMNI_COMMA) }; + +// INITIALIZE +#define DECLARE_INITIALIZE_minors(code,sep) \ +\ +code( INITIALIZE_TransportError , OMNIORBMinorCode_13 ) sep \ +code( INITIALIZE_InvalidORBInitArgs , OMNIORBMinorCode_30 ) sep \ +code( INITIALIZE_FailedBOAInit , OMNIORBMinorCode_31 ) sep \ +code( INITIALIZE_FailedPOAInit , OMNIORBMinorCode_32 ) sep \ +code( INITIALIZE_FailedORBInit , OMNIORBMinorCode_44 ) sep \ +code( INITIALIZE_FailedLoadLibrary , OMNIORBMinorCode_45 ) sep \ +code( INITIALIZE_ConfigFileError , OMNIORBMinorCode_50 ) sep \ +code( INITIALIZE_NotOmniThread , OMNIORBMinorCode_56 ) sep \ +code( INITIALIZE_CannotOpenLogFile , OMNIORBMinorCode_118 ) sep \ +code( INITIALIZE_EndpointPublishFailure, OMNIORBMinorCode_119 ) + +enum INITIALIZE_minor { + DECLARE_INITIALIZE_minors(DeclareValue,OMNI_COMMA) +}; + + +// NO_IMPLEMENT +#define DECLARE_NO_IMPLEMENT_minors(code,sep) \ +\ +code( NO_IMPLEMENT_NoValueImpl , OMGMinorCode(1) ) sep \ +code( NO_IMPLEMENT_IncompatibleVersion, OMGMinorCode(2) ) sep \ +code( NO_IMPLEMENT_NoUsableProfile , OMGMinorCode(3) ) sep \ +code( NO_IMPLEMENT_DIIOnLocalObject , OMGMinorCode(4) ) sep \ +code( NO_IMPLEMENT_Unsupported , OMNIORBMinorCode_36 ) sep \ +code( NO_IMPLEMENT_NoPythonMethod , OMNIORBMinorCode_99 ) + +enum NO_IMPLEMENT_minor { + DECLARE_NO_IMPLEMENT_minors(DeclareValue,OMNI_COMMA) +}; + + // BAD_TYPECODE #define DECLARE_BAD_TYPECODE_minors(code,sep) \ \ @@ -413,20 +409,18 @@ DECLARE_BAD_TYPECODE_minors(DeclareValue,OMNI_COMMA) }; -// NO_IMPLEMENT -#define DECLARE_NO_IMPLEMENT_minors(code,sep) \ + +// BAD_OPERATION +#define DECLARE_BAD_OPERATION_minors(code,sep) \ \ -code( NO_IMPLEMENT_NoValueImpl , OMGMinorCode(1) ) sep \ -code( NO_IMPLEMENT_IncompatibleVersion, OMGMinorCode(2) ) sep \ -code( NO_IMPLEMENT_NoUsableProfile , OMGMinorCode(3) ) sep \ -code( NO_IMPLEMENT_DIIOnLocalObject , OMGMinorCode(4) ) sep \ -code( NO_IMPLEMENT_Unsupported , OMNIORBMinorCode_36 ) sep \ -code( NO_IMPLEMENT_NoPythonMethod , OMNIORBMinorCode_99 ) +code( BAD_OPERATION_UnRecognisedOperationName, OMNIORBMinorCode_38 ) sep \ +code( BAD_OPERATION_WrongPollerOperation, OMNIORBMinorCode_126 ) -enum NO_IMPLEMENT_minor { - DECLARE_NO_IMPLEMENT_minors(DeclareValue,OMNI_COMMA) +enum BAD_OPERATION_minor { + DECLARE_BAD_OPERATION_minors(DeclareValue,OMNI_COMMA) }; + // NO_RESOURCES #define DECLARE_NO_RESOURCES_minors(code,sep) \ \ @@ -439,6 +433,17 @@ DECLARE_NO_RESOURCES_minors(DeclareValue,OMNI_COMMA) }; + +// NO_RESPONSE +#define DECLARE_NO_RESPONSE_minors(code,sep) \ +\ +code ( NO_RESPONSE_ReplyNotAvailableYet, OMGMinorCode(1) ) + +enum NO_RESPONSE_minor { + DECLARE_NO_RESPONSE_minors(DeclareValue,OMNI_COMMA) +}; + + // BAD_INV_ORDER #define DECLARE_BAD_INV_ORDER_minors(code,sep) \ \ @@ -459,6 +464,7 @@ code( BAD_INV_ORDER_ServiceContextIdAlreadyExists , OMGMinorCode(15) ) sep \ code( BAD_INV_ORDER_PolicyFactoryTypeAlreadyExists, OMGMinorCode(16) ) sep \ code( BAD_INV_ORDER_POACreationDuringDestruction , OMGMinorCode(17) ) sep \ +code( BAD_INV_ORDER_NoPollerResponseYet , OMGMinorCode(22) ) sep \ code( BAD_INV_ORDER_CodeSetNotKnownYet , OMNIORBMinorCode_24 ) sep \ code( BAD_INV_ORDER_ArgumentsNotCalled , OMNIORBMinorCode_65 ) sep \ code( BAD_INV_ORDER_ErrorInDynamicImplementation , OMNIORBMinorCode_66 ) sep \ @@ -470,6 +476,7 @@ DECLARE_BAD_INV_ORDER_minors(DeclareValue,OMNI_COMMA) }; + // TRANSIENT #define DECLARE_TRANSIENT_minors(code,sep) \ \ @@ -490,6 +497,7 @@ DECLARE_TRANSIENT_minors(DeclareValue,OMNI_COMMA) }; + // OBJ_ADAPTER #define DECLARE_OBJ_ADAPTER_minors(code,sep) \ \ @@ -508,6 +516,7 @@ DECLARE_OBJ_ADAPTER_minors(DeclareValue,OMNI_COMMA) }; + // DATA_CONVERSION #define DECLARE_DATA_CONVERSION_minors(code,sep) \ \ @@ -519,19 +528,22 @@ DECLARE_DATA_CONVERSION_minors(DeclareValue,OMNI_COMMA) }; + // OBJECT_NOT_EXIST #define DECLARE_OBJECT_NOT_EXIST_minors(code,sep) \ \ -code( OBJECT_NOT_EXIST_NoMatch , OMGMinorCode(1) ) sep \ -code( OBJECT_NOT_EXIST_IncarnateFailed , OMGMinorCode(2) ) sep \ -code( OBJECT_NOT_EXIST_BOANotInitialised , OMNIORBMinorCode_34 ) sep \ -code( OBJECT_NOT_EXIST_POANotInitialised , OMNIORBMinorCode_58 ) sep \ -code( OBJECT_NOT_EXIST_DynAnyDestroyed , OMNIORBMinorCode_102 ) +code( OBJECT_NOT_EXIST_NoMatch , OMGMinorCode(1) ) sep \ +code( OBJECT_NOT_EXIST_IncarnateFailed , OMGMinorCode(2) ) sep \ +code( OBJECT_NOT_EXIST_PollerAlreadyDeliveredReply, OMGMinorCode(5) ) sep \ +code( OBJECT_NOT_EXIST_BOANotInitialised , OMNIORBMinorCode_34 ) sep \ +code( OBJECT_NOT_EXIST_POANotInitialised , OMNIORBMinorCode_58 ) sep \ +code( OBJECT_NOT_EXIST_DynAnyDestroyed , OMNIORBMinorCode_102 ) enum OBJECT_NOT_EXIST_minor { DECLARE_OBJECT_NOT_EXIST_minors(DeclareValue,OMNI_COMMA) }; + // INV_POLICY #define DECLARE_INV_POLICY_minors(code,sep) \ \ @@ -544,29 +556,6 @@ }; -// BAD_OPERATION -#define DECLARE_BAD_OPERATION_minors(code,sep) \ -\ -code( BAD_OPERATION_UnRecognisedOperationName, OMNIORBMinorCode_38 ) - -enum BAD_OPERATION_minor { - DECLARE_BAD_OPERATION_minors(DeclareValue,OMNI_COMMA) -}; - - -// COMM_FAILURE -#define DECLARE_COMM_FAILURE_minors(code,sep) \ -\ -code( COMM_FAILURE_MarshalArguments , OMNIORBMinorCode_3 ) sep \ -code( COMM_FAILURE_UnMarshalArguments , OMNIORBMinorCode_4 ) sep \ -code( COMM_FAILURE_MarshalResults , OMNIORBMinorCode_5 ) sep \ -code( COMM_FAILURE_UnMarshalResults , OMNIORBMinorCode_6 ) sep \ -code( COMM_FAILURE_WaitingForReply , OMNIORBMinorCode_7 ) - -enum COMM_FAILURE_minor { - DECLARE_COMM_FAILURE_minors(DeclareValue,OMNI_COMMA) -}; - // INTF_REPOS #define DECLARE_INTF_REPOS_minors(code,sep) \ \ @@ -577,24 +566,6 @@ DECLARE_INTF_REPOS_minors(DeclareValue,OMNI_COMMA) }; -// INITIALIZE -#define DECLARE_INITIALIZE_minors(code,sep) \ -\ -code( INITIALIZE_TransportError , OMNIORBMinorCode_13 ) sep \ -code( INITIALIZE_InvalidORBInitArgs , OMNIORBMinorCode_30 ) sep \ -code( INITIALIZE_FailedBOAInit , OMNIORBMinorCode_31 ) sep \ -code( INITIALIZE_FailedPOAInit , OMNIORBMinorCode_32 ) sep \ -code( INITIALIZE_FailedORBInit , OMNIORBMinorCode_44 ) sep \ -code( INITIALIZE_FailedLoadLibrary , OMNIORBMinorCode_45 ) sep \ -code( INITIALIZE_ConfigFileError , OMNIORBMinorCode_50 ) sep \ -code( INITIALIZE_NotOmniThread , OMNIORBMinorCode_56 ) sep \ -code( INITIALIZE_CannotOpenLogFile , OMNIORBMinorCode_118 ) sep \ -code( INITIALIZE_EndpointPublishFailure, OMNIORBMinorCode_119 ) - - -enum INITIALIZE_minor { - DECLARE_INITIALIZE_minors(DeclareValue,OMNI_COMMA) -}; // BAD_CONTEXT #define DECLARE_BAD_CONTEXT_minors(code,sep) \ @@ -608,13 +579,17 @@ }; -// NO_MEMORY -#define DECLARE_NO_MEMORY_minors(code,sep) \ -\ -code( NO_MEMORY_BadAlloc, OMNIORBMinorCode_121 ) +// TIMEOUT +// Note that TIMEOUT_CallTimedOutOnClient is the same code as +// TRANSIENT_CallTimedout +#define DECLARE_TIMEOUT_minors(code,sep) \ +\ +code( TIMEOUT_NoPollerResponseInTime, OMGMinorCode(1) ) sep \ +code( TIMEOUT_CallTimedOutOnClient , OMNIORBMinorCode_8 ) sep \ +code( TIMEOUT_CallTimedOutOnServer , OMNIORBMinorCode_124 ) -enum NO_MEMORY_minor { - DECLARE_NO_MEMORY_minors(DeclareValue,OMNI_COMMA) +enum TIMEOUT_minor { + DECLARE_TIMEOUT_minors(DeclareValue,OMNI_COMMA) }; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/objTracker.h omniorb-dfsg-4.2.2/include/omniORB4/objTracker.h --- omniorb-dfsg-4.1.6/include/omniORB4/objTracker.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/objTracker.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniAsyncInvoker.h omniorb-dfsg-4.2.2/include/omniORB4/omniAsyncInvoker.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniAsyncInvoker.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniAsyncInvoker.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,66 +1,31 @@ // -*- Mode: C++; -*- // Package : omniORB // omniAsyncInvoker.h Created on: 20 Dec 2000 -// Author : Sai Lai Lo (sll) +// Authors : Duncan Grisby +// Sai Lai Lo // -// Copyright (C) 2006 Apasphere Ltd +// Copyright (C) 2006-2013 Apasphere Ltd // Copyright (C) 2000 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.2 2006/07/02 22:52:05 dgrisby - Store self thread in task objects to avoid calls to self(), speeding - up Current. Other minor performance tweaks. - - Revision 1.1.4.1 2003/03/23 21:04:15 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.3 2002/11/08 17:31:51 dgrisby - Another AIX patch. - - Revision 1.1.2.2 2002/11/06 11:58:28 dgrisby - Partial AIX patches. - - Revision 1.1.2.1 2002/01/09 11:35:21 dpg1 - Remove separate omniAsyncInvoker library to save library overhead. - - Revision 1.1.4.3 2001/08/01 10:03:39 dpg1 - AyncInvoker no longer maintains its own dedicated thread queue. - Derived classes must provide the implementation. - - Revision 1.1.4.2 2001/06/13 20:06:17 sll - Minor fix to make the ORB compile with MSVC++. - - Revision 1.1.4.1 2001/04/19 09:47:54 sll - New library omniAsyncInvoker. - - Revision 1.1.2.1 2001/02/23 16:47:09 sll - Added new files. - -*/ - #ifndef __OMNIASYNCINVOKER_H__ #define __OMNIASYNCINVOKER_H__ @@ -79,10 +44,11 @@ // Notice that the call to the execute() method is always done by // another thread, hence giving the invoker its asynchronous nature. // -// Depend on the category of an omniTask, the invoker will choose a -// thread to execute the task in one of the following ways: +// Depending on the category of an omniTask, the invoker will +// choose a thread to execute the task in one of the following +// ways: // -// Anytime: the task will be executed by one of the threads in the +// AnyTime: the task will be executed by one of the threads in the // pool. If no thread is available, the task may be queued // indefinitely until a thread is available // @@ -110,59 +76,88 @@ // about it. If the task object is heap allocated, it has to be garbage // collected by some external means. The simplist approach is to delete // the task object before the execute() method returns. -// -// Once inserted, a task may be cancelled by calling the cancel() method. -// However, this call only has an effect if the task is still sitting in a -// queue waiting for its turn to be executed. +class omniAsyncPool; +class omniAsyncDedicated; class omniAsyncWorker; /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// + class omniTaskLink { public: omniTaskLink* next; omniTaskLink* prev; - omniTaskLink() { next = prev = this; } - - void enq(omniTaskLink& head); - void deq(); - static unsigned int is_empty(omniTaskLink& head); + inline omniTaskLink() + { + next = prev = this; + } + + inline void enq(omniTaskLink& head) + { + next = head.prev->next; + head.prev->next = this; + prev = head.prev; + head.prev = this; + } + + inline void deq() + { + prev->next = next; + next->prev = prev; + } + + static inline unsigned int is_empty(omniTaskLink& head) + { + return (head.next == &head); + } private: omniTaskLink(const omniTaskLink&); omniTaskLink& operator=(const omniTaskLink&); }; + /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// + class omniTask : public omniTaskLink { public: - enum Category { AnyTime, - ImmediateDispatch, - DedicatedThread + // What sort of task dispatch? + enum Category { AnyTime, // Run whenever a thread is free + ImmediateDispatch, // Run immediately + DedicatedThread // Use the dedicated thread + }; + + // What is this task doing? + enum Purpose { General, // General task + ServerUpcall, // Server-side upcall into application code + ClientInvocation // Client-side operation invocation }; virtual void execute() = 0; - inline omniTask(Category cat = AnyTime) - : pd_category(cat), pd_selfThread(0) {} + inline omniTask(Category cat = AnyTime, Purpose pur = General) + : pd_category(cat), pd_purpose(pur), pd_self(0) {} virtual ~omniTask() {} - inline Category category() { return pd_category; } - inline void category(Category c) { pd_category = c; } + inline Category category() { return pd_category; } + inline void category(Category c) { pd_category = c; } + inline Purpose purpose() { return pd_purpose; } + inline void purpose(Purpose p) { pd_purpose = p; } - inline omni_thread* selfThread() { return pd_selfThread; } + inline omni_thread* selfThread() { return pd_self; } // The worker thread assigned to handle the task. Set by the worker. private: Category pd_category; - omni_thread* pd_selfThread; + Purpose pd_purpose; + omni_thread* pd_self; omniTask(const omniTask&); omniTask& operator=(const omniTask&); @@ -175,71 +170,79 @@ class omniAsyncInvoker { public: - omniAsyncInvoker(unsigned int max=10000); - // specifies the maximum number of threads the object should - // spawn to perform tasks in the Anytime category. + omniAsyncInvoker(); + // Constructor. virtual ~omniAsyncInvoker(); // Returns only when all the threads doing Anytime tasks have exited. - // Notice that any tasks still sitting on the pending queue will be + // Notice that any tasks still sitting on the pending queues will be // discarded quietly. - int insert(omniTask*); - // insert the task into the pending queue. The task will be - // dispatched according to its category. If the task is a - // DedicatedThread task, call insert_dedicated() to deal with it. + CORBA::Boolean insert(omniTask*); + // insert the task into the correct pending queue. The task will be + // dispatched according to its category. // - // returns 0 if the task cannot be inserted. // returns 1 if the task has been inserted successfully. + // returns 0 if the task cannot be inserted. - int cancel(omniTask*); - // Cancel a task on the pending queue. If the task is a - // DedicatedThread task, call cancel_dedicated() to deal with it. - // - // returns 0 if the task is not found in the pending queue - // returns 1 if the task is successfully removed from the pending queue. - - virtual int work_pending(); + CORBA::Boolean work_pending(); // Return 1 if there are DedicatedThread tasks pending, 0 if none. - // Default implementation always returns 0. - virtual void perform(unsigned long secs = 0, unsigned long nanosecs = 0); + void perform(unsigned long secs = 0, unsigned long nanosecs = 0); // Loop performing dedicated thread tasks. If a timeout is - // specified, must return when the absolute time passes. - // Implementations may return in other circumstances. - // - // Default implementation aborts! Don't call this unless you have - // overriden it. + // specified, returns when the absolute time passes; otherwise, + // blocks until shut down. + + void shutdown(); + // Release threads blocked in perform. - friend class omniAsyncWorker; static _core_attr unsigned int idle_timeout; - // No. of seconds before an idle thread - // has to wait before it exits. - // default is 10 seconds. -protected: - - virtual int insert_dedicated(omniTask*); - // Override this in derived classes to support DedicatedThread - // tasks. Default version always returns 0. - - virtual int cancel_dedicated(omniTask*); - // Override this in derived classes to support DedicatedThread - // tasks. Default version always returns 0. + // No. of seconds an idle thread waits before it exits. default is + // 10 seconds. private: - unsigned int pd_keep_working;// 0 means all threads should exit. - omni_tracedmutex* pd_lock; - omni_tracedcondition* pd_cond; // signal this conditional when all - // the threads serving Anytime tasks - // are exiting. - omniTaskLink pd_anytime_tq; // Anytime tasks - omniAsyncWorker* pd_idle_threads;// idle threads ready for Anytime tasks - unsigned int pd_nthreads; // No. of threads serving Anytime tasks - unsigned int pd_maxthreads; // Max. no. of threads serving Anytime - // tasks - unsigned int pd_totalthreads;// total no. of threads. + omniAsyncWorker* getWorker(omniAsyncPool* pool); + + inline unsigned int workerStart() + { + omni_tracedmutex_lock l(pd_lock); + return ++pd_total_threads; + } + + inline unsigned int workerStartLocked() + { + ASSERT_OMNI_TRACEDMUTEX_HELD(pd_lock, 1); + return ++pd_total_threads; + } + + inline unsigned int workerStop() + { + omni_tracedmutex_lock l(pd_lock); + + if (--pd_total_threads == 0) + pd_idle_cond.broadcast(); + + return pd_total_threads; + } + + omni_tracedmutex pd_lock; + omni_tracedcondition pd_idle_cond; + unsigned int pd_total_threads; // Total number of threads. + omniAsyncWorker* pd_idle_threads; + + omniAsyncPool* pd_general; // General threads/tasks + omniAsyncPool* pd_server; // Server threads/tasks + omniAsyncPool* pd_client; // Client threads/tasks + omniAsyncDedicated* pd_dedicated; // Dedicated tasks + + CORBA::Boolean pd_keep_working; + + + friend class omniAsyncWorker; + friend class omniAsyncPool; + friend class omniAsyncDedicated; }; #endif // __OMNIASYNCINVOKER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniConnectionMgmt.h omniorb-dfsg-4.2.2/include/omniORB4/omniConnectionMgmt.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniConnectionMgmt.h 2006-07-26 17:40:32.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniConnectionMgmt.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // Description: // Proprietary omniORB connection management API diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniInterceptors.h omniorb-dfsg-4.2.2/include/omniORB4/omniInterceptors.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniInterceptors.h 2011-06-01 23:11:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniInterceptors.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,73 +3,29 @@ // omniInterceptors.h Created on: 22/09/2000 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2006-2011 Apasphere Ltd +// Copyright (C) 2006-2013 Apasphere Ltd // Copyright (C) 2000 AT&T Laboratories, Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.3 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.4.2 2006/06/05 11:28:04 dgrisby - Change clientSendRequest interceptor members to a single GIOP_C. - - Revision 1.1.4.1 2003/03/23 21:04:14 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.9 2002/11/26 16:54:13 dgrisby - Fix exception interception. - - Revision 1.1.2.8 2002/11/26 14:50:43 dgrisby - Implement missing interceptors. - - Revision 1.1.2.7 2002/09/10 23:17:10 dgrisby - Thread interceptors. - - Revision 1.1.2.6 2002/08/16 16:03:30 dgrisby - Interceptor tweaks. - - Revision 1.1.2.5 2002/03/27 11:44:51 dpg1 - Check in interceptors things left over from last week. - - Revision 1.1.2.4 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.2.3 2001/04/18 17:50:44 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.1.2.2 2000/11/15 17:05:39 sll - Added interceptors along the giop request processing path. - - Revision 1.1.2.1 2000/09/27 16:54:08 sll - *** empty log message *** - -*/ - #ifndef __OMNIINTERCEPTORS_H__ #define __OMNIINTERCEPTORS_H__ @@ -79,10 +35,12 @@ class omniLocalIdentity; class omniCallDescriptor; +class omniServant; OMNI_NAMESPACE_BEGIN(omni) class omniInterceptorP; +class giopRope; class giopStrand; class GIOP_S; class GIOP_C; @@ -157,6 +115,13 @@ info_T(GIOP_C& c) : giop_c(c), reject(0), why(0) {} + // Accessors for connection details + const char* operation(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -182,6 +147,13 @@ info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {} + // Accessors for operation / connection details + const char* operation(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -207,6 +179,13 @@ info_T(GIOP_C& c, IOP::ServiceContextList& sc) : giop_c(c), service_contexts(sc) {} + // Accessors for operation / connection details + const char* operation(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -233,6 +212,12 @@ info_T(giopStrand& s) : strand(s), reject(0), why(0) {} + // Accessors for connection details + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -257,6 +242,13 @@ info_T(GIOP_S& s) : giop_s(s) {} + // Accessors for operation / connection details + const char* operation(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -281,6 +273,13 @@ info_T(GIOP_S& s) : giop_s(s) {} + // Accessors for operation / connection details + const char* operation(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -305,6 +304,14 @@ info_T(GIOP_S& s, const CORBA::Exception* e) : giop_s(s), exception(e) {} + + // Accessors for operation / connection details + const char* operation(); + const char* myaddress(); + const char* peeraddress(); + const char* peeridentity(); + void* peerdetails(); + private: info_T(); info_T(const info_T&); @@ -319,6 +326,27 @@ ////////////////////////////////////////////////////////////////// + class createRope_T { + public: + + class info_T { + public: + const giopAddressList& addrlist; + omniIOR::IORInfo* ior_info; + giopRope*& rope; + + info_T(const giopAddressList& a, omniIOR::IORInfo* i, giopRope*& r) : + addrlist(a), ior_info(i), rope(r) {} + }; + + typedef CORBA::Boolean (*interceptFunc)(info_T& info); + + void add(interceptFunc); + void remove(interceptFunc); + }; + + + ////////////////////////////////////////////////////////////////// class createIdentity_T { public: @@ -386,6 +414,7 @@ class info_T { public: virtual void run() = 0; + virtual omni_thread* self() = 0; }; typedef void (*interceptFunc)(info_T& info); @@ -402,6 +431,23 @@ class info_T { public: virtual void run() = 0; + virtual omni_thread* self() = 0; + }; + + typedef void (*interceptFunc)(info_T& info); + + void add(interceptFunc); + void remove(interceptFunc); + }; + + ////////////////////////////////////////////////////////////////// + class assignAMIThread_T { + public: + + class info_T { + public: + virtual void run() = 0; + virtual omni_thread* self() = 0; }; typedef void (*interceptFunc)(info_T& info); @@ -410,6 +456,15 @@ void remove(interceptFunc); }; + ////////////////////////////////////////////////////////////////// + class invokeLocalCall_T { + public: + typedef void (*interceptFunc)(omniCallDescriptor*, omniServant*); + + void add(interceptFunc); + void remove(interceptFunc); + }; + ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// @@ -422,11 +477,14 @@ serverReceiveRequest_T serverReceiveRequest; serverSendReply_T serverSendReply; serverSendException_T serverSendException; + createRope_T createRope; createIdentity_T createIdentity; createORBServer_T createORBServer; createPolicy_T createPolicy; createThread_T createThread; assignUpcallThread_T assignUpcallThread; + assignAMIThread_T assignAMIThread; + invokeLocalCall_T invokeLocalCall; ////////////////////////////////////////////////////////////////// friend class omni_interceptor_initialiser; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniInternal.h omniorb-dfsg-4.2.2/include/omniORB4/omniInternal.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniInternal.h 2010-01-26 22:25:43.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniInternal.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,221 +3,29 @@ // omniInternal.h Created on: 6/2/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2006 Apasphere Ltd +// Copyright (C) 2003-2009 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.5.2.10 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.5.2.9 2006/04/09 19:52:31 dgrisby - More IPv6, endPointPublish parameter. - - Revision 1.5.2.8 2006/02/22 14:56:37 dgrisby - New endPointPublishHostname and endPointResolveNames parameters. - - Revision 1.5.2.7 2005/12/08 14:22:31 dgrisby - Better string marshalling performance; other minor optimisations. - - Revision 1.5.2.6 2005/11/17 17:03:27 dgrisby - Merge from omni4_0_develop. - - Revision 1.5.2.5 2005/01/06 23:08:10 dgrisby - Big merge from omni4_0_develop. - - Revision 1.5.2.4 2005/01/06 17:31:06 dgrisby - Changes (mainly from omni4_0_develop) to compile on gcc 3.4. - - Revision 1.5.2.3 2004/07/04 23:53:35 dgrisby - More ValueType TypeCode and Any support. - - Revision 1.5.2.2 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - - Revision 1.5.2.1 2003/03/23 21:04:14 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.15 2003/02/17 02:03:07 dgrisby - vxWorks port. (Thanks Michael Sturm / Acterna Eningen GmbH). - - Revision 1.2.2.14 2002/02/13 16:04:01 dpg1 - Rearrange includes so omnithread sees system dependencies. - - Revision 1.2.2.13 2001/09/24 14:26:01 dpg1 - Safer static translation unit counts for omnithread and final clean-up. - - Revision 1.2.2.12 2001/09/19 17:26:43 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.2.2.11 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.2.2.10 2001/08/01 10:08:19 dpg1 - Main thread policy. - - Revision 1.2.2.9 2001/05/31 16:18:11 dpg1 - inline string matching functions, re-ordered string matching in - _ptrToInterface/_ptrToObjRef - - Revision 1.2.2.8 2001/05/29 17:03:48 dpg1 - In process identity. - - Revision 1.2.2.7 2001/05/10 15:08:37 dpg1 - _compatibleServant() replaced with _localServantTarget(). - createIdentity() now takes a target string. - djr's fix to deactivateObject(). - - Revision 1.2.2.6 2001/04/18 17:50:44 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.5 2000/11/15 17:03:38 sll - Added include codeSets.h. - - Revision 1.2.2.4 2000/11/03 18:58:47 sll - Unbounded sequence of octet got a new type name. - - Revision 1.2.2.3 2000/10/27 15:42:03 dpg1 - Initial code set conversion support. Not yet enabled or fully tested. - - Revision 1.2.2.2 2000/09/27 17:21:02 sll - Updated to use the new cdrStream abstraction. - Replace include/omniORB3 with include/omniORB4. - Changed the signatures of the createObjRef() functions to accept the - omniIOR* argument. - Removed the obsoluted omniRopeAndKey. - - Revision 1.2.2.1 2000/07/17 10:35:35 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.10 2000/06/27 16:15:08 sll - New classes: _CORBA_String_element, _CORBA_ObjRef_Element, - _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a - sequence of string and a sequence of object reference. - - Revision 1.1.2.9 2000/04/27 10:36:48 dpg1 - Interoperable Naming Service - - stringToObject() and objectToString() moved to omniURI.h. - - Revision 1.1.2.8 2000/02/22 12:25:37 dpg1 - A few things made `publicly' accessible so omniORBpy can get its hands - on them. - - Revision 1.1.2.7 2000/02/08 13:25:23 djr - Added a couple of missing _core_attr. - - Revision 1.1.2.6 2000/01/27 16:31:32 djr - String_member now initialised to empty string by default. - - Revision 1.1.2.5 2000/01/20 11:51:33 djr - (Most) Pseudo objects now used omni::poRcLock for ref counting. - New assertion check OMNI_USER_CHECK. - - Revision 1.1.2.4 1999/10/29 13:18:09 djr - Changes to ensure mutexes are constructed when accessed. - - Revision 1.1.2.3 1999/10/27 17:32:09 djr - omni::internalLock and objref_rc_lock are now pointers. - - Revision 1.1.2.2 1999/09/24 15:01:27 djr - Added module initialisers, and sll's new scavenger implementation. - - Revision 1.1.2.1 1999/09/24 09:51:45 djr - Moved from omniORB2 + some new files. - - Revision 1.27 1999/06/26 17:55:41 sll - Added string.h for all platforms by default. - - Revision 1.26 1999/06/18 21:15:17 sll - Updated copyright notice. - - Revision 1.25 1999/06/18 20:36:31 sll - Replaced _LC_attr with _core_attr. - - Revision 1.24 1999/04/01 15:52:23 djr - Updated version number to 2.8. - Move an _LC_attr to the correct position in a declaration. - - Revision 1.23 1999/01/07 18:36:13 djr - Changes to support split of omniORB library in two. - - Revision 1.22 1998/10/08 13:07:24 sll - OpenVMS needs string.h (POSIX or System V) instead of strings.h (BSD). - - Revision 1.21 1998/08/21 19:27:08 sll - New omniObject member noExistentCheck. - - Revision 1.20 1998/08/05 18:11:09 sll - Updated version variable to omniORB_2_6 (previously omniORB_2_5). - - Revision 1.19 1998/04/07 19:53:38 sll - Replace _OMNIORB2_NTDLL_ on the whole class omni with - _OMNIORB_NTDLL_IMPORT on individual constants and variables. - - Revision 1.18 1998/02/27 14:00:17 sll - Changed manager() to _objectManager() in class omniObject to avoid - potential name clash with application code. - - * Revision 1.17 1998/01/27 16:06:45 ewc - * Added support necessary for TypeCode and Any - * - * Revision 1.16 1998/01/20 16:46:18 sll - * Removed obsolute variable omni::traceLevel. - * - Revision 1.15 1997/12/15 15:26:32 sll - Added the missing dllimport/dllexport for WIN32. - - Revision 1.14 1997/12/12 19:59:19 sll - Added version variable omniORB_x_y. - - Revision 1.13 1997/12/10 11:52:31 sll - *** empty log message *** - - Revision 1.12 1997/12/09 20:45:54 sll - Added support for system exception handlers. - Added support for late bindings. - - * Revision 1.11 1997/09/20 16:23:53 dpg1 - * Added second argument, is_cxx_type to _widenFromTheMostDerivedIntf(). - * Added a new hash table of wrapped objects, and a mutex for it, for - * LifeCycle support. - * - Revision 1.10 1997/08/26 15:25:26 sll - Removed initFile.h include. - - Revision 1.9 1997/05/06 16:09:13 sll - Public release. - - */ - #ifndef __OMNIINTERNAL_H__ #define __OMNIINTERNAL_H__ @@ -271,8 +79,8 @@ // the variable name stays the same with compatible shared library, e.g. // 2.5.1. // -extern _core_attr const char* omniORB_4_1; -extern _dyn_attr const char* omniORB_4_1_dyn; +extern _core_attr const char* omniORB_4_2; +extern _dyn_attr const char* omniORB_4_2_dyn; extern _core_attr const _CORBA_ULong omniORB_TAG_ORB_TYPE; // ATT\x00 class Strand; @@ -290,16 +98,7 @@ _CORBA_MODULE_BEG - -#if SIZEOF_PTR == SIZEOF_LONG - typedef unsigned long ptr_arith_t; -#elif SIZEOF_PTR == SIZEOF_INT - typedef unsigned int ptr_arith_t; -#elif defined (_WIN64) - typedef size_t ptr_arith_t; -#else -#error "No suitable type to do pointer arithmetic" -#endif + typedef omni_ptr_arith_t ptr_arith_t; enum alignment_t { ALIGN_1 = 1, ALIGN_2 = 2, ALIGN_4 = 4, ALIGN_8 = 8 }; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniIOR.h omniorb-dfsg-4.2.2/include/omniORB4/omniIOR.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniIOR.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniIOR.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,93 +3,29 @@ // omniIOR.h Created on: 11/8/99 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2007 Apasphere Ltd +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 1999-2000 AT&T Laboratories, Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.4 2007/11/28 12:24:26 dgrisby - Implement a tiny subset of CSIv2 to permit multiple SSL endpoints in IORs. - - Revision 1.1.4.3 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.1.4.2 2005/01/06 23:08:09 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:04:14 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.13 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.12 2002/09/08 21:12:38 dgrisby - Properly handle IORs with no usable profiles. - - Revision 1.1.2.11 2002/01/02 18:13:43 dpg1 - Platform fixes/additions. - - Revision 1.1.2.10 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.1.2.9 2001/08/06 15:49:17 sll - Added IOP component TAG_OMNIORB_UNIX_TRANS for omniORB specific local - transport using the unix domain socket. - - Revision 1.1.2.8 2001/07/31 16:10:38 sll - Added GIOP BiDir support. - - Revision 1.1.2.7 2001/06/13 20:07:25 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.2.6 2001/06/11 17:53:23 sll - The omniIOR ctor used by genior and corbaloc now has the option to - select whether to call interceptors and what set of interceptors to call. - - Revision 1.1.2.5 2001/05/09 17:00:27 sll - addr_selected_profile_index() now returns signed long. - - Revision 1.1.2.4 2001/04/18 17:50:44 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.1.2.3 2000/11/15 17:06:49 sll - Added tcs_c and tcs_w in omniIOR to record what code set convertor to use - for this IOR. - Added declarations for handlers of the tagged components used by the ORB. - - Revision 1.1.2.2 2000/10/03 17:37:07 sll - Changed omniIOR synchronisation mutex from omni::internalLock to its own - mutex. - - Revision 1.1.2.1 2000/09/27 16:54:08 sll - *** empty log message *** - -*/ - #ifndef __OMNIIOR_H__ #define __OMNIIOR_H__ @@ -97,6 +33,7 @@ OMNI_NAMESPACE_BEGIN(omni) class Rope; +class IORPublish; OMNI_NAMESPACE_END(omni) class omniIORHints { @@ -200,7 +137,12 @@ void TCS_W(_OMNI_NS(omniCodeSet::TCS_W)* tcs_w) { pd_tcs_w = tcs_w; } // Extra info list - IORExtraInfoList& extraInfo() { return pd_extra_info; } + IORExtraInfoList& extraInfo() { return pd_extra_info; } + const IORExtraInfoList& extraInfo() const { return pd_extra_info; } + + // Flags (defined in giopStrandFlags.h) + inline _CORBA_ULong flags() const { return pd_flags; } + inline void flags(_CORBA_ULong flags) { pd_flags = flags; } IORInfo(); ~IORInfo(); @@ -212,6 +154,7 @@ _OMNI_NS(omniCodeSet::TCS_C)* pd_tcs_c; _OMNI_NS(omniCodeSet::TCS_W)* pd_tcs_w; IORExtraInfoList pd_extra_info; + _CORBA_ULong pd_flags; }; public: @@ -284,57 +227,48 @@ // Handlers for each of the tagged component used by the ORB static void unmarshal_TAG_ORB_TYPE(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_ORB_TYPE(const IOP::TaggedComponent&); //// static void unmarshal_TAG_CODE_SETS(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_CODE_SETS(const IOP::TaggedComponent&); static void add_TAG_CODE_SETS(const _OMNI_NS(CONV_FRAME::CodeSetComponentInfo)&); //// static void unmarshal_TAG_ALTERNATE_IIOP_ADDRESS(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_ALTERNATE_IIOP_ADDRESS(const IOP::TaggedComponent&); - static void add_TAG_ALTERNATE_IIOP_ADDRESS(const IIOP::Address&); - - //// - static void unmarshal_TAG_GROUP(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_GROUP(const IOP::TaggedComponent&); + static void add_TAG_ALTERNATE_IIOP_ADDRESS(const IIOP::Address&, + _OMNI_NS(IORPublish)* eps); //// static void unmarshal_TAG_SSL_SEC_TRANS(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_SSL_SEC_TRANS(const IOP::TaggedComponent&); static void add_TAG_SSL_SEC_TRANS(const IIOP::Address&, - _CORBA_UShort supports, - _CORBA_UShort requires); + _CORBA_UShort supports, + _CORBA_UShort requires, + _OMNI_NS(IORPublish)* eps); //// static void unmarshal_TAG_CSI_SEC_MECH_LIST(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_CSI_SEC_MECH_LIST(const IOP::TaggedComponent&); - //// static void unmarshal_TAG_OMNIORB_BIDIR(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_OMNIORB_BIDIR(const IOP::TaggedComponent&); static void add_TAG_OMNIORB_BIDIR(const char* sendfrom, omniIOR&); //// static void unmarshal_TAG_OMNIORB_UNIX_TRANS(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_OMNIORB_UNIX_TRANS(const IOP::TaggedComponent&); - static void add_TAG_OMNIORB_UNIX_TRANS(const char* filename); + static void add_TAG_OMNIORB_UNIX_TRANS(const char* filename, + _OMNI_NS(IORPublish)* eps); //// static void unmarshal_TAG_OMNIORB_PERSISTENT_ID(const IOP::TaggedComponent&, omniIOR&); - static char* dump_TAG_OMNIORB_PERSISTENT_ID(const IOP::TaggedComponent&); //// - static void add_IIOP_ADDRESS(const IIOP::Address&); + static void add_IIOP_ADDRESS(const IIOP::Address&, + _OMNI_NS(IORPublish)* eps); // Add this address to the IIOP profile. private: @@ -345,7 +279,7 @@ GIOP::AddressingDisposition pd_addr_mode; IORInfo* pd_iorInfo; int pd_refCount; - // Protected by + // Protected by omniIOR(); omniIOR(const omniIOR&); diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniObjKey.h omniorb-dfsg-4.2.2/include/omniORB4/omniObjKey.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniObjKey.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniObjKey.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,44 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Representation of an object key. // -/* - $Log$ - Revision 1.2.2.3 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.2.2.2 2000/09/27 17:11:40 sll - Removed reference to the obsoluted MemBufferedStream and NetBufferedStream. - - Revision 1.2.2.1 2000/07/17 10:35:35 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:47 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNIOBJKEY_H__ #define __OMNIOBJKEY_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniObjRef.h omniorb-dfsg-4.2.2/include/omniORB4/omniObjRef.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniObjRef.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniObjRef.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,108 +3,29 @@ // omniObjRef.h Created on: 22/2/99 // Author : David Riddoch (djr) // -// Copyright (C) 2002-2006 Apasphere Ltd +// Copyright (C) 2002-2011 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Base class for object references. // -/* - $Log$ - Revision 1.4.2.3 2006/07/18 16:21:24 dgrisby - New experimental connection management extension; ORB core support - for it. - - Revision 1.4.2.2 2005/11/09 12:22:18 dgrisby - Local interfaces support. - - Revision 1.4.2.1 2003/03/23 21:04:12 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.12 2002/10/14 20:06:06 dgrisby - Per objref / per thread timeouts. - - Revision 1.2.2.11 2001/11/12 13:46:07 dpg1 - _unchecked_narrow, improved _narrow. - - Revision 1.2.2.10 2001/11/08 16:33:49 dpg1 - Local servant POA shortcut policy. - - Revision 1.2.2.9 2001/09/19 17:26:43 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.2.2.8 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.2.2.7 2001/05/31 16:21:13 dpg1 - object references optionally just store a pointer to their repository - id string rather than copying it. - - Revision 1.2.2.6 2001/05/10 15:08:37 dpg1 - _compatibleServant() replaced with _localServantTarget(). - createIdentity() now takes a target string. - djr's fix to deactivateObject(). - - Revision 1.2.2.5 2001/04/18 17:50:43 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.4 2000/11/07 18:44:03 sll - Renamed omniObjRef::_hash and _is_equivalent to __hash and __is_equivalent - to avoid name clash with the member functions of CORBA::Object. - - Revision 1.2.2.3 2000/10/03 17:37:07 sll - Changed omniIOR synchronisation mutex from omni::internalLock to its own - mutex. - - Revision 1.2.2.2 2000/09/27 17:16:20 sll - Replaced data member pd_iopProfiles with pd_ior which contains decoded - members of the IOR. - Removed _getRopeAndKey(), _getTheKey() and _iopProfiles(). - Added new functions _getIOR(), _marshal(), _unMarshal(), _toString, - _fromString(), _hash(), _is_equivalent(). - - Revision 1.2.2.1 2000/07/17 10:35:35 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.4 2000/03/01 17:57:42 dpg1 - New omniObjRef::_compatibleServant() function to support object - references and servants written for languages other than C++. - - Revision 1.1.2.3 2000/02/22 12:25:38 dpg1 - A few things made `publicly' accessible so omniORBpy can get its hands - on them. - - Revision 1.1.2.2 1999/10/27 17:32:09 djr - omni::internalLock and objref_rc_lock are now pointers. - - Revision 1.1.2.1 1999/09/24 09:51:48 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNIOBJREF_H__ #define __OMNIOBJREF_H__ @@ -116,6 +37,7 @@ class omniIOR; class omniCallDescriptor; +class omniAsyncCallDescriptor; class omniIdentity; class omniLocalIdentity; class omniObjTableEntry; @@ -200,55 +122,80 @@ // not. May throw other system exceptions. // This function is thread-safe. - void* _transientExceptionHandler(void*& cookie); + void* _transientExceptionHandler(void*& cookie, _CORBA_Boolean& ext); // If a transientExceptionHandler_t has been installed for this object // by _transientExceptionHandler(void*,void*), returns this handler and its // associated opaque argument in cookie. // Otherwise return 0. // This function is thread-safe. - void _transientExceptionHandler(void* new_handler, void* cookie); + void _transientExceptionHandler(void* new_handler, void* cookie, + _CORBA_Boolean ext); // Set the transientExceptionHandler_t of this object. By default, // i.e. when this function is not called for an object, the global - // transientExceptionHandler_t will be invoked when a CORBA::TRANSIENT - // exception is caught in a remote call from a proxy object. - // The argument is an opaque argument that will be passed - // to the exception handler. + // transientExceptionHandler_t will be invoked when a + // CORBA::TRANSIENT exception is caught in a remote call from a + // proxy object. The argument is an opaque argument that + // will be passed to the exception handler. ext is true if the + // handler has extended parameters. + // This function is thread-safe. + + void* _timeoutExceptionHandler(void*& cookie, _CORBA_Boolean& ext); + // If a timeoutExceptionHandler_t has been installed for this object + // by _timeoutExceptionHandler(void*,void*), returns this handler and its + // associated opaque argument in cookie. + // Otherwise return 0. + // This function is thread-safe. + + void _timeoutExceptionHandler(void* new_handler, void* cookie, + _CORBA_Boolean ext); + // Set the timeoutExceptionHandler_t of this object. By default, + // i.e. when this function is not called for an object, the global + // timeoutExceptionHandler_t will be invoked when a CORBA::TIMEOUT + // exception is caught in a remote call from a proxy object. The + // argument is an opaque argument that will be passed to + // the exception handler. ext is true if the handler has extended + // parameters. // This function is thread-safe. - void* _commFailureExceptionHandler(void*& cookie); + void* _commFailureExceptionHandler(void*& cookie, _CORBA_Boolean& ext); // If a commFailureExceptionHandler_t has been installed for this object // by _commFailureExceptionHandler(void*,void*), returns this handler and its // associated opaque argument in cookie. // Otherwise return 0. // This function is thread-safe. - void _commFailureExceptionHandler(void* new_handler, void* cookie); - // Set the commFailureExceptionHandler_t of this object. By default, - // i.e. when this function is not called for an object, the global - // commFailureExceptionHandler_t will be invoked when a CORBA::COMM_FAILURE - // exception is caught in a remote call from a proxy object. - // The argument is an opaque argument that will be passed - // to the exception handler. + void _commFailureExceptionHandler(void* new_handler, void* cookie, + _CORBA_Boolean ext); + // Set the commFailureExceptionHandler_t of this object. By + // default, i.e. when this function is not called for an object, the + // global commFailureExceptionHandler_t will be invoked when a + // CORBA::COMM_FAILURE exception is caught in a remote call from a + // proxy object. The argument is an opaque argument that + // will be passed to the exception handler. ext is true if the + // handler has extended parameters. // This function is thread-safe. - void* _systemExceptionHandler(void*& cookie); + void* _systemExceptionHandler(void*& cookie, _CORBA_Boolean& ext); // If a systemExceptionHandler_t has been installed for this object // by _systemExceptionHandler(void*,void*), returns this handler and its // associated opaque argument in cookie. // Otherwise return 0. // This function is thread-safe. - void _systemExceptionHandler(void* new_handler, void* cookie); + void _systemExceptionHandler(void* new_handler, void* cookie, + _CORBA_Boolean ext); // Set the systemExceptionHandler_t of this object. By default, // i.e. when this function is not called for an object, the global - // systemExceptionHandler_t will be invoked when a CORBA::SystemException - // exception, other than CORBA::TRANSIENT and CORBA::COMM_FAILURE is caught - // in a remote call from a proxy object. The handlers for CORBA::TRANSIENT - // and CORBA::COMM_FAILURE are installed their own install functions. - // The argument is an opaque argument that will be passed - // to the exception handler. - // This function is thread-safe. + // systemExceptionHandler_t will be invoked when a + // CORBA::SystemException exception, other than CORBA::TRANSIENT, + // CORBA::COMM_FAILURE or CORBA::TIMEOUT is caught in a remote call + // from a proxy object. The handlers for CORBA::TRANSIENT, + // CORBA::COMM_FAILURE and CORBA::TIMEOUT are installed their own + // install functions. The argument is an opaque argument + // that will be passed to the exception handler. ext is true if the + // handler has extended parameters. + // This function is thread-safe. inline omniIdentity* _identity() { ASSERT_OMNI_TRACEDMUTEX_HELD(*omni::internalLock, 1); @@ -292,6 +239,10 @@ // the call to the object identity, and deals with exception // handlers, retries and location forwarding. + void _invoke_async(omniAsyncCallDescriptor*); + // Equivalent to _invoke, but the call is performed asynchronously. + // The call descriptor is informed when the call completes. + omniIOR* _getIOR(); // Returns an omniIOR. The object contains all the fields in // the IOR of the object reference. The object is read-only @@ -333,10 +284,13 @@ inline void _setTimeout(unsigned long secs, unsigned long ns) { - pd_timeout_secs = secs; - pd_timeout_nanosecs = ns; + pd_timeout.assign(secs, ns); } + void _NP_disconnect(); + // Forcibly disconnect all connections associated with this object + // reference. + protected: virtual ~omniObjRef(); // Must not hold . @@ -450,6 +404,7 @@ // very first invocation. unsigned transient_exception_handler : 1; + unsigned timeout_exception_handler : 1; unsigned commfail_exception_handler : 1; unsigned system_exception_handler : 1; // True if a per-object exception handler has been installed @@ -465,8 +420,7 @@ } pd_flags; // Mutable. Protected by . - unsigned long pd_timeout_secs; - unsigned long pd_timeout_nanosecs; + omni_time_t pd_timeout; }; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniORBcompat.h omniorb-dfsg-4.2.2/include/omniORB4/omniORBcompat.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniORBcompat.h 2004-10-13 18:00:33.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniORBcompat.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniORB.h omniorb-dfsg-4.2.2/include/omniORB4/omniORB.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniORB.h 2011-06-20 22:13:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniORB.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,205 +3,29 @@ // omniORB.h Created on: 6/2/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2002-2011 Apasphere Ltd +// Copyright (C) 2002-2014 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // This is the public API of omniORB's extension to CORBA. // The API is intended to be used in application code. -/* - $Log$ - Revision 1.5.2.7 2007/09/19 14:16:08 dgrisby - Avoid namespace clashes if IDL defines modules named CORBA. - - Revision 1.5.2.6 2006/01/10 13:59:37 dgrisby - New clientConnectTimeOutPeriod configuration parameter. - - Revision 1.5.2.5 2005/09/19 18:26:33 dgrisby - Merge from omni4_0_develop again. - - Revision 1.5.2.4 2005/04/14 00:04:00 dgrisby - New traceInvocationReturns and traceTime options; remove logf function. - - Revision 1.5.2.3 2005/03/30 23:36:15 dgrisby - Another merge from omni4_0_develop. - - Revision 1.5.2.2 2005/01/06 23:08:10 dgrisby - Big merge from omni4_0_develop. - - Revision 1.5.2.1 2003/03/23 21:04:13 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.19 2002/10/14 20:06:03 dgrisby - Per objref / per thread timeouts. - - Revision 1.2.2.18 2002/08/16 17:47:39 dgrisby - Documentation, message updates. ORB tweaks to match docs. - - Revision 1.2.2.17 2002/01/09 11:39:22 dpg1 - New omniORB::setLogFunction() function. - - Revision 1.2.2.16 2001/09/19 17:30:04 dpg1 - New traceThreadId option to add omni_thread id to log messages. - - Revision 1.2.2.15 2001/09/12 19:42:35 sll - Added back function to report max. GIOP message size. - - Revision 1.2.2.14 2001/08/17 17:03:23 sll - Moved configuration parameters to orbParameters. Move old compatibility API - to omniORBcompat.h. - - Revision 1.2.2.13 2001/08/16 16:11:48 sll - Removed duplicate offerBidirectionalGIOP. - - Revision 1.2.2.12 2001/08/08 15:57:11 sll - New options unixTransportDirectory & unixTransportPermission. - - Revision 1.2.2.11 2001/08/03 17:45:08 sll - Moved OMNIORB_THROW so that it can be used in stub headers - - Revision 1.2.2.10 2001/08/01 10:08:20 dpg1 - Main thread policy. - - Revision 1.2.2.9 2001/07/31 16:10:38 sll - Added GIOP BiDir support. - - Revision 1.2.2.8 2001/07/13 15:16:56 sll - New configuration variables: oneCallPerConnection, threadPerConnectionPolicy, - maxServerThreadPerConnection, maxInterleavedCallsPerConnection, - maxServerThreadPoolSize, threadPerConnectionUpperLimit, - threadPerConnectionLowerLimit. Removed maxNumOfAsyncThreads. - - Revision 1.2.2.7 2001/06/07 16:24:08 dpg1 - PortableServer::Current support. - - Revision 1.2.2.6 2001/05/11 14:25:54 sll - Added operator for omniORB::logger to report system exception status and - minor code. - - Revision 1.2.2.5 2001/04/18 17:50:44 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.4 2000/11/20 11:59:43 dpg1 - API to configure code sets. - - Revision 1.2.2.3 2000/11/03 18:58:47 sll - Unbounded sequence of octet got a new type name. - - Revision 1.2.2.2 2000/09/27 17:09:16 sll - New member maxGIOPVersion(), getInterceptors(), noFirewallNavigation, - giopTargetAddressMode. - LOCATION_FORWARD ctor takes an extra argument to indicate permanent - location forwarding. - - Revision 1.2.2.1 2000/07/17 10:35:35 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.8 2000/05/24 17:11:18 dpg1 - Comments clarified. - - Revision 1.1.2.7 2000/03/07 18:07:32 djr - Fixed user-exceptions when can't catch by base class. - - Revision 1.1.2.6 2000/03/03 14:29:17 djr - Improvement to BOA skeletons (less generated code). - - Revision 1.1.2.5 1999/09/30 11:49:27 djr - Implemented catching user-exceptions in GIOP_S for all compilers. - - Revision 1.1.2.4 1999/09/27 11:01:09 djr - Modifications to logging. - - Revision 1.1.2.3 1999/09/24 17:11:10 djr - New option -ORBtraceInvocations and omniORB::traceInvocations. - - Revision 1.1.2.2 1999/09/24 15:01:28 djr - Added module initialisers, and sll's new scavenger implementation. - - Revision 1.1.2.1 1999/09/24 09:51:46 djr - Moved from omniORB2 + some new files. - - Revision 1.21 1999/08/30 16:56:19 sll - New API members: omniORB::scanGranularity and omniORB::callTimeOutPeriod. - - Revision 1.20 1999/06/26 17:56:39 sll - New configuration variables: abortOnInternalError, verifyObjectExistAndType. - - Revision 1.19 1999/06/25 13:53:51 sll - Renamed copyStringInAnyExtraction to omniORB_27_CompatibleAnyExtraction. - - Revision 1.18 1999/06/18 21:16:36 sll - Updated copyright notice. - - Revision 1.17 1999/06/18 20:37:04 sll - Replaced _LC_attr with _core_attr and _dyn_attr. - New variable copyStringInAnyExtraction. - - Revision 1.16 1999/03/19 15:17:44 djr - New option acceptMisalignedIndirections - - Revision 1.15 1999/02/18 15:19:54 djr - New configuration function omniORB::enableLcdMode() - - Revision 1.14 1999/01/07 18:38:34 djr - New configuration variable omniORB::diiThrowsSysExceptions. - - Revision 1.13 1998/08/26 21:50:22 sll - Added omniORB::maxTcpConnectionPerServer to customise the maximum no. of - outgoing connections per server. - - Revision 1.12 1998/04/07 19:52:31 sll - Updated to use namespace if available. - New class logStream to log all error messages. - - Revision 1.11 1998/03/04 14:48:47 sll - Added omniORB::giopServerThreadWrapper. - - * Revision 1.10 1998/03/02 17:05:29 ewc - * Removed scoping from objectKey in class loader (caused problems compiling - * with MSVC++ 5.0) - * - * Revision 1.9 1998/02/25 20:34:59 sll - * New omniORB::loader class for adding dynamic object loader. - * - * Revision 1.8 1998/01/27 16:07:58 ewc - * Added -ORBtcAliasExpand flag - * - Revision 1.7 1997/12/12 18:47:16 sll - New variable serverName. - - Revision 1.6 1997/12/09 20:36:05 sll - Support for system exception handlers. - Support for incoming and outgoing rope scavenger threads. - - * Revision 1.5 1997/05/06 16:09:39 sll - * Public release. - * - */ - #ifndef __OMNIORB_H__ #define __OMNIORB_H__ @@ -287,6 +111,9 @@ // // _CORBA_MODULE_VAR _core_attr _CORBA_Boolean traceTime; // // If true, logging messages will include the current time. // + // // + _CORBA_MODULE_VAR _core_attr _CORBA_Boolean traceLocking; // + // If true, all locking operations will be traced. // /////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -350,6 +177,12 @@ // _CORBA_MODULE_FN void setClientThreadCallDeadline(unsigned long secs, // unsigned long ns); // + // + _CORBA_MODULE_FN inline void // + setClientThreadCallDeadline(const omni_time_t& tt) // + { // + setClientThreadCallDeadline(tt.s, tt.ns); // + } // _CORBA_MODULE_FN void setClientConnectTimeout(CORBA::ULong millisecs);// // //////////////////////////////////////////////////////////////////////// @@ -535,19 +368,84 @@ // an addition argument to identify the target object reference.// // The argument is an opaque pointer which will be passed // // on by the ORB when it calls the exception handler. // + + typedef CORBA::Boolean + (*transientExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex); + + typedef CORBA::Boolean + (*transientExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TRANSIENT& ex, + CORBA::Object_ptr obj, + const char* op); + + _CORBA_MODULE_FN void + installTransientExceptionHandler(void* cookie, + transientExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installTransientExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installTransientExceptionHandlerExt(void* cookie, + transientExceptionHandlerExt_t fn); + + _CORBA_MODULE_FN void + installTransientExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + transientExceptionHandlerExt_t fn); + + //////////////////////////////////////////////////////////////////////// + + + //////////////////////////////////////////////////////////////////////// + // When an operation is invoked via an object reference, a // + // CORBA::TIMEOUT exception may be raised. // // // - typedef CORBA::Boolean (*transientExceptionHandler_t)(void* cookie, // - CORBA::ULong n_retries, // - const CORBA::TRANSIENT& ex); // - // // - _CORBA_MODULE_FN void installTransientExceptionHandler(void* cookie, // - transientExceptionHandler_t fn); // + // By default, the ORB will pass this exception on to the application.// // // - _CORBA_MODULE_FN void installTransientExceptionHandler( // - CORBA::Object_ptr obj, // - void* cookie, // - transientExceptionHandler_t fn); // - // + // This behaviour can be overridden by installing an exception // + // handler. The function signature of the handler should be the same // + // as omniORB::timeoutExceptionHandler_t. The handlers can be // + // installed using the overloaded functions // + // omniORB::installTimeoutExceptionHandler. The use of these // + // functions is similar to those for the TRANSIENT exception. See // + // above for details. // + + typedef CORBA::Boolean + (*timeoutExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TIMEOUT& ex); + + typedef CORBA::Boolean + (*timeoutExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::TIMEOUT& ex, + CORBA::Object_ptr obj, + const char* op); + + _CORBA_MODULE_FN void + installTimeoutExceptionHandler(void* cookie, + timeoutExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installTimeoutExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + timeoutExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installTimeoutExceptionHandlerExt(void* cookie, + timeoutExceptionHandlerExt_t fn); + + _CORBA_MODULE_FN void + installTimeoutExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + timeoutExceptionHandlerExt_t fn); + //////////////////////////////////////////////////////////////////////// @@ -564,18 +462,37 @@ // omniORB::installCommFailureExceptionHandler. The use of these // // functions is similar to those for the TRANSIENT exception. See // // above for details. // - // // - typedef CORBA::Boolean (*commFailureExceptionHandler_t)(void* cookie, // - CORBA::ULong n_retries, // - const CORBA::COMM_FAILURE& ex); // - // // - _CORBA_MODULE_FN void installCommFailureExceptionHandler(void* cookie,// - commFailureExceptionHandler_t fn); // - // // - _CORBA_MODULE_FN void installCommFailureExceptionHandler( // - CORBA::Object_ptr obj, // - void* cookie, // - commFailureExceptionHandler_t fn); // + + typedef CORBA::Boolean + (*commFailureExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::COMM_FAILURE& ex); + + typedef CORBA::Boolean + (*commFailureExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::COMM_FAILURE& ex, + CORBA::Object_ptr obj, + const char* op); + + _CORBA_MODULE_FN void + installCommFailureExceptionHandler(void* cookie, + commFailureExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installCommFailureExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + commFailureExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installCommFailureExceptionHandlerExt(void* cookie, + commFailureExceptionHandlerExt_t fn); + + _CORBA_MODULE_FN void + installCommFailureExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + commFailureExceptionHandlerExt_t fn); + //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// @@ -598,25 +515,44 @@ // exception. See above for details. Notice that the installed // // exception handler will only be called when the system exception is // // neither CORBA::TRANSIENT nor CORBA::COMM_FAILURE. // - // // - typedef CORBA::Boolean (*systemExceptionHandler_t)(void* cookie, // - CORBA::ULong n_retries, // - const CORBA::SystemException& ex); // - // // - _CORBA_MODULE_FN void installSystemExceptionHandler(void* cookie, // - systemExceptionHandler_t fn); // - // // - _CORBA_MODULE_FN void installSystemExceptionHandler( // - CORBA::Object_ptr obj, // - void* cookie, // - systemExceptionHandler_t fn); // + + typedef CORBA::Boolean + (*systemExceptionHandler_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::SystemException& ex); + + typedef CORBA::Boolean + (*systemExceptionHandlerExt_t)(void* cookie, + CORBA::ULong n_retries, + const CORBA::SystemException& ex, + CORBA::Object_ptr obj, + const char* op); + + _CORBA_MODULE_FN void + installSystemExceptionHandler(void* cookie, + systemExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installSystemExceptionHandler(CORBA::Object_ptr obj, + void* cookie, + systemExceptionHandler_t fn); + + _CORBA_MODULE_FN void + installSystemExceptionHandlerExt(void* cookie, + systemExceptionHandlerExt_t fn); + + _CORBA_MODULE_FN void + installSystemExceptionHandlerExt(CORBA::Object_ptr obj, + void* cookie, + systemExceptionHandlerExt_t fn); + //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // class fatalException // // // - // This exception is thrown if a bug inside the omniORB2 runtime is // + // This exception is thrown if a bug inside the omniORB runtime is // // detected. The exact location in the source where the exception is // // thrown is indicated by file() and line(). // // // @@ -625,7 +561,7 @@ fatalException(const char *file,int line,const char *errmsg); // inline ~fatalException() {} // inline const char *file() const { return pd_file; } // - inline int line() const { return pd_line; } // + inline int line() const { return pd_line; } // inline const char *errmsg() const { return pd_errmsg; } // private: // const char *pd_file; // @@ -650,7 +586,7 @@ class LOCATION_FORWARD { // public: // inline LOCATION_FORWARD(CORBA::Object_ptr objref, // - CORBA::Boolean permanent) // + CORBA::Boolean permanent=0) // : pd_objref(objref), pd_permanent(permanent) {} // // inline CORBA::Object_ptr get_obj() const { return pd_objref; } // @@ -677,7 +613,14 @@ private: #endif -#ifndef HAS_Cplusplus_catch_exception_by_base +#ifdef HAS_Cplusplus_catch_exception_by_base + +# define _OMNIORB_EX_ONLY_CD(x) + +#else + +# define _OMNIORB_EX_ONLY_CD(x) x + // Internal omniORB class. Used in the stubs to pass // user-defined exceptions to a lower level. @@ -725,22 +668,13 @@ OMNI_NAMESPACE_END(omni) -#ifdef OMNIORB_THROW_VISIBLE_THROW - #define OMNIORB_THROW(name, minor, completion) \ do {\ _OMNI_NS(omniExHelper)::name(__FILE__, __LINE__, minor, completion); \ throw ::CORBA::name(minor, completion); \ } while(0) -#else // throw inside omniExHelper function - -#define OMNIORB_THROW(name, minor, completion) \ - _OMNI_NS(omniExHelper)::name(__FILE__, __LINE__, minor, completion) - -#endif // OMNIORB_THROW_VISIBLE_THROW - -#else // no tracing +#else #define OMNIORB_THROW(name, minor, completion) \ throw ::CORBA::name(minor, completion) diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniPolicy.h omniorb-dfsg-4.2.2/include/omniORB4/omniPolicy.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniPolicy.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniPolicy.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,24 +3,23 @@ // omniPolicy.h Created on: 2001/11/07 // Author : Duncan Grisby (dpg1) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -30,10 +29,16 @@ #ifndef __OMNIPOLICY_H__ #define __OMNIPOLICY_H__ +#include + + _CORBA_MODULE omniPolicy _CORBA_MODULE_BEG +// +// Local shortcut + typedef CORBA::UShort LocalShortcutPolicyValue; _CORBA_MODULE_VARINT @@ -48,6 +53,60 @@ OMNIORB_DECLARE_POLICY_OBJECT(LocalShortcutPolicy, 0x41545401) + +_CORBA_MODULE_FN LocalShortcutPolicy_ptr +create_local_shortcut_policy(LocalShortcutPolicyValue v); + + +// +// EndPoint publishing + +typedef CORBA::StringSeq EndPointPublishPolicyValue; + +_CORBA_MODULE_VARINT +const CORBA::PolicyType ENDPOINT_PUBLISH_POLICY_TYPE + _init_in_decl_( = 0x41545402 ); + + +// Cannot use the OMNIORB_DECLARE_POLICY_OBJECT macro because the +// value is a sequence + +class EndPointPublishPolicy; +typedef EndPointPublishPolicy* EndPointPublishPolicy_ptr; +typedef EndPointPublishPolicy_ptr EndPointPublishPolicyRef; + +class EndPointPublishPolicy : public CORBA::Policy +{ +public: + EndPointPublishPolicy(const EndPointPublishPolicyValue& value_); + inline EndPointPublishPolicy() : pd_eps(0) {} + virtual ~EndPointPublishPolicy(); + + virtual CORBA::Policy_ptr copy(); + virtual const EndPointPublishPolicyValue& value() { return pd_value; } + + virtual void* _ptrToObjRef(const char* repoId); + + _OMNI_NS(IORPublish)* getEPs(); + + static EndPointPublishPolicy_ptr _duplicate(EndPointPublishPolicy_ptr p); + static EndPointPublishPolicy_ptr _narrow(CORBA::Object_ptr p); + static EndPointPublishPolicy_ptr _nil(); + + static _core_attr const char* _PD_repoId; + +private: + EndPointPublishPolicyValue pd_value; + _OMNI_NS(IORPublish)* pd_eps; +}; + +typedef _CORBA_PseudoObj_Var EndPointPublishPolicy_var; + + +_CORBA_MODULE_FN EndPointPublishPolicy_ptr +create_endpoint_publish_policy(const EndPointPublishPolicyValue& v); + + _CORBA_MODULE_END diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniServant.h omniorb-dfsg-4.2.2/include/omniORB4/omniServant.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniServant.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniServant.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,60 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Base class for object implementations (servants). // -/* - $Log$ - Revision 1.4.2.2 2005/09/05 17:22:09 dgrisby - Reference counted local call shortcut. - - Revision 1.4.2.1 2003/03/23 21:04:10 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.5 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.2.2.4 2001/05/29 17:03:48 dpg1 - In process identity. - - Revision 1.2.2.3 2001/04/18 17:50:43 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.2 2000/09/27 17:12:47 sll - New member _upcall(). - - Revision 1.2.2.1 2000/07/17 10:35:35 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:05 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.2 1999/10/27 17:32:09 djr - omni::internalLock and objref_rc_lock are now pointers. - - Revision 1.1.2.1 1999/09/24 09:51:48 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNISERVANT_H__ #define __OMNISERVANT_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniServer.h omniorb-dfsg-4.2.2/include/omniORB4/omniServer.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniServer.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniServer.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,41 +9,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.3 2006/10/09 09:47:12 dgrisby - Only delete giopServer if all threads are successfully shut down. - - Revision 1.1.4.2 2006/04/09 19:52:31 dgrisby - More IPv6, endPointPublish parameter. - - Revision 1.1.4.1 2003/03/23 21:04:09 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.1 2001/04/18 17:26:28 sll - Big checkin with the brand new internal APIs. - -*/ - #ifndef __OMNISERVER_H__ #define __OMNISERVER_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniTransport.h omniorb-dfsg-4.2.2/include/omniORB4/omniTransport.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniTransport.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniTransport.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.4 2002/03/27 11:44:51 dpg1 - Check in interceptors things left over from last week. - - Revision 1.1.4.3 2001/08/03 17:48:43 sll - Make sure dll import spec for win32 is properly done. - - Revision 1.1.4.2 2001/06/13 20:07:25 sll - Minor update to make the ORB compiles with MSVC++. - - Revision 1.1.4.1 2001/04/18 17:26:28 sll - Big checkin with the brand new internal APIs. - - */ - #ifndef __OMNITRANSPORT_H__ #define __OMNITRANSPORT_H__ @@ -136,7 +118,7 @@ virtual void incrRefCount() = 0; virtual void decrRefCount() = 0; - + virtual void disconnect() = 0; friend class Strand; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniURI.h omniorb-dfsg-4.2.2/include/omniORB4/omniURI.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniURI.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniURI.h 2017-02-20 22:45:59.000000000 +0000 @@ -9,19 +9,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -29,41 +27,6 @@ // *** PROPRIETARY INTERFACE *** // -// $Log$ -// Revision 1.4.2.3 2006/03/25 18:54:04 dgrisby -// Initial IPv6 support. -// -// Revision 1.4.2.2 2005/07/22 17:18:40 dgrisby -// Another merge from omni4_0_develop. -// -// Revision 1.4.2.1 2003/03/23 21:04:07 dgrisby -// Start of omniORB 4.1.x development branch. -// -// Revision 1.2.2.5 2001/08/17 17:03:53 sll -// Remove addURIHandler. -// -// Revision 1.2.2.4 2001/04/18 17:50:43 sll -// Big checkin with the brand new internal APIs. -// Scoped where appropriate with the omni namespace. -// -// Revision 1.2.2.3 2000/11/09 12:27:50 dpg1 -// Huge merge from omni3_develop, plus full long long from omni3_1_develop. -// -// Revision 1.2.2.2 2000/09/27 17:12:03 sll -// Updated to include from include/omniORB4. -// -// Revision 1.2.2.1 2000/07/17 10:35:35 sll -// Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. -// -// Revision 1.3 2000/07/13 15:26:05 dpg1 -// Merge from omni3_develop for 3.0 release. -// -// Revision 1.1.2.1 2000/04/27 10:37:12 dpg1 -// Interoperable Naming Service -// -// All URI related function definitions. -// - #ifndef _omniURI_h_ #define _omniURI_h_ @@ -90,12 +53,23 @@ const char** rest = 0); // Extract host and port from the part of a URI containing the // address. If rest is non-zero, the pointer is set to the address - // of the character following the port number. Returns zero if the - // address is invalid. + // of the character following the port number, otherwise anything + // after the port number renders the URI invalid. Returns zero if + // the address is invalid. + + static char* extractHostPortRange(const char* addr, + CORBA::UShort& port_min, + CORBA::UShort& port_max); + // Extract host and port range from the part of a URI containing the + // address. Accepts a port range in the form min-max. Returns zero + // if the address is invalid. static CORBA::Boolean validHostPort(const char* addr); // True if addr is a valid host:port; false otherwise. + static CORBA::Boolean validHostPortRange(const char* addr); + // True if addr is a valid host:port_min-port_max; false otherwise. + static char* objectToString(CORBA::Object_ptr obj); // Return a stringified IOR for the given object reference. diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniutilities.h omniorb-dfsg-4.2.2/include/omniORB4/omniutilities.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniutilities.h 2003-09-26 16:12:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniutilities.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,37 +8,22 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** -// - -/* - $Log$ - Revision 1.1.6.1 2003/03/23 21:04:06 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.4.2 2002/11/21 14:24:59 dgrisby - More unique guard name (thanks Daniel Bell). - - Revision 1.1.4.1 2001/04/18 17:26:25 sll - Big checkin with the brand new internal APIs. - -*/ +// *** PROPRIETARY INTERFACE *** +// #ifndef __OMNIUTILITIES_H__ #define __OMNIUTILITIES_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/omniZIOP.h omniorb-dfsg-4.2.2/include/omniORB4/omniZIOP.h --- omniorb-dfsg-4.1.6/include/omniORB4/omniZIOP.h 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/omniZIOP.h 2017-02-20 22:45:59.000000000 +0000 @@ -0,0 +1,95 @@ +// -*- Mode: C++; -*- +// Package : omniORB +// omniZIOP.cc Created on: 2012/10/02 +// Author : Duncan Grisby (dgrisby) +// +// Copyright (C) 2012 Apasphere Ltd. +// +// This file is part of the omniORB library +// +// The omniORB library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ +// +// Description: +// ZIOP support + +#ifndef _omniZIOP_h_ +#define _omniZIOP_h_ + +#include +#include + + +// +// Proprietary omniZIOP module +// + +_CORBA_MODULE omniZIOP +_CORBA_MODULE_BEG + + // + // Policy creation functions + // + // These are equivalent to using orb->create_policy(), but do not + // require use of Any. + + ZIOP::CompressionEnablingPolicy_ptr + create_compression_enabling_policy(CORBA::Boolean compression_enabled); + + ZIOP::CompressionIdLevelListPolicy_ptr + create_compression_id_level_list_policy(const Compression::CompressorIdLevelList& compressor_ids); + + ZIOP::CompressionLowValuePolicy_ptr + create_compression_low_value_policy(CORBA::ULong low_value); + + ZIOP::CompressionMinRatioPolicy_ptr + create_compression_min_ratio_policy(Compression::CompressionRatio ratio); + + + // + // Global policies + + void + setGlobalPolicies(const CORBA::PolicyList& policies); + // Sets global policies that apply to all POAs and all object + // references, equivalent to separately setting the policies in + // calls to the POAs and calling _set_policy_overrides() on all + // object references. + // + // There is no need to include a CompressionEnablingPolicy with + // value true, since calling this implicitly enables compression. + // If other policies are not set, default values are used, so to + // enable ZIOP with default settings, simply call setGlobalPolicies + // with empty policies. + + CORBA::Object_ptr + setServerPolicies(CORBA::Object_ptr obj, const CORBA::PolicyList& policies); + // Returns a new object reference equivalent to obj, but with + // specified compression policies, as if the server-side ORB had set + // those policies. This is useful to enable ZIOP for an object + // reference constructed from a corbaloc URI. + // + // ZIOP is only valid for GIOP 1.2 (and later), so the object + // reference must be GIOP 1.2. For a corbaloc URI, specify it as + // + // corbaloc::1.2@some.host.name/key + // + // Beware that this may cause the client to make ZIOP calls to a + // server that does not support ZIOP! + + +_CORBA_MODULE_END + +#undef _ziop_attr + +#endif // _omniZIOP_h_ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/optionalFeatures.h omniorb-dfsg-4.2.2/include/omniORB4/optionalFeatures.h --- omniorb-dfsg-4.1.6/include/omniORB4/optionalFeatures.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/optionalFeatures.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,19 +8,17 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/poa_defs.h omniorb-dfsg-4.2.2/include/omniORB4/poa_defs.h --- omniorb-dfsg-4.1.6/include/omniORB4/poa_defs.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/poa_defs.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,82 +3,27 @@ // poa_defs.h Created on: 8/6/99 // Author : David Riddoch (djr) // -// Copyright (C) 2005 Apasphere Ltd +// Copyright (C) 2005-2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // Description: // - -/* - $Log$ - Revision 1.4.2.2 2005/11/09 12:22:18 dgrisby - Local interfaces support. - - Revision 1.4.2.1 2003/03/23 21:04:04 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.7 2001/11/08 16:33:50 dpg1 - Local servant POA shortcut policy. - - Revision 1.2.2.6 2001/10/17 16:44:01 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.2.2.5 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.2.2.4 2001/05/29 17:03:48 dpg1 - In process identity. - - Revision 1.2.2.3 2001/04/18 17:50:43 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.2 2000/09/27 16:57:14 sll - Replaced marshalling operators for MemBufferedStream and NetBufferedStream - with just one type for cdrStream. - - Revision 1.2.2.1 2000/07/17 10:35:36 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.5 2000/06/27 16:15:08 sll - New classes: _CORBA_String_element, _CORBA_ObjRef_Element, - _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a - sequence of string and a sequence of object reference. - - Revision 1.1.2.4 1999/10/21 11:29:45 djr - Added _core_attr to declaration of _PD_repoId in exceptions & interfaces. - - Revision 1.1.2.3 1999/10/16 13:22:52 djr - Changes to support compiling on MSVC. - - Revision 1.1.2.2 1999/10/04 15:51:51 djr - Various fixes/MSVC work-arounds. - - Revision 1.1.2.1 1999/09/24 09:51:50 djr - Moved from omniORB2 + some new files. - -*/ +// Hand-edited generated code for POA IDL. #ifndef __OMNIPOA_H__ #error poa_defs.h should only be included by poa.h @@ -101,33 +46,35 @@ pd_insertToAnyFnNCP = insertToAnyFnNCP; } ForwardRequest(const ForwardRequest&); - ForwardRequest(CORBA::Object_ptr i_forward_reference); + ForwardRequest(::CORBA::Object_ptr i_forward_reference); ForwardRequest& operator=(const ForwardRequest&); virtual ~ForwardRequest(); virtual void _raise() const; - static ForwardRequest* _downcast(CORBA::Exception*); - static const ForwardRequest* _downcast(const CORBA::Exception*); - static inline ForwardRequest* _narrow(CORBA::Exception* e) { - return _downcast(e); + static ForwardRequest* _downcast(::CORBA::Exception*); + static const ForwardRequest* _downcast(const ::CORBA::Exception*); + static inline ForwardRequest* _narrow(::CORBA::Exception* _e) { + return _downcast(_e); } - - void operator>>=(cdrStream&) const; - void operator<<=(cdrStream&); + + void operator>>=(cdrStream&) const ; + void operator<<=(cdrStream&) ; static _core_attr insertExceptionToAny insertToAnyFn; static _core_attr insertExceptionToAnyNCP insertToAnyFnNCP; + virtual ::CORBA::Exception* _NP_duplicate() const; + static _core_attr const char* _PD_repoId; + static _core_attr const char* _PD_typeId; private: - virtual CORBA::Exception* _NP_duplicate() const; virtual const char* _NP_typeId() const; virtual const char* _NP_repoId(int*) const; virtual void _NP_marshal(cdrStream&) const; }; -_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_ForwardRequest; +_CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ForwardRequest; ////////////////////////////////////////////////////////////////////// ////////////////////////// AdapterActivator ////////////////////////// @@ -167,8 +114,9 @@ typedef AdapterActivator_var _var_type; static _ptr_type _duplicate(_ptr_type); - static _ptr_type _narrow(CORBA::Object_ptr); - static _ptr_type _unchecked_narrow(CORBA::Object_ptr); + static _ptr_type _narrow(::CORBA::Object_ptr); + static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); + static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream& s) { @@ -179,9 +127,13 @@ static inline _ptr_type _unmarshalObjRef(cdrStream& s) { OMNIORB_THROW(MARSHAL, _OMNI_NS(MARSHAL_LocalObject), (CORBA::CompletionStatus)s.completion()); -#ifdef NEED_DUMMY_RETURN - return 0; -#endif + } + + static inline _ptr_type _fromObjRef(omniObjRef* o) { + if (o) + return (_ptr_type) o->_ptrToObjRef(_PD_repoId); + else + return _nil(); } static _core_attr const char* _PD_repoId; @@ -229,7 +181,7 @@ inline _pof_AdapterActivator() : _OMNI_NS(proxyObjectFactory)(AdapterActivator::_PD_repoId) {} virtual ~_pof_AdapterActivator(); - virtual omniObjRef* newObjRef(omniIOR* ior, omniIdentity*); + virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; @@ -241,8 +193,8 @@ virtual ~_impl_AdapterActivator(); virtual CORBA::Boolean unknown_adapter(POA_ptr parent, const char* name) = 0; - -protected: + +public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: @@ -251,7 +203,7 @@ }; -_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_AdapterActivator; +_CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_AdapterActivator; ////////////////////////////////////////////////////////////////////// /////////////////////////// ServantManager /////////////////////////// @@ -291,8 +243,9 @@ typedef ServantManager_var _var_type; static _ptr_type _duplicate(_ptr_type); - static _ptr_type _narrow(CORBA::Object_ptr); - static _ptr_type _unchecked_narrow(CORBA::Object_ptr); + static _ptr_type _narrow(::CORBA::Object_ptr); + static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); + static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream& s) { @@ -303,9 +256,13 @@ static inline _ptr_type _unmarshalObjRef(cdrStream& s) { OMNIORB_THROW(MARSHAL, _OMNI_NS(MARSHAL_LocalObject), (CORBA::CompletionStatus)s.completion()); -#ifdef NEED_DUMMY_RETURN - return 0; -#endif + } + + static inline _ptr_type _fromObjRef(omniObjRef* o) { + if (o) + return (_ptr_type) o->_ptrToObjRef(_PD_repoId); + else + return _nil(); } static _core_attr const char* _PD_repoId; @@ -351,7 +308,7 @@ inline _pof_ServantManager() : _OMNI_NS(proxyObjectFactory)(ServantManager::_PD_repoId) {} virtual ~_pof_ServantManager(); - virtual omniObjRef* newObjRef(omniIOR*, omniIdentity*); + virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; @@ -362,8 +319,9 @@ public: virtual ~_impl_ServantManager(); - -protected: + + +public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: @@ -372,7 +330,7 @@ }; -_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_ServantManager; +_CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ServantManager; ////////////////////////////////////////////////////////////////////// ////////////////////////// ServantActivator ////////////////////////// @@ -412,8 +370,9 @@ typedef ServantActivator_var _var_type; static _ptr_type _duplicate(_ptr_type); - static _ptr_type _narrow(CORBA::Object_ptr); - static _ptr_type _unchecked_narrow(CORBA::Object_ptr); + static _ptr_type _narrow(::CORBA::Object_ptr); + static _ptr_type _unchecked_narrow(::CORBA::Object_ptr); + static _ptr_type _nil(); static inline void _marshalObjRef(_ptr_type, cdrStream& s) { @@ -424,9 +383,6 @@ static inline _ptr_type _unmarshalObjRef(cdrStream& s) { OMNIORB_THROW(MARSHAL, _OMNI_NS(MARSHAL_LocalObject), (CORBA::CompletionStatus)s.completion()); -#ifdef NEED_DUMMY_RETURN - return 0; -#endif } static _core_attr const char* _PD_repoId; @@ -478,7 +434,7 @@ inline _pof_ServantActivator() : _OMNI_NS(proxyObjectFactory)(ServantActivator::_PD_repoId) {} virtual ~_pof_ServantActivator(); - virtual omniObjRef* newObjRef(omniIOR*, omniIdentity*); + virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; @@ -492,7 +448,7 @@ virtual Servant incarnate(const ObjectId& oid, POA_ptr adapter) = 0; virtual void etherealize(const ObjectId& oid, POA_ptr adapter, Servant serv, CORBA::Boolean cleanup_in_progress, CORBA::Boolean remaining_activations) = 0; -protected: +public: // Really protected, workaround for xlC virtual _CORBA_Boolean _dispatch(omniCallHandle&); private: @@ -501,7 +457,7 @@ }; -_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_ServantActivator; +_CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ServantActivator; ////////////////////////////////////////////////////////////////////// /////////////////////////// ServantLocator /////////////////////////// @@ -553,16 +509,13 @@ static inline _ptr_type _unmarshalObjRef(cdrStream& s) { OMNIORB_THROW(MARSHAL, _OMNI_NS(MARSHAL_LocalObject), (CORBA::CompletionStatus)s.completion()); -#ifdef NEED_DUMMY_RETURN - return 0; -#endif } static _core_attr const char* _PD_repoId; // Other IDL defined within this scope. - static _dyn_attr const CORBA::TypeCode_ptr _tc_Cookie; + static _dyn_attr const ::CORBA::TypeCode_ptr _tc_Cookie; typedef void* Cookie; // Operations declared in this local interface @@ -610,7 +563,7 @@ inline _pof_ServantLocator() : _OMNI_NS(proxyObjectFactory)(ServantLocator::_PD_repoId) {} virtual ~_pof_ServantLocator(); - virtual omniObjRef* newObjRef(omniIOR*, omniIdentity*); + virtual omniObjRef* newObjRef(omniIOR*,omniIdentity*); virtual _CORBA_Boolean is_a(const char*) const; }; @@ -633,7 +586,7 @@ }; -_CORBA_MODULE_VAR _dyn_attr const CORBA::TypeCode_ptr _tc_ServantLocator; +_CORBA_MODULE_VAR _dyn_attr const ::CORBA::TypeCode_ptr _tc_ServantLocator; #endif // __OMNI_POA_DEFS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/poa.h omniorb-dfsg-4.2.2/include/omniORB4/poa.h --- omniorb-dfsg-4.1.6/include/omniORB4/poa.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/poa.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,137 +3,28 @@ // poa.h Created on: 2/99 // Author : David Riddoch (djr) // -// Copyright (C) 2004-2009 Apasphere Ltd +// Copyright (C) 2004-2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.4.2.12 2009/04/20 11:08:26 dgrisby - Use class instead of typename to make Sun compiler happy. Thanks - Paul Parlett. - - Revision 1.4.2.11 2007/02/26 12:41:00 dgrisby - Fix duplicated POA enum Any operators. Thanks Thomas Richter. - - Revision 1.4.2.10 2006/10/23 15:08:31 dgrisby - Suppress GCC warnings about missing base class constructor calls. - Thanks Tamas Kerecsen. Somehow, this patch works on VC++ 6, where - before a similar change failed. - - Revision 1.4.2.9 2006/03/22 15:55:14 dgrisby - VC++ 6 doesn't like explicit calls to default base constructors. - - Revision 1.4.2.8 2005/11/09 12:22:18 dgrisby - Local interfaces support. - - Revision 1.4.2.7 2005/08/02 09:41:13 dgrisby - Bug in Servant_var if assigning to itself. - - Revision 1.4.2.6 2005/07/22 17:18:39 dgrisby - Another merge from omni4_0_develop. - - Revision 1.4.2.5 2005/01/06 23:08:11 dgrisby - Big merge from omni4_0_develop. - - Revision 1.4.2.4 2004/10/13 17:58:18 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.4.2.3 2004/07/23 10:29:57 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.4.2.2 2004/02/16 10:10:28 dgrisby - More valuetype, including value boxes. C++ mapping updates. - - Revision 1.4.2.1 2003/03/23 21:04:06 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.12 2001/11/13 14:11:44 dpg1 - Tweaks for CORBA 2.5 compliance. - - Revision 1.2.2.11 2001/10/19 11:05:25 dpg1 - ObjectId to/from wstring - - Revision 1.2.2.10 2001/10/17 16:44:01 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.2.2.9 2001/08/01 10:08:20 dpg1 - Main thread policy. - - Revision 1.2.2.8 2001/07/31 16:04:07 sll - Added ORB::create_policy() and associated types and operators. - - Revision 1.2.2.7 2001/06/07 16:24:08 dpg1 - PortableServer::Current support. - - Revision 1.2.2.6 2001/05/29 17:03:48 dpg1 - In process identity. - - Revision 1.2.2.5 2001/04/18 17:50:43 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.4 2000/11/09 12:27:50 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.2.2.3 2000/11/03 18:58:47 sll - Unbounded sequence of octet got a new type name. - - Revision 1.2.2.2 2000/09/27 16:57:14 sll - Replaced marshalling operators for MemBufferedStream and NetBufferedStream - with just one type for cdrStream. - - Revision 1.2.2.1 2000/07/17 10:35:35 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.7 2000/06/27 16:15:08 sll - New classes: _CORBA_String_element, _CORBA_ObjRef_Element, - _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a - sequence of string and a sequence of object reference. - - Revision 1.1.2.6 1999/11/23 10:48:07 djr - Added _ptr_type and _var_type to POA. - - Revision 1.1.2.5 1999/10/21 11:29:45 djr - Added _core_attr to declaration of _PD_repoId in exceptions & interfaces. - - Revision 1.1.2.4 1999/10/18 17:28:18 djr - Fixes for building MSVC dlls. - - Revision 1.1.2.3 1999/10/16 13:22:51 djr - Changes to support compiling on MSVC. - - Revision 1.1.2.2 1999/09/28 09:47:57 djr - Corrected declaration of ObjectId_to_string and string_to_ObjectId. - - Revision 1.1.2.1 1999/09/24 09:51:49 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNIPOA_H__ #define __OMNIPOA_H__ @@ -689,7 +580,7 @@ virtual void* _downcast(); // Overrides omniServant. - int _pd_refCount; + omni_refcount _pd_refCount; }; ////////////////////////////////////////////////////////////////////// diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/poa_poa.h omniorb-dfsg-4.2.2/include/omniORB4/poa_poa.h --- omniorb-dfsg-4.1.6/include/omniORB4/poa_poa.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/poa_poa.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,41 +3,28 @@ // poa_poa.h Created on: 8/6/99 // Author : David Riddoch (djr) // +// Copyright (C) 2005-2012 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // - -/* - $Log$ - Revision 1.2.2.1 2000/07/17 10:35:36 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:51 djr - Moved from omniORB2 + some new files. - -*/ +// Hand-edited generated code for POA IDL. #ifndef __OMNIPOA_H__ #error poa_poa.h should only be included by poa.h @@ -52,8 +39,8 @@ class AdapterActivator : - public virtual PortableServer::_impl_AdapterActivator, - public virtual PortableServer::ServantBase + public virtual PortableServer::_impl_AdapterActivator, + public virtual PortableServer::ServantBase { public: virtual ~AdapterActivator(); @@ -65,8 +52,8 @@ class ServantManager : - public virtual PortableServer::_impl_ServantManager, - public virtual PortableServer::ServantBase + public virtual PortableServer::_impl_ServantManager, + public virtual PortableServer::ServantBase { public: virtual ~ServantManager(); @@ -78,8 +65,8 @@ class ServantActivator : - public virtual PortableServer::_impl_ServantActivator, - public virtual PortableServer::ServantBase + public virtual PortableServer::_impl_ServantActivator, + public virtual ServantManager { public: virtual ~ServantActivator(); @@ -91,8 +78,8 @@ class ServantLocator : - public virtual PortableServer::_impl_ServantLocator, - public virtual PortableServer::ServantBase + public virtual PortableServer::_impl_ServantLocator, + public virtual ServantManager { public: virtual ~ServantLocator(); diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/proxyFactory.h omniorb-dfsg-4.2.2/include/omniORB4/proxyFactory.h --- omniorb-dfsg-4.1.6/include/omniORB4/proxyFactory.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/proxyFactory.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,58 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.2.2.4 2001/08/15 10:26:08 dpg1 - New object table behaviour, correct POA semantics. - - Revision 1.2.2.3 2001/04/18 17:50:43 sll - Big checkin with the brand new internal APIs. - Scoped where appropriate with the omni namespace. - - Revision 1.2.2.2 2000/09/27 17:03:57 sll - Changed newObjRef signature to accept omniIOR* as an argument. - - Revision 1.2.2.1 2000/07/17 10:35:37 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.1 1999/09/24 09:51:52 djr - Moved from omniORB2 + some new files. - - Revision 1.7 1999/01/07 18:40:32 djr - Changes to support split of omniORB library into two. - - Revision 1.6 1998/04/07 19:56:44 sll - Replace _OMNIORB2_NTDLL_ specification on class proxyObjectFactory with - _OMNIORB_NTDLL_IMPORT on static member variables. - - * Revision 1.5 1997/05/06 16:10:05 sll - * Public release. - * -*/ - #ifndef __OMNI_PROXYFACTORY_H__ #define __OMNI_PROXYFACTORY_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/seqTemplatedecls.h omniorb-dfsg-4.2.2/include/omniORB4/seqTemplatedecls.h --- omniorb-dfsg-4.1.6/include/omniORB4/seqTemplatedecls.h 2006-04-28 18:40:47.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/seqTemplatedecls.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,130 +1,30 @@ // -*- Mode: C++; -*- -// Package : omniORB2 +// Package : omniORB // seqtemplates.h Created on: 14/5/96 // Author : Sai Lai Lo (sll) // +// Copyright (C) 2009 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** -/* - $Log$ - Revision 1.1.4.3 2005/11/17 17:03:27 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.2 2005/01/06 23:08:21 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:04:03 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.8 2003/01/16 12:47:08 dgrisby - Const cast macro. Thanks Matej Kenda. - - Revision 1.1.2.7 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.6 2001/10/29 17:42:36 dpg1 - Support forward-declared structs/unions, ORB::create_recursive_tc(). - - Revision 1.1.2.5 2001/06/08 17:12:08 dpg1 - Merge all the bug fixes from omni3_develop. - - Revision 1.1.2.4 2000/11/20 18:56:39 sll - Sequence templates were broken by the previous checkin. They are now fixed. - - Revision 1.1.2.3 2000/11/20 14:41:43 sll - Simplified sequence template hierachy and added templates for sequence of - wchar and sequence of array of wchar. - - Revision 1.1.2.2 2000/11/03 19:02:45 sll - Separate out the marshalling of byte, octet and char into 3 set of distinct - marshalling functions. Sequence of and sequence of array of these types - updated correspondingly. - - Revision 1.1.2.1 2000/09/27 16:54:09 sll - *** empty log message *** - - Revision 1.2 2000/07/04 15:23:30 dpg1 - Merge from omni3_develop. - - Revision 1.1.2.1 1999/09/24 09:51:53 djr - Moved from omniORB2 + some new files. - - Revision 1.21 1999/08/15 13:54:01 sll - Added tyepdef ... BaseT to various sequence templates. - - Revision 1.20 1999/06/18 20:33:42 sll - Updated to CORBA 2.3 mapping. - - Revision 1.19 1999/05/26 15:55:39 sll - Added new template _CORBA_Sequence_ObjRef to deal with sequence - of object reference. This is necessary in order to implment the value ctor - correctly. - - Revision 1.18 1999/05/26 15:04:15 sll - - Revision 1.17 1999/05/26 14:55:06 sll - - Revision 1.16 1999/05/25 13:18:20 sll - - Revision 1.15 1999/04/21 13:15:31 djr - *** empty log message *** - - Revision 1.14 1999/01/07 18:44:55 djr - *** empty log message *** - - Revision 1.13 1998/04/07 20:01:05 sll - Added specialised marshalling functions for sequence boolean, - sequence array boolean when bool type is used to represent CORBA::Boolean. - - Revision 1.12 1998/03/05 11:21:16 sll - Added NP_data() to all the derived class of Sequence_Array. This is - to remove the warning given by some compiler, such as HPUX C++. - - Revision 1.11 1998/01/28 14:29:48 ewc - *** empty log message *** - - * Revision 1.10 1998/01/27 19:35:56 ewc - * Revised Octet and Boolean templates - * - * Revision 1.9 1998/01/27 16:08:45 ewc - * Added new classes and templates for sequence of Boolean and sequence - * of Octet. - * - Revision 1.8 1997/12/18 17:35:52 sll - _CORBA_Sequence copy ctor should allocate s.pd_max elements instead of - s.pd_len elements. - - Revision 1.7 1997/12/09 20:42:25 sll - Updated sequence array templates. - - Revision 1.6 1997/08/21 22:21:56 sll - New templates to support sequence of array. - - * Revision 1.5 1997/05/06 16:11:10 sll - * Public release. - * - */ #ifndef __SEQTEMPLATEDECLS_H__ #define __SEQTEMPLATEDECLS_H__ @@ -144,15 +44,28 @@ inline _CORBA_ULong length() const { return pd_len; } inline void length(_CORBA_ULong len) { - if (pd_bounded && len > pd_max) { - _CORBA_bound_check_error(); - // never reach here. - } if (len) { - // Allocate buffer on-demand. Either pd_data == 0 - // or pd_data = buffer for pd_max elements - if (!pd_buf || len > pd_max) { - copybuffer(((len > pd_max) ? len : pd_max)); + if (len > pd_max) { + if (pd_bounded) { + _CORBA_bound_check_error(); + // Never reach here. + } + // Grow exponentially + _CORBA_ULong newmax = pd_max * 2; + copybuffer((len > newmax) ? len : newmax); + } + else if (!pd_buf) { + // Allocate initial buffer + copybuffer(pd_max); + } + } + else { + // Zero length. Deallocate buffer if it is owned by us. + if (pd_rel && pd_buf) { + freebuf(pd_buf); + pd_buf = 0; + if (!pd_bounded) + pd_max = 0; } } pd_len = len; @@ -172,7 +85,7 @@ } return tmp; } - static inline void freebuf(T * b) { + static inline void freebuf(T* b) { if (b) delete [] b; } @@ -187,8 +100,9 @@ return pd_buf; } else { - if (!pd_rel) + if (!pd_rel) { return 0; + } else { T* tmp = pd_buf; pd_buf = 0; @@ -196,7 +110,6 @@ pd_max = 0; } pd_len = 0; - pd_rel = 1; return tmp; } } @@ -237,12 +150,11 @@ } } - inline _CORBA_Sequence(_CORBA_ULong max, - _CORBA_ULong len, - T *value, + inline _CORBA_Sequence(_CORBA_ULong max, + _CORBA_ULong len, + T* value, _CORBA_Boolean release_ = 0, - _CORBA_Boolean bounded = 0 - ) + _CORBA_Boolean bounded = 0) : pd_max(max), pd_len(len), pd_rel(release_), @@ -257,9 +169,14 @@ inline T_seq &operator= (const T_seq &s) { - length(s.pd_len); - for (unsigned long i=0; i < pd_len; i++) { - pd_buf[i] = s.pd_buf[i]; + if (&s != this) { + // Prevent copybuffer from copying any of the current sequence members + pd_len = 0; + + length(s.pd_len); + for (unsigned long i=0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + } } return *this; } @@ -291,7 +208,7 @@ // never reach here } for (unsigned long i=0; i < pd_len; i++) { - newbuf[i] = pd_buf[i]; + newbuf[i] = pd_buf[i]; } if (pd_rel && pd_buf) { freebuf(pd_buf); @@ -303,11 +220,11 @@ pd_max = newmax; } - _CORBA_ULong pd_max; - _CORBA_ULong pd_len; - _CORBA_Boolean pd_rel; - _CORBA_Boolean pd_bounded; - T *pd_buf; + _CORBA_ULong pd_max; + _CORBA_ULong pd_len; + _CORBA_Boolean pd_rel; + _CORBA_Boolean pd_bounded; + T* pd_buf; }; ////////////////////////////////////////////////////////////////////// @@ -367,6 +284,13 @@ Base_T_seq::operator= (s); return *this; } + + static inline T* allocbuf(_CORBA_ULong /*nelems*/) { + return Base_T_seq::allocbuf(max); + } + + static inline T* allocbuf() { return allocbuf(max); } + // CORBA 2.3 additions inline void replace(_CORBA_ULong len, T* data,_CORBA_Boolean release_ = 0) { @@ -390,15 +314,28 @@ inline _CORBA_ULong length() const { return pd_len; } inline void length(_CORBA_ULong len) { - if (pd_bounded && len > pd_max) { - _CORBA_bound_check_error(); - // never reach here. - } if (len) { - // Allocate buffer on-demand. Either pd_data == 0 - // or pd_data = buffer for pd_max elements - if (!pd_buf || len > pd_max) { - NP_copybuffer(((len > pd_max) ? len : pd_max)); + if (len > pd_max) { + if (pd_bounded) { + _CORBA_bound_check_error(); + // Never reach here. + } + // Grow exponentially + _CORBA_ULong newmax = pd_max * 2; + NP_copybuffer((len > newmax) ? len : newmax); + } + else if (!pd_buf) { + // Allocate initial buffer + NP_copybuffer(pd_max); + } + } + else { + // Zero length. Deallocate buffer if it is owned by us. + if (pd_rel && pd_buf) { + NP_freebuf(); + pd_buf = 0; + if (!pd_bounded) + pd_max = 0; } } pd_len = len; @@ -453,9 +390,9 @@ inline _CORBA_Sequence_Forward(_CORBA_ULong max, _CORBA_Boolean bounded=0) : pd_max(max), pd_len(0), pd_rel(1), pd_bounded(bounded), pd_buf(0) {} - inline _CORBA_Sequence_Forward(_CORBA_ULong max, - _CORBA_ULong len, - T *value, + inline _CORBA_Sequence_Forward(_CORBA_ULong max, + _CORBA_ULong len, + T* value, _CORBA_Boolean release_ = 0, _CORBA_Boolean bounded = 0) : pd_max(max), @@ -490,11 +427,11 @@ virtual void NP_copybuffer(_CORBA_ULong newmax) = 0; virtual void NP_freebuf() = 0; - _CORBA_ULong pd_max; - _CORBA_ULong pd_len; - _CORBA_Boolean pd_rel; - _CORBA_Boolean pd_bounded; - T *pd_buf; + _CORBA_ULong pd_max; + _CORBA_ULong pd_len; + _CORBA_Boolean pd_rel; + _CORBA_Boolean pd_bounded; + T* pd_buf; }; @@ -1088,30 +1025,40 @@ //////////////////////// _CORBA_Sequence_Array /////////////////////// ////////////////////////////////////////////////////////////////////// -template +template class _CORBA_Sequence_Array { public: - typedef _CORBA_Sequence_Array T_seq; + typedef _CORBA_Sequence_Array T_seq; inline _CORBA_ULong maximum() const { return pd_max; } inline _CORBA_ULong length() const { return pd_len; } inline void length(_CORBA_ULong len) { - if (pd_bounded && len > pd_max) { - _CORBA_bound_check_error(); - // never reach here. - } - if (len) { - // Allocate buffer on-demand. Either pd_data == 0 - // or pd_data = buffer for pd_max elements - if (!pd_buf || len > pd_max) { - copybuffer(((len > pd_max) ? len : pd_max)); + if (len > pd_max) { + if (pd_bounded) { + _CORBA_bound_check_error(); + // Never reach here. + } + // Grow exponentially + _CORBA_ULong newmax = pd_max * 2; + copybuffer((len > newmax) ? len : newmax); + } + else if (!pd_buf) { + // Allocate initial buffer + copybuffer(pd_max); + } + } + else { + // Zero length. Deallocate buffer if it is owned by us. + if (pd_rel && pd_buf) { + freebuf(pd_buf); + pd_buf = 0; + if (!pd_bounded) + pd_max = 0; } } - pd_len = len; - } // These have to return pointer to slice to support brain-dead compilers // (such as MSVC, which handles references to arrays poorly). @@ -1125,6 +1072,7 @@ if (index_ >= pd_len) _CORBA_bound_check_error(); return (const T_slice*)(pd_buf[index_]); } + static inline T* allocbuf(_CORBA_ULong nelems) { if (nelems) return new T[nelems]; @@ -1176,7 +1124,7 @@ return; } - // omniORB2 extensions + // omniORB extensions inline T *NP_data() const { return pd_buf; } inline void NP_norelease() { pd_rel = 0; } @@ -1196,7 +1144,7 @@ length(s.pd_len); for (_CORBA_ULong i=0; i < pd_len; i++) { for (_CORBA_ULong j=0; j < dimension; j++) { - *((Telm*)(pd_buf[i]) + j) = *((Telm*)(s.pd_buf[i]) + j); + *((T_elm*)(pd_buf[i]) + j) = *((T_elm*)(s.pd_buf[i]) + j); } } } @@ -1222,10 +1170,15 @@ inline T_seq& operator= (const T_seq& s) { - length(s.pd_len); - for (unsigned long i=0; i < pd_len; i++) { - for (_CORBA_ULong j=0; j < dimension; j++) { - *((Telm*)(pd_buf[i]) + j) = *((Telm*)(s.pd_buf[i]) + j); + if (&s != this) { + // Prevent copybuffer from copying any of the current sequence members + pd_len = 0; + + length(s.pd_len); + for (unsigned long i=0; i < pd_len; i++) { + for (_CORBA_ULong j=0; j < dimension; j++) { + *((T_elm*)(pd_buf[i]) + j) = *((T_elm*)(s.pd_buf[i]) + j); + } } } return *this; @@ -1261,7 +1214,7 @@ } for (unsigned long i=0; i < pd_len; i++) { for (_CORBA_ULong j=0; j < dimension; j++) { - *((Telm*)(newbuf[i]) + j) = *((Telm*)(pd_buf[i]) + j); + *((T_elm*)(newbuf[i]) + j) = *((T_elm*)(pd_buf[i]) + j); } } if (pd_rel && pd_buf) { @@ -1285,11 +1238,11 @@ /////////////////// _CORBA_Unbounded_Sequence_Array ////////////////// ////////////////////////////////////////////////////////////////////// -template -class _CORBA_Unbounded_Sequence_Array : public _CORBA_Sequence_Array { +template +class _CORBA_Unbounded_Sequence_Array : public _CORBA_Sequence_Array { public: typedef _CORBA_Unbounded_Sequence_Array T_seq; - typedef _CORBA_Sequence_Array Base_T_seq ; + typedef _CORBA_Sequence_Array Base_T_seq ; inline _CORBA_Unbounded_Sequence_Array() {} inline _CORBA_Unbounded_Sequence_Array(_CORBA_ULong max) : Base_T_seq(max) {} @@ -1320,11 +1273,11 @@ //////////////////// _CORBA_Bounded_Sequence_Array /////////////////// ////////////////////////////////////////////////////////////////////// -template -class _CORBA_Bounded_Sequence_Array : public _CORBA_Sequence_Array { +template +class _CORBA_Bounded_Sequence_Array : public _CORBA_Sequence_Array { public: - typedef _CORBA_Bounded_Sequence_Array T_seq; - typedef _CORBA_Sequence_Array Base_T_seq ; + typedef _CORBA_Bounded_Sequence_Array T_seq; + typedef _CORBA_Sequence_Array Base_T_seq ; inline _CORBA_Bounded_Sequence_Array() : Base_T_seq(max,1) {} inline _CORBA_Bounded_Sequence_Array(_CORBA_ULong len, @@ -1339,6 +1292,12 @@ inline ~_CORBA_Bounded_Sequence_Array() {} + static inline T* allocbuf(_CORBA_ULong /*nelems*/) { + return Base_T_seq::allocbuf(max); + } + + static inline T* allocbuf() { return allocbuf(max); } + // CORBA 2.3 additions inline void replace(_CORBA_ULong len, T* data,_CORBA_Boolean release_ = 0) { @@ -1353,13 +1312,13 @@ ////////// _CORBA_Unbounded_Sequence_Array_w_FixSizeElement ////////// ////////////////////////////////////////////////////////////////////// -template +template class _CORBA_Unbounded_Sequence_Array_w_FixSizeElement - : public _CORBA_Unbounded_Sequence_Array + : public _CORBA_Unbounded_Sequence_Array { public: - typedef _CORBA_Unbounded_Sequence_Array_w_FixSizeElement T_seq; - typedef _CORBA_Unbounded_Sequence_Array Base_T_seq; + typedef _CORBA_Unbounded_Sequence_Array_w_FixSizeElement T_seq; + typedef _CORBA_Unbounded_Sequence_Array Base_T_seq; inline _CORBA_Unbounded_Sequence_Array_w_FixSizeElement() {} inline _CORBA_Unbounded_Sequence_Array_w_FixSizeElement(_CORBA_ULong max) : @@ -1396,13 +1355,13 @@ /////////// _CORBA_Bounded_Sequence_Array_w_FixSizeElement /////////// ////////////////////////////////////////////////////////////////////// -template +template class _CORBA_Bounded_Sequence_Array_w_FixSizeElement - : public _CORBA_Bounded_Sequence_Array + : public _CORBA_Bounded_Sequence_Array { public: - typedef _CORBA_Bounded_Sequence_Array_w_FixSizeElement T_seq; - typedef _CORBA_Bounded_Sequence_Array Base_T_seq; + typedef _CORBA_Bounded_Sequence_Array_w_FixSizeElement T_seq; + typedef _CORBA_Bounded_Sequence_Array Base_T_seq; inline _CORBA_Bounded_Sequence_Array_w_FixSizeElement() {} @@ -1875,76 +1834,80 @@ ///////////////// _CORBA_Sequence_ObjRef //////////////// ////////////////////////////////////////////////////////////////////// -template +template class _CORBA_Sequence_ObjRef { public: - typedef _CORBA_Sequence_ObjRef T_seq; + typedef _CORBA_Sequence_ObjRef T_seq; inline _CORBA_ULong maximum() const { return pd_max; } inline _CORBA_ULong length() const { return pd_len; } - inline void length(_CORBA_ULong len) { - if (pd_bounded && len > pd_max) { - _CORBA_bound_check_error(); - // never reach here. - } - - // If we've shrunk we need to clear the entries at the top. - for( _CORBA_ULong i = len; i < pd_len; i++ ) - operator[](i) = T_Helper::_nil(); - + inline void length(_CORBA_ULong len) + { if (len) { - // Allocate buffer on-demand. Either pd_data == 0 - // or pd_data = buffer for pd_max elements - if (!pd_data || len > pd_max) { - copybuffer(((len > pd_max) ? len : pd_max)); + if (len > pd_max) { + if (pd_bounded) { + _CORBA_bound_check_error(); + // Never reach here. + } + // Grow exponentially + _CORBA_ULong newmax = pd_max * 2; + copybuffer((len > newmax) ? len : newmax); + } + else if (!pd_buf) { + // Allocate initial buffer + copybuffer(pd_max); + } + else { + // We have shrunk. Clear the entries at the top + T* nil_ = T_Helper::_nil(); + for (_CORBA_ULong i = len; i < pd_len; i++) { + T_Helper::release(pd_buf[i]); + pd_buf[i] = nil_; + } + } + } + else { + // Zero length. Deallocate buffer if it is owned by us. + if (pd_rel && pd_buf) { + freebuf(pd_buf); + pd_buf = 0; + if (!pd_bounded) + pd_max = 0; } } - pd_len = len; } - inline ElemT operator[] (_CORBA_ULong i) { + inline T_Elem operator[] (_CORBA_ULong i) { if( i >= pd_len ) _CORBA_bound_check_error(); - return ElemT(pd_data[i],pd_rel); + return T_Elem(pd_buf[i],pd_rel); } - inline ElemT operator[] (_CORBA_ULong i) const { + inline T_Elem operator[] (_CORBA_ULong i) const { if( i >= pd_len ) _CORBA_bound_check_error(); - return ElemT(pd_data[i],pd_rel); + return T_Elem(pd_buf[i],pd_rel); } -#if SIZEOF_PTR == SIZEOF_LONG - typedef unsigned long ptr_arith_t; -#elif SIZEOF_PTR == SIZEOF_INT - typedef unsigned int ptr_arith_t; -#elif defined (_WIN64) - typedef size_t ptr_arith_t; -#else -#error "No suitable type to do pointer arithmetic" -#endif - - static inline T** allocbuf(_CORBA_ULong nelems) { + static inline T** allocbuf(_CORBA_ULong nelems) { if (!nelems) return 0; - T** b = new T*[nelems+2]; - ptr_arith_t l = nelems; - for (_CORBA_ULong i_ = 2; i_ < nelems+2; i_++) { - b[i_] = T_Helper::_nil(); - } - b[0] = (T*) ((ptr_arith_t)0x53514F4AU); - b[1] = (T*) l; - return b+2; + + T** b = new T*[nelems+1]; + + T* nil_ = T_Helper::_nil(); + for (_CORBA_ULong i_ = 1; i_ < nelems+1; i_++) { + b[i_] = nil_; + } + b[0] = (T*) (omni_ptr_arith_t) nelems; + return b+1; } static inline void freebuf(T** buf) { if (!buf) return; - T** b = buf-2; - if ((ptr_arith_t)b[0] != ((ptr_arith_t) 0x53514F4AU)) { - _CORBA_bad_param_freebuf(); - return; - } - ptr_arith_t l = (ptr_arith_t) b[1]; - for (_CORBA_ULong i = 0; i < (_CORBA_ULong) l; i++) { - if (!T_Helper::is_nil(buf[i])) - T_Helper::release(buf[i]); + + T** b = buf-1; + + _CORBA_ULong l = (_CORBA_ULong)(omni_ptr_arith_t)b[0]; + for (_CORBA_ULong i = 0; i < l; i++) { + T_Helper::release(buf[i]); } b[0] = (T*) 0; delete [] b; @@ -1954,18 +1917,19 @@ inline _CORBA_Boolean release() const { return pd_rel; } inline T** get_buffer(_CORBA_Boolean orphan = 0) { - if (pd_max && !pd_data) { + if (pd_max && !pd_buf) { copybuffer(pd_max); } if (!orphan) { - return pd_data; + return pd_buf; } else { - if (!pd_rel) + if (!pd_rel) { return 0; + } else { - T** tmp = pd_data; - pd_data = 0; + T** tmp = pd_buf; + pd_buf = 0; if (!pd_bounded) { pd_max = 0; } @@ -1977,30 +1941,30 @@ } inline T*const * get_buffer() const { - if (pd_max && !pd_data) { + if (pd_max && !pd_buf) { T_seq* s = OMNI_CONST_CAST(T_seq*, this); s->copybuffer(pd_max); } - return pd_data; + return pd_buf; } inline ~_CORBA_Sequence_ObjRef() { - if (pd_rel && pd_data) freebuf(pd_data); - pd_data = 0; + if (pd_rel && pd_buf) freebuf(pd_buf); + pd_buf = 0; } - // omniORB2 extensions + // omniORB extensions inline void operator>>= (cdrStream &s) const; inline void operator<<= (cdrStream &s); protected: inline _CORBA_Sequence_ObjRef() - : pd_max(0), pd_len(0), pd_rel(1), pd_bounded(0), pd_data(0) {} + : pd_max(0), pd_len(0), pd_rel(1), pd_bounded(0), pd_buf(0) {} inline _CORBA_Sequence_ObjRef(_CORBA_ULong max, _CORBA_Boolean bounded=0) - : pd_max(max), pd_len(0), pd_rel(1), pd_bounded(bounded), pd_data(0) {} + : pd_max(max), pd_len(0), pd_rel(1), pd_bounded(bounded), pd_buf(0) {} inline _CORBA_Sequence_ObjRef(_CORBA_ULong max, _CORBA_ULong len, @@ -2008,7 +1972,7 @@ _CORBA_Boolean release_ = 0, _CORBA_Boolean bounded = 0) : pd_max(max), pd_len(len), pd_rel(release_), - pd_bounded(bounded), pd_data(value) + pd_bounded(bounded), pd_buf(value) { if (len > max || (len && !value)) { _CORBA_bound_check_error(); @@ -2018,16 +1982,39 @@ inline _CORBA_Sequence_ObjRef(const T_seq& s) : pd_max(s.pd_max), pd_len(0), pd_rel(1), - pd_bounded(s.pd_bounded), pd_data(0) { + pd_bounded(s.pd_bounded), pd_buf(0) { length(s.pd_len); - for( _CORBA_ULong i = 0; i < pd_len; i++ ) - operator[](i) = s[i]; + for (_CORBA_ULong i = 0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + T_Helper::duplicate(pd_buf[i]); + } } inline T_seq& operator= (const T_seq& s) { - length(s.pd_len); - for( _CORBA_ULong i = 0; i < pd_len; i++ ) - operator[](i) = s[i]; + if (&s != this) { + _CORBA_ULong i; + + if (pd_rel) { + T* nil_ = T_Helper::_nil(); + for (i=0; i < pd_len; i++) { + T_Helper::release(pd_buf[i]); + pd_buf[i] = nil_; + } + pd_len = 0; + length(s.pd_len); + for (i = 0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + T_Helper::duplicate(pd_buf[i]); + } + } + else { + pd_len = 0; + length(s.pd_len); + for (i = 0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + } + } + } return *this; } @@ -2038,12 +2025,12 @@ _CORBA_bound_check_error(); // never reach here } - if (pd_rel && pd_data) { - freebuf(pd_data); + if (pd_rel && pd_buf) { + freebuf(pd_buf); } pd_max = max; pd_len = len; - pd_data = data; + pd_buf = data; pd_rel = release_; } @@ -2051,7 +2038,7 @@ protected: void copybuffer(_CORBA_ULong newmax) { - // replace pd_data with a new buffer of size newmax. + // replace pd_buf with a new buffer of size newmax. // Invariant: pd_len <= newmax // T** newdata = allocbuf(newmax); @@ -2059,23 +2046,24 @@ _CORBA_new_operator_return_null(); // never reach here } - for (unsigned long i_=0; i_ < pd_len; i_++) { - if (pd_rel) { - newdata[i_] = pd_data[i_]; - pd_data[i_] = T_Helper::_nil(); + if (pd_rel) { + T* nil_ = T_Helper::_nil(); + for (unsigned long i_=0; i_ < pd_len; i_++) { + newdata[i_] = pd_buf[i_]; + pd_buf[i_] = nil_; } - else { - T_Helper::duplicate(pd_data[i_]); - newdata[i_] = pd_data[i_]; + if (pd_buf) { + freebuf(pd_buf); } } - if (pd_rel && pd_data) { - freebuf(pd_data); - } else { + for (unsigned long i_=0; i_ < pd_len; i_++) { + T_Helper::duplicate(pd_buf[i_]); + newdata[i_] = pd_buf[i_]; + } pd_rel = 1; } - pd_data = newdata; + pd_buf = newdata; pd_max = newmax; } @@ -2083,18 +2071,18 @@ _CORBA_ULong pd_len; _CORBA_Boolean pd_rel; _CORBA_Boolean pd_bounded; - T** pd_data; + T** pd_buf; }; ////////////////////////////////////////////////////////////////////// ///////////////// _CORBA_Unbounded_Sequence_ObjRef //////////////// ////////////////////////////////////////////////////////////////////// -template -class _CORBA_Unbounded_Sequence_ObjRef : public _CORBA_Sequence_ObjRef { +template +class _CORBA_Unbounded_Sequence_ObjRef : public _CORBA_Sequence_ObjRef { public: - typedef _CORBA_Unbounded_Sequence_ObjRef T_seq; - typedef _CORBA_Sequence_ObjRef Base_T_seq; + typedef _CORBA_Unbounded_Sequence_ObjRef T_seq; + typedef _CORBA_Sequence_ObjRef Base_T_seq; inline _CORBA_Unbounded_Sequence_ObjRef() {} inline _CORBA_Unbounded_Sequence_ObjRef(_CORBA_ULong max) : @@ -2126,13 +2114,13 @@ ///////////////// _CORBA_Bounded_Sequence_ObjRef //////////////// ////////////////////////////////////////////////////////////////////// -template +template class _CORBA_Bounded_Sequence_ObjRef - : public _CORBA_Sequence_ObjRef + : public _CORBA_Sequence_ObjRef { public: - typedef _CORBA_Bounded_Sequence_ObjRef T_seq; - typedef _CORBA_Sequence_ObjRef Base_T_seq; + typedef _CORBA_Bounded_Sequence_ObjRef T_seq; + typedef _CORBA_Sequence_ObjRef Base_T_seq; inline _CORBA_Bounded_Sequence_ObjRef() : Base_T_seq(max,1){} inline _CORBA_Bounded_Sequence_ObjRef(_CORBA_ULong len, @@ -2149,6 +2137,12 @@ return *this; } + static inline T** allocbuf(_CORBA_ULong /*nelems*/) { + return Base_T_seq::allocbuf(max); + } + + static inline T** allocbuf() { return allocbuf(max); } + // CORBA 2.3 additions inline void replace(_CORBA_ULong len, T** data, _CORBA_Boolean release_ = 0) { diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/seqTemplatedefns.h omniorb-dfsg-4.2.2/include/omniORB4/seqTemplatedefns.h --- omniorb-dfsg-4.1.6/include/omniORB4/seqTemplatedefns.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/seqTemplatedefns.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,112 +1,40 @@ // -*- Mode: C++; -*- -// Package : omniORB2 +// Package : omniORB // seqTemplatedefns.h Created on: 14/5/96 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2003-2007 Apasphere Ltd +// Copyright (C) 2003-2009 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** - -/* - $Log$ - Revision 1.1.4.4 2007/04/12 19:50:32 dgrisby - A few cases of sizeof(bool) > 1 were not handled correctly. - - Revision 1.1.4.3 2006/04/28 18:40:46 dgrisby - Merge from omni4_0_develop. - - Revision 1.1.4.2 2005/01/06 17:31:06 dgrisby - Changes (mainly from omni4_0_develop) to compile on gcc 3.4. - - Revision 1.1.2.11 2003/05/22 13:41:39 dgrisby - HPUX patches. - - Revision 1.1.4.1 2003/03/23 21:04:02 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.10 2002/10/15 23:25:45 dgrisby - DOH! - - Revision 1.1.2.9 2002/10/15 23:23:29 dgrisby - Forgot case of compilers with no bool. - - Revision 1.1.2.8 2002/10/14 15:10:09 dgrisby - Cope with platforms where sizeof(bool) != 1. - - Revision 1.1.2.7 2001/08/03 17:41:16 sll - System exception minor code overhaul. When a system exeception is raised, - a meaning minor code is provided. - - Revision 1.1.2.6 2001/05/04 11:24:46 sll - Wrong bound check in all sequence array templates. - - Revision 1.1.2.5 2000/11/20 18:56:39 sll - Sequence templates were broken by the previous checkin. They are now fixed. - - Revision 1.1.2.4 2000/11/20 14:41:44 sll - Simplified sequence template hierachy and added templates for sequence of - wchar and sequence of array of wchar. - - Revision 1.1.2.3 2000/11/07 18:19:54 sll - Revert to use explicit castings in the marshalling operators of sequence of - arrays. - - Revision 1.1.2.2 2000/11/03 19:02:46 sll - Separate out the marshalling of byte, octet and char into 3 set of distinct - marshalling functions. Sequence of and sequence of array of these types - updated correspondingly. - - Revision 1.1.2.1 2000/09/27 16:54:09 sll - *** empty log message *** - -*/ - +// *** PROPRIETARY INTERFACE *** #ifndef __SEQTEMPLATEDEFNS_H__ #define __SEQTEMPLATEDEFNS_H__ -#ifndef Swap16 -#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) -#else -#error "Swap16 has already been defined" -#endif - -#ifndef Swap32 -#define Swap32(l) ((((l) & 0xff000000) >> 24) | \ - (((l) & 0x00ff0000) >> 8) | \ - (((l) & 0x0000ff00) << 8) | \ - (((l) & 0x000000ff) << 24)) -#else -#error "Swap32 has already been defined" -#endif - ////////////////////////////////////////////////////////////////////// template inline void _CORBA_Unbounded_Sequence::operator>>= (cdrStream& s) const { - ::operator>>=(_CORBA_ULong(this->pd_len), s); - for( int i = 0; i < (int)this->pd_len; i++ ) + s.marshalULong(this->pd_len); + for (_CORBA_ULong i = 0; i < this->pd_len; i++) this->pd_buf[i] >>= s; } @@ -123,7 +51,7 @@ // never reach here } this->length(l); - for( _CORBA_ULong i = 0; i < l; i++ ) + for (_CORBA_ULong i = 0; i < l; i++) this->pd_buf[i] <<= s; } @@ -132,8 +60,8 @@ inline void _CORBA_Bounded_Sequence::operator>>= (cdrStream& s) const { - ::operator>>=(_CORBA_ULong(this->pd_len), s); - for( int i = 0; i < (int)this->pd_len; i++ ) + s.marshalULong(this->pd_len); + for (_CORBA_ULong i = 0; i < this->pd_len; i++) this->pd_buf[i] >>= s; } @@ -150,7 +78,7 @@ // never reach here } this->length(l); - for( _CORBA_ULong i = 0; i < l; i++ ) + for (_CORBA_ULong i = 0; i < l; i++) this->pd_buf[i] <<= s; } @@ -190,28 +118,41 @@ s.get_octet_array((_CORBA_Octet*)Base_T_seq::NP_data(), (int)l*elmSize, (omni::alignment_t)elmAlignment); + if (s.unmarshal_byte_swap() && elmAlignment != 1) { if (elmSize == 2) { + _CORBA_UShort* data = (_CORBA_UShort*)Base_T_seq::NP_data(); + for (_CORBA_ULong i=0; i max)) { _CORBA_marshal_sequence_range_check_error(s); // never reach here } @@ -252,28 +193,41 @@ s.get_octet_array((_CORBA_Octet*)Base_T_seq::NP_data(), (int)l*elmSize, (omni::alignment_t)elmAlignment); + if (s.unmarshal_byte_swap() && elmAlignment != 1) { if (elmSize == 2) { + _CORBA_UShort* data = (_CORBA_UShort*)Base_T_seq::NP_data(); + for (_CORBA_ULong i=0; ipd_bounded && l > this->pd_max)) { + if (!s.checkInputOverrun(1,l)) { _CORBA_marshal_sequence_range_check_error(s); // never reach here } @@ -677,30 +631,43 @@ s.get_octet_array((_CORBA_Octet*)Base_T_seq::NP_data(), (int)l*dimension*elmSize, (omni::alignment_t)elmAlignment); + if (s.unmarshal_byte_swap() && elmAlignment != 1) { + l *= dimension; + if (elmSize == 2) { - l *= dimension; + _CORBA_UShort* data = (_CORBA_UShort*)Base_T_seq::NP_data(); + for (_CORBA_ULong i=0; i max)) { _CORBA_marshal_sequence_range_check_error(s); // never reach here } @@ -742,49 +709,62 @@ s.get_octet_array((_CORBA_Octet*)Base_T_seq::NP_data(), (int)l*dimension*elmSize, (omni::alignment_t)elmAlignment); + if (s.unmarshal_byte_swap() && elmAlignment != 1) { + l *= dimension; + if (elmSize == 2) { - l *= dimension; + _CORBA_UShort* data = (_CORBA_UShort*)Base_T_seq::NP_data(); + for (_CORBA_ULong i=0; i +template inline void -_CORBA_Sequence_ObjRef::operator>>= (cdrStream& s) const +_CORBA_Sequence_ObjRef::operator>>= (cdrStream& s) const { - ::operator>>=(_CORBA_ULong(this->pd_len), s); + s.marshalULong(this->pd_len); for( int i = 0; i < (int)this->pd_len; i++ ) - T_Helper::marshalObjRef(pd_data[i],s); + T_Helper::marshalObjRef(pd_buf[i],s); } ////////////////////////////////////////////////////////////////////// -template +template inline void -_CORBA_Sequence_ObjRef::operator<<= (cdrStream& s) +_CORBA_Sequence_ObjRef::operator<<= (cdrStream& s) { _CORBA_ULong l; l <<= s; @@ -792,12 +772,22 @@ _CORBA_marshal_sequence_range_check_error(s); // never reach here } + + _CORBA_ULong i; + + if (this->pd_rel) { + T* nil_ = T_Helper::_nil(); + for (i=0; i < this->pd_len; i++) { + T_Helper::release(pd_buf[i]); + pd_buf[i] = nil_; + } + } + this->pd_len = 0; + this->length(l); - for( _CORBA_ULong i = 0; i < l; i++ ) - operator[](i) = T_Helper::unmarshalObjRef(s); + for (i = 0; i < l; i++) + this->pd_buf[i] = T_Helper::unmarshalObjRef(s); } -#undef Swap16 -#undef Swap32 #endif // __SEQTEMPLATEDEFNS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/sslContext.h omniorb-dfsg-4.2.2/include/omniORB4/sslContext.h --- omniorb-dfsg-4.1.6/include/omniORB4/sslContext.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/sslContext.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,67 +3,29 @@ // sslContext.h Created on: 29 May 2001 // Author : Sai Lai Lo (sll) // -// Copyright (C) 2005-2008 Apasphere Ltd +// Copyright (C) 2005-2012 Apasphere Ltd // Copyright (C) 2001 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** // -/* - $Log$ - Revision 1.1.4.5 2008/02/14 13:50:03 dgrisby - Initialise openssl only if necessary. Thanks Teemu Torma. - - Revision 1.1.4.4 2006/01/10 12:24:04 dgrisby - Merge from omni4_0_develop pre 4.0.7 release. - - Revision 1.1.4.3 2005/09/05 17:12:20 dgrisby - Merge again. Mainly SSL transport changes. - - Revision 1.1.4.2 2005/01/06 23:08:22 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:04:02 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.5 2002/09/05 14:29:01 dgrisby - Link force mechanism wasn't working with gcc. - - Revision 1.1.2.4 2002/02/25 11:17:11 dpg1 - Use tracedmutexes everywhere. - - Revision 1.1.2.3 2001/09/14 11:10:35 sll - Do the right dllimport for win32. - - Revision 1.1.2.2 2001/09/13 15:36:00 sll - Provide hooks to openssl for thread safety. - Switched to select v2 or v3 methods but accept only v3 or tls v1 protocol. - Added extra method set_supported_versions. - - Revision 1.1.2.1 2001/06/11 18:11:07 sll - *** empty log message *** - -*/ - #ifndef __SSLCONTEXT_H__ #define __SSLCONTEXT_H__ @@ -96,13 +58,45 @@ SSL_CTX* get_SSL_CTX() const { return pd_ctx; } - // These four parameters must be set or else the default way to + // These parameters must be set or else the default way to // initialise a sslContext singleton will not be used. static _core_attr const char* certificate_authority_file; // In PEM format + static _core_attr const char* certificate_authority_path; // Path static _core_attr const char* key_file; // In PEM format static _core_attr const char* key_file_password; + + // These parameters can be overriden to adjust the verify mode and + // verify callback passed to SSL_CTX_set_verify and the info + // callback passed to SSL_CTX_set_info_callback. static _core_attr int verify_mode; + static _core_attr int (*verify_callback)(int, X509_STORE_CTX*); + + static _core_attr void (*info_callback)(const SSL *s, + int where, int ret); + + // If this parameter is false (the default), interceptor + // peerdetails() calls treturn an X509*. If set true, the calls + // return a pointer to an sslContext::PeerDetails object. + static _core_attr CORBA::Boolean full_peerdetails; + + class PeerDetails { + public: + inline PeerDetails(SSL* s, X509* c, CORBA::Boolean v) + : pd_ssl(s), pd_cert(c), pd_verified(v) {} + + ~PeerDetails(); + + inline SSL* ssl() { return pd_ssl; } + inline X509* cert() { return pd_cert; } + inline CORBA::Boolean verified() { return pd_verified; } + + private: + SSL* pd_ssl; + X509* pd_cert; + CORBA::Boolean pd_verified; + }; + // sslContext singleton object. static _core_attr sslContext* singleton; virtual ~sslContext(); @@ -112,8 +106,8 @@ // Default to return SSLv23_method(). virtual void set_supported_versions(); - // Default to SSL_CTX_set_options(ssL_ctx, SSL_OP_NO_SSLv2); That is - // only accept SSL version 3 or TLS version 1. + // Default to SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3); + // That is only accept TLS. virtual void set_CA(); // Default to read the certificates of the Certificate Authorities in the diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/streamOperators.h omniorb-dfsg-4.2.2/include/omniORB4/streamOperators.h --- omniorb-dfsg-4.1.6/include/omniORB4/streamOperators.h 2006-05-25 18:16:50.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/streamOperators.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,29 +8,21 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Stream operators -// -// $Id: streamOperators.h 5498 2006-05-25 18:16:50Z dgrisby $ - -/* - $Log$ -*/ #ifndef __OMNI_STREAM_OPERATORS_H__ #define __OMNI_STREAM_OPERATORS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/stringtypes.h omniorb-dfsg-4.2.2/include/omniORB4/stringtypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/stringtypes.h 2010-09-07 13:34:40.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/stringtypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,113 +3,29 @@ // stringtypes.h Created on: 16/4/99 // Author : David Riddoch (djr) // -// Copyright (C) 2003-2005 Apasphere Ltd +// Copyright (C) 2003-2015 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // The CORBA string type helpers. Also sequence of string. // -/* - $Log$ - Revision 1.4.2.3 2005/11/17 17:03:27 dgrisby - Merge from omni4_0_develop. - - Revision 1.4.2.2 2005/01/06 23:08:22 dgrisby - Big merge from omni4_0_develop. - - Revision 1.4.2.1 2003/03/23 21:04:01 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.12 2003/01/16 12:47:08 dgrisby - Const cast macro. Thanks Matej Kenda. - - Revision 1.2.2.11 2003/01/14 11:48:15 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.2.2.10 2002/03/11 12:23:03 dpg1 - Tweaks to avoid compiler warnings. - - Revision 1.2.2.9 2001/11/06 15:41:35 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.2.2.8 2001/09/19 17:26:44 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.2.2.7 2001/08/17 13:44:08 dpg1 - Change freeing behaviour of string members and elements. - - Revision 1.2.2.6 2001/08/03 17:47:45 sll - Removed obsoluted code. - - Revision 1.2.2.5 2000/11/22 14:37:59 dpg1 - Code set marshalling functions now take a string length argument. - - Revision 1.2.2.4 2000/11/09 12:27:50 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.2.2.3 2000/11/03 19:04:34 sll - Renamed _CORBA_Unbounded_Sequence__String to _CORBA_Unbounded_Sequence_String - and _CORBA_Bounded_Sequence__String to _CORBA_Bounded_Sequence_String - Removed marshal() and unmarshal() from String_helper. - - Revision 1.2.2.2 2000/09/27 17:02:24 sll - Consolidate all string allocation functions into the _CORBA_String_helper - class. Updated to use the new cdrStream abstraction. - - Revision 1.2.2.1 2000/07/17 10:35:37 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.4 2000/06/27 16:15:08 sll - New classes: _CORBA_String_element, _CORBA_ObjRef_Element, - _CORBA_ObjRef_tcDesc_arg to support assignment to an element of a - sequence of string and a sequence of object reference. - - Revision 1.1.2.3 2000/02/09 15:01:28 djr - Fixed _CORBA_String_member bug. - - Revision 1.1.2.2 2000/01/27 16:31:32 djr - String_member now initialised to empty string by default. - - Revision 1.1.2.1 1999/09/24 09:51:54 djr - Moved from omniORB2 + some new files. - - Revision 1.4 1999/06/18 20:28:30 sll - New Sequence string implementation. New string_member. - - Revision 1.3 1999/06/03 17:10:50 sll - Updated String_out and String_var to CORBA 2.2 - - Revision 1.2 1999/05/25 13:24:06 sll - Removed unnecessary const qualifier in operator char*(). - - Revision 1.1 1999/04/21 11:18:31 djr - Initial revision - -*/ - - #ifndef __OMNI_STRINGTYPES_H__ #define __OMNI_STRINGTYPES_H__ @@ -133,15 +49,22 @@ // we don't initialise to empty string. // does not include nul terminator. -static inline void free(char* s) { +static inline void dealloc(char* s) { if (s && s != empty_string) delete[] s; } // As CORBA::string_free(). static inline char* dup(const char* s) { - char* r = alloc((int)strlen(s)); + int l = (int)strlen(s); + char* r = alloc(l); if (r) { +#if defined(_MSC_VER) + strcpy_s(r, l+1, s); +#elif defined(__darwin__) + strlcpy(r, s, l+1); +#else strcpy(r, s); +#endif return r; } return 0; @@ -181,17 +104,17 @@ inline _CORBA_String_var(const _CORBA_String_element& s); inline ~_CORBA_String_var() { - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); } inline _CORBA_String_var& operator=(char* p) { - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); _data = p; return *this; } inline _CORBA_String_var& operator=(const char* p) { - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); _data = 0; if (p) _data = _CORBA_String_helper::dup(p); return *this; @@ -199,7 +122,7 @@ inline _CORBA_String_var& operator=(const _CORBA_String_var& s) { if (&s != this) { - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); _data = 0; if( (const char*)s ) _data = _CORBA_String_helper::dup(s); } @@ -235,7 +158,7 @@ inline char*& inout() { return _data; } inline char*& out() { if( _data ){ - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); _data = 0; } return _data; @@ -275,17 +198,17 @@ } inline ~_CORBA_String_member() { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); } inline _CORBA_String_member& operator=(char* s) { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); _ptr = s; return *this; } inline _CORBA_String_member& operator= (const char* s) { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); if (s) _ptr = _CORBA_String_helper::dup(s); else @@ -295,7 +218,7 @@ inline _CORBA_String_member& operator=(const _CORBA_String_member& s) { if (&s != this) { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); if (s._ptr && s._ptr != _CORBA_String_helper::empty_string) _ptr = _CORBA_String_helper::dup(s._ptr); else @@ -305,7 +228,7 @@ } inline _CORBA_String_member& operator=(const _CORBA_String_var& s) { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); if( (const char*)s ) { _ptr = _CORBA_String_helper::dup((const char*)s); } @@ -341,7 +264,7 @@ inline const char* in() const { return _ptr; } inline char*& inout() { return _ptr; } inline char*& out() { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); _ptr = 0; return _ptr; } @@ -382,14 +305,14 @@ inline _CORBA_String_element& operator=(char* s) { if (pd_rel) - _CORBA_String_helper::free(pd_data); + _CORBA_String_helper::dealloc(pd_data); pd_data = s; return *this; } inline _CORBA_String_element& operator= (const char* s) { if (pd_rel) - _CORBA_String_helper::free(pd_data); + _CORBA_String_helper::dealloc(pd_data); if (s) pd_data = _CORBA_String_helper::dup(s); else @@ -400,7 +323,7 @@ inline _CORBA_String_element& operator=(const _CORBA_String_element& s) { if (s.pd_data != pd_data) { if (pd_rel) - _CORBA_String_helper::free(pd_data); + _CORBA_String_helper::dealloc(pd_data); if (s.pd_data && s.pd_data != _CORBA_String_helper::empty_string) pd_data = _CORBA_String_helper::dup(s.pd_data); else { @@ -412,7 +335,7 @@ inline _CORBA_String_element& operator=(const _CORBA_String_var& s) { if (pd_rel) - _CORBA_String_helper::free(pd_data); + _CORBA_String_helper::dealloc(pd_data); if( (const char*)s ) pd_data = _CORBA_String_helper::dup((const char*)s); else @@ -422,7 +345,7 @@ inline _CORBA_String_element& operator=(const _CORBA_String_member& s) { if (pd_rel) - _CORBA_String_helper::free(pd_data); + _CORBA_String_helper::dealloc(pd_data); if( (const char*)s && (const char*) s != _CORBA_String_helper::empty_string) pd_data = _CORBA_String_helper::dup((const char*)s); @@ -457,7 +380,7 @@ inline char*& inout() { return pd_data; } inline char*& out() { if (pd_rel) { - _CORBA_String_helper::free(pd_data); + _CORBA_String_helper::dealloc(pd_data); pd_data = 0; } else { @@ -514,7 +437,7 @@ inline _CORBA_String_var& _CORBA_String_var::operator= (const _CORBA_String_member& s) { - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); if ((const char*)s) _data = _CORBA_String_helper::dup(s); else @@ -525,7 +448,7 @@ inline _CORBA_String_var& _CORBA_String_var::operator= (const _CORBA_String_element& s) { - _CORBA_String_helper::free(_data); + _CORBA_String_helper::dealloc(_data); if ((const char*)s) _data = _CORBA_String_helper::dup(s); else @@ -535,7 +458,7 @@ inline _CORBA_String_member& _CORBA_String_member::operator=(const _CORBA_String_element& s) { - _CORBA_String_helper::free(_ptr); + _CORBA_String_helper::dealloc(_ptr); if( (const char*)s ) _ptr = _CORBA_String_helper::dup((const char*)s); else @@ -682,7 +605,7 @@ } ptr_arith_t l = (ptr_arith_t) b[1]; for (_CORBA_ULong i = 0; i < (_CORBA_ULong) l; i++) { - _CORBA_String_helper::free(buf[i]); + _CORBA_String_helper::dealloc(buf[i]); } b[0] = (char*) 0; delete [] b; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/templatedecls.h omniorb-dfsg-4.2.2/include/omniORB4/templatedecls.h --- omniorb-dfsg-4.1.6/include/omniORB4/templatedecls.h 2009-09-22 15:25:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/templatedecls.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,23 +8,21 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** #ifndef __TEMPLATEDECLS_H__ #define __TEMPLATEDECLS_H__ @@ -794,21 +792,28 @@ inline _CORBA_ConstrType_Fix_Var() {} inline _CORBA_ConstrType_Fix_Var(T* p) { pd_data = *p; delete p; } + inline _CORBA_ConstrType_Fix_Var(const T& d) { pd_data = d; } inline _CORBA_ConstrType_Fix_Var(const T_var& p) { pd_data = p.pd_data; } inline ~_CORBA_ConstrType_Fix_Var() {} - inline T_var&operator= (T* p) { - pd_data = *p; - delete p; + inline T_var& operator= (T* p) { + if (p != &pd_data) { + pd_data = *p; + delete p; + } return *this; } inline T_var& operator= (const T_var& p) { - pd_data = p.pd_data; + if (&p != this) + pd_data = p.pd_data; + return *this; } - inline T_var& operator= (T p) { - pd_data = p; + inline T_var& operator= (const T& p) { + if (&p != &pd_data) + pd_data = p; + return *this; } inline T* operator->() const { return (T*) &pd_data; } diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/templatedefns.h omniorb-dfsg-4.2.2/include/omniORB4/templatedefns.h --- omniorb-dfsg-4.1.6/include/omniORB4/templatedefns.h 2003-09-26 16:12:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/templatedefns.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,23 +8,21 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: -// *** PROPRIETORY INTERFACE *** +// *** PROPRIETARY INTERFACE *** #ifndef __TEMPLATEDEFNS_H__ #define __TEMPLATEDEFNS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/tracedthread.h omniorb-dfsg-4.2.2/include/omniORB4/tracedthread.h --- omniorb-dfsg-4.1.6/include/omniORB4/tracedthread.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/tracedthread.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,56 +3,29 @@ // tracedthread.h Created on: 15/6/99 // Author : David Riddoch (djr) // +// Copyright (C) 2010-2013 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Research Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // omni_thread style mutex and condition variables with checks. // -/* - $Log$ - Revision 1.2.2.4 2002/04/28 20:39:46 dgrisby - autoconf, install location tweaks. - - Revision 1.2.2.3 2001/12/03 18:47:39 dpg1 - Detect use after deletion in traced mutex and condition. - - Revision 1.2.2.2 2001/08/17 13:49:08 dpg1 - Optional logging for traced mutexes and condition variables. - - Revision 1.2.2.1 2000/07/17 10:35:38 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.2 2000/02/09 12:06:37 djr - Additional checks for tracedmutex/conditions. - Removed superflouous member of omni_tracedmutex. - - Revision 1.1.2.1 1999/09/24 09:51:57 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNI_TRACEDTHREAD_H__ #define __OMNI_TRACEDTHREAD_H__ @@ -70,9 +43,19 @@ #ifndef OMNIORB_ENABLE_LOCK_TRACES #define ASSERT_OMNI_TRACEDMUTEX_HELD(m, yes) -typedef omni_mutex omni_tracedmutex; + +class omni_tracedmutex : public omni_mutex { +public: + inline omni_tracedmutex(const char* /*name*/=0) : omni_mutex() {} +}; + typedef omni_mutex_lock omni_tracedmutex_lock; -typedef omni_condition omni_tracedcondition; + +class omni_tracedcondition : public omni_condition { +public: + inline omni_tracedcondition(omni_tracedmutex* m, const char* /*name*/=0) + : omni_condition(m) {} +}; #else @@ -81,7 +64,7 @@ class omni_tracedmutex { public: - omni_tracedmutex(); + omni_tracedmutex(const char* name=0); ~omni_tracedmutex(); void lock(); @@ -91,11 +74,6 @@ void assert_held(const char* file, int line, int yes); - void log(const char* name); - // Call this to cause logging messages whenever the mutex is locked - // or unlocked. The storage associated with name must exist until - // the mutex is deleted, or log(0) is called. - private: friend class omni_tracedcondition; @@ -107,7 +85,7 @@ omni_thread* pd_holder; // the thread holding pd_m, or 0 int pd_n_conds; // number of dependent condition vars int pd_deleted; // set true on deletion, may catch later use - const char* pd_logname; // if non-zero, name to use for logging + char* pd_logname; // name to use for logging }; ////////////////////////////////////////////////////////////////////// @@ -116,19 +94,15 @@ class omni_tracedcondition { public: - omni_tracedcondition(omni_tracedmutex* m); + omni_tracedcondition(omni_tracedmutex* m, const char* name = 0); ~omni_tracedcondition(); void wait(); int timedwait(unsigned long secs, unsigned long nanosecs = 0); + inline int timedwait(const omni_time_t& t) { return timedwait(t.s, t.ns); } void signal(); void broadcast(); - void log(const char* name); - // Call this to cause logging messages whenever the condition is - // signalled or waited upon. The storage associated with name must - // exist until the mutex is deleted, or log(0) is called. - private: omni_tracedcondition(const omni_tracedcondition&); omni_tracedcondition& operator=(const omni_tracedcondition&); @@ -137,7 +111,7 @@ omni_condition pd_cond; int pd_n_waiters; int pd_deleted; - const char* pd_logname; + char* pd_logname; }; ////////////////////////////////////////////////////////////////////// @@ -163,6 +137,7 @@ // #ifndef OMNIORB_ENABLE_LOCK_TRACES #endif + ////////////////////////////////////////////////////////////////////// ///////////////////////// omni_optional_lock ///////////////////////// ////////////////////////////////////////////////////////////////////// @@ -184,5 +159,22 @@ omni_tracedmutex& pd_m; }; + +////////////////////////////////////////////////////////////////////// +//////////////////////// omni_tracedmutex_unlock ///////////////////// +////////////////////////////////////////////////////////////////////// + +class omni_tracedmutex_unlock { +public: + inline omni_tracedmutex_unlock(omni_tracedmutex& m) : pd_m(m) { m.unlock(); } + inline ~omni_tracedmutex_unlock() { pd_m.lock(); } + +private: + omni_tracedmutex_unlock(const omni_tracedmutex_unlock&); + omni_tracedmutex_unlock& operator=(const omni_tracedmutex_unlock&); + + omni_tracedmutex& pd_m; +}; + #endif // __OMNITRACEDTHREAD_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/userexception.h omniorb-dfsg-4.2.2/include/omniORB4/userexception.h --- omniorb-dfsg-4.1.6/include/omniORB4/userexception.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/userexception.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,84 +3,28 @@ // userexception.h Created on: 1999 // Author : David Riddoch (djr) // -// Copyright (C) 2003-2004 Apasphere Ltd +// Copyright (C) 2003-2011 Apasphere Ltd // Copyright (C) 1996-1999 AT&T Laboratories Cambridge // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // -/* - $Log$ - Revision 1.4.2.2 2004/07/23 10:29:57 dgrisby - Completely new, much simpler Any implementation. - - Revision 1.4.2.1 2003/03/23 21:03:59 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.2.2.6 2001/10/17 16:44:01 dpg1 - Update DynAny to CORBA 2.5 spec, const Any exception extraction. - - Revision 1.2.2.5 2001/09/19 17:44:20 sll - Remove obsolute system exception WRONG_TRANSACTION - - Revision 1.2.2.4 2001/07/31 15:59:02 sll - Added new 2.4.2 System Exceptions - - Revision 1.2.2.3 2000/11/03 19:05:30 sll - Added INV_POLICY and CODESET_INCOMPATIBLE. - - Revision 1.2.2.2 2000/09/27 16:58:07 sll - Replaced marshalling operators for MemBufferedStream and NetBufferedStream - with just one type for cdrStream. - - Revision 1.2.2.1 2000/07/17 10:35:38 sll - Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. - - Revision 1.3 2000/07/13 15:26:04 dpg1 - Merge from omni3_develop for 3.0 release. - - Revision 1.1.2.7 2000/01/27 10:55:44 djr - Mods needed for powerpc_aix. New macro OMNIORB_BASE_CTOR to provide - fqname for base class constructor for some compilers. - - Revision 1.1.2.6 1999/10/21 11:29:46 djr - Added _core_attr to declaration of _PD_repoId in exceptions & interfaces. - - Revision 1.1.2.5 1999/10/18 17:28:19 djr - Fixes for building MSVC dlls. - - Revision 1.1.2.4 1999/10/18 11:27:37 djr - Centralised list of system exceptions. - - Revision 1.1.2.3 1999/10/04 17:08:30 djr - Some more fixes/MSVC work-arounds. - - Revision 1.1.2.2 1999/10/04 15:51:51 djr - Various fixes/MSVC work-arounds. - - Revision 1.1.2.1 1999/09/24 09:51:58 djr - Moved from omniORB2 + some new files. - -*/ - #ifndef __OMNIORB_USEREXCEPTION_H__ #define __OMNIORB_USEREXCEPTION_H__ @@ -201,5 +145,4 @@ doit (TRANSACTION_MODE) \ doit (BAD_QOS) - #endif // __OMNIORB_USEREXCEPTION_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/valueFactoryManager.h omniorb-dfsg-4.2.2/include/omniORB4/valueFactoryManager.h --- omniorb-dfsg-4.1.6/include/omniORB4/valueFactoryManager.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/valueFactoryManager.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,33 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // Manager for ValueFactories // -// $Log$ -// Revision 1.1.2.2 2004/02/16 10:10:29 dgrisby -// More valuetype, including value boxes. C++ mapping updates. -// -// Revision 1.1.2.1 2003/09/26 16:12:53 dgrisby -// Start of valuetype support. -// - #include diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/valueTemplatedecls.h omniorb-dfsg-4.2.2/include/omniORB4/valueTemplatedecls.h --- omniorb-dfsg-4.1.6/include/omniORB4/valueTemplatedecls.h 2009-09-22 15:25:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/valueTemplatedecls.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,58 +3,28 @@ // valueTemplatedecls.h Created on: 2003/09/24 // Author : Duncan Grisby // -// Copyright (C) 2003-2007 Apasphere Ltd. +// Copyright (C) 2003-2009 Apasphere Ltd. // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // ValueType templates // -/* - $Log$ - Revision 1.1.2.8 2007/04/18 22:32:43 dgrisby - Missing definition of ptr_arith_t on Win64. - - Revision 1.1.2.7 2006/05/25 18:17:18 dgrisby - Comment fixes. - - Revision 1.1.2.6 2005/08/16 13:51:21 dgrisby - Problems with valuetype / abstract interface C++ mapping. - - Revision 1.1.2.5 2005/01/06 17:31:06 dgrisby - Changes (mainly from omni4_0_develop) to compile on gcc 3.4. - - Revision 1.1.2.4 2004/10/13 17:58:19 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.1.2.3 2004/07/04 23:53:35 dgrisby - More ValueType TypeCode and Any support. - - Revision 1.1.2.2 2003/11/06 11:56:55 dgrisby - Yet more valuetype. Plain valuetype and abstract valuetype are now working. - - Revision 1.1.2.1 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - -*/ - #ifndef __VALUETEMPLATEDECLS_H__ #define __VALUETEMPLATEDECLS_H__ @@ -447,76 +417,81 @@ //////////////////////////// _CORBA_Sequence_Value /////////////////// ////////////////////////////////////////////////////////////////////// -template +template class _CORBA_Sequence_Value { public: - typedef _CORBA_Sequence_Value T_seq; + typedef _CORBA_Sequence_Value T_seq; inline _CORBA_ULong maximum() const { return pd_max; } inline _CORBA_ULong length() const { return pd_len; } - inline void length(_CORBA_ULong len) { - if (pd_bounded && len > pd_max) { - _CORBA_bound_check_error(); - // never reach here. - } - - // If we've shrunk we need to clear the entries at the top. - for( _CORBA_ULong i = len; i < pd_len; i++ ) - operator[](i) = 0; - + inline void length(_CORBA_ULong len) + { if (len) { - // Allocate buffer on-demand. Either pd_data == 0 - // or pd_data = buffer for pd_max elements - if (!pd_data || len > pd_max) { - copybuffer(((len > pd_max) ? len : pd_max)); + if (len > pd_max) { + if (pd_bounded) { + _CORBA_bound_check_error(); + // Never reach here. + } + // Grow exponentially + _CORBA_ULong newmax = pd_max * 2; + copybuffer((len > newmax) ? len : newmax); + } + else if (!pd_buf) { + // Allocate initial buffer + copybuffer(pd_max); + } + else { + // We have shrunk. Clear the entries at the top + for (_CORBA_ULong i = len; i < pd_len; i++) { + T_Helper::remove_ref(pd_buf[i]); + pd_buf[i] = 0; + } + } + } + else { + // Zero length. Deallocate buffer if it is owned by us. + if (pd_rel && pd_buf) { + freebuf(pd_buf); + pd_buf = 0; + if (!pd_bounded) + pd_max = 0; } } - pd_len = len; } - inline ElemT operator[] (_CORBA_ULong i) { + inline T_Elem operator[] (_CORBA_ULong i) { if( i >= pd_len ) _CORBA_bound_check_error(); - return ElemT(pd_data[i],pd_rel); + return T_Elem(pd_buf[i],pd_rel); } - inline ElemT operator[] (_CORBA_ULong i) const { + inline T_Elem operator[] (_CORBA_ULong i) const { if( i >= pd_len ) _CORBA_bound_check_error(); - return ElemT(pd_data[i],pd_rel); + return T_Elem(pd_buf[i],pd_rel); } -#if SIZEOF_PTR == SIZEOF_LONG - typedef long ptr_arith_t; -#elif SIZEOF_PTR == SIZEOF_INT - typedef int ptr_arith_t; -#elif defined (_WIN64) - typedef size_t ptr_arith_t; -#else -#error "No suitable type to do pointer arithmetic" -#endif - static inline T** allocbuf(_CORBA_ULong nelems) { if (!nelems) return 0; - T** b = new T*[nelems+2]; - ptr_arith_t l = nelems; - for (_CORBA_ULong i_ = 2; i_ < nelems+2; i_++) { + + T** b = new T*[nelems+1]; + + for (_CORBA_ULong i_ = 1; i_ < nelems+1; i_++) { b[i_] = 0; } - b[0] = (T*) ((ptr_arith_t)0x5351564CU); - b[1] = (T*) l; - return b+2; + b[0] = (T*) (omni_ptr_arith_t) nelems; + return b+1; } static inline void freebuf(T** buf) { if (!buf) return; - T** b = buf-2; - if ((ptr_arith_t)b[0] != ((ptr_arith_t) 0x5351564CU)) { - _CORBA_bad_param_freebuf(); - return; - } - ptr_arith_t l = (ptr_arith_t) b[1]; - for (_CORBA_ULong i = 0; i < (_CORBA_ULong) l; i++) { - T_Helper::remove_ref(buf[i]); + + T** b = buf-1; + + _CORBA_ULong l = (_CORBA_ULong) (omni_ptr_arith_t) b[0]; + for (_CORBA_ULong i = 0; i < l; i++) { + if (buf[i]) { + T_Helper::remove_ref(buf[i]); + } } b[0] = (T*) 0; delete [] b; @@ -526,18 +501,19 @@ inline _CORBA_Boolean release() const { return pd_rel; } inline T** get_buffer(_CORBA_Boolean orphan = 0) { - if (pd_max && !pd_data) { + if (pd_max && !pd_buf) { copybuffer(pd_max); } if (!orphan) { - return pd_data; + return pd_buf; } else { - if (!pd_rel) + if (!pd_rel) { return 0; + } else { - T** tmp = pd_data; - pd_data = 0; + T** tmp = pd_buf; + pd_buf = 0; if (!pd_bounded) { pd_max = 0; } @@ -549,34 +525,33 @@ } inline T*const * get_buffer() const { - if (pd_max && !pd_data) { + if (pd_max && !pd_buf) { T_seq* s = OMNI_CONST_CAST(T_seq*, this); s->copybuffer(pd_max); } - return pd_data; + return pd_buf; } inline ~_CORBA_Sequence_Value() { - if (pd_rel && pd_data) freebuf(pd_data); - pd_data = 0; + if (pd_rel && pd_buf) freebuf(pd_buf); + pd_buf = 0; } - // omniORB2 extensions + // omniORB extensions inline void operator>>= (cdrStream &s) const; inline void operator<<= (cdrStream &s); - // omniORB extensions - inline T** NP_data() const { return pd_data; } + inline T** NP_data() const { return pd_buf; } inline void NP_norelease() { pd_rel = 0; } protected: inline _CORBA_Sequence_Value() - : pd_max(0), pd_len(0), pd_rel(1), pd_bounded(0), pd_data(0) {} + : pd_max(0), pd_len(0), pd_rel(1), pd_bounded(0), pd_buf(0) {} inline _CORBA_Sequence_Value(_CORBA_ULong max, _CORBA_Boolean bounded=0) - : pd_max(max), pd_len(0), pd_rel(1), pd_bounded(bounded), pd_data(0) {} + : pd_max(max), pd_len(0), pd_rel(1), pd_bounded(bounded), pd_buf(0) {} inline _CORBA_Sequence_Value(_CORBA_ULong max, _CORBA_ULong len, @@ -584,7 +559,7 @@ _CORBA_Boolean release_ = 0, _CORBA_Boolean bounded = 0) : pd_max(max), pd_len(len), pd_rel(release_), - pd_bounded(bounded), pd_data(value) + pd_bounded(bounded), pd_buf(value) { if (len > max || (len && !value)) { _CORBA_bound_check_error(); @@ -594,16 +569,39 @@ inline _CORBA_Sequence_Value(const T_seq& s) : pd_max(s.pd_max), pd_len(0), pd_rel(1), - pd_bounded(s.pd_bounded), pd_data(0) { + pd_bounded(s.pd_bounded), pd_buf(0) + { length(s.pd_len); - for( _CORBA_ULong i = 0; i < pd_len; i++ ) - operator[](i) = s[i]; + for (_CORBA_ULong i = 0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + if (pd_buf[i]) + T_Helper::add_ref(pd_buf[i]); + } } inline T_seq& operator= (const T_seq& s) { - length(s.pd_len); - for( _CORBA_ULong i = 0; i < pd_len; i++ ) - operator[](i) = s[i]; + _CORBA_ULong i; + + if (pd_rel) { + for (i=0; i < pd_len; i++) { + T_Helper::remove_ref(pd_buf[i]); + pd_buf[i] = 0; + } + pd_len = 0; + length(s.pd_len); + for (i = 0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + if (pd_buf[i]) + T_Helper::add_ref(pd_buf[i]); + } + } + else { + pd_len = 0; + length(s.pd_len); + for (i = 0; i < pd_len; i++) { + pd_buf[i] = s.pd_buf[i]; + } + } return *this; } @@ -614,12 +612,12 @@ _CORBA_bound_check_error(); // never reach here } - if (pd_rel && pd_data) { - freebuf(pd_data); + if (pd_rel && pd_buf) { + freebuf(pd_buf); } pd_max = max; pd_len = len; - pd_data = data; + pd_buf = data; pd_rel = release_; } @@ -627,7 +625,7 @@ protected: void copybuffer(_CORBA_ULong newmax) { - // replace pd_data with a new buffer of size newmax. + // replace pd_buf with a new buffer of size newmax. // Invariant: pd_len <= newmax // T** newdata = allocbuf(newmax); @@ -635,23 +633,23 @@ _CORBA_new_operator_return_null(); // never reach here } - for (unsigned long i_=0; i_ < pd_len; i_++) { - if (pd_rel) { - newdata[i_] = pd_data[i_]; - pd_data[i_] = 0; + if (pd_rel) { + for (unsigned long i_=0; i_ < pd_len; i_++) { + newdata[i_] = pd_buf[i_]; + pd_buf[i_] = 0; } - else { - newdata[i_] = pd_data[i_]; - T_Helper::add_ref(newdata[i_]); + if (pd_buf) { + freebuf(pd_buf); } } - if (pd_rel && pd_data) { - freebuf(pd_data); - } else { + for (unsigned long i_=0; i_ < pd_len; i_++) { + T_Helper::add_ref(pd_buf[i_]); + newdata[i_] = pd_buf[i_]; + } pd_rel = 1; } - pd_data = newdata; + pd_buf = newdata; pd_max = newmax; } @@ -659,7 +657,7 @@ _CORBA_ULong pd_len; _CORBA_Boolean pd_rel; _CORBA_Boolean pd_bounded; - T** pd_data; + T** pd_buf; }; @@ -667,11 +665,11 @@ ///////////////// _CORBA_Unbounded_Sequence_Value //////////////////// ////////////////////////////////////////////////////////////////////// -template -class _CORBA_Unbounded_Sequence_Value : public _CORBA_Sequence_Value { +template +class _CORBA_Unbounded_Sequence_Value : public _CORBA_Sequence_Value { public: - typedef _CORBA_Unbounded_Sequence_Value T_seq; - typedef _CORBA_Sequence_Value Base_T_seq; + typedef _CORBA_Unbounded_Sequence_Value T_seq; + typedef _CORBA_Sequence_Value Base_T_seq; inline _CORBA_Unbounded_Sequence_Value() {} inline _CORBA_Unbounded_Sequence_Value(_CORBA_ULong max) : @@ -703,11 +701,11 @@ ///////////////// _CORBA_Bounded_Sequence_Value ////////////////////// ////////////////////////////////////////////////////////////////////// -template -class _CORBA_Bounded_Sequence_Value : public _CORBA_Sequence_Value { +template +class _CORBA_Bounded_Sequence_Value : public _CORBA_Sequence_Value { public: - typedef _CORBA_Bounded_Sequence_Value T_seq; - typedef _CORBA_Sequence_Value Base_T_seq; + typedef _CORBA_Bounded_Sequence_Value T_seq; + typedef _CORBA_Sequence_Value Base_T_seq; inline _CORBA_Bounded_Sequence_Value() : Base_T_seq(max,1){} @@ -725,6 +723,12 @@ return *this; } + static inline T** allocbuf(_CORBA_ULong /*nelems*/) { + return Base_T_seq::allocbuf(max); + } + + static inline T** allocbuf() { return allocbuf(max); } + // CORBA 2.3 additions inline void replace(_CORBA_ULong len, T** data, _CORBA_Boolean release_ = 0) { diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/valueTemplatedefns.h omniorb-dfsg-4.2.2/include/omniORB4/valueTemplatedefns.h --- omniorb-dfsg-4.1.6/include/omniORB4/valueTemplatedefns.h 2005-08-16 13:51:21.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/valueTemplatedefns.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,24 +3,22 @@ // valueTemplatedefns.h Created on: 2005/01/06 // Author : Duncan Grisby // -// Copyright (C) 2005 Apasphere Ltd. +// Copyright (C) 2005-2009 Apasphere Ltd. // // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: @@ -31,14 +29,13 @@ #define __VALUETEMPLATEDEFNS_H__ - template inline void _CORBA_Sequence_Value::operator>>= (cdrStream& s) const { ::operator>>=(_CORBA_ULong(pd_len), s); for (int i = 0; i < (int)pd_len; i++) - T_Helper::marshal(pd_data[i], s); + T_Helper::marshal(pd_buf[i], s); } template @@ -50,11 +47,21 @@ _CORBA_marshal_sequence_range_check_error(s); // never reach here } + + _CORBA_ULong i; + + if (pd_rel) { + for (i=0; i < pd_len; i++) { + T_Helper::remove_ref(pd_buf[i]); + pd_buf[i] = 0; + } + } + pd_len = 0; + length(l); - for( _CORBA_ULong i = 0; i < l; i++ ) - operator[](i) = T_Helper::unmarshal(s); + for (i = 0; i < l; i++) + pd_buf[i] = T_Helper::unmarshal(s); } - #endif // __VALUETEMPLATEDEFNS_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/valueType.h omniorb-dfsg-4.2.2/include/omniORB4/valueType.h --- omniorb-dfsg-4.1.6/include/omniORB4/valueType.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/valueType.h 2017-02-20 22:45:59.000000000 +0000 @@ -8,41 +8,23 @@ // This file is part of the omniORB library // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // ValueType definitions // -/* - $Log$ - Revision 1.1.2.4 2004/10/13 17:58:19 dgrisby - Abstract interfaces support; values support interfaces; value bug fixes. - - Revision 1.1.2.3 2004/07/26 22:56:38 dgrisby - Support valuetypes in Anys. - - Revision 1.1.2.2 2004/07/04 23:53:35 dgrisby - More ValueType TypeCode and Any support. - - Revision 1.1.2.1 2003/09/26 16:12:53 dgrisby - Start of valuetype support. - -*/ - #ifndef __OMNI_VALUETYPE_H__ #define __OMNI_VALUETYPE_H__ diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/wstringtypes.h omniorb-dfsg-4.2.2/include/omniORB4/wstringtypes.h --- omniorb-dfsg-4.1.6/include/omniORB4/wstringtypes.h 2010-05-06 16:18:38.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/wstringtypes.h 2017-02-20 22:45:59.000000000 +0000 @@ -3,73 +3,29 @@ // wstringtypes.h Created on: 27/10/2000 // Author : Duncan Grisby (dpg1) // +// Copyright (C) 2003-2013 Apasphere Ltd // Copyright (C) 2000 AT&T Laboratories Cambridge // // This file is part of the omniORB library. // // The omniORB library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // Description: // The CORBA wide string type helpers. Also sequence of wide string. // -/* - $Log$ - Revision 1.1.4.3 2005/03/30 23:36:14 dgrisby - Another merge from omni4_0_develop. - - Revision 1.1.4.2 2005/01/06 23:08:22 dgrisby - Big merge from omni4_0_develop. - - Revision 1.1.4.1 2003/03/23 21:03:58 dgrisby - Start of omniORB 4.1.x development branch. - - Revision 1.1.2.10 2003/01/16 12:47:08 dgrisby - Const cast macro. Thanks Matej Kenda. - - Revision 1.1.2.9 2003/01/14 11:48:16 dgrisby - Remove warnings from gcc -Wshadow. Thanks Pablo Mejia. - - Revision 1.1.2.8 2002/03/11 12:23:03 dpg1 - Tweaks to avoid compiler warnings. - - Revision 1.1.2.7 2001/11/06 15:41:35 dpg1 - Reimplement Context. Remove CORBA::Status. Tidying up. - - Revision 1.1.2.6 2001/09/19 17:26:44 dpg1 - Full clean-up after orb->destroy(). - - Revision 1.1.2.5 2001/08/17 13:44:08 dpg1 - Change freeing behaviour of string members and elements. - - Revision 1.1.2.4 2000/11/17 19:11:16 dpg1 - Rename _CORBA_Sequence__WString to _CORBA_Sequence_WString. - - Revision 1.1.2.3 2000/11/15 17:04:33 sll - Removed marshalling functions from WString_helper. - - Revision 1.1.2.2 2000/11/09 12:27:50 dpg1 - Huge merge from omni3_develop, plus full long long from omni3_1_develop. - - Revision 1.1.2.1 2000/10/27 15:42:03 dpg1 - Initial code set conversion support. Not yet enabled or fully tested. - -*/ - #ifndef __OMNI_WSTRINGTYPES_H__ #define __OMNI_WSTRINGTYPES_H__ @@ -94,7 +50,7 @@ // don't initialise to empty string. does not include nul // terminator. -static inline void free(_CORBA_WChar* s) { +static inline void dealloc(_CORBA_WChar* s) { if (s && s != empty_wstring) delete[] s; } // As CORBA::wstring_free(). @@ -153,17 +109,17 @@ inline _CORBA_WString_var(const _CORBA_WString_element& s); inline ~_CORBA_WString_var() { - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); } inline _CORBA_WString_var& operator=(_CORBA_WChar* p) { - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); _data = p; return *this; } inline _CORBA_WString_var& operator=(const _CORBA_WChar* p) { - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); _data = 0; if (p) _data = _CORBA_WString_helper::dup(p); return *this; @@ -171,7 +127,7 @@ inline _CORBA_WString_var& operator=(const _CORBA_WString_var& s) { if (&s != this) { - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); _data = 0; if( (const _CORBA_WChar*)s ) _data = _CORBA_WString_helper::dup(s); } @@ -207,7 +163,7 @@ inline _CORBA_WChar*& inout() { return _data; } inline _CORBA_WChar*& out() { if( _data ){ - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); _data = 0; } return _data; @@ -247,17 +203,17 @@ } inline ~_CORBA_WString_member() { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); } inline _CORBA_WString_member& operator=(_CORBA_WChar* s) { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); _ptr = s; return *this; } inline _CORBA_WString_member& operator= (const _CORBA_WChar* s) { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); if (s) _ptr = _CORBA_WString_helper::dup(s); else @@ -267,7 +223,7 @@ inline _CORBA_WString_member& operator=(const _CORBA_WString_member& s) { if (&s != this) { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); if (s._ptr && s._ptr != _CORBA_WString_helper::empty_wstring) _ptr = _CORBA_WString_helper::dup(s._ptr); else @@ -277,7 +233,7 @@ } inline _CORBA_WString_member& operator=(const _CORBA_WString_var& s) { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); if( (const _CORBA_WChar*)s ) { _ptr = _CORBA_WString_helper::dup((const _CORBA_WChar*)s); } @@ -313,7 +269,7 @@ inline const _CORBA_WChar* in() const { return _ptr; } inline _CORBA_WChar*& inout() { return _ptr; } inline _CORBA_WChar*& out() { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); _ptr = 0; return _ptr; } @@ -354,14 +310,14 @@ inline _CORBA_WString_element& operator=(_CORBA_WChar* s) { if (pd_rel) - _CORBA_WString_helper::free(pd_data); + _CORBA_WString_helper::dealloc(pd_data); pd_data = s; return *this; } inline _CORBA_WString_element& operator= (const _CORBA_WChar* s) { if (pd_rel) - _CORBA_WString_helper::free(pd_data); + _CORBA_WString_helper::dealloc(pd_data); if (s) pd_data = _CORBA_WString_helper::dup(s); else @@ -372,7 +328,7 @@ inline _CORBA_WString_element& operator=(const _CORBA_WString_element& s) { if (s.pd_data != pd_data) { if (pd_rel) - _CORBA_WString_helper::free(pd_data); + _CORBA_WString_helper::dealloc(pd_data); if (s.pd_data && s.pd_data != _CORBA_WString_helper::empty_wstring) pd_data = _CORBA_WString_helper::dup(s.pd_data); else @@ -383,7 +339,7 @@ inline _CORBA_WString_element& operator=(const _CORBA_WString_var& s) { if (pd_rel) - _CORBA_WString_helper::free(pd_data); + _CORBA_WString_helper::dealloc(pd_data); if( (const _CORBA_WChar*)s ) pd_data = _CORBA_WString_helper::dup((const _CORBA_WChar*)s); else @@ -393,7 +349,7 @@ inline _CORBA_WString_element& operator=(const _CORBA_WString_member& s) { if (pd_rel) - _CORBA_WString_helper::free(pd_data); + _CORBA_WString_helper::dealloc(pd_data); if( (const _CORBA_WChar*)s && (const _CORBA_WChar*) s != _CORBA_WString_helper::empty_wstring) pd_data = _CORBA_WString_helper::dup((const _CORBA_WChar*)s); @@ -428,7 +384,7 @@ inline _CORBA_WChar*& inout() { return pd_data; } inline _CORBA_WChar*& out() { if (pd_rel) { - _CORBA_WString_helper::free(pd_data); + _CORBA_WString_helper::dealloc(pd_data); pd_data = 0; } else { @@ -485,7 +441,7 @@ inline _CORBA_WString_var& _CORBA_WString_var::operator= (const _CORBA_WString_member& s) { - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); if ((const _CORBA_WChar*)s) _data = _CORBA_WString_helper::dup(s); else @@ -496,7 +452,7 @@ inline _CORBA_WString_var& _CORBA_WString_var::operator= (const _CORBA_WString_element& s) { - _CORBA_WString_helper::free(_data); + _CORBA_WString_helper::dealloc(_data); if ((const _CORBA_WChar*)s) _data = _CORBA_WString_helper::dup(s); else @@ -506,7 +462,7 @@ inline _CORBA_WString_member& _CORBA_WString_member::operator=(const _CORBA_WString_element& s) { - _CORBA_WString_helper::free(_ptr); + _CORBA_WString_helper::dealloc(_ptr); if( (const _CORBA_WChar*)s ) _ptr = _CORBA_WString_helper::dup((const _CORBA_WChar*)s); else @@ -655,7 +611,7 @@ } ptr_arith_t l = (ptr_arith_t) b[1]; for (_CORBA_ULong i = 0; i < (_CORBA_ULong) l; i++) { - _CORBA_WString_helper::free(buf[i]); + _CORBA_WString_helper::dealloc(buf[i]); } b[0] = (_CORBA_WChar*) 0; delete [] b; diff -Nru omniorb-dfsg-4.1.6/include/omniORB4/ziopStubs.h omniorb-dfsg-4.2.2/include/omniORB4/ziopStubs.h --- omniorb-dfsg-4.1.6/include/omniORB4/ziopStubs.h 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omniORB4/ziopStubs.h 2017-02-20 22:45:59.000000000 +0000 @@ -0,0 +1,133 @@ +// -*- Mode: C++; -*- +// Package : omniORB +// ziopStubs,h Created on: 2012/10/02 +// Author : Duncan Grisby (dgrisby) +// +// Copyright (C) 2012 Apasphere Ltd. +// +// This file is part of the omniORB library +// +// The omniORB library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ +// +// Description: +// ZIOP stubs + +#ifndef _omni_ziop_stubs_h_ +#define _omni_ziop_stubs_h_ + +// +// The fun of Windows DLL linkage... +// + +#ifdef _ziop_attr +# error "A local CPP macro _ziop_attr has already been defined." +#endif + +#ifdef _OMNIORB_ZIOP_LIBRARY +# define _ziop_attr +#else +# define _ziop_attr _OMNIORB_NTDLL_IMPORT +# ifndef USE_core_stub_in_nt_dll +# define USE_core_stub_in_nt_dll +# define USE_core_stub_in_nt_dll_was_set +# endif +#endif + +#include + + +// +// Definitions from standard ZIOP module +// + +#ifdef _dyn_attr +# error "A local CPP macro _dyn_attr has already been defined." +#endif + +#if defined(_OMNIORB_ZIOP_DYNAMIC_LIBRARY) +# define _dyn_attr +#else +# define _dyn_attr _OMNIORB_NTDLL_IMPORT +#endif + + +_CORBA_MODULE ZIOP +_CORBA_MODULE_BEG + +# include + +# define OMNIORB_DECLARE_ZIOP_POLICY_CLASS(name, type, valret, valmethod) \ + class name; \ + typedef name* name##_ptr; \ + \ + class name : public CORBA::Policy \ + { \ + public: \ + inline name(const name##Value& value_) : \ + CORBA::Policy(type), pd_value(value_) {} \ + inline name() {} \ + virtual ~name(); \ + \ + virtual CORBA::Policy_ptr copy(); \ + virtual valret valmethod(); \ + \ + virtual void* _ptrToObjRef(const char* repoId); \ + \ + static name##_ptr _duplicate(name##_ptr p); \ + static name##_ptr _narrow(CORBA::Object_ptr p); \ + static name##_ptr _nil(); \ + \ + static _ziop_attr const char* _PD_repoId; \ + \ + private: \ + name##Value pd_value; \ + }; \ + \ + typedef _CORBA_PseudoObj_Var name##_var + + OMNIORB_DECLARE_ZIOP_POLICY_CLASS(CompressionEnablingPolicy, + COMPRESSION_ENABLING_POLICY_ID, + CompressionEnablingPolicyValue, + compression_enabled); + + OMNIORB_DECLARE_ZIOP_POLICY_CLASS(CompressionIdLevelListPolicy, + COMPRESSOR_ID_LEVEL_LIST_POLICY_ID, + CompressionIdLevelListPolicyValue*, + compressor_ids); + + OMNIORB_DECLARE_ZIOP_POLICY_CLASS(CompressionLowValuePolicy, + COMPRESSION_LOW_VALUE_POLICY_ID, + CompressionLowValuePolicyValue, + low_value); + + OMNIORB_DECLARE_ZIOP_POLICY_CLASS(CompressionMinRatioPolicy, + COMPRESSION_MIN_RATIO_POLICY_ID, + CompressionMinRatioPolicyValue, + ratio); + +# undef OMNIORB_DECLARE_ZIOP_POLICY_CLASS + +_CORBA_MODULE_END + +# include + + +#ifdef USE_core_stub_in_nt_dll_was_set +# undef USE_core_stub_in_nt_dll +#endif + +#undef _ziop_attr +#undef _dyn_attr + +#endif // _omni_ziop_stubs_h_ diff -Nru omniorb-dfsg-4.1.6/include/omnithread/atomic.h omniorb-dfsg-4.2.2/include/omnithread/atomic.h --- omniorb-dfsg-4.1.6/include/omnithread/atomic.h 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/atomic.h 2017-02-20 22:45:59.000000000 +0000 @@ -0,0 +1,94 @@ +// -*- Mode: C++; -*- +// Package : omnithread +// omnithread/atomic.h Created : 2011/04/14 dgrisby +// +// Copyright (C) 2011 Apasphere Ltd +// +// This file is part of the omnithread library +// +// The omnithread library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ +// + +// +// Atomic operations for platforms that support them. + +#ifndef __omnithread_atomic_h_ +#define __omnithread_atomic_h_ + + +#ifdef OMNI_HAVE_SYNC_ADD_AND_FETCH + +# define OMNI_REFCOUNT_DEFINED + +class _OMNITHREAD_NTDLL_ omni_refcount { +public: + inline omni_refcount(int start) : count(start) {} + inline ~omni_refcount() {} + + // Atomically increment reference count and return new value + inline int inc() { + return __sync_add_and_fetch(&count, 1); + } + + // Atomically decrement reference count and return new value + inline int dec() { + return __sync_sub_and_fetch(&count, 1); + } + + // Return snapshot of current value. Real count may have changed by + // the time the value is looked at! + inline int value() { + return count; + } + +private: + volatile int count; +}; + +#endif // OMNI_ATOMIC_GCC_SYNC + + +#if defined(_MSC_VER) && !defined(OMNI_REFCOUNT_DEFINED) + +# define OMNI_REFCOUNT_DEFINED + +class _OMNITHREAD_NTDLL_ omni_refcount { +public: + inline omni_refcount(int start) : count(start) {} + inline ~omni_refcount() {} + + // Atomically increment reference count and return new value + inline int inc() { + return InterlockedIncrement(&count); + } + + // Atomically decrement reference count and return new value + inline int dec() { + return InterlockedDecrement(&count); + } + + // Return snapshot of current value. Real count may have changed by + // the time the value is looked at! + inline int value() { + return count; + } + +private: + volatile LONG count; +}; + +#endif // _MSC_VER + + +#endif // __omnithread_atomic_h_ diff -Nru omniorb-dfsg-4.1.6/include/omnithread/GNUmakefile.in omniorb-dfsg-4.2.2/include/omnithread/GNUmakefile.in --- omniorb-dfsg-4.1.6/include/omnithread/GNUmakefile.in 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/GNUmakefile.in 2011-04-20 17:24:30.000000000 +0000 @@ -6,7 +6,7 @@ INSTALLDIR = $(INSTALLINCDIR)/omnithread -HEADERS = mach.h nt.h posix.h pthread_nt.h solaris.h +HEADERS = nt.h posix.h pthread_nt.h atomic.h include $(TOP)/mk/beforeauto.mk diff -Nru omniorb-dfsg-4.1.6/include/omnithread/mach.h omniorb-dfsg-4.2.2/include/omnithread/mach.h --- omniorb-dfsg-4.1.6/include/omnithread/mach.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/mach.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -// Package : omnithread -// omnithread/posix.h Created : 7/97 lars immisch lars@ibp.de -// -// Copyright (C) 1994,1995,1996, 1997 Immisch, becker & Partner -// -// This file is part of the omnithread library -// -// The omnithread library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library 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 -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA -// -// -// OMNI thread implementation classes for posix threads -// - -#ifndef __omnithread_mach_h_ -#define __omnithread_mach_h_ - -#include - -extern "C" void* omni_thread_wrapper(void* ptr); - -#define OMNI_MUTEX_IMPLEMENTATION \ - struct mutex mach_mutex; - -#define OMNI_CONDITION_IMPLEMENTATION \ - struct condition mach_cond; - -#define OMNI_SEMAPHORE_IMPLEMENTATION \ - omni_mutex m; \ - omni_condition c; \ - int value; - - -#define OMNI_THREAD_IMPLEMENTATION \ - cthread_t mach_thread; \ - static int mach_priority(priority_t); \ - friend void* omni_thread_wrapper(void* ptr); - -#endif diff -Nru omniorb-dfsg-4.1.6/include/omnithread/nt.h omniorb-dfsg-4.2.2/include/omnithread/nt.h --- omniorb-dfsg-4.1.6/include/omnithread/nt.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/nt.h 2017-02-20 22:45:59.000000000 +0000 @@ -7,19 +7,17 @@ // This file is part of the omnithread library // // The omnithread library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // OMNI thread implementation classes for NT threads. diff -Nru omniorb-dfsg-4.1.6/include/omnithread/posix.h omniorb-dfsg-4.2.2/include/omnithread/posix.h --- omniorb-dfsg-4.1.6/include/omnithread/posix.h 2011-06-20 22:13:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/posix.h 2017-02-20 22:45:59.000000000 +0000 @@ -1,25 +1,23 @@ // Package : omnithread // omnithread/posix.h Created : 7/94 tjr // -// Copyright (C) 2002-2009 Apasphere Ltd +// Copyright (C) 2002-2012 Apasphere Ltd // Copyright (C) 1994-1997 Olivetti & Oracle Research Laboratory // // This file is part of the omnithread library // // The omnithread library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // // OMNI thread implementation classes for posix threads diff -Nru omniorb-dfsg-4.1.6/include/omnithread/pthread_nt.h omniorb-dfsg-4.2.2/include/omnithread/pthread_nt.h --- omniorb-dfsg-4.1.6/include/omnithread/pthread_nt.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/pthread_nt.h 2017-02-20 22:45:59.000000000 +0000 @@ -6,19 +6,17 @@ This file is part of the omnithread library The omnithread library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public + modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - + version 2.1 of the License, or (at your option) any later version. + This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see http://www.gnu.org/licenses/ Posix Threads implementation for Windows NT, version 4.0 */ diff -Nru omniorb-dfsg-4.1.6/include/omnithread/solaris.h omniorb-dfsg-4.2.2/include/omnithread/solaris.h --- omniorb-dfsg-4.1.6/include/omnithread/solaris.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/solaris.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -// Package : omnithread -// omnithread/solaris.h Created : 7/94 tjr -// -// Copyright (C) 1994,1995,1996, 1997 Olivetti & Oracle Research Laboratory -// -// This file is part of the omnithread library -// -// The omnithread library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library 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 -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA -// -// OMNI thread implementation classes for solaris threads. -// - -#ifndef __omnithread_solaris_h_ -#define __omnithread_solaris_h_ - -#include - -extern "C" void* omni_thread_wrapper(void* ptr); - -#define OMNI_MUTEX_IMPLEMENTATION \ - mutex_t sol_mutex; - -#define OMNI_CONDITION_IMPLEMENTATION \ - cond_t sol_cond; - -#define OMNI_SEMAPHORE_IMPLEMENTATION \ - sema_t sol_sem; - -#define OMNI_THREAD_IMPLEMENTATION \ - thread_t sol_thread; \ - static int sol_priority(priority_t); \ - friend void* omni_thread_wrapper(void* ptr); - -#endif diff -Nru omniorb-dfsg-4.1.6/include/omnithread/VxThread.h omniorb-dfsg-4.2.2/include/omnithread/VxThread.h --- omniorb-dfsg-4.1.6/include/omnithread/VxThread.h 2008-09-19 09:29:03.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread/VxThread.h 2013-07-18 11:28:03.000000000 +0000 @@ -9,36 +9,6 @@ %% Description: OMNI thread implementation classes for VxWorks threads %% Notes: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% $Log$ -%% Revision 1.1.4.4 2006/12/11 10:39:37 dgrisby -%% Silly duplicated member in vxWorks omnithread. -%% -%% Revision 1.1.4.3 2006/10/29 15:09:08 dgrisby -%% omni_condition broken on VxWorks. Thanks Aleksander Matveyev. -%% -%% Revision 1.1.4.2 2005/01/06 23:08:27 dgrisby -%% Big merge from omni4_0_develop. -%% -%% Revision 1.1.4.1 2003/03/23 21:03:40 dgrisby -%% Start of omniORB 4.1.x development branch. -%% -%% Revision 1.1.2.1 2003/02/17 02:03:07 dgrisby -%% vxWorks port. (Thanks Michael Sturm / Acterna Eningen GmbH). -%% -%% Revision 1.1.1.1 2002/11/19 14:55:21 sokcevti -%% OmniOrb4.0.0 VxWorks port -%% -%% Revision 1.2 2002/06/14 12:45:50 engeln -%% unnecessary members in condition removed. -%% --- -%% -%% Revision 1.1.1.1 2002/04/02 10:08:49 sokcevti -%% omniORB4 initial realease -%% -%% Revision 1.1 2001/03/23 16:50:23 hartmut -%% Initial Version 2.8 -%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ diff -Nru omniorb-dfsg-4.1.6/include/omnithread.h omniorb-dfsg-4.2.2/include/omnithread.h --- omniorb-dfsg-4.1.6/include/omnithread.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/include/omnithread.h 2017-02-20 22:45:59.000000000 +0000 @@ -2,25 +2,23 @@ // Package : omnithread // omnithread.h Created : 7/94 tjr // -// Copyright (C) 2002-2009 Apasphere Ltd +// Copyright (C) 2002-2011 Apasphere Ltd // Copyright (C) 1994-1997 Olivetti & Oracle Research Laboratory // // This file is part of the omnithread library // // The omnithread library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public +// modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. +// version 2.1 of the License, or (at your option) any later version. // // This library 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 -// Library General Public License for more details. +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free -// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library. If not, see http://www.gnu.org/licenses/ // // @@ -37,10 +35,6 @@ #ifndef __omnithread_h_ #define __omnithread_h_ -#ifndef NULL -#define NULL 0 -#endif - class omni_mutex; class omni_condition; class omni_semaphore; @@ -54,45 +48,29 @@ // #ifndef OMNI_THREAD_EXPOSE -#define OMNI_THREAD_EXPOSE private +# define OMNI_THREAD_EXPOSE private #endif // // Include implementation-specific header file. // -// This must define 4 CPP macros of the form OMNI_x_IMPLEMENTATION for mutex, +// This must define 7 CPP macros of the form OMNI_x_IMPLEMENTATION for mutex, // condition variable, semaphore and thread. Each should define any // implementation-specific members of the corresponding classes. // +// +// Windows -#if defined(__arm__) && defined(__atmos__) -#include +#if defined(__WIN32__) -#elif defined(__osf1__) -# include -# if defined(_OSF_SOURCE) && defined(signal) -# undef signal +# if defined(__POSIX_NT__) +# include +# else +# include # endif -#elif defined(__aix__) -#include - -#elif defined(__hpux__) -#include - -#elif defined(__vxWorks__) -#include - -#elif defined(__WIN32__) - -#if defined(__POSIX_NT__) -#include -#else -#include -#endif - -#if defined(_MSC_VER) || defined(__BCPLUSPLUS__) +# if defined(_MSC_VER) || defined(__BCPLUSPLUS__) // Using MSVC++ or Borland C++ to compile. If compiling library as a // DLL, define _OMNITHREAD_DLL. If compiling as a static library, @@ -101,95 +79,48 @@ // application is to be dynamically linked, there is no need to define // any of these macros). -#if defined (_OMNITHREAD_DLL) && defined(_WINSTATIC) -#error "Both _OMNITHREAD_DLL and _WINSTATIC are defined." -#elif defined(_OMNITHREAD_DLL) -#define _OMNITHREAD_NTDLL_ __declspec(dllexport) -#elif !defined(_WINSTATIC) -#define _OMNITHREAD_NTDLL_ __declspec(dllimport) -#elif defined(_WINSTATIC) -#define _OMNITHREAD_NTDLL_ -#endif +# if defined (_OMNITHREAD_DLL) && defined(_WINSTATIC) +# error "Both _OMNITHREAD_DLL and _WINSTATIC are defined." +# elif defined(_OMNITHREAD_DLL) +# define _OMNITHREAD_NTDLL_ __declspec(dllexport) +# elif !defined(_WINSTATIC) +# define _OMNITHREAD_NTDLL_ __declspec(dllimport) +# elif defined(_WINSTATIC) +# define _OMNITHREAD_NTDLL_ +# endif // _OMNITHREAD_DLL && _WINSTATIC -#else +# else // Not using MSVC++ to compile -#define _OMNITHREAD_NTDLL_ - -#endif - // _MSC_VER - -#elif defined(__sunos__) -#if __OSVERSION__ != 5 -// XXX Workaround for SUN C++ compiler (seen on 4.2) Template.DB code -// regeneration bug. See omniORB2/CORBA_sysdep.h for details. -#if !defined(__SUNPRO_CC) || __OSVERSION__ != '5' -#error "Only SunOS 5.x or later is supported." -#endif -#endif -#ifdef UseSolarisThreads -#include -#else -#include -#endif - -#elif defined(__linux__) -#include +# define _OMNITHREAD_NTDLL_ -#elif defined(__GLIBC__) -#include - -#elif defined(__nextstep__) -#include - -#elif defined(__VMS) -#include - -#elif defined(__SINIX__) -#include - -#elif defined(__osr5__) -#include - -#elif defined(__uw7__) -#include - -#elif defined(__irix__) -#include - -#elif defined(__freebsd__) -#include - -#elif defined(__netbsd__) -#include +# endif -#elif defined(__openbsd__) -#include +// +// vxWorks -#elif defined(__rtems__) -#include -#include +#elif defined(__vxWorks__) +# include -#elif defined(__darwin__) -#include +// +// Everything else uses pthreads -#elif defined(__macos__) -#include -#include +#else +# include -#elif defined(__cygwin__) -#include +#endif -#elif defined(__Lynx__) -#include +// +// Additional platform dependencies -#else -#error "No implementation header file" +#if defined(__macos__) +# include #endif + #if !defined(__WIN32__) -#define _OMNITHREAD_NTDLL_ +# define _OMNITHREAD_NTDLL_ #endif #if (!defined(OMNI_MUTEX_IMPLEMENTATION) || \ @@ -199,7 +130,7 @@ !defined(OMNI_CONDITION_IMPLEMENTATION) || \ !defined(OMNI_SEMAPHORE_IMPLEMENTATION) || \ !defined(OMNI_THREAD_IMPLEMENTATION)) -#error "Implementation header file incomplete" +# error "Implementation header file incomplete" #endif @@ -209,8 +140,8 @@ class _OMNITHREAD_NTDLL_ omni_thread_fatal { public: - int error; - omni_thread_fatal(int e = 0) : error(e) {} + int error; + omni_thread_fatal(int e = 0) : error(e) {} }; @@ -224,36 +155,124 @@ /////////////////////////////////////////////////////////////////////////// // +// Time +// +/////////////////////////////////////////////////////////////////////////// + +struct omni_time_t { + unsigned long s; // seconds + unsigned long ns; // nanoseconds + + inline omni_time_t(unsigned long _s=0, unsigned long _ns=0) + : s(_s), ns(_ns) {} + + inline void assign(unsigned long _s=0, unsigned long _ns=0) + { + s = _s; + ns = _ns; + } + + // void* operator used to test for non-zero time. We cant use bool + // in case we're using an ancient compiler with no bool. + inline operator void*() const + { + return (void*)(s || ns); + } + + inline int operator==(const omni_time_t& o) const + { + return o.s == s && o.ns == ns; + } + + inline int operator<(const omni_time_t& o) const + { + return s < o.s || (s == o.s && ns < o.ns); + } + + inline int operator<=(const omni_time_t& o) const + { + return s < o.s || (s == o.s && ns <= o.ns); + } + + inline int operator>(const omni_time_t& o) const + { + return s > o.s || (s == o.s && ns > o.ns); + } + + inline int operator>=(const omni_time_t& o) const + { + return s > o.s || (s == o.s && ns >= o.ns); + } + + inline omni_time_t& operator+=(const omni_time_t& o) + { + unsigned long os = o.s + o.ns / 1000000000; + unsigned long ons = o.ns % 1000000000; + unsigned long nns = ns + ons; + s += os + nns / 1000000000; + ns = nns % 1000000000; + return *this; + } + + inline const omni_time_t operator+(const omni_time_t& o) + { + omni_time_t n(*this); + n += o; + return n; + } + + inline omni_time_t& operator-=(const omni_time_t& o) + { + unsigned long os = o.s + o.ns / 1000000000; + unsigned long ons = o.ns % 1000000000; + unsigned long nns = ns + 1000000000 - ons; + + s -= os + (1 - nns / 1000000000); + ns = nns % 1000000000; + return *this; + } + + inline const omni_time_t operator-(const omni_time_t& o) + { + omni_time_t n(*this); + n -= o; + return n; + } +}; + + +/////////////////////////////////////////////////////////////////////////// +// // Mutex // /////////////////////////////////////////////////////////////////////////// class _OMNITHREAD_NTDLL_ omni_mutex { - public: - omni_mutex(void); - ~omni_mutex(void); + omni_mutex(); + ~omni_mutex(); - inline void lock(void) { OMNI_MUTEX_LOCK_IMPLEMENTATION } - inline void unlock(void) { OMNI_MUTEX_UNLOCK_IMPLEMENTATION } - inline int trylock(void) { OMNI_MUTEX_TRYLOCK_IMPLEMENTATION } - // if mutex is unlocked then lock it and return 1 (true). - // If it is already locked then return 0 (false). - - inline void acquire(void) { lock(); } - inline void release(void) { unlock(); } - // the names lock and unlock are preferred over acquire and release - // since we are attempting to be as POSIX-like as possible. + inline void lock() { OMNI_MUTEX_LOCK_IMPLEMENTATION } + inline void unlock() { OMNI_MUTEX_UNLOCK_IMPLEMENTATION } - friend class omni_condition; + inline int trylock() { OMNI_MUTEX_TRYLOCK_IMPLEMENTATION } + // if mutex is unlocked then lock it and return 1 (true). + // If it is already locked then return 0 (false). + + inline void acquire() { lock(); } + inline void release() { unlock(); } + // the names lock and unlock are preferred over acquire and release + // since we are attempting to be as POSIX-like as possible. + + friend class omni_condition; private: - // dummy copy constructor and operator= to prevent copying - omni_mutex(const omni_mutex&); - omni_mutex& operator=(const omni_mutex&); + // dummy copy constructor and operator= to prevent copying + omni_mutex(const omni_mutex&); + omni_mutex& operator=(const omni_mutex&); OMNI_THREAD_EXPOSE: - OMNI_MUTEX_IMPLEMENTATION + OMNI_MUTEX_IMPLEMENTATION }; // @@ -276,27 +295,31 @@ // class _OMNITHREAD_NTDLL_ omni_mutex_lock { - omni_mutex& mutex; public: - inline omni_mutex_lock(omni_mutex& m) : mutex(m) { mutex.lock(); } - inline ~omni_mutex_lock(void) { mutex.unlock(); } + inline omni_mutex_lock(omni_mutex& m) : mutex(m) { mutex.lock(); } + inline ~omni_mutex_lock() { mutex.unlock(); } + private: - // dummy copy constructor and operator= to prevent copying - omni_mutex_lock(const omni_mutex_lock&); - omni_mutex_lock& operator=(const omni_mutex_lock&); + omni_mutex& mutex; + + // dummy copy constructor and operator= to prevent copying + omni_mutex_lock(const omni_mutex_lock&); + omni_mutex_lock& operator=(const omni_mutex_lock&); }; class _OMNITHREAD_NTDLL_ omni_mutex_trylock { - omni_mutex& mutex; - const int locked; public: - omni_mutex_trylock(omni_mutex& m) : mutex(m), locked(mutex.trylock()) {} - ~omni_mutex_trylock(void) { if (locked) mutex.unlock(); } - operator int(void) const { return locked; } + omni_mutex_trylock(omni_mutex& m) : mutex(m), locked(mutex.trylock()) {} + ~omni_mutex_trylock() { if (locked) mutex.unlock(); } + operator int() const { return locked; } + private: - // dummy copy constructor and operator= to prevent copying - omni_mutex_trylock(const omni_mutex_trylock&); - omni_mutex_trylock& operator=(const omni_mutex_trylock&); + omni_mutex& mutex; + const int locked; + + // dummy copy constructor and operator= to prevent copying + omni_mutex_trylock(const omni_mutex_trylock&); + omni_mutex_trylock& operator=(const omni_mutex_trylock&); }; @@ -309,45 +332,51 @@ class _OMNITHREAD_NTDLL_ omni_condition { - omni_mutex* mutex; +private: + omni_mutex* mutex; public: - omni_condition(omni_mutex* m); - // constructor must be given a pointer to an existing mutex. The - // condition variable is then linked to the mutex, so that there is an - // implicit unlock and lock around wait() and timed_wait(). - - ~omni_condition(void); - - void wait(void); - // wait for the condition variable to be signalled. The mutex is - // implicitly released before waiting and locked again after waking up. - // If wait() is called by multiple threads, a signal may wake up more - // than one thread. See POSIX threads documentation for details. - - int timedwait(unsigned long secs, unsigned long nanosecs = 0); - // timedwait() is given an absolute time to wait until. To wait for a - // relative time from now, use omni_thread::get_time. See POSIX threads - // documentation for why absolute times are better than relative. - // Returns 1 (true) if successfully signalled, 0 (false) if time - // expired. - - void signal(void); - // if one or more threads have called wait(), signal wakes up at least - // one of them, possibly more. See POSIX threads documentation for - // details. - - void broadcast(void); - // broadcast is like signal but wakes all threads which have called - // wait(). + omni_condition(omni_mutex* m); + // constructor must be given a pointer to an existing mutex. The + // condition variable is then linked to the mutex, so that there is an + // implicit unlock and lock around wait() and timed_wait(). + + ~omni_condition(); + + void wait(); + // wait for the condition variable to be signalled. The mutex is + // implicitly released before waiting and locked again after waking up. + // If wait() is called by multiple threads, a signal may wake up more + // than one thread. See POSIX threads documentation for details. + + int timedwait(unsigned long secs, unsigned long nanosecs = 0); + // timedwait() is given an absolute time to wait until. To wait for a + // relative time from now, use omni_thread::get_time. See POSIX threads + // documentation for why absolute times are better than relative. + // Returns 1 (true) if successfully signalled, 0 (false) if time + // expired. + + inline int timedwait(const omni_time_t& t) + { + return timedwait(t.s, t.ns); + } + + void signal(); + // if one or more threads have called wait(), signal wakes up at least + // one of them, possibly more. See POSIX threads documentation for + // details. + + void broadcast(); + // broadcast is like signal but wakes all threads which have called + // wait(). private: - // dummy copy constructor and operator= to prevent copying - omni_condition(const omni_condition&); - omni_condition& operator=(const omni_condition&); + // dummy copy constructor and operator= to prevent copying + omni_condition(const omni_condition&); + omni_condition& operator=(const omni_condition&); OMNI_THREAD_EXPOSE: - OMNI_CONDITION_IMPLEMENTATION + OMNI_CONDITION_IMPLEMENTATION }; @@ -360,43 +389,46 @@ class _OMNITHREAD_NTDLL_ omni_semaphore { public: - omni_semaphore(unsigned int initial = 1); - ~omni_semaphore(void); + omni_semaphore(unsigned int initial = 1); + ~omni_semaphore(); - void wait(void); - // if semaphore value is > 0 then decrement it and carry on. If it's - // already 0 then block. - - int trywait(void); - // if semaphore value is > 0 then decrement it and return 1 (true). - // If it's already 0 then return 0 (false). - - void post(void); - // if any threads are blocked in wait(), wake one of them up. Otherwise - // increment the value of the semaphore. + void wait(); + // if semaphore value is > 0 then decrement it and carry on. If it's + // already 0 then block. + + int trywait(); + // if semaphore value is > 0 then decrement it and return 1 (true). + // If it's already 0 then return 0 (false). + + void post(); + // if any threads are blocked in wait(), wake one of them up. Otherwise + // increment the value of the semaphore. private: - // dummy copy constructor and operator= to prevent copying - omni_semaphore(const omni_semaphore&); - omni_semaphore& operator=(const omni_semaphore&); + // dummy copy constructor and operator= to prevent copying + omni_semaphore(const omni_semaphore&); + omni_semaphore& operator=(const omni_semaphore&); OMNI_THREAD_EXPOSE: - OMNI_SEMAPHORE_IMPLEMENTATION + OMNI_SEMAPHORE_IMPLEMENTATION }; + // // A helper class for semaphores, similar to omni_mutex_lock above. // class _OMNITHREAD_NTDLL_ omni_semaphore_lock { - omni_semaphore& sem; public: - omni_semaphore_lock(omni_semaphore& s) : sem(s) { sem.wait(); } - ~omni_semaphore_lock(void) { sem.post(); } + omni_semaphore_lock(omni_semaphore& s) : sem(s) { sem.wait(); } + ~omni_semaphore_lock() { sem.post(); } + private: - // dummy copy constructor and operator= to prevent copying - omni_semaphore_lock(const omni_semaphore_lock&); - omni_semaphore_lock& operator=(const omni_semaphore_lock&); + omni_semaphore& sem; + + // dummy copy constructor and operator= to prevent copying + omni_semaphore_lock(const omni_semaphore_lock&); + omni_semaphore_lock& operator=(const omni_semaphore_lock&); }; @@ -407,275 +439,339 @@ /////////////////////////////////////////////////////////////////////////// class _OMNITHREAD_NTDLL_ omni_thread { - public: - enum priority_t { - PRIORITY_LOW, - PRIORITY_NORMAL, - PRIORITY_HIGH - }; - - enum state_t { - STATE_NEW, // thread object exists but thread hasn't - // started yet. - STATE_RUNNING, // thread is running. - STATE_TERMINATED // thread has terminated but storage has not - // been reclaimed (i.e. waiting to be joined). - }; - - // - // Constructors set up the thread object but the thread won't start until - // start() is called. The create method can be used to construct and start - // a thread in a single call. - // - - omni_thread(void (*fn)(void*), void* arg = NULL, - priority_t pri = PRIORITY_NORMAL); - omni_thread(void* (*fn)(void*), void* arg = NULL, - priority_t pri = PRIORITY_NORMAL); - // these constructors create a thread which will run the given function - // when start() is called. The thread will be detached if given a - // function with void return type, undetached if given a function - // returning void*. If a thread is detached, storage for the thread is - // reclaimed automatically on termination. Only an undetached thread - // can be joined. - - void start(void); - // start() causes a thread created with one of the constructors to - // start executing the appropriate function. + enum priority_t { + PRIORITY_LOW, + PRIORITY_NORMAL, + PRIORITY_HIGH + }; + + enum state_t { + STATE_NEW, // thread object exists but thread hasn't + // started yet. + STATE_RUNNING, // thread is running. + STATE_TERMINATED // thread has terminated but storage has not + // been reclaimed (i.e. waiting to be joined). + }; + + // + // Constructors set up the thread object but the thread won't start until + // start() is called. The create method can be used to construct and start + // a thread in a single call. + // + + omni_thread(void (*fn)(void*), void* arg = 0, + priority_t pri = PRIORITY_NORMAL); + + omni_thread(void* (*fn)(void*), void* arg = 0, + priority_t pri = PRIORITY_NORMAL); + + // these constructors create a thread which will run the given function + // when start() is called. The thread will be detached if given a + // function with void return type, undetached if given a function + // returning void*. If a thread is detached, storage for the thread is + // reclaimed automatically on termination. Only an undetached thread + // can be joined. + + void start(); + // start() causes a thread created with one of the constructors to + // start executing the appropriate function. protected: - omni_thread(void* arg = NULL, priority_t pri = PRIORITY_NORMAL); - // this constructor is used in a derived class. The thread will - // execute the run() or run_undetached() member functions depending on - // whether start() or start_undetached() is called respectively. - - void start_undetached(void); - // can be used with the above constructor in a derived class to cause - // the thread to be undetached. In this case the thread executes the - // run_undetached member function. - - virtual ~omni_thread(void); - // destructor cannot be called by user (except via a derived class). - // Use exit() instead. This also means a thread object must be - // allocated with new - it cannot be statically or automatically - // allocated. The destructor of a class that inherits from omni_thread - // shouldn't be public either (otherwise the thread object can be - // destroyed while the underlying thread is still running). - -public: - - void join(void**); - // join causes the calling thread to wait for another's completion, - // putting the return value in the variable of type void* whose address - // is given (unless passed a null pointer). Only undetached threads - // may be joined. Storage for the thread will be reclaimed. - - void set_priority(priority_t); - // set the priority of the thread. - - static omni_thread* create(void (*fn)(void*), void* arg = NULL, - priority_t pri = PRIORITY_NORMAL); - static omni_thread* create(void* (*fn)(void*), void* arg = NULL, - priority_t pri = PRIORITY_NORMAL); - // create spawns a new thread executing the given function with the - // given argument at the given priority. Returns a pointer to the - // thread object. It simply constructs a new thread object then calls - // start. - - static void exit(void* return_value = NULL); - // causes the calling thread to terminate. - - static omni_thread* self(void); - // returns the calling thread's omni_thread object. If the - // calling thread is not the main thread and is not created - // using this library, returns 0. (But see create_dummy() - // below.) - - static void yield(void); - // allows another thread to run. - - static void sleep(unsigned long secs, unsigned long nanosecs = 0); - // sleeps for the given time. - - static void get_time(unsigned long* abs_sec, unsigned long* abs_nsec, - unsigned long rel_sec = 0, unsigned long rel_nsec=0); - // calculates an absolute time in seconds and nanoseconds, suitable for - // use in timed_waits on condition variables, which is the current time - // plus the given relative offset. - - - static void stacksize(unsigned long sz); - static unsigned long stacksize(); - // Use this value as the stack size when spawning a new thread. - // The default value (0) means that the thread library default is - // to be used. - - - // Per-thread data - // - // These functions allow you to attach additional data to an - // omni_thread. First allocate a key for yourself with - // allocate_key(). Then you can store any object whose class is - // derived from value_t. Any values still stored in the - // omni_thread when the thread exits are deleted. - // - // These functions are NOT thread safe, so you should be very - // careful about setting/getting data in a different thread to the - // current thread. - - typedef unsigned int key_t; - static key_t allocate_key(); - - class value_t { - public: - virtual ~value_t() {} - }; - - value_t* set_value(key_t k, value_t* v); - // Sets a value associated with the given key. The key must - // have been allocated with allocate_key(). If a value has - // already been set with the specified key, the old value_t - // object is deleted and replaced. Returns the value which was - // set, or zero if the key is invalid. - - value_t* get_value(key_t k); - // Returns the value associated with the key. If the key is - // invalid, or there is no value for the key, returns zero. - - value_t* remove_value(key_t k); - // Removes the value associated with the key and returns it. - // If the key is invalid, or there is no value for the key, - // returns zero. - - - // Dummy omni_thread - // - // Sometimes, an application finds itself with threads created - // outside of omnithread which must interact with omnithread - // features such as the per-thread data. In this situation, - // omni_thread::self() would normally return 0. These functions - // allow the application to create a suitable dummy omni_thread - // object. - - static omni_thread* create_dummy(void); - // creates a dummy omni_thread for the calling thread. Future - // calls to self() will return the dummy omni_thread. Throws - // omni_thread_invalid if this thread already has an - // associated omni_thread (real or dummy). - - static void release_dummy(); - // release the dummy omni_thread for this thread. This - // function MUST be called before the thread exits. Throws - // omni_thread_invalid if the calling thread does not have a - // dummy omni_thread. - - // class ensure_self should be created on the stack. If created in - // a thread without an associated omni_thread, it creates a dummy - // thread which is released when the ensure_self object is deleted. - - class ensure_self { - public: - inline ensure_self() : _dummy(0) - { - _self = omni_thread::self(); - if (!_self) { - _dummy = 1; - _self = omni_thread::create_dummy(); - } - } - inline ~ensure_self() - { - if (_dummy) - omni_thread::release_dummy(); - } - inline omni_thread* self() { return _self; } - private: - omni_thread* _self; - int _dummy; - }; + omni_thread(void* arg = 0, priority_t pri = PRIORITY_NORMAL); + // this constructor is used in a derived class. The thread will + // execute the run() or run_undetached() member functions depending on + // whether start() or start_undetached() is called respectively. + + void start_undetached(); + // can be used with the above constructor in a derived class to cause + // the thread to be undetached. In this case the thread executes the + // run_undetached member function. + + virtual ~omni_thread(); + // destructor cannot be called by user (except via a derived class). + // Use exit() instead. This also means a thread object must be + // allocated with new - it cannot be statically or automatically + // allocated. The destructor of a class that inherits from omni_thread + // shouldn't be public either (otherwise the thread object can be + // destroyed while the underlying thread is still running). +public: + + void join(void**); + // join causes the calling thread to wait for another's completion, + // putting the return value in the variable of type void* whose address + // is given (unless passed a null pointer). Only undetached threads + // may be joined. Storage for the thread will be reclaimed. + + void set_priority(priority_t); + // set the priority of the thread. + + static omni_thread* create(void (*fn)(void*), void* arg = 0, + priority_t pri = PRIORITY_NORMAL); + + static omni_thread* create(void* (*fn)(void*), void* arg = 0, + priority_t pri = PRIORITY_NORMAL); + // create spawns a new thread executing the given function with the + // given argument at the given priority. Returns a pointer to the + // thread object. It simply constructs a new thread object then calls + // start. + + static void exit(void* return_value = 0); + // causes the calling thread to terminate. + + static omni_thread* self(); + // returns the calling thread's omni_thread object. If the calling + // thread is not the main thread and is not created using this + // library, returns 0. (But see create_dummy() below.) + + static void yield(); + // allows another thread to run. + + static void sleep(unsigned long secs, unsigned long nanosecs = 0); + // sleeps for the given time. + + static inline void sleep(const omni_time_t& t) + { + sleep(t.s, t.ns); + } + + static void get_time(unsigned long* abs_sec, unsigned long* abs_nsec, + unsigned long rel_sec = 0, unsigned long rel_nsec = 0); + // calculates an absolute time in seconds and nanoseconds, suitable for + // use in timed_waits on condition variables, which is the current time + // plus the given relative offset. + + static inline void get_time(omni_time_t& t) + { + get_time(&t.s, &t.ns); + } + + static inline void get_time(omni_time_t& t, const omni_time_t& r) + { + get_time(&t.s, &t.ns, r.s, r.ns); + } + + static inline void get_time(omni_time_t& t, unsigned long rel_sec) + { + get_time(&t.s, &t.ns, rel_sec, 0); + } + + static void stacksize(unsigned long sz); + static unsigned long stacksize(); + // Use this value as the stack size when spawning a new thread. + // The default value (0) means that the thread library default is + // to be used. + + + // Per-thread data + // + // These functions allow you to attach additional data to an + // omni_thread. First allocate a key for yourself with + // allocate_key(). Then you can store any object whose class is + // derived from value_t. Any values still stored in the omni_thread + // when the thread exits are deleted. + // + // These functions are NOT thread safe, so you should be very + // careful about setting/getting data in a different thread to the + // current thread. + + typedef unsigned int key_t; + static key_t allocate_key(); + + class value_t { + public: + virtual ~value_t() {} + }; + + value_t* set_value(key_t k, value_t* v); + // Sets a value associated with the given key. The key must have + // been allocated with allocate_key(). If a value has already been + // set with the specified key, the old value_t object is deleted and + // replaced. Returns the value which was set, or zero if the key is + // invalid. + + value_t* get_value(key_t k); + // Returns the value associated with the key. If the key is invalid, + // or there is no value for the key, returns zero. + + value_t* remove_value(key_t k); + // Removes the value associated with the key and returns it. If the + // key is invalid, or there is no value for the key, returns zero. + + + // Dummy omni_thread + // + // Sometimes, an application finds itself with threads created + // outside of omnithread which must interact with omnithread + // features such as the per-thread data. In this situation, + // omni_thread::self() would normally return 0. These functions + // allow the application to create a suitable dummy omni_thread + // object. + + static omni_thread* create_dummy(); + // creates a dummy omni_thread for the calling thread. Future calls + // to self() will return the dummy omni_thread. Throws + // omni_thread_invalid if this thread already has an associated + // omni_thread (real or dummy). + + static void release_dummy(); + // release the dummy omni_thread for this thread. This function MUST + // be called before the thread exits. Throws omni_thread_invalid if + // the calling thread does not have a dummy omni_thread. + + // class ensure_self should be created on the stack. If created in a + // thread without an associated omni_thread, it creates a dummy + // thread which is released when the ensure_self object is deleted. + + class ensure_self { + public: + inline ensure_self() : _dummy(0) + { + _self = omni_thread::self(); + if (!_self) { + _dummy = 1; + _self = omni_thread::create_dummy(); + } + } + inline ~ensure_self() + { + if (_dummy) + omni_thread::release_dummy(); + } + inline omni_thread* self() { return _self; } + private: + omni_thread* _self; + int _dummy; + }; private: - virtual void run(void* /*arg*/) {} - virtual void* run_undetached(void* /*arg*/) { return NULL; } - // can be overridden in a derived class. When constructed using the - // the constructor omni_thread(void*, priority_t), these functions are - // called by start() and start_undetached() respectively. + virtual void run(void*) {} + virtual void* run_undetached(void*) { return 0; } + // can be overridden in a derived class. When constructed using the + // the constructor omni_thread(void*, priority_t), these functions are + // called by start() and start_undetached() respectively. + + void common_constructor(void* arg, priority_t pri, int det); + // implements the common parts of the constructors. + + omni_mutex mutex; + // used to protect any members which can change after construction, + // i.e. the following 2 members. + + state_t _state; + priority_t _priority; + + static omni_mutex* next_id_mutex; + static int next_id; + int _id; + + void (*fn_void)(void*); + void* (*fn_ret)(void*); + void* thread_arg; + int detached; + int _dummy; + value_t** _values; + unsigned long _value_alloc; + + omni_thread(const omni_thread&); + omni_thread& operator=(const omni_thread&); + // Not implemented - void common_constructor(void* arg, priority_t pri, int det); - // implements the common parts of the constructors. +public: + priority_t priority() { - omni_mutex mutex; - // used to protect any members which can change after construction, - // i.e. the following 2 members. + // return this thread's priority. - state_t _state; - priority_t _priority; + omni_mutex_lock l(mutex); + return _priority; + } - static omni_mutex* next_id_mutex; - static int next_id; - int _id; + state_t state() { - void (*fn_void)(void*); - void* (*fn_ret)(void*); - void* thread_arg; - int detached; - int _dummy; - value_t** _values; - unsigned long _value_alloc; + // return thread state (invalid, new, running or terminated). - omni_thread(const omni_thread&); - omni_thread& operator=(const omni_thread&); - // Not implemented + omni_mutex_lock l(mutex); + return _state; + } -public: + int id() { return _id; } + // return unique thread id within the current process. - priority_t priority(void) { - // return this thread's priority. + // This class plus the instance of it declared below allows us to execute + // some initialisation code before main() is called. - omni_mutex_lock l(mutex); - return _priority; - } + class _OMNITHREAD_NTDLL_ init_t { + public: + init_t(); + ~init_t(); + }; - state_t state(void) { + friend class init_t; + friend class omni_thread_dummy; - // return thread state (invalid, new, running or terminated). +OMNI_THREAD_EXPOSE: + OMNI_THREAD_IMPLEMENTATION +}; - omni_mutex_lock l(mutex); - return _state; - } - int id(void) { return _id; } - // return unique thread id within the current process. +/////////////////////////////////////////////////////////////////////////// +// +// Atomic reference count +// +/////////////////////////////////////////////////////////////////////////// - // This class plus the instance of it declared below allows us to execute - // some initialisation code before main() is called. +#ifndef OMNI_DISABLE_ATOMIC_OPS +# include +#endif - class _OMNITHREAD_NTDLL_ init_t { - public: - init_t(void); - ~init_t(void); - }; +#ifndef OMNI_REFCOUNT_DEFINED - friend class init_t; - friend class omni_thread_dummy; +# define OMNI_REFCOUNT_DEFAULT -OMNI_THREAD_EXPOSE: - OMNI_THREAD_IMPLEMENTATION +class _OMNITHREAD_NTDLL_ omni_refcount { +public: + inline omni_refcount(int start) : count(start) {} + inline ~omni_refcount() {} + + // Atomically increment reference count and return new value + inline int inc() { + omni_mutex_lock l(lock); + return ++count; + } + + // Atomically decrement reference count and return new value + inline int dec() { + omni_mutex_lock l(lock); + return --count; + } + + // Return snapshot of current value. Real count may have changed by + // the time the value is looked at! + inline int value() { + return count; + } + +private: + static omni_mutex lock; + int count; }; +#endif // OMNI_REFCOUNT_DEFINED + + + #ifndef __rtems__ static omni_thread::init_t omni_thread_init; #else // RTEMS calls global Ctor/Dtor in a context that is not // a posix thread. Calls to functions to pthread_self() in -// that context returns NULL. +// that context returns 0. // So, for RTEMS we will make the thread initialization at the // beginning of the Init task that has a posix context. #endif diff -Nru omniorb-dfsg-4.1.6/mk/beforeauto.mk.in omniorb-dfsg-4.2.2/mk/beforeauto.mk.in --- omniorb-dfsg-4.1.6/mk/beforeauto.mk.in 2010-11-22 23:00:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/beforeauto.mk.in 2016-09-16 22:44:16.000000000 +0000 @@ -44,14 +44,38 @@ INSTALLPYEXECDIR := $(DESTDIR)@pyexecdir@ INSTALLIDLDIR := $(DESTDIR)@datadir@/idl + +############################################################################# +# +# Cross compilation +# + +ifeq (@CROSS_COMPILING@,yes) + EmbeddedSystem = 1 +endif + + ############################################################################# # # Tool bindir to use depends on make target # + +ifndef EmbeddedSystem + ifeq ($(MAKECMDGOALS),install) - TOOLBINDIR = $(INSTALLBINDIR) + TOOLBINDIR = $(INSTALLBINDIR) else - TOOLBINDIR = $(TOP)/$(BINDIR) + TOOLBINDIR = $(TOP)/$(BINDIR) +endif + +OMKDEPEND = $(TOOLBINDIR)/omkdepend +OMNIORB_IDL_ONLY = $(TOOLBINDIR)/omniidl -bcxx + +else + +OMKDEPEND = @OMKDEPEND@ +OMNIORB_IDL_ONLY = @OMNIIDL@ -bcxx + endif @@ -167,7 +191,7 @@ define CreateDir if [ ! -d $$dir ]; then \ - (umask 002; set -x; $(MKDIRHIER) $$dir); \ + (umask 022; set -x; $(MKDIRHIER) $$dir); \ fi endef @@ -457,7 +481,6 @@ OMNIORB_DYNAMIC_DLL_NAME = $(patsubst %,$(LibSearchPattern),\ omniDynamic$(OMNIORB_MAJOR_VERSION)) -OMNIORB_IDL_ONLY = $(TOOLBINDIR)/omniidl -bcxx OMNIORB_IDL_ANY_FLAGS = -Wba OMNIORB_IDL = $(OMNIORB_IDL_ONLY) $(OMNIORB_IDL_ANY_FLAGS) OMNIORB_CPPFLAGS = -D__OMNIORB$(OMNIORB_MAJOR_VERSION)__ \ @@ -526,6 +549,16 @@ OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) +# ZIOP +OMNIORB_ZIOP_LIB = $(patsubst %,$(LibSearchPattern),omniZIOP$(OMNIORB_MAJOR_VERSION)) +lib_depend := $(patsubst %,$(LibPattern),omniZIOP$(OMNIORB_MAJOR_VERSION)) +OMNIORB_ZIOP_LIB_DEPEND := $(GENERATE_LIB_DEPEND) + +OMNIORB_ZIOP_DYNAMIC_LIB = $(patsubst %,$(LibSearchPattern),omniZIOPDynamic$(OMNIORB_MAJOR_VERSION)) +lib_depend := $(patsubst %,$(LibPattern),omniZIOPDynamic$(OMNIORB_MAJOR_VERSION)) +OMNIORB_ZIOP_DYNAMIC_LIB_DEPEND := $(GENERATE_LIB_DEPEND) + + ########################################################################## # # Shared library support stuff @@ -575,7 +608,7 @@ soname=$(SharedLibrarySoNameTemplate); \ set -x; \ $(RM) $@; \ - $(CXX) $(SharedLibraryPlatformLinkFlagsTemplate) -o $@ \ + $(CXX) @LDFLAGS@ $(SharedLibraryPlatformLinkFlagsTemplate) -o $@ \ $(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibSuffixPattern),$^) $$extralibs; endef @@ -681,7 +714,6 @@ CP = cp MV = mv -f CPP = @CPP@ -OMKDEPEND = $(TOOLBINDIR)/omkdepend RMDIRHIER = $(RM) -rf CXXMAKEDEPEND = $(OMKDEPEND) -D__cplusplus @@ -727,6 +759,14 @@ DisableLongDouble = 1 endif +# +# Enable ZIOP? +# + +ifeq (@ENABLE_ZIOP@,yes) +EnableZIOP = 1 +endif + ########################################################################### # @@ -778,10 +818,16 @@ endif ################### +ifdef GNU +OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 +OMNITHREAD_CPPFLAGS = -D_REENTRANT -pthread +OMNITHREAD_LIB += -lpthread +endif + +################### ifdef SunOS IMPORT_CPPFLAGS += -D__sunos__ -OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \ - -DPthreadSupportThreadPriority +OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 OMNITHREAD_CPPFLAGS = -DUsePthread -D_REENTRANT $(CXXMTFLAG) SOCKET_LIB = -lsocket -lnsl THREAD_LIB = -lthread $(CXXMTFLAG) @@ -1029,7 +1075,7 @@ OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \ -DPthreadSupportThreadPriority -DNoNanoSleep -CXXOPTIONS = -fno-common -bind_at_load @EXTRA_GCC_CXXFLAGS@ +CXXOPTIONS = -fno-common @EXTRA_GCC_CXXFLAGS@ SHAREDLIB_SUFFIX = dylib SharedLibraryFullNameTemplate = lib$$1$$2.$$3.$$4.$(SHAREDLIB_SUFFIX) @@ -1040,8 +1086,7 @@ -flat_namespace \ -undefined suppress PythonLibraryPlatformLinkFlagsTemplate = -bundle -flat_namespace \ - -undefined suppress \ - -bind_at_load + -undefined suppress PythonSHAREDLIB_SUFFIX = so diff -Nru omniorb-dfsg-4.1.6/mk/beforedir.mk omniorb-dfsg-4.2.2/mk/beforedir.mk --- omniorb-dfsg-4.1.6/mk/beforedir.mk 2008-02-14 13:50:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/beforedir.mk 2016-09-16 22:44:16.000000000 +0000 @@ -187,7 +187,7 @@ define CreateDir if [ ! -d $$dir ]; then \ - (umask 002; set -x; $(MKDIRHIER) $$dir); \ + (umask 022; set -x; $(MKDIRHIER) $$dir); \ fi endef diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_10.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_10.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_10.mk 2009-09-03 17:54:55.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_10.mk 2017-05-11 13:01:56.000000000 +0000 @@ -17,14 +17,11 @@ # # Python set-up # -# You must set a path to a Python 1.5.2 or later interpreter. If you -# do not wish to make a complete installation, you may download a -# minimal Python from -# http://sourceforge.net/project/showfiles.php?group_id=51138&package_id=48638 -# In that case, uncomment the first line below. +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. -#PYTHON = $(ABSTOP)/$(BINDIR)/omnipython -#PYTHON = /cygdrive/c/Python26/python +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python # Use the following set of flags to build and use multithreaded DLLs @@ -84,3 +81,14 @@ ssleay32.lib libeay32.lib OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build experimental ZIOP support, EnableZIOP must be defined and +# ZLIB_ROOT must be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_11.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_11.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_11.mk 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_11.mk 2017-05-11 13:01:56.000000000 +0000 @@ -0,0 +1,94 @@ +# +# x86_win32_vc11.mk - make variables and rules specific to Visual Studio 11 +# + +WindowsNT = 1 +x86Processor = 1 + +compiler_version_suffix=_vc11 + +WINVER = 0x0501 + +BINDIR = bin/x86_win32 +LIBDIR = lib/x86_win32 + +ABSTOP = $(shell cd $(TOP); pwd) + +# +# Python set-up +# +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. + +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python + + +# Use the following set of flags to build and use multithreaded DLLs +# +MSVC_DLL_CXXNODEBUGFLAGS = -MD -EHs -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CNODEBUGFLAGS = -MD -GS -GR -Zi -nologo +MSVC_DLL_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +# +MSVC_DLL_CXXDEBUGFLAGS = -MDd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CDEBUGFLAGS = -MDd -RTC1 -GS -GR -Zd -Zi -nologo +MSVC_DLL_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +# +# Or +# +# Use the following set of flags to build and use multithread static libraries +# +MSVC_STATICLIB_CXXNODEBUGFLAGS = -MT -EHs -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CNODEBUGFLAGS = -MT -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG + +MSVC_STATICLIB_CXXDEBUGFLAGS = -MTd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CDEBUGFLAGS = -MTd -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG + + +# +# Include general win32 things +# + +include $(THIS_IMPORT_TREE)/mk/win32.mk + +MANIFESTTOOL = mt.exe + +IMPORT_CPPFLAGS += -D__x86__ -D__NT__ -D__OSVERSION__=4 \ + -D_CRT_SECURE_NO_DEPRECATE=1 + + +# Default directory for the omniNames log files. +OMNINAMES_LOG_DEFAULT_LOCATION = C:\\temp + + +# Add the location of the Open SSL library + +# To build the SSL transport, OPEN_SSL_ROOT must be defined and points to +# the top level directory of the openssl library. The default is to disable +# the build. +# +#OPEN_SSL_ROOT = /cygdrive/c/openssl +# + +OPEN_SSL_CPPFLAGS = -I$(OPEN_SSL_ROOT)/include +OPEN_SSL_LIB = $(patsubst %,$(LibPathPattern),$(OPEN_SSL_ROOT)/lib) \ + ssleay32.lib libeay32.lib +OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) +OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build experimental ZIOP support, EnableZIOP must be defined and +# ZLIB_ROOT must be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_12.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_12.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_12.mk 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_12.mk 2017-05-11 13:01:56.000000000 +0000 @@ -0,0 +1,94 @@ +# +# x86_win32_vc12.mk - make variables and rules specific to Visual Studio 12 +# + +WindowsNT = 1 +x86Processor = 1 + +compiler_version_suffix=_vc12 + +WINVER = 0x0501 + +BINDIR = bin/x86_win32 +LIBDIR = lib/x86_win32 + +ABSTOP = $(shell cd $(TOP); pwd) + +# +# Python set-up +# +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. + +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python + + +# Use the following set of flags to build and use multithreaded DLLs +# +MSVC_DLL_CXXNODEBUGFLAGS = -MD -EHs -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CNODEBUGFLAGS = -MD -GS -GR -Zi -nologo +MSVC_DLL_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +# +MSVC_DLL_CXXDEBUGFLAGS = -MDd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CDEBUGFLAGS = -MDd -RTC1 -GS -GR -Zd -Zi -nologo +MSVC_DLL_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +# +# Or +# +# Use the following set of flags to build and use multithread static libraries +# +MSVC_STATICLIB_CXXNODEBUGFLAGS = -MT -EHs -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CNODEBUGFLAGS = -MT -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG + +MSVC_STATICLIB_CXXDEBUGFLAGS = -MTd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CDEBUGFLAGS = -MTd -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG + + +# +# Include general win32 things +# + +include $(THIS_IMPORT_TREE)/mk/win32.mk + +MANIFESTTOOL = mt.exe + +IMPORT_CPPFLAGS += -D__x86__ -D__NT__ -D__OSVERSION__=4 \ + -D_CRT_SECURE_NO_DEPRECATE=1 + + +# Default directory for the omniNames log files. +OMNINAMES_LOG_DEFAULT_LOCATION = C:\\temp + + +# Add the location of the Open SSL library + +# To build the SSL transport, OPEN_SSL_ROOT must be defined and points to +# the top level directory of the openssl library. The default is to disable +# the build. +# +#OPEN_SSL_ROOT = /cygdrive/c/openssl +# + +OPEN_SSL_CPPFLAGS = -I$(OPEN_SSL_ROOT)/include +OPEN_SSL_LIB = $(patsubst %,$(LibPathPattern),$(OPEN_SSL_ROOT)/lib) \ + ssleay32.lib libeay32.lib +OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) +OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build experimental ZIOP support, EnableZIOP must be defined and +# ZLIB_ROOT must be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_14.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_14.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_14.mk 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_14.mk 2017-05-11 13:01:56.000000000 +0000 @@ -0,0 +1,94 @@ +# +# x86_win32_vc14.mk - make variables and rules specific to Visual Studio 14 +# + +WindowsNT = 1 +x86Processor = 1 + +compiler_version_suffix=_vc14 + +WINVER = 0x0501 + +BINDIR = bin/x86_win32 +LIBDIR = lib/x86_win32 + +ABSTOP = $(shell cd $(TOP); pwd) + +# +# Python set-up +# +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. + +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python + + +# Use the following set of flags to build and use multithreaded DLLs +# +MSVC_DLL_CXXNODEBUGFLAGS = -MD -EHs -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CNODEBUGFLAGS = -MD -GS -GR -Zi -nologo +MSVC_DLL_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +# +MSVC_DLL_CXXDEBUGFLAGS = -MDd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CDEBUGFLAGS = -MDd -RTC1 -GS -GR -Zd -Zi -nologo +MSVC_DLL_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +# +# Or +# +# Use the following set of flags to build and use multithread static libraries +# +MSVC_STATICLIB_CXXNODEBUGFLAGS = -MT -EHs -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CNODEBUGFLAGS = -MT -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG + +MSVC_STATICLIB_CXXDEBUGFLAGS = -MTd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CDEBUGFLAGS = -MTd -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG + + +# +# Include general win32 things +# + +include $(THIS_IMPORT_TREE)/mk/win32.mk + +MANIFESTTOOL = mt.exe + +IMPORT_CPPFLAGS += -D__x86__ -D__NT__ -D__OSVERSION__=4 \ + -D_CRT_SECURE_NO_DEPRECATE=1 + + +# Default directory for the omniNames log files. +OMNINAMES_LOG_DEFAULT_LOCATION = C:\\temp + + +# Add the location of the Open SSL library + +# To build the SSL transport, OPEN_SSL_ROOT must be defined and points to +# the top level directory of the openssl library. The default is to disable +# the build. +# +#OPEN_SSL_ROOT = /cygdrive/c/openssl +# + +OPEN_SSL_CPPFLAGS = -I$(OPEN_SSL_ROOT)/include +OPEN_SSL_LIB = $(patsubst %,$(LibPathPattern),$(OPEN_SSL_ROOT)/lib) \ + ssleay32.lib libeay32.lib +OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) +OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build experimental ZIOP support, EnableZIOP must be defined and +# ZLIB_ROOT must be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_15.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_15.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_15.mk 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_15.mk 2017-05-11 13:01:56.000000000 +0000 @@ -0,0 +1,94 @@ +# +# x86_win32_vc15.mk - make variables and rules specific to Visual Studio 15 +# + +WindowsNT = 1 +x86Processor = 1 + +compiler_version_suffix=_vc15 + +WINVER = 0x0501 + +BINDIR = bin/x86_win32 +LIBDIR = lib/x86_win32 + +ABSTOP = $(shell cd $(TOP); pwd) + +# +# Python set-up +# +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. + +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python + + +# Use the following set of flags to build and use multithreaded DLLs +# +MSVC_DLL_CXXNODEBUGFLAGS = -MD -EHs -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CNODEBUGFLAGS = -MD -GS -GR -Zi -nologo +MSVC_DLL_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +# +MSVC_DLL_CXXDEBUGFLAGS = -MDd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_DLL_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_DLL_CDEBUGFLAGS = -MDd -RTC1 -GS -GR -Zd -Zi -nologo +MSVC_DLL_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +# +# Or +# +# Use the following set of flags to build and use multithread static libraries +# +MSVC_STATICLIB_CXXNODEBUGFLAGS = -MT -EHs -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CNODEBUGFLAGS = -MT -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKNODEBUGOPTIONS = -nologo -manifest -DEBUG + +MSVC_STATICLIB_CXXDEBUGFLAGS = -MTd -EHs -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CXXLINKDEBUGOPTIONS = -nologo -manifest -DEBUG +MSVC_STATICLIB_CDEBUGFLAGS = -MTd -RTC1 -GS -GR -Zi -nologo +MSVC_STATICLIB_CLINKDEBUGOPTIONS = -nologo -manifest -DEBUG + + +# +# Include general win32 things +# + +include $(THIS_IMPORT_TREE)/mk/win32.mk + +MANIFESTTOOL = mt.exe + +IMPORT_CPPFLAGS += -D__x86__ -D__NT__ -D__OSVERSION__=4 \ + -D_CRT_SECURE_NO_DEPRECATE=1 + + +# Default directory for the omniNames log files. +OMNINAMES_LOG_DEFAULT_LOCATION = C:\\temp + + +# Add the location of the Open SSL library + +# To build the SSL transport, OPEN_SSL_ROOT must be defined and points to +# the top level directory of the openssl library. The default is to disable +# the build. +# +#OPEN_SSL_ROOT = /cygdrive/c/openssl +# + +OPEN_SSL_CPPFLAGS = -I$(OPEN_SSL_ROOT)/include +OPEN_SSL_LIB = $(patsubst %,$(LibPathPattern),$(OPEN_SSL_ROOT)/lib) \ + ssleay32.lib libeay32.lib +OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) +OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build ZIOP support, EnableZIOP must be defined and ZLIB_ROOT must +# be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_6.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_6.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_6.mk 2009-07-02 13:24:15.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_6.mk 2017-05-11 13:01:56.000000000 +0000 @@ -17,14 +17,11 @@ # # Python set-up # -# You must set a path to a Python 1.5.2 or later interpreter. If you -# do not wish to make a complete installation, you may download a -# minimal Python from -# http://sourceforge.net/project/showfiles.php?group_id=51138&package_id=48638 -# In that case, uncomment the first line below. +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. -#PYTHON = $(ABSTOP)/$(BINDIR)/omnipython -#PYTHON = /cygdrive/c/Python26/python +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python # Use the following set of flags to build and use multithreaded DLLs diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_7.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_7.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_7.mk 2009-07-02 13:24:15.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_7.mk 2017-05-11 13:01:56.000000000 +0000 @@ -17,14 +17,11 @@ # # Python set-up # -# You must set a path to a Python 1.5.2 or later interpreter. If you -# do not wish to make a complete installation, you may download a -# minimal Python from -# http://sourceforge.net/project/showfiles.php?group_id=51138&package_id=48638 -# In that case, uncomment the first line below. +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. -#PYTHON = $(ABSTOP)/$(BINDIR)/omnipython -#PYTHON = /cygdrive/c/Python26/python +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python # Use the following set of flags to build and use multithreaded DLLs diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_8.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_8.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_8.mk 2009-07-02 13:24:15.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_8.mk 2017-05-11 13:01:56.000000000 +0000 @@ -17,14 +17,11 @@ # # Python set-up # -# You must set a path to a Python 1.5.2 or later interpreter. If you -# do not wish to make a complete installation, you may download a -# minimal Python from -# http://sourceforge.net/project/showfiles.php?group_id=51138&package_id=48638 -# In that case, uncomment the first line below. +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. -#PYTHON = $(ABSTOP)/$(BINDIR)/omnipython -#PYTHON = /cygdrive/c/Python26/python +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python # Use the following set of flags to build and use multithreaded DLLs @@ -84,3 +81,14 @@ ssleay32.lib libeay32.lib OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build experimental ZIOP support, EnableZIOP must be defined and +# ZLIB_ROOT must be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_9.mk omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_9.mk --- omniorb-dfsg-4.1.6/mk/platforms/x86_win32_vs_9.mk 2009-07-02 13:24:15.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/platforms/x86_win32_vs_9.mk 2017-05-11 13:01:56.000000000 +0000 @@ -17,14 +17,11 @@ # # Python set-up # -# You must set a path to a Python 1.5.2 or later interpreter. If you -# do not wish to make a complete installation, you may download a -# minimal Python from -# http://sourceforge.net/project/showfiles.php?group_id=51138&package_id=48638 -# In that case, uncomment the first line below. +# You must set a path to a Python interpreter, either version 2.7 or +# version 3.5 or later. -#PYTHON = $(ABSTOP)/$(BINDIR)/omnipython -#PYTHON = /cygdrive/c/Python26/python +#PYTHON = /cygdrive/c/Python27/python +#PYTHON = /cygdrive/c/Python36/python # Use the following set of flags to build and use multithreaded DLLs @@ -84,3 +81,14 @@ ssleay32.lib libeay32.lib OMNIORB_SSL_LIB += $(OPEN_SSL_LIB) OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS) + + +# To build experimental ZIOP support, EnableZIOP must be defined and +# ZLIB_ROOT must be set to the path to the zlib install. See also the +# OMNIORB_ENABLE_ZIOP define in include/omniORB4/CORBA_sysdep_trad.h. + +#EnableZIOP = 1 +#ZLIB_ROOT = /cygdrive/c/zlib-1.2.7 + +ZLIB_CPPFLAGS = -I$(ZLIB_ROOT) +ZLIB_LIB = $(patsubst %,$(LibPathPattern),$(ZLIB_ROOT)) zdll.lib diff -Nru omniorb-dfsg-4.1.6/mk/python.mk omniorb-dfsg-4.2.2/mk/python.mk --- omniorb-dfsg-4.1.6/mk/python.mk 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/python.mk 2015-06-26 10:32:49.000000000 +0000 @@ -0,0 +1,16 @@ +############################################################################# +# Make variables for building Python modules # +############################################################################# + +PYVERSION := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.version[:3])') +PYPREFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write(sys.exec_prefix.replace("\\","/"))') +PYINCDIR := $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_inc().replace("\\","/"))') + +PythonSHAREDLIB_SUFFIX = $(shell $(PYTHON) -c 'import sys, distutils.sysconfig; sys.stdout.write((distutils.sysconfig.get_config_var("SO") or ".so").lstrip("."))') + +PY_MODULE_SUFFIX := $(shell $(PYTHON) -c 'import sys; sys.stdout.write((sys.hexversion < 0x3000000) and "module" or "")') + +PYINCFILE := "" +PYINCTHRD := "" + +DIR_CPPFLAGS += -I$(PYINCDIR) -DPYTHON_INCLUDE=$(PYINCFILE) -DPYTHON_THREAD_INC=$(PYINCTHRD) diff -Nru omniorb-dfsg-4.1.6/mk/version.mk omniorb-dfsg-4.2.2/mk/version.mk --- omniorb-dfsg-4.1.6/mk/version.mk 2011-07-01 13:50:36.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/version.mk 2017-05-10 23:52:28.000000000 +0000 @@ -1,15 +1,16 @@ # Library version information -OMNITHREAD_VERSION = 3.4 +OMNITHREAD_VERSION = 4.0 OMNITHREAD_MAJOR_VERSION = $(word 1,$(subst ., ,$(OMNITHREAD_VERSION))) OMNITHREAD_MINOR_VERSION = $(word 2,$(subst ., ,$(OMNITHREAD_VERSION))) -OMNIORB_VERSION = 4.1.6 -OMNIORB_VERSION_HEX = 0x040106F1 +OMNIORB_VERSION = 4.2.2 +OMNIORB_VERSION_HEX = 0x040202F1 OMNIORB_MAJOR_VERSION = $(word 1,$(subst ., ,$(OMNIORB_VERSION))) OMNIORB_MINOR_VERSION = $(word 2,$(subst ., ,$(OMNIORB_VERSION))) OMNIORB_MICRO_VERSION = $(word 3,$(subst ., ,$(OMNIORB_VERSION))) -OMNIPY_VERSION = 3.6 +OMNIPY_VERSION = 4.2.2 OMNIPY_MAJOR = $(word 1,$(subst ., ,$(OMNIPY_VERSION))) OMNIPY_MINOR = $(word 2,$(subst ., ,$(OMNIPY_VERSION))) +OMNIPY_MICRO = $(word 3,$(subst ., ,$(OMNIPY_VERSION))) diff -Nru omniorb-dfsg-4.1.6/mk/win32.mk omniorb-dfsg-4.2.2/mk/win32.mk --- omniorb-dfsg-4.1.6/mk/win32.mk 2010-12-23 00:45:36.000000000 +0000 +++ omniorb-dfsg-4.2.2/mk/win32.mk 2013-07-24 13:24:12.000000000 +0000 @@ -509,6 +509,12 @@ OMNIORB_CONNECTIONS_DLL_NAME = $(shell $(SharedLibraryFullName) $(subst ., ,omniConnectionMgmt.$(OMNIORB_VERSION))) OMNIORB_DEBUG_CONNECTIONS_DLL_NAME = $(shell $(SharedLibraryDebugFullName) $(subst ., ,omniConnectionMgmt.$(OMNIORB_VERSION))) +OMNIORB_ZIOP_DLL_NAME = $(shell $(SharedLibraryFullName) $(subst ., ,omniZIOP.$(OMNIORB_VERSION))) +OMNIORB_DEBUG_ZIOP_DLL_NAME = $(shell $(SharedLibraryDebugFullName) $(subst ., ,omniZIOP.$(OMNIORB_VERSION))) + +OMNIORB_ZIOP_DYNAMIC_DLL_NAME = $(shell $(SharedLibraryFullName) $(subst ., ,omniZIOPDynamic.$(OMNIORB_VERSION))) +OMNIORB_DEBUG_ZIOP_DYNAMIC_DLL_NAME = $(shell $(SharedLibraryDebugFullName) $(subst ., ,omniZIOPDynamic.$(OMNIORB_VERSION))) + ifndef BuildDebugBinary @@ -516,6 +522,8 @@ omnidynamic_dll_name := $(OMNIORB_DYNAMIC_DLL_NAME) omnicodesets_dll_name := $(OMNIORB_CODESETS_DLL_NAME) omniconnections_dll_name := $(OMNIORB_CONNECTIONS_DLL_NAME) +omniziop_dll_name := $(OMNIORB_ZIOP_DLL_NAME) +omniziopdynamic_dll_name := $(OMNIORB_ZIOP_DYNAMIC_DLL_NAME) else @@ -523,6 +531,8 @@ omnidynamic_dll_name := $(OMNIORB_DEBUG_DYNAMIC_DLL_NAME) omnicodesets_dll_name := $(OMNIORB_DEBUG_CODESETS_DLL_NAME) omniconnections_dll_name := $(OMNIORB_DEBUG_CONNECTIONS_DLL_NAME) +omniziop_dll_name := $(OMNIORB_DEBUG_ZIOP_DLL_NAME) +omniziopdynamic_dll_name := $(OMNIORB_DEBUG_ZIOP_DYNAMIC_DLL_NAME) endif lib_depend := $(omniorb_dll_name) @@ -533,6 +543,10 @@ omniCodeSets_lib_depend := $(GENERATE_LIB_DEPEND) lib_depend := $(omniconnections_dll_name) omniConnections_lib_depend := $(GENERATE_LIB_DEPEND) +lib_depend := $(omniziop_dll_name) +omniZIOP_lib_depend := $(GENERATE_LIB_DEPEND) +lib_depend := $(omniziopdynamic_dll_name) +omniZIOPDynamic_lib_depend := $(GENERATE_LIB_DEPEND) OMNIIDL = $(BASE_OMNI_TREE)/$(WRAPPER_FPATH)/oidlwrapper.exe $(XLN) OMNIORB_IDL_ONLY = $(OMNIIDL) -T -bcxx -Wbh=.hh -Wbs=SK.cc @@ -564,6 +578,12 @@ OMNIORB_CONNECTIONS_LIB = $(omniconnections_dll_name) OMNIORB_CONNECTIONS_LIB_DEPEND := $(omniConnections_lib_depend) +# ZIOP library +OMNIORB_ZIOP_LIB = $(omniziop_dll_name) +OMNIORB_ZIOP_LIB_DEPEND := $(omniZiop_lib_depend) + +OMNIORB_ZIOP_DYNAMIC_LIB = $(omniziopdynamic_dll_name) +OMNIORB_ZIOP_DYNAMIC_LIB_DEPEND := $(omniZiopDynamic_lib_depend) OMNIORB_STATIC_STUB_OBJS = \ diff -Nru omniorb-dfsg-4.1.6/README.FIRST.txt omniorb-dfsg-4.2.2/README.FIRST.txt --- omniorb-dfsg-4.1.6/README.FIRST.txt 2011-06-24 21:37:28.000000000 +0000 +++ omniorb-dfsg-4.2.2/README.FIRST.txt 2017-05-10 23:52:28.000000000 +0000 @@ -1,6 +1,6 @@ READ ME FIRST! -This is omniORB 4.1.6. +This is omniORB 4.2.2 omniORB is copyright Apasphere Ltd, AT&T Laboratories Cambridge and others. It is free software. The programs in omniORB are distributed @@ -21,8 +21,9 @@ README.win32.txt - contains important information on building and using omniORB on Windows NT and Windows 95. -README.unix - contains important information on building and - using omniORB on Unix platforms. +README.unix.txt - contains important information on building and + using omniORB on Unix / Linux platforms, including + cross-compilation Other readmes live the the readmes/ subdirectory. See if there is one for your platform. @@ -36,14 +37,13 @@ specification 2.6 of the Common Object Request Broker Architecture (CORBA). -- C++ language bindings are supported. The mapping conforms to the - latest revision of the CORBA specification. +- C++ and Python language bindings. -- support for the Portable Object Adapter (POA) +- Full support for the Portable Object Adapter (POA) -- support for the Interoperable Naming Service (INS) +- Support for the Interoperable Naming Service (INS) -- The Internet Inter-ORB Protocol (IIOP 1.2) is used as the native +- Internet Inter-ORB Protocol (IIOP 1.2) is used as the native protocol. - The omniORB runtime is fully multithreaded. It uses native platform @@ -58,6 +58,9 @@ - Valuetype and abstract interfaces are supported. +- Asynchronous Method Invocation (AMI) supported, including both the + polling and callback models. + - A COS Naming Service, omniNames, is provided. - Many platforms are supported, including most Unix platforms and @@ -72,16 +75,6 @@ other ORBs. -Work in progress -================ - -omniORB is not yet a complete implementation of the CORBA core. The -following features are not supported in the current release. - -- Portable Interceptors. -- Asynchronous Message Interface. - - Missing features ================ @@ -99,7 +92,7 @@ Installation instructions are provided in the following files: -- README.unix for all unix platforms +- README.unix.txt for all Unix / Linux platforms - README.win32.txt for Windows, both 32 and 64 bit. @@ -107,8 +100,7 @@ ============= - omniORB user guides are located in the ./doc directory. They are - available in Postscript, PDF and HTML formats, as well as LaTeX - source. + available in PDF and HTML formats, as well as LaTeX source. - README files are provided throughout the distribution tree. They provide specific information about the directories and files, tools @@ -150,4 +142,3 @@ For general queries and discussion about CORBA, try the newsgroup comp.object.corba. - diff -Nru omniorb-dfsg-4.1.6/README.unix omniorb-dfsg-4.2.2/README.unix --- omniorb-dfsg-4.1.6/README.unix 2010-12-20 22:08:33.000000000 +0000 +++ omniorb-dfsg-4.2.2/README.unix 1970-01-01 00:00:00.000000000 +0000 @@ -1,303 +0,0 @@ -This file contains information on installing, building and using -omniORB on Unix platforms. - -Unless specified otherwise, the information applies to all Unix -platforms. Platform specific information is also available in separate -files. - -omniORB has been tested on the following Unix platforms: - - o Linux on x86, Alpha, Sparc, IBM zSeries. - o Solaris 2.{5,6,7,8,9}/ Sun SparcCompiler C++ version 4.2, 5.x, gcc. - o HPUX 11.00/ aC++ - o SGI Irix 6.x/SGI C++ compiler 7.2 - -It has also been tested by external contributors on the following platforms: - - o IBM AIX 4.2/ IBM C Set++ 3.1.4 - o HPUX 10.20/ aC++ (B3910 A.01.04) - o NextStep 3.3/ gcc-2.7.2 - o Reliant Unix 5.43/CDS++ - o SCO OpenServer 5/g++ - o SCO Unixware 7 - o Linux 2.x powerpc/Debian - o Digital Unix 3.2/ DEC C++ compiler version 5.5 - o Digital Unix 4.0D/ DEC C++ compiler version 6.0 - -And probably quite a few others. - -Roadmap -======= - -The directory structure of this distribution looks as follows: - -./readmes : platform specific readme files -./doc : omniORB documentation -./man : omniORB manual pages -./mk : make configuration files -./config : configuration files for target platform -./include : include files -./src : source files -./src/lib/omnithread : source files for the omnithread library -./src/lib/omniORB : source files for the ORB runtime library -./src/tool/omniidl : source files for the IDL compiler -./src/appl/omniNames : source files for the COS Naming service -./src/appl/utils : source files for utilities -./src/examples : source files for examples - -If this is a pre-compiled binary distribution, the binaries are located in the -following directories: - -./lib : static and shared libraries -./bin : executables - - -Configuration -============= - -There are two ways to configure omniORB. The easiest is usually to use -the Autoconf configure script; if that fails, or you have a good -reason, manual configuration based on platform files is possible. - - -Autoconf configuration -====================== - -On most Unix platforms, omniORB can be configured using the common -Autoconf configure script, that tries to figure out the specifics of -your machine. - -The Autoconf build does not currently work for cross compiling. - -Although you can run configure and make in the main omniORB source -directory, you are strongly advised to build in a different -directory. e.g. - - $ cd $OMNIORB_TOP - $ mkdir build - $ cd build - $ ../configure [configure options] - $ make - $ make install - -That keeps the build files separate from the source files, and allows -you to have several parallel builds. - -configure options ------------------ - -Run configure --help to get a list of configuration options. Most -options are standard Autoconf ones. The most commonly required is ---prefix, used to select the install location. The default is -/usr/local. To change it, use, for example - - ../configure --prefix=/home/fred/omni_inst - -The configure script tries to figure out the location of the C and C++ -compilers and Python. It will always choose gcc over the platform's -native compiler if it is available. To change the choices it makes, -use variables CC, CXX and PYTHON, e.g.: - - ../configure CXX=/usr/bin/platform_c++ PYTHON=/usr/local/bin/python2.3 - -There are various omniORB specific options: - - --disable-static disables the build of static libraries, which - shortens the build process. - - --enable-thread-tracing - Turns on thread and mutex tracing that can help - track down threading bugs in omniORB, but gives a - significant performance hit. - - In some beta releases, thread tracing is turned - on by default, so you may wish to turn it off - with --disable-thread-tracing. - - --with-openssl= Specify a location to find the OpenSSL - installation, required by the SSL transport. - - --with-omniORB-config= - Location to look for the omniORB configuration - file. Default /etc/omniORB.cfg - - --with-omniNames-logdir= - Location for omniNames' log files. Default - /var/omninames. - - -Once omniORB is configured, build it with "make", then install it with -"make install". You must use GNU make. - - -Configuring the Naming service -============================== - -You also have to configure the omniORB runtime and the naming service, -consult the user guides in ./doc for details. For a quick start, -follow these steps: - - o Set the environment variable OMNINAMES_LOGDIR to a directory where - the naming service omniNames can store its data. For example: - OMNINAMES_LOGDIR=/wib/wob; export OMNINAMES_LOGDIR - - o Start omniNames. - $ omniNames -start & - - o Create a file omniORB.cfg, based on sample.cfg. It should - contain a line of the form - - InitRef = NameService=corbaname::my.host.name - - o Set the environment variable OMNIORB_CONFIG to contain the full - path name of the file omniORB.cfg. For example, - OMNIORB_CONFIG=/wib/wob/omniORB.cfg; export OMNIORB_CONFIG - - -Building the examples -===================== - -You are strongly encouraged to try out the examples provided in the -src/examples directory. To build them, go into the src/examples -directory (within the build tree if you are using an Autoconf separate -build tree) and do "make". - -Study the documentation in ./doc before you run any of the example -programs. - - -Writing your own Makefile -========================= - -The distribution makefiles may be a bit much to digest. -Here is a few tips of what to put into your makefiles to compile omniORB -programs: - -1. Compiler flags: - -To compile omniORB programs correctly, several C++ preprocessor defines -must be specified to identify the target platform. With an Autoconf -based build, the file include/omniconfig.h sets the defines for you, -so you do not need to explicitly set anything. With non-Autoconf -builds, you must set the following processor defines: - -Sun Solaris 2.5 |__sparc__ __sunos__ __OSVERSION__=5 | -Digital Unix 3.2 |__alpha__ __osf1__ __OSVERSION__=3 | -HPUX 10.x |__hppa__ __hpux__ __OSVERSION__=10 | -HPUX 11.x |__hppa__ __hpux__ __OSVERSION__=11 | -IBM AIX 4.x & |__aix__ __powerpc__ __OSVERSION__=4 | -Linux 2.0 (x86) |__x86__ __linux__ __OSVERSION__=2 | -Linux 2.0 (alpha) |__alpha__ __linux__ __OSVERSION__=2 | -Windows/NT 3.5 |__x86__ __NT__ __OSVERSION__=3 __WIN32__ | -Windows/NT 4.0 |__x86__ __NT__ __OSVERSION__=4 __WIN32__ | -Windows 2000 |__x86__ __NT__ __OSVERSION__=5 __WIN32__ | -Windows 95 |__x86__ __WIN32__ | -OpenVMS 6.x (alpha) |__alpha__ __vms __OSVERSION__=6 | -OpenVMS 6.x (vax) |__vax__ __vms __OSVERSION__=6 | -ATMos 4.0 |__arm__ __atmos__ __OSVERSION__=4 | -NextStep 3.x |__m68k__ __nextstep__ __OSVERSION__=3 | -Unixware 7 |__x86__ __uw7__ __OSVERSION__=5 | - -You should also specify the preprocessor defines (e.g. -D_REENTRANT) for -compiling multithreaded programs. - - -2. Libraries: - -The runtime libraries that you have to link to your executables are -usually: - -libomnithread.so - omnithread shared library -libomniORB4.so - omniORB runtime shared library -libomniDynamic4.so - omniORB runtime shared library for dynamic features -libomniCodeSets4.so - extra code sets for string transformation -libomnisslTP.so - SSL transport (built if OpenSSL is available) -libCOS4.so - stubs and skeletons for the COS service interfaces -libCOSDynamic4.so - dynamic stubs for the COS service interfaces - -The name of the libraries may be have different suffixes on different -platforms. You can figure it out. - -3. IDL compiler: - -IDL stubs can be compiled like this: - - omniidl -bcxx echo.idl - -The product is the files: echo.hh and echoSK.cc - - -Documentation -============= - -You must read the omniORB and the naming service user guides. Follow -the instructions in the guides to complete the configuration process. - - -Manual configuration with platform files -======================================== - -Ignore this section unless you are absolutely certain that you should -be using the old build environment. - -To build using the old omniORB build environment, follow these steps: - - 1. Select the appropriate platform configuration file - ------------------------------------------------------ - - Edit ./config/config.mk to select the appropriate platform file - - e.g. For Solaris 2.5 onwards and with Sunspro C++ - - platform = sun4_sosV_5.5 - - All the platform files are in ./mk/platforms. - - If you are using gcc or the default compiler for your platform is - gcc, it is most likely that you have to edit the CXX and CC make - variables in the platform file. Some old versions of gcc do not have - proper support for multithreaded exception handling, and thus cannot - be used for omniORB. Moreover, the gcc compiler has to be configured - with the --enable-threads option or else the code generated does not - work reliably. The default version of gcc compiler that comes with - your platform may not be the right version. - - - 2. Set the location of a Python interpreter - ------------------------------------------- - - Edit ./mk/platforms/.mk, where is the platform - name you set in config.mk. - - Uncomment the 'PYTHON =' line, and set it to the path of your Python - interpreter. - - If you do not have Python 1.5.2 or higher, you can download the full - source distribution from - - http://www.python.org/download/ - - - 3. Building and installing - -------------------------- - - The makefiles in this distribution only work with GNU make. Make - sure that you have the program installed and invoke it directly. - - To build and install everything, go into the directory ./src and - type 'make export'. If all goes well, the libraries and executables - will be installed into ./lib// and ./bin//. - - - 4. Add omniORB libraries to search path - --------------------------------------- - - Since the shared libraries libomniORB4.so and libomnithread.so are not in - the directories searched by the dynamic loader by default, you must add - the library directory to the search path. For example: - - On Solaris 2.5 - $ LD_LIBRARY_PATH= - $ export LD_LIBRARY_PATH - - diff -Nru omniorb-dfsg-4.1.6/README.unix.txt omniorb-dfsg-4.2.2/README.unix.txt --- omniorb-dfsg-4.1.6/README.unix.txt 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/README.unix.txt 2017-05-10 23:52:28.000000000 +0000 @@ -0,0 +1,332 @@ +This file contains information on installing, building and using +omniORB on Unix platforms. + +Unless specified otherwise, the information applies to all Unix +platforms. Platform specific information is also available in separate +files. + +The primary Unix platforms tested during omniORB development are Linux +and Mac OS X. It is known to work on the vast majority of other Unix +platforms. + + +Roadmap +======= + +The directory structure of this distribution looks as follows: + +./readmes : platform specific readme files +./doc : omniORB documentation +./man : omniORB manual pages +./mk : make configuration files +./config : configuration files for target platform +./include : include files +./src : source files +./src/lib/omnithread : source files for the omnithread library +./src/lib/omniORB : source files for the ORB runtime library +./src/tool/omniidl : source files for the IDL compiler +./src/appl/omniNames : source files for the COS Naming service +./src/appl/utils : source files for utilities +./src/examples : source files for examples + +If this is a pre-compiled binary distribution, the binaries are located in the +following directories: + +./lib : static and shared libraries +./bin : executables + + +Configuration +============= + +There are two ways to configure omniORB. The easiest is usually to use +the Autoconf configure script; if that fails, or you have a good +reason, manual configuration based on platform files is possible. + + +Autoconf configuration +====================== + +On most Unix platforms, omniORB should be configured using the +Autoconf configure script, that tries to figure out the specifics of +your machine. + +The Autoconf build does not currently work for cross compiling. + +Although you can run configure and make in the main omniORB source +directory, you are strongly advised to build in a different +directory. e.g. + + $ cd $OMNIORB_TOP + $ mkdir build + $ cd build + $ ../configure [configure options] + $ make + $ make install + +That keeps the build files separate from the source files, and allows +you to have several parallel builds. + +configure options +----------------- + +Run configure --help to get a list of configuration options. Most +options are standard Autoconf ones. The most commonly required is +--prefix, used to select the install location. The default is +/usr/local. To change it, use, for example + + ../configure --prefix=/home/fred/omni_inst + +The configure script tries to figure out the location of the C and C++ +compilers and Python. It will always choose gcc over the platform's +native compiler if it is available. To change the choices it makes, +use variables CC, CXX and PYTHON, e.g.: + + ../configure CXX=/usr/bin/platform_c++ PYTHON=/usr/local/bin/python2.7 + +There are various omniORB specific options: + + --disable-static Disables the build of static libraries, which + shortens the build process. + + --enable-thread-tracing + Turns on thread and mutex tracing that can help + track down threading bugs in omniORB, but gives a + significant performance hit. + + In some beta releases, thread tracing is turned + on by default, so you may wish to turn it off + with --disable-thread-tracing. + + --disable-ipv6 Disables support for IPv6. + + --disable-longdouble + Disables the CORBA::LongDouble type. + + --disable-atomic Disables the use of atomic operations, using + mutexes instead. + + --with-openssl Enable the SSL transport. If the configure script + does not find the OpenSSL libraries of its own + accord, you can specify the root directory of the + OpenSSL implementation: --with-openssl=/install/path + + --with-omniORB-config= + Location to look for the omniORB configuration + file. Default /etc/omniORB.cfg + + --with-omniNames-logdir= + Location for omniNames' log files. Default + /var/omninames. + + +Once omniORB is configured, build it with "make", then install it with +"make install". You must use GNU make. + + +Cross-compilation +================= + +The configure script and make files support cross-compilation. The +normal build makes various tools that are used later in the build, in +particular omniidl. When cross-compiling, the tools must already be +available for your native platform. To cross-compile, use these steps: + + 1. configure, build and install omniORB for your native platform. As + recommended above, use a build subdirectory rather than building + in the source tree. + + Make a note of the first few lines output by the configure script + that tell you the build system type. For example + "x86_64-unknown-linux-gnu". + + 2. Add the ${prefix}/bin directory to your PATH so omniidl and other + tools are available. + + 3. In a new build directory (e.g. build-cross), run the configure + script with arguments for cross-compiling. e.g. to compile on an + x86-64 Linux machine, cross-compiling for ARM: + + cd build-cross + ../configure CC=cross-cc CXX=cross-cxx \ + --prefix=/home/example/cross-inst + --build=x86_64-unknown-linux-gnu \ + --host=arm-unknown-linux-gnu + + The essential part to trigger a cross compile is to specify both + --build and --host. + + 4. Run make as usual. + + +Configuring the Naming service +============================== + +You also have to configure the omniORB runtime and the naming service, +consult the user guides in ./doc for details. For a quick start, +follow these steps: + + o Set the environment variable OMNINAMES_DATADIR to a directory where + the naming service omniNames can store its data. For example: + OMNINAMES_DATADIR=/wib/wob; export OMNINAMES_DATADIR + + o Start omniNames. + $ omniNames -start & + + o Create a file omniORB.cfg, based on sample.cfg. It should + contain a line of the form + + InitRef = NameService=corbaname::my.host.name + + o Set the environment variable OMNIORB_CONFIG to contain the full + path name of the file omniORB.cfg. For example, + OMNIORB_CONFIG=/wib/wob/omniORB.cfg; export OMNIORB_CONFIG + + +Building the examples +===================== + +You are strongly encouraged to try out the examples provided in the +src/examples directory. To build them, go into the src/examples +directory (within the build tree if you are using an Autoconf separate +build tree) and do "make". + +Study the documentation in ./doc before you run any of the example +programs. + + +Writing your own Makefile +========================= + +The distribution makefiles may be a bit much to digest. +Here is a few tips of what to put into your makefiles to compile omniORB +programs: + +1. Compiler flags: + +To compile omniORB programs correctly, several C++ preprocessor defines +must be specified to identify the target platform. With an Autoconf +based build, the file include/omniconfig.h sets the defines for you, +so you do not need to explicitly set anything. With non-Autoconf +builds, you must set the following processor defines: + +Sun Solaris 2.5 |__sparc__ __sunos__ __OSVERSION__=5 | +Digital Unix 3.2 |__alpha__ __osf1__ __OSVERSION__=3 | +HPUX 10.x |__hppa__ __hpux__ __OSVERSION__=10 | +HPUX 11.x |__hppa__ __hpux__ __OSVERSION__=11 | +IBM AIX 4.x & |__aix__ __powerpc__ __OSVERSION__=4 | +Linux 2.0 (x86) |__x86__ __linux__ __OSVERSION__=2 | +Linux 2.0 (alpha) |__alpha__ __linux__ __OSVERSION__=2 | +Windows/NT 3.5 |__x86__ __NT__ __OSVERSION__=3 __WIN32__ | +Windows/NT 4.0 |__x86__ __NT__ __OSVERSION__=4 __WIN32__ | +Windows 2000 |__x86__ __NT__ __OSVERSION__=5 __WIN32__ | +Windows 95 |__x86__ __WIN32__ | +OpenVMS 6.x (alpha) |__alpha__ __vms __OSVERSION__=6 | +OpenVMS 6.x (vax) |__vax__ __vms __OSVERSION__=6 | +ATMos 4.0 |__arm__ __atmos__ __OSVERSION__=4 | +NextStep 3.x |__m68k__ __nextstep__ __OSVERSION__=3 | +Unixware 7 |__x86__ __uw7__ __OSVERSION__=5 | + +You should also specify the preprocessor defines (e.g. -D_REENTRANT) for +compiling multithreaded programs. + + +2. Libraries: + +The runtime libraries that you have to link to your executables are +usually: + +libomnithread.so - omnithread shared library +libomniORB4.so - omniORB runtime shared library +libomniDynamic4.so - omniORB runtime shared library for dynamic features +libomniCodeSets4.so - extra code sets for string transformation +libomnisslTP4.so - SSL transport (built if OpenSSL is available) +libCOS4.so - stubs and skeletons for the COS service interfaces +libCOSDynamic4.so - dynamic stubs for the COS service interfaces + +The name of the libraries may be have different suffixes on different +platforms. You can figure it out. + +3. IDL compiler: + +IDL stubs can be compiled like this: + + omniidl -bcxx echo.idl + +The product is the files: echo.hh and echoSK.cc + + +Documentation +============= + +You should read the omniORB and the naming service user guides. Follow +the instructions in the guides to complete the configuration process. + + +Manual configuration with platform files +======================================== + +Ignore this section unless you are absolutely certain that you should +be using the old build environment. + +To build using the old omniORB build environment, follow these steps: + + 1. Select the appropriate platform configuration file + ------------------------------------------------------ + + Edit ./config/config.mk to select the appropriate platform file + + e.g. For Solaris 2.5 onwards and with Sunspro C++ + + platform = sun4_sosV_5.5 + + All the platform files are in ./mk/platforms. + + If you are using gcc or the default compiler for your platform is + gcc, it is most likely that you have to edit the CXX and CC make + variables in the platform file. Some old versions of gcc do not have + proper support for multithreaded exception handling, and thus cannot + be used for omniORB. Moreover, the gcc compiler has to be configured + with the --enable-threads option or else the code generated does not + work reliably. The default version of gcc compiler that comes with + your platform may not be the right version. + + + 2. Set the location of a Python interpreter + ------------------------------------------- + + Edit ./mk/platforms/.mk, where is the platform + name you set in config.mk. + + Uncomment the 'PYTHON =' line, and set it to the path of your Python + interpreter. + + If you do not have Python 2.5 or higher, you can download the full + source distribution from + + http://www.python.org/download/ + + + 3. Building and installing + -------------------------- + + The makefiles in this distribution only work with GNU make. Make + sure that you have the program installed and invoke it directly. + + To build and install everything, go into the directory ./src and + type 'make export'. If all goes well, the libraries and executables + will be installed into ./lib// and ./bin//. + + + 4. Add omniORB libraries to search path + --------------------------------------- + + Since the shared libraries libomniORB4.so and libomnithread.so are not in + the directories searched by the dynamic loader by default, you must add + the library directory to the search path. For example: + + On Solaris 2.5 + $ LD_LIBRARY_PATH= + $ export LD_LIBRARY_PATH + + diff -Nru omniorb-dfsg-4.1.6/README.win32.txt omniorb-dfsg-4.2.2/README.win32.txt --- omniorb-dfsg-4.1.6/README.win32.txt 2010-12-20 22:08:33.000000000 +0000 +++ omniorb-dfsg-4.2.2/README.win32.txt 2017-05-11 13:52:55.000000000 +0000 @@ -6,15 +6,15 @@ omniORB has been tested with the following software configuration: -- Operating System : Windows NT 4.0, 9x, 2000, XP, 2003, Vista, 7 +- Operating System : Any modern Windows version, back to NT 4. - Architecture : x86, x86-64 (and alpha in earlier versions) -- Compiler : Visual C++ 6, 7, 8, 9, 10. VC++ 5 may still work. +- Compiler : Visual C++ 6 and later Roadmap ======= -When the omniORB4 distribution is unpacked, the following are created: +When the omniORB distribution is unpacked, the following are created: \ : Directory where distribution was unpacked @@ -41,12 +41,6 @@ Installation ============ -If you downloaded the Win32 binary distribution of omniORB, -ready-built binaries are provided. The binaries are compiled with VC++ -9 or 10, depending on the version you downloaded. If you are using any -other version of VC++, the binaries will not work, and you must -compile omniORB from source. - Note that although there are many references to "win32", everything works on 64 bit Windows platforms. There is no separate "win64" platform in the build environment. @@ -54,15 +48,138 @@ The executables and DLLs are in \bin\x86_win32. The libraries are in \lib\x86_win32. -You should set up your PATH environment to include +You should set up your PATH environment to include + \bin\x86_win32 + otherwise the DLLs will not be picked up when omniORB programs are run. -If you have the source-only distribution, you will need to build -omniORB. Please read the "Building omniORB from the source files" -section, below. (If you want the Win32 binary distribution, but don't -have it, you can download it from SourceForge via -http://omniorb.sourceforge.net/download.html) +omniORB is primarily shipped in source form. To use it, you must first +compile it. There are a few pre-requisites, but as long as you follow +these instructions, compilation should be easy. + + +Building omniORB from the source files +====================================== + +omniORB should be compiled using Visual C++. It compiles fine with the +latest Visual Studio Community versions that are free for +non-commercial use. You can get it from https://www.visualstudio.com/ + + + A. Pre-requisites + -------------- + + The omniORB build system requires the Cygwin utilities and + Python. Cygwin is only used at build time; Python is used by the + IDL compiler, omniidl. Neither Cygwin or Python are used at + runtime by compiled omniORB code. + + + Cygwin + ------ + + The full Cygwin distribution is freely available at: + + http://www.cygwin.com/ + + The installer allows you to choose from a vast number of packages. + To build omniORB, you just need the standard tools from the base + package, plus GNU make from the devel package. + + + Python + ------ + + omniidl requires Python 2.7 or 3.x. You can download the full + Python distribution from: + + http://www.python.org/download/download_windows.html + + Make sure you install a 64 bit or 32 bit Python version that + matches the architecture you want to use for omniORB. The Cygwin + version of Python does not work. You must use the version from + python.org. + + + + B. Choose the right platform configuration file + -------------------------------------------- + + Edit \config\config.mk to select the right platform file + according to the compiler you are using: + + platform = x86_win32_vs_X + + Where X is the version of Visual Studio you are using. Microsoft + confusingly gives both a year-version and a numeric version to + their releases of Visual Studio. Even more confusingly, the + cl.exe compiler has its own different version number! Visual + Studio 2017 is version 15, so for that you use x86_win32_vs_15. + For a helpful table of version numbers, see + + https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History + + + Instead of using Visual C++, you may have some success with MinGW + instead, in which case you can use + + platform = x86_win32_mingw + + The MinGW is not maintained and tested as part of the core + omniORB development, so you may need to make some modifications + to the platform file for it to work. + + + C. Set the location of the Python interpreter + ------------------------------------------ + + Edit \mk\platforms\.mk + + where is the platform you just chose in config.mk, + e.g. \mk\platforms\x86_win32_vs_15.mk. + + Set PYTHON to the location of your Python executable. Note that + you must use a Unix-style Cygwin path, + e.g. /cygdrive/c/Python36/python + + + D. Building and installing + -------------------------- + + Visual C++ needs lots of environment variables to be set for it + to find all the components it needs. By far the easiest way to + get the right settings is to use the "Command Prompt" shortcuts + created in the Start menu by the Visual Studio Installer. For + example, to use the 64 bit compiler from Visual Studio 2017, run + + Start -> All Programs -> Visual Studio 2017 -> + VS2015 x64 Native Tools Command Prompt + + In the terminal window that opens, you now need to add the Cygwin + binaries and Python directory to the END of the path: + + set path=%path%;c:\cygwin64\bin;c:\Python36 + + (Putting them at the end is essential -- cygwin includes a + link.exe which clashes with Visual Studio's link.exe.) + + + Now, to compile, go into the directory \src and type 'make + export'. If all goes well: + + 1. The executables and DLLs will be installed into + \bin\x86_win32\ + + 2. The libraries will be installed into + \lib\x86_win32\ + + + If you are using mingw to build omniORB, before you build the + main distribution, you must build the omkdepend tool first by + going to the directory \src\tool\omkdepend and typing 'make + export'. + Libraries @@ -150,7 +267,8 @@ ================================= Once the installation is completed. You can try compiling and running -the examples in \src\examples. +the examples in \src\examples. You can use GNU +make as with the core omniORB build, or you can use Microsoft's nmake. Just do the following: @@ -162,6 +280,7 @@ compile and link omniORB programs. + Building Projects using omniORB and Visual C++ 7 and later ========================================================== @@ -250,146 +369,6 @@ -Building omniORB from the source files -====================================== - -omniORB should be compiled using Visual C++ 6.0 or higher. It may -still work with Visual C++ 5 but that has not been tested. - - - A. Pre-requisites - -------------- - - The omniORB source tree requires the Cygwin utilities to build. It - also requires the scripting language Python to be able to compile - IDL to C++. - - Cygwin - ------ - - The full Cygwin distribution is freely available at: - - http://www.cygwin.com/ - - - The toolkit is big and you don't need all of it to compile - omniORB. Alternatively, you can download a cutdown version from: - - http://omniorb.sourceforge.net/att_packages/gnu-win32-lite.zip - - The utilities in this version are all you need to build omniORB. - - Assume that you have downloaded the toolkit and have - unpacked/installed it in some sensible subdirectory, say - C:\gnuwin32, you then have to go through the following checklist: - - 1. In a command prompt window, make sure that you have the - environment variables and path setup properly to use MS - Visual C++. - - The easiest way is to call the vcvars.bat file created by the - Visual Studio installer. - - 2. If you have unpacked gnu-win32-lite.zip in C:\gnuwin32, add - C:\gnuwin32\bin to your Path environment variable. - - Warning: If you have installed posix utilities from the - Windows resource kits, make sure that C:\gnuwin32 is searched - before the directory containing these utilities. - - If you have installed the full Cygwin toolkit, just follow - its installation instructions and you can skip 3. - - 3. Now you have to run a small script *once* to setup in your - registry the necessary 'mount' points. Basically, it tells - the gnuwin32 runtime how to translate a path such as /bin/sh - to the real path name Win32 (e.g. C:\gnuwin32\bin\sh.exe) - understands. - - Just execute this command in a command prompt window: - - C:\gnuwin32\bin\checkmounts C:\gnuwin32 - - If all goes well, this is what you see: - - C:\> C:\gnuwin32\bin\checkmounts C:\gnuwin32 - no /bin/sh.exe, mounting c:\gnuwin32\bin as /bin - Completed successfully. - - 4. Now you are ready. You can now build the distribution by - following the instructions below. - - Python - ------ - - omniidl requires Python 1.5.2 or later. You can download the full - Python distribution from - - http://www.python.org/download/download_windows.html - - - Alternatively, for Windows on x86, you can install a minimal - version of Python which contains just the functionality required - by omniidl. Download it from Sourceforge, via - - http://omniorb.sourceforge.net/att_packages/omnipython-x86_win32.zip - - Unpack the zip file at the top of the omniORB tree. It places - files in the bin, lib and include directories. - - - B. Choose the right platform configuration file - -------------------------------------------- - - Edit \config\config.mk to select one of the following - depending on the compiler you are using: - - platform = x86_win32_vs_6 - platform = x86_win32_vs_7 - platform = x86_win32_vs_8 - platform = x86_win32_vs_9 - platform = x86_win32_vs_10 - platform = x86_win32_mingw - - - C. Set the location of the Python interpreter - ------------------------------------------ - - Edit \mk\platforms\.mk - - where is the platform you just chose in config.mk, - e.g. \mk\platforms\x86_win32_vs_10.mk. - - If you are using the omnipython minimal distribution, uncomment - the line which reads - - PYTHON = $(ABSTOP)/$(BINDIR)/omnipython - - otherwise, set PYTHON to the location of your Python executable. - Note that you must use a Unix-style Cygwin path. - - If you are using the mingw compiler, you must patch the - omnipython distribution using the patch in the patches/ - directory. - - - D. Building and installing - -------------------------- - - Go into the directory \src and type 'make export'. If all - goes well: - 1. The executables and DLLs will be installed into - \bin\x86_win32\ - 2. The libraries will be installed into - \lib\x86_win32\ - - If you are using mingw to build omniORB, before you build the - main distribution, you must build the omkdepend tool first by - going to the directory \src\tool\omkdepend and typing 'make - export'. - - - Mailing List ============ diff -Nru omniorb-dfsg-4.1.6/ReleaseChecklist.txt omniorb-dfsg-4.2.2/ReleaseChecklist.txt --- omniorb-dfsg-4.1.6/ReleaseChecklist.txt 2011-06-24 21:37:28.000000000 +0000 +++ omniorb-dfsg-4.2.2/ReleaseChecklist.txt 2017-05-10 23:52:28.000000000 +0000 @@ -10,6 +10,10 @@ ReleaseNotes.txt +omniORBpy/ReleaseNotes.txt + +omniORBpy/README.txt + bugfixes-XXX.xml configure.ac @@ -21,3 +25,5 @@ Features web page Wiki + +Development page diff -Nru omniorb-dfsg-4.1.6/ReleaseNotes.txt omniorb-dfsg-4.2.2/ReleaseNotes.txt --- omniorb-dfsg-4.1.6/ReleaseNotes.txt 2011-06-24 21:37:28.000000000 +0000 +++ omniorb-dfsg-4.2.2/ReleaseNotes.txt 2017-05-10 23:52:28.000000000 +0000 @@ -1,172 +1,70 @@ RELEASE NOTES ============= -This is omniORB 4.1.6. +This is omniORB 4.2.2 -See README.unix or README.win32.txt for building instructions. +See README.unix.txt or README.win32.txt for building instructions. See the documentation in the doc directory for more information. -Changes since omniORB 4.1.5 +Changes since omniORB 4.2.1 --------------------------- - - Bug fixes. See bugfixes-415.xml +omniORB 4.2.2 is primarily a bug fix release. See update.log for full +details of changes. Highlights include: - - New clientOpenConnection and serverAcceptConnection interceptors. + - Support for cross-compilation using the configure script. + - New defaultCharCodeSet and defaultWCharCodeSet configuration + parameters to handle code set conversion with corbaloc URIs and + badly-behaved servers. -Changes since omniORB 4.1.4 ---------------------------- - - - Bug fixes. See bugfixes-414.xml - - - Support for building with the newest versions of Cygwin. - - - Incoming SSL connections can time out waiting for SSL_accept to complete. - - - Ability to disable longdouble support during compilation. - - -Changes since omniORB 4.1.3 ---------------------------- - - - Bug fixes. See bugfixes-413.xml - - - Connection management enhancements and logging improvements. - - - Ability to switch bidirectional mode at run-time. + - Suppression of many compiler warnings. -Changes since omniORB 4.1.2 +Changes since omniORB 4.2.0 --------------------------- - - Bug fixes. See bugfixes-412.xml - - - Option to validate UTF-8 string data. - - - New omni_mutex trylock method. - - - New ISO-8859 and Windows code sets. - - - Port to LynxOS. - - -Changes since omniORB 4.1.1 ---------------------------- - - - Bug fixes. See bugfixes-411.xml. - - - omniNames Windows service support. See doc/omniNames.pdf. - - - Support for multi-endpoint SSL IORs (using an extremely minimal - subset of CSIv2). - - - -Changes since omniORB 4.1.0 ---------------------------- - - - Bug fixes. See bugfixes-410.xml. - - - Documentation updates. +omniORB 4.2.1 is primarily a bug fix release. See update.log for full +details of changes. Highlights include: - - Support for new platforms and compilers. + - Improved Python 3 support. - - New configuration parameters: socketSendBuffer, resetTimeOutOnRetries. + - Additional SSL / TLS options. - - New -Wbguard_prefix option to omniidl. + - The default DH parameters for TLS are now 2048 bits. - - Small performance improvements. + - More efficient marshalling of messages including large numbers of + valuetypes. -Changes since omniORB 4.1.0 release candidate 2 ------------------------------------------------ - - - Bug fixes. - - -Changes since omniORB 4.1.0 release candidate 1 ------------------------------------------------ - - - Modified Windows platform files and DLL names. Platforms are now - x86_win32_vs_* - - - Minor bug fixes. - - -Changes since omniORB 4.1.0 beta 2 ----------------------------------- - - - Incompatible change to the clientSendRequest interceptor members. - Application code using the interceptor will require a small - modification. - - - Support for insertion / extraction of various types from standard - iostreams. - - - More comprehensive logging of connection and protocol errors. - - - Experimental omniConnectionMgmt extension. - - - Minor bug fixes. - - -Changes since omniORB 4.1.0 beta 1 ----------------------------------- - - - IPv6 support. - - See section 8.6.1 of the omniORB manual for details. - - - New endPointPublish parameter. - - Used for configuring what to publish in IORs. See section 8.6.2 - of the omniORB manual. - - - Minor bug fixes. - - -Changes since omniORB 4.0.x +Changes since omniORB 4.1.x --------------------------- - - Objects by value support. - - omniORB now supports the full objects by value specification, - with the exception of custom valuetypes. See chapter 13 of the - omniORB manual for information about valuetype in omniORB. - - - Abstract interfaces support. - - - New simpler and more efficient Any implementation. - - - New socket collection implementation. - - Uses poll() on platforms where it is available to avoid limiting - the number of connections to FD_SETSIZE. Windows specific version - that better manages the unusual Windows fd_set. - - - New tracing options traceTime and traceInvocationReturns. +omniORB 4.2 has a number of new features compared to omniORB 4.1.x, +both large and small. Here are the highlights: - See section 4.2 of the omniORB manual. + - Full Asynchronous Method Invocation (AMI) support. - - C++ mapping updated to version 1.1. + - Support for ZIOP, which compresses large messages. - Deprecation of RefCountServantBase; Servant_var template type. + - Call timeouts are indicated with the CORBA::TIMEOUT exception, + rather than CORBA::TRANSIENT (unless suppressed with the + throwTransientOnTimeout configuration parameter). - - Support for local interfaces. + - Servers can be limited to a range of ports to listen on. - In particular, ServantManagers and AdapterActivators no longer - need to be activated in a POA, but can be simple C++ objects. See - the examples in src/examples/poa/servant_manager. + - Performance improvements to Any, sequence buffer management, + unions, and other areas. - Note that to use local interfaces derived from unconstrained - interfaces, you must compile the idl for the base interfaces - using the -Wbvirtual_objref -Wbimpl_mapping omniidl flags. + - Ancient Python versions are no longer supported. omniidl and + omniORBpy now only work with Python 2.5 or later. + - omniidl works with Python 3.x as well as 2.x. -Known issues ------------- +Known issues / limitations +-------------------------- This release has the following known issues and omissions: diff -Nru omniorb-dfsg-4.1.6/sample.cfg omniorb-dfsg-4.2.2/sample.cfg --- omniorb-dfsg-4.1.6/sample.cfg 2010-12-20 22:08:33.000000000 +0000 +++ omniorb-dfsg-4.2.2/sample.cfg 2017-05-10 23:52:28.000000000 +0000 @@ -60,7 +60,7 @@ # # Valid values = 0 or 1 # -traceThreadId = 0 +traceThreadId = 1 ############################################################################ # Trace time @@ -68,7 +68,7 @@ # # Valid values = 0 or 1 # -traceTime = 0 +traceTime = 1 ############################################################################ # dumpConfiguration @@ -212,6 +212,22 @@ nativeWCharCodeSet = UTF-16 ############################################################################ +# defaultCharCodeSet +# +# set the code set used for char and string if the server does not +# specify anything in its IORs +# +#defaultCharCodeSet = UTF-8 + +############################################################################ +# defaultWCharCodeSet +# +# set the default code set for wchar and wstring if the server does not +# specify anything in its IORs +# +#defaultWCharCodeSet = UTF-16 + +############################################################################ # abortOnInternalError # # If the value of this variable is TRUE then the ORB will abort @@ -289,6 +305,7 @@ ############################################################################ # sslCAFile +# sslCAPath # sslKeyFile # sslKeyPassword # sslVerifyMode @@ -302,6 +319,9 @@ # sslCAFile specifies the file containing the SSL Certificate # Authority certificate. # +# sslCAPath specifies a directory containing SSL Certificate +# Authority certificates. +# # sslKeyFile specifies the file containing the SSL key. # # sslKeyPassword specifies the password to unlock the key. @@ -393,10 +413,12 @@ # clientTransportRule = [^]
[action]+ # #
can be: -# 1. localhost the address is this machine +# 1. localhost if the address is this machine # 2. w.x.y.z/m1.m2.m3.m4 IPv4 address with the bits selected by # the mask. e.g. 172.16.0.0/255.240.0.0 -# 3. * the wildcard that matches any address +# 3. w.x.y.z/len IPv4 address with len significant bits. +# 4. a:b:c:d:e:f:g:h/len IPv6 address with len significant bits. +# 5. * the wildcard that matches any address # # + can be one or more of the following: # 1. none Do not use this address @@ -498,6 +520,17 @@ resetTimeOutOnRetries = 0 ############################################################################ +# throwTransientOnTimeout +# +# If true, when a timeout occurs, CORBA::TRANSIENT is thrown rather +# than CORBA::TIMEOUT. Used for backwards-compatibility with +# previous omniORB versions. +# +# Valid values = 0 or 1 +# +throwTransientOnTimeout = 0 + +############################################################################ # outConScanPeriod # # Idle connections shutdown. The ORB periodically scans all the diff -Nru omniorb-dfsg-4.1.6/sample.reg omniorb-dfsg-4.2.2/sample.reg --- omniorb-dfsg-4.1.6/sample.reg 2009-07-19 17:35:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/sample.reg 2010-03-01 15:57:26.000000000 +0000 @@ -67,7 +67,7 @@ ; ; Valid values = 0 or 1 ; -traceThreadId = "0" +traceThreadId = "1" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Trace time @@ -75,7 +75,7 @@ ; ; Valid values = 0 or 1 ; -traceTime = "0" +traceTime = "1" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; dumpConfiguration diff -Nru omniorb-dfsg-4.1.6/src/appl/omniMapper/omniMapper.cc omniorb-dfsg-4.2.2/src/appl/omniMapper/omniMapper.cc --- omniorb-dfsg-4.1.6/src/appl/omniMapper/omniMapper.cc 2005-01-06 23:11:24.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniMapper/omniMapper.cc 2017-02-20 22:45:59.000000000 +0000 @@ -17,49 +17,7 @@ // General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA. - -// $Id: omniMapper.cc 5133 2005-01-06 23:11:24Z dgrisby $ -// $Log$ -// Revision 1.5.2.2 2004/02/20 00:03:34 dgrisby -// Compilation fixes. Thanks Gary Duzan for pointing them out. -// -// Revision 1.5.2.1 2003/03/23 21:03:18 dgrisby -// Start of omniORB 4.1.x development branch. -// -// Revision 1.2.2.7 2002/01/16 12:35:46 dpg1 -// omniMapper used -ORBendpoint instead of -ORBendPoint. -// -// Revision 1.2.2.6 2001/10/17 16:49:11 dpg1 -// Minor error message tweaks -// -// Revision 1.2.2.5 2001/09/19 17:33:17 dpg1 -// Update omniMapper and omniNames INS mapper to ORB core changes from a -// while ago. -// -// Revision 1.2.2.4 2001/06/08 17:12:08 dpg1 -// Merge all the bug fixes from omni3_develop. -// -// Revision 1.2.2.3 2001/04/19 09:39:05 sll -// Big checkin with the brand new internal APIs. -// -// Revision 1.2.2.2 2000/10/09 16:20:56 sll -// Ported to omniORB 4 API. -// -// Revision 1.2.2.1 2000/07/17 10:35:38 sll -// Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. -// -// Revision 1.3 2000/07/13 15:26:04 dpg1 -// Merge from omni3_develop for 3.0 release. -// -// Revision 1.1.2.2 2000/06/19 15:25:57 dpg1 -// Explicit cast to (const char*) when using String_var with logger. -// -// Revision 1.1.2.1 2000/05/24 17:15:37 dpg1 -// Added omniMapper. -// +// along with this program. If not, see http://www.gnu.org/licenses/ #include #include diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/BindingIterator_i.h omniorb-dfsg-4.2.2/src/appl/omniNames/BindingIterator_i.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/BindingIterator_i.h 2008-02-05 12:47:14.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/BindingIterator_i.h 2017-02-20 22:45:59.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #ifndef _BindingIterator_i_h_ @@ -35,10 +33,8 @@ #endif -class BindingIterator_i : public POA_CosNaming::BindingIterator, - public PortableServer::RefCountServantBase +class BindingIterator_i : public POA_CosNaming::BindingIterator { - public: BindingIterator_i(PortableServer::POA_ptr poa, CosNaming::BindingList* l) @@ -47,25 +43,25 @@ PortableServer::ObjectId_var id = poa->activate_object(this); } - CORBA::Boolean next_one(CosNaming::Binding_out b) { - - CosNaming::BindingList* bl; + CORBA::Boolean next_one(CosNaming::Binding_out b) + { + CosNaming::BindingList_var bl; CORBA::Boolean ret = next_n(1, bl); + b = new CosNaming::Binding; if (ret) - *b = (*bl)[0]; + *b = bl[0]; else #ifndef MIPSPRO_WORKAROUND b->binding_type = CosNaming::nobject; #else b.ptr()->binding_type = CosNaming::nobject; #endif - delete bl; return ret; } - CORBA::Boolean next_n(CORBA::ULong how_many, CosNaming::BindingList_out bl) { - + CORBA::Boolean next_n(CORBA::ULong how_many, CosNaming::BindingList_out bl) + { // // What we do here is return the current list to the caller, shortening // it to the required length. Before this however, we create a new list @@ -75,11 +71,13 @@ if (list->length() < how_many) { how_many = list->length(); } - bl = list; + bl = list._retn(); + list = new CosNaming::BindingList(bl->length() - how_many); list->length(bl->length() - how_many); + for (unsigned int i = 0; i < list->length(); i++) { - (*list)[i] = (*bl)[i + how_many]; + list[i] = (*bl)[i + how_many]; } bl->length(how_many); @@ -90,19 +88,18 @@ return 1; } - void destroy(void) { - // remember the destructor for an object should never be called explicitly. + void destroy(void) + { PortableServer::ObjectId_var id = names_poa->servant_to_id(this); names_poa->deactivate_object(id); } private: - CosNaming::BindingList* list; + CosNaming::BindingList_var list; - // remember the destructor for an object should never be called explicitly. + // The destructor for an object should never be called explicitly. ~BindingIterator_i() { - delete list; } }; diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/INSMapper.h omniorb-dfsg-4.2.2/src/appl/omniNames/INSMapper.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/INSMapper.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/INSMapper.h 2017-02-20 22:45:59.000000000 +0000 @@ -18,38 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. -// - -// $Id: INSMapper.h 5867 2009-05-06 16:16:18Z dgrisby $ -// $Log$ -// Revision 1.5.2.2 2004/02/20 00:03:35 dgrisby -// Compilation fixes. Thanks Gary Duzan for pointing them out. -// -// Revision 1.5.2.1 2003/03/23 21:03:18 dgrisby -// Start of omniORB 4.1.x development branch. -// -// Revision 1.2.2.4 2001/09/19 17:33:17 dpg1 -// Update omniMapper and omniNames INS mapper to ORB core changes from a -// while ago. -// -// Revision 1.2.2.3 2001/04/19 09:39:05 sll -// Big checkin with the brand new internal APIs. -// -// Revision 1.2.2.2 2000/10/09 16:20:56 sll -// Ported to omniORB 4 API. -// -// Revision 1.2.2.1 2000/07/17 10:35:38 sll -// Merged from omni3_develop the diff between omni3_0_0_pre3 and omni3_0_0. -// -// Revision 1.3 2000/07/13 15:26:03 dpg1 -// Merge from omni3_develop for 3.0 release. -// -// Revision 1.1.2.1 2000/05/24 17:13:07 dpg1 -// omniNames now creates a forwarding agent with object key `NameService' -// if the root context doesn't already have that key. +// along with this program. If not, see http://www.gnu.org/licenses/ // #include diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/log.cc omniorb-dfsg-4.2.2/src/appl/omniNames/log.cc --- omniorb-dfsg-4.1.6/src/appl/omniNames/log.cc 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/log.cc 2017-02-20 22:45:59.000000000 +0000 @@ -2,7 +2,7 @@ // Package : omniNames // log.cc Author : Tristan Richardson (tjr) // -// Copyright (C) 2002-2008 Apasphere Ltd +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 1997-1999 AT&T Laboratories Cambridge // // This file is part of omniNames. @@ -18,9 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #include @@ -112,37 +110,6 @@ // -// This class can be used to generate timestamps. The t() method normally -// returns a timestamp string, but if the same timestamp (to the nearest -// second) would be returned as last time then an empty string is returned -// instead. -// - -class timestamp { - char str[29]; -public: - timestamp(void) { - str[0] = '\n'; - str[1] = str[28] = '\0'; - } - char* t(void) { - time_t t = time(NULL); - char *p = ctime(&t); - if (strncmp(p, &str[1], 24) == 0) { - return &str[28]; - } - strncpy(&str[1], p, 24); - str[25] = ':'; - str[26] = '\n'; - str[27] = '\n'; - return str; - } -}; - -timestamp ts; - - -// // Constructor for class omniNameslog. There will normally be only one // instance of this class. Unfortunately the initialisation of the class // cannot be completed in the constructor - the rest is done in the init() @@ -169,6 +136,10 @@ #endif CORBA::String_var logdir; + + if (!arg_logdir) + arg_logdir = getenv(DATADIR_ENV_VAR); + if (!arg_logdir) arg_logdir = getenv(LOGDIR_ENV_VAR); @@ -196,8 +167,7 @@ struct utsname un; if (uname(&un) < 0) { - cerr << ts.t() << "Error: cannot get the name of this host." << endl; - + LOG(1, "Error: cannot get the name of this host."); exit(1); } @@ -220,8 +190,7 @@ char hostname[MAXHOSTNAMELEN+1]; if (gethostname(hostname, MAXHOSTNAMELEN) < 0) { - cerr << ts.t() << "Error: cannot get the name of this host." << endl; - + LOG(1, "Error: cannot get the name of this host."); exit(1); } logname = CORBA::string_alloc(strlen(logdir) + strlen("/omninames-") + @@ -237,7 +206,7 @@ DWORD machineName_buflen = MAX_COMPUTERNAME_LENGTH+1; CORBA::String_var machineName = CORBA::string_alloc(machineName_buflen-1); if (!GetComputerName((LPTSTR)(char*)machineName, &machineName_buflen)) { - cerr << ts.t() << "Error: cannot get the name of this host." << endl; + LOG(1, "Error: cannot get the name of this host."); exit(1); } @@ -249,15 +218,14 @@ #else // VMS char last(logdir[strlen(logdir)-1]); if (last != ':' && last != ']') { - cerr << ts.t() << "Error: " << LOGDIR_ENV_VAR << " (" << logdir - << ") is not a directory name." << endl; + LOG(1, "Error: " << LOGDIR_ENV_VAR << " (" << logdir << + ") is not a directory name."); exit(1); } struct utsname un; if (uname(&un) < 0) { - cerr << ts.t() << "Error: cannot get the name of this host." << endl; - + LOG(1, "Error: cannot get the name of this host."); exit(1); } @@ -268,22 +236,45 @@ } #ifndef __VMS - active = CORBA::string_alloc(strlen(logname)+strlen(".log")); - sprintf(active,"%s.log", (const char*)logname); + active_new = CORBA::string_alloc(strlen(logname)+strlen(".dat")); + sprintf(active_new,"%s.dat", (const char*)logname); + + active_old = CORBA::string_alloc(strlen(logname)+strlen(".log")); + sprintf(active_old,"%s.log", (const char*)logname); + backup = CORBA::string_alloc(strlen(logname)+strlen(".bak")); sprintf(backup,"%s.bak", (const char*)logname); + checkpt = CORBA::string_alloc(strlen(logname)+strlen(".ckp")); sprintf(checkpt,"%s.ckp", (const char*)logname); #else // specify latest version: - active = CORBA::string_alloc(strlen(logname)+strlen(".log;")); - sprintf(active,"%s.log;", (const char*)logname); + active_new = CORBA::string_alloc(strlen(logname)+strlen(".dat;")); + sprintf(active_new,"%s.dat;", (const char*)logname); + + active_old = CORBA::string_alloc(strlen(logname)+strlen(".log;")); + sprintf(active_old,"%s.log;", (const char*)logname); + backup = CORBA::string_alloc(strlen(logname)+strlen(".bak;")); sprintf(backup,"%s.bak;", (const char*)logname); + checkpt = CORBA::string_alloc(strlen(logname)+strlen(".ckp;")); sprintf(checkpt,"%s.ckp;", (const char*)logname); #endif + if (stat(active_old,&sb) == 0) { + if (stat(active_new,&sb) == 0) { + LOG(1, "Data file '" << active_new << "' and old log file '" << + active_old << "' both exist. Cannot start."); + exit(1); + } + LOG(1, "Using old data file name '" << active_old << "'."); + active = active_old; + } + else { + active = active_new; + } + if (port == 0) { firstTime = 0; } @@ -302,26 +293,24 @@ } } if (firstTime) { - // // Starting for the first time - make sure log file doesn't exist, and // for safety, that there is no backup file either. // - + if (stat(active,&sb) == 0) { - cerr << ts.t() << "Error: log file '" << active - << "' exists. Can't use -start option." << endl; + LOG(1, "Error: data file '" << active << + "' exists. Can't use -start option."); exit(1); } if (stat(backup,&sb) == 0) { - cerr << ts.t() << "Error: backup file '" << backup - << "' exists. Can't use -start option." << endl; + LOG(1, "Error: backup file '" << backup << + "' exists. Can't use -start option."); exit(1); } } else { - // // Restart - get port info from log file. // @@ -332,46 +321,45 @@ ifstream initf(active); #endif if (!initf) { - cerr << ts.t() << "Error: cannot open log file '" << active << "'." - << endl; + LOG(1, "Error: cannot open data file '" << active << "': " << + strerror(errno)); if (stat(backup,&sb) == 0) { if (always) { if (unlink(backup) == 0) { - cerr << "Info: backup file '" << backup << "' removed." << endl; + LOG(1, "Info: backup file '" << backup << "' removed."); } else { - cerr << "Backup file '" << backup - << "' exists and cannot be removed." << endl; + LOG(1, "Backup file '" << backup << + "' exists and cannot be removed."); exit(1); } } else { - cerr << "Backup file '" << backup << "' exists." << endl - << "Refusing to start. " - << "Remove the backup file to start omniNames." - << endl; + LOG(1, "Backup file '" << backup << + "' exists. Refusing to start. " + "Remove the backup file to start omniNames."); exit(1); } } + else { + exit(1); + } } try { getPort(initf); } catch (IOError&) { - - cerr << ts.t() << "Error: reading log file '" << active << "' failed: " - << flush; - perror(""); + LOG(1, "Error: reading data file '" << active << "' failed: " << + strerror(errno)); initf.close(); exit(1); } catch (ParseError&) { - - cerr << ts.t() << "Error: parse error in log file '" << active - << "' at line " << line << "." << endl; + LOG(1, "Error: parse error in data file '" << active << "' at line " << + line << "."); initf.close(); exit(1); } @@ -397,6 +385,8 @@ setlocale(LC_ALL, ""); #endif + LOG(1, "Data file: '" << active << "'."); + if (firstTime) { // @@ -404,7 +394,7 @@ // port specification and the root context. // - cerr << ts.t() << "Starting omniNames for the first time." << endl; + LOG(1, "Starting omniNames for the first time."); try { #ifdef USE_STREAM_OPEN @@ -454,20 +444,18 @@ throw IOError(); #endif - } catch (IOError& ex) { - - cerr << ts.t() << "Error: cannot create initial log file '" << active - << "': " << endl; - perror(""); - cerr << "\nYou can set the environment variable " << LOGDIR_ENV_VAR - << " to specify the\ndirectory where the log files are kept.\n" - << endl; + } + catch (IOError& ex) { + LOG(1, "Error: cannot create initial data file '" << active << "': " << + strerror(errno)); + LOG(1, "You can set the environment variable " << DATADIR_ENV_VAR << + " to specify the directory where the data files are kept."); logf.close(); unlink(active); exit(1); } - cerr << ts.t() << "Wrote initial log file." << endl; + LOG(1, "Wrote initial data file '" << active << "'."); } // claim the global lock as a writer (ie exclusive). @@ -477,8 +465,7 @@ ifstream initf(active); if (!initf) { - cerr << ts.t() << "Error: cannot open log file '" << active << "'." - << endl; + LOG(1, "Error: cannot open data file '" << active << "'."); exit(1); } @@ -494,45 +481,47 @@ if (strcmp(cmd, "port") == 0) { while (initf && (initf.get() != '\n')); // ignore rest of line line++; - } else if (strcmp(cmd, "persistent") == 0) { + } + else if (strcmp(cmd, "persistent") == 0) { getPersistent(initf); - } else if (strcmp(cmd, "create") == 0) { + } + else if (strcmp(cmd, "create") == 0) { getCreate(initf); - } else if (strcmp(cmd, "destroy") == 0) { + } + else if (strcmp(cmd, "destroy") == 0) { getDestroy(initf); - } else if (strcmp(cmd, "bind") == 0) { + } + else if (strcmp(cmd, "bind") == 0) { getBind(initf); - } else if (strcmp(cmd, "unbind") == 0) { + } + else if (strcmp(cmd, "unbind") == 0) { getUnbind(initf); - } else { - cerr << ts.t() << "Error: unknown command '" << cmd - << "' in log file '" << active << "'." << endl; + } + else { + LOG(1, "Error: unknown command '" << cmd << "' in data file '" << + active << "'."); throw ParseError(); } delete [] cmd; } - initf.close(); - - } catch (IOError&) { - - cerr << ts.t() << "Error: reading log file '" << active << "' failed: " - << flush; - perror(""); + } + catch (IOError&) { + LOG(1, "Error: reading data file '" << active << "' failed: " << + strerror(errno)); initf.close(); exit(1); - } catch (ParseError&) { - - cerr << ts.t() << "Error: parse error in log file '" << active - << "' at line " << line << "." << endl; + } + catch (ParseError&) { + LOG(1, "Error: parse error in data file '" << active << "' at line " << + line << "."); initf.close(); - exit(1); } - cerr << ts.t() << "Read log file successfully." << endl; + LOG(1, "Read data file '" << active << "' successfully."); CosNaming::NamingContext_ptr rootContext = NamingContext_i::headContext->_this(); @@ -553,26 +542,25 @@ if (strncmp((const char*)iiop.object_key.get_buffer(), "NameService", 11)) { - cerr << ts.t() << "(Pre-INS log file)" << endl; + LOG(1, "Pre-INS data file."); new INSMapper(the_ins_poa, rootContext); } } - char* p = orb->object_to_string(rootContext); - cerr << ts.t() << "Root context is " << p << endl; + CORBA::String_var p = orb->object_to_string(rootContext); + LOG(1, "Root context is " << p); + // Now use the backdoor to tell the bootstrap agent in this // address space to return this root context in response to // CORBA::InitialReferences::get("NameService"); _omni_set_NameService(rootContext); - delete p; CORBA::release(rootContext); // dispose of the object reference #ifdef USE_STREAM_OPEN logf.OPEN(active,ios::out|ios::app,0666); if (!logf) { - cerr << ts.t() << "Error: cannot open log file '" << active - << "' for writing." << endl; + LOG(1, "Error: cannot open data file '" << active << "' for writing."); exit(1); } #else @@ -583,8 +571,7 @@ # endif if (fd < 0) { - cerr << ts.t() << "Error: cannot open log file '" << active - << "' for writing." << endl; + LOG(1, "Error: cannot open data file '" << active << "' for writing."); exit(1); } logf.attach(fd); @@ -609,9 +596,9 @@ try { putCreate(id, logf); reallyFlush(logf); - } catch (IOError& ex) { - cerr << ts.t() << flush; - perror("I/O error writing log file"); + } + catch (IOError& ex) { + LOG(1, "I/O error writing data file: " << strerror(errno)); logf.clear(); throw CORBA::PERSIST_STORE(); } @@ -626,9 +613,9 @@ try { putDestroy(nc, logf); reallyFlush(logf); - } catch (IOError& ex) { - cerr << ts.t() << flush; - perror("I/O error writing log file"); + } + catch (IOError& ex) { + LOG(1, "I/O error writing data file: " << strerror(errno)); logf.clear(); throw CORBA::PERSIST_STORE(); } @@ -638,15 +625,15 @@ void omniNameslog::bind(CosNaming::NamingContext_ptr nc, const CosNaming::Name& n, - CORBA::Object_ptr obj, CosNaming::BindingType t) + CORBA::Object_ptr obj, CosNaming::BindingType t) { if (!startingUp) { try { putBind(nc, n, obj, t, logf); reallyFlush(logf); - } catch (IOError& ex) { - cerr << ts.t() << flush; - perror("I/O error writing log file"); + } + catch (IOError& ex) { + LOG(1, "I/O error writing data file: " << strerror(errno)); logf.clear(); throw CORBA::PERSIST_STORE(); } @@ -661,9 +648,9 @@ try { putUnbind(nc, n, logf); reallyFlush(logf); - } catch (IOError& ex) { - cerr << ts.t() << flush; - perror("I/O error writing log file"); + } + catch (IOError& ex) { + LOG(1, "I/O error writing data file: " << strerror(errno)); logf.clear(); throw CORBA::PERSIST_STORE(); } @@ -673,14 +660,14 @@ void -omniNameslog::checkpoint(void) +omniNameslog::checkpoint() { if (!checkpointNeeded) { - // cerr << ts.t() << "No checkpoint needed." << endl; + LOG(5, "No checkpoint needed."); return; } - cerr << ts.t() << "Checkpointing Phase 1: Prepare." << endl; + LOG(1, "Checkpointing Phase 1: Prepare."); // // Get the global lock as a reader. This means clients will still be able @@ -696,10 +683,10 @@ try { #ifdef USE_STREAM_OPEN - ckpf.OPEN(checkpt,ios::out|ios::trunc,0666); + ckpf.OPEN(checkpt, ios::out|ios::trunc, 0666); if (!ckpf) { - cerr << ts.t() << "Error: cannot open checkpoint file '" - << checkpt << "' for writing." << endl; + LOG(1, "Error: cannot open checkpoint file '" << checkpt << + "' for writing."); throw IOError(); } #else @@ -710,8 +697,8 @@ # endif if (fd < 0) { - cerr << ts.t() << "Error: cannot open checkpoint file '" - << checkpt << "' for writing." << endl; + LOG(1, "Error: cannot open checkpoint file '" << checkpt << + "' for writing."); throw IOError(); } @@ -746,11 +733,12 @@ throw IOError(); #endif - } catch (IOError& ex) { - cerr << ts.t() << flush; - perror("I/O error writing checkpoint file"); - cerr << "Abandoning checkpoint" << endl; + } + catch (IOError& ex) { + LOG(1, "I/O error writing checkpoint file: " << strerror(errno)); + LOG(1, "Abandoning checkpoint"); ckpf.close(); + // a bug in sparcworks C++ means that the fd doesn't get closed. #if defined(__sunos__) && defined(__SUNPRO_CC) && __SUNPRO_CC < 0x500 close(fd); @@ -765,7 +753,7 @@ // Now commit the checkpoint to become the active log. // - cerr << ts.t() << "Checkpointing Phase 2: Commit." << endl; + LOG(1, "Checkpointing Phase 2: Commit."); // a bug in sparcworks C++ means that the fd doesn't get closed. #if defined(__sunos__) && defined(__SUNPRO_CC) && __SUNPRO_CC < 0x500 @@ -784,20 +772,21 @@ if (link(active,backup) < 0) { #endif // Failure here leaves old active and checkpoint file. - cerr << ts.t() << "Error: failed to link backup file '" << backup - << "' to old log file '" << active << "'." << endl; + LOG(1, "Error: failed to link backup file '" << backup << + "' to old data file '" << active << "'."); exit(1); } #ifndef __VMS if (unlink(active) < 0) { // Failure here leaves active and backup pointing to the same (old) file. - cerr << ts.t() << "Error: failed to unlink old log file '" << active - << "'." << endl; + LOG(1, "Error: failed to unlink old data file '" << active << "'."); exit(1); } #endif + active = active_new; + #if defined(__WIN32__) if (!CopyFile(checkpt,active,TRUE)) { #elif defined(__VMS) @@ -806,16 +795,15 @@ if (link(checkpt,active) < 0) { #endif // Failure here leaves no active but backup points to the old file. - cerr << ts.t() << "Error: failed to link log file '" << active - << "' to checkpoint file '" << checkpt << "'." << endl; + LOG(1, "Error: failed to link data file '" << active << + "' to checkpoint file '" << checkpt << "'."); exit(1); } #ifndef __VMS if (unlink(checkpt) < 0) { // Failure here leaves active and checkpoint pointing to the same file. - cerr << ts.t() << "Error: failed to unlink checkpoint file '" << checkpt - << "'." << endl; + LOG(1, "Error: failed to unlink checkpoint file '" << checkpt << "'."); exit(1); } #endif @@ -823,8 +811,7 @@ #ifdef USE_STREAM_OPEN logf.OPEN(active,ios::out|ios::app,0666); if (!logf) { - cerr << ts.t() << "Error: cannot open log file '" << active - << "' for writing." << endl; + LOG(1, "Error: cannot open data file '" << active << "' for writing."); exit(1); } #else @@ -835,8 +822,7 @@ # endif if (fd < 0) { - cerr << ts.t() << "Error: cannot open new log file '" << active - << "' for writing." << endl; + LOG(1, "Error: cannot open new data file '" << active << "' for writing."); exit(1); } logf.attach(fd); @@ -844,8 +830,7 @@ NamingContext_i::lock.readerOut(); - cerr << ts.t() << "Checkpointing completed." << endl; - + LOG(1, "Checkpointing completed."); checkpointNeeded = 0; } @@ -872,7 +857,7 @@ getNonfinalString(str, file); if (strcmp(str, "port") != 0) { - cerr << ts.t() << "Error: log file doesn't start with \"port\"." << endl; + LOG(1, "Error: data file doesn't start with \"port\"."); throw ParseError(); } @@ -885,7 +870,7 @@ delete [] str; if (port == 0) { - cerr << ts.t() << "Error: invalid port specified in log file." << endl; + LOG(1, "Error: invalid port specified in data file."); throw ParseError(); } } @@ -963,8 +948,9 @@ CORBA::Object_var o; try { o = orb->string_to_object(str); - } catch (...) { - cerr << ts.t() << "getDestroy: invalid IOR." << endl; + } + catch (...) { + LOG(1, "getDestroy: invalid IOR."); delete [] str; throw ParseError(); } @@ -973,10 +959,9 @@ CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(o); if (CORBA::is_nil(nc)) { - cerr << ts.t() << "getDestroy: IOR not a NamingContext." << endl; + LOG(1, "getDestroy: IOR not a NamingContext."); throw ParseError(); } - nc->destroy(); } @@ -1015,8 +1000,9 @@ CORBA::Object_var o; try { o = orb->string_to_object(str); - } catch (...) { - cerr << ts.t() << "getBind: invalid IOR." << endl; + } + catch (...) { + LOG(1, "getBind: invalid IOR."); delete [] str; throw ParseError(); } @@ -1024,7 +1010,7 @@ CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(o); if (CORBA::is_nil(nc)) { - cerr << ts.t() << "getBind: IOR not a NamingContext." << endl; + LOG(1, "getBind: IOR not a NamingContext."); throw ParseError(); } @@ -1055,8 +1041,9 @@ getFinalString(str, file); try { o = orb->string_to_object(str); - } catch (...) { - cerr << ts.t() << "getDestroy: invalid IOR." << endl; + } + catch (...) { + LOG(1, "getDestroy: invalid IOR."); delete [] str; throw ParseError(); } @@ -1067,15 +1054,13 @@ CosNaming::NamingContext_var nc2 = CosNaming::NamingContext::_narrow(o); if (CORBA::is_nil(nc2)) { - cerr << ts.t() << "bind: IOR not a NamingContext." << endl; + LOG(1, "bind: IOR not a NamingContext."); throw ParseError(); } nc->rebind_context(name, nc2); - - } else { - + } + else { nc->rebind(name, o); - } delete [] bindingType; @@ -1111,8 +1096,9 @@ CORBA::Object_var o; try { o = orb->string_to_object(str); - } catch (...) { - cerr << ts.t() << "getUnbind: invalid IOR." << endl; + } + catch (...) { + LOG(1, "getUnbind: invalid IOR."); delete [] str; throw ParseError(); } @@ -1120,7 +1106,7 @@ CosNaming::NamingContext_var nc = CosNaming::NamingContext::_narrow(o); if (CORBA::is_nil(nc)) { - cerr << ts.t() << "getUnbind: IOR not a NamingContext." << endl; + LOG(1, "getUnbind: IOR not a NamingContext."); throw ParseError(); } @@ -1261,12 +1247,10 @@ *p++ = '\r'; break; default: - cerr << ts.t() << "Unknown character following '\\' in log file" - << endl; + LOG(1, "Unknown character following '\\' in data file."); } - - } else { - + } + else { switch (c) { case '\\': backslash = 1; diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/log.h omniorb-dfsg-4.2.2/src/appl/omniNames/log.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/log.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/log.h 2017-02-20 22:45:59.000000000 +0000 @@ -2,7 +2,7 @@ // Package : omniNames // log.h Author : Tristan Richardson (tjr) // -// Copyright (C) 2003-2008 Apasphere Ltd +// Copyright (C) 2003-2013 Apasphere Ltd // Copyright (C) 1997-1999 AT&T Laboratories Cambridge // // This file is part of omniNames. @@ -18,9 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #ifndef _log_h_ @@ -35,18 +33,37 @@ # include #endif +#ifndef DATADIR_ENV_VAR +# define DATADIR_ENV_VAR "OMNINAMES_DATADIR" +#endif + #ifndef LOGDIR_ENV_VAR # define LOGDIR_ENV_VAR "OMNINAMES_LOGDIR" #endif +// Tracing/logging + +#define LOG(level, msg) \ + do { \ + if (omniORB::trace(level)) { \ + omniORB::logger _log("omniNames: "); \ + _log << msg << '\n'; \ + } \ + } while(0) + + class omniNameslog { CORBA::ORB_ptr orb; PortableServer::POA_ptr poa; PortableServer::POA_ptr ins_poa; + CORBA::String_var active; CORBA::String_var backup; CORBA::String_var checkpt; + CORBA::String_var active_new; + CORBA::String_var active_old; + ofstream logf; int port; @@ -123,7 +140,7 @@ CosNaming::BindingType t); void unbind(CosNaming::NamingContext_ptr nc, const CosNaming::Name& n); - void checkpoint(void); + void checkpoint(); }; diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/NamingContext_i.cc omniorb-dfsg-4.2.2/src/appl/omniNames/NamingContext_i.cc --- omniorb-dfsg-4.1.6/src/appl/omniNames/NamingContext_i.cc 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/NamingContext_i.cc 2017-02-20 22:45:59.000000000 +0000 @@ -2,7 +2,7 @@ // Package : omniNames // NamingContext_i.cc Author : Tristan Richardson (tjr) // -// Copyright (C) 2002-2008 Apasphere Ltd +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 1997-1999 AT&T Laboratories Cambridge // // This file is part of omniNames. @@ -18,9 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #include @@ -38,12 +36,6 @@ # include #endif -#ifdef DEBUG_NC -#define DB(x) x -#else -#define DB(x) -#endif - ReadersWritersLock NamingContext_i::lock; NamingContext_i* NamingContext_i::headContext = (NamingContext_i*)0; NamingContext_i* NamingContext_i::tailContext = (NamingContext_i*)0; @@ -70,7 +62,8 @@ tailContext = this; if (prev) { prev->next = this; - } else { + } + else { headContext = this; } @@ -85,6 +78,8 @@ CosNaming::NamingContext_ptr NamingContext_i::new_context() { + LOG(4, "new_context"); + CORBA::Object_var ref = names_poa->create_reference( CosNaming::NamingContext::_PD_repoId); PortableServer::ObjectId_var id = names_poa->reference_to_id(ref); @@ -109,8 +104,7 @@ { assert(n.length() == 1); - DB(cerr << " resolve_simple name (" << n[0].id << "," << n[0].kind << ")" - << " in context " << this << endl); + LOG(4, "resolve_simple (" << n[0].id << '.' << n[0].kind << ")"); for (ObjectBinding* ob = headBinding; ob; ob = ob->next) { @@ -119,17 +113,13 @@ if ((strcmp(n[0].id,ob->binding.binding_name[0].id) == 0) && (strcmp(n[0].kind,ob->binding.binding_name[0].kind) == 0)) { - DB(cerr << " resolve_simple: found (" << n[0].id << "," << n[0].kind - << ")" << " in context " << this << ", bound to " - << (void*)((CORBA::Object_ptr)ob->object) << endl); + LOG(4, "resolve_simple: found (" << n[0].id << '.' << n[0].kind << ")"); return ob; } } - DB(cerr << " resolve_simple: didn't find (" << n[0].id << "," << n[0].kind - << ")" << " in context " << this << "; raising exception" - << endl); + LOG(4, "resolve_simple: didn't find (" << n[0].id << '.' << n[0].kind << ")"); throw CosNaming::NamingContext::NotFound(CosNaming::NamingContext:: missing_node, n); @@ -148,11 +138,16 @@ NamingContext_i::resolve_compound(const CosNaming::Name& n, CosNaming::Name& restOfName) { - DB(cerr << " resolve_compound name "); - for (unsigned int j = 0; j < n.length(); j++) { - DB(cerr << "(" << n[j].id << "," << n[j].kind << ")"); + if (omniORB::trace(4)) { + omniORB::logger log("omniNames: "); + log << "resolve_compound name ("; + + for (unsigned int j = 0; j < n.length(); j++) { + if (j != 0) log << '/'; + log << n[j].id << '.' << n[j].kind; + } + log << ")\n"; } - DB(cerr << " in context " << this << endl); if (n.length() == 0) { throw CosNaming::NamingContext::InvalidName(); @@ -183,13 +178,11 @@ if (CORBA::is_nil((CosNaming::NamingContext_ptr)context) || (ob->binding.binding_type != CosNaming::ncontext)) { - DB(cerr << " resolve_compound: object " - << (void*)((CORBA::Object_ptr)ob->object) - << " not (bound as) a context; raising exception" << endl); + LOG(4, "resolve_compound: object (" << n[0].id << '.' << n[0].kind << + ") not bound as a context; raising exception"); throw CosNaming::NamingContext::NotFound(CosNaming::NamingContext:: not_context, n); } - return CosNaming::NamingContext::_duplicate(context); } @@ -201,29 +194,25 @@ CORBA::Object_ptr NamingContext_i::resolve(const CosNaming::Name& n) { - if (n.length() == 1) { - DB(cerr << "resolve simple name (" << n[0].id << "," << n[0].kind - << ") in context " << this << endl); + if (omniORB::trace(3)) { + omniORB::logger log("omniNames: "); + log << "resolve ("; + + for (unsigned int j = 0; j < n.length(); j++) { + if (j != 0) log << '/'; + log << n[j].id << '.' << n[j].kind; + } + log << ")\n"; + } + if (n.length() == 1) { ReaderLock r(lock); - ObjectBinding* ob = resolve_simple(n); - - DB(cerr << "returning " << (void*)((CORBA::Object_ptr)ob->object) << endl); - return CORBA::Object::_duplicate(ob->object); - - } else { - - DB(cerr << "resolve compound name "); - for (unsigned int i = 0; i < n.length(); i++) { - DB(cerr << "(" << n[i].id << "," << n[i].kind << ")"); - } - DB(cerr << " in context " << this << endl); - + } + else { CosNaming::Name restOfName; CosNaming::NamingContext_var context = resolve_compound(n, restOfName); - return context->resolve(restOfName); } } @@ -237,17 +226,12 @@ NamingContext_i::bind_helper(const CosNaming::Name& n, CORBA::Object_ptr obj, CosNaming::BindingType t, CORBA::Boolean rebind) { - DB(cerr << "bind in context " << this << " (type " << t << " rebind " - << (int)rebind << ")" << endl); - if (n.length() == 1) { - // // Bind a simple name - i.e. bind object in this context. // - DB(cerr << " bind simple name (" << n[0].id << "," << n[0].kind << ") to " - << obj << " in context " << this << endl); + LOG(2, "bind simple name (" << n[0].id << '.' << n[0].kind << ')'); WriterLock w(lock); @@ -260,44 +244,37 @@ } catch (CosNaming::NamingContext::NotFound& ex) { ob = 0; - DB(cerr << " bind in context " << this - << ": caught not found exception from resolving simple name\n" - << " reason " << ex.why << " rest of name "); - - for (unsigned int i = 0; i < ex.rest_of_name.length(); i++) { - DB(cerr << "(" << ex.rest_of_name[i].id << "," - << ex.rest_of_name[i].kind << ")"); - } - DB(cerr << endl); } CosNaming::NamingContext_var nc = _this(); redolog->bind(nc, n, obj, t); if (ob) { - DB(cerr << " rebind in context " << this - << ": unbinding simple name (" << n[0].id << "," << n[0].kind - << ") from " << (void*)((CORBA::Object_ptr)ob->object) << endl); + LOG(4, "rebind: unbinding simple name (" << n[0].id << '.' << n[0].kind + << ')'); delete ob; } new ObjectBinding(n, t, obj, this); - DB(cerr << " bind in context " << this << ": bound simple name (" - << n[0].id << "," << n[0].kind << ") to " << obj << endl); - - } else { - + LOG(4, "bound simple name (" << n[0].id << '.' << n[0].kind << ')'); + } + else { // // Bind a compound name - i.e. bind object to name // in the context . // - DB(cerr << " bind compound name "); - for (unsigned int i = 0; i < n.length(); i++) { - DB(cerr << "(" << n[i].id << "," << n[i].kind << ")"); + if (omniORB::trace(2)) { + omniORB::logger log("omniNames: "); + log << "bind compound name ("; + + for (unsigned int j = 0; j < n.length(); j++) { + if (j != 0) log << '/'; + log << n[j].id << '.' << n[j].kind; + } + log << ")\n"; } - DB(cerr << " to " << obj << " in context " << this << endl); CosNaming::Name restOfName; CosNaming::NamingContext_var context = resolve_compound(n, restOfName); @@ -307,7 +284,8 @@ context->rebind(restOfName, obj); else context->bind(restOfName, obj); - } else { + } + else { if (rebind) context->rebind_context(restOfName, CosNaming::NamingContext::_narrow(obj)); @@ -326,16 +304,12 @@ void NamingContext_i::unbind(const CosNaming::Name& n) { - DB(cerr << "unbind in context " << this << endl); - if (n.length() == 1) { - // // Unbind a simple name - i.e. remove it from this context. // - DB(cerr << " unbind simple name (" << n[0].id << "," << n[0].kind << ")" - << " in context " << this << endl); + LOG(2, "unbind simple name (" << n[0].id << '.' << n[0].kind << ')'); WriterLock w(lock); @@ -344,25 +318,24 @@ CosNaming::NamingContext_var nc = _this(); redolog->unbind(nc, n); - DB(cerr << " unbind: removing (" << n[0].id << "," << n[0].kind << ")" - << " from context " << this << " (was bound to " - << (void*)((CORBA::Object_ptr)ob->object) << ")" << endl); - delete ob; - - } else { - + } + else { // // Unbind a compound name - i.e. unbind the name // from the context . // - DB(cerr << " unbind compound name "); - for (unsigned int i = 0; i < n.length(); i++) { - DB(cerr << "(" << n[i].id << "," << n[i].kind << ")"); + if (omniORB::trace(2)) { + omniORB::logger log("omniNames: "); + log << "unbind compound name ("; + + for (unsigned int j = 0; j < n.length(); j++) { + if (j != 0) log << '/'; + log << n[j].id << '.' << n[j].kind; + } + log << ")\n"; } - DB(cerr << " in context " << this << endl); - CosNaming::Name restOfName; CosNaming::NamingContext_var context = resolve_compound(n, restOfName); @@ -379,38 +352,41 @@ NamingContext_i::bind_new_context(const CosNaming::Name& n) { if (n.length() == 1) { - // // Bind a new context with a simple name - i.e. create a new context and // bind it in this context. // - DB(cerr << "bind_new_context simple (" << n[0].id << "," << n[0].kind - << ") in context " << this << endl); + LOG(2, "bind_new_context simple name (" << + n[0].id << '.' << n[0].kind << ')'); + CosNaming::NamingContext_ptr nc = new_context(); try { bind_context(n, nc); - } catch (...) { + } + catch (...) { nc->destroy(); CORBA::release(nc); throw; } - return nc; - - } else { - + } + else { // // Bind a new context with a compound name - i.e. // bind_new_context in the context . // - DB(cerr << "bind_new_context compound name "); - for (unsigned int i = 0; i < n.length(); i++) { - DB(cerr << "(" << n[i].id << "," << n[i].kind << ")"); + if (omniORB::trace(2)) { + omniORB::logger log("omniNames: "); + log << "bind_new_context compound name ("; + + for (unsigned int j = 0; j < n.length(); j++) { + if (j != 0) log << '/'; + log << n[j].id << '.' << n[j].kind; + } + log << ")\n"; } - DB(cerr << " in context " << this << endl); - CosNaming::Name restOfName; CosNaming::NamingContext_var context = resolve_compound(n, restOfName); @@ -426,7 +402,7 @@ void NamingContext_i::destroy() { - DB(cerr << "destroy" << endl); + LOG(4, "destroy"); WriterLock w(lock); @@ -451,10 +427,9 @@ { lock.readerIn(); - DB(cerr << "list context " << this << ", how_many " << how_many - << ", size " << size << endl); + LOG(3, "list context: how_many = " << how_many << ", size = " << size); - CosNaming::BindingList* all = new CosNaming::BindingList(size); + CosNaming::BindingList_var all = new CosNaming::BindingList(size); all->length(size); unsigned int i; @@ -462,35 +437,24 @@ for (ob = headBinding, i = 0; ob; ob = ob->next, i++) { assert(i < size); - (*all)[i] = ob->binding; - DB(cerr << " (" << (*all)[i].binding_name[0].id << "," - << (*all)[i].binding_name[0].kind << ") binding type " - << (((*all)[i].binding_type == CosNaming::nobject) ? - "nobject" : "ncontext") - << endl); + all[i] = ob->binding; } lock.readerOut(); - if( all->length() <= how_many ) { + if (all->length() <= how_many) { // don't need an iterator. All results can go back as a // result of this call bi = CosNaming::BindingIterator::_nil(); - bl = all; + bl = all._retn(); return; } - BindingIterator_i* bii = new BindingIterator_i(names_poa, all); + BindingIterator_i* bii = new BindingIterator_i(names_poa, all._retn()); bi = bii->_this(); bii->_remove_ref(); - if (CORBA::is_nil(bi.ptr())) { - cerr << "couldn't narrow binding iterator" << endl; - return; - } - - DB(cerr << " calling next_n()" << endl); bi->next_n(how_many, bl); } @@ -501,18 +465,18 @@ NamingContext_i::~NamingContext_i() { - DB(cerr << "~NamingContext_i" << endl); - WriterLock w(lock); if (prev) { prev->next = next; - } else { + } + else { headContext = next; } if (next) { next->prev = prev; - } else { + } + else { tailContext = prev; } diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/NamingContext_i.h omniorb-dfsg-4.2.2/src/appl/omniNames/NamingContext_i.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/NamingContext_i.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/NamingContext_i.h 2017-02-20 22:45:59.000000000 +0000 @@ -18,9 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #ifndef _NamingContext_i_h_ @@ -35,10 +33,8 @@ class ObjectBinding; -class NamingContext_i : public POA_CosNaming::NamingContextExt, - public PortableServer::RefCountServantBase +class NamingContext_i : public POA_CosNaming::NamingContextExt { - friend class ObjectBinding; friend class omniNameslog; diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/ObjectBinding.h omniorb-dfsg-4.2.2/src/appl/omniNames/ObjectBinding.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/ObjectBinding.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/ObjectBinding.h 2017-02-20 22:45:59.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #ifndef _ObjectBinding_h_ diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/omniNames.cc omniorb-dfsg-4.2.2/src/appl/omniNames/omniNames.cc --- omniorb-dfsg-4.1.6/src/appl/omniNames/omniNames.cc 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/omniNames.cc 2017-02-20 22:45:59.000000000 +0000 @@ -2,7 +2,7 @@ // Package : omniNames // omniNames.cc Author : Tristan Richardson (tjr) // -// Copyright (C) 2002-2008 Apasphere Ltd +// Copyright (C) 2002-2013 Apasphere Ltd // Copyright (C) 1997-1999 AT&T Laboratories Cambridge // // This file is part of omniNames. @@ -18,9 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #include @@ -71,10 +69,9 @@ << " [-remove]\n" #endif << " [-always]\n" - << " [-logdir ]\n" + << " [-datadir ]\n" << " [-nohostname]\n" << " [-errlog ]\n" - << " [-ignoreport]\n" << " [-help]\n" << " [...]" << endl << "\nUse -start option to start omniNames for the first time.\n" @@ -86,16 +83,15 @@ << "Use -manual to request manual service start/stop rather than automatic.\n" #endif << "\nUse -always in conjunction with -start to always start omniNames, regardless\n" - << "of whether the log/data files already exist.\n" - << "\nUse -logdir option to specify the directory where the log/data files are kept.\n" - << "\nYou can also set the environment variable " << LOGDIR_ENV_VAR - << " to specify the\ndirectory where the log/data files are kept.\n" + << "of whether the data files already exist.\n" + << "\nUse -datadir option to specify the directory where the data files are kept.\n" + << "You can also set the environment variable " << DATADIR_ENV_VAR + << " to specify the\ndirectory where the data files are kept.\n" << "\nUse -nohostname to suppress the inclusion of the hostname in the log files.\n" - << "\nUse -errlog option to specify where standard error output is redirected.\n" - << "\nUse -ignoreport option to ignore the port specification when determining\n" - << "the end points to listen on, using -ORBendPoint arguments instead.\n" + << "\nUse -errlog option to specify where error/debug output is redirected.\n" << "\nTo publish a specific IP address to clients, use\n" - << " -ORBendPointPublish giop:tcp:
:\n"; + << " -ORBendPointPublish giop:tcp:
:\n" + << "\nFor a list of omniORB options run with -ORBhelp\n"; } @@ -165,7 +161,8 @@ else if (strcmp(argv[arg], "-nohostname") == 0) { nohostname = 1; } - else if (strcmp(argv[arg], "-logdir") == 0) { + else if (strcmp(argv[arg], "-datadir") == 0 || + strcmp(argv[arg], "-logdir") == 0) { if (arg + 1 == argc) { usage(); exit(1); @@ -180,10 +177,15 @@ errlog = argv[++arg]; } else if (strcmp(argv[arg], "-help") == 0 || - strcmp(argv[arg], "-ORBhelp") == 0) { + strcmp(argv[arg], "--help") == 0) { usage(); cerr << endl << endl; - new_argv[new_argc++] = "-ORBhelp"; + exit(0); + } + else if (strcmp(argv[arg], "-ORBhelp") == 0) { + usage(); + cerr << endl << endl; + new_argv[new_argc++] = (char*)"-ORBhelp"; CORBA::ORB_var orb = CORBA::ORB_init(new_argc, new_argv); orb->destroy(); exit(0); @@ -193,10 +195,11 @@ exit(1); } else { - if (strcmp(argv[arg], "-ORBendPoint") == 0 && !ignoreport) { - cerr << "Warning: -ORBendPoint specified without -ignoreport\n" - << " omniNames will add its own -ORBendPoint argument before yours.\n" - << " To publish a specific address use -ORBendPointPublish giop:tcp:
:\n"; + if (strcmp(argv[arg], "-ORBendPoint") == 0) { + if (!ignoreport) { + ignoreport = 1; + LOG(1, "-ORBendPoint option overriding default endpoint."); + } } new_argv[new_argc++] = argv[arg]; if (arg+1 < argc) @@ -225,10 +228,7 @@ names.run(); } catch (const CORBA::INITIALIZE& ex) { - cerr << "Failed to initialise the ORB / POA: " << ex.NP_minorString() - << endl - << "Is omniNames already running?" - << endl; + // omniNames constructor has logged a suitable error. exit(1); } return 0; @@ -245,30 +245,16 @@ int argc, char** argv) : cond_(&mu_), stop_(0), running_(0) -#ifdef __WIN32__ - , cerrbuf_(0) -#endif { - // Redirect stderr + // Redirect log if (errlog) { -#ifdef __WIN32__ - errstream_.open(errlog, ios_base::out | ios_base::trunc); - - if (errstream_.good()) { - cerrbuf_ = cerr.ios::rdbuf(errstream_.rdbuf()); + try { + omniORB::setLogFilename(errlog); } - else { -#else - int fd = open(errlog, O_WRONLY | O_CREAT | O_TRUNC, 0666); - if (fd < 0 || dup2(fd,2) < 0) { -#endif + catch (CORBA::INITIALIZE&) { cerr << "Cannot open error log file: " << errlog << endl; - usage(); exit(1); } -#ifndef __WIN32__ - setvbuf(stderr, 0, _IOLBF, 0); -#endif } // Set up an instance of omniNameslog. This also gives us back the @@ -296,35 +282,46 @@ new_argv[new_argc++] = argv[arg]; // Initialise ORB - orb_ = CORBA::ORB_init(new_argc, new_argv); - - delete [] new_argv; - - PortableServer::POA_var root_poa; - PortableServer::POA_var ins_poa; - - // Root POA - CORBA::Object_var poaref = orb_->resolve_initial_references("RootPOA"); - root_poa = PortableServer::POA::_narrow(poaref); - - PortableServer::POAManager_var pman = root_poa->the_POAManager(); + try { + orb_ = CORBA::ORB_init(new_argc, new_argv); - CORBA::PolicyList pl(1); - pl.length(1); - pl[0] = root_poa->create_lifespan_policy(PortableServer::PERSISTENT); + delete [] new_argv; - // Main naming context POA - names_poa = root_poa->create_POA("", pman, pl); - pman->activate(); + PortableServer::POA_var root_poa; + PortableServer::POA_var ins_poa; - // Get the interoperable naming service POA - poaref = orb_->resolve_initial_references("omniINSPOA"); - ins_poa = PortableServer::POA::_narrow(poaref); - pman = ins_poa->the_POAManager(); - pman->activate(); + // Root POA + CORBA::Object_var poaref = orb_->resolve_initial_references("RootPOA"); + root_poa = PortableServer::POA::_narrow(poaref); + + PortableServer::POAManager_var pman = root_poa->the_POAManager(); + + CORBA::PolicyList pl(1); + pl.length(1); + pl[0] = root_poa->create_lifespan_policy(PortableServer::PERSISTENT); + + // Main naming context POA + names_poa = root_poa->create_POA("", pman, pl); + pman->activate(); + + // Get the interoperable naming service POA + poaref = orb_->resolve_initial_references("omniINSPOA"); + ins_poa = PortableServer::POA::_narrow(poaref); + pman = ins_poa->the_POAManager(); + pman->activate(); - // Read the log file and set up all the naming contexts described in it. - log_->init(orb_, names_poa, ins_poa); + // Read the log file and set up all the naming contexts described in it. + log_->init(orb_, names_poa, ins_poa); + } + catch (const CORBA::INITIALIZE& ex) { + { + omniORB::logger log("omniNames: "); + log << "Failed to initialise: " << ex.NP_minorString() + << "\nomniNames may already be running, or omniORB may be " + "misconfigured.\n"; + } + throw; + } } void @@ -350,11 +347,7 @@ cond_.timedwait(s,n); } while (!stop_); } - { - time_t t = time(NULL); - char *p = ctime(&t); - cerr << endl << p << endl << "omniNames shutting down." << endl; - } + omniORB::logs(1, "omniNames shutting down."); } omniNames:: @@ -362,14 +355,6 @@ { delete log_; orb_->destroy(); - -#ifdef __WIN32__ - if (cerrbuf_) { - // Restore original cerr buffer - cerr.ios::rdbuf(cerrbuf_); - errstream_.close(); - } -#endif } void diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/omniNames.h omniorb-dfsg-4.2.2/src/appl/omniNames/omniNames.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/omniNames.h 2009-05-06 16:16:18.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/omniNames.h 2017-02-20 22:45:59.000000000 +0000 @@ -18,9 +18,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #ifndef _omniNames_h_ @@ -84,11 +82,6 @@ omni_condition cond_; CORBA::Boolean stop_; CORBA::Boolean running_; - -#ifdef __WIN32__ - std::ofstream errstream_; - std::streambuf* cerrbuf_; -#endif }; diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/omniNamesWin.cc omniorb-dfsg-4.2.2/src/appl/omniNames/omniNamesWin.cc --- omniorb-dfsg-4.1.6/src/appl/omniNames/omniNamesWin.cc 2008-02-18 16:31:44.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/omniNamesWin.cc 2017-02-20 22:45:59.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #ifdef __WIN32__ @@ -61,7 +59,7 @@ (const BYTE*)val, strlen(val)) != ERROR_SUCCESS) { TCHAR err_msg[512]; GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Registry error: " << err_msg << endl; + LOG(1, "Registry error: " << err_msg); return 0; } return 1; @@ -75,7 +73,7 @@ (const BYTE*)&val, sizeof(val)) != ERROR_SUCCESS) { TCHAR err_msg[512]; GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Registry error: " << err_msg << endl; + LOG(1, "Registry error: " << err_msg); return 0; } return 1; @@ -103,7 +101,7 @@ (const BYTE*)(char*)val, len+1) != ERROR_SUCCESS) { TCHAR err_msg[512]; GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Registry error: " << err_msg << endl; + LOG(1, "Registry error: " << err_msg); return 0; } return 1; @@ -232,7 +230,7 @@ if (path_result == 0 || path_result == sizeof(path)) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Unable to install " << WIN32_DISP_NAME << ": " << err_msg << endl; + LOG(1, "Unable to install " << WIN32_DISP_NAME << ": " << err_msg); return 2; } @@ -250,8 +248,7 @@ NULL, &rootkey, NULL) != ERROR_SUCCESS) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Unable to install " << WIN32_DISP_NAME << ": " << err_msg - << endl; + LOG(1, "Unable to install " << WIN32_DISP_NAME << ": " << err_msg); return 2; } if (!setRegLong(rootkey, "port", port)) return 2; @@ -275,7 +272,7 @@ hmanager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hmanager == NULL) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Unable to open Service Control Manager: " << err_msg << endl; + LOG(1, "Unable to open Service Control Manager: " << err_msg); return 2; } @@ -293,7 +290,7 @@ sd.lpDescription = (LPSTR)WIN32_SVC_DESC; if (!ChangeServiceConfig2(hservice, SERVICE_CONFIG_DESCRIPTION, &sd)) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Error changing service description: " << err_msg << endl; + LOG(1, "Error changing service description: " << err_msg); } CloseServiceHandle(hservice); } @@ -302,11 +299,11 @@ if (!hservice) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Failed to create service: " << err_msg << endl; + LOG(1, "Failed to create service: " << err_msg); return 2; } - cerr << WIN32_DISP_NAME << " installed." << endl; + LOG(1, WIN32_DISP_NAME << " installed."); return 0; } @@ -324,15 +321,14 @@ hmanager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (hmanager == NULL) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Unable to open Service Control Manager: " << err_msg << endl; + LOG(1, "Unable to open Service Control Manager: " << err_msg); return 2; } hservice = OpenService(hmanager, WIN32_SVC_NAME, SERVICE_ALL_ACCESS); if (hservice == NULL) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Unable to open " << WIN32_DISP_NAME << " service: " << err_msg - << endl; + LOG(1, "Unable to open " << WIN32_DISP_NAME << " service: " << err_msg); CloseServiceHandle(hmanager); return 2; } @@ -340,32 +336,31 @@ // Try to stop the service SERVICE_STATUS status; if (ControlService(hservice, SERVICE_CONTROL_STOP, &status)) { - cerr << "Stopping " << WIN32_DISP_NAME << "..." << flush; + LOG(1, "Stopping " << WIN32_DISP_NAME << "..."); Sleep(1000); while (QueryServiceStatus(hservice, &status)) { if (status.dwCurrentState != SERVICE_STOP_PENDING) break; - cerr << "." << flush; + LOG(1, "...waiting..."); Sleep(1000); } - cerr << endl; if (status.dwCurrentState == SERVICE_STOPPED) - cerr << WIN32_DISP_NAME << " stopped." << endl; + LOG(1, WIN32_DISP_NAME << " stopped."); else - cerr << WIN32_DISP_NAME << " failed to stop." << endl; + LOG(1, WIN32_DISP_NAME << " failed to stop."); } // now remove the service int return_status = 0; if (DeleteService(hservice)) { - cerr << WIN32_DISP_NAME << " removed." << endl; + LOG(1, WIN32_DISP_NAME << " removed."); } else { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Failed to delete " << WIN32_DISP_NAME << ": " << err_msg << endl; + LOG(1, "Failed to delete " << WIN32_DISP_NAME << ": " << err_msg); return_status = 2; } @@ -376,7 +371,7 @@ // Clear registry if (RegDeleteKey(HKEY_LOCAL_MACHINE, REGISTRY_KEY) != ERROR_SUCCESS) { GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Failed to clear registry key: " << err_msg << endl; + LOG(1, "Failed to clear registry key: " << err_msg); return_status = 2; } } @@ -428,8 +423,15 @@ { NULL, NULL } }; - names = new omniNames(port, logdir, errlog, ignoreport, nohostname, 1, - argc, argv); + try { + names = new omniNames(port, logdir, errlog, ignoreport, nohostname, 1, + argc, argv); + } + catch (...) { + // Carry on, to allow service start-up to report an error + names = 0; + } + if (argv != a_argv) delete [] argv; @@ -437,13 +439,17 @@ if (StartServiceCtrlDispatcher(dispatch) == 0) { char err_msg[512]; GetLastErrorText(err_msg, sizeof(err_msg)); - cerr << "Unable to start service control dispatcher: " << err_msg << endl; + LOG(1, "Unable to start service control dispatcher: " << err_msg); + + if (names) + delete names; - delete names; names = 0; return 1; } - delete names; + if (names) + delete names; + names = 0; return 0; } @@ -475,17 +481,22 @@ if (h_status) { if (win32_report_status(SERVICE_START_PENDING, NO_ERROR, 5000)) { - // Start main omniNames thread - NamesThread* nthread = new NamesThread; - - if (!names->waitForStart(5)) { - names->stop(); + if (names) { + // Start main omniNames thread + NamesThread* nthread = new NamesThread; + + if (!names->waitForStart(5)) { + names->stop(); + win32_report_status(SERVICE_STOPPED, ERROR_SERVICE_SPECIFIC_ERROR, 0); + return; + } + win32_report_status(SERVICE_RUNNING, NO_ERROR, 0); + nthread->join(0); + win32_report_status(SERVICE_STOPPED, NO_ERROR, 0); + } + else { win32_report_status(SERVICE_STOPPED, ERROR_SERVICE_SPECIFIC_ERROR, 0); - return; } - win32_report_status(SERVICE_RUNNING, NO_ERROR, 0); - nthread->join(0); - win32_report_status(SERVICE_STOPPED, NO_ERROR, 0); } } return; diff -Nru omniorb-dfsg-4.1.6/src/appl/omniNames/ReadersWritersLock.h omniorb-dfsg-4.2.2/src/appl/omniNames/ReadersWritersLock.h --- omniorb-dfsg-4.1.6/src/appl/omniNames/ReadersWritersLock.h 2003-03-23 21:04:39.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/omniNames/ReadersWritersLock.h 2017-02-20 22:45:59.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // // diff -Nru omniorb-dfsg-4.1.6/src/appl/utils/catior/catior.cc omniorb-dfsg-4.2.2/src/appl/utils/catior/catior.cc --- omniorb-dfsg-4.1.6/src/appl/utils/catior/catior.cc 2009-05-28 09:30:13.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/utils/catior/catior.cc 2017-02-20 22:45:59.000000000 +0000 @@ -2,6 +2,7 @@ // Package : catior // catior.cc Author : Eoin Carroll (ewc) // +// Copyright (C) 2013 Apasphere Ltd // Copyright (C) 1997-1999 AT&T Laboratories Cambridge // // This file is part of catior. @@ -17,17 +18,23 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // // // Lists contents of an IOR. +// For vendor tags, see: +// +// http://doc.omg.org/vendor-tags + + #include #include +#include #include +#include +#include #ifdef HAVE_STD # include @@ -62,6 +69,8 @@ #endif +OMNI_USING_NAMESPACE(omni) + static void usage(char* progname) { @@ -91,47 +100,42 @@ if (optind == num_args) return -1; char* buf_left = *(args+optind); - if ((*buf_left != '-' && *buf_left != '/') || buf_left == NULL ) return -1; + if ((*buf_left != '-' && *buf_left != '/') || buf_left == NULL) + return -1; + else if ((optind < (num_args-1)) && strcmp(buf_left,"-") == 0 && - strcmp(*(args+optind+1),"-") == 0) - { - optind+=2; - return -1; - } - else if (strcmp(buf_left,"-") == 0) - { - optind++; - return '?'; - } + strcmp(*(args+optind+1),"-") == 0) { + optind+=2; + return -1; + } + else if (strcmp(buf_left,"-") == 0) { + optind++; + return '?'; + } - for(int count = 0; count < strlen(optstring); count++) - { - if (optstring[count] == ':') continue; - if (buf_left[1] == optstring[count]) - { - if(optstring[count+1] == ':') - { - if (strlen(buf_left) > 2) - { - optarg = (buf_left+2); - optind++; - } - else if (optind < (num_args-1)) - { - optarg = *(args+optind+1); - optind+=2; - } - else - { - optind++; - return '?'; - } - } - else optind++; + for (int count = 0; count < strlen(optstring); count++) { + if (optstring[count] == ':') + continue; + + if (buf_left[1] == optstring[count]) { + if (optstring[count+1] == ':') { + if (strlen(buf_left) > 2) { + optarg = (buf_left+2); + optind++; + } + else if (optind < (num_args-1)) { + optarg = *(args+optind+1); + optind+=2; + } + else { + optind++; + return '?'; + } + } else optind++; - return buf_left[1]; - } + return buf_left[1]; } + } optind++; return '?'; } @@ -144,15 +148,28 @@ #define TRANSIENT_SUFFIX_SIZE 8 +static inline void +print_char(unsigned char c) +{ + if (c >= ' ' && c <= '~') { + cout << c; + } + else { + char buf[5]; + sprintf(buf, "\\x%02x", (int)c); + cout << buf; + } +} + static void -print_key(_CORBA_Unbounded_Sequence_Octet& key, int hexflag) +print_key(const _CORBA_Unbounded_Sequence_Octet& key, int hexflag) { if (hexflag) { // Output key in hexadecimal form. cout << "0x"; - for( unsigned j = 0; j < key.length(); j++ ) { + for (unsigned j = 0; j < key.length(); j++) { int v = (key[j] & 0xf0) >> 4; if (v < 10) @@ -176,23 +193,19 @@ cout << "\""; - for( unsigned j = 0; j < key.length(); j++ ) { - if( (char) key[j] >= ' ' && - (char) key[j] <= '~') - cout << (char) key[j]; - else - cout << "."; - } + for (unsigned j = 0; j < key.length(); j++) + print_char(key[j]); + cout << "\"" << endl; } } static int -get_poa_info(_CORBA_Unbounded_Sequence_Octet& key, - _CORBA_Unbounded_Sequence_String& poas_out, - int& transient_out, - _CORBA_Unbounded_Sequence_Octet& id_out) +get_poa_info(const _CORBA_Unbounded_Sequence_Octet& key, + _CORBA_Unbounded_Sequence_String& poas_out, + int& transient_out, + _CORBA_Unbounded_Sequence_Octet& id_out) { const char* k = (const char*) key.NP_data(); int len = key.length(); @@ -201,17 +214,17 @@ poas_out.length(1); poas_out[0] = CORBA::string_dup("root"); - if( *k != TRANSIENT_SUFFIX_SEP && *k != POA_NAME_SEP ) return 0; + if (*k != TRANSIENT_SUFFIX_SEP && *k != POA_NAME_SEP) return 0; - while( k < kend && *k == POA_NAME_SEP ) { + while (k < kend && *k == POA_NAME_SEP) { k++; const char* name = k; - while( k < kend && *k && *k != POA_NAME_SEP && *k != TRANSIENT_SUFFIX_SEP ) + while (k < kend && *k && *k != POA_NAME_SEP && *k != TRANSIENT_SUFFIX_SEP) k++; - if( k == kend ) return 0; + if (k == kend) return 0; char* nm = new char[k - name + 1]; memcpy(nm, name, k - name); @@ -220,14 +233,14 @@ poas_out[poas_out.length() - 1] = nm; } - if( k == kend ) return 0; + if (k == kend) return 0; transient_out = 0; - if( *k == TRANSIENT_SUFFIX_SEP ) { + if (*k == TRANSIENT_SUFFIX_SEP) { transient_out = 1; k += TRANSIENT_SUFFIX_SIZE + 1; } - if( k >= kend || *k ) return 0; + if (k >= kend || *k) return 0; k++; id_out.length(kend - k); @@ -238,52 +251,699 @@ static void -print_omni_key(_CORBA_Unbounded_Sequence_Octet& key, int hexflag) +print_omni_key(const _CORBA_Unbounded_Sequence_Octet& key, int hexflag) { _CORBA_Unbounded_Sequence_String poas; int is_transient; _CORBA_Unbounded_Sequence_Octet id; - if( get_poa_info(key, poas, is_transient, id) ) { + if (get_poa_info(key, poas, is_transient, id)) { cout << "POA(" << (char*)poas[0]; - for( unsigned i = 1; i < poas.length(); i++ ) + for (unsigned i = 1; i < poas.length(); i++) cout << '/' << (char*)poas[i]; cout << ") "; } + else if (key.length() == sizeof(omniOrbBoaKey)) { + cout << "BOA "; + } else { - if( key.length() != sizeof(omniOrbBoaKey) ) { - cout << "Object key not recognised as from omniORB." << endl; - exit(-1); + cout << "Unknown "; + } + print_key(key, hexflag); +} + + +// +// TaggedComponents + +static +void +print_tag_orb_type(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::ULong orb_type; + orb_type <<= e; + + cout << " TAG_ORB_TYPE "; + + switch (orb_type & 0xffffff00) { + + case 0x41545400: + cout << "omniORB"; + break; + + case 0x48500000: + case 0x4e534400: + cout << "HP"; + break; + + case 0x49424d00: + cout << "IBM"; + break; + + case 0x53554e00: + cout << "Sun"; + break; + + case 0x4f424200: + case 0x42454100: + case 0x574C5300: + cout << "BEA"; + break; + + case 0x494c5500: + cout << "Xerox"; + break; + + case 0x58505300: + case 0x50544300: + cout << "PrismTech"; + break; + + case 0x49534900: + cout << "AdNovum Informatik"; + break; + + case 0x56495300: + cout << "Borland"; + break; + + case 0x4f495300: + cout << "Object Interface Systems"; + break; + + case 0x46420000: + cout << "FloorBoard Software"; + break; + + case 0x4e4e4e00: + cout << "Rogue Wave"; + break; + + case 0x4e550000: + cout << "Nihon Unisys"; + break; + + case 0x4a424b00: + cout << "SilverStream Software"; + break; + + case 0x54414f00: + cout << "TAO"; + break; + + case 0x4c434200: + cout << "2AB"; + break; + + case 0x41505800: + cout << "Univ. of Erlangen-Nuernberg"; + break; + + case 0x4f425400: + cout << "ORBit"; + break; + + case 0x47534900: + cout << "GemStone Systems"; + break; + + case 0x464a0000: + cout << "Fujitsu"; + break; + + case 0x4f425f00: + cout << "TIBCO"; + break; + + case 0x4f414b00: + cout << "Camros Corporation"; + break; + + case 0x4f4f4300: + cout << "IONA (Orbacus)"; + break; + + case 0x49545f00: + cout << "IONA (Orbix)"; + break; + + case 0x4e454300: + cout << "NEC"; + break; + + case 0x424c5500: + cout << "Berry Software"; + break; + + case 0x56495400: + cout << "Vitria"; + break; + + case 0x444f4700: + cout << "Exoffice Technologies"; + break; + + case 0xcb0e0000: + cout << "Chicago Board of Exchange"; + break; + + case 0x4a414300: + cout << "JacORB"; + break; + + case 0x58545200: + cout << "Xtradyne Technologies"; + break; + + case 0x54475800: + cout << "Top Graph'X"; + break; + + case 0x41646100: + cout << "AdaOS Project"; + break; + + case 0x4e4f4b00: + cout << "Nokia"; + break; + + case 0x45524900: + cout << "Ericsson"; + break; + + case 0x52415900: + cout << "RayORB"; + break; + + case 0x53414e00: + cout << "Sankhya Technologies"; + break; + + case 0x414e4400: + cout << "Androsoft"; + break; + + case 0x42424300: + cout << "Bionic Buffalo"; + break; + + case 0x522e4300: + cout << "Remoting.Corba"; + break; + + case 0x504f0000: + cout << "PolyORB"; + break; + + case 0x54494400: + cout << "Telefonica"; + break; + + default: + cout << "(unknown)"; + } + cout << " ("; + print_char((orb_type & 0xff000000) >> 24); + print_char((orb_type & 0x00ff0000) >> 16); + print_char((orb_type & 0x0000ff00) >> 8); + print_char((orb_type & 0x000000ff) ); + + cout << ')' << endl; +} + + + +static +void +print_codeset_name(CORBA::ULong id) +{ + switch (id) { + + case 0x00010001: cout << "ISO-8859-1"; break; + case 0x00010002: cout << "ISO-8859-2"; break; + case 0x00010003: cout << "ISO-8859-3"; break; + case 0x00010004: cout << "ISO-8859-4"; break; + case 0x00010005: cout << "ISO-8859-5"; break; + case 0x00010006: cout << "ISO-8859-6"; break; + case 0x00010007: cout << "ISO-8859-7"; break; + case 0x00010008: cout << "ISO-8859-8"; break; + case 0x00010009: cout << "ISO-8859-9"; break; + case 0x0001000a: cout << "ISO-8859-10"; break; + case 0x0001000b: cout << "ISO-8859-11"; break; + case 0x0001000d: cout << "ISO-8859-13"; break; + case 0x0001000e: cout << "ISO-8859-14"; break; + case 0x0001000f: cout << "ISO-8859-15"; break; + case 0x00010010: cout << "ISO-8859-16"; break; + case 0x00010020: cout << "ISO-646"; break; + case 0x00010100: cout << "UCS-2-level-1"; break; + case 0x00010101: cout << "UCS-2-level-2"; break; + case 0x00010102: cout << "UCS-2-level-3"; break; + case 0x00010106: cout << "UCS-4"; break; + case 0x05010001: cout << "UTF-8"; break; + case 0x00010109: cout << "UTF-16"; break; + case 0x100204e2: cout << "windows-1250"; break; + case 0x100204e3: cout << "windows-1251"; break; + case 0x100204e4: cout << "windows-1252"; break; + case 0x100204e5: cout << "windows-1253"; break; + case 0x100204e6: cout << "windows-1254"; break; + case 0x100204e7: cout << "windows-1255"; break; + case 0x100204e8: cout << "windows-1256"; break; + case 0x100204e9: cout << "windows-1257"; break; + case 0x100204ea: cout << "windows-1258"; break; + case 0x10020025: cout << "IBM-037"; break; + case 0x100201f8: cout << "IBM-500"; break; + case 0x10040366: cout << "SNI-EDF-4"; break; + case 0x10020567: cout << "GBK"; break; + + default: + { + char buf[9]; + sprintf(buf, "%08lx", (unsigned long)id); + cout << "(0x" << buf << ")"; } - cout << "BOA "; } +} + + +static +void +print_tag_code_sets(const IOP::TaggedComponent& c) +{ + CORBA::ULong idx; + + cdrEncapsulationStream e(c.component_data, 1); + + CONV_FRAME::CodeSetComponentInfo info; + info <<= e; + + cout << " TAG_CODE_SETS char native code set: "; + print_codeset_name(info.ForCharData.native_code_set); + cout << endl; + + cout << " char conversion code sets: "; + + for (idx=0; idx != info.ForCharData.conversion_code_sets.length(); ++idx) { + if (idx != 0) + cout << ", "; - print_key(id, hexflag); + print_codeset_name(info.ForCharData.conversion_code_sets[idx]); + } + cout << endl; + + cout << " wchar native code set: "; + print_codeset_name(info.ForWcharData.native_code_set); + cout << endl; + + cout << " wchar conversion code sets: "; + + for (idx=0; idx != info.ForWcharData.conversion_code_sets.length(); ++idx) { + if (idx != 0) + cout << ", "; + + print_codeset_name(info.ForWcharData.conversion_code_sets[idx]); + } + cout << endl << endl; } static void +print_tag_policies(IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + // Encapsulation contains a Messaging::PolicyValueSeq, but the ORB + // core does not have the stubs for the Messaging module, so we + // unpick it by hand. + + CORBA::ULong seq_len; + seq_len <<= e; + + for (CORBA::ULong idx=0; idx != seq_len; ++idx) { + if (idx == 0) + cout << " TAG_POLICIES "; + else + cout << " "; + + CORBA::ULong ptype; + CORBA::OctetSeq pvalue; + + ptype <<= e; + pvalue <<= e; + + switch (ptype) { + case /*ZIOP::COMPRESSION_ENABLING_POLICY_ID*/ 64: + { + cdrEncapsulationStream pe(pvalue, 1); + CORBA::Boolean enabled = pe.unmarshalBoolean(); + + cout << "ZIOP::COMPRESSION_ENABLING_POLICY_ID: " + << (enabled ? "true" : "false") + << endl; + } + break; + + case /*ZIOP::COMPRESSOR_ID_LEVEL_LIST_POLICY_ID*/ 65: + { + cdrEncapsulationStream pe(pvalue, 1); + + cout << "ZIOP::COMPRESSOR_ID_LEVEL_LIST_POLICY_ID: " + << endl; + + // Encapsulation contains a Compression::CompressorIdLevelList + + CORBA::ULong ids_len; + ids_len <<= pe; + + for (CORBA::ULong ii=0; ii != ids_len; ++ii) { + CORBA::UShort compressor_id, compression_level; + + compressor_id <<= pe; + compression_level <<= pe; + + cout << " compressor "; + + switch (compressor_id) { + case 0: + cout << "NONE"; + break; + case 1: + cout << "GZIP"; + break; + case 2: + cout << "PKZIP"; + break; + case 3: + cout << "BZIP2"; + break; + case 4: + cout << "ZLIB"; + break; + case 5: + cout << "LZMA"; + break; + case 6: + cout << "LZO"; + break; + case 7: + cout << "RZIP"; + break; + case 8: + cout << "7X"; + break; + case 9: + cout << "XAR"; + break; + default: + cout << "unknown"; + break; + } + cout << ", level " << compression_level << endl; + } + } + break; + + default: + cout << "unknown(" << ptype << ')' << endl; + break; + } + } +} + +static +void +print_tag_alternate_iiop_address(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::String_var host; + CORBA::UShort port; + + host = e.unmarshalRawString(); + port <<= e; + + cout << " TAG_ALTERNATE_IIOP_ADDRESS " << host << ' ' << port << endl; +} + +static +void +print_tag_ssl_sec_trans(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::UShort target_supports, target_requires, port; + CORBA::Boolean is_visi = 0; + + cout << " TAG_SSL_SEC_TRANS"; + + try { + switch (c.component_data.length()) { + // Remember this is an encapsulation, so the length includes the + // first endian octet plus the necessary paddings after it + case 8: + { + // This is the standard format + target_supports <<= e; + target_requires <<= e; + port <<= e; + break; + } + default: + { + // Try visibroker propriety format + CORBA::ULong v; + v <<= e; target_supports = v; + v <<= e; target_requires = v; + port <<= e; + is_visi = 1; + break; + } + } + cout << " port = " << port + << " supports " << target_supports + << " requires " << target_requires; + + if (is_visi) + cout << " (visibroker format)"; + } + catch (...) { + cout << " (non-standard and unknown format)"; + } + cout << endl; +} + +static +void +print_tag_csi_sec_mech_list(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::Boolean stateful = e.unmarshalBoolean(); + + CORBA::ULong mech_count; + mech_count <<= e; + + for (CORBA::ULong mech_idx = 0; mech_idx != mech_count; ++mech_idx) { + CORBA::UShort target_requires; + + CORBA::UShort as_target_supports, as_target_requires; + _CORBA_Unbounded_Sequence_Octet as_client_authentication_mech; + _CORBA_Unbounded_Sequence_Octet as_target_name; + + CORBA::UShort sas_target_supports, sas_target_requires; + CORBA::ULong sas_privilege_authorities_len; + _CORBA_Unbounded_Sequence<_CORBA_Unbounded_Sequence_Octet> sas_supported_naming_mechanisms; + CORBA::ULong sas_supported_identity_types; + + // CompoundSecMech structure + target_requires <<= e; + + IOP::TaggedComponent transport_mech; + transport_mech <<= e; + + // as_context_mech member + as_target_supports <<= e; + as_target_requires <<= e; + as_client_authentication_mech <<= e; + as_target_name <<= e; + + // sas_context_mech member + sas_target_supports <<= e; + sas_target_requires <<= e; + sas_privilege_authorities_len <<= e; + for (CORBA::ULong pi = 0; pi != sas_privilege_authorities_len; ++pi) { + CORBA::ULong syntax; + _CORBA_Unbounded_Sequence_Octet name; + + syntax <<= e; + name <<= e; + } + sas_supported_naming_mechanisms <<= e; + sas_supported_identity_types <<= e; + + if (as_target_requires == 0 && + sas_target_requires == 0 && + transport_mech.tag == IOP::TAG_TLS_SEC_TRANS) { + + // No higher-level requirements and a TLS transport tag -- we + // can support this component. + CORBA::UShort tls_target_supports, tls_target_requires; + CORBA::ULong addresses_len; + + cdrEncapsulationStream tls_e(transport_mech.component_data, 1); + + tls_target_supports <<= tls_e; + tls_target_requires <<= tls_e; + addresses_len <<= tls_e; + + for (CORBA::ULong ai = 0; ai != addresses_len; ++ai) { + IIOP::Address ssladdr; + + ssladdr.host = tls_e.unmarshalRawString(); + ssladdr.port <<= tls_e; + + CORBA::String_var addr = omniURI::buildURI("", ssladdr.host, + ssladdr.port); + if (ai == 0) + cout << " TAG_CSI_SEC_MECH_LIST endpoints "; + else + cout << " "; + + cout << addr << endl; + } + return; + } + } + cout << " TAG_CSI_SEC_MECH_LIST (no usable endpoints)" << endl; +} + +static +void +print_tag_omniorb_bidir(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::String_var sendfrom = e.unmarshalRawString(); + + cout << " TAG_OMNIORB_BIDIR " << sendfrom << endl; +} + +static +void +print_tag_omniorb_unix_trans(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::String_var host = e.unmarshalRawString(); + CORBA::String_var filename = e.unmarshalRawString(); + + cout << " TAG_OMNIORB_UNIX_TRANS " << host << ' ' << filename << endl; +} + +static +void +print_tag_omniorb_persistent_id(const IOP::TaggedComponent& c) +{ + cout << " TAG_OMNIORB_PERSISTENT_ID "; + print_key(c.component_data, 1); + cout << endl; +} + +static +void +print_tag_omniorb_restricted_connection(const IOP::TaggedComponent& c) +{ + cdrEncapsulationStream e(c.component_data, 1); + + CORBA::Octet version; + CORBA::UShort flags; + CORBA::ULong connection_id, max_connections, max_threads; + + version = e.unmarshalOctet(); + flags <<= e; + connection_id <<= e; + max_connections <<= e; + max_threads <<= e; + + cout << " TAG_OMNIORB_RESTRICTED_CONNECTION version " + << (unsigned long)version << endl; + + cout << " flags "; + if (flags & 0x0001) cout << " data_batch"; + if (flags & 0x0002) cout << " permit_interleaved"; + if (flags & 0x0004) cout << " hold_open"; + if (flags == 0) cout << " (none)"; + cout << endl; + + cout << " connection_id " + << connection_id << endl; + + cout << " max_connections " + << max_connections << endl; + + cout << " max_threads " + << max_threads << endl; +} + + +static +void print_tagged_components(IOP::MultipleComponentProfile& components) { CORBA::ULong total = components.length(); for (CORBA::ULong index=0; index < total; index++) { + IOP::TaggedComponent& c = components[index]; + try { - CORBA::String_var content; - content = IOP::dumpComponent(components[index]); - char* p = content; - char* q; - do { - q = strchr(p,'\n'); - if (q) { - *q++ = '\0'; - } - cout << " " << (const char*) p << endl; - p = q; - } while (q); + switch (c.tag) { + case 0: // IOP::TAG_ORB_TYPE + print_tag_orb_type(c); + break; + + case 1: // IOP::TAG_CODE_SETS + print_tag_code_sets(c); + break; + + case 2: // IOP::TAG_POLICIES + print_tag_policies(c); + break; + + case 3: // IOP:TAG_ALTERNATE_IIOP_ADDRESS + print_tag_alternate_iiop_address(c); + break; + + case 20: // IOP::TAG_SSL_SEC_TRANS + print_tag_ssl_sec_trans(c); + break; + + case 33: // IOP::TAG_CSI_SEC_MECH_LIST + print_tag_csi_sec_mech_list(c); + break; + + case 0x41545401: // TAG_OMNIORB_BIDIR + print_tag_omniorb_bidir(c); + break; + + case 0x41545402: // TAG_OMNIORB_UNIX_TRANS + print_tag_omniorb_unix_trans(c); + break; + + case 0x41545403: // TAG_OMNIORB_PERSISTENT_ID + print_tag_omniorb_persistent_id(c); + break; + + case 0x41545404: // TAG_OMNIORB_RESTRICTED_CONNECTION + print_tag_omniorb_restricted_connection(c); + break; + + default: + cout << " Unknown component tag " << c.tag << endl; + } } catch (CORBA::MARSHAL& ex) { - cout << " Broken component" << endl; + cout << " Broken component with tag " << c.tag << endl; } } } @@ -393,7 +1053,7 @@ try { - toIOR(str_ior,ior); + toIOR(str_ior, ior); if (ior.profiles.length() == 0 && strlen(ior.type_id) == 0) { cout << "IOR is a nil object reference." << endl; @@ -418,7 +1078,7 @@ unsigned long j; - if( omniflag ) + if (omniflag) print_omni_key(pBody.object_key, hexflag); else print_key(pBody.object_key, hexflag); diff -Nru omniorb-dfsg-4.1.6/src/appl/utils/convertior/convertior.cc omniorb-dfsg-4.2.2/src/appl/utils/convertior/convertior.cc --- omniorb-dfsg-4.1.6/src/appl/utils/convertior/convertior.cc 2009-05-28 09:30:13.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/utils/convertior/convertior.cc 2017-02-20 22:45:59.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // // // Takes an IOR, hostname as arguments. Outputs IOR with new hostname. diff -Nru omniorb-dfsg-4.1.6/src/appl/utils/genior/genior.cc omniorb-dfsg-4.2.2/src/appl/utils/genior/genior.cc --- omniorb-dfsg-4.1.6/src/appl/utils/genior/genior.cc 2009-05-28 09:30:13.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/utils/genior/genior.cc 2017-03-30 13:54:10.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // // // @@ -265,6 +263,7 @@ hi = ((curr - 'a' + 10) << 4); else { cerr << "Hexadecimal key is corrupted." << endl; + delete keySeed; return 0; } curr = tolower(objKey[j+1]); @@ -288,7 +287,9 @@ CORBA::String_var result; result = omniObjRef::_toString(objref); - + + delete keySeed; + return result._retn(); } diff -Nru omniorb-dfsg-4.1.6/src/appl/utils/nameclt/nameclt.cc omniorb-dfsg-4.2.2/src/appl/utils/nameclt/nameclt.cc --- omniorb-dfsg-4.1.6/src/appl/utils/nameclt/nameclt.cc 2005-06-08 09:35:37.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/appl/utils/nameclt/nameclt.cc 2017-02-20 22:45:59.000000000 +0000 @@ -17,9 +17,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. +// along with this program. If not, see http://www.gnu.org/licenses/ // #include diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/dir.mk omniorb-dfsg-4.2.2/src/examples/ami/dir.mk --- omniorb-dfsg-4.1.6/src/examples/ami/dir.mk 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/dir.mk 2013-07-26 16:25:46.000000000 +0000 @@ -0,0 +1,32 @@ +CXXSRCS = echo_callback.cc echo_poller.cc echo_pollable_set.cc echo_dii_pollable_set.cc + +DIR_CPPFLAGS = $(CORBA_CPPFLAGS) + +CORBA_INTERFACES = echo_ami + +OMNIORB_IDL += -Wbami + +echo_callback = $(patsubst %,$(BinPattern),echo_callback) +echo_poller = $(patsubst %,$(BinPattern),echo_poller) +echo_pollable_set = $(patsubst %,$(BinPattern),echo_pollable_set) +echo_dii_pollable_set = $(patsubst %,$(BinPattern),echo_dii_pollable_set) + +all:: $(echo_callback) $(echo_poller) $(echo_pollable_set) $(echo_dii_pollable_set) + +clean:: + $(RM) $(echo_callback) $(echo_poller) $(echo_pollable_set) $(echo_dii_pollable_set) + +export:: $(echo_callback) $(echo_poller) $(echo_pollable_set) $(echo_dii_pollable_set) + @(module="echoexamples"; $(ExportExecutable)) + +$(echo_callback): echo_callback.o $(CORBA_STATIC_STUB_OBJS) $(CORBA_LIB_DEPEND) + @(libs="$(CORBA_LIB)"; $(CXXExecutable)) + +$(echo_poller): echo_poller.o $(CORBA_STATIC_STUB_OBJS) $(CORBA_LIB_DEPEND) + @(libs="$(CORBA_LIB)"; $(CXXExecutable)) + +$(echo_pollable_set): echo_pollable_set.o $(CORBA_STATIC_STUB_OBJS) $(CORBA_LIB_DEPEND) + @(libs="$(CORBA_LIB)"; $(CXXExecutable)) + +$(echo_dii_pollable_set): echo_dii_pollable_set.o $(CORBA_STATIC_STUB_OBJS) $(CORBA_LIB_DEPEND) + @(libs="$(CORBA_LIB)"; $(CXXExecutable)) diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/echo_ami.idl omniorb-dfsg-4.2.2/src/examples/ami/echo_ami.idl --- omniorb-dfsg-4.1.6/src/examples/ami/echo_ami.idl 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/echo_ami.idl 2012-02-15 23:31:07.000000000 +0000 @@ -0,0 +1,8 @@ +// echo_ami.idl +// +// This is identical to echo.idl. It is a separate file to enable easy +// compilation with AMI support. + +interface Echo { + string echoString(in string mesg); +}; diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/echo_callback.cc omniorb-dfsg-4.2.2/src/examples/ami/echo_callback.cc --- omniorb-dfsg-4.1.6/src/examples/ami/echo_callback.cc 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/echo_callback.cc 2012-04-04 20:40:14.000000000 +0000 @@ -0,0 +1,94 @@ +// AMI callback echo example. Use as a client to echo/eg2_impl +// +// Usage: echo_callback +// + +#include + +#ifdef HAVE_STD +# include +# include + using namespace std; +#else +# include +#endif + +class EchoHandler_i : public virtual POA_AMI_EchoHandler +{ +public: + inline EchoHandler_i() {}; + virtual ~EchoHandler_i() {} + + void echoString(const char* ami_return_val); + void echoString_excep(Messaging::ExceptionHolder* excep_holder); +}; + +void +EchoHandler_i::echoString(const char* ami_return_val) +{ + cout << "echoString return: " << ami_return_val << endl; +} + +void +EchoHandler_i::echoString_excep(Messaging::ExceptionHolder* excep_holder) +{ + try { + excep_holder->raise_exception(); + } + catch (CORBA::Exception& ex) { + cout << "echoString exception: " << ex._name() << endl; + } +} + + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + if (argc != 2) { + cerr << "usage: echo_callback " << endl; + return 1; + } + + // Get reference to Echo object + CORBA::Object_var obj = orb->string_to_object(argv[1]); + Echo_var echoref = Echo::_narrow(obj); + + if (CORBA::is_nil(echoref)) { + cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; + return 1; + } + + // Resolve and activate the Root POA + CORBA::Object_var poa_obj = orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(poa_obj); + PortableServer::POAManager_var pman = poa->the_POAManager(); + pman->activate(); + + // Create an EchoHandler object to receive the callback + PortableServer::Servant_var handler_svt = new EchoHandler_i; + AMI_EchoHandler_var handler = handler_svt->_this(); + + // Make the asynchronous call + echoref->sendc_echoString(handler, "Hello async!"); + + // Wait for a while -- the call should complete within this time + omni_thread::sleep(2); + + orb->destroy(); + } + catch(CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch(CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch(CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/echo_dii_pollable_set.cc omniorb-dfsg-4.2.2/src/examples/ami/echo_dii_pollable_set.cc --- omniorb-dfsg-4.1.6/src/examples/ami/echo_dii_pollable_set.cc 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/echo_dii_pollable_set.cc 2013-07-26 16:25:46.000000000 +0000 @@ -0,0 +1,101 @@ +// AMI pollable set echo example that uses the pollable set to watch +// for a DII call as well as an AMI call. +// +// Use as a client to echo/eg2_impl +// +// Usage: echo_dii_pollable_set +// + +#include + +#ifdef HAVE_STD +# include +# include + using namespace std; +#else +# include +#endif + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + if (argc != 2) { + cerr << "usage: echo_pollable_set " << endl; + return 1; + } + + // Get reference to Echo object + CORBA::Object_var obj = orb->string_to_object(argv[1]); + Echo_var echoref = Echo::_narrow(obj); + + if (CORBA::is_nil(echoref)) { + cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; + return 1; + } + + // Make an asynchronous call + AMI_EchoPoller_var poller = echoref->sendp_echoString("Hello async"); + + // Make a deferred synchronous DII call + CORBA::Request_var req = echoref->_request("echoString"); + CORBA::String_var arg = (const char*) "Hello DII"; + + req->add_in_arg() <<= arg; + req->set_return_type(CORBA::_tc_string); + req->send_deferred(); + + + // Create PollableSet + CORBA::PollableSet_var pset = poller->create_pollable_set(); + + // Get DIIPollable and add to set + CORBA::DIIPollable_var dii_pollable = pset->create_dii_pollable(); + pset->add_pollable(dii_pollable); + + try { + while (1) { + cout << pset->number_left() << " pollers left" << endl; + + CORBA::Pollable_var pollable = pset->get_ready_pollable(2000); + AMI_EchoPoller* poller = AMI_EchoPoller::_downcast(pollable); + + if (poller) { + CORBA::String_var result; + poller->echoString(0, result.out()); + cout << "AMI call returned: " << (const char*)result << endl; + } + else if (req->poll_response()) { + const char* dii_ret; + req->return_value() >>= dii_ret; + cout << "DII call returned: " << dii_ret << endl; + } + else { + cout << "Unexpected poller returned from pollable set!" << endl; + } + } + } + catch (CORBA::PollableSet::NoPossiblePollable&) { + cout << "No possible pollable." << endl; + } + catch (CORBA::TIMEOUT&) { + cout << "Timeout" << endl; + } + + orb->destroy(); + } + catch(CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch(CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch(CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/echo_pollable_set.cc omniorb-dfsg-4.2.2/src/examples/ami/echo_pollable_set.cc --- omniorb-dfsg-4.1.6/src/examples/ami/echo_pollable_set.cc 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/echo_pollable_set.cc 2013-07-26 16:25:46.000000000 +0000 @@ -0,0 +1,77 @@ +// AMI pollable set echo example. Use as a client to echo/eg2_impl +// +// Usage: echo_pollable_set +// + +#include + +#ifdef HAVE_STD +# include +# include + using namespace std; +#else +# include +#endif + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + if (argc != 2) { + cerr << "usage: echo_pollable_set " << endl; + return 1; + } + + // Get reference to Echo object + CORBA::Object_var obj = orb->string_to_object(argv[1]); + Echo_var echoref = Echo::_narrow(obj); + + if (CORBA::is_nil(echoref)) { + cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; + return 1; + } + + // Make some asynchronous calls + AMI_EchoPoller_var poller1 = echoref->sendp_echoString("Hello async 1!"); + AMI_EchoPoller_var poller2 = echoref->sendp_echoString("Hello async 2!"); + + // Create PollableSet containing both pollers + CORBA::PollableSet_var pset = poller1->create_pollable_set(); + pset->add_pollable(poller2); + + try { + while (1) { + cout << pset->number_left() << " pollers left" << endl; + + CORBA::Pollable_var pollable = pset->get_ready_pollable(2000); + AMI_EchoPoller* poller = AMI_EchoPoller::_downcast(pollable); + + CORBA::String_var result; + poller->echoString(0, result.out()); + cout << "The call returned: " << (const char*)result << endl; + } + } + catch (CORBA::PollableSet::NoPossiblePollable&) { + cout << "No possible pollable." << endl; + } + catch (CORBA::TIMEOUT&) { + cout << "Timeout" << endl; + } + + orb->destroy(); + } + catch(CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch(CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch(CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/echo_poller.cc omniorb-dfsg-4.2.2/src/examples/ami/echo_poller.cc --- omniorb-dfsg-4.1.6/src/examples/ami/echo_poller.cc 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/echo_poller.cc 2012-04-04 20:40:14.000000000 +0000 @@ -0,0 +1,77 @@ +// AMI poller echo example. Use as a client to echo/eg2_impl +// +// Usage: echo_poller +// + +#include + +#ifdef HAVE_STD +# include +# include + using namespace std; +#else +# include +#endif + +////////////////////////////////////////////////////////////////////// + +int main(int argc, char** argv) +{ + try { + CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + + if (argc != 2) { + cerr << "usage: echo_poller " << endl; + return 1; + } + + // Get reference to Echo object + CORBA::Object_var obj = orb->string_to_object(argv[1]); + Echo_var echoref = Echo::_narrow(obj); + + if (CORBA::is_nil(echoref)) { + cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; + return 1; + } + + // Make the asynchronous call + AMI_EchoPoller_var poller = echoref->sendp_echoString("Hello async!"); + + // Poll using is_ready + while (!poller->is_ready(100)) + cout << "Not ready" << endl; + + CORBA::String_var result; + poller->echoString(0, result.out()); + + cout << "The call returned: " << (const char*)result << endl; + + // Make another call + poller = echoref->sendp_echoString("Hello again async!"); + + // Poll with type-specific method + while (1) { + try { + poller->echoString(100, result.out()); + break; + } + catch (CORBA::TIMEOUT&) { + cout << "Not ready" << endl; + } + } + cout << "The second call returned: " << (const char*)result << endl; + + orb->destroy(); + } + catch(CORBA::TRANSIENT&) { + cerr << "Caught system exception TRANSIENT -- unable to contact the " + << "server." << endl; + } + catch(CORBA::SystemException& ex) { + cerr << "Caught a CORBA::" << ex._name() << endl; + } + catch(CORBA::Exception& ex) { + cerr << "Caught CORBA::Exception: " << ex._name() << endl; + } + return 0; +} diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/GNUmakefile omniorb-dfsg-4.2.2/src/examples/ami/GNUmakefile --- omniorb-dfsg-4.1.6/src/examples/ami/GNUmakefile 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/GNUmakefile 2012-02-15 23:31:07.000000000 +0000 @@ -0,0 +1,4 @@ + +TOP=../../.. +CURRENT=src/examples/ami +include $(TOP)/config/config.mk diff -Nru omniorb-dfsg-4.1.6/src/examples/ami/GNUmakefile.in omniorb-dfsg-4.2.2/src/examples/ami/GNUmakefile.in --- omniorb-dfsg-4.1.6/src/examples/ami/GNUmakefile.in 1970-01-01 00:00:00.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/ami/GNUmakefile.in 2012-02-15 23:31:07.000000000 +0000 @@ -0,0 +1,9 @@ +TOP=../../.. +CURRENT=src/examples/ami +BASE_OMNI_TREE=@top_srcdir@ +VPATH=@srcdir@ +INSTALL=@INSTALL@ + +include $(TOP)/mk/beforeauto.mk +include @srcdir@/dir.mk +include $(TOP)/mk/afterauto.mk diff -Nru omniorb-dfsg-4.1.6/src/examples/anyExample/anyExample_clt.cc omniorb-dfsg-4.2.2/src/examples/anyExample/anyExample_clt.cc --- omniorb-dfsg-4.1.6/src/examples/anyExample/anyExample_clt.cc 2005-06-08 09:35:37.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/anyExample/anyExample_clt.cc 2012-08-01 10:31:57.000000000 +0000 @@ -77,7 +77,7 @@ try { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - if( argc != 2 ) { + if (argc != 2) { cerr << "usage: anyExample_clt " << endl; return 1; } @@ -85,7 +85,7 @@ { CORBA::Object_var obj = orb->string_to_object(argv[1]); anyExample_var ref = anyExample::_narrow(obj); - if( CORBA::is_nil(ref) ) { + if (CORBA::is_nil(ref)) { cerr << "Can't narrow reference to type anyExample (or it was nil)." << endl; return 1; @@ -94,21 +94,15 @@ } orb->destroy(); } - catch(CORBA::TRANSIENT&) { + catch (CORBA::TRANSIENT&) { cerr << "Caught system exception TRANSIENT -- unable to contact the " << "server." << endl; } - catch(CORBA::SystemException& ex) { + catch (CORBA::SystemException& ex) { cerr << "Caught a CORBA::" << ex._name() << endl; } - catch(CORBA::Exception& ex) { + catch (CORBA::Exception& ex) { cerr << "Caught CORBA::Exception: " << ex._name() << endl; } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } return 0; } diff -Nru omniorb-dfsg-4.1.6/src/examples/anyExample/anyExample_impl.cc omniorb-dfsg-4.2.2/src/examples/anyExample/anyExample_impl.cc --- omniorb-dfsg-4.1.6/src/examples/anyExample/anyExample_impl.cc 2005-06-08 09:35:37.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/anyExample/anyExample_impl.cc 2012-08-01 10:31:57.000000000 +0000 @@ -46,8 +46,6 @@ cout << "Long: " << l << endl; } #ifndef NO_FLOAT - // XXX - should we provide stream ops for _CORBA_Double_ and - // _CORBA_Float_on VMS?? else if (a >>= d) { cout << "Double: " << (double)d << endl; } @@ -97,17 +95,11 @@ orb->run(); orb->destroy(); } - catch(CORBA::SystemException& ex) { + catch (CORBA::SystemException& ex) { cerr << "Caught CORBA::" << ex._name() << endl; } - catch(CORBA::Exception& ex) { + catch (CORBA::Exception& ex) { cerr << "Caught CORBA::Exception: " << ex._name() << endl; } - catch(omniORB::fatalException& fe) { - cerr << "Caught omniORB::fatalException:" << endl; - cerr << " file: " << fe.file() << endl; - cerr << " line: " << fe.line() << endl; - cerr << " mesg: " << fe.errmsg() << endl; - } return 0; } diff -Nru omniorb-dfsg-4.1.6/src/examples/bidir/bd_client.cc omniorb-dfsg-4.2.2/src/examples/bidir/bd_client.cc --- omniorb-dfsg-4.1.6/src/examples/bidir/bd_client.cc 2005-06-08 09:35:37.000000000 +0000 +++ omniorb-dfsg-4.2.2/src/examples/bidir/bd_client.cc 2012-08-01 10:31:57.000000000 +0000 @@ -27,7 +27,7 @@ static void do_single(cb::Server_ptr server, cb::CallBack_ptr cb) { - if( CORBA::is_nil(server) ) { + if (CORBA::is_nil(server)) { cerr << "cb_client: The server reference is nil!" << endl; return; } @@ -41,7 +41,7 @@ static void do_register(cb::Server_ptr server, cb::CallBack_ptr cb, int period, int time_to_shutdown) { - if( CORBA::is_nil(server) ) { + if (CORBA::is_nil(server)) { cerr << "cb_client: The server reference is nil!" << endl; return; } @@ -63,13 +63,12 @@ CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); - if( argc != 2 && argc != 4 ) { + if (argc != 2 && argc != 4) { cerr << "usage: bd_client [" "