diff --git a/swig/interfaces/DOM.i b/swig/interfaces/DOM.i deleted file mode 100644 index 0a5e02944075a4b84c0fd6ab0f7a2c4551faf549..0000000000000000000000000000000000000000 --- a/swig/interfaces/DOM.i +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * All DOM classes and their related SWIG alterations go in this interface file - */ - -/* - * the DOM classes gets a special exception handler - * 'goto fail' must be called - either explicitly, or via SWIG_croak() - * to ensure that any variable cleanup is done - to avoid memory leaks. - * By making these macros, it reduces the code *file* size dramatically - * (but doesn't reduce the compiled file size at all...) - */ -%{ -#define CATCH_DOM_EXCEPTION \ - catch (const XMLException& e) \ - { \ - makeXMLException(e); \ - goto fail; \ - } \ - catch (const DOMException& e) \ - { \ - makeDOMException(e); \ - goto fail; \ - } \ - catch (...) \ - { \ - SWIG_croak("Handling Unknown exception"); \ - goto fail; \ - } -%} - -%exception { - try - { - $action - } - CATCH_DOM_EXCEPTION -} - -// Introduced in DOM Level 1 -%include "dom/DOMException.i" -%include "dom/DOMNode.i" -%include "dom/DOMAttr.i" -%include "dom/DOMElement.i" -%include "dom/DOMEntity.i" -%include "dom/DOMDocumentType.i" -%include "dom/DOMCharacterData.i" -%include "dom/DOMComment.i" -%include "dom/DOMText.i" -%include "dom/DOMCDATASection.i" -%include "dom/DOMNodeList.i" -%include "dom/DOMNamedNodeMap.i" -%include "dom/DOMDocumentFragment.i" -%include "dom/DOMEntityReference.i" -%include "dom/DOMNotation.i" -%include "dom/DOMProcessingInstruction.i" - -// type info -%include "dom/DOMTypeInfo.i" -%include "dom/DOMPSVITypeInfo.i" - -// XPath -%include "dom/DOMXPathEvaluator.i" -%include "dom/DOMXPathException.i" -%include "dom/DOMXPathExpression.i" -%include "dom/DOMXPathNamespace.i" -%include "dom/DOMXPathNSResolver.i" -%include "dom/DOMXPathResult.i" - -// Introduced in DOM Level 2 -%include "dom/DOMDocumentRange.i" -%include "dom/DOMDocumentTraversal.i" -%include "dom/DOMNodeIterator.i" -%include "dom/DOMNodeFilter.i" -%include "dom/DOMRange.i" -%include "dom/DOMRangeException.i" -%include "dom/DOMTreeWalker.i" - -/* - * Introduced in DOM Level 3 - */ -%include "dom/DOMUserDataHandler.i" -%include "dom/DOMConfiguration.i" -%include "dom/DOMStringList.i" -%include "dom/DOMImplementationLS.i" -%include "dom/DOMImplementation.i" -%include "dom/DOMImplementationList.i" -%include "dom/DOMImplementationSource.i" -%include "dom/DOMImplementationRegistry.i" - -%include "dom/DOMError.i" -%include "dom/DOMErrorHandler.i" -%include "dom/DOMDocument.i" -%include "dom/DOMLocator.i" -%include "dom/DOMLSResourceResolver.i" - -// DOMLSParser -%include "dom/DOMLSInput.i" -%include "framework/Wrapper4InputSource.i" -%include "framework/Wrapper4DOMLSInput.i" -%import "dom/DOMLSParserFilter.i" -%include "dom/DOMLSParser.i" - -// DOMWriter -%include "dom/DOMLSOutput.i" -%include "framework/XMLFormatter.i" -%include "framework/StdOutFormatTarget.i" -%include "framework/LocalFileFormatTarget.i" -%include "framework/MemBufFormatTarget.i" - -%include "dom/DOMLSException.i" -%include "dom/DOMLSSerializer.i" -%include "dom/DOMLSSerializerFilter.i" diff --git a/swig/interfaces/Perl/transcode.i b/swig/interfaces/Perl/transcode.i deleted file mode 100644 index c152c88f782302ab34199c430330744ca2832d6b..0000000000000000000000000000000000000000 --- a/swig/interfaces/Perl/transcode.i +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Perl/transcode.i - maps Xerces-C UTF16 chars to Perl's UTF8 chars - * - */ - -%{ - -SV* -XMLString2Perl(const XMLCh* input) { - SV *output; - unsigned int charsEaten = 0; - int length = XMLString::stringLen(input); // string length - // use +1 to make room for the '\0' at the end of the string - // in the pathological case when each character of the string - // is UTF8_MAXLEN bytes long - XMLByte* res = new XMLByte[(length * UTF8_MAXLEN) + 1]; // output string - - unsigned int total_chars = - UTF8_TRANSCODER->transcodeTo((const XMLCh*) input, - (unsigned int) length, - (XMLByte*) res, - (unsigned int) (length*UTF8_MAXLEN), - charsEaten, - XMLTranscoder::UnRep_Throw - ); - res[total_chars] = '\0'; - -#if (0) - if (DEBUG_UTF8_OUT) { - printf("Xerces out length = %d: ",total_chars); - for (int i=0;i<length;i++){ - printf("<0x%.4X>",res[i]); - } - printf("\n"); - } -#endif - - output = sv_newmortal(); - sv_setpv((SV*)output, (char *)res ); - SvUTF8_on((SV*)output); - delete[] res; - return output; -} - -XMLCh* -Perl2XMLString(SV* input){ - XMLCh* output; - - STRLEN length; - char *ptr = (char *)SvPVutf8(input,length); - -#if (0) - if (DEBUG_UTF8_IN) { - printf("Perl in length = %d: ",length); - for (unsigned int i=0;i<length;i++){ - printf("<0x%.4X>",ptr[i]); - } - printf("\n"); - } -#endif - - if (SvUTF8(input)) { - unsigned int charsEaten = 0; - unsigned char* sizes = new unsigned char[length+1]; - output = new XMLCh[length+1]; - unsigned int chars_stored = - UTF8_TRANSCODER->transcodeFrom((const XMLByte*) ptr, - (unsigned int) length, - (XMLCh*) output, - (unsigned int) length, - charsEaten, - (unsigned char*)sizes - ); - delete [] sizes; - -#if (0) - if (DEBUG_UTF8_IN) { - printf("Xerces in length = %d: ",chars_stored); - for (unsigned int i=0;i<chars_stored;i++){ - printf("<0x%.4X>",output[i]); - } - printf("\n"); - } -#endif - - // indicate the end of the string - output[chars_stored] = '\0'; - } else { - output = XMLString::transcode(ptr); - -#if (0) - if (DEBUG_UTF8_IN) { - printf("Xerces: "); - for (int i=0;output[i];i++){ - printf("<0x%.4X>",output[i]); - } - printf("\n"); - } -#endif - - } - return(output); -} - -%} \ No newline at end of file diff --git a/swig/interfaces/typemaps-xmlch.i b/swig/interfaces/typemaps-xmlch.i deleted file mode 100644 index abe1134f0441bbff32794f51a9629048071273b2..0000000000000000000000000000000000000000 --- a/swig/interfaces/typemaps-xmlch.i +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/***********/ -/* */ -/* XMLCh * */ -/* */ -/***********/ - -/************************************************************************/ -/* */ -/* FOR FUNCTIONS TAKING XMLCh * (I.E AN XMLCh STRING) AS AN ARGUMENT -- */ -/* NOW YOU CAN JUST SUPPLY A STRING. THIS TYPEMAP CONVERTS */ -/* PERL-STRINGS TO XMLCh STRINGS AUTOMATICALLY */ -/* */ -/************************************************************************/ - -/************************************************************************/ -/* */ -/* CAVEAT: */ -/* TO CONVERT STRINGS TO XMLCh STRINGS, A TEMPORARY POINTER MUST BE */ -/* CREATED IN THE in TYPEMAP TO POINT TO MEMORY THAT HOLDS THE */ -/* CONVERSION. THE MEMORY IS DYNAMIC, SO IT MUST BE FREED AFTER THE C */ -/* FUNCTION THAT USES IT IS CALLED. THIS IS DONE VIA A "freearg" */ -/* TYPEMAP. */ -/* */ -/************************************************************************/ - -// in typemap -%typemap(in) XMLCh * %{ - if ($input == &PL_sv_undef) { - SWIG_Perl_NullRef("perl-string",$argnum,"$symname"); - goto fail; - } else { - // we convert *everything* into a string that isn't undef - $1 = Perl2XMLString($input); - } -%} - -%typemap(freearg) XMLCh * %{ - delete[] $1; -%} - -// out typemap -%typemap(out) XMLCh * %{ - $result = XMLString2Perl($1); - ++argvi; -%} -