diff options
Diffstat (limited to 'xmlsecurity/source/xmlsec')
6 files changed, 25 insertions, 19 deletions
diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx index ac9b72511458..3cbe0ac1142e 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.cxx +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -29,8 +29,9 @@ #include <comphelper/windowserrorstring.hxx> #endif -extern "C" -void errorCallback(const char* file, +extern "C" { + +static void errorCallback(const char* file, int line, const char* func, const char* errorObject, @@ -50,6 +51,8 @@ void errorCallback(const char* file, SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'" << systemErrorString); } +} + XSECXMLSEC_DLLPUBLIC void setErrorRecorder() { xmlSecErrorsSetCallback(errorCallback); diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 3fb94bd256c5..e79e3db09e9a 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -54,8 +54,11 @@ using namespace com::sun::star; #define ROOT_CERTS "Root Certs for OpenOffice.org" -extern "C" void nsscrypto_finalize(); +extern "C" { +static void nsscrypto_finalize(); + +} namespace { diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 7ccc70c85955..5fd173689ba9 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -57,8 +57,8 @@ using ::com::sun::star::lang::XSingleServiceFactory ; using ::com::sun::star::xml::crypto::XSecurityEnvironment ; using ::com::sun::star::security::XCertificate ; -extern X509Certificate_NssImpl* NssCertToXCert( CERTCertificate* cert ) ; -extern X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* ) ; +static X509Certificate_NssImpl* NssCertToXCert( CERTCertificate* cert ) ; +static X509Certificate_NssImpl* NssPrivKeyToXCert( SECKEYPrivateKey* ) ; struct UsageDescription @@ -78,7 +78,7 @@ struct UsageDescription }; -char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) +static char* GetPasswordFunction( PK11SlotInfo* pSlot, PRBool bRetry, void* /*arg*/ ) { uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference < task::XInteractionHandler2 > xInteractionHandler( diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index 0cf8c17d3303..53449e9c0900 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -350,7 +350,7 @@ const Sequence< sal_Int8>& X509Certificate_NssImpl::getUnoTunnelId() { return theX509Certificate_NssImplUnoTunnelId::get().getSeq(); } -OUString getAlgorithmDescription(SECAlgorithmID const *aid) +static OUString getAlgorithmDescription(SECAlgorithmID const *aid) { SECOidTag tag; tag = SECOID_GetAlgorithmTag(aid); @@ -360,7 +360,7 @@ OUString getAlgorithmDescription(SECAlgorithmID const *aid) return OUString::createFromAscii( pDesc ) ; } -css::uno::Sequence< sal_Int8 > getThumbprint(CERTCertificate const *pCert, SECOidTag id) +static css::uno::Sequence< sal_Int8 > getThumbprint(CERTCertificate const *pCert, SECOidTag id) { if( pCert != nullptr ) { diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx index 028edbcf547b..7be5fbfce752 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.cxx +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -35,7 +35,7 @@ namespace cssxcsax = com::sun::star::xml::csax; * The return value is NULL terminated. The application has the responsibilty to * deallocte the return value. */ -xmlChar* ous_to_xmlstr( const OUString& oustr ) +static xmlChar* ous_to_xmlstr( const OUString& oustr ) { OString ostr = OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; return xmlStrndup( reinterpret_cast<xmlChar const *>(ostr.getStr()), static_cast<int>(ostr.getLength()) ) ; @@ -45,7 +45,7 @@ xmlChar* ous_to_xmlstr( const OUString& oustr ) * The return value is NULL terminated. The application has the responsibilty to * deallocte the return value. */ -xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) +static xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) { OString ostr = OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; length = ostr.getLength(); @@ -57,7 +57,7 @@ xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) * The return value and the referenced value must be NULL terminated. * The application has the responsibilty to deallocte the return value. */ -const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) +static const xmlChar** attrlist_to_nxmlstr( const cssu::Sequence< cssxcsax::XMLAttribute >& aAttributes ) { xmlChar* attname = nullptr ; xmlChar* attvalue = nullptr ; diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx index 7cd44219d2f5..be48ae34b232 100644 --- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx +++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx @@ -33,8 +33,9 @@ static bool g_bInputCallbacksRegistered = false; static css::uno::Reference< css::xml::crypto::XUriBinding > m_xUriBinding ; -extern "C" -int xmlStreamMatch( const char* uri ) +extern "C" { + +static int xmlStreamMatch( const char* uri ) { css::uno::Reference< css::io::XInputStream > xInputStream ; @@ -65,8 +66,7 @@ int xmlStreamMatch( const char* uri ) return 0 ; } -extern "C" -void* xmlStreamOpen( const char* uri ) +static void* xmlStreamOpen( const char* uri ) { css::uno::Reference< css::io::XInputStream > xInputStream ; @@ -99,8 +99,7 @@ void* xmlStreamOpen( const char* uri ) return nullptr ; } -extern "C" -int xmlStreamRead( void* context, char* buffer, int len ) +static int xmlStreamRead( void* context, char* buffer, int len ) { int numbers ; css::uno::Reference< css::io::XInputStream > xInputStream ; @@ -124,8 +123,7 @@ int xmlStreamRead( void* context, char* buffer, int len ) return numbers ; } -extern "C" -int xmlStreamClose( void * context ) +static int xmlStreamClose( void * context ) { if (g_bInputCallbacksEnabled && g_bInputCallbacksRegistered) { @@ -139,6 +137,8 @@ int xmlStreamClose( void * context ) return 0 ; } +} + XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks() { if (!g_bInputCallbacksEnabled) |