Sha256: 4c75a8190538155cbdf8b1664356accc258e3dfe6ec293980912ef4dbc15b76e

Contents?: true

Size: 944 Bytes

Versions: 3

Compression:

Stored size: 944 Bytes

Contents

// TODO: This is silly, autoconf...
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION

#include "../config.hpp"

// TODO: This is silly, autoconf...
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION

#if !defined(HAVE_NODE_H) && !defined(REALLY_HAVE_RUBY_NODE_H)

#include "mininode.hpp"
#include <cstring>

extern "C"
char const * ruby_node_name(int node);

namespace
{

int node_value(char const * name)
{
  /* TODO: any way to end the block? */
  int j;
  for(j = 0; ; ++j)
  {
    if(!std::strcmp(name, ruby_node_name(j)))
    {
      return j;
    }
  }
}

} // namespace

#ruby <<END
require 'node_names'
NODE_NAMES.each do |name|
  puts <<-END
static int NODE_#{name}_ = -1;

int Rice::detail::Mininode::get_NODE_#{name}()
{
  if(NODE_#{name}_ == -1)
  {
    NODE_#{name}_ = node_value("NODE_#{name}");
  }

  return NODE_#{name}_;
}
  END
end
nil
END

#endif

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
jameskilton-rice-1.2.0 rice/detail/mininode.cpp.rpp
rice-1.2.0 rice/detail/mininode.cpp.rpp
rice-1.1.0 rice/detail/mininode.cpp.rpp