From 9db80409b3ca048c4b404a43d2c224f374c0090a Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Wed, 19 Jul 2017 16:40:15 +0200 Subject: DOM with Lua DataModel and dropped V8 --- CMakeLists.txt | 9 +- README.md | 11 +- TODO.txt | 1 - src/uscxml/interpreter/BasicContentExecutor.cpp | 230 +- src/uscxml/interpreter/ContentExecutorImpl.h | 1 + src/uscxml/interpreter/FastMicroStep.cpp | 95 +- src/uscxml/interpreter/InterpreterImpl.h | 4 + src/uscxml/plugins/DataModel.cpp | 4 + src/uscxml/plugins/DataModel.h | 2 + src/uscxml/plugins/DataModelImpl.h | 14 +- src/uscxml/plugins/datamodel/CMakeLists.txt | 11 +- .../ecmascript/JavaScriptCore/JSCDataModel.cpp | 4 + .../ecmascript/JavaScriptCore/JSCDataModel.h | 1 + .../plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc | 575 ++- .../datamodel/ecmascript/v8/V8Event.cpp.inc | 33 +- .../plugins/datamodel/ecmascript/v8/bindings.i | 1 + src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc | 794 ++-- src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 117 +- src/uscxml/plugins/datamodel/lua/LuaDataModel.h | 1 + src/uscxml/plugins/datamodel/lua/LuaEvent.cpp.inc | 4154 ++++++++++++++++++++ src/uscxml/plugins/datamodel/lua/bindings.i | 10 + .../plugins/datamodel/promela/PromelaDataModel.cpp | 9 +- 22 files changed, 5175 insertions(+), 906 deletions(-) create mode 100644 src/uscxml/plugins/datamodel/lua/LuaEvent.cpp.inc diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c2e3dd..fd92ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -410,9 +410,12 @@ OPTION(WITH_DM_ECMA_V8 "Do search for the V8 ECMAScript implementation" ON) if (WITH_DM_ECMA_V8) find_package(V8) if (V8_FOUND) - set(ECMA_FOUND ON) - include_directories(${V8_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) + # set(ECMA_FOUND ON) + # include_directories(${V8_INCLUDE_DIR}) + # list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) + + message(WARNING "We no longer support the V8 ECMAScript engine - contributions are welcome") + set(V8_FOUND OFF) else() set(WITH_DM_ECMA_V8 OFF) endif() diff --git a/README.md b/README.md index c1f7ea7..b5e5736 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ #### Quick Links - [Building from source](http://tklab-tud.github.io/uscxml/building.html) -- [Changes](docs/CHANGES.md) - [Tests passed](test/w3c/TESTS.md) - [Publications](docs/PUBLICATIONS.md) - [Benchmarks](docs/BENCHMARKS.md) @@ -50,6 +49,12 @@ For more detailled information, refer to the [documentation](http://tklab-tud.gi ### Embedded as a Library uscxml::Interpreter scxml = uscxml::Interpreter::fromURL("..."); + scxml.on().enterState([](const std::string& sessionId, + const std::string& stateName, + const xercesc_3_1::DOMElement* state) { + std::cout << "Entered " << stateName << std::endl; + }); + while(scxml.step() != uscxml::USCXML_FINISHED) { ... } @@ -79,6 +84,10 @@ For more detailled information, refer to the [documentation](http://tklab-tud.gi ## Changes + * **[]():** + + We dropped support for Google's V8 ECMAScript engine. The API is changing too fast and there is no reliable way to get / build / identify older versions. The latest branch will not work with the wrappers generated from even SWIG 4.0 and I have no time to keep up with them. Use JavaScriptCore, its API is unchanged since we started to support it in 2012. If you feel capable to maintain the [](V8DataModel.cpp) send a push request. Everything will be left in place but we will ignore `libv8` at configure time. I may have another look when a number of Linux distribution settled on a more recent version, most are still shipping v8 in version 3.14. + * **[bfefa5fd44b9ed1491612f26b099db8ad624247b](https://github.com/tklab-tud/uscxml/pull/155/commits/bfefa5fd44b9ed1491612f26b099db8ad624247b):** We **broke the InterpreterMonitor** API by substituting the Interpreter instance in the first formal parameter by its sessionId throughout all callbacks. Retrieving the actual Interpreter involved locking a weak_ptr into a shared_ptr which proved to be a performance bottleneck. You can retrieve the Interpreter from its sessionId via the new static method `Interpreter::fromSessionId` if you actually need. diff --git a/TODO.txt b/TODO.txt index f5b6d1b..901189d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,2 +1 @@ Arraybuffers -PGO \ No newline at end of file diff --git a/src/uscxml/interpreter/BasicContentExecutor.cpp b/src/uscxml/interpreter/BasicContentExecutor.cpp index 5344957..9ea2b6a 100644 --- a/src/uscxml/interpreter/BasicContentExecutor.cpp +++ b/src/uscxml/interpreter/BasicContentExecutor.cpp @@ -593,155 +593,89 @@ void BasicContentExecutor::processParams(std::multimap& param paramMap.insert(make_pair(name, d)); } } - + Data BasicContentExecutor::elementAsData(XERCESC_NS::DOMElement* element, bool asExpression) { - if (HAS_ATTR(element, kXMLCharExpr)) { -// return _callbacks->evalAsData(ATTR(element, "expr")); -#if 0 - if (LOCALNAME(element) == "content") { - // test 528 - return _callbacks->evalAsData(ATTR(element, kXMLCharExpr)); - } else { - // test 326 - return Data(ATTR(element, kXMLCharExpr), Data::INTERPRETED); - } -#endif - if (asExpression) // test 453 - return Data(ATTR(element, kXMLCharExpr), Data::INTERPRETED); - return _callbacks->evalAsData(ATTR(element, kXMLCharExpr)); - } - - if (HAS_ATTR(element, kXMLCharSource)) { - // remote content from URL - - // test 446, test 552, test 558 - std::string src = ATTR(element, kXMLCharSource); - URL url(ATTR(element, kXMLCharSource)); - if (!url.isAbsolute()) { - url = URL::resolve(url, _callbacks->getBaseURL()); - } - - std::string content = url.getInContent(); - - // make an attempt to parse as XML - try { -#if 0 - XERCESC_NS::XercesDOMParser parser; - parser.setValidationScheme(XERCESC_NS::XercesDOMParser::Val_Never); - parser.setDoNamespaces(true); - parser.useScanner(XERCESC_NS::XMLUni::fgWFXMLScanner); - - XERCESC_NS::HandlerBase errHandler; - parser.setErrorHandler(&errHandler); - - std::string tmp = url; - XERCESC_NS::MemBufInputSource is((XMLByte*)content.c_str(), content.size(), X("fake")); - - parser.parse(is); - - Data d; - XERCESC_NS::DOMDocument* doc = parser.adoptDocument(); - d.adoptedDoc = std::shared_ptr(doc); - d.node = doc->getDocumentElement(); - return d; -#else - std::unique_ptr parser(new XERCESC_NS::XercesDOMParser()); - parser->setValidationScheme(XERCESC_NS::XercesDOMParser::Val_Always); - parser->setDoNamespaces(true); - parser->useScanner(XERCESC_NS::XMLUni::fgWFXMLScanner); - - std::unique_ptr errHandler(new XERCESC_NS::HandlerBase()); - parser->setErrorHandler(errHandler.get()); - - try { - std::string tmp = url; - parser->parse(tmp.c_str()); - - XERCESC_NS::DOMNode* newNode = element->getOwnerDocument()->importNode(parser->getDocument()->getDocumentElement(), true); - - // remove any old child elements - while(element->getFirstElementChild() != NULL) { - element->removeChild(element->getFirstElementChild()); - } - // we need to save the DOM somewhere .. Data::adoptedDoc was not good enough - element->appendChild(newNode); - - Data d; -// d.adoptedDoc = std::shared_ptr(parser->adoptDocument()); - d.node = newNode; - return d; - } - - catch (const XERCESC_NS::SAXParseException& toCatch) { - ERROR_PLATFORM_THROW(X(toCatch.getMessage()).str()); - } catch (const XERCESC_NS::RuntimeException& toCatch) { - ERROR_PLATFORM_THROW(X(toCatch.getMessage()).str()); - } catch (const XERCESC_NS::XMLException& toCatch) { - ERROR_PLATFORM_THROW(X(toCatch.getMessage()).str()); - } catch (const XERCESC_NS::DOMException& toCatch) { - ERROR_PLATFORM_THROW(X(toCatch.getMessage()).str()); - } - -#endif - - } catch (...) { - // just ignore and return as an interpreted string below - } - try { - Data d = _callbacks->getAsData(content); - if (!d.empty()) - return d; - } catch(...) {} - - return Data(spaceNormalize(content), Data::VERBATIM); - - } else { - // local content in document - - std::list elementChildren = DOMUtils::filterChildType(DOMNode::ELEMENT_NODE, element); - if (elementChildren.size() > 0) { - // always return parent element, even with a single child node - return Data(static_cast(element)); - } - - std::list textChildren = DOMUtils::filterChildType(DOMNode::TEXT_NODE, element); - if (textChildren.size() > 0) { - std::stringstream contentSS; - for (auto textIter = textChildren.begin(); textIter != textChildren.end(); textIter++) { - contentSS << X((*textIter)->getNodeValue()); - } - - // this must be handled in getAsData - // test294, test562 - if (LOCALNAME(element) == "content") { - // need first try getAsData because how to pass 179 ? - try { - // test153, we need to throw for test150 in promela - Data d = _callbacks->getAsData(contentSS.str()); - if (!d.empty()) - return d; - } catch (ErrorEvent &) { - return Data(spaceNormalize(contentSS.str()), Data::VERBATIM); - } - } - - if (asExpression) // not actually used, but likely expected - return Data(contentSS.str(), Data::INTERPRETED); - - // test153, we need to throw for test150 in promela, but we need to space normalize for test558 - try { - Data d = _callbacks->getAsData(contentSS.str()); - if (!d.empty()) - return d; - } catch ( ... ) {} - - // test558 - return Data(spaceNormalize(contentSS.str()), Data::VERBATIM); - } - } - -// LOG(USCXML_WARN) << "Element " << DOMUtils::xPathForNode(element) << " did not yield any data"; - return Data(); + // element with expr + if (HAS_ATTR(element, kXMLCharExpr)) { + std::string expr = ATTR(element, kXMLCharExpr); + if (_callbacks->isLegalDataValue(expr)) { + return Data(expr, Data::INTERPRETED); + } else { + ERROR_EXECUTION_THROW2("Expression '" + expr + "' is not a legal data value", element); + } + } + + // element with external src - this ought to behave just as with child nodes below + if (HAS_ATTR(element, kXMLCharSource)) { + + // remove any old child elements + while(element->getFirstElementChild() != NULL) { + element->removeChild(element->getFirstElementChild()); + } + + std::string src = ATTR(element, kXMLCharSource); + URL url(ATTR(element, kXMLCharSource)); + if (!url.isAbsolute()) { + url = URL::resolve(url, _callbacks->getBaseURL()); + } + std::string content = url.getInContent(); + + // append as XML? + try { + std::unique_ptr parser(new XERCESC_NS::XercesDOMParser()); + parser->setValidationScheme(XERCESC_NS::XercesDOMParser::Val_Always); + parser->setDoNamespaces(true); + parser->useScanner(XERCESC_NS::XMLUni::fgWFXMLScanner); + + std::unique_ptr errHandler(new XERCESC_NS::HandlerBase()); + parser->setErrorHandler(errHandler.get()); + + XERCESC_NS::MemBufInputSource is((XMLByte*)content.c_str(), content.size(), X("fake")); + is.setPublicId(X(url)); + + parser->parse(is); + XERCESC_NS::DOMNode* newNode = element->getOwnerDocument()->importNode(parser->getDocument()->getDocumentElement(), true); + + // we need to save the DOM somewhere .. Data::adoptedDoc was not good enough + element->appendChild(newNode); + goto SOURCE_APPEND_DONE; + } catch (...) { + } + + // append as text (are we leaking?) + XERCESC_NS::DOMText* textNode = element->getOwnerDocument()->createTextNode(X(content)); + element->appendChild(textNode); + } +SOURCE_APPEND_DONE: + + if (element->hasChildNodes()) { + // XML elements e.g. for content with invoke + std::list elementChildren = DOMUtils::filterChildType(DOMNode::ELEMENT_NODE, element); + if (elementChildren.size() > 0) { + // always return parent element, even with a single child node + return Data(static_cast(element)); + } + + // expression in text element + std::list textChildren = DOMUtils::filterChildType(DOMNode::TEXT_NODE, element); + if (textChildren.size() > 0) { + std::stringstream contentSS; + for (auto textIter = textChildren.begin(); textIter != textChildren.end(); textIter++) { + contentSS << X((*textIter)->getNodeValue()); + } + + try { + Data d = _callbacks->getAsData(contentSS.str()); + if (!d.empty()) + return d; + } catch(...) {} + + // anything else is considered verbatim - space normalize? + return Data(spaceNormalize(contentSS.str()), Data::VERBATIM); + } + } + + return Data(); } } diff --git a/src/uscxml/interpreter/ContentExecutorImpl.h b/src/uscxml/interpreter/ContentExecutorImpl.h index c85d9a0..0c080ca 100644 --- a/src/uscxml/interpreter/ContentExecutorImpl.h +++ b/src/uscxml/interpreter/ContentExecutorImpl.h @@ -62,6 +62,7 @@ public: virtual Data evalAsData(const std::string& expr) = 0; virtual void eval(const std::string& expr) = 0; virtual Data getAsData(const std::string& expr) = 0; + virtual bool isLegalDataValue(const std::string& expr) = 0; virtual void assign(const std::string& location, const Data& data, const std::map& attrs) = 0; diff --git a/src/uscxml/interpreter/FastMicroStep.cpp b/src/uscxml/interpreter/FastMicroStep.cpp index ab6b5f9..1258279 100644 --- a/src/uscxml/interpreter/FastMicroStep.cpp +++ b/src/uscxml/interpreter/FastMicroStep.cpp @@ -509,6 +509,9 @@ COMPLETION_STABLISHED: _transitions.resize(tmp.size()); _exitSets.resize(tmp.size()); +// std::list transSpontaneous; +// std::list transEventful; + for (i = 0; i < _transitions.size(); i++) { _transitions[i] = new Transition(i); _transitions[i]->element = tmp.front(); @@ -579,7 +582,10 @@ TARGET_SET_ESTABLISHED: if (!HAS_ATTR(_transitions[i]->element, kXMLCharEvent)) { _transitions[i]->type |= USCXML_TRANS_SPONTANEOUS; - } +// transSpontaneous.push_back(_transitions[i]); + } else { +// transEventful.push_back(_transitions[i]); + } if (iequals(TAGNAME_CAST(_transitions[i]->element->getParentNode()), _xmlPrefix.str() + "history")) { _transitions[i]->type |= USCXML_TRANS_HISTORY; @@ -606,14 +612,88 @@ TARGET_SET_ESTABLISHED: { _exitSets[i] = getExitSet(_transitions[i]); } - } /** * This bound by cache locality! * Before you change anything, do benchmark! */ - + +#if 0 +#define exit1 _exitSets[t1->postFixOrder] +#define exit2 _exitSets[t2->postFixOrder] + + for (size_t set = 0; set < 2; set++) { + std::list::const_iterator transBegin; + std::list::const_iterator transEnd; + if (set == 0) { + transBegin = transEventful.begin(); + transEnd = transEventful.end(); + } else { + transBegin = transSpontaneous.begin(); + transEnd = transSpontaneous.end(); + } + + for (auto t1Iter = transBegin; t1Iter != transEnd; t1Iter++) { + Transition* t1 = *t1Iter; + auto anc1 = _states[t1->source]->ancestors; + const uint32_t source1 = t1->source; + + for (auto t2Iter = t1Iter; t2Iter != transEnd; t2Iter++) { + Transition* t2 = *t2Iter; + + if (exit1.first == 0 && exit2.first == 0) { + goto COMPATIBLE_TRANS; + } + + if (exit1.first <= exit2.first && exit1.second >= exit2.first) { + goto CONFLICTING_TRANS; + } + + if (exit2.first <= exit1.first && exit2.second >= exit1.first) { + goto CONFLICTING_TRANS; + } + + COMPATIBLE_TRANS: + if (t2->source == source1) { + goto CONFLICTING_TRANS; + } + + if (anc1[t2->source]) { + goto CONFLICTING_TRANS; + } + + if (_states[t2->source]->ancestors[source1]) { + goto CONFLICTING_TRANS; + } + + t1->conflicts[t2->postFixOrder] = false; + // _transitions[j]->conflicts[i] = false; + continue; + + CONFLICTING_TRANS: + t1->conflicts[t2->postFixOrder] = true; + // _transitions[j]->conflicts[i] = true; + + continue; + + } + } + + for (auto t1Iter = transBegin; t1Iter != transEnd; t1Iter++) { + Transition* t1 = *t1Iter; + // conflicts matrix is symmetric + for (auto t2Iter = transBegin; t2Iter != t1Iter; t2Iter++) { + Transition* t2 = *t2Iter; + + t1->conflicts[t2->postFixOrder] = t2->conflicts[t1->postFixOrder]; + } + } + + } + + +#else #define anc1 _states[_transitions[i]->source]->ancestors #define exit1 _exitSets[i] #define exit2 _exitSets[j] @@ -659,12 +739,6 @@ CONFLICTING_TRANS: continue; } -#if 0 // moved down for cache locality - // conflicts matrix is symmetric - for (j = 0; j < i; j++) { - _transitions[i]->conflicts[j] = _transitions[j]->conflicts[i]; - } -#endif } for (i = 0; i < _transitions.size(); i++) { @@ -673,7 +747,8 @@ CONFLICTING_TRANS: _transitions[i]->conflicts[j] = _transitions[j]->conflicts[i]; } } - +#endif + // initialize bitarrays for step() _exitSet = boost::dynamic_bitset(_states.size(), false); _entrySet = boost::dynamic_bitset(_states.size(), false); diff --git a/src/uscxml/interpreter/InterpreterImpl.h b/src/uscxml/interpreter/InterpreterImpl.h index 2f5fb07..1f87fd2 100644 --- a/src/uscxml/interpreter/InterpreterImpl.h +++ b/src/uscxml/interpreter/InterpreterImpl.h @@ -196,6 +196,10 @@ public: return _dataModel.getAsData(expr); } + virtual bool isLegalDataValue(const std::string& expr) { + return _dataModel.isLegalDataValue(expr); + } + virtual void assign(const std::string& location, const Data& data, const std::map& attrs); virtual std::string getInvokeId() { diff --git a/src/uscxml/plugins/DataModel.cpp b/src/uscxml/plugins/DataModel.cpp index cf4dda2..19a01c9 100644 --- a/src/uscxml/plugins/DataModel.cpp +++ b/src/uscxml/plugins/DataModel.cpp @@ -30,6 +30,10 @@ bool DataModel::isValidSyntax(const std::string& expr) { return _impl->isValidSyntax(expr); } +bool DataModel::isLegalDataValue(const std::string& expr) { + return _impl->isLegalDataValue(expr); +} + void DataModel::setEvent(const Event& event) { return _impl->setEvent(event); } diff --git a/src/uscxml/plugins/DataModel.h b/src/uscxml/plugins/DataModel.h index 484f1cc..6812553 100644 --- a/src/uscxml/plugins/DataModel.h +++ b/src/uscxml/plugins/DataModel.h @@ -46,6 +46,8 @@ public: virtual std::list getNames(); /// @copydoc DataModelImpl::isValidSyntax() virtual bool isValidSyntax(const std::string& expr); + /// @copydoc DataModelImpl::isLegalDataValue() + virtual bool isLegalDataValue(const std::string& expr); /// @copydoc DataModelImpl::setEvent() virtual void setEvent(const Event& event); diff --git a/src/uscxml/plugins/DataModelImpl.h b/src/uscxml/plugins/DataModelImpl.h index e3db75a..b378a96 100644 --- a/src/uscxml/plugins/DataModelImpl.h +++ b/src/uscxml/plugins/DataModelImpl.h @@ -116,7 +116,8 @@ public: /** * Determine whether a given string constitutes valid syntax in the - * data-model's language. + * data-model's language. This is only used to identify InterpreterIssues + * but may be useful to implement isLegalDataValue() as well. * @param expr A string, supposedly containing an expression of the data-model. * @return Whether expr is in L(DM). */ @@ -124,6 +125,17 @@ public: return true; // overwrite when datamodel supports it } + /** + * Determine whether a given string constitutes a legal data value that can appear + * at the right-hand side of an assignment. + * + * @param expr A string, supposedly containing a legal data value. + * @return Whether expr is a legal data value. + */ + virtual bool isLegalDataValue(const std::string& expr) { + return true; // overwrite when datamodel supports it + } + /** * Set the given event as `_event` in the data-model's global scope. * @param event The event as it was dequeued from either the internal or external queue. diff --git a/src/uscxml/plugins/datamodel/CMakeLists.txt b/src/uscxml/plugins/datamodel/CMakeLists.txt index a03e7c8..05feb11 100644 --- a/src/uscxml/plugins/datamodel/CMakeLists.txt +++ b/src/uscxml/plugins/datamodel/CMakeLists.txt @@ -176,6 +176,7 @@ else() COMMENT "Creating the DOM for JavaScriptCore (no XERCESC) ...") # list (APPEND JSC_DATAMODEL ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/JavaScriptCore/JSCDOM.cpp.inc) + set_target_properties(jsc-bindings-noxercesc PROPERTIES FOLDER "Bindings") set_target_properties(jsc-bindings PROPERTIES FOLDER "Bindings") endif() @@ -208,11 +209,12 @@ else() COMMENT "Creating the DOM for V8 (no XERCESC) ...") # list (APPEND V8_DATAMODEL ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/v8/V8DOM.cpp.inc) + set_target_properties(v8-bindings-noxercesc PROPERTIES FOLDER "Bindings") set_target_properties(v8-bindings PROPERTIES FOLDER "Bindings") endif() - if (LUA51_FOUND) + if (LUA_FOUND) add_custom_target(lua-bindings COMMAND ${SWIG_EXECUTABLE} -I${XercesC_INCLUDE_DIRS} @@ -233,13 +235,14 @@ else() -lua -DNO_XERCESC -c++ - -o ${CMAKE_CURRENT_SOURCE_DIR}/lua/LuaDOM.cpp.inc + -o ${CMAKE_CURRENT_SOURCE_DIR}/lua/LuaEvent.cpp.inc lua/bindings.i WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Creating the DOM for Lua ...") + COMMENT "Creating the DOM for Lua (no XERCESC) ...") # list (APPEND V8_DATAMODEL ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/v8/V8DOM.cpp.inc) - set_target_properties(lua-bindings PROPERTIES FOLDER "Bindings") + set_target_properties(lua-bindings-noxercesc PROPERTIES FOLDER "Bindings") + set_target_properties(lua-bindings PROPERTIES FOLDER "Bindings") endif() endif() diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index 921f4cf..3932961 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -668,6 +668,10 @@ bool JSCDataModel::isValidSyntax(const std::string& expr) { return true; } +bool JSCDataModel::isLegalDataValue(const std::string& expr) { + return isValidSyntax("var __tmp = " + expr); +} + bool JSCDataModel::isDeclared(const std::string& expr) { JSStringRef scriptJS = JSStringCreateWithUTF8CString(expr.c_str()); JSValueRef exception = NULL; diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h index 977385c..38b0ca5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h @@ -64,6 +64,7 @@ public: return names; } + virtual bool isLegalDataValue(const std::string& expr); virtual bool isValidSyntax(const std::string& expr); virtual void setEvent(const Event& event); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc index a0d8ae6..48e4898 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.8 + * Version 4.0.0 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -98,9 +98,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -669,16 +671,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) { char d = *(c++); unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); + uu = (unsigned char)((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); + uu |= (unsigned char)(d - ('a'-10)); else return (char *) 0; *u = uu; @@ -771,13 +773,13 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #define SWIGV8_SETWEAK_VERSION 0x032224 -#if (SWIG_V8_VERSION < 0x031803) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031803) #define SWIGV8_STRING_NEW2(cstr, len) v8::String::New(cstr, len) #else #define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::String::kNormalString, len) #endif -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) typedef v8::Handle SwigV8ReturnValue; typedef v8::Arguments SwigV8Arguments; typedef v8::AccessorInfo SwigV8PropertyCallbackInfo; @@ -791,11 +793,11 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return #endif -#if (SWIG_V8_VERSION < 0x032117) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032117) #define SWIGV8_HANDLESCOPE() v8::HandleScope scope #define SWIGV8_HANDLESCOPE_ESC() v8::HandleScope scope #define SWIGV8_ESCAPE(val) return scope.Close(val) -#elif (SWIG_V8_VERSION < 0x032224) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032224) #define SWIGV8_HANDLESCOPE() v8::HandleScope scope(v8::Isolate::GetCurrent()); #define SWIGV8_HANDLESCOPE_ESC() v8::HandleScope scope(v8::Isolate::GetCurrent()); #define SWIGV8_ESCAPE(val) return scope.Close(val) @@ -805,7 +807,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_ESCAPE(val) return scope.Escape(val) #endif -#if (SWIG_V8_VERSION < 0x032224) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032224) #define SWIGV8_ADJUST_MEMORY(size) v8::V8::AdjustAmountOfExternalAllocatedMemory(size) #define SWIGV8_CURRENT_CONTEXT() v8::Context::GetCurrent() #define SWIGV8_THROW_EXCEPTION(err) v8::ThrowException(err) @@ -819,7 +821,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym) #endif -#if (SWIG_V8_VERSION < 0x032318) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032318) #define SWIGV8_ARRAY_NEW() v8::Array::New() #define SWIGV8_BOOLEAN_NEW(bool) v8::Boolean::New(bool) #define SWIGV8_EXTERNAL_NEW(val) v8::External::New(val) @@ -847,9 +849,9 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; #define SWIGV8_NULL() v8::Null(v8::Isolate::GetCurrent()) #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) #define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ = v8::Persistent::New(class); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) #define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ = v8::Persistent::New(v8::Isolate::GetCurrent(), class); #else #define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); @@ -861,7 +863,7 @@ typedef v8::PropertyCallbackInfo SwigV8PropertyCallbackInfo; * ---------------------------------------------------------------------------*/ #define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg) -#define SWIG_exception(code, msg) SWIGV8_ErrorHandler.error(code, msg) +#define SWIG_exception(code, msg) do { SWIGV8_ErrorHandler.error(code, msg); SWIG_fail; } while (0) #define SWIG_fail goto fail #define SWIGV8_OVERLOAD false @@ -920,13 +922,13 @@ public: }; ~SWIGV8_Proxy() { -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) handle.ClearWeak(); handle.Dispose(); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) handle.ClearWeak(v8::Isolate::GetCurrent()); handle.Dispose(v8::Isolate::GetCurrent()); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) handle.ClearWeak(); handle.Dispose(); #else @@ -934,7 +936,7 @@ public: handle.Reset(); #endif -#if (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) handle.Clear(); #endif @@ -951,11 +953,11 @@ class SWIGV8_ClientData { public: v8::Persistent class_templ; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) void (*dtor) (v8::Persistent< v8::Value> object, void *parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Value> object, void *parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy); #else void (*dtor) (const v8::WeakCallbackData &data); @@ -969,7 +971,7 @@ SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle objRef, void * if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; -#if (SWIG_V8_VERSION < 0x031511) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) v8::Handle cdataRef = objRef->GetInternalField(0); SWIGV8_Proxy *cdata = static_cast(v8::External::Unwrap(cdataRef)); #else @@ -997,13 +999,13 @@ SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle objRef, void * } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Persistent< v8::Value > object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Value > object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy) { #else SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackData &data) { @@ -1021,7 +1023,7 @@ SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Handle valRef, void **ptr) if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; -#if (SWIG_V8_VERSION < 0x031511) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) v8::Handle cdataRef = objRef->GetInternalField(0); SWIGV8_Proxy *cdata = static_cast(v8::External::Unwrap(cdataRef)); #else @@ -1043,34 +1045,34 @@ SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle obj, void *ptr, sw cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; cdata->info = info; -#if (SWIG_V8_VERSION < 0x031511) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) obj->SetPointerInInternalField(0, cdata); #else obj->SetAlignedPointerInInternalField(0, cdata); #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) cdata->handle = v8::Persistent::New(obj); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) cdata->handle = v8::Persistent::New(v8::Isolate::GetCurrent(), obj); #else cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) // clientdata must be set for owned data as we need to register the dtor if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { cdata->handle.MakeWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); } else { cdata->handle.MakeWeak(cdata, SWIGV8_Proxy_DefaultDtor); } -#elif (SWIG_V8_VERSION < 0x031918) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031918) if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); } else { cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, SWIGV8_Proxy_DefaultDtor); } -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { cdata->handle.MakeWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); } else { @@ -1084,9 +1086,9 @@ SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle obj, void *ptr, sw } #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) cdata->handle.MarkIndependent(); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) cdata->handle.MarkIndependent(v8::Isolate::GetCurrent()); #else cdata->handle.MarkIndependent(); @@ -1115,15 +1117,15 @@ SWIGRUNTIME v8::Handle SWIG_V8_NewPointerObj(void *ptr, swig_type_inf v8::Handle class_templ; if (ptr == NULL) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) SWIGV8_ESCAPE(SWIGV8_NULL()); #else v8::Local result = SWIGV8_NULL(); SWIGV8_ESCAPE(result); -#endif +#endif } -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) if(info->clientdata != 0) { class_templ = ((SWIGV8_ClientData*) info->clientdata)->class_templ; } else { @@ -1247,7 +1249,7 @@ swig_type_info *SwigV8Packed_UnpackData(v8::Handle valRef, void *ptr, v8::Handle objRef = valRef->ToObject(); -#if (SWIG_V8_VERSION < 0x031511) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) v8::Handle cdataRef = objRef->GetInternalField(0); sobj = static_cast(v8::External::Unwrap(cdataRef)); #else @@ -1275,13 +1277,13 @@ int SWIGV8_ConvertPacked(v8::Handle valRef, void *ptr, size_t sz, swi return SWIG_OK; } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Persistent< v8::Value > object, void *parameter) { SwigV8PackedData *cdata = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SwigV8PackedData *cdata = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent *object, SwigV8PackedData *cdata) { #else SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackData &data) { @@ -1291,15 +1293,15 @@ SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackDataDispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -1316,35 +1318,35 @@ v8::Handle SWIGV8_NewPackedObj(void *data, size_t size, swig_type_inf obj->SetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__"), SWIGV8_BOOLEAN_NEW(true)); -#if (SWIG_V8_VERSION < 0x031511) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511) obj->SetPointerInInternalField(0, cdata); #else obj->SetAlignedPointerInInternalField(0, cdata); #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) cdata->handle = v8::Persistent::New(obj); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) cdata->handle = v8::Persistent::New(v8::Isolate::GetCurrent(), obj); #else cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) cdata->handle.MakeWeak(cdata, _wrap_SwigV8PackedData_delete); -#elif (SWIG_V8_VERSION < 0x031918) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031918) cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, _wrap_SwigV8PackedData_delete); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) cdata->handle.MakeWeak(cdata, _wrap_SwigV8PackedData_delete); #else cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete); // v8::V8::SetWeak(&cdata->handle, cdata, _wrap_SwigV8PackedData_delete); #endif -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) cdata->handle.MarkIndependent(); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) cdata->handle.MarkIndependent(v8::Isolate::GetCurrent()); #else cdata->handle.MarkIndependent(); @@ -1364,7 +1366,7 @@ v8::Handle SWIGV8_NewPackedObj(void *data, size_t size, swig_type_inf SWIGRUNTIME -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) v8::Handle SWIGV8_AppendOutput(v8::Handle result, v8::Handle obj) { #else v8::Handle SWIGV8_AppendOutput(v8::Local result, v8::Handle obj) { @@ -1374,11 +1376,11 @@ v8::Handle SWIGV8_AppendOutput(v8::Local result, v8::Handl if (result->IsUndefined()) { result = SWIGV8_ARRAY_NEW(); } -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) v8::Handle arr = v8::Handle::Cast(result); #else v8::Local arr = v8::Local::Cast(result); -#endif +#endif arr->Set(arr->Length(), obj); SWIGV8_ESCAPE(arr); @@ -1387,7 +1389,7 @@ v8::Handle SWIGV8_AppendOutput(v8::Local result, v8::Handl // Note: since 3.19 there are new CallBack types, since 03.21.9 the old ones have been removed -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) typedef v8::InvocationCallback SwigV8FunctionCallback; typedef v8::AccessorGetter SwigV8AccessorGetterCallback; typedef v8::AccessorSetter SwigV8AccessorSetterCallback; @@ -1469,6 +1471,7 @@ SWIGRUNTIME void JS_veto_set_variable(v8::Local property, v8::Local< } else { SWIG_exception(SWIG_ERROR, msg); } +fail: ; } @@ -1523,7 +1526,7 @@ static swig_module_info swig_module = {swig_types, 39, 0, 0, 0, 0}; -#define SWIGVERSION 0x030008 +#define SWIGVERSION 0x040000 #define SWIG_VERSION SWIGVERSION @@ -1802,10 +1805,43 @@ v8::Handle SWIG_From_unsigned_SS_long (unsigned long value) } +#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) +# define SWIG_LONG_LONG_AVAILABLE +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE +v8::Handle SWIG_From_long_SS_long (long long value) +{ + return SWIGV8_NUMBER_NEW(value); +} +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERNINLINE +v8::Handle SWIG_From_unsigned_SS_long_SS_long (unsigned long long value) +{ + return (value > LONG_MAX) ? + SWIGV8_INTEGER_NEW_UNS(value) : SWIGV8_INTEGER_NEW((long)(value)); +} +#endif + + SWIGINTERNINLINE v8::Handle SWIG_From_size_t (size_t value) { - return SWIG_From_unsigned_SS_long ((unsigned long)(value)); +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + return SWIG_From_unsigned_SS_long ((unsigned long)(value)); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else { + /* assume sizeof(size_t) <= sizeof(unsigned long long) */ + return SWIG_From_unsigned_SS_long_SS_long ((unsigned long long)(value)); + } +#endif } @@ -1828,12 +1864,44 @@ int SWIG_AsVal_unsigned_SS_long (v8::Handle obj, unsigned long *val) } +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN +int SWIG_AsVal_unsigned_SS_long_SS_long (v8::Handle obj, unsigned long long *val) +{ + if(!obj->IsNumber()) { + return SWIG_TypeError; + } + + long long longVal = (long long) obj->NumberValue(); + + if(longVal < 0) { + return SWIG_OverflowError; + } + + if(val) *val = longVal; + + return SWIG_OK; +} +#endif + + SWIGINTERNINLINE int SWIG_AsVal_size_t (v8::Handle obj, size_t *val) { - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = (size_t)(v); + int res = SWIG_TypeError; +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + unsigned long long v; + res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); + } +#endif return res; } @@ -2450,7 +2518,7 @@ static SwigV8ReturnValue _wrap_new_DOMException(const SwigV8Arguments &args) { if(args.Length() == 3) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_DOMException__SWIG_0(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -2465,7 +2533,7 @@ static SwigV8ReturnValue _wrap_new_DOMException(const SwigV8Arguments &args) { if(args.Length() == 2) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_DOMException__SWIG_1(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -2480,7 +2548,7 @@ static SwigV8ReturnValue _wrap_new_DOMException(const SwigV8Arguments &args) { if(args.Length() == 1) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_DOMException__SWIG_2(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -2502,13 +2570,13 @@ fail: } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMException(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMException(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMException(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMException(const v8::WeakCallbackData &data) { @@ -2522,13 +2590,13 @@ static void _wrap_delete_DOMException(v8::Persistent object, void *pa } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -2680,13 +2748,13 @@ fail: } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMNode(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMNode(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMNode(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMNode(const v8::WeakCallbackData &data) { @@ -2700,13 +2768,13 @@ static void _wrap_delete_DOMNode(v8::Persistent object, void *paramet } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -4225,17 +4293,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMNode(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMNode can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMAttr(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMAttr(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMAttr(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMAttr(const v8::WeakCallbackData &data) { @@ -4249,13 +4318,13 @@ static void _wrap_delete_DOMAttr(v8::Persistent object, void *paramet } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -4473,17 +4542,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMAttr(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMAttr can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMElement(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMElement(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMElement(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMElement(const v8::WeakCallbackData &data) { @@ -4497,13 +4567,13 @@ static void _wrap_delete_DOMElement(v8::Persistent object, void *para } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -5438,17 +5508,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMElement(const SwigV8Arguments &args) SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMElement can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMEntity(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMEntity(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMEntity(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMEntity(const v8::WeakCallbackData &data) { @@ -5462,13 +5533,13 @@ static void _wrap_delete_DOMEntity(v8::Persistent object, void *param } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -5660,17 +5731,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMEntity(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMEntity can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMDocumentType(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMDocumentType(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMDocumentType(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMDocumentType(const v8::WeakCallbackData &data) { @@ -5684,13 +5756,13 @@ static void _wrap_delete_DOMDocumentType(v8::Persistent object, void } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -5878,17 +5950,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMDocumentType(const SwigV8Arguments &a SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMDocumentType can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMCharacterData(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMCharacterData(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMCharacterData(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMCharacterData(const v8::WeakCallbackData &data) { @@ -5902,13 +5975,13 @@ static void _wrap_delete_DOMCharacterData(v8::Persistent object, void } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -6234,17 +6307,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMCharacterData(const SwigV8Arguments & SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMCharacterData can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMComment(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMComment(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMComment(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMComment(const v8::WeakCallbackData &data) { @@ -6258,13 +6332,13 @@ static void _wrap_delete_DOMComment(v8::Persistent object, void *para } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -6276,17 +6350,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMComment(const SwigV8Arguments &args) SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMComment can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMText(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMText(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMText(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMText(const v8::WeakCallbackData &data) { @@ -6300,13 +6375,13 @@ static void _wrap_delete_DOMText(v8::Persistent object, void *paramet } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -6476,17 +6551,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMText(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMText can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMCDATASection(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMCDATASection(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMCDATASection(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMCDATASection(const v8::WeakCallbackData &data) { @@ -6500,13 +6576,13 @@ static void _wrap_delete_DOMCDATASection(v8::Persistent object, void } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -6518,17 +6594,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMCDATASection(const SwigV8Arguments &a SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMCDATASection can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMNodeList(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMNodeList(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMNodeList(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMNodeList(const v8::WeakCallbackData &data) { @@ -6542,13 +6619,13 @@ static void _wrap_delete_DOMNodeList(v8::Persistent object, void *par } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -6625,17 +6702,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMNodeList(const SwigV8Arguments &args) SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMNodeList can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMNamedNodeMap(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMNamedNodeMap(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMNamedNodeMap(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMNamedNodeMap(const v8::WeakCallbackData &data) { @@ -6649,13 +6727,13 @@ static void _wrap_delete_DOMNamedNodeMap(v8::Persistent object, void } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -6960,17 +7038,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMNamedNodeMap(const SwigV8Arguments &a SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMNamedNodeMap can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMDocumentFragment(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMDocumentFragment(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMDocumentFragment(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMDocumentFragment(const v8::WeakCallbackData &data) { @@ -6984,13 +7063,13 @@ static void _wrap_delete_DOMDocumentFragment(v8::Persistent object, v } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -7002,17 +7081,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMDocumentFragment(const SwigV8Argument SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMDocumentFragment can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMEntityReference(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMEntityReference(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMEntityReference(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMEntityReference(const v8::WeakCallbackData &data) { @@ -7026,13 +7106,13 @@ static void _wrap_delete_DOMEntityReference(v8::Persistent object, vo } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -7044,17 +7124,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMEntityReference(const SwigV8Arguments SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMEntityReference can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMNotation(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMNotation(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMNotation(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMNotation(const v8::WeakCallbackData &data) { @@ -7068,13 +7149,13 @@ static void _wrap_delete_DOMNotation(v8::Persistent object, void *par } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -7146,17 +7227,18 @@ static SwigV8ReturnValue _wrap_new_veto_DOMNotation(const SwigV8Arguments &args) SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMNotation can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_DOMProcessingInstruction(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_DOMProcessingInstruction(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_DOMProcessingInstruction(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_DOMProcessingInstruction(const v8::WeakCallbackData &data) { @@ -7170,13 +7252,13 @@ static void _wrap_delete_DOMProcessingInstruction(v8::Persistent obje } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -7282,6 +7364,7 @@ static SwigV8ReturnValue _wrap_new_veto_DOMProcessingInstruction(const SwigV8Arg SWIGV8_HANDLESCOPE(); SWIG_exception(SWIG_ERROR, "Class DOMProcessingInstruction can not be instantiated"); +fail: SWIGV8_RETURN(SWIGV8_UNDEFINED()); } @@ -7435,7 +7518,7 @@ static SwigV8ReturnValue _wrap_new_Event(const SwigV8Arguments &args) { if(args.Length() == 0) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_Event__SWIG_0(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -7450,7 +7533,7 @@ static SwigV8ReturnValue _wrap_new_Event(const SwigV8Arguments &args) { if(args.Length() == 2) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_Event__SWIG_1(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -7465,7 +7548,7 @@ static SwigV8ReturnValue _wrap_new_Event(const SwigV8Arguments &args) { if(args.Length() == 1) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_Event__SWIG_2(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -7487,6 +7570,37 @@ fail: } +static SwigV8ReturnValue _wrap_Event_fromData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + Data *arg1 = 0 ; + void *argp1 ; + int res1 = 0 ; + uscxml::Event result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_fromData."); + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_Data, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_fromData" "', argument " "1"" of type '" "Data const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_fromData" "', argument " "1"" of type '" "Data const &""'"); + } + arg1 = (Data *)(argp1); + result = uscxml::Event::fromData((Data const &)*arg1); + jsresult = SWIG_NewPointerObj((new uscxml::Event((const uscxml::Event&)(result))), SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + static SwigV8ReturnValue _wrap_Event_operator_equal_to(const SwigV8Arguments &args) { SWIGV8_HANDLESCOPE(); @@ -7744,7 +7858,7 @@ static SwigV8ReturnValue _wrap_Event__wrap_Event_getParam(const SwigV8Arguments if(args.Length() == 3) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) jsresult = _wrap_Event_getParam__SWIG_0(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(jsresult); @@ -7760,7 +7874,7 @@ static SwigV8ReturnValue _wrap_Event__wrap_Event_getParam(const SwigV8Arguments if(args.Length() == 3) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) jsresult = _wrap_Event_getParam__SWIG_1(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(jsresult); @@ -7776,7 +7890,7 @@ static SwigV8ReturnValue _wrap_Event__wrap_Event_getParam(const SwigV8Arguments if(args.Length() == 3) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) jsresult = _wrap_Event_getParam__SWIG_3(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(jsresult); @@ -7798,6 +7912,34 @@ fail: } +static SwigV8ReturnValue _wrap_Event_getUUID(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::string *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_getUUID."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getUUID" "', argument " "1"" of type '" "uscxml::Event const *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (std::string *) &((uscxml::Event const *)arg1)->getUUID(); + jsresult = SWIG_From_std_string((std::string)(*result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + static void _wrap_Event_raw_set(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid &info) { SWIGV8_HANDLESCOPE(); @@ -7979,13 +8121,13 @@ fail: } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_Event(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_Event(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_Event(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_Event(const v8::WeakCallbackData &data) { @@ -7999,13 +8141,13 @@ static void _wrap_delete_Event(v8::Persistent object, void *parameter } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -8075,7 +8217,7 @@ static SwigV8ReturnValue _wrap_new_ErrorEvent(const SwigV8Arguments &args) { if(args.Length() == 0) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_ErrorEvent__SWIG_0(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -8090,7 +8232,7 @@ static SwigV8ReturnValue _wrap_new_ErrorEvent(const SwigV8Arguments &args) { if(args.Length() == 1) { errorHandler.err.Clear(); -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) self = _wrap_new_ErrorEvent__SWIG_1(args, errorHandler); if(errorHandler.err.IsEmpty()) { SWIGV8_ESCAPE(self); @@ -8112,13 +8254,13 @@ fail: } -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) static void _wrap_delete_ErrorEvent(v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) static void _wrap_delete_ErrorEvent(v8::Isolate *isolate, v8::Persistent object, void *parameter) { SWIGV8_Proxy *proxy = static_cast(parameter); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) static void _wrap_delete_ErrorEvent(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { #else static void _wrap_delete_ErrorEvent(const v8::WeakCallbackData &data) { @@ -8132,13 +8274,13 @@ static void _wrap_delete_ErrorEvent(v8::Persistent object, void *para } delete proxy; -#if (SWIG_V8_VERSION < 0x031710) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710) object.Dispose(); -#elif (SWIG_V8_VERSION < 0x031900) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031900) object.Dispose(isolate); -#elif (SWIG_V8_VERSION < 0x032100) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100) object->Dispose(isolate); -#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +#elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) object->Dispose(); #else object.Clear(); @@ -8739,7 +8881,6 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection->clientdata == 0) { } /* Name: _exports_DOMNodeList, Type: p_XERCES_CPP_NAMESPACE__DOMNodeList, Dtor: _wrap_delete_DOMNodeList */ v8::Handle _exports_DOMNodeList_class = SWIGV8_CreateClassTemplate("_exports_DOMNodeList"); -//_exports_DOMNodeList_class->InstanceTemplate()->SetIndexedPropertyHandler(V8NodeListIndexedPropertyHandler2); SWIGV8_SET_CLASS_TEMPL(_exports_DOMNodeList_clientData.class_templ, _exports_DOMNodeList_class); _exports_DOMNodeList_clientData.dtor = _wrap_delete_DOMNodeList; if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList->clientdata == 0) { @@ -8914,6 +9055,7 @@ SWIGV8_AddMemberFunction(_exports_DOMProcessingInstruction_class, "getData", _wr SWIGV8_AddMemberFunction(_exports_DOMProcessingInstruction_class, "setData", _wrap_DOMProcessingInstruction_setData); SWIGV8_AddMemberFunction(_exports_Event_class, "operator_equal_to", _wrap_Event_operator_equal_to); SWIGV8_AddMemberFunction(_exports_Event_class, "operator_not_equal_to", _wrap_Event_operator_not_equal_to); +SWIGV8_AddMemberFunction(_exports_Event_class, "getUUID", _wrap_Event_getUUID); SWIGV8_AddMemberVariable(_exports_Event_class, "raw", _wrap_Event_raw_get, _wrap_Event_raw_set); SWIGV8_AddMemberVariable(_exports_Event_class, "name", _wrap_Event_name_get, _wrap_Event_name_set); SWIGV8_AddMemberVariable(_exports_Event_class, "eventType", _wrap_Event_eventType_get, _wrap_Event_eventType_set); @@ -8922,7 +9064,7 @@ SWIGV8_AddMemberVariable(_exports_Event_class, "eventType", _wrap_Event_eventTyp /* setup inheritances */ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMAttr_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMAttr_class->Inherit( @@ -8942,7 +9084,7 @@ SWIGV8_AddMemberVariable(_exports_Event_class, "eventType", _wrap_Event_eventTyp } if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMElement_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMElement_class->Inherit( @@ -8962,7 +9104,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMEntity_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMEntity_class->Inherit( @@ -8982,7 +9124,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMDocumentType_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMDocumentType_class->Inherit( @@ -9002,7 +9144,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMCharacterData_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMCharacterData_class->Inherit( @@ -9022,7 +9164,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMComment_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ); #else _exports_DOMComment_class->Inherit( @@ -9042,7 +9184,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata && !(static_ca } if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMText_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ); #else _exports_DOMText_class->Inherit( @@ -9062,7 +9204,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata && !(static_ca } if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMCDATASection_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata)->class_templ); #else _exports_DOMCDATASection_class->Inherit( @@ -9082,7 +9224,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMDocumentFragment_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMDocumentFragment_class->Inherit( @@ -9102,7 +9244,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMEntityReference_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMEntityReference_class->Inherit( @@ -9122,7 +9264,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMNotation_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMNotation_class->Inherit( @@ -9142,7 +9284,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_DOMProcessingInstruction_class->Inherit(static_cast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); #else _exports_DOMProcessingInstruction_class->Inherit( @@ -9162,7 +9304,7 @@ if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_castclientdata && !(static_cast(SWIGTYPE_p_uscxml__Event->clientdata)->class_templ.IsEmpty())) { -#if (SWIG_V8_VERSION < 0x031903) +#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031903) _exports_ErrorEvent_class->Inherit(static_cast(SWIGTYPE_p_uscxml__Event->clientdata)->class_templ); #else _exports_ErrorEvent_class->Inherit( @@ -9332,6 +9474,7 @@ SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_IMPLEMENTATION SWIGV8_AddStaticVariable(_exports_Event_obj, "INTERNAL", _wrap_uscxml_Event_INTERNAL, JS_veto_set_variable); SWIGV8_AddStaticVariable(_exports_Event_obj, "EXTERNAL", _wrap_uscxml_Event_EXTERNAL, JS_veto_set_variable); SWIGV8_AddStaticVariable(_exports_Event_obj, "PLATFORM", _wrap_uscxml_Event_PLATFORM, JS_veto_set_variable); +SWIGV8_AddStaticFunction(_exports_Event_obj, "fromData", _wrap_Event_fromData); SWIGV8_AddStaticFunction(_exports_Event_obj, "getParam", _wrap_Event__wrap_Event_getParam); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8Event.cpp.inc b/src/uscxml/plugins/datamodel/ecmascript/v8/V8Event.cpp.inc index 757c8a7..d8cb61a 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8Event.cpp.inc +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8Event.cpp.inc @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.13 + * Version 4.0.0 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -1496,7 +1496,7 @@ static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; -#define SWIGVERSION 0x030013 +#define SWIGVERSION 0x040000 #define SWIG_VERSION SWIGVERSION @@ -2210,6 +2210,34 @@ fail: } +static SwigV8ReturnValue _wrap_Event_getUUID(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::string *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_getUUID."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getUUID" "', argument " "1"" of type '" "uscxml::Event const *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (std::string *) &((uscxml::Event const *)arg1)->getUUID(); + jsresult = SWIG_From_std_string((std::string)(*result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + static void _wrap_Event_raw_set(v8::Local property, v8::Local value, const SwigV8PropertyCallbackInfoVoid &info) { SWIGV8_HANDLESCOPE(); @@ -2928,6 +2956,7 @@ if (SWIGTYPE_p_uscxml__ErrorEvent->clientdata == 0) { SWIGV8_AddStaticVariable(exports_obj, "XERCES_HAS_CPP_NAMESPACE", _wrap_XERCES_HAS_CPP_NAMESPACE, JS_veto_set_variable); SWIGV8_AddMemberFunction(_exports_Event_class, "operator_equal_to", _wrap_Event_operator_equal_to); SWIGV8_AddMemberFunction(_exports_Event_class, "operator_not_equal_to", _wrap_Event_operator_not_equal_to); +SWIGV8_AddMemberFunction(_exports_Event_class, "getUUID", _wrap_Event_getUUID); SWIGV8_AddMemberVariable(_exports_Event_class, "raw", _wrap_Event_raw_get, _wrap_Event_raw_set); SWIGV8_AddMemberVariable(_exports_Event_class, "name", _wrap_Event_name_get, _wrap_Event_name_set); SWIGV8_AddMemberVariable(_exports_Event_class, "eventType", _wrap_Event_eventType_get, _wrap_Event_eventType_set); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i b/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i index a0d649c..42d0015 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i @@ -38,6 +38,7 @@ gcc -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include %include "../../common/bindings/dom/dom.i" #endif + // Operators we do want // %rename(operator_assignment) operator=; %rename(operator_equal_to) operator==; diff --git a/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc b/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc index 5a256b6..75f30ce 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc +++ b/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 3.0.8 + * Version 3.0.13 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make @@ -107,9 +107,11 @@ template T SwigValueInit() { #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -659,16 +661,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) { char d = *(c++); unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); + uu = (unsigned char)((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); + uu |= (unsigned char)(d - ('a'-10)); else return (char *) 0; *u = uu; @@ -1547,6 +1549,44 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED * It returns an error code. Number of function return values is passed inside 'ret'. * first_arg is not used in this function because function always has 2 arguments. */ +SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret) +{ +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute +*/ + int bases_search_result; + int substack_start = lua_gettop(L)-2; + assert(first_arg == substack_start+1); + lua_checkstack(L,5); + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_pushvalue(L,substack_start+2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + if(ret) *ret = 1; + return SWIG_OK; + } + lua_pop(L,1); + /* Remove the metatable */ + lua_pop(L,1); + /* Search in base classes */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get_item,ret); + return bases_search_result; /* sorry not known */ +} + + +/* The class.get method helper, performs the lookup of class attributes. + * It returns an error code. Number of function return values is passed inside 'ret'. + * first_arg is not used in this function because function always has 2 arguments. + */ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret) { /* there should be 2 params passed in @@ -1590,19 +1630,6 @@ SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW return SWIG_OK; } lua_pop(L,1); /* remove whatever was there */ - /* NEW: looks for the __getitem() fn - this is a user provided get fn */ - SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ - if (lua_iscfunction(L,-1)) /* if its there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,substack_start+1); /* the userdata */ - lua_pushvalue(L,substack_start+2); /* the parameter */ - lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - if(ret) *ret = 1; - return SWIG_OK; - } - lua_pop(L,1); /* Remove the metatable */ lua_pop(L,1); /* Search in base classes */ @@ -1629,6 +1656,10 @@ SWIGINTERN int SWIG_Lua_class_get(lua_State *L) if(result == SWIG_OK) return ret; + result = SWIG_Lua_class_do_get_item(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + return 0; } @@ -3336,9 +3367,7 @@ static int _wrap_DOMException_getMessage(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMException const *)arg1)->getMessage(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -3406,27 +3435,24 @@ static int _wrap_DOMException_msg_set(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::msg",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::msg",1,"XERCES_CPP_NAMESPACE::DOMException *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::msg",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,0))){ SWIG_fail_ptr("DOMException_msg_set",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("DOMException_msg_set",2,SWIGTYPE_p_uint16_t); + } if (arg1) (arg1)->msg = (XMLCh const *)arg2; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -3445,9 +3471,7 @@ static int _wrap_DOMException_msg_get(lua_State* L) { } result = (XMLCh *) ((arg1)->msg); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -3538,9 +3562,7 @@ static int _wrap_DOMNode_getNodeName(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeName(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -3564,9 +3586,7 @@ static int _wrap_DOMNode_getNodeValue(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeValue(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4019,27 +4039,24 @@ static int _wrap_DOMNode_setNodeValue(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setNodeValue",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setNodeValue",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setNodeValue",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_setNodeValue",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_setNodeValue",2,SWIGTYPE_p_uint16_t); + } (arg1)->setNodeValue((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4077,36 +4094,30 @@ static int _wrap_DOMNode_isSupported(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::isSupported",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isSupported",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isSupported",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isSupported",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_isSupported",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_isSupported",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_isSupported",3,SWIGTYPE_p_uint16_t); + } result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSupported((XMLCh const *)arg2,(XMLCh const *)arg3); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -4125,9 +4136,7 @@ static int _wrap_DOMNode_getNamespaceURI(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNamespaceURI(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4151,9 +4160,7 @@ static int _wrap_DOMNode_getLocalName(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLocalName(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4171,27 +4178,24 @@ static int _wrap_DOMNode_setPrefix(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setPrefix",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setPrefix",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setPrefix",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_setPrefix",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_setPrefix",2,SWIGTYPE_p_uint16_t); + } (arg1)->setPrefix((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4293,6 +4297,7 @@ static int _wrap_DOMNode_setUserData(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setUserData",4,4) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",2,"XMLCh const *"); if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",3,"void *"); if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",4,"XERCES_CPP_NAMESPACE::DOMUserDataHandler *"); @@ -4301,7 +4306,9 @@ static int _wrap_DOMNode_setUserData(lua_State* L) { } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_setUserData",2,SWIGTYPE_p_uint16_t); + } arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"DOMNode_setUserData"); @@ -4311,17 +4318,11 @@ static int _wrap_DOMNode_setUserData(lua_State* L) { result = (void *)(arg1)->setUserData((XMLCh const *)arg2,arg3,arg4); SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4335,27 +4336,24 @@ static int _wrap_DOMNode_getUserData(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getUserData",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getUserData",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getUserData",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_getUserData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_getUserData",2,SWIGTYPE_p_uint16_t); + } result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getUserData((XMLCh const *)arg2); SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4374,9 +4372,7 @@ static int _wrap_DOMNode_getBaseURI(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getBaseURI(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4431,9 +4427,7 @@ static int _wrap_DOMNode_getTextContent(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getTextContent(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4451,27 +4445,24 @@ static int _wrap_DOMNode_setTextContent(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setTextContent",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setTextContent",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setTextContent",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_setTextContent",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_setTextContent",2,SWIGTYPE_p_uint16_t); + } (arg1)->setTextContent((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4485,29 +4476,24 @@ static int _wrap_DOMNode_lookupPrefix(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::lookupPrefix",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::lookupPrefix",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::lookupPrefix",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_lookupPrefix",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_lookupPrefix",2,SWIGTYPE_p_uint16_t); + } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupPrefix((XMLCh const *)arg2); - - result = XMLString2Lua(result); - - - delete[] arg2; - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4521,27 +4507,24 @@ static int _wrap_DOMNode_isDefaultNamespace(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::isDefaultNamespace",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isDefaultNamespace",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isDefaultNamespace",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_isDefaultNamespace",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_isDefaultNamespace",2,SWIGTYPE_p_uint16_t); + } result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isDefaultNamespace((XMLCh const *)arg2); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4555,29 +4538,24 @@ static int _wrap_DOMNode_lookupNamespaceURI(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::lookupNamespaceURI",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::lookupNamespaceURI",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::lookupNamespaceURI",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_lookupNamespaceURI",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_lookupNamespaceURI",2,SWIGTYPE_p_uint16_t); + } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupNamespaceURI((XMLCh const *)arg2); - - result = XMLString2Lua(result); - - - delete[] arg2; - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -4592,36 +4570,30 @@ static int _wrap_DOMNode_getFeature(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getFeature",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getFeature",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getFeature",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getFeature",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ SWIG_fail_ptr("DOMNode_getFeature",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_getFeature",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNode_getFeature",3,SWIGTYPE_p_uint16_t); + } result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFeature((XMLCh const *)arg2,(XMLCh const *)arg3); SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -4790,9 +4762,7 @@ static int _wrap_DOMAttr_getName(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getName(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4840,9 +4810,7 @@ static int _wrap_DOMAttr_getValue(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getValue(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -4860,27 +4828,24 @@ static int _wrap_DOMAttr_setValue(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::setValue",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::setValue",1,"XERCES_CPP_NAMESPACE::DOMAttr *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::setValue",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ SWIG_fail_ptr("DOMAttr_setValue",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMAttr_setValue",2,SWIGTYPE_p_uint16_t); + } (arg1)->setValue((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5017,9 +4982,7 @@ static int _wrap_DOMElement_getTagName(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getTagName(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -5038,29 +5001,24 @@ static int _wrap_DOMElement_getAttribute(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttribute",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttribute",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_getAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getAttribute",2,SWIGTYPE_p_uint16_t); + } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttribute((XMLCh const *)arg2); - - result = XMLString2Lua(result); - - - delete[] arg2; - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5074,27 +5032,24 @@ static int _wrap_DOMElement_getAttributeNode(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNode",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNode",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNode",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_getAttributeNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNode",2,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNode((XMLCh const *)arg2); SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5108,27 +5063,24 @@ static int _wrap_DOMElement_getElementsByTagName(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagName",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagName",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagName",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_getElementsByTagName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getElementsByTagName",2,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagName((XMLCh const *)arg2); SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5142,36 +5094,30 @@ static int _wrap_DOMElement_setAttribute(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setAttribute",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttribute",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttribute",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_setAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setAttribute",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setAttribute",3,SWIGTYPE_p_uint16_t); + } (arg1)->setAttribute((XMLCh const *)arg2,(XMLCh const *)arg3); - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5246,27 +5192,24 @@ static int _wrap_DOMElement_removeAttribute(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::removeAttribute",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttribute",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_removeAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_removeAttribute",2,SWIGTYPE_p_uint16_t); + } (arg1)->removeAttribute((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5281,38 +5224,30 @@ static int _wrap_DOMElement_getAttributeNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_getAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNS",3,SWIGTYPE_p_uint16_t); + } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); - - result = XMLString2Lua(result); - - - delete[] arg2; - - - delete[] arg3; - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5327,45 +5262,36 @@ static int _wrap_DOMElement_setAttributeNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",4,4) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",3,"XMLCh const *"); + if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",4,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_setAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNS",3,SWIGTYPE_p_uint16_t); + } - arg4 = Lua2XMLString(4); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNS",4,SWIGTYPE_p_uint16_t); + } (arg1)->setAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,(XMLCh const *)arg4); - - delete[] arg2; - - - delete[] arg3; - - - delete[] arg4; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - - - delete[] arg4; - lua_error(L); return SWIG_arg; } @@ -5379,36 +5305,30 @@ static int _wrap_DOMElement_removeAttributeNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_removeAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_removeAttributeNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_removeAttributeNS",3,SWIGTYPE_p_uint16_t); + } (arg1)->removeAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5423,36 +5343,30 @@ static int _wrap_DOMElement_getAttributeNodeNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNodeNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNodeNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNodeNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNodeNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_getAttributeNodeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNodeNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNodeNS",3,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNodeNS((XMLCh const *)arg2,(XMLCh const *)arg3); SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5498,36 +5412,30 @@ static int _wrap_DOMElement_getElementsByTagNameNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagNameNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagNameNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagNameNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagNameNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_getElementsByTagNameNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getElementsByTagNameNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_getElementsByTagNameNS",3,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagNameNS((XMLCh const *)arg2,(XMLCh const *)arg3); SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0); SWIG_arg++; - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5541,27 +5449,24 @@ static int _wrap_DOMElement_hasAttribute(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::hasAttribute",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttribute",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_hasAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_hasAttribute",2,SWIGTYPE_p_uint16_t); + } result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttribute((XMLCh const *)arg2); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5576,36 +5481,30 @@ static int _wrap_DOMElement_hasAttributeNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::hasAttributeNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttributeNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttributeNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ SWIG_fail_ptr("DOMElement_hasAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_hasAttributeNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_hasAttributeNS",3,SWIGTYPE_p_uint16_t); + } result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5619,6 +5518,7 @@ static int _wrap_DOMElement_setIdAttribute(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",2,"XMLCh const *"); if(!lua_isboolean(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",3,"bool"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ @@ -5626,22 +5526,18 @@ static int _wrap_DOMElement_setIdAttribute(lua_State* L) { } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setIdAttribute",2,SWIGTYPE_p_uint16_t); + } arg3 = (lua_toboolean(L, 3)!=0); (arg1)->setIdAttribute((XMLCh const *)arg2,arg3); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -5656,6 +5552,8 @@ static int _wrap_DOMElement_setIdAttributeNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",4,4) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",3,"XMLCh const *"); if(!lua_isboolean(L,4)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",4,"bool"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ @@ -5663,31 +5561,23 @@ static int _wrap_DOMElement_setIdAttributeNS(lua_State* L) { } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setIdAttributeNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMElement_setIdAttributeNS",3,SWIGTYPE_p_uint16_t); + } arg4 = (lua_toboolean(L, 4)!=0); (arg1)->setIdAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,arg4); - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -5947,9 +5837,7 @@ static int _wrap_DOMEntity_getPublicId(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getPublicId(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -5973,9 +5861,7 @@ static int _wrap_DOMEntity_getSystemId(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getSystemId(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -5999,9 +5885,7 @@ static int _wrap_DOMEntity_getNotationName(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getNotationName(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6025,9 +5909,7 @@ static int _wrap_DOMEntity_getInputEncoding(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getInputEncoding(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6051,9 +5933,7 @@ static int _wrap_DOMEntity_getXmlEncoding(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlEncoding(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6077,9 +5957,7 @@ static int _wrap_DOMEntity_getXmlVersion(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlVersion(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6148,9 +6026,7 @@ static int _wrap_DOMDocumentType_getName(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getName(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6222,9 +6098,7 @@ static int _wrap_DOMDocumentType_getPublicId(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getPublicId(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6248,9 +6122,7 @@ static int _wrap_DOMDocumentType_getSystemId(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getSystemId(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6274,9 +6146,7 @@ static int _wrap_DOMDocumentType_getInternalSubset(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getInternalSubset(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6345,9 +6215,7 @@ static int _wrap_DOMCharacterData_getData(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getData(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6403,9 +6271,7 @@ static int _wrap_DOMCharacterData_substringData(lua_State* L) { SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative") arg3 = (XMLSize_t)lua_tonumber(L, 3); result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->substringData(arg2,arg3); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6423,27 +6289,24 @@ static int _wrap_DOMCharacterData_appendData(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::appendData",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::appendData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::appendData",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ SWIG_fail_ptr("DOMCharacterData_appendData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMCharacterData_appendData",2,SWIGTYPE_p_uint16_t); + } (arg1)->appendData((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -6458,6 +6321,7 @@ static int _wrap_DOMCharacterData_insertData(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",2,"XMLSize_t"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ SWIG_fail_ptr("DOMCharacterData_insertData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); @@ -6466,21 +6330,17 @@ static int _wrap_DOMCharacterData_insertData(lua_State* L) { SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") arg2 = (XMLSize_t)lua_tonumber(L, 2); - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMCharacterData_insertData",3,SWIGTYPE_p_uint16_t); + } (arg1)->insertData(arg2,(XMLCh const *)arg3); - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -6528,6 +6388,7 @@ static int _wrap_DOMCharacterData_replaceData(lua_State* L) { if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",2,"XMLSize_t"); if(!lua_isnumber(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",3,"XMLSize_t"); + if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",4,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ SWIG_fail_ptr("DOMCharacterData_replaceData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); @@ -6538,21 +6399,17 @@ static int _wrap_DOMCharacterData_replaceData(lua_State* L) { SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative") arg3 = (XMLSize_t)lua_tonumber(L, 3); - arg4 = Lua2XMLString(4); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMCharacterData_replaceData",4,SWIGTYPE_p_uint16_t); + } (arg1)->replaceData(arg2,arg3,(XMLCh const *)arg4); - - delete[] arg4; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg4; - lua_error(L); return SWIG_arg; } @@ -6565,27 +6422,24 @@ static int _wrap_DOMCharacterData_setData(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::setData",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::setData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::setData",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ SWIG_fail_ptr("DOMCharacterData_setData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMCharacterData_setData",2,SWIGTYPE_p_uint16_t); + } (arg1)->setData((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -6742,9 +6596,7 @@ static int _wrap_DOMText_getWholeText(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getWholeText(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -6763,27 +6615,24 @@ static int _wrap_DOMText_replaceWholeText(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMText::replaceWholeText",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::replaceWholeText",1,"XERCES_CPP_NAMESPACE::DOMText *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::replaceWholeText",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0))){ SWIG_fail_ptr("DOMText_replaceWholeText",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMText_replaceWholeText",2,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->replaceWholeText((XMLCh const *)arg2); SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0); SWIG_arg++; - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -7065,30 +6914,27 @@ static int _wrap_DOMNamedNodeMap_getNamedItem(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItem",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItem",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItem",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ SWIG_fail_ptr("DOMNamedNodeMap_getNamedItem",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_getNamedItem",2,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItem((XMLCh const *)arg2); { swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; } - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -7126,30 +6972,27 @@ static int _wrap_DOMNamedNodeMap_removeNamedItem(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItem",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItem",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItem",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItem",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItem",2,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItem((XMLCh const *)arg2); { swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; } - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -7164,39 +7007,33 @@ static int _wrap_DOMNamedNodeMap_getNamedItemNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItemNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItemNS",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItemNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItemNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ SWIG_fail_ptr("DOMNamedNodeMap_getNamedItemNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_getNamedItemNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_getNamedItemNS",3,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); { swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; } - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -7245,39 +7082,33 @@ static int _wrap_DOMNamedNodeMap_removeNamedItemNS(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItemNS",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItemNS",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItemNS",2,"XMLCh const *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItemNS",3,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItemNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItemNS",2,SWIGTYPE_p_uint16_t); + } - arg3 = Lua2XMLString(3); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItemNS",3,SWIGTYPE_p_uint16_t); + } result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); { swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; } - - delete[] arg2; - - - delete[] arg3; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - - - delete[] arg3; - lua_error(L); return SWIG_arg; } @@ -7421,9 +7252,7 @@ static int _wrap_DOMNotation_getPublicId(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getPublicId(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -7447,9 +7276,7 @@ static int _wrap_DOMNotation_getSystemId(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getSystemId(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -7514,9 +7341,7 @@ static int _wrap_DOMProcessingInstruction_getTarget(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getTarget(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -7540,9 +7365,7 @@ static int _wrap_DOMProcessingInstruction_getData(lua_State* L) { } result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getData(); - - result = XMLString2Lua(result); - + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uint16_t,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -7560,27 +7383,24 @@ static int _wrap_DOMProcessingInstruction_setData(lua_State* L) { SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::setData",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::setData",1,"XERCES_CPP_NAMESPACE::DOMProcessingInstruction *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::setData",2,"XMLCh const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction,0))){ SWIG_fail_ptr("DOMProcessingInstruction_setData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction); } - arg2 = Lua2XMLString(2); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uint16_t,0))){ + SWIG_fail_ptr("DOMProcessingInstruction_setData",2,SWIGTYPE_p_uint16_t); + } (arg1)->setData((XMLCh const *)arg2); - - delete[] arg2; - return SWIG_arg; if(0) SWIG_fail; fail: - - delete[] arg2; - lua_error(L); return SWIG_arg; } @@ -7733,6 +7553,33 @@ static int _wrap_new_Event(lua_State* L) { } +static int _wrap_Event_fromData(lua_State* L) { + int SWIG_arg = 0; + Data *arg1 = 0 ; + uscxml::Event result; + + SWIG_check_num_args("uscxml::Event::fromData",1,1) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::fromData",1,"Data const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Data,0))){ + SWIG_fail_ptr("Event_fromData",1,SWIGTYPE_p_Data); + } + + result = uscxml::Event::fromData((Data const &)*arg1); + { + uscxml::Event * resultptr = new uscxml::Event((const uscxml::Event &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_Event___lt(lua_State* L) { int SWIG_arg = 0; uscxml::Event *arg1 = (uscxml::Event *) 0 ; @@ -8004,6 +7851,30 @@ static int _wrap_Event_getParam(lua_State* L) { } +static int _wrap_Event_getUUID(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("uscxml::Event::getUUID",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::getUUID",1,"uscxml::Event const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_getUUID",1,SWIGTYPE_p_uscxml__Event); + } + + result = (std::string *) &((uscxml::Event const *)arg1)->getUUID(); + lua_pushlstring(L,result->data(),result->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_Event_raw_set(lua_State* L) { int SWIG_arg = 0; uscxml::Event *arg1 = (uscxml::Event *) 0 ; @@ -8177,6 +8048,7 @@ static swig_lua_attribute swig_Event_attributes[] = { static swig_lua_method swig_Event_methods[]= { { "__lt", _wrap_Event___lt}, { "__eq", _wrap_Event___eq}, + { "getUUID", _wrap_Event_getUUID}, {0,0} }; static swig_lua_method swig_Event_meta[] = { @@ -8195,6 +8067,7 @@ static swig_lua_const_info swig_Event_Sf_SwigStatic_constants[]= { {0,0,0,0,0,0} }; static swig_lua_method swig_Event_Sf_SwigStatic_methods[]= { + { "fromData", _wrap_Event_fromData}, { "getParam", _wrap_Event_getParam}, {0,0} }; @@ -8375,6 +8248,7 @@ static swig_lua_const_info swig_SwigModule_constants[]= { {0,0,0,0,0,0} }; static swig_lua_method swig_SwigModule_methods[]= { + { "Event_fromData", _wrap_Event_fromData}, { "Event_getParam", _wrap_Event_getParam}, {0,0} }; diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 92866ee..15cbf9d 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -36,34 +36,44 @@ #endif #include "uscxml/messages/Event.h" + #ifndef NO_XERCESC #include "uscxml/util/DOM.h" #endif + #include "uscxml/interpreter/Logging.h" #include -//#include "LuaDOM.cpp.inc" +//#include "LuaDOM.cpp.inc" // TODO: activate XercesC bindings for test 530 #ifdef BUILD_AS_PLUGINS #include #endif -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new LuaDataModelProvider() ); - return true; -} -#endif - //static int luaInspect(lua_State * l) { // return 0; //} -bool _luaHasXMLParser = false; +//bool _luaHasXMLParser = false; +using namespace XERCESC_NS; + +#ifndef NO_XERCESC +#include "LuaDOM.cpp.inc" +#else +#include "LuaEvent.cpp.inc" +#endif + +namespace uscxml { + +#ifdef BUILD_AS_PLUGINS + PLUMA_CONNECTOR + bool pluginConnect(pluma::Host& host) { + host.add( new LuaDataModelProvider() ); + return true; + } +#endif + static int luaEval(lua_State* luaState, const std::string& expr) { int preStack = lua_gettop(luaState); int error = luaL_loadstring(luaState, expr.c_str()) || lua_pcall(luaState, 0, LUA_MULTRET, 0); @@ -86,8 +96,13 @@ static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) { data.atom = "__tmpFunc"; data.type = Data::INTERPRETED; } else if(lua.isLightUserdata() || lua.isUserdata()) { - // not sure what to do - } else if(lua.isThread()) { +#ifndef NO_XERCESC + int err = SWIG_Lua_ConvertPtr(_luaState, 0, (void**)&(data.node), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + if (err == SWIG_ERROR) + data.node = NULL; +#endif + + } else if(lua.isThread()) { // not sure what to do } else if(lua.type() == LUA_TBOOLEAN) { // why is there no isBoolean in luabridge? @@ -106,7 +121,7 @@ static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) { } else if(lua.isString()) { data.atom = lua.cast(); data.type = Data::VERBATIM; - } else if(lua.isTable()) { + } else if(lua.isTable()) { // check whether it is to be interpreted as a map or an array bool isArray = true; std::map luaItems; @@ -145,20 +160,14 @@ static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { luabridge::LuaRef luaData (_luaState); if (data.node) { - if (_luaHasXMLParser) { - const luabridge::LuaRef& luaLom = luabridge::getGlobal(_luaState, "lxp.lom"); - const luabridge::LuaRef& luaLomParse = luaLom["parse"]; - assert(luaLomParse.isFunction()); - std::stringstream luaXMLSS; - luaXMLSS << data.node; - try { - luaData = luaLomParse(luaXMLSS.str()); - } catch (luabridge::LuaException e) { - ERROR_EXECUTION_THROW(e.what()); - } - return luaData; - } - } +#ifndef NO_XERCESC + SWIG_Lua_NewPointerObj(_luaState, data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + luaData = luabridge::LuaRef::fromStack(_luaState, 1); + return luaData; +#else + ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); +#endif + } if (data.compound.size() > 0) { luaData = luabridge::newTable(_luaState); std::map::const_iterator compoundIter = data.compound.begin(); @@ -248,6 +257,9 @@ void LuaDataModel::setup() { _luaState = luaL_newstate(); luaL_openlibs(_luaState); + SWIG_init(_luaState); + +#if 0 try { const luabridge::LuaRef& requireFunc = luabridge::getGlobal(_luaState, "require"); if (requireFunc.isFunction()) { @@ -264,7 +276,8 @@ void LuaDataModel::setup() { } catch (luabridge::LuaException e) { LOG(_callbacks->getLogger(), USCXML_INFO) << e.what() << std::endl; } - +#endif + luabridge::getGlobalNamespace(_luaState).beginClass("DataModel").endClass(); luabridge::setGlobal(_luaState, this, "__datamodel"); @@ -308,7 +321,6 @@ void LuaDataModel::setEvent(const Event& event) { luabridge::LuaRef luaEvent(_luaState); luaEvent = luabridge::newTable(_luaState); - luaEvent["name"] = event.name; if (event.raw.size() > 0) luaEvent["raw"] = event.raw; @@ -338,20 +350,12 @@ void LuaDataModel::setEvent(const Event& event) { } if (event.data.node) { - if (_luaHasXMLParser) { - const luabridge::LuaRef& luaLom = luabridge::getGlobal(_luaState, "lxp.lom"); - const luabridge::LuaRef& luaLomParse = luaLom["parse"]; - assert(luaLomParse.isFunction()); - std::stringstream luaXMLSS; - luaXMLSS << event.data.node; - try { - luaEvent["data"] = luaLomParse(luaXMLSS.str()); - } catch (luabridge::LuaException e) { - ERROR_EXECUTION_THROW(e.what()); - } - } else { - ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); - } +#ifndef NO_XERCESC + SWIG_Lua_NewPointerObj(_luaState, event.data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + luaEvent["data"] = luabridge::LuaRef::fromStack(_luaState, 1); +#else + ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); +#endif } else { // _event.data is KVP Data d = event.data; @@ -380,6 +384,7 @@ void LuaDataModel::setEvent(const Event& event) { } luabridge::setGlobal(_luaState, luaEvent, "_event"); + } Data LuaDataModel::evalAsData(const std::string& content) { @@ -403,6 +408,10 @@ void LuaDataModel::eval(const std::string& content) { lua_pop(_luaState, retVals); } +bool LuaDataModel::isLegalDataValue(const std::string& expr) { + return isValidSyntax("local __tmp = " + expr); +} + bool LuaDataModel::isValidSyntax(const std::string& expr) { int preStack = lua_gettop(_luaState); int err = luaL_loadstring (_luaState, expr.c_str()); @@ -499,18 +508,14 @@ void LuaDataModel::assign(const std::string& location, const Data& data, const s ERROR_EXECUTION_THROW("Cannot assign to _event"); if (data.node) { - ERROR_EXECUTION_THROW("Cannot assign xml nodes in lua datamodel"); - - // TODO: DOM is prepared by swig - -// return SWIG_JSC_NewPointerObj(_ctx, -// (void*)node, -// SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, -// SWIG_as_voidptrptr(&node)), -// 0); - +#ifndef NO_XERCESC -// JSObjectSetProperty(_ctx, JSContextGetGlobalObject(_ctx), JSStringCreateWithUTF8CString(location.c_str()), getNodeAsValue(data.node), 0, &exception); + SWIG_Lua_NewPointerObj(_luaState, data.node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_POINTER_DISOWN); + lua_setglobal(_luaState, "__tmpAssign"); + eval(location + "= __tmpAssign"); +#else + ERROR_EXECUTION_THROW("Cannot assign xml nodes in lua datamodel"); +#endif } else { diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h index 93379fc..84633f1 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h @@ -62,6 +62,7 @@ public: } virtual bool isValidSyntax(const std::string& expr); + virtual bool isLegalDataValue(const std::string& expr); virtual void setEvent(const Event& event); diff --git a/src/uscxml/plugins/datamodel/lua/LuaEvent.cpp.inc b/src/uscxml/plugins/datamodel/lua/LuaEvent.cpp.inc new file mode 100644 index 0000000..7e6de8b --- /dev/null +++ b/src/uscxml/plugins/datamodel/lua/LuaEvent.cpp.inc @@ -0,0 +1,4154 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.13 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + + +#ifndef SWIGLUA +#define SWIGLUA +#endif + +#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA +#define SWIG_LUA_MODULE_GLOBAL + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = (unsigned char)((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = (unsigned char)((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (unsigned char)(d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (unsigned char)(d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * luarun.swg + * + * This file contains the runtime support for Lua modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lua.h" +#include "lauxlib.h" +#include /* for malloc */ +#include /* for a few sanity tests */ + +/* ----------------------------------------------------------------------------- + * Lua flavors + * ----------------------------------------------------------------------------- */ + +#define SWIG_LUA_FLAVOR_LUA 1 +#define SWIG_LUA_FLAVOR_ELUA 2 +#define SWIG_LUA_FLAVOR_ELUAC 3 + +#if !defined(SWIG_LUA_TARGET) +# error SWIG_LUA_TARGET not defined +#endif + +#if defined(SWIG_LUA_ELUA_EMULATE) + +struct swig_elua_entry; + +typedef struct swig_elua_key { + int type; + union { + const char* strkey; + lua_Number numkey; + } key; +} swig_elua_key; + +typedef struct swig_elua_val { + int type; + union { + lua_Number number; + const struct swig_elua_entry *table; + const char *string; + lua_CFunction function; + struct { + char member; + long lvalue; + void *pvalue; + swig_type_info **ptype; + } userdata; + } value; +} swig_elua_val; + +typedef struct swig_elua_entry { + swig_elua_key key; + swig_elua_val value; +} swig_elua_entry; + +#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } +#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } +#define LNILKEY {LUA_TNIL, {.strkey = 0} } + +#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } +#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } +#define LROVAL(x) {LUA_TTABLE, {.table = x} } +#define LNILVAL {LUA_TNIL, {.string = 0} } +#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } + +#define LUA_REG_TYPE swig_elua_entry + +#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" + +#define lua_pushrotable(L,p)\ + lua_newtable(L);\ + assert(p);\ + SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); + +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } + +#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) +# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) + /* Those two types of constants are not supported in elua */ + +#ifndef SWIG_LUA_CONSTTAB_POINTER +#warning eLua does not support pointers as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL +#endif + +#ifndef SWIG_LUA_CONSTTAB_BINARY +#warning eLua does not support pointers to member as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL +#endif +#else /* SWIG_LUA_FLAVOR_LUA */ +# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 +# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 +# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D +# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ + SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D +#endif + +#ifndef SWIG_LUA_ELUA_EMULATE +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} +# define LSTRVAL LRO_STRVAL +#endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ + +#ifndef SWIG_LUA_ELUA_EMULATE +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) + +#ifndef MIN_OPT_LEVEL +#define MIN_OPT_LEVEL 2 +#endif + +#include "lrodefs.h" +#include "lrotable.h" +#endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ +/* ----------------------------------------------------------------------------- + * compatibility defines + * ----------------------------------------------------------------------------- */ + +/* History of Lua C API length functions: In Lua 5.0 (and before?) + there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", + but a compatibility define of "lua_strlen" was added. In Lua 5.2, + this function was again renamed, to "lua_rawlen" (to emphasize that + it doesn't call the "__len" metamethod), and the compatibility + define of lua_strlen was removed. All SWIG uses have been updated + to "lua_rawlen", and we add our own defines of that here for older + versions of Lua. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +# define lua_rawlen lua_strlen +#elif LUA_VERSION_NUM == 501 +# define lua_rawlen lua_objlen +#endif + + +/* lua_pushglobaltable is the recommended "future-proof" way to get + the global table for Lua 5.2 and later. Here we define + lua_pushglobaltable ourselves for Lua versions before 5.2. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) +#endif + +/* lua_absindex was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) +#endif + +/* lua_rawsetp was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +#define lua_rawsetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_insert(L,-2);\ + lua_rawset(L,index); + +#define lua_rawgetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_rawget(L,index); + +#endif + +/* -------------------------------------------------------------------------- + * Helper functions for error handling + * -------------------------------------------------------------------------- */ + +/* Push the string STR on the Lua stack, like lua_pushstring, but + prefixed with the the location of the innermost Lua call-point + (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pusherrstring (lua_State *L, const char *str) +{ + luaL_where (L, 1); + lua_pushstring (L, str); + lua_concat (L, 2); +} + +/* Push a formatted string generated from FMT and following args on + the Lua stack, like lua_pushfstring, but prefixed with the the + location of the innermost Lua call-point (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); +} + + +/* ----------------------------------------------------------------------------- + * global swig types + * ----------------------------------------------------------------------------- */ +/* Constant table */ +#define SWIG_LUA_INT 1 +#define SWIG_LUA_FLOAT 2 +#define SWIG_LUA_STRING 3 +#define SWIG_LUA_POINTER 4 +#define SWIG_LUA_BINARY 5 +#define SWIG_LUA_CHAR 6 + +/* Structure for variable linking table */ +typedef struct { + const char *name; + lua_CFunction get; + lua_CFunction set; +} swig_lua_var_info; + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +typedef const LUA_REG_TYPE swig_lua_method; +typedef const LUA_REG_TYPE swig_lua_const_info; +#else /* Normal lua */ +typedef luaL_Reg swig_lua_method; + +/* Constant information structure */ +typedef struct { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_lua_const_info; + +#endif + +typedef struct { + const char *name; + lua_CFunction getmethod; + lua_CFunction setmethod; +} swig_lua_attribute; + + +struct swig_lua_class; +/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ +typedef struct swig_lua_namespace { + const char *name; + swig_lua_method *ns_methods; + swig_lua_attribute *ns_attributes; + swig_lua_const_info *ns_constants; + struct swig_lua_class **ns_classes; + struct swig_lua_namespace **ns_namespaces; +} swig_lua_namespace; + +typedef struct swig_lua_class { + const char *name; /* Name that this class has in Lua */ + const char *fqname; /* Fully qualified name - Scope + class name */ + swig_type_info **type; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; + swig_lua_attribute *attributes; + swig_lua_namespace *cls_static; + swig_lua_method *metatable; /* 0 for -eluac */ + struct swig_lua_class **bases; + const char **base_names; +} swig_lua_class; + +/* this is the struct for wrapping all pointers in SwigLua +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + void *ptr; +} swig_lua_userdata; + +/* this is the struct for wrapping arbitrary packed binary data +(currently it is only used for member function pointers) +the data ordering is similar to swig_lua_userdata, but it is currently not possible +to tell the two structures apart within SWIG, other than by looking at the type +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + char data[1]; /* arbitary amount of data */ +} swig_lua_rawdata; + +/* Common SWIG API */ +#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) +#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) + +/* Runtime API */ +#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) +#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) +#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* + +/* Contract support */ +#define SWIG_contract_assert(expr, msg) \ + if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else + + +/* helper #defines */ +#define SWIG_fail {goto fail;} +#define SWIG_fail_arg(func_name,argnum,type) \ + {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ + func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ + goto fail;} +#define SWIG_fail_ptr(func_name,argnum,type) \ + SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") +#define SWIG_check_num_args(func_name,a,b) \ + if (lua_gettop(L)b) \ + {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ + goto fail;} + + +#define SWIG_Lua_get_table(L,n) \ + (lua_pushstring(L, n), lua_rawget(L,-2)) + +#define SWIG_Lua_add_function(L,n,f) \ + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) + +#define SWIG_Lua_add_boolean(L,n,b) \ + (lua_pushstring(L, n), \ + lua_pushboolean(L, b), \ + lua_rawset(L,-3)) + +/* special helper for allowing 'nil' for usertypes */ +#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) + +#ifdef __cplusplus +/* Special helper for member function pointers +it gets the address, casts it, then dereferences it */ +/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ +#endif + +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State *L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} + +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: modules + * ----------------------------------------------------------------------------- */ + +/* this function is called when trying to set an immutable. +default action is to print an error. +This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ +SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) +{ +/* there should be 1 param passed in: the new value */ +#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE + lua_pop(L,1); /* remove it */ + luaL_error(L,"This variable is immutable"); +#endif + return 0; /* should not return anything */ +} + +#ifdef SWIG_LUA_ELUA_EMULATE + +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); +static int swig_lua_elua_emulate_unique_key; + +/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ +SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) +{ + int i, table_parsed, parsed_tables_array, target_table; + assert(lua_istable(L,-1)); + target_table = lua_gettop(L); + /* Get the registry where we put all parsed tables to avoid loops */ + lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); + if(lua_isnil(L,-1)) { + lua_pop(L,1); + lua_newtable(L); + lua_pushvalue(L,-1); + lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); + } + parsed_tables_array = lua_gettop(L); + lua_pushvalue(L,target_table); + lua_rawsetp(L, parsed_tables_array, table); + table_parsed = 0; + const int SWIGUNUSED pairs_start = lua_gettop(L); + for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) + { + const swig_elua_entry *entry = table + i; + int is_metatable = 0; + switch(entry->key.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->key.key.strkey); + if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) + is_metatable = 1; + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->key.key.numkey); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); + } + switch(entry->value.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->value.value.string); + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->value.value.number); + break; + case LUA_TFUNCTION: + lua_pushcfunction(L,entry->value.value.function); + break; + case LUA_TTABLE: + lua_rawgetp(L,parsed_tables_array, entry->value.value.table); + table_parsed = !lua_isnil(L,-1); + if(!table_parsed) { + lua_pop(L,1); /*remove nil */ + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,entry->value.value.table); + } + if(is_metatable) { + assert(lua_istable(L,-1)); + lua_pushvalue(L,-1); + lua_setmetatable(L,target_table); + } + + break; + case LUA_TUSERDATA: + if(entry->value.value.userdata.member) + SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, + entry->value.value.userdata.lvalue, + *(entry->value.value.userdata.ptype)); + else + SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, + *(entry->value.value.userdata.ptype),0); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); + } + assert(lua_gettop(L) == pairs_start + 2); + lua_rawset(L,target_table); + } + lua_pop(L,1); /* Removing parsed tables storage */ + assert(lua_gettop(L) == target_table); +} + +SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) +{ + lua_pushnil(L); + lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); +} + +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); + +SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) +{ + SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); + SWIG_Lua_get_class_registry(L); + lua_getfield(L,-1,"lua_getmetatable"); + lua_remove(L,-2); /* remove the registry*/ + assert(!lua_isnil(L,-1)); + lua_pushvalue(L,1); + assert(lua_gettop(L) == 3); /* object | function | object again */ + lua_call(L,1,1); + if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ + return 1; + /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ + assert(lua_gettop(L) == 2); + if(lua_istable(L,-2)) { + lua_pop(L,1); /*remove the nil*/ + lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); + } + assert(lua_gettop(L) == 2); + return 1; + +fail: + lua_error(L); + return 0; +} + +SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) +{ + SWIG_Lua_get_class_registry(L); + lua_pushglobaltable(L); + lua_pushstring(L,"lua_getmetatable"); + lua_getfield(L,-2,"getmetatable"); + assert(!lua_isnil(L,-1)); + lua_rawset(L,-4); + lua_pushstring(L, "getmetatable"); + lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); + lua_rawset(L,-3); + lua_pop(L,2); + +} +/* END OF REMOVE */ + +#endif +/* ----------------------------------------------------------------------------- + * global variable support code: namespaces and modules (which are the same thing) + * ----------------------------------------------------------------------------- */ + +SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute +*/ + assert(lua_istable(L,-2)); /* just in case */ + lua_getmetatable(L,-2); + assert(lua_istable(L,-1)); + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + return 0; +} + +SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + + assert(lua_istable(L,1)); + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + lua_pop(L,1); /* remote metatable */ + lua_rawset(L,-3); + return 0; +} + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); + +/* helper function - register namespace methods and attributes into namespace */ +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) +{ + int i; + /* There must be namespace table (not metatable) at the top of the stack */ + assert(lua_istable(L,-1)); + SWIG_Lua_InstallConstants(L, ns->ns_constants); + + /* add methods to the namespace/module table */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); + } + lua_getmetatable(L,-1); + + /* add fns */ + for(i=0;ns->ns_attributes[i].name;i++){ + SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); + } + + /* clear stack - remove metatble */ + lua_pop(L,1); + return 0; +} + +/* Register all classes in the namespace */ +SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) +{ + swig_lua_class **classes; + + /* There must be a module/namespace table at the top of the stack */ + assert(lua_istable(L,-1)); + + classes = ns->ns_classes; + + if( classes != 0 ) { + while(*classes != 0) { + SWIG_Lua_class_register(L, *classes); + classes++; + } + } +} + +/* Helper function. Creates namespace table and adds it to module table + if 'reg' is true, then will register namespace table to parent one (must be on top of the stack + when function is called). + Function always returns newly registered table on top of the stack. +*/ +SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) +{ + swig_lua_namespace **sub_namespace; + /* 1 argument - table on the top of the stack */ + const int SWIGUNUSED begin = lua_gettop(L); + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ + lua_checkstack(L,5); + lua_newtable(L); /* namespace itself */ + lua_newtable(L); /* metatable for namespace */ + + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); + + lua_setmetatable(L,-2); /* set metatable */ + + /* Register all functions, variables etc */ + SWIG_Lua_add_namespace_details(L,ns); + /* Register classes */ + SWIG_Lua_add_namespace_classes(L,ns); + + sub_namespace = ns->ns_namespaces; + if( sub_namespace != 0) { + while(*sub_namespace != 0) { + SWIG_Lua_namespace_register(L, *sub_namespace, 1); + lua_pop(L,1); /* removing sub-namespace table */ + sub_namespace++; + } + } + + if (reg) { + lua_pushstring(L,ns->name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); /* add namespace to module table */ + } + assert(lua_gettop(L) == begin+1); +} +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + +/* ----------------------------------------------------------------------------- + * global variable support code: classes + * ----------------------------------------------------------------------------- */ + +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); + +typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); + +SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, + int first_arg, swig_lua_base_iterator_func func, int *const ret) +{ + /* first_arg - position of the object in stack. Everything that is above are arguments + * and is passed to every evocation of the func */ + int last_arg = lua_gettop(L);/* position of last argument */ + int original_metatable = last_arg + 1; + size_t bases_count; + int result = SWIG_ERROR; + int bases_table; + (void)swig_type; + lua_getmetatable(L,first_arg); + + /* initialise base search */ +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); + bases_count = lua_rawlen(L,-1); + bases_table = lua_gettop(L); +#else + /* In elua .bases table doesn't exist. Use table from swig_lua_class */ + (void)bases_table; + assert(swig_type!=0); + swig_module_info *module=SWIG_GetModule(L); + swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; + const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; + bases_count = 0; + for(;base_names[bases_count]; + bases_count++);/* get length of bases */ +#endif + + if(ret) + *ret = 0; + if(bases_count>0) + { + int to_remove; + size_t i; + int j; + int subcall_last_arg; + int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ + int valid = 1; + swig_type_info *base_swig_type = 0; + for(j=first_arg;j<=last_arg;j++) + lua_pushvalue(L,j); + subcall_last_arg = lua_gettop(L); + + /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ + for(i=0;ifqname); + base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); + assert(base_swig_type != 0); + } +#endif + + if(!valid) + continue; + assert(lua_isuserdata(L, subcall_first_arg)); + assert(lua_istable(L,-1)); + lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ + assert(lua_gettop(L) == subcall_last_arg); + result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ + if(result != SWIG_ERROR) { + break; + } + } + /* Restore original metatable */ + lua_pushvalue(L,original_metatable); + lua_setmetatable(L,first_arg); + /* Clear - remove everything between last_arg and subcall_last_arg including */ + to_remove = subcall_last_arg - last_arg; + for(j=0;jtype; + result = SWIG_Lua_class_do_get(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + result = SWIG_Lua_class_do_get_item(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + return 0; +} + +/* helper for the class.set method, performs the lookup of class attributes + * It returns error code. Number of function return values is passed inside 'ret' + */ +SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value + */ + + int bases_search_result; + int substack_start = lua_gettop(L) - 3; + lua_checkstack(L,5); + assert(lua_isuserdata(L,substack_start+1)); /* just in case */ + lua_getmetatable(L,substack_start+1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + if(ret) + *ret = 0; /* it is setter - number of return values is always 0 */ + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,substack_start+2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* tidy stack, remove .set table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* userdata */ + lua_pushvalue(L,substack_start+3); /* value */ + lua_call(L,2,0); + lua_remove(L,substack_start+4); /*remove metatable*/ + return SWIG_OK; + } + lua_pop(L,1); /* remove the value */ + } else { + lua_pop(L,1); /* remove the answer for .set table request*/ + } + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_pushvalue(L,substack_start+2); /* the parameter */ + lua_pushvalue(L,substack_start+3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return SWIG_OK; + } + lua_pop(L,1); /* remove value */ + + lua_pop(L,1); /* remove metatable */ + /* Search among bases */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); + if(ret) + assert(*ret == 0); + assert(lua_gettop(L) == substack_start + 3); + return bases_search_result; +} + +/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly + * handles return values. + */ +SWIGINTERN int SWIG_Lua_class_set(lua_State *L) +{ +/* There should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value + */ + int ret = 0; + int result; + swig_lua_userdata *usr; + swig_type_info *type; + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_set(L,type,1,&ret); + if(result != SWIG_OK) { + SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); + lua_error(L); + } else { + assert(ret==0); + } + return 0; +} + +/* the class.destruct method called by the interpreter */ +SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata *usr; + swig_lua_class *clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; +} + +/* the class.__tostring method called by the interpreter and print */ +SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) +{ +/* there should be 1 param passed in + (1) userdata (not the metatable) */ + const char *className; + void* userData; + assert(lua_isuserdata(L,1)); /* just in case */ + userData = lua_touserdata(L,1); /* get the userdata address for later */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + lua_getfield(L, -1, ".type"); + className = lua_tostring(L, -1); + + lua_pushfstring(L, "<%s userdata: %p>", className, userData); + return 1; +} + +/* to manually disown some userdata */ +SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata *usr; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + + usr->own = 0; /* clear our ownership */ + return 0; +} + +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) +{ + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* populate table at the top of the stack with metamethods that ought to be inherited */ +SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_add_boolean(L, "__add", 1); + SWIG_Lua_add_boolean(L, "__sub", 1); + SWIG_Lua_add_boolean(L, "__mul", 1); + SWIG_Lua_add_boolean(L, "__div", 1); + SWIG_Lua_add_boolean(L, "__mod", 1); + SWIG_Lua_add_boolean(L, "__pow", 1); + SWIG_Lua_add_boolean(L, "__unm", 1); + SWIG_Lua_add_boolean(L, "__len", 1 ); + SWIG_Lua_add_boolean(L, "__concat", 1 ); + SWIG_Lua_add_boolean(L, "__eq", 1); + SWIG_Lua_add_boolean(L, "__lt", 1); + SWIG_Lua_add_boolean(L, "__le", 1); + SWIG_Lua_add_boolean(L, "__call", 1); + SWIG_Lua_add_boolean(L, "__tostring", 1); + SWIG_Lua_add_boolean(L, "__gc", 0); +} + +/* creates the swig registry */ +SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) +{ + /* create main SWIG registry table */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + /* populate it with some predefined data */ + + /* .library table. Placeholder */ + lua_pushstring(L,".library"); + lua_newtable(L); + { + /* list of metamethods that class inherits from its bases */ + lua_pushstring(L,"inheritable_metamethods"); + lua_newtable(L); + /* populate with list of metamethods */ + SWIG_Lua_populate_inheritable_metamethods(L); + lua_rawset(L,-3); + } + lua_rawset(L,-3); + + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* gets the swig registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) +{ + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + SWIG_Lua_create_class_registry(L); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } +} + +SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_get_class_registry(L); + lua_pushstring(L, ".library"); + lua_rawget(L,-2); + assert( !lua_isnil(L,-1) ); + lua_pushstring(L, "inheritable_metamethods"); + lua_rawget(L,-2); + + /* Remove class registry and library table */ + lua_remove(L,-2); + lua_remove(L,-2); +} + +/* Helper function to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) +{ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ +} + +/* Set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) +{ + int i=0; + swig_module_info *module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) +/* Merges two tables */ +SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) +{ + /* iterating */ + lua_pushnil(L); + while (lua_next(L,source) != 0) { + /* -1 - value, -2 - index */ + /* have to copy to assign */ + lua_pushvalue(L,-2); /* copy of index */ + lua_pushvalue(L,-2); /* copy of value */ + lua_rawset(L, target); + lua_pop(L,1); + /* only key is left */ + } +} + +/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ +SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) +{ + /* push original[name], then base[name] */ + lua_pushstring(L,name); + lua_rawget(L,original); + int original_table = lua_gettop(L); + lua_pushstring(L,name); + lua_rawget(L,base); + int base_table = lua_gettop(L); + SWIG_Lua_merge_tables_by_index(L, original_table, base_table); + /* clearing stack */ + lua_pop(L,2); +} + +/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ +SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) +{ + /* There is one parameter - original, i.e. 'derived' class metatable */ + assert(lua_istable(L,-1)); + int original = lua_gettop(L); + SWIG_Lua_get_class_metatable(L,base_cls->fqname); + int base = lua_gettop(L); + SWIG_Lua_merge_tables(L, ".fn", original, base ); + SWIG_Lua_merge_tables(L, ".set", original, base ); + SWIG_Lua_merge_tables(L, ".get", original, base ); + lua_pop(L,1); +} + +/* Function squashes all symbols from 'clss' bases into itself */ +SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) +{ + int i; + SWIG_Lua_get_class_metatable(L,clss->fqname); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ + continue; + /* Thing is: all bases are already registered. Thus they have already executed + * this function. So we just need to squash them into us, because their bases + * are already squashed into them. No need for recursion here! + */ + SWIG_Lua_class_squash_base(L, clss->bases[i]); + } + lua_pop(L,1); /*tidy stack*/ +} +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ +/* helper add a variable to a registered class */ +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } +} + +/* helper to recursively add class static details (static attributes, operations and constants) */ +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) +{ + int i = 0; + /* The class namespace table must be on the top of the stack */ + assert(lua_istable(L,-1)); + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_static_details(L,clss->bases[i]); + } + + SWIG_Lua_add_namespace_details(L, clss->cls_static); +} + +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ + +/* helper to recursively add class details (attributes & operations) */ +SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) +{ + int i; + size_t bases_count = 0; + /* Add bases to .bases table */ + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + /* Base class must be already registered */ + assert(lua_istable(L,-1)); + lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ + bases_count++; + } + assert(lua_rawlen(L,-1) == bases_count); + lua_pop(L,1); /* remove .bases table */ + /* add attributes */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + This adds methods from metatable array to metatable. Can mess up garbage + collectind if someone defines __gc method + */ + if(clss->metatable) { + for(i=0;clss->metatable[i].name;i++) { + SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); + } + } + +#if !defined(SWIG_LUA_SQUASH_BASES) + /* Adding metamethods that are defined in base classes. If bases were squashed + * then it is obviously unnecessary + */ + SWIG_Lua_add_class_user_metamethods(L, clss); +#endif +} + +/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed + for the following issue: Lua runtime checks for metamethod existence with rawget function + ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method + search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly + in metatable and not in object). + Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants + are automatically given a special proxy __x that calls the real __x method. + Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, + those changes must be reflected in all descendants. +*/ + +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ + +/* The real function that resolves a metamethod. + * Function searches given class and all it's bases(recursively) for first instance of something that is + * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation + * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the + * answer. + * Returns 1 if found, 0 otherwise. + * clss is class which metatable we will search for method + * metamethod_name_idx is index in L where metamethod name (as string) lies + * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check + * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from + * SWIG_Lua_resolve_metamethod + * */ +SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, + int skip_check) +{ + /* This function is called recursively */ + int result = 0; + int i = 0; + + if (!skip_check) { + SWIG_Lua_get_class_metatable(L, clss->fqname); + lua_pushvalue(L, metamethod_name_idx); + lua_rawget(L,-2); + /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then + * this isn't the function we are looking for :) + * lua_tocfunction will return NULL if not cfunction + */ + if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { + lua_remove(L,-2); /* removing class metatable */ + return 1; + } + lua_pop(L,2); /* remove class metatable and query result */ + } + + /* Forwarding calls to bases */ + for(i=0;clss->bases[i];i++) + { + result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); + if (result) + break; + } + + return result; +} + +/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method + * and calls it */ +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) +{ + int numargs; + int metamethod_name_idx; + const swig_lua_class* clss; + int result; + + lua_checkstack(L,5); + numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ + + /* Get upvalues from closure */ + lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ + metamethod_name_idx = lua_gettop(L); + + lua_pushvalue(L, lua_upvalueindex(2)); + clss = (const swig_lua_class*)(lua_touserdata(L,-1)); + lua_pop(L,1); /* remove lightuserdata with clss from stack */ + + /* Actual work */ + result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); + if (!result) { + SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); + lua_error(L); + return 0; + } + + lua_remove(L,-2); /* remove metamethod key */ + lua_insert(L,1); /* move function to correct position */ + lua_call(L, numargs, LUA_MULTRET); + return lua_gettop(L); /* return all results */ +} + + +/* If given metamethod must be present in given class, then creates appropriate proxy + * Returns 1 if successfully added, 0 if not added because no base class has it, -1 + * if method is defined in the class metatable itself + */ +SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) +{ + int key_index; + int success = 0; + int i = 0; + + /* metamethod name - on the top of the stack */ + assert(lua_isstring(L,-1)); + + key_index = lua_gettop(L); + + /* Check whether method is already defined in metatable */ + lua_pushvalue(L,key_index); /* copy of the key */ + lua_gettable(L,metatable_index); + if( !lua_isnil(L,-1) ) { + lua_pop(L,1); + return -1; + } + lua_pop(L,1); + + /* Iterating over immediate bases */ + for(i=0;clss->bases[i];i++) + { + const swig_lua_class *base = clss->bases[i]; + SWIG_Lua_get_class_metatable(L, base->fqname); + lua_pushvalue(L, key_index); + lua_rawget(L, -2); + if( !lua_isnil(L,-1) ) { + lua_pushvalue(L, key_index); + + /* Add proxy function */ + lua_pushvalue(L, key_index); /* first closure value is function name */ + lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ + lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); + + lua_rawset(L, metatable_index); + success = 1; + } + lua_pop(L,1); /* remove function or nil */ + lua_pop(L,1); /* remove base class metatable */ + + if( success ) + break; + } + + return success; +} + +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) +{ + int metatable_index; + int metamethods_info_index; + int tostring_undefined; + int eq_undefined = 0; + + SWIG_Lua_get_class_metatable(L, clss->fqname); + metatable_index = lua_gettop(L); + SWIG_Lua_get_inheritable_metamethods(L); + assert(lua_istable(L,-1)); + metamethods_info_index = lua_gettop(L); + lua_pushnil(L); /* first key */ + while(lua_next(L, metamethods_info_index) != 0 ) { + /* key at index -2, value at index -1 */ + const int is_inheritable = lua_toboolean(L,-2); + lua_pop(L,1); /* remove value - we don't need it anymore */ + + if(is_inheritable) { /* if metamethod is inheritable */ + SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); + } + } + + lua_pop(L,1); /* remove inheritable metatmethods table */ + + /* Special handling for __tostring method */ + lua_pushstring(L, "__tostring"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + tostring_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( tostring_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_tostring); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + + /* Special handling for __eq method */ + lua_pushstring(L, "__eq"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + eq_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( eq_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_equal); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] + * a __getitem/__setitem method should be defined + */ + lua_pop(L,1); /* pop class metatable */ +} + +/* Register class static methods,attributes etc as well as constructor proxy */ +SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + lua_checkstack(L,5); /* just in case */ + assert(lua_istable(L,-1)); /* just in case */ + assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ + + SWIG_Lua_namespace_register(L,clss->cls_static, 1); + + assert(lua_istable(L,-1)); /* just in case */ + + /* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + { + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,"__call", clss->constructor); + lua_pop(L,1); + } + + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_class_static_details(L, clss); + + /* clear stack */ + lua_pop(L,1); + assert( lua_gettop(L) == begin ); +} + +/* Performs the instance (non-static) class registration process. Metatable for class is created + * and added to the class registry. + */ +SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_newtable(L); /* create the metatable */ +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* If squashing is requested, then merges all bases metatable into this one. + * It would get us all special methods: __getitem, __add etc. + * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away + */ + { + int new_metatable_index = lua_absindex(L,-1); + for(i=0;clss->bases[i];i++) + { + int base_metatable; + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + base_metatable = lua_absindex(L,-1); + SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); + lua_pop(L,1); + } + } + /* And now we will overwrite all incorrectly set data */ +#endif + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->fqname); + lua_rawset(L,-3); + /* add a table called bases */ + lua_pushstring(L,".bases"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + /* add manual disown method */ + SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ + assert(lua_gettop(L) == begin); + +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ + SWIG_Lua_class_squash_bases(L,clss); +#endif + SWIG_Lua_get_class_metatable(L,clss->fqname); + SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ + assert( lua_gettop(L) == begin ); +} + +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) +{ + int SWIGUNUSED begin; + assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ + SWIG_Lua_class_register_instance(L,clss); + SWIG_Lua_class_register_static(L,clss); + + /* Add links from static part to instance part and vice versa */ + /* [SWIG registry] [Module] + * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] + * ".get" ----> ... | | getmetatable()----| + * ".set" ----> ... | | | + * ".static" --------------)----------------/ [static part metatable] + * | ".get" --> ... + * | ".set" --> .... + * |=============================== ".instance" + */ + begin = lua_gettop(L); + lua_pushstring(L,clss->cls_static->name); + lua_rawget(L,-2); /* get class static table */ + assert(lua_istable(L,-1)); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* get class static metatable */ + lua_pushstring(L,".instance"); /* prepare key */ + + SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ + assert(lua_istable(L,-1)); + lua_pushstring(L,".static"); /* prepare key */ + lua_pushvalue(L, -4); /* push static class TABLE */ + assert(lua_istable(L,-1)); + lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ + lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ + lua_pop(L,2); + assert(lua_gettop(L) == begin); +} +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + assert(clss->metatable); + lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ + lua_rawset(L,-3); + lua_pop(L,1); + assert(lua_gettop(L) == begin); +} +#endif /* elua && eluac */ + +/* ----------------------------------------------------------------------------- + * Class/structure conversion fns + * ----------------------------------------------------------------------------- */ + +/* helper to add metatable to new lua object */ +SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) +{ + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } +} + +/* pushes a new object into the lua stack */ +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) +{ + swig_lua_userdata *usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + SWIG_Lua_AddMetatable(L,type); /* add metatable */ +#endif +} + +/* takes a object from the lua stack & converts it into an object of the correct type + (if possible) */ +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) +{ + swig_lua_userdata *usr; + swig_cast_info *cast; + if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ + { + usr->own=0; + } + if (!type) /* special cast void*, no casting fn */ + { + *ptr=usr->ptr; + return SWIG_OK; /* ok */ + } + cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ + if (cast) + { + int newmemory = 0; + *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + return SWIG_OK; /* ok */ + } + } + return SWIG_ERROR; /* error */ +} + +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, + int argnum,const char *func_name){ + void *result; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ + luaL_error (L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + } + return result; +} + +/* pushes a packed userdata. user for member fn pointers only */ +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata *raw; + assert(ptr); /* not acceptable to pass in a NULL value */ + raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ + raw->type=type; + raw->own=0; + memcpy(raw->data,ptr,size); /* copy the data */ + SWIG_Lua_AddMetatable(L,type); /* add metatable */ +} + +/* converts a packed userdata. user for member fn pointers only */ +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata *raw; + raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ + if (!raw) return SWIG_ERROR; /* error */ + if (type==0 || type==raw->type) /* void* or identical type */ + { + memcpy(ptr,raw->data,size); /* copy it */ + return SWIG_OK; /* ok */ + } + return SWIG_ERROR; /* error */ +} + +/* a function to get the typestring of a piece of data */ +SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) +{ + swig_lua_userdata *usr; + if (lua_isuserdata(L,tp)) + { + usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ + if (usr && usr->type && usr->type->str) + return usr->type->str; + return "userdata (unknown type)"; + } + return lua_typename(L,lua_type(L,tp)); +} + +/* lua callable function to get the userdata's type */ +SWIGRUNTIME int SWIG_Lua_type(lua_State *L) +{ + lua_pushstring(L,SWIG_Lua_typename(L,1)); + return 1; +} + +/* ----------------------------------------------------------------------------- + * global variable support code: class/struct typemap functions + * ----------------------------------------------------------------------------- */ + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* Install Constants */ +SWIGINTERN void +SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { + int i; + for (i = 0; constants[i].type; i++) { + switch(constants[i].type) { + case SWIG_LUA_INT: + lua_pushstring(L,constants[i].name); + lua_pushinteger(L,(lua_Number)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_FLOAT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].dvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_CHAR: + lua_pushstring(L,constants[i].name); + { + char c = constants[i].lvalue; + lua_pushlstring(L,&c,1); + } + lua_rawset(L,-3); + break; + case SWIG_LUA_STRING: + lua_pushstring(L,constants[i].name); + lua_pushstring(L,(char *) constants[i].pvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_POINTER: + lua_pushstring(L,constants[i].name); + SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); + lua_rawset(L,-3); + break; + case SWIG_LUA_BINARY: + lua_pushstring(L,constants[i].name); + SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); + lua_rawset(L,-3); + break; + default: + break; + } + } +} +#endif + +/* ----------------------------------------------------------------------------- + * executing lua code from within the wrapper + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ +#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) +#endif +/* Executes a C string in Lua which is a really simple way of calling lua from C +Unfortunately lua keeps changing its APIs, so we need a conditional compile +In lua 5.0.X it's lua_dostring() +In lua 5.1.X it's luaL_dostring() +*/ +SWIGINTERN int +SWIG_Lua_dostring(lua_State *L, const char *str) { + int ok,top; + if (str==0 || str[0]==0) return 0; /* nothing to do */ + top=lua_gettop(L); /* save stack */ +#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) + ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ +#else + ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ +#endif + if (ok!=0) { + SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); + } + lua_settop(L,top); /* restore the stack */ + return ok; +} + +#ifdef __cplusplus +} +#endif + +/* ------------------------------ end luarun.swg ------------------------------ */ + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_Data swig_types[0] +#define SWIGTYPE_p_bool swig_types[1] +#define SWIGTYPE_p_namelist_t swig_types[2] +#define SWIGTYPE_p_params_t swig_types[3] +#define SWIGTYPE_p_std__listT_Data_t swig_types[4] +#define SWIGTYPE_p_std__multimapT_std__string_Data_t swig_types[5] +#define SWIGTYPE_p_std__string swig_types[6] +#define SWIGTYPE_p_uscxml__ErrorEvent swig_types[7] +#define SWIGTYPE_p_uscxml__Event swig_types[8] +static swig_type_info *swig_types[10]; +static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_name "LuaDOM" +#define SWIG_init luaopen_LuaDOM +#define SWIG_init_user luaopen_LuaDOM_user + +#define SWIG_LUACODE luaopen_LuaDOM_luacode + +namespace swig { +typedef struct{} LANGUAGE_OBJ; +} + + +#include + + +SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { + int ret = lua_isstring(L, idx); + if (!ret) + ret = lua_isnil(L, idx); + return ret; +} + + +using uscxml::Data; + +#ifdef __cplusplus +extern "C" { +#endif +static int _wrap_new_string__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + std::string *result = 0 ; + + SWIG_check_num_args("std::string::string",0,0) + result = (std::string *)new std::string(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + char *arg1 = (char *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("std::string::string",1,1) + if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("std::string::string",1,"char const *"); + arg1 = (char *)lua_tostring(L, 1); + result = (std::string *)new std::string((char const *)arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_string__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = SWIG_lua_isnilstring(L,argv[0]); + } + if (_v) { + return _wrap_new_string__SWIG_1(L); + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_string'\n" + " Possible C/C++ prototypes are:\n" + " std::string::string()\n" + " std::string::string(char const *)\n"); + lua_error(L);return 0; +} + + +static int _wrap_string_size(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("std::string::size",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::size",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->size(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_length(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("std::string::length",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::length",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->length(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_empty(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + bool result; + + SWIG_check_num_args("std::string::empty",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::empty",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); + } + + result = (bool)((std::string const *)arg1)->empty(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_c_str(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("std::string::c_str",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::c_str",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->c_str(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_data(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("std::string::data",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::data",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->data(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_assign(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *arg2 = (char *) 0 ; + + SWIG_check_num_args("std::string::assign",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::assign",1,"std::string *"); + if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("std::string::assign",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); + } + + arg2 = (char *)lua_tostring(L, 2); + (arg1)->assign((char const *)arg2); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_string(void *obj) { +std::string *arg1 = (std::string *) obj; +delete arg1; +} +static int _proxy__wrap_new_string(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_string); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_string_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_string_methods[]= { + { "size", _wrap_string_size}, + { "length", _wrap_string_length}, + { "empty", _wrap_string_empty}, + { "c_str", _wrap_string_c_str}, + { "data", _wrap_string_data}, + { "assign", _wrap_string_assign}, + {0,0} +}; +static swig_lua_method swig_string_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_string_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_string_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_string_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_string_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_string_Sf_SwigStatic = { + "string", + swig_string_Sf_SwigStatic_methods, + swig_string_Sf_SwigStatic_attributes, + swig_string_Sf_SwigStatic_constants, + swig_string_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_string_bases[] = {0}; +static const char *swig_string_base_names[] = {0}; +static swig_lua_class _wrap_class_string = { "string", "string", &SWIGTYPE_p_std__string,_proxy__wrap_new_string, swig_delete_string, swig_string_methods, swig_string_attributes, &swig_string_Sf_SwigStatic, swig_string_meta, swig_string_bases, swig_string_base_names }; + +static int _wrap_new_Event__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *result = 0 ; + + SWIG_check_num_args("uscxml::Event::Event",0,0) + result = (uscxml::Event *)new uscxml::Event(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Event__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = 0 ; + uscxml::Event::Type arg2 ; + std::string temp1 ; + uscxml::Event *result = 0 ; + + SWIG_check_num_args("uscxml::Event::Event",2,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("uscxml::Event::Event",1,"std::string const &"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("uscxml::Event::Event",2,"uscxml::Event::Type"); + temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1; + arg2 = (uscxml::Event::Type)(int)lua_tonumber(L, 2); + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1,arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Event__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = 0 ; + std::string temp1 ; + uscxml::Event *result = 0 ; + + SWIG_check_num_args("uscxml::Event::Event",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("uscxml::Event::Event",1,"std::string const &"); + temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1; + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Event(lua_State* L) { + int argc; + int argv[3]={ + 1,2,3 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Event__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + return _wrap_new_Event__SWIG_2(L); + } + } + if (argc == 2) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_new_Event__SWIG_1(L); + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Event'\n" + " Possible C/C++ prototypes are:\n" + " uscxml::Event::Event()\n" + " uscxml::Event::Event(std::string const &,uscxml::Event::Type)\n" + " uscxml::Event::Event(std::string const &)\n"); + lua_error(L);return 0; +} + + +static int _wrap_Event_fromData(lua_State* L) { + int SWIG_arg = 0; + Data *arg1 = 0 ; + uscxml::Event result; + + SWIG_check_num_args("uscxml::Event::fromData",1,1) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::fromData",1,"Data const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Data,0))){ + SWIG_fail_ptr("Event_fromData",1,SWIGTYPE_p_Data); + } + + result = uscxml::Event::fromData((Data const &)*arg1); + { + uscxml::Event * resultptr = new uscxml::Event((const uscxml::Event &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event___lt(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + bool result; + + SWIG_check_num_args("uscxml::Event::operator <",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::operator <",1,"uscxml::Event const *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("uscxml::Event::operator <",2,"uscxml::Event const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___lt",1,SWIGTYPE_p_uscxml__Event); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___lt",2,SWIGTYPE_p_uscxml__Event); + } + + result = (bool)((uscxml::Event const *)arg1)->operator <((uscxml::Event const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event___eq(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + bool result; + + SWIG_check_num_args("uscxml::Event::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::operator ==",1,"uscxml::Event const *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("uscxml::Event::operator ==",2,"uscxml::Event const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___eq",1,SWIGTYPE_p_uscxml__Event); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___eq",2,SWIGTYPE_p_uscxml__Event); + } + + result = (bool)((uscxml::Event const *)arg1)->operator ==((uscxml::Event const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + Data *arg3 = 0 ; + std::string temp2 ; + bool result; + + SWIG_check_num_args("uscxml::Event::getParam",3,3) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::getParam",1,"uscxml::Event::params_t const &"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::getParam",2,"std::string const &"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("uscxml::Event::getParam",3,"Data &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__multimapT_std__string_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",1,SWIGTYPE_p_std__multimapT_std__string_Data_t); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Data,0))){ + SWIG_fail_ptr("Event_getParam",3,SWIGTYPE_p_Data); + } + + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + std::list< Data > *arg3 = 0 ; + std::string temp2 ; + bool result; + + SWIG_check_num_args("uscxml::Event::getParam",3,3) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::getParam",1,"uscxml::Event::params_t const &"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::getParam",2,"std::string const &"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("uscxml::Event::getParam",3,"std::list< Data > &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__multimapT_std__string_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",1,SWIGTYPE_p_std__multimapT_std__string_Data_t); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__listT_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",3,SWIGTYPE_p_std__listT_Data_t); + } + + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam__SWIG_3(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + bool *arg3 = 0 ; + std::string temp2 ; + bool result; + + SWIG_check_num_args("uscxml::Event::getParam",3,3) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::getParam",1,"uscxml::Event::params_t const &"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::getParam",2,"std::string const &"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("uscxml::Event::getParam",3,"bool &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__multimapT_std__string_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",1,SWIGTYPE_p_std__multimapT_std__string_Data_t); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_bool,0))){ + SWIG_fail_ptr("Event_getParam",3,SWIGTYPE_p_bool); + } + + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 3) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isstring(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Data, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_Event_getParam__SWIG_0(L); + } + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isstring(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_std__listT_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_Event_getParam__SWIG_1(L); + } + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isstring(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_bool, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_Event_getParam__SWIG_3(L); + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Event_getParam'\n" + " Possible C/C++ prototypes are:\n" + " uscxml::Event::getParam(uscxml::Event::params_t const &,std::string const &,Data &)\n" + " uscxml::Event::getParam(uscxml::Event::params_t const &,std::string const &,std::list< Data > &)\n" + " uscxml::Event::getParam(uscxml::Event::params_t const &,std::string const &,bool &)\n"); + lua_error(L);return 0; +} + + +static int _wrap_Event_getUUID(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("uscxml::Event::getUUID",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::getUUID",1,"uscxml::Event const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_getUUID",1,SWIGTYPE_p_uscxml__Event); + } + + result = (std::string *) &((uscxml::Event const *)arg1)->getUUID(); + lua_pushlstring(L,result->data(),result->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_raw_set(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + std::string temp2 ; + + SWIG_check_num_args("uscxml::Event::raw",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::raw",1,"uscxml::Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::raw",2,"std::string const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_raw_set",1,SWIGTYPE_p_uscxml__Event); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + if (arg1) (arg1)->raw = *arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_raw_get(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("uscxml::Event::raw",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::raw",1,"uscxml::Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_raw_get",1,SWIGTYPE_p_uscxml__Event); + } + + result = (std::string *) & ((arg1)->raw); + lua_pushlstring(L,result->data(),result->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_name_set(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + std::string temp2 ; + + SWIG_check_num_args("uscxml::Event::name",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::name",1,"uscxml::Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::name",2,"std::string const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_name_set",1,SWIGTYPE_p_uscxml__Event); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + if (arg1) (arg1)->name = *arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_name_get(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("uscxml::Event::name",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::name",1,"uscxml::Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_name_get",1,SWIGTYPE_p_uscxml__Event); + } + + result = (std::string *) & ((arg1)->name); + lua_pushlstring(L,result->data(),result->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_eventType_set(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event::Type arg2 ; + + SWIG_check_num_args("uscxml::Event::eventType",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::eventType",1,"uscxml::Event *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("uscxml::Event::eventType",2,"uscxml::Event::Type"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_eventType_set",1,SWIGTYPE_p_uscxml__Event); + } + + arg2 = (uscxml::Event::Type)(int)lua_tonumber(L, 2); + if (arg1) (arg1)->eventType = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_eventType_get(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event::Type result; + + SWIG_check_num_args("uscxml::Event::eventType",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::eventType",1,"uscxml::Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_eventType_get",1,SWIGTYPE_p_uscxml__Event); + } + + result = (uscxml::Event::Type) ((arg1)->eventType); + lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Event(void *obj) { +uscxml::Event *arg1 = (uscxml::Event *) obj; +delete arg1; +} +static int _proxy__wrap_new_Event(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_Event); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_Event_attributes[] = { + { "raw", _wrap_Event_raw_get, _wrap_Event_raw_set }, + { "name", _wrap_Event_name_get, _wrap_Event_name_set }, + { "eventType", _wrap_Event_eventType_get, _wrap_Event_eventType_set }, + {0,0,0} +}; +static swig_lua_method swig_Event_methods[]= { + { "__lt", _wrap_Event___lt}, + { "__eq", _wrap_Event___eq}, + { "getUUID", _wrap_Event_getUUID}, + {0,0} +}; +static swig_lua_method swig_Event_meta[] = { + { "__lt", _wrap_Event___lt}, + { "__eq", _wrap_Event___eq}, + {0,0} +}; + +static swig_lua_attribute swig_Event_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_Event_Sf_SwigStatic_constants[]= { + {SWIG_LUA_CONSTTAB_INT("INTERNAL", uscxml::Event::INTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("EXTERNAL", uscxml::Event::EXTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("PLATFORM", uscxml::Event::PLATFORM)}, + {0,0,0,0,0,0} +}; +static swig_lua_method swig_Event_Sf_SwigStatic_methods[]= { + { "fromData", _wrap_Event_fromData}, + { "getParam", _wrap_Event_getParam}, + {0,0} +}; +static swig_lua_class* swig_Event_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_Event_Sf_SwigStatic = { + "Event", + swig_Event_Sf_SwigStatic_methods, + swig_Event_Sf_SwigStatic_attributes, + swig_Event_Sf_SwigStatic_constants, + swig_Event_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_Event_bases[] = {0}; +static const char *swig_Event_base_names[] = {0}; +static swig_lua_class _wrap_class_Event = { "Event", "Event", &SWIGTYPE_p_uscxml__Event,_proxy__wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, &swig_Event_Sf_SwigStatic, swig_Event_meta, swig_Event_bases, swig_Event_base_names }; + +static int _wrap_new_ErrorEvent__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + uscxml::ErrorEvent *result = 0 ; + + SWIG_check_num_args("uscxml::ErrorEvent::ErrorEvent",0,0) + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__ErrorEvent,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_ErrorEvent__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = 0 ; + std::string temp1 ; + uscxml::ErrorEvent *result = 0 ; + + SWIG_check_num_args("uscxml::ErrorEvent::ErrorEvent",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("uscxml::ErrorEvent::ErrorEvent",1,"std::string const &"); + temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1; + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent((std::string const &)*arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__ErrorEvent,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_ErrorEvent(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_ErrorEvent__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + return _wrap_new_ErrorEvent__SWIG_1(L); + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_ErrorEvent'\n" + " Possible C/C++ prototypes are:\n" + " uscxml::ErrorEvent::ErrorEvent()\n" + " uscxml::ErrorEvent::ErrorEvent(std::string const &)\n"); + lua_error(L);return 0; +} + + +static void swig_delete_ErrorEvent(void *obj) { +uscxml::ErrorEvent *arg1 = (uscxml::ErrorEvent *) obj; +delete arg1; +} +static int _proxy__wrap_new_ErrorEvent(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_ErrorEvent); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_ErrorEvent_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_ErrorEvent_methods[]= { + {0,0} +}; +static swig_lua_method swig_ErrorEvent_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_ErrorEvent_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_ErrorEvent_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_ErrorEvent_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_ErrorEvent_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_ErrorEvent_Sf_SwigStatic = { + "ErrorEvent", + swig_ErrorEvent_Sf_SwigStatic_methods, + swig_ErrorEvent_Sf_SwigStatic_attributes, + swig_ErrorEvent_Sf_SwigStatic_constants, + swig_ErrorEvent_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_ErrorEvent_bases[] = {0,0}; +static const char *swig_ErrorEvent_base_names[] = {"uscxml::Event *",0}; +static swig_lua_class _wrap_class_ErrorEvent = { "ErrorEvent", "ErrorEvent", &SWIGTYPE_p_uscxml__ErrorEvent,_proxy__wrap_new_ErrorEvent, swig_delete_ErrorEvent, swig_ErrorEvent_methods, swig_ErrorEvent_attributes, &swig_ErrorEvent_Sf_SwigStatic, swig_ErrorEvent_meta, swig_ErrorEvent_bases, swig_ErrorEvent_base_names }; + +static swig_lua_attribute swig_SwigModule_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_SwigModule_constants[]= { + {SWIG_LUA_CONSTTAB_INT("XERCES_HAS_CPP_NAMESPACE", 1)}, + {SWIG_LUA_CONSTTAB_INT("Event_INTERNAL", uscxml::Event::INTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("Event_EXTERNAL", uscxml::Event::EXTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("Event_PLATFORM", uscxml::Event::PLATFORM)}, + {0,0,0,0,0,0} +}; +static swig_lua_method swig_SwigModule_methods[]= { + { "Event_fromData", _wrap_Event_fromData}, + { "Event_getParam", _wrap_Event_getParam}, + {0,0} +}; +static swig_lua_class* swig_SwigModule_classes[]= { +&_wrap_class_string, +&_wrap_class_Event, +&_wrap_class_ErrorEvent, + 0 +}; +static swig_lua_namespace* swig_SwigModule_namespaces[] = { + 0 +}; + +static swig_lua_namespace swig_SwigModule = { + "LuaDOM", + swig_SwigModule_methods, + swig_SwigModule_attributes, + swig_SwigModule_constants, + swig_SwigModule_classes, + swig_SwigModule_namespaces +}; +#ifdef __cplusplus +} +#endif + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_uscxml__ErrorEventTo_p_uscxml__Event(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((uscxml::Event *) ((uscxml::ErrorEvent *) x)); +} +static swig_type_info _swigt__p_Data = {"_p_Data", "Data *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_bool = {"_p_bool", "bool *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_namelist_t = {"_p_namelist_t", "namelist_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_params_t = {"_p_params_t", "params_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__listT_Data_t = {"_p_std__listT_Data_t", "std::list< Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__multimapT_std__string_Data_t = {"_p_std__multimapT_std__string_Data_t", "uscxml::Event::params_t *|std::multimap< std::string,Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_string, 0}; +static swig_type_info _swigt__p_uscxml__ErrorEvent = {"_p_uscxml__ErrorEvent", "uscxml::ErrorEvent *", 0, 0, (void*)&_wrap_class_ErrorEvent, 0}; +static swig_type_info _swigt__p_uscxml__Event = {"_p_uscxml__Event", "uscxml::Event *", 0, 0, (void*)&_wrap_class_Event, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_Data, + &_swigt__p_bool, + &_swigt__p_namelist_t, + &_swigt__p_params_t, + &_swigt__p_std__listT_Data_t, + &_swigt__p_std__multimapT_std__string_Data_t, + &_swigt__p_std__string, + &_swigt__p_uscxml__ErrorEvent, + &_swigt__p_uscxml__Event, +}; + +static swig_cast_info _swigc__p_Data[] = { {&_swigt__p_Data, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_bool[] = { {&_swigt__p_bool, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_namelist_t[] = { {&_swigt__p_namelist_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_params_t[] = { {&_swigt__p_params_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__listT_Data_t[] = { {&_swigt__p_std__listT_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__multimapT_std__string_Data_t[] = { {&_swigt__p_std__multimapT_std__string_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__ErrorEvent[] = { {&_swigt__p_uscxml__ErrorEvent, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__Event[] = { {&_swigt__p_uscxml__Event, 0, 0, 0}, {&_swigt__p_uscxml__ErrorEvent, _p_uscxml__ErrorEventTo_p_uscxml__Event, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_Data, + _swigc__p_bool, + _swigc__p_namelist_t, + _swigc__p_params_t, + _swigc__p_std__listT_Data_t, + _swigc__p_std__multimapT_std__string_Data_t, + _swigc__p_std__string, + _swigc__p_uscxml__ErrorEvent, + _swigc__p_uscxml__Event, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ /* c-mode */ +#endif +} +#endif + + + +/* Forward declaration of where the user's %init{} gets inserted */ +void SWIG_init_user(lua_State* L ); + +#ifdef __cplusplus +extern "C" { +#endif +/* this is the initialization function + added at the very end of the code + the function is always called SWIG_init, but an earlier #define will rename it +*/ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) +LUALIB_API int SWIG_init(lua_State* L) +#else +SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ +#endif +{ +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ + int i; + int globalRegister = 0; + /* start with global table */ + lua_pushglobaltable (L); + /* SWIG's internal initialisation */ + SWIG_InitializeModule((void*)L); + SWIG_PropagateClientData(); +#endif + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) + /* add a global fn */ + SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* set up base class pointers (the hierarchy) */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } +#ifdef SWIG_LUA_MODULE_GLOBAL + globalRegister = 1; +#endif + + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } +#endif + +#if defined(SWIG_LUA_ELUA_EMULATE) + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); + SWIG_Lua_elua_emulate_register_clear(L); + if(globalRegister) { + lua_pushstring(L,swig_SwigModule.name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); + } +#endif + +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* invoke user-specific initialization */ + SWIG_init_user(L); + /* end module */ + /* Note: We do not clean up the stack here (Lua will do this for us). At this + point, we have the globals table and out module table on the stack. Returning + one value makes the module table the result of the require command. */ + return 1; +#else + return 0; +#endif +} + +#ifdef __cplusplus +} +#endif + + +const char* SWIG_LUACODE= + ""; + +void SWIG_init_user(lua_State* L) +{ + /* exec Lua code if applicable */ + SWIG_Lua_dostring(L,SWIG_LUACODE); +} + diff --git a/src/uscxml/plugins/datamodel/lua/bindings.i b/src/uscxml/plugins/datamodel/lua/bindings.i index 73bc9f9..08dfc84 100644 --- a/src/uscxml/plugins/datamodel/lua/bindings.i +++ b/src/uscxml/plugins/datamodel/lua/bindings.i @@ -2,6 +2,13 @@ %include +/* + +swig -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include/ -lua -c++ uscxml.i +gcc -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include/ ./uscxml_wrap.cxx + +*/ + %module LuaDOM %import "uscxml/config.h" @@ -15,6 +22,8 @@ %include "../common/bindings/dom/defines.i" %include "../common/bindings/dom/typemaps-general.i" +// todo: read about string encoding in lua +#if 0 // in typemap %typemap(in) XMLCh * %{ $1 = Lua2XMLString($input); @@ -28,6 +37,7 @@ %typemap(out) XMLCh * %{ $result = XMLString2Lua($1); %} +#endif %include "../common/bindings/dom/dom.i" #endif diff --git a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp index 0518a0e..9f4f22f 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp @@ -413,10 +413,10 @@ void PromelaDataModel::setEvent(const Event& event) { if (isNumeric(d.atom.c_str(), 10)) { return Data(d.atom, Data::VERBATIM); } - return Data(d.asJSON(), Data::VERBATIM); - if (d.type == Data::INTERPRETED && d.atom[0] == '\'' && d.atom[d.atom.size() - 1] == '\'') - return Data(d.atom.substr(1, d.atom.size() - 2), Data::VERBATIM); return d; +// if (d.type == Data::INTERPRETED && d.atom[0] == '\'' && d.atom[d.atom.size() - 1] == '\'') +// return Data(d.atom.substr(1, d.atom.size() - 2), Data::VERBATIM); +// return d; } case PML_VAR_ARRAY: case PML_CMPND: @@ -707,7 +707,8 @@ void PromelaDataModel::setEvent(const Event& event) { void PromelaDataModel::assign(const std::string& location, const Data& data, const std::map& attr) { PromelaParser parser(location); if (data.atom.size() > 0 && data.type == Data::INTERPRETED) { - setVariable(parser.ast, evalAsData(data.atom)); + // e.g. Var1 = Var1 + 1 + setVariable(parser.ast, evalAsData(data.atom)); } else { setVariable(parser.ast, data); } -- cgit v0.12