// -*- C++ -*-

//=============================================================================
/**
 *  @file    PG_Properties_Support.cpp
 *
 *  This file implements classes to help manage PortableGroup::Properties
 *
 *  @author Dale Wilson <wilson_d@ociweb.com>
 */
//=============================================================================

#include "orbsvcs/PortableGroup/PG_Properties_Support.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO::PG_Properties_Support::PG_Properties_Support ()
{
  TAO::PG_Property_Set *props;
  ACE_NEW_THROW_EX (props,
                    TAO::PG_Property_Set (),
                    CORBA::NO_MEMORY());
  this->default_properties_.reset (props);
}

TAO::PG_Properties_Support::~PG_Properties_Support ()
{
  this->properties_map_.unbind_all ();
}

void TAO::PG_Properties_Support::set_default_property (const char * name,
      const PortableGroup::Value & value)
{
  this->default_properties_->set_property(name, value);
}

void TAO::PG_Properties_Support::set_default_properties (const PortableGroup::Properties & props)
{
  this->default_properties_->decode (props);
}

PortableGroup::Properties *
TAO::PG_Properties_Support::get_default_properties ()
{
  PortableGroup::Properties_var result;
  ACE_NEW_THROW_EX ( result, PortableGroup::Properties(), CORBA::NO_MEMORY());
  this->default_properties_->export_properties (*result);
  return result._retn ();
}

void TAO::PG_Properties_Support::remove_default_properties (
    const PortableGroup::Properties & props)
{
  this->default_properties_->remove (props);
}

void
TAO::PG_Properties_Support::set_type_properties (
    const char *type_id,
    const PortableGroup::Properties & overrides)
{
  ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);

  TAO::PG_Property_Set_var typeid_properties;
  if ( 0 != this->properties_map_.find (type_id, typeid_properties))
  {
    TAO::PG_Property_Set *props;
    ACE_NEW_THROW_EX (props,
                      TAO::PG_Property_Set (overrides,
                                            this->default_properties_),
                      CORBA::NO_MEMORY());
    typeid_properties.reset (props);
    this->properties_map_.bind (type_id, typeid_properties);
  }
  typeid_properties->clear ();
  typeid_properties->decode (overrides);
}

PortableGroup::Properties *
TAO::PG_Properties_Support::get_type_properties (
    const char *type_id)
{
  PortableGroup::Properties_var result;
  ACE_NEW_THROW_EX (result, PortableGroup::Properties(), CORBA::NO_MEMORY ());

  ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, 0);

  TAO::PG_Property_Set_var typeid_properties;
  if ( 0 != this->properties_map_.find (type_id, typeid_properties))
  {
    typeid_properties->export_properties (*result);
  }
  return result._retn ();
}

void
TAO::PG_Properties_Support::remove_type_properties (
    const char *type_id,
    const PortableGroup::Properties & props)
{
  // NOTE: do not actually delete the properties for this type.
  // There may be object groups depending on these.
  // Reference counted pointers could be used to allow property sets
  // for unused typeids to be deleted.

  ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->internals_);

  TAO::PG_Property_Set_var typeid_properties;
  if ( 0 != this->properties_map_.find (type_id, typeid_properties))
  {
    typeid_properties->remove (props);
  }
}

TAO::PG_Property_Set_var
TAO::PG_Properties_Support::find_typeid_properties (const char *type_id)
{
  TAO::PG_Property_Set_var result;
  ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->internals_, result);

  if ( 0 != this->properties_map_.find (type_id, result))
  {
    TAO::PG_Property_Set * props;
    ACE_NEW_THROW_EX (props,
                      TAO::PG_Property_Set (this->default_properties_),
                      CORBA::NO_MEMORY());
    result.reset (props);
    this->properties_map_.bind (type_id, result);
  }
  return result;
}

TAO_END_VERSIONED_NAMESPACE_DECL


#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
#   Copyright 1996-2007 Free Software Foundation, Inc.
#   Taken from GNU libtool, 2001
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
#   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.
#
# The first argument passed to this file is the canonical host specification,
#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.

# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
#   than 256 bytes, otherwise the compiler driver will dump core. The only
#   known workaround is to choose shorter directory names for the build
#   directory and/or the installation directory.

# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so

host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`

# Code taken from libtool.m4's _LT_CC_BASENAME.

for cc_temp in $CC""; do
  case $cc_temp in
    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
    \-*) ;;
    *) break;;
  esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`

# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.

wl=
if test "$GCC" = yes; then
  wl='-Wl,'
else
  case "$host_os" in
    aix*)
      wl='-Wl,'
      ;;
    darwin*)
      case $cc_basename in
        xlc*)
          wl='-Wl,'
          ;;
      esac
      ;;
    mingw* | cygwin* | pw32* | os2*)
      ;;
    hpux9* | hpux10* | hpux11*)
      wl='-Wl,'
      ;;
    irix5* | irix6* | nonstopux*)
      wl='-Wl,'
      ;;
    newsos6)
      ;;
    linux* | k*bsd*-gnu)
      case $cc_basename in
        icc* | ecc*)
          wl='-Wl,'
          ;;
        pgcc | pgf77 | pgf90)
          wl='-Wl,'
          ;;
        ccc*)
          wl='-Wl,'
          ;;
        como)
          wl='-lopt='
          ;;
        *)
          case `$CC -V 2>&1 | sed 5q` in
            *Sun\ C*)
              wl='-Wl,'
              ;;
          esac
          ;;
      esac
      ;;
    osf3* | osf4* | osf5*)
      wl='-Wl,'
      ;;
    rdos*)
      ;;
    solaris*)
      wl='-Wl,'
      ;;
    sunos4*)
      wl='-Qoption ld '
      ;;
    sysv4 | sysv4.2uw2* | sysv4.3*)
      wl='-Wl,'
      ;;
    sysv4*MP*)
      ;;
    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
      wl='-Wl,'
      ;;
    unicos*)
      wl='-Wl,'
      ;;
    uts4*)
      ;;
  esac
fi

# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.

hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no

case "$host_os" in
  cygwin* | mingw* | pw32*)
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
    # When not using gcc, we currently assume that we are using
    # Microsoft Visual C++.
    if test "$GCC" != yes; then
      with_gnu_ld=no
    fi
    ;;
  interix*)
    # we just hope/assume this is gcc and not c89 (= MSVC++)
    with_gnu_ld=yes
    ;;
  openbsd*)
    with_gnu_ld=no
    ;;
esac

ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
  # Set some defaults for GNU ld with shared library support. These
  # are reset later if shared libraries are not supported. Putting them
  # here allows them to be overridden if necessary.
  # Unlike libtool, we use -rpath here, not --rpath, since the documented
  # option of GNU ld is called -rpath, not --rpath.
  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  case "$host_os" in
    aix3* | aix4* | aix5*)
      # On AIX/PPC, the GNU linker is very broken
      if test "$host_cpu" != ia64; then
        ld_shlibs=no
      fi
      ;;
    amigaos*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
      # that the semantics of dynamic libraries on AmigaOS, at least up
      # to version 4, is to share data among multiple programs linked
      # with the same dynamic library.  Since this doesn't match the
      # behavior of shared libraries on other platforms, we cannot use
      # them.
      ld_shlibs=no
      ;;
    beos*)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    cygwin* | mingw* | pw32*)
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec='-L$libdir'
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    interix[3-9]*)
      hardcode_direct=no
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
      ;;
    gnu* | linux* | k*bsd*-gnu)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    netbsd*)
      ;;
    solaris*)
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
        ld_shlibs=no
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
      case `$LD -v 2>&1` in
        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
          ld_shlibs=no
          ;;
        *)
          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
          else
            ld_shlibs=no
          fi
          ;;
      esac
      ;;
    sunos4*)
      hardcode_direct=yes
      ;;
    *)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
  esac
  if test "$ld_shlibs" = no; then
    hardcode_libdir_flag_spec=
  fi
else
  case "$host_os" in
    aix3*)
      # Note: this linker hardcodes the directories in LIBPATH if there
      # are no directories specified by -L.
      hardcode_minus_L=yes
      if test "$GCC" = yes; then
        # Neither direct hardcoding nor static linking is supported with a
        # broken collect2.
        hardcode_direct=unsupported
      fi
      ;;
    aix4* | aix5*)
      if test "$host_cpu" = ia64; then
        # On IA64, the linker does run time linking by default, so we don't
        # have to do anything special.
        aix_use_runtimelinking=no
      else
        aix_use_runtimelinking=no
        # Test if we are trying to use run time linking or normal
        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
        # need to do runtime linking.
        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
          for ld_flag in $LDFLAGS; do
            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
              aix_use_runtimelinking=yes
              break
            fi
          done
          ;;
        esac
      fi
      hardcode_direct=yes
      hardcode_libdir_separator=':'
      if test "$GCC" = yes; then
        case $host_os in aix4.[012]|aix4.[012].*)
          collect2name=`${CC} -print-prog-name=collect2`
          if test -f "$collect2name" && \
            strings "$collect2name" | grep resolve_lib_name >/dev/null
          then
            # We have reworked collect2
            :
          else
            # We have old collect2
            hardcode_direct=unsupported
            hardcode_minus_L=yes
            hardcode_libdir_flag_spec='-L$libdir'
            hardcode_libdir_separator=
          fi
          ;;
        esac
      fi
      # Begin _LT_AC_SYS_LIBPATH_AIX.
      echo 'int main () { return 0; }' > conftest.c
      ${CC} ${LDFLAGS} conftest.c -o conftest
      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
}'`
      if test -z "$aix_libpath"; then
        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
}'`
      fi
      if test -z "$aix_libpath"; then
        aix_libpath="/usr/lib:/lib"
      fi
      rm -f conftest.c conftest
      # End _LT_AC_SYS_LIBPATH_AIX.
      if test "$aix_use_runtimelinking" = yes; then
        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
      else
        if test "$host_cpu" = ia64; then
          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
        else
          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
        fi
      fi
      ;;
    amigaos*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      # see comment about different semantics on the GNU ld section
      ld_shlibs=no
      ;;
    bsdi[45]*)
      ;;
    cygwin* | mingw* | pw32*)
      # When not using gcc, we currently assume that we are using
      # Microsoft Visual C++.
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec=' '
      libext=lib
      ;;
    darwin* | rhapsody*)
      hardcode_direct=no
      if test "$GCC" = yes ; then
        :
      else
        case $cc_basename in
          xlc*)
            ;;
          *)
            ld_shlibs=no
            ;;
        esac
      fi
      ;;
    dgux*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    freebsd1*)
      ld_shlibs=no
      ;;
    freebsd2.2*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    freebsd2*)
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    freebsd* | dragonfly*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    hpux9*)
      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
      hardcode_libdir_separator=:
      hardcode_direct=yes
      # hardcode_minus_L: Not really in the search PATH,
      # but as the default location of the library.
      hardcode_minus_L=yes
      ;;
    hpux10*)
      if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
        hardcode_libdir_separator=:
        hardcode_direct=yes
        # hardcode_minus_L: Not really in the search PATH,
        # but as the default location of the library.
        hardcode_minus_L=yes
      fi
      ;;
    hpux11*)
      if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
        hardcode_libdir_separator=:
        case $host_cpu in
          hppa*64*|ia64*)
            hardcode_direct=no
            ;;
          *)
            hardcode_direct=yes
            # hardcode_minus_L: Not really in the search PATH,
            # but as the default location of the library.
            hardcode_minus_L=yes
            ;;
        esac
      fi
      ;;
    irix5* | irix6* | nonstopux*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    netbsd*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    newsos6)
      hardcode_direct=yes
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    openbsd*)
      if test -f /usr/libexec/ld.so; then
        hardcode_direct=yes
        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
        else
          case "$host_os" in
            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
              hardcode_libdir_flag_spec='-R$libdir'
              ;;
            *)
              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
              ;;
          esac
        fi
      else
        ld_shlibs=no
      fi
      ;;
    os2*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      ;;
    osf3*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    osf4* | osf5*)
      if test "$GCC" = yes; then
        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      else
        # Both cc and cxx compiler support -rpath directly
        hardcode_libdir_flag_spec='-rpath $libdir'
      fi
      hardcode_libdir_separator=:
      ;;
    solaris*)
      hardcode_libdir_flag_spec='-R$libdir'
      ;;
    sunos4*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    sysv4)
      case $host_vendor in
        sni)
          hardcode_direct=yes # is this really true???
          ;;
        siemens)
          hardcode_direct=no
          ;;
        motorola)
          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
          ;;
      esac
      ;;
    sysv4.3*)
      ;;
    sysv4*MP*)
      if test -d /usr/nec; then
        ld_shlibs=yes
      fi
      ;;
    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
      ;;
    sysv5* | sco3.2v5* | sco5v6*)
      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
      hardcode_libdir_separator=':'
      ;;
    uts4*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    *)
      ld_shlibs=no
      ;;
  esac
fi

# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec=      # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
  aix3*)
    library_names_spec='$libname.a'
    ;;
  aix4* | aix5*)
    library_names_spec='$libname$shrext'
    ;;
  amigaos*)
    library_names_spec='$libname.a'
    ;;
  beos*)
    library_names_spec='$libname$shrext'
    ;;
  bsdi[45]*)
    library_names_spec='$libname$shrext'
    ;;
  cygwin* | mingw* | pw32*)
    shrext=.dll
    library_names_spec='$libname.dll.a $libname.lib'
    ;;
  darwin* | rhapsody*)
    shrext=.dylib
    library_names_spec='$libname$shrext'
    ;;
  dgux*)
    library_names_spec='$libname$shrext'
    ;;
  freebsd1*)
    ;;
  freebsd* | dragonfly*)
    case "$host_os" in
      freebsd[123]*)
        library_names_spec='$libname$shrext$versuffix' ;;
      *)
        library_names_spec='$libname$shrext' ;;
    esac
    ;;
  gnu*)
    library_names_spec='$libname$shrext'
    ;;
  hpux9* | hpux10* | hpux11*)
    case $host_cpu in
      ia64*)
        shrext=.so
        ;;
      hppa*64*)
        shrext=.sl
        ;;
      *)
        shrext=.sl
        ;;
    esac
    library_names_spec='$libname$shrext'
    ;;
  interix[3-9]*)
    library_names_spec='$libname$shrext'
    ;;
  irix5* | irix6* | nonstopux*)
    library_names_spec='$libname$shrext'
    case "$host_os" in
      irix5* | nonstopux*)
        libsuff= shlibsuff=
        ;;
      *)
        case $LD in
          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
          *) libsuff= shlibsuff= ;;
        esac
        ;;
    esac
    ;;
  linux*oldld* | linux*aout* | linux*coff*)
    ;;
  linux* | k*bsd*-gnu)
    library_names_spec='$libname$shrext'
    ;;
  knetbsd*-gnu)
    library_names_spec='$libname$shrext'
    ;;
  netbsd*)
    library_names_spec='$libname$shrext'
    ;;
  newsos6)
    library_names_spec='$libname$shrext'
    ;;
  nto-qnx*)
    library_names_spec='$libname$shrext'
    ;;
  openbsd*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  os2*)
    libname_spec='$name'
    shrext=.dll
    library_names_spec='$libname.a'
    ;;
  osf3* | osf4* | osf5*)
    library_names_spec='$libname$shrext'
    ;;
  rdos*)
    ;;
  solaris*)
    library_names_spec='$libname$shrext'
    ;;
  sunos4*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  sysv4 | sysv4.3*)
    library_names_spec='$libname$shrext'
    ;;
  sysv4*MP*)
    library_names_spec='$libname$shrext'
    ;;
  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
    library_names_spec='$libname$shrext'
    ;;
  uts4*)
    library_names_spec='$libname$shrext'
    ;;
esac

sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`

LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF

# How to pass a linker flag through the compiler.
wl="$escaped_wl"

# Static library suffix (normally "a").
libext="$libext"

# Shared library suffix (normally "so").
shlibext="$shlibext"

# Format of library name prefix.
libname_spec="$escaped_libname_spec"

# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"

# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"

# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"

# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"

# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"

EOF


#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
	Local $hGUI, $hImage, $hCombo

	; Create GUI
	$hGUI = GUICreate("ComboBoxEx Set Cur Sel", 400, 300)
	$hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 2, 2, 394, 100, BitOR($CBS_SIMPLE, $WS_VSCROLL, $WS_BORDER))
	GUISetState()

	$hImage = _GUIImageList_Create(16, 16, 5, 3)
	_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 110)
	_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131)
	_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 165)
	_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 168)
	_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 137)
	_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 146)
	_GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0xFF0000, 16, 16))
	_GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x00FF00, 16, 16))
	_GUIImageList_Add($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap($hCombo, 0x0000FF, 16, 16))
	_GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)

	_GUICtrlComboBoxEx_InitStorage($hCombo, 100, 200)

	_GUICtrlComboBoxEx_BeginUpdate($hCombo)
	For $x = 0 To 99
		_GUICtrlComboBoxEx_AddString($hCombo, StringFormat("%03d : Random string", $x), Random(0, 8, 1), Random(0, 8, 1), Random(0, 8, 1))
	Next
	_GUICtrlComboBoxEx_EndUpdate($hCombo)

	; Set Cur Sel
	_GUICtrlComboBoxEx_SetCurSel($hCombo, Random(0, 99, 1))

	; Get Cur Sel
	MsgBox(4160, "Information", "Current Sel: " & _GUICtrlComboBoxEx_GetCurSel($hCombo))

	Do
	Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main


// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

export let a0 = 0;
export let a1 = 1;
export let a2 = 2;
export let a3 = 3;
export let a4 = 4;
export let a5 = 5;
export let a6 = 6;
export let a7 = 7;
export let a8 = 8;
export let a9 = 9;
export let a10 = 10;
export let a11 = 11;
export let a12 = 12;
export let a13 = 13;
export let a14 = 14;
export let a15 = 15;
export let a16 = 16;
export let a17 = 17;
export let a18 = 18;
export let a19 = 19;
export let a20 = 20;
export let a21 = 21;
export let a22 = 22;
export let a23 = 23;
export let a24 = 24;
export let a25 = 25;
export let a26 = 26;
export let a27 = 27;
export let a28 = 28;
export let a29 = 29;
export let a30 = 30;
export let a31 = 31;
export let a32 = 32;
export let a33 = 33;
export let a34 = 34;
export let a35 = 35;
export let a36 = 36;
export let a37 = 37;
export let a38 = 38;
export let a39 = 39;
export let a40 = 40;
export let a41 = 41;
export let a42 = 42;
export let a43 = 43;
export let a44 = 44;
export let a45 = 45;
export let a46 = 46;
export let a47 = 47;
export let a48 = 48;
export let a49 = 49;
export let a50 = 50;
export let a51 = 51;
export let a52 = 52;
export let a53 = 53;
export let a54 = 54;
export let a55 = 55;
export let a56 = 56;
export let a57 = 57;
export let a58 = 58;
export let a59 = 59;
export let a60 = 60;
export let a61 = 61;
export let a62 = 62;
export let a63 = 63;
export let a64 = 64;
export let a65 = 65;
export let a66 = 66;
export let a67 = 67;
export let a68 = 68;
export let a69 = 69;
export let a70 = 70;
export let a71 = 71;
export let a72 = 72;
export let a73 = 73;
export let a74 = 74;
export let a75 = 75;
export let a76 = 76;
export let a77 = 77;
export let a78 = 78;
export let a79 = 79;
export let a80 = 80;
export let a81 = 81;
export let a82 = 82;
export let a83 = 83;
export let a84 = 84;
export let a85 = 85;
export let a86 = 86;
export let a87 = 87;
export let a88 = 88;
export let a89 = 89;
export let a90 = 90;
export let a91 = 91;
export let a92 = 92;
export let a93 = 93;
export let a94 = 94;
export let a95 = 95;
export let a96 = 96;
export let a97 = 97;
export let a98 = 98;
export let a99 = 99;
export let a100 = 100;
export let a101 = 101;
export let a102 = 102;
export let a103 = 103;
export let a104 = 104;
export let a105 = 105;
export let a106 = 106;
export let a107 = 107;
export let a108 = 108;
export let a109 = 109;
export let a110 = 110;
export let a111 = 111;
export let a112 = 112;
export let a113 = 113;
export let a114 = 114;
export let a115 = 115;
export let a116 = 116;
export let a117 = 117;
export let a118 = 118;
export let a119 = 119;
export let a120 = 120;
export let a121 = 121;
export let a122 = 122;
export let a123 = 123;
export let a124 = 124;
export let a125 = 125;
export let a126 = 126;
export let a127 = 127;
export let a128 = 128;
export let a129 = 129;
export let a130 = 130;
export let a131 = 131;
export let a132 = 132;
export let a133 = 133;
export let a134 = 134;
export let a135 = 135;
export let a136 = 136;
export let a137 = 137;
export let a138 = 138;
export let a139 = 139;
export let a140 = 140;
export let a141 = 141;
export let a142 = 142;
export let a143 = 143;
export let a144 = 144;
export let a145 = 145;
export let a146 = 146;
export let a147 = 147;
export let a148 = 148;
export let a149 = 149;
export let a150 = 150;
export let a151 = 151;
export let a152 = 152;
export let a153 = 153;
export let a154 = 154;
export let a155 = 155;
export let a156 = 156;
export let a157 = 157;
export let a158 = 158;
export let a159 = 159;
export let a160 = 160;
export let a161 = 161;
export let a162 = 162;
export let a163 = 163;
export let a164 = 164;
export let a165 = 165;
export let a166 = 166;
export let a167 = 167;
export let a168 = 168;
export let a169 = 169;
export let a170 = 170;
export let a171 = 171;
export let a172 = 172;
export let a173 = 173;
export let a174 = 174;
export let a175 = 175;
export let a176 = 176;
export let a177 = 177;
export let a178 = 178;
export let a179 = 179;
export let a180 = 180;
export let a181 = 181;
export let a182 = 182;
export let a183 = 183;
export let a184 = 184;
export let a185 = 185;
export let a186 = 186;
export let a187 = 187;
export let a188 = 188;
export let a189 = 189;
export let a190 = 190;
export let a191 = 191;
export let a192 = 192;
export let a193 = 193;
export let a194 = 194;
export let a195 = 195;
export let a196 = 196;
export let a197 = 197;
export let a198 = 198;
export let a199 = 199;
export let a200 = 200;
export let a201 = 201;
export let a202 = 202;
export let a203 = 203;
export let a204 = 204;
export let a205 = 205;
export let a206 = 206;
export let a207 = 207;
export let a208 = 208;
export let a209 = 209;
export let a210 = 210;
export let a211 = 211;
export let a212 = 212;
export let a213 = 213;
export let a214 = 214;
export let a215 = 215;
export let a216 = 216;
export let a217 = 217;
export let a218 = 218;
export let a219 = 219;
export let a220 = 220;
export let a221 = 221;
export let a222 = 222;
export let a223 = 223;
export let a224 = 224;
export let a225 = 225;
export let a226 = 226;
export let a227 = 227;
export let a228 = 228;
export let a229 = 229;
export let a230 = 230;
export let a231 = 231;
export let a232 = 232;
export let a233 = 233;
export let a234 = 234;
export let a235 = 235;
export let a236 = 236;
export let a237 = 237;
export let a238 = 238;
export let a239 = 239;
export let a240 = 240;
export let a241 = 241;
export let a242 = 242;
export let a243 = 243;
export let a244 = 244;
export let a245 = 245;
export let a246 = 246;
export let a247 = 247;
export let a248 = 248;
export let a249 = 249;
export let a250 = 250;
export let a251 = 251;
export let a252 = 252;
export let a253 = 253;
export let a254 = 254;
export let a255 = 255;
export let a256 = 256;
export let a257 = 257;
export let a258 = 258;
export let a259 = 259;
export let a260 = 260;
export let a261 = 261;
export let a262 = 262;
export let a263 = 263;
export let a264 = 264;
export let a265 = 265;
export let a266 = 266;
export let a267 = 267;
export let a268 = 268;
export let a269 = 269;
export let a270 = 270;
export let a271 = 271;
export let a272 = 272;
export let a273 = 273;
export let a274 = 274;
export let a275 = 275;
export let a276 = 276;
export let a277 = 277;
export let a278 = 278;
export let a279 = 279;
export let a280 = 280;
export let a281 = 281;
export let a282 = 282;
export let a283 = 283;
export let a284 = 284;
export let a285 = 285;
export let a286 = 286;
export let a287 = 287;
export let a288 = 288;
export let a289 = 289;
export let a290 = 290;
export let a291 = 291;
export let a292 = 292;
export let a293 = 293;
export let a294 = 294;
export let a295 = 295;
export let a296 = 296;
export let a297 = 297;
export let a298 = 298;
export let a299 = 299;
export let a300 = 300;
export let a301 = 301;
export let a302 = 302;
export let a303 = 303;
export let a304 = 304;
export let a305 = 305;
export let a306 = 306;
export let a307 = 307;
export let a308 = 308;
export let a309 = 309;
export let a310 = 310;
export let a311 = 311;
export let a312 = 312;
export let a313 = 313;
export let a314 = 314;
export let a315 = 315;
export let a316 = 316;
export let a317 = 317;
export let a318 = 318;
export let a319 = 319;
export let a320 = 320;
export let a321 = 321;
export let a322 = 322;
export let a323 = 323;
export let a324 = 324;
export let a325 = 325;
export let a326 = 326;
export let a327 = 327;
export let a328 = 328;
export let a329 = 329;
export let a330 = 330;
export let a331 = 331;
export let a332 = 332;
export let a333 = 333;
export let a334 = 334;
export let a335 = 335;
export let a336 = 336;
export let a337 = 337;
export let a338 = 338;
export let a339 = 339;
export let a340 = 340;
export let a341 = 341;
export let a342 = 342;
export let a343 = 343;
export let a344 = 344;
export let a345 = 345;
export let a346 = 346;
export let a347 = 347;
export let a348 = 348;
export let a349 = 349;
export let a350 = 350;
export let a351 = 351;
export let a352 = 352;
export let a353 = 353;
export let a354 = 354;
export let a355 = 355;
export let a356 = 356;
export let a357 = 357;
export let a358 = 358;
export let a359 = 359;
export let a360 = 360;
export let a361 = 361;
export let a362 = 362;
export let a363 = 363;
export let a364 = 364;
export let a365 = 365;
export let a366 = 366;
export let a367 = 367;
export let a368 = 368;
export let a369 = 369;
export let a370 = 370;
export let a371 = 371;
export let a372 = 372;
export let a373 = 373;
export let a374 = 374;
export let a375 = 375;
export let a376 = 376;
export let a377 = 377;
export let a378 = 378;
export let a379 = 379;
export let a380 = 380;
export let a381 = 381;
export let a382 = 382;
export let a383 = 383;
export let a384 = 384;
export let a385 = 385;
export let a386 = 386;
export let a387 = 387;
export let a388 = 388;
export let a389 = 389;
export let a390 = 390;
export let a391 = 391;
export let a392 = 392;
export let a393 = 393;
export let a394 = 394;
export let a395 = 395;
export let a396 = 396;
export let a397 = 397;
export let a398 = 398;
export let a399 = 399;
export let a400 = 400;
export let a401 = 401;
export let a402 = 402;
export let a403 = 403;
export let a404 = 404;
export let a405 = 405;
export let a406 = 406;
export let a407 = 407;
export let a408 = 408;
export let a409 = 409;
export let a410 = 410;
export let a411 = 411;
export let a412 = 412;
export let a413 = 413;
export let a414 = 414;
export let a415 = 415;
export let a416 = 416;
export let a417 = 417;
export let a418 = 418;
export let a419 = 419;
export let a420 = 420;
export let a421 = 421;
export let a422 = 422;
export let a423 = 423;
export let a424 = 424;
export let a425 = 425;
export let a426 = 426;
export let a427 = 427;
export let a428 = 428;
export let a429 = 429;
export let a430 = 430;
export let a431 = 431;
export let a432 = 432;
export let a433 = 433;
export let a434 = 434;
export let a435 = 435;
export let a436 = 436;
export let a437 = 437;
export let a438 = 438;
export let a439 = 439;
export let a440 = 440;
export let a441 = 441;
export let a442 = 442;
export let a443 = 443;
export let a444 = 444;
export let a445 = 445;
export let a446 = 446;
export let a447 = 447;
export let a448 = 448;
export let a449 = 449;
export let a450 = 450;
export let a451 = 451;
export let a452 = 452;
export let a453 = 453;
export let a454 = 454;
export let a455 = 455;
export let a456 = 456;
export let a457 = 457;
export let a458 = 458;
export let a459 = 459;
export let a460 = 460;
export let a461 = 461;
export let a462 = 462;
export let a463 = 463;
export let a464 = 464;
export let a465 = 465;
export let a466 = 466;
export let a467 = 467;
export let a468 = 468;
export let a469 = 469;
export let a470 = 470;
export let a471 = 471;
export let a472 = 472;
export let a473 = 473;
export let a474 = 474;
export let a475 = 475;
export let a476 = 476;
export let a477 = 477;
export let a478 = 478;
export let a479 = 479;
export let a480 = 480;
export let a481 = 481;
export let a482 = 482;
export let a483 = 483;
export let a484 = 484;
export let a485 = 485;
export let a486 = 486;
export let a487 = 487;
export let a488 = 488;
export let a489 = 489;
export let a490 = 490;
export let a491 = 491;
export let a492 = 492;
export let a493 = 493;
export let a494 = 494;
export let a495 = 495;
export let a496 = 496;
export let a497 = 497;
export let a498 = 498;
export let a499 = 499;
export let a500 = 500;
export let a501 = 501;
export let a502 = 502;
export let a503 = 503;
export let a504 = 504;
export let a505 = 505;
export let a506 = 506;
export let a507 = 507;
export let a508 = 508;
export let a509 = 509;
export let a510 = 510;
export let a511 = 511;
export let a512 = 512;
export let a513 = 513;
export let a514 = 514;
export let a515 = 515;
export let a516 = 516;
export let a517 = 517;
export let a518 = 518;
export let a519 = 519;
export let a520 = 520;
export let a521 = 521;
export let a522 = 522;
export let a523 = 523;
export let a524 = 524;
export let a525 = 525;
export let a526 = 526;
export let a527 = 527;
export let a528 = 528;
export let a529 = 529;
export let a530 = 530;
export let a531 = 531;
export let a532 = 532;
export let a533 = 533;
export let a534 = 534;
export let a535 = 535;
export let a536 = 536;
export let a537 = 537;
export let a538 = 538;
export let a539 = 539;
export let a540 = 540;
export let a541 = 541;
export let a542 = 542;
export let a543 = 543;
export let a544 = 544;
export let a545 = 545;
export let a546 = 546;
export let a547 = 547;
export let a548 = 548;
export let a549 = 549;
export let a550 = 550;
export let a551 = 551;
export let a552 = 552;
export let a553 = 553;
export let a554 = 554;
export let a555 = 555;
export let a556 = 556;
export let a557 = 557;
export let a558 = 558;
export let a559 = 559;
export let a560 = 560;
export let a561 = 561;
export let a562 = 562;
export let a563 = 563;
export let a564 = 564;
export let a565 = 565;
export let a566 = 566;
export let a567 = 567;
export let a568 = 568;
export let a569 = 569;
export let a570 = 570;
export let a571 = 571;
export let a572 = 572;
export let a573 = 573;
export let a574 = 574;
export let a575 = 575;
export let a576 = 576;
export let a577 = 577;
export let a578 = 578;
export let a579 = 579;
export let a580 = 580;
export let a581 = 581;
export let a582 = 582;
export let a583 = 583;
export let a584 = 584;
export let a585 = 585;
export let a586 = 586;
export let a587 = 587;
export let a588 = 588;
export let a589 = 589;
export let a590 = 590;
export let a591 = 591;
export let a592 = 592;
export let a593 = 593;
export let a594 = 594;
export let a595 = 595;
export let a596 = 596;
export let a597 = 597;
export let a598 = 598;
export let a599 = 599;
export let a600 = 600;
export let a601 = 601;
export let a602 = 602;
export let a603 = 603;
export let a604 = 604;
export let a605 = 605;
export let a606 = 606;
export let a607 = 607;
export let a608 = 608;
export let a609 = 609;
export let a610 = 610;
export let a611 = 611;
export let a612 = 612;
export let a613 = 613;
export let a614 = 614;
export let a615 = 615;
export let a616 = 616;
export let a617 = 617;
export let a618 = 618;
export let a619 = 619;
export let a620 = 620;
export let a621 = 621;
export let a622 = 622;
export let a623 = 623;
export let a624 = 624;
export let a625 = 625;
export let a626 = 626;
export let a627 = 627;
export let a628 = 628;
export let a629 = 629;
export let a630 = 630;
export let a631 = 631;
export let a632 = 632;
export let a633 = 633;
export let a634 = 634;
export let a635 = 635;
export let a636 = 636;
export let a637 = 637;
export let a638 = 638;
export let a639 = 639;
export let a640 = 640;
export let a641 = 641;
export let a642 = 642;
export let a643 = 643;
export let a644 = 644;
export let a645 = 645;
export let a646 = 646;
export let a647 = 647;
export let a648 = 648;
export let a649 = 649;
export let a650 = 650;
export let a651 = 651;
export let a652 = 652;
export let a653 = 653;
export let a654 = 654;
export let a655 = 655;
export let a656 = 656;
export let a657 = 657;
export let a658 = 658;
export let a659 = 659;
export let a660 = 660;
export let a661 = 661;
export let a662 = 662;
export let a663 = 663;
export let a664 = 664;
export let a665 = 665;
export let a666 = 666;
export let a667 = 667;
export let a668 = 668;
export let a669 = 669;
export let a670 = 670;
export let a671 = 671;
export let a672 = 672;
export let a673 = 673;
export let a674 = 674;
export let a675 = 675;
export let a676 = 676;
export let a677 = 677;
export let a678 = 678;
export let a679 = 679;
export let a680 = 680;
export let a681 = 681;
export let a682 = 682;
export let a683 = 683;
export let a684 = 684;
export let a685 = 685;
export let a686 = 686;
export let a687 = 687;
export let a688 = 688;
export let a689 = 689;
export let a690 = 690;
export let a691 = 691;
export let a692 = 692;
export let a693 = 693;
export let a694 = 694;
export let a695 = 695;
export let a696 = 696;
export let a697 = 697;
export let a698 = 698;
export let a699 = 699;
export let a700 = 700;
export let a701 = 701;
export let a702 = 702;
export let a703 = 703;
export let a704 = 704;
export let a705 = 705;
export let a706 = 706;
export let a707 = 707;
export let a708 = 708;
export let a709 = 709;
export let a710 = 710;
export let a711 = 711;
export let a712 = 712;
export let a713 = 713;
export let a714 = 714;
export let a715 = 715;
export let a716 = 716;
export let a717 = 717;
export let a718 = 718;
export let a719 = 719;
export let a720 = 720;
export let a721 = 721;
export let a722 = 722;
export let a723 = 723;
export let a724 = 724;
export let a725 = 725;
export let a726 = 726;
export let a727 = 727;
export let a728 = 728;
export let a729 = 729;
export let a730 = 730;
export let a731 = 731;
export let a732 = 732;
export let a733 = 733;
export let a734 = 734;
export let a735 = 735;
export let a736 = 736;
export let a737 = 737;
export let a738 = 738;
export let a739 = 739;
export let a740 = 740;
export let a741 = 741;
export let a742 = 742;
export let a743 = 743;
export let a744 = 744;
export let a745 = 745;
export let a746 = 746;
export let a747 = 747;
export let a748 = 748;
export let a749 = 749;
export let a750 = 750;
export let a751 = 751;
export let a752 = 752;
export let a753 = 753;
export let a754 = 754;
export let a755 = 755;
export let a756 = 756;
export let a757 = 757;
export let a758 = 758;
export let a759 = 759;
export let a760 = 760;
export let a761 = 761;
export let a762 = 762;
export let a763 = 763;
export let a764 = 764;
export let a765 = 765;
export let a766 = 766;
export let a767 = 767;
export let a768 = 768;
export let a769 = 769;
export let a770 = 770;
export let a771 = 771;
export let a772 = 772;
export let a773 = 773;
export let a774 = 774;
export let a775 = 775;
export let a776 = 776;
export let a777 = 777;
export let a778 = 778;
export let a779 = 779;
export let a780 = 780;
export let a781 = 781;
export let a782 = 782;
export let a783 = 783;
export let a784 = 784;
export let a785 = 785;
export let a786 = 786;
export let a787 = 787;
export let a788 = 788;
export let a789 = 789;
export let a790 = 790;
export let a791 = 791;
export let a792 = 792;
export let a793 = 793;
export let a794 = 794;
export let a795 = 795;
export let a796 = 796;
export let a797 = 797;
export let a798 = 798;
export let a799 = 799;
export let a800 = 800;
export let a801 = 801;
export let a802 = 802;
export let a803 = 803;
export let a804 = 804;
export let a805 = 805;
export let a806 = 806;
export let a807 = 807;
export let a808 = 808;
export let a809 = 809;
export let a810 = 810;
export let a811 = 811;
export let a812 = 812;
export let a813 = 813;
export let a814 = 814;
export let a815 = 815;
export let a816 = 816;
export let a817 = 817;
export let a818 = 818;
export let a819 = 819;
export let a820 = 820;
export let a821 = 821;
export let a822 = 822;
export let a823 = 823;
export let a824 = 824;
export let a825 = 825;
export let a826 = 826;
export let a827 = 827;
export let a828 = 828;
export let a829 = 829;
export let a830 = 830;
export let a831 = 831;
export let a832 = 832;
export let a833 = 833;
export let a834 = 834;
export let a835 = 835;
export let a836 = 836;
export let a837 = 837;
export let a838 = 838;
export let a839 = 839;
export let a840 = 840;
export let a841 = 841;
export let a842 = 842;
export let a843 = 843;
export let a844 = 844;
export let a845 = 845;
export let a846 = 846;
export let a847 = 847;
export let a848 = 848;
export let a849 = 849;
export let a850 = 850;
export let a851 = 851;
export let a852 = 852;
export let a853 = 853;
export let a854 = 854;
export let a855 = 855;
export let a856 = 856;
export let a857 = 857;
export let a858 = 858;
export let a859 = 859;
export let a860 = 860;
export let a861 = 861;
export let a862 = 862;
export let a863 = 863;
export let a864 = 864;
export let a865 = 865;
export let a866 = 866;
export let a867 = 867;
export let a868 = 868;
export let a869 = 869;
export let a870 = 870;
export let a871 = 871;
export let a872 = 872;
export let a873 = 873;
export let a874 = 874;
export let a875 = 875;
export let a876 = 876;
export let a877 = 877;
export let a878 = 878;
export let a879 = 879;
export let a880 = 880;
export let a881 = 881;
export let a882 = 882;
export let a883 = 883;
export let a884 = 884;
export let a885 = 885;
export let a886 = 886;
export let a887 = 887;
export let a888 = 888;
export let a889 = 889;
export let a890 = 890;
export let a891 = 891;
export let a892 = 892;
export let a893 = 893;
export let a894 = 894;
export let a895 = 895;
export let a896 = 896;
export let a897 = 897;
export let a898 = 898;
export let a899 = 899;
export let a900 = 900;
export let a901 = 901;
export let a902 = 902;
export let a903 = 903;
export let a904 = 904;
export let a905 = 905;
export let a906 = 906;
export let a907 = 907;
export let a908 = 908;
export let a909 = 909;
export let a910 = 910;
export let a911 = 911;
export let a912 = 912;
export let a913 = 913;
export let a914 = 914;
export let a915 = 915;
export let a916 = 916;
export let a917 = 917;
export let a918 = 918;
export let a919 = 919;
export let a920 = 920;
export let a921 = 921;
export let a922 = 922;
export let a923 = 923;
export let a924 = 924;
export let a925 = 925;
export let a926 = 926;
export let a927 = 927;
export let a928 = 928;
export let a929 = 929;
export let a930 = 930;
export let a931 = 931;
export let a932 = 932;
export let a933 = 933;
export let a934 = 934;
export let a935 = 935;
export let a936 = 936;
export let a937 = 937;
export let a938 = 938;
export let a939 = 939;
export let a940 = 940;
export let a941 = 941;
export let a942 = 942;
export let a943 = 943;
export let a944 = 944;
export let a945 = 945;
export let a946 = 946;
export let a947 = 947;
export let a948 = 948;
export let a949 = 949;
export let a950 = 950;
export let a951 = 951;
export let a952 = 952;
export let a953 = 953;
export let a954 = 954;
export let a955 = 955;
export let a956 = 956;
export let a957 = 957;
export let a958 = 958;
export let a959 = 959;
export let a960 = 960;
export let a961 = 961;
export let a962 = 962;
export let a963 = 963;
export let a964 = 964;
export let a965 = 965;
export let a966 = 966;
export let a967 = 967;
export let a968 = 968;
export let a969 = 969;
export let a970 = 970;
export let a971 = 971;
export let a972 = 972;
export let a973 = 973;
export let a974 = 974;
export let a975 = 975;
export let a976 = 976;
export let a977 = 977;
export let a978 = 978;
export let a979 = 979;
export let a980 = 980;
export let a981 = 981;
export let a982 = 982;
export let a983 = 983;
export let a984 = 984;
export let a985 = 985;
export let a986 = 986;
export let a987 = 987;
export let a988 = 988;
export let a989 = 989;
export let a990 = 990;
export let a991 = 991;
export let a992 = 992;
export let a993 = 993;
export let a994 = 994;
export let a995 = 995;
export let a996 = 996;
export let a997 = 997;
export let a998 = 998;
export let a999 = 999;
export let a1000 = 1000;
export let a1001 = 1001;
export let a1002 = 1002;
export let a1003 = 1003;
export let a1004 = 1004;
export let a1005 = 1005;
export let a1006 = 1006;
export let a1007 = 1007;
export let a1008 = 1008;
export let a1009 = 1009;
export let a1010 = 1010;
export let a1011 = 1011;
export let a1012 = 1012;
export let a1013 = 1013;
export let a1014 = 1014;
export let a1015 = 1015;
export let a1016 = 1016;
export let a1017 = 1017;
export let a1018 = 1018;
export let a1019 = 1019;
export let a1020 = 1020;
export let a1021 = 1021;
export let a1022 = 1022;
export let a1023 = 1023;
export let a1024 = 1024;
export let a1025 = 1025;
export let a1026 = 1026;
export let a1027 = 1027;
export let a1028 = 1028;
export let a1029 = 1029;
export let a1030 = 1030;
export let a1031 = 1031;
export let a1032 = 1032;
export let a1033 = 1033;
export let a1034 = 1034;
export let a1035 = 1035;
export let a1036 = 1036;
export let a1037 = 1037;
export let a1038 = 1038;
export let a1039 = 1039;
export let a1040 = 1040;
export let a1041 = 1041;
export let a1042 = 1042;
export let a1043 = 1043;
export let a1044 = 1044;
export let a1045 = 1045;
export let a1046 = 1046;
export let a1047 = 1047;
export let a1048 = 1048;
export let a1049 = 1049;
export let a1050 = 1050;
export let a1051 = 1051;
export let a1052 = 1052;
export let a1053 = 1053;
export let a1054 = 1054;
export let a1055 = 1055;
export let a1056 = 1056;
export let a1057 = 1057;
export let a1058 = 1058;
export let a1059 = 1059;
export let a1060 = 1060;
export let a1061 = 1061;
export let a1062 = 1062;
export let a1063 = 1063;
export let a1064 = 1064;
export let a1065 = 1065;
export let a1066 = 1066;
export let a1067 = 1067;
export let a1068 = 1068;
export let a1069 = 1069;
export let a1070 = 1070;
export let a1071 = 1071;
export let a1072 = 1072;
export let a1073 = 1073;
export let a1074 = 1074;
export let a1075 = 1075;
export let a1076 = 1076;
export let a1077 = 1077;
export let a1078 = 1078;
export let a1079 = 1079;
export let a1080 = 1080;
export let a1081 = 1081;
export let a1082 = 1082;
export let a1083 = 1083;
export let a1084 = 1084;
export let a1085 = 1085;
export let a1086 = 1086;
export let a1087 = 1087;
export let a1088 = 1088;
export let a1089 = 1089;
export let a1090 = 1090;
export let a1091 = 1091;
export let a1092 = 1092;
export let a1093 = 1093;
export let a1094 = 1094;
export let a1095 = 1095;
export let a1096 = 1096;
export let a1097 = 1097;
export let a1098 = 1098;
export let a1099 = 1099;


/*******************************************************************************
 * Copyright (c) 2015 EclipseSource and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Holger Staudacher - initial API and implementation
 ******************************************************************************/
package com.eclipsesource.jaxrs.connector.example.swagger;

public class User {

  private final String name;
  private final String email;

  public User( String name, String email) {
    this.name = name;
    this.email = email;
  }

  public String getName() {
    return name;
  }

  public String getEmail() {
    return email;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ( ( email == null ) ? 0 : email.hashCode() );
    result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
    return result;
  }

  @Override
  public boolean equals( Object obj ) {
    if( this == obj )
      return true;
    if( obj == null )
      return false;
    if( getClass() != obj.getClass() )
      return false;
    User other = ( User )obj;
    if( email == null ) {
      if( other.email != null )
        return false;
    } else if( !email.equals( other.email ) )
      return false;
    if( name == null ) {
      if( other.name != null )
        return false;
    } else if( !name.equals( other.name ) )
      return false;
    return true;
  }

}


---
-api-id: P:Windows.Devices.Sms.SmsAppMessage.ProtocolId
-api-type: winrt property
-api-device-family-note: xbox
---

<!-- Property syntax
public int ProtocolId { get;  set; }
-->

# Windows.Devices.Sms.SmsAppMessage.ProtocolId

## -description
The Protocol identifier for the message.

## -property-value
The Protocol identifier for the message. (3GPP2 only.)

## -remarks

## -examples

## -see-also

## -capabilities
cellularMessaging, sms


Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files.  Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.axml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
    drawable/
        icon.png

    layout/
        main.axml

    values/
        strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource".  The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs.  When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called "R"
(this is an Android convention) that contains the tokens for each one of the resources
included. For example, for the above Resources layout, this is what the R class would expose:

public class R {
    public class drawable {
        public const int icon = 0x123;
    }

    public class layout {
        public const int main = 0x456;
    }

    public class strings {
        public const int first_string = 0xabc;
        public const int second_string = 0xbcd;
    }
}

You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
to reference the layout/main.axml file, or R.strings.first_string to reference the first
string in the dictionary file values/strings.xml.


fileFormatVersion: 2
guid: 1b295e0457695334c98721cd922e1849
timeCreated: 1496002504
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:


/***************************************************************************//**
 * @file
 * @brief EFR32MG12P_RTCC_RET register and bit field definitions
 * @version 5.8.3
 *******************************************************************************
 * # License
 * <b>Copyright 2019 Silicon Laboratories Inc. www.silabs.com</b>
 *******************************************************************************
 *
 * SPDX-License-Identifier: Zlib
 *
 * The licensor of this software is Silicon Laboratories Inc.
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 *    claim that you wrote the original software. If you use this software
 *    in a product, an acknowledgment in the product documentation would be
 *    appreciated but is not required.
 * 2. Altered source versions must be plainly marked as such, and must not be
 *    misrepresented as being the original software.
 * 3. This notice may not be removed or altered from any source distribution.
 *
 ******************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#if defined(__ICCARM__)
#pragma system_include       /* Treat file as system include file. */
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#pragma clang system_header  /* Treat file as system include file. */
#endif

/***************************************************************************//**
 * @addtogroup Parts
 * @{
 ******************************************************************************/
/***************************************************************************//**
 * @brief RTCC_RET RTCC RET Register
 * @ingroup EFR32MG12P_RTCC
 ******************************************************************************/
typedef struct {
  __IOM uint32_t REG; /**< Retention Register  */
} RTCC_RET_TypeDef;

/** @} End of group Parts */
#ifdef __cplusplus
}
#endif


// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file. JavaScript code in this file should be added after the last require_* statement.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require rails-ujs
//= require activestorage
//= require turbolinks
//= require_tree .


/*
 * Copyright (C) 2020 Team Gateship-One
 * (Hendrik Borghorst & Frederik Luetkes)
 *
 * The AUTHORS.md file contains a detailed contributors list:
 * <https://github.com/gateship-one/odyssey/blob/master/AUTHORS.md>
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 *
 */

package org.gateshipone.odyssey.models;

import android.util.Log;

import org.gateshipone.odyssey.BuildConfig;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Random;

/**
 * This class keeps a HashMap of all artists that are part of a track list (e.g. playlist)
 * and their belonging tracks with the original list position as a pair. This can be used to
 * randomize the playback of the playback equally distributed over all artists of the original
 * track list.
 */
public class TrackRandomGenerator {
    private static final String TAG = TrackRandomGenerator.class.getSimpleName();

    /**
     * Underlying data structure for artist-track buckets
     */
    private ArrayList<List<Integer>> mData;

    /**
     * Creates an empty data structure
     */
    public TrackRandomGenerator() {
        mData = new ArrayList<>();
    }

    private BetterPseudoRandomGenerator mRandomGenerator = new BetterPseudoRandomGenerator();

    private List<TrackModel> mOriginalList;

    private int mIntelligenceFactor;

    /**
     * Creates a list of artists and their tracks with position in the original playlist
     *
     * @param tracks List of tracks
     */
    public synchronized void fillFromList(List<TrackModel> tracks) {
        // Clear all entries
        mData.clear();

        mOriginalList = tracks;

        if (mIntelligenceFactor == 0) {
            return;
        }
        LinkedHashMap<String, List<Integer>> hashMap = new LinkedHashMap<>();

        if (tracks == null || tracks.isEmpty()) {
            // Abort for empty data structures
            return;
        }

        // Iterate over the list and add all tracks to their artist lists
        int trackNo = 0;
        for (TrackModel track : tracks) {
            String artistName = track.getTrackArtistName();
            List<Integer> list = hashMap.get(artistName);
            if (list == null) {
                // If artist is not already in HashMap add a new list for it
                list = new ArrayList<>();
                hashMap.put(artistName, list);
            }
            // Add pair of position in original playlist and track itself to artists bucket list
            list.add(trackNo);

            // Increase the track number (index) of the original playlist
            trackNo++;
        }
        if (BuildConfig.DEBUG) {
            Log.v(TAG, "Recreated buckets with: " + hashMap.size() + " artists");
        }

        mData.addAll(hashMap.values());
        Collections.shuffle(mData);
    }

    /**
     * Generates a randomized track number within the original track list, that was used for the call
     * of fillFromList. The random track number should be equally distributed over all artists.
     *
     * @return A random number of a track of the original track list
     */
    public synchronized int getRandomTrackNumber() {
        // Randomize if a more balanced (per artist) approach or a traditional approach should be used
        boolean smartRandom = mRandomGenerator.getLimitedRandomNumber(100) < mIntelligenceFactor;

        if (smartRandom) {
            if (BuildConfig.DEBUG) {
                Log.v(TAG, "Use smart random");
            }
            if (mData.isEmpty()) {
                // Refill list from original list
                fillFromList(mOriginalList);
            }

            // First level random, get artist
            int randomArtistNumber = mRandomGenerator.getLimitedRandomNumber(mData.size());

            // Get artists bucket list to artist number
            List<Integer> artistsTracks;

            // Get the list of tracks belonging to the selected artist
            artistsTracks = mData.get(randomArtistNumber);

            // Check if an artist was found
            if (artistsTracks == null) {
                return 0;
            }

            int randomTrackNo = mRandomGenerator.getLimitedRandomNumber(artistsTracks.size());

            Integer songNumber = artistsTracks.get(randomTrackNo);

            // Remove track to prevent double plays
            artistsTracks.remove(randomTrackNo);
            if (BuildConfig.DEBUG) {
                Log.v(TAG, "Tracks from artist left: " + artistsTracks.size());
            }

            // Check if tracks from this artist are left, otherwise remove the artist
            if (artistsTracks.isEmpty()) {
                // No tracks left from artist, remove from map
                mData.remove(randomArtistNumber);
                if (BuildConfig.DEBUG) {
                    Log.v(TAG, "Artists left: " + mData.size());
                }
            }
            if (BuildConfig.DEBUG) {
                Log.v(TAG, "Selected artist no.: " + randomArtistNumber + " with internal track no.: " + randomTrackNo + " and original track no.: " + songNumber);
            }
            // Get random track number
            return songNumber;
        } else {
            if (BuildConfig.DEBUG) {
                Log.v(TAG, "Use traditional random");
            }
            return mRandomGenerator.getLimitedRandomNumber(mOriginalList.size());
        }
    }

    public void setEnabled(int factor) {
        if (mIntelligenceFactor == 0 && factor != 0) {
            // Redo track buckets
            fillFromList(mOriginalList);
        } else if (mIntelligenceFactor != 0 && factor == 0) {
            // Remove track buckets
            fillFromList(null);
        }
        mIntelligenceFactor = factor;
    }

    private static class BetterPseudoRandomGenerator {
        /**
         * Timeout in ns (1 second)
         */
        private final static long TIMEOUT_NS = 10000000000L;
        private Random mJavaGenerator;

        private static final int RAND_MAX = Integer.MAX_VALUE;

        /**
         * Value after how many random numbers a reseed is done
         */
        private static final int RESEED_COUNT = 20;

        private int mNumbersGiven = 0;

        private int mInternalSeed;

        private BetterPseudoRandomGenerator() {
            mJavaGenerator = new Random();

            // Initialize internal seed
            mInternalSeed = mJavaGenerator.nextInt();

            // Do a quick check
            //testDistribution(20,20);
        }

        private int getInternalRandomNumber() {
            /*
             * Marsaglia, "Xorshift RNGs"
             */
            int newSeed = mInternalSeed;

            newSeed ^= newSeed << 13;
            newSeed ^= newSeed >> 17;
            newSeed ^= newSeed << 5;

            mNumbersGiven++;
            if (mNumbersGiven == RESEED_COUNT) {
                if (BuildConfig.DEBUG) {
                    Log.v(TAG, "Reseeded PRNG");
                }
                mInternalSeed = mJavaGenerator.nextInt();
                mNumbersGiven = 0;
            } else {
                mInternalSeed = newSeed;
            }
            return Math.abs(newSeed);
        }

        int getLimitedRandomNumber(int limit) {
            if (limit == 0) {
                return 0;
            }
            int r, d = RAND_MAX / limit;
            limit *= d;
            long startTime = System.nanoTime();
            do {
                r = getInternalRandomNumber();
                if ((System.nanoTime() - startTime) > TIMEOUT_NS) {
                    if (BuildConfig.DEBUG) {
                        Log.w(TAG, "Random generation timed out");
                    }
                    // Fallback to java generator
                    return mJavaGenerator.nextInt(limit);
                }
            } while (r >= limit);
            return r / d;
        }

        private void testDistribution(int numberLimit, int runs) {
            int[] numberCount = new int[numberLimit];

            for (int i = 0; i < runs; i++) {
                numberCount[getLimitedRandomNumber(numberLimit)]++;
            }

            // Print distribution and calculate mean
            int arithmeticMean = 0;
            for (int i = 0; i < numberLimit; i++) {
                Log.v(TAG, "Number: " + i + " = " + numberCount[i]);
                arithmeticMean += numberCount[i];
            }

            arithmeticMean /= numberLimit;
            Log.v(TAG, "Mean value: " + arithmeticMean);

            int variance = 0;
            for (int i = 0; i < numberLimit; i++) {
                variance += Math.pow((numberCount[i] - arithmeticMean), 2);
            }
            Log.v(TAG, "Variance: " + variance);
            double sd = Math.sqrt(variance);
            Log.v(TAG, "Standard deviation: " + sd);
            double rsd = sd / arithmeticMean;
            Log.v(TAG, "Relative standard deviation: " + rsd + " %");

        }
    }
}


/******************************************************************
 *  LexMarkdown.cxx
 *
 *  A simple Markdown lexer for scintilla.
 *
 *  Includes highlighting for some extra features from the
 *  Pandoc implementation; strikeout, using '#.' as a default
 *  ordered list item marker, and delimited code blocks.
 *
 *  Limitations:
 *
 *  Standard indented code blocks are not highlighted at all,
 *  as it would conflict with other indentation schemes. Use
 *  delimited code blocks for blanket highlighting of an
 *  entire code block.  Embedded HTML is not highlighted either.
 *  Blanket HTML highlighting has issues, because some Markdown
 *  implementations allow Markdown markup inside of the HTML. Also,
 *  there is a following blank line issue that can't be ignored,
 *  explained in the next paragraph. Embedded HTML and code
 *  blocks would be better supported with language specific
 *  highlighting.
 *
 *  The highlighting aims to accurately reflect correct syntax,
 *  but a few restrictions are relaxed. Delimited code blocks are
 *  highlighted, even if the line following the code block is not blank.
 *  Requiring a blank line after a block, breaks the highlighting
 *  in certain cases, because of the way Scintilla ends up calling
 *  the lexer.
 *
 *  Written by Jon Strait - jstrait@moonloop.net
 *
 *  The License.txt file describes the conditions under which this
 *  software may be distributed.
 *
 *****************************************************************/

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>

#include "ILexer.h"
#include "Scintilla.h"
#include "SciLexer.h"

#include "WordList.h"
#include "LexAccessor.h"
#include "Accessor.h"
#include "StyleContext.h"
#include "CharacterSet.h"
#include "LexerModule.h"

using namespace Scintilla;

static inline bool IsNewline(const int ch) {
    return (ch == '\n' || ch == '\r');
}

// True if can follow ch down to the end with possibly trailing whitespace
static bool FollowToLineEnd(const int ch, const int state, const Sci_PositionU endPos, StyleContext &sc) {
    Sci_PositionU i = 0;
    while (sc.GetRelative(++i) == ch)
        ;
    // Skip over whitespace
    while (IsASpaceOrTab(sc.GetRelative(i)) && sc.currentPos + i < endPos)
        ++i;
    if (IsNewline(sc.GetRelative(i)) || sc.currentPos + i == endPos) {
        sc.Forward(i);
        sc.ChangeState(state);
        sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
        return true;
    }
    else return false;
}

// Set the state on text section from current to length characters,
// then set the rest until the newline to default, except for any characters matching token
static void SetStateAndZoom(const int state, const Sci_Position length, const int token, StyleContext &sc) {
    sc.SetState(state);
    sc.Forward(length);
    sc.SetState(SCE_MARKDOWN_DEFAULT);
    sc.Forward();
    bool started = false;
    while (sc.More() && !IsNewline(sc.ch)) {
        if (sc.ch == token && !started) {
            sc.SetState(state);
            started = true;
        }
        else if (sc.ch != token) {
            sc.SetState(SCE_MARKDOWN_DEFAULT);
            started = false;
        }
        sc.Forward();
    }
    sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
}

// Does the previous line have more than spaces and tabs?
static bool HasPrevLineContent(StyleContext &sc) {
    Sci_Position i = 0;
    // Go back to the previous newline
    while ((--i + (Sci_Position)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i)))
        ;
    while ((--i + (Sci_Position)sc.currentPos) >= 0) {
        if (IsNewline(sc.GetRelative(i)))
            break;
        if (!IsASpaceOrTab(sc.GetRelative(i)))
            return true;
    }
    return false;
}

static bool AtTermStart(StyleContext &sc) {
    return sc.currentPos == 0 || sc.chPrev == 0 || isspacechar(sc.chPrev);
}

static bool IsValidHrule(const Sci_PositionU endPos, StyleContext &sc) {
    int count = 1;
    Sci_PositionU i = 0;
    for (;;) {
        ++i;
        int c = sc.GetRelative(i);
        if (c == sc.ch)
            ++count;
        // hit a terminating character
        else if (!IsASpaceOrTab(c) || sc.currentPos + i == endPos) {
            // Are we a valid HRULE
            if ((IsNewline(c) || sc.currentPos + i == endPos) &&
                    count >= 3 && !HasPrevLineContent(sc)) {
                sc.SetState(SCE_MARKDOWN_HRULE);
                sc.Forward(i);
                sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
                return true;
            }
            else {
                sc.SetState(SCE_MARKDOWN_DEFAULT);
		return false;
            }
        }
    }
}

static void ColorizeMarkdownDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
                               WordList **, Accessor &styler) {
    Sci_PositionU endPos = startPos + length;
    int precharCount = 0;
    bool isLinkNameDetecting = false;
    // Don't advance on a new loop iteration and retry at the same position.
    // Useful in the corner case of having to start at the beginning file position
    // in the default state.
    bool freezeCursor = false;

    StyleContext sc(startPos, length, initStyle, styler);

    while (sc.More()) {
        // Skip past escaped characters
        if (sc.ch == '\\') {
            sc.Forward();
            continue;
        }

        // A blockquotes resets the line semantics
        if (sc.state == SCE_MARKDOWN_BLOCKQUOTE)
            sc.SetState(SCE_MARKDOWN_LINE_BEGIN);

        // Conditional state-based actions
        if (sc.state == SCE_MARKDOWN_CODE2) {
            if (sc.Match("``") && sc.GetRelative(-2) != ' ') {
                sc.Forward(2);
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
        }
        else if (sc.state == SCE_MARKDOWN_CODE) {
            if (sc.ch == '`' && sc.chPrev != ' ')
                sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
        }
        /* De-activated because it gets in the way of other valid indentation
         * schemes, for example multiple paragraphs inside a list item.
        // Code block
        else if (sc.state == SCE_MARKDOWN_CODEBK) {
            bool d = true;
            if (IsNewline(sc.ch)) {
                if (sc.chNext != '\t') {
                    for (int c = 1; c < 5; ++c) {
                        if (sc.GetRelative(c) != ' ')
                            d = false;
                    }
                }
            }
            else if (sc.atLineStart) {
                if (sc.ch != '\t' ) {
                    for (int i = 0; i < 4; ++i) {
                        if (sc.GetRelative(i) != ' ')
                            d = false;
                    }
                }
            }
            if (!d)
                sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
        }
        */
        // Strong
        else if (sc.state == SCE_MARKDOWN_STRONG1) {
            if (sc.Match("**") && sc.chPrev != ' ') {
                sc.Forward(2);
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
        }
        else if (sc.state == SCE_MARKDOWN_STRONG2) {
            if (sc.Match("__") && sc.chPrev != ' ') {
                sc.Forward(2);
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
        }
        // Emphasis
        else if (sc.state == SCE_MARKDOWN_EM1) {
            if (sc.ch == '*' && sc.chPrev != ' ')
                sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
        }
        else if (sc.state == SCE_MARKDOWN_EM2) {
            if (sc.ch == '_' && sc.chPrev != ' ')
                sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
        }
        else if (sc.state == SCE_MARKDOWN_CODEBK) {
            if (sc.atLineStart && sc.Match("~~~")) {
                Sci_Position i = 1;
                while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos)
                    i++;
                sc.Forward(i);
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
        }
        else if (sc.state == SCE_MARKDOWN_STRIKEOUT) {
            if (sc.Match("~~") && sc.chPrev != ' ') {
                sc.Forward(2);
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
        }
        else if (sc.state == SCE_MARKDOWN_LINE_BEGIN) {
            // Header
            if (sc.Match("######"))
                SetStateAndZoom(SCE_MARKDOWN_HEADER6, 6, '#', sc);
            else if (sc.Match("#####"))
                SetStateAndZoom(SCE_MARKDOWN_HEADER5, 5, '#', sc);
            else if (sc.Match("####"))
                SetStateAndZoom(SCE_MARKDOWN_HEADER4, 4, '#', sc);
            else if (sc.Match("###"))
                SetStateAndZoom(SCE_MARKDOWN_HEADER3, 3, '#', sc);
            else if (sc.Match("##"))
                SetStateAndZoom(SCE_MARKDOWN_HEADER2, 2, '#', sc);
            else if (sc.Match("#")) {
                // Catch the special case of an unordered list
                if (sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
                    precharCount = 0;
                    sc.SetState(SCE_MARKDOWN_PRECHAR);
                }
                else
                    SetStateAndZoom(SCE_MARKDOWN_HEADER1, 1, '#', sc);
            }
            // Code block
            else if (sc.Match("~~~")) {
                if (!HasPrevLineContent(sc))
                    sc.SetState(SCE_MARKDOWN_CODEBK);
                else
                    sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
            else if (sc.ch == '=') {
                if (HasPrevLineContent(sc) && FollowToLineEnd('=', SCE_MARKDOWN_HEADER1, endPos, sc))
                    ;
                else
                    sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
            else if (sc.ch == '-') {
                if (HasPrevLineContent(sc) && FollowToLineEnd('-', SCE_MARKDOWN_HEADER2, endPos, sc))
                    ;
                else {
                    precharCount = 0;
                    sc.SetState(SCE_MARKDOWN_PRECHAR);
                }
            }
            else if (IsNewline(sc.ch))
                sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
            else {
                precharCount = 0;
                sc.SetState(SCE_MARKDOWN_PRECHAR);
            }
        }

        // The header lasts until the newline
        else if (sc.state == SCE_MARKDOWN_HEADER1 || sc.state == SCE_MARKDOWN_HEADER2 ||
                sc.state == SCE_MARKDOWN_HEADER3 || sc.state == SCE_MARKDOWN_HEADER4 ||
                sc.state == SCE_MARKDOWN_HEADER5 || sc.state == SCE_MARKDOWN_HEADER6) {
            if (IsNewline(sc.ch))
                sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
        }

        // New state only within the initial whitespace
        if (sc.state == SCE_MARKDOWN_PRECHAR) {
            // Blockquote
            if (sc.ch == '>' && precharCount < 5)
                sc.SetState(SCE_MARKDOWN_BLOCKQUOTE);
            /*
            // Begin of code block
            else if (!HasPrevLineContent(sc) && (sc.chPrev == '\t' || precharCount >= 4))
                sc.SetState(SCE_MARKDOWN_CODEBK);
            */
            // HRule - Total of three or more hyphens, asterisks, or underscores
            // on a line by themselves
            else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '_') && IsValidHrule(endPos, sc))
                ;
            // Unordered list
            else if ((sc.ch == '-' || sc.ch == '*' || sc.ch == '+') && IsASpaceOrTab(sc.chNext)) {
                sc.SetState(SCE_MARKDOWN_ULIST_ITEM);
                sc.ForwardSetState(SCE_MARKDOWN_DEFAULT);
            }
            // Ordered list
            else if (IsADigit(sc.ch)) {
                int digitCount = 0;
                while (IsADigit(sc.GetRelative(++digitCount)))
                    ;
                if (sc.GetRelative(digitCount) == '.' &&
                        IsASpaceOrTab(sc.GetRelative(digitCount + 1))) {
                    sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
                    sc.Forward(digitCount + 1);
                    sc.SetState(SCE_MARKDOWN_DEFAULT);
                }
            }
            // Alternate Ordered list
            else if (sc.ch == '#' && sc.chNext == '.' && IsASpaceOrTab(sc.GetRelative(2))) {
                sc.SetState(SCE_MARKDOWN_OLIST_ITEM);
                sc.Forward(2);
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
            else if (sc.ch != ' ' || precharCount > 2)
                sc.SetState(SCE_MARKDOWN_DEFAULT);
            else
                ++precharCount;
        }

        // Any link
        if (sc.state == SCE_MARKDOWN_LINK) {
            if (sc.Match("](") && sc.GetRelative(-1) != '\\') {
              sc.Forward(2);
              isLinkNameDetecting = true;
            }
            else if (sc.Match("]:") && sc.GetRelative(-1) != '\\') {
              sc.Forward(2);
              sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
            else if (!isLinkNameDetecting && sc.ch == ']' && sc.GetRelative(-1) != '\\') {
              sc.Forward();
              sc.SetState(SCE_MARKDOWN_DEFAULT);
            }
            else if (isLinkNameDetecting && sc.ch == ')' && sc.GetRelative(-1) != '\\') {
              sc.Forward();
              sc.SetState(SCE_MARKDOWN_DEFAULT);
              isLinkNameDetecting = false;
            }
        }

        // New state anywhere in doc
        if (sc.state == SCE_MARKDOWN_DEFAULT) {
            if (sc.atLineStart && sc.ch == '#') {
                sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
                freezeCursor = true;
            }
            // Links and Images
            if (sc.Match("![")) {
              sc.SetState(SCE_MARKDOWN_LINK);
              sc.Forward(2);
            }
            else if (sc.ch == '[' && sc.GetRelative(-1) != '\\') {
              sc.SetState(SCE_MARKDOWN_LINK);
              sc.Forward();
            }
            // Code - also a special case for alternate inside spacing
            else if (sc.Match("``") && sc.GetRelative(3) != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_CODE2);
                sc.Forward();
            }
            else if (sc.ch == '`' && sc.chNext != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_CODE);
            }
            // Strong
            else if (sc.Match("**") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_STRONG1);
                sc.Forward();
           }
            else if (sc.Match("__") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_STRONG2);
                sc.Forward();
            }
            // Emphasis
            else if (sc.ch == '*' && sc.chNext != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_EM1);
            }
            else if (sc.ch == '_' && sc.chNext != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_EM2);
            }
            // Strikeout
            else if (sc.Match("~~") && sc.GetRelative(2) != ' ' && AtTermStart(sc)) {
                sc.SetState(SCE_MARKDOWN_STRIKEOUT);
                sc.Forward();
            }
            // Beginning of line
            else if (IsNewline(sc.ch)) {
                sc.SetState(SCE_MARKDOWN_LINE_BEGIN);
            }
        }
        // Advance if not holding back the cursor for this iteration.
        if (!freezeCursor)
            sc.Forward();
        freezeCursor = false;
    }
    sc.Complete();
}

LexerModule lmMarkdown(SCLEX_MARKDOWN, ColorizeMarkdownDoc, "markdown");


nvkm-y += nvkm/engine/sw/base.o
nvkm-y += nvkm/engine/sw/nv04.o
nvkm-y += nvkm/engine/sw/nv10.o
nvkm-y += nvkm/engine/sw/nv50.o
nvkm-y += nvkm/engine/sw/gf100.o

nvkm-y += nvkm/engine/sw/chan.o

nvkm-y += nvkm/engine/sw/nvsw.o


# Tests for PERFORMANCE_SCHEMA

--source include/not_embedded.inc
--source include/have_perfschema.inc

# The query result are not re producible,
# due to variations in platforms and plugins
# We still execute the select statement, for:
# - code coverage
# - make sure it does not crash
# - valgrind coverage

--disable_result_log
select * from performance_schema.setup_instruments;
--enable_result_log

# DEBUG_SYNC::mutex is dependent on the build (DEBUG only)

select * from performance_schema.setup_instruments
  where name like 'Wait/Synch/Mutex/sql/%'
  and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
  order by name limit 10;

# CRYPTO_dynlock_value::lock is dependent on the build (SSL)

select * from performance_schema.setup_instruments
  where name like 'Wait/Synch/Rwlock/sql/%'
  and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
  order by name limit 10;

# COND_handler_count is dependent on the build (Windows only)
# DEBUG_SYNC::cond is dependent on the build (DEBUG only)
# COND_main_thread_in_use is dependent on the build (non Windows)
# COND_start_signal_handler is dependent on the build (non Windows)

select * from performance_schema.setup_instruments
  where name like 'Wait/Synch/Cond/sql/%'
  and name not in (
    'wait/synch/cond/sql/COND_open',
    'wait/synch/cond/sql/COND_handler_count',
    'wait/synch/cond/sql/DEBUG_SYNC::cond',
    'wait/synch/cond/sql/COND_socket_listener_active',
    'wait/synch/cond/sql/COND_start_signal_handler')
  order by name limit 10;

--disable_result_log
select * from performance_schema.setup_instruments
  where name='Wait';
--enable_result_log

--disable_result_log
select * from performance_schema.setup_instruments
  where enabled='YES';
--enable_result_log

--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.setup_instruments
  set name='FOO', enabled='YES', timed='YES';

--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.setup_instruments
  set name='FOO';

update performance_schema.setup_instruments
  set enabled='NO';

update performance_schema.setup_instruments
  set timed='NO';

--disable_result_log
select * from performance_schema.setup_instruments;
--enable_result_log

update performance_schema.setup_instruments
  set enabled='YES', timed='YES';

--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.setup_instruments;

--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.setup_instruments
  where name like 'Wait/Synch/%';

LOCK TABLES performance_schema.setup_instruments READ;
UNLOCK TABLES;

LOCK TABLES performance_schema.setup_instruments WRITE;
UNLOCK TABLES;

--echo
--echo # Bug#13813193 ASSERTION `TABLE->READ_SET ==
--echo # &TABLE->DEF_READ_SET' FAILED / MYSQL_UPDATE
--echo
UPDATE performance_schema.setup_instruments SET timed='NO'
ORDER BY RAND();

# Test cleanup

update performance_schema.setup_instruments
  set enabled='YES', TIMED='YES';


#root {
    height: 100%;
}

#root .ant-layout {
    height: 100%;
}

#root .logo {
    width: 100%;
    color: #fff;
    text-align: center;
    height: 60px;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    background: transparent;
    float: left;
    margin-bottom: 20px;
    border-bottom: 1px solid #232e3a;
    padding-top: 10px;
}

#root .logo > img {
    width: 31px;
    height: 31px;
}

#main {
    background-image: url(https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg);
    background-repeat: no-repeat;
    background-position: center 110px;
    background-size: 100%;
}

#login-top {
    text-align: center;
}

#root .ant-menu-dark.ant-menu-horizontal {
    border-bottom-color: transparent;
}

/*
.ant-menu.ant-menu-dark .ant-menu-item-selected, .ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected {
    background-color: #1ac09e;
}
*/
.vullevel {
    width: 50%;
}

.vultype {
    width: 50%;
}

.ant-form-inline .ant-form-item {
    display: inline-block;
    margin-right: 0px;
    margin-bottom: 0;
    width: 100%;
}

.ant-form-inline .ant-form-item > .ant-form-item-control-wrapper, .ant-form-inline .ant-form-item > .ant-form-item-label {
    display: inline-block;
    vertical-align: middle;
    width: 100%;
}

/*滚动字幕*/
.marquee {
    color: #000000;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    animation: marquee 10s linear infinite;
}

.marquee:hover {
    animation-play-state: paused
}

/* Make it move */
@keyframes marquee {
    0% {
        text-indent: 27.5em
    }
    100% {
        text-indent: -105em
    }
}


'use strict';

module.exports = function(app, options) {
  options = options || {};

  // Globals
  global.__basedir = __dirname;
  global.__version = require('./package.json').version;

  // Node modules
  const BodyParser = require('body-parser');
  const Chalk = require('chalk');
  const CookieParser = require('cookie-parser');
  const Compression = require('compression');
  const DustHelpers = require('dustjs-helpers');
  const Express = require('express');
  const Path = require('path');
  const Promise = require('bluebird');
  const Slashes = require('connect-slashes');

  // Local modules
  const DustEngine = require(Path.join(__basedir, 'source/modules/dust_engine.js'));
  const DynamicImages = require(Path.join(__basedir, 'source/modules/dynamic_images.js'));
  const HtmlHelpers = require(Path.join(__basedir, 'source/modules/helpers/html_helpers.js'));
  const I18n = require(Path.join(__basedir, 'source/modules/i18n.js'));
  const ThemeHelpers = require(Path.join(__basedir, 'source/modules/helpers/theme_helpers.js'));
  const UtilityHelpers = require(Path.join(__basedir, 'source/modules/helpers/utility_helpers.js'));

  // Express app
  const AdminRouter = require(Path.join(__basedir, 'source/routers/admin_router.js'));
  const ApiRouter = require(Path.join(__basedir, 'source/routers/api_router.js'));
  const ThemeRouter = require(Path.join(__basedir, 'source/routers/theme_router.js'));
  const AuthMiddleware = require(Path.join(__basedir, 'source/middleware/auth_middleware'));
  const ViewMiddleware = require(Path.join(__basedir, 'source/middleware/view_middleware.js'));
  const ErrorController = require(Path.join(__basedir, 'source/controllers/error_controller.js'));

  // Database
  const Database = require(Path.join(__basedir, 'source/modules/database.js'))(options);
  app.locals.Database = Database;

  // Themes stored on app.locals so we can access the configured directory
  const Themes = require(Path.join(__basedir, 'source/modules/themes.js'))(options);
  app.locals.Themes = Themes;

  // Stash upload path on app.locals so we can access the configured directory
  app.locals.uploadPath = options.uploadPath || Path.join(__basedir, 'uploads');

  return Promise.resolve()
    // Initialize the database
    .then(() => Database.init())
    .then(() => {
      let models = Database.sequelize.models;

      // Generate search indexes on startup
      return Promise.all([
        models.post.buildSearchIndex(),
        models.user.buildSearchIndex(),
        models.tag.buildSearchIndex()
      ]);
    })
    // Load settings into app.locals.Settings
    .then(() => Database.loadSettings())
    .then((settings) => app.locals.Settings = settings)
    // Load navigation into app.locals.Navigation
    .then(() => Database.sequelize.models.navigation.getArray())
    .then((navigation) => app.locals.Navigation = navigation)
    // Load i18n into app.locals.I18n
    .then(() => {
      app.locals.I18n = I18n;
      return app.locals.I18n.load(app.locals.Settings.language);
    })
    // Start the app
    .then(() => {
      // App config
      app.enable('strict routing');
      app.disable('x-powered-by');

      // App-level middleware
      app
        .use(Slashes(false))
        .use(CookieParser())
        .use(Compression())
        .use(DynamicImages.processImages)
        .use('/assets', Express.static(Path.join(__basedir, 'assets')))
        .use('/themes', Express.static(Themes.themePath))
        .use('/uploads', Express.static(app.locals.uploadPath))
        .use(BodyParser.urlencoded({ extended: true, limit: '10mb' }))
        .use(AuthMiddleware.attachUser)
        .use(ViewMiddleware.attachViewData);

      // View engine
      app.engine('dust', DustEngine.engine(app, {
        cache: process.env.NODE_ENV === 'production',
        helpers: [DustHelpers, HtmlHelpers, UtilityHelpers, ThemeHelpers]
      }));
      app.set('json spaces', process.env.NODE_ENV === 'production' ? undefined : 2);
      app.set('views', [
        Path.join(Themes.themePath, app.locals.Settings.theme, 'templates'),
        Path.join(__basedir, 'source/views')
      ]);
      app.set('view engine', 'dust');

      // App routers
      ApiRouter(app);
      AdminRouter(app);
      ThemeRouter(app);

      // Error pages
      app.use(ErrorController.notFound);
      app.use(ErrorController.applicationError);
    })
    .catch((err) => {
      console.error(
        Chalk.red('Error: ') + 'Postleaf failed to initialize! 🐛\n\n' +
        Chalk.red(err.stack)
      );
    });
};


;;; cider-browse-ns-tests.el

;; Copyright © 2012-2016 Tim King, Bozhidar Batsov

;; Author: Tim King <kingtim@gmail.com>
;;         Bozhidar Batsov <bozhidar@batsov.com>
;;         Artur Malabarba <bruce.connor.am@gmail.com>

;; This file is NOT part of GNU Emacs.

;; 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 3 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, see `http://www.gnu.org/licenses/'.

;;; Commentary:

;; This file is part of CIDER

;;; Code:

(require 'buttercup)
(require 'cider-browse-ns)

(describe "cider-browse-ns--text-face"
  (it "identifies a function"
    (expect (cider-browse-ns--text-face '(dict "arglists" "fn arg list"))
            :to-equal 'font-lock-function-name-face))

  (it "identifies a macro"
    (expect (cider-browse-ns--text-face '(dict "arglists" "fn arg list" "macro" "true"))
            :to-equal 'font-lock-keyword-face))

  (it "identifies a variable"
    (expect (cider-browse-ns--text-face '(dict))
            :to-equal 'font-lock-variable-name-face)))

(describe "cider-browse-ns"
  :var (cider-browse-ns-buffer)
  (it "lists out all forms of a namespace with correct font-locks"
    (spy-on 'cider-sync-request:ns-vars-with-meta :and-return-value
            '(dict "blank?"
                   (dict "arglists" "fn arg list"
                         "doc" "\"True if s is nil, empty, or contains only whitespace.\"")))

    (with-temp-buffer
      (setq cider-browse-ns-buffer (buffer-name (current-buffer)))
      (cider-browse-ns "clojure.string")
      (search-forward "clojure")
      (expect (get-text-property (point) 'face) :to-equal 'font-lock-type-face)
      (search-forward "blank")
      (expect (get-text-property (point) 'font-lock-face) :to-equal 'font-lock-function-name-face)
      (search-forward "True")
      (expect (get-text-property (point) 'font-lock-face) :to-equal 'font-lock-doc-face))))

(describe "cider-browse-ns--first-doc-line"
  (it "returns Not documented if the doc string is missing"
    (expect (cider-browse-ns--first-doc-line nil)
            :to-equal "Not documented."))

  (it "returns the first line of the doc string"
    (expect (cider-browse-ns--first-doc-line "True if s is nil, empty, or contains only whitespace.")
            :to-equal "True if s is nil, empty, or contains only whitespace."))

  (it "returns the first sentence of the doc string if the first line contains multiple sentences"
    (expect (cider-browse-ns--first-doc-line "First sentence. Second sentence.")
            :to-equal "First sentence. "))

  (it "returns the first line of the doc string if the first sentence spans multiple lines"
    (expect (cider-browse-ns--first-doc-line "True if s is nil, empty, or\n contains only whitespace.")
            :to-equal "True if s is nil, empty, or...")))


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.beam.sdk.extensions.sql.impl.rel;

import java.util.HashMap;
import java.util.Map;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv;
import org.apache.beam.sdk.extensions.sql.meta.BeamSqlTable;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.Row;

/** Base class for rel test. */
public abstract class BaseRelTest {
  private static Map<String, BeamSqlTable> tables = new HashMap<>();
  protected static BeamSqlEnv env = BeamSqlEnv.readOnly("test", tables);

  protected static PCollection<Row> compilePipeline(String sql, Pipeline pipeline) {
    return BeamSqlRelUtils.toPCollection(pipeline, env.parseQuery(sql));
  }

  protected static void registerTable(String tableName, BeamSqlTable table) {
    tables.put(tableName, table);
  }

  protected static BeamSqlTable getTable(String tableName) {
    return tables.get(tableName);
  }
}


[kvmremote]
# Specify a comma-separated list of available machines to be used. For each
# specified ID you have to define a dedicated section containing the details
# on the respective machine. (E.g. machine1, machine2, machine3)
machines = machine1

# Specify a comma-separated list of KVM hypervisors to be used. For each
# specified ID you have to define a dedicated section containing the details
hypervisors = hypervisor1

[hypervisor1]
# Specify connection string for hypervisor
dsn = qemu:///system
# Specify interface used to sniff traffic with KVM
interface = br0

# Specify if memory dump mode is enabled, hypervisor is remote
# (remote memory dump capability)
# should use a ssh shared key and root user (as actions will be performed by root)
# remote_host = root@192.168.122.1

[machine1]
# Specify the label name of the current machine as specified in your
# physical machine configuration.
label = machine1

# Specify the IP address of the current machine. Make sure that the IP address
# is valid and that the host machine is able to reach it. If not, the analysis
# will fail.
ip = 127.0.0.1

# Specify the operating system platform used by current machine
# [windows/darwin/linux].
platform = windows

# Specify hypervisor name for machine
hypervisor = rex