[Libreoffice-commits] core.git: 8 commits - include/registry registry/Executable_regview.mk registry/inc registry/Library_reg.mk registry/source registry/tools

Stephan Bergmann sbergman at redhat.com
Fri Jul 3 06:41:46 PDT 2015


 include/registry/reflread.hxx  |  286 --------------------------
 include/registry/reflwrit.hxx  |  221 --------------------
 include/registry/registry.h    |  440 -----------------------------------------
 registry/Executable_regview.mk |    5 
 registry/Library_reg.mk        |    5 
 registry/inc/regapi.hxx        |  432 ++++++++++++++++++++++++++++++++++++++++
 registry/source/keyimpl.hxx    |    2 
 registry/source/reflread.cxx   |  199 ++++++------------
 registry/source/reflread.hxx   |  119 +++++++++++
 registry/source/reflwrit.cxx   |  144 +++----------
 registry/source/reflwrit.hxx   |  107 +++++++++
 registry/source/regimpl.cxx    |    4 
 registry/source/regimpl.hxx    |    2 
 registry/source/registry.cxx   |    8 
 registry/source/regkey.cxx     |    2 
 registry/tools/regview.cxx     |    2 
 16 files changed, 786 insertions(+), 1192 deletions(-)

New commits:
commit bded4ddd6da0de2c465b28a51d773720338542c3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 11:22:38 2015 +0200

    Make RegistryTypeWriter non-copyable
    
    (and note the operator == vs. = typo)
    
    Change-Id: I9c25149967ed9b80f5e8f014de0dfee2e8f485d8

diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index 288beb9..689bc2d 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1165,14 +1165,6 @@ void TypeWriter::createBlop()
 
 extern "C" {
 
-static void TYPEREG_CALLTYPE acquire(TypeWriterImpl hEntry)
-{
-    TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry);
-
-    if (pEntry != NULL)
-        pEntry->m_refCount++;
-}
-
 static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry)
 {
     TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry);
@@ -1374,29 +1366,11 @@ RegistryTypeWriter::RegistryTypeWriter(RTTypeClass               RTTypeClass,
                                   referenceCount);
 }
 
-RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
-    : m_hImpl(toCopy.m_hImpl)
-{
-    acquire(m_hImpl);
-}
-
 RegistryTypeWriter::~RegistryTypeWriter()
 {
     release(m_hImpl);
 }
 
-RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
-{
-    if (m_hImpl != toAssign.m_hImpl)
-    {
-        release(m_hImpl);
-        m_hImpl = toAssign.m_hImpl;
-        acquire(m_hImpl);
-    }
-
-    return *this;
-}
-
 void RegistryTypeWriter::setFieldData( sal_uInt16              index,
                                               const rtl::OUString&    name,
                                               const rtl::OUString&    typeName,
diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx
index 9bb8475..dcf2eec 100644
--- a/registry/source/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -58,18 +58,12 @@ public:
                               sal_uInt16                methodCount,
                               sal_uInt16                referenceCount);
 
-    /// Copy constructcor
-    RegistryTypeWriter(const RegistryTypeWriter& toCopy);
-
     /** Destructor. The Destructor frees the internal data block.
 
         The pointer (returned by getBlop) will be set to NULL.
      */
     ~RegistryTypeWriter();
 
-    /// Assign operator
-    RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
-
     /** sets the data for a field member of a type blob.
 
         @param index indicates the index of the field.
@@ -100,7 +94,9 @@ public:
      */
     sal_uInt32       getBlopSize();
 
-protected:
+private:
+    RegistryTypeWriter(RegistryTypeWriter &) = delete;
+    void operator =(RegistryTypeWriter) = delete;
 
     /// stores the handle of an implementation class
     TypeWriterImpl                                               m_hImpl;
commit 79429448052d4b69cc235000b74f3f8d6fa5a74c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 11:19:50 2015 +0200

    Remove RegistryTypeWriter_Api indirection
    
    Change-Id: I313adfb72272a631299efb3d2464873853a126be

diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index c8ec720..288beb9 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1356,26 +1356,66 @@ static TypeWriterImpl TYPEREG_CALLTYPE createEntry(
     return t;
 }
 
-RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api()
+}
+
+RegistryTypeWriter::RegistryTypeWriter(RTTypeClass               RTTypeClass,
+                                              const rtl::OUString&    typeName,
+                                              const rtl::OUString&    superTypeName,
+                                              sal_uInt16                fieldCount,
+                                              sal_uInt16                methodCount,
+                                              sal_uInt16                referenceCount)
+    : m_hImpl(NULL)
 {
-    static RegistryTypeWriter_Api aApi= {0,0,0,0,0,0};
-    if (!aApi.acquire)
-    {
-        aApi.createEntry        = &createEntry;
-        aApi.acquire            = &acquire;
-        aApi.release            = &release;
-        aApi.setFieldData       = &setFieldData;
-        aApi.getBlop            = &getBlop;
-        aApi.getBlopSize        = &getBlopSize;
-
-        return (&aApi);
-    }
-    else
+    m_hImpl = createEntry(RTTypeClass,
+                                  typeName.pData,
+                                  superTypeName.pData,
+                                  fieldCount,
+                                  methodCount,
+                                  referenceCount);
+}
+
+RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
+    : m_hImpl(toCopy.m_hImpl)
+{
+    acquire(m_hImpl);
+}
+
+RegistryTypeWriter::~RegistryTypeWriter()
+{
+    release(m_hImpl);
+}
+
+RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
+{
+    if (m_hImpl != toAssign.m_hImpl)
     {
-        return (&aApi);
+        release(m_hImpl);
+        m_hImpl = toAssign.m_hImpl;
+        acquire(m_hImpl);
     }
+
+    return *this;
 }
 
+void RegistryTypeWriter::setFieldData( sal_uInt16              index,
+                                              const rtl::OUString&    name,
+                                              const rtl::OUString&    typeName,
+                                              const rtl::OUString&    doku,
+                                              const rtl::OUString&    fileName,
+                                              RTFieldAccess           access,
+                                              const RTConstValue&     constValue)
+{
+    ::setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
+}
+
+const sal_uInt8* RegistryTypeWriter::getBlop()
+{
+    return ::getBlop(m_hImpl);
+}
+
+sal_uInt32 RegistryTypeWriter::getBlopSize()
+{
+    return ::getBlopSize(m_hImpl);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx
index 0be0fb3..9bb8475 100644
--- a/registry/source/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -27,43 +27,10 @@
 /// Implememetation handle
 typedef void* TypeWriterImpl;
 
-/****************************************************************************
-
-    C-Api
-
-*****************************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** specifies a collection of function pointers which represents the complete registry type writer C-API.
-
-    This funtions pointers are used by the C++ wrapper to call the C-API.
-*/
-struct RegistryTypeWriter_Api
-{
-    TypeWriterImpl          (TYPEREG_CALLTYPE *createEntry)         (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
-    void                    (TYPEREG_CALLTYPE *acquire)             (TypeWriterImpl);
-    void                    (TYPEREG_CALLTYPE *release)             (TypeWriterImpl);
-    void                    (TYPEREG_CALLTYPE *setFieldData)        (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
-    const sal_uInt8*        (TYPEREG_CALLTYPE *getBlop)             (TypeWriterImpl);
-    sal_uInt32              (TYPEREG_CALLTYPE *getBlopSize)         (TypeWriterImpl);
-};
-
-/** the API initialization function.
-*/
-RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api();
-
-#ifdef __cplusplus
-}
-#endif
-
 /** RegistryTypeWriter writes/creates a binary type blob.
 
     This class provides the necessary functions to write type information
     for all kinds of types into a blob.
-    The class is inline and use a C-Api.
 
     @deprecated
     use typereg::Writer instead
@@ -84,7 +51,7 @@ public:
         @param referenceCount specifies the number of references (eg. number of supported interfaces,
                               exported services ...)
      */
-    inline RegistryTypeWriter(RTTypeClass               RTTypeClass,
+    RegistryTypeWriter(RTTypeClass               RTTypeClass,
                               const rtl::OUString&    typeName,
                               const rtl::OUString&    superTypeName,
                               sal_uInt16                fieldCount,
@@ -92,16 +59,16 @@ public:
                               sal_uInt16                referenceCount);
 
     /// Copy constructcor
-    inline RegistryTypeWriter(const RegistryTypeWriter& toCopy);
+    RegistryTypeWriter(const RegistryTypeWriter& toCopy);
 
     /** Destructor. The Destructor frees the internal data block.
 
         The pointer (returned by getBlop) will be set to NULL.
      */
-    inline ~RegistryTypeWriter();
+    ~RegistryTypeWriter();
 
     /// Assign operator
-    inline RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
+    RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
 
     /** sets the data for a field member of a type blob.
 
@@ -114,7 +81,7 @@ public:
         @param constValue specifies the value of the field. The value is only interesting
                           for enum values or constants.
      */
-    inline void setFieldData( sal_uInt16              index,
+    void setFieldData( sal_uInt16              index,
                               const rtl::OUString&    name,
                               const rtl::OUString&    typeName,
                               const rtl::OUString&    doku,
@@ -127,86 +94,18 @@ public:
         The pointer will be invalid (NULL) if the instance of
         the RegistryTypeWriter will be destroyed.
      */
-    inline const sal_uInt8*     getBlop();
+    const sal_uInt8*     getBlop();
 
     /** returns the size of the new type blob in bytes.
      */
-    inline sal_uInt32       getBlopSize();
+    sal_uInt32       getBlopSize();
 
 protected:
 
-    /// stores the registry type writer Api.
-    const RegistryTypeWriter_Api*                                m_pApi;
     /// stores the handle of an implementation class
     TypeWriterImpl                                               m_hImpl;
 };
 
-
-
-inline RegistryTypeWriter::RegistryTypeWriter(RTTypeClass               RTTypeClass,
-                                              const rtl::OUString&    typeName,
-                                              const rtl::OUString&    superTypeName,
-                                              sal_uInt16                fieldCount,
-                                              sal_uInt16                methodCount,
-                                              sal_uInt16                referenceCount)
-    : m_pApi(initRegistryTypeWriter_Api())
-    , m_hImpl(NULL)
-{
-    m_hImpl = m_pApi->createEntry(RTTypeClass,
-                                  typeName.pData,
-                                  superTypeName.pData,
-                                  fieldCount,
-                                  methodCount,
-                                  referenceCount);
-}
-
-
-inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
-    : m_pApi(toCopy.m_pApi)
-    , m_hImpl(toCopy.m_hImpl)
-{
-    m_pApi->acquire(m_hImpl);
-}
-
-inline RegistryTypeWriter::~RegistryTypeWriter()
-{
-    m_pApi->release(m_hImpl);
-}
-
-inline RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
-{
-    if (m_hImpl != toAssign.m_hImpl)
-    {
-        m_pApi->release(m_hImpl);
-        m_hImpl = toAssign.m_hImpl;
-        m_pApi->acquire(m_hImpl);
-    }
-
-    return *this;
-}
-
-inline void RegistryTypeWriter::setFieldData( sal_uInt16              index,
-                                              const rtl::OUString&    name,
-                                              const rtl::OUString&    typeName,
-                                              const rtl::OUString&    doku,
-                                              const rtl::OUString&    fileName,
-                                              RTFieldAccess           access,
-                                              const RTConstValue&     constValue)
-{
-    m_pApi->setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
-}
-
-inline const sal_uInt8* RegistryTypeWriter::getBlop()
-{
-    return m_pApi->getBlop(m_hImpl);
-}
-
-inline sal_uInt32 RegistryTypeWriter::getBlopSize()
-{
-    return m_pApi->getBlopSize(m_hImpl);
-}
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7e74fe416de8f2da49d7fd2eb13759cde76e9c6c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 11:16:31 2015 +0200

    Remove unused functions
    
    Change-Id: Ic4058c133a676646bc0c5d1e52207471bb78a1cb

diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index ea26929..c8ec720 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1184,35 +1184,6 @@ static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry)
     }
 }
 
-static void TYPEREG_CALLTYPE setUik(TypeWriterImpl  hEntry, const RTUik* uik)
-{
-    TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry);
-
-    if (pEntry != NULL)
-    {
-        if (pEntry->m_pUik)
-        {
-            pEntry->m_pUik->m_Data1 = uik->m_Data1;
-            pEntry->m_pUik->m_Data2 = uik->m_Data2;
-            pEntry->m_pUik->m_Data3 = uik->m_Data3;
-            pEntry->m_pUik->m_Data4 = uik->m_Data4;
-            pEntry->m_pUik->m_Data5 = uik->m_Data5;
-        }
-        else
-            pEntry->m_pUik = new RTUik(*uik);
-    }
-}
-
-static void TYPEREG_CALLTYPE setDoku(TypeWriterImpl hEntry, rtl_uString* doku)
-{
-    static_cast< TypeWriter * >(hEntry)->m_doku = toByteString(doku);
-}
-
-static void TYPEREG_CALLTYPE setFileName(TypeWriterImpl hEntry, rtl_uString* fileName)
-{
-    static_cast< TypeWriter * >(hEntry)->m_fileName = toByteString(fileName);
-}
-
 sal_Bool TYPEREG_CALLTYPE typereg_writer_setFieldData(
     void * handle, sal_uInt16 index, rtl_uString const * documentation,
     rtl_uString const * fileName, RTFieldAccess flags, rtl_uString const * name,
@@ -1263,19 +1234,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodData(
     return true;
 }
 
-static void TYPEREG_CALLTYPE setMethodData(TypeWriterImpl   hEntry,
-                                           sal_uInt16       index,
-                                           rtl_uString*     name,
-                                           rtl_uString*     returnTypeName,
-                                           RTMethodMode     mode,
-                                           sal_uInt16       paramCount,
-                                           sal_uInt16       excCount,
-                                           rtl_uString*     doku)
-{
-    typereg_writer_setMethodData(
-        hEntry, index, doku, mode, name, returnTypeName, paramCount, excCount);
-}
-
 sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData(
     void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex,
     RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName)
@@ -1291,17 +1249,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData(
     return true;
 }
 
-static void TYPEREG_CALLTYPE setParamData(TypeWriterImpl    hEntry,
-                                          sal_uInt16        index,
-                                          sal_uInt16        paramIndex,
-                                          rtl_uString*      type,
-                                          rtl_uString*      name,
-                                          RTParamMode       mode)
-{
-    typereg_writer_setMethodParameterData(
-        hEntry, index, paramIndex, mode, name, type);
-}
-
 sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodExceptionTypeName(
     void * handle, sal_uInt16 methodIndex, sal_uInt16 exceptionIndex,
     rtl_uString const * typeName)
@@ -1316,14 +1263,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodExceptionTypeName(
     return true;
 }
 
-static void TYPEREG_CALLTYPE setExcData(TypeWriterImpl  hEntry,
-                                        sal_uInt16      index,
-                                        sal_uInt16      excIndex,
-                                        rtl_uString*    type)
-{
-    typereg_writer_setMethodExceptionTypeName(hEntry, index, excIndex, type);
-}
-
 void const * TYPEREG_CALLTYPE typereg_writer_getBlob(void * handle, sal_uInt32 * size)
     SAL_THROW_EXTERN_C()
 {
@@ -1367,16 +1306,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setReferenceData(
     return true;
 }
 
-static void TYPEREG_CALLTYPE setReferenceData(TypeWriterImpl    hEntry,
-                                              sal_uInt16        index,
-                                              rtl_uString*      name,
-                                              RTReferenceType   refType,
-                                              rtl_uString*      doku,
-                                              RTFieldAccess     access)
-{
-    typereg_writer_setReferenceData(hEntry, index, doku, refType, access, name);
-}
-
 void * TYPEREG_CALLTYPE typereg_writer_create(
     typereg_Version version, rtl_uString const * documentation,
     rtl_uString const * fileName, RTTypeClass typeClass, sal_Bool published,
@@ -1429,22 +1358,15 @@ static TypeWriterImpl TYPEREG_CALLTYPE createEntry(
 
 RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api()
 {
-    static RegistryTypeWriter_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0};
+    static RegistryTypeWriter_Api aApi= {0,0,0,0,0,0};
     if (!aApi.acquire)
     {
         aApi.createEntry        = &createEntry;
         aApi.acquire            = &acquire;
         aApi.release            = &release;
-        aApi.setUik             = &setUik;
-        aApi.setDoku            = &setDoku;
-        aApi.setFileName        = &setFileName;
         aApi.setFieldData       = &setFieldData;
-        aApi.setMethodData      = &setMethodData;
-        aApi.setParamData       = &setParamData;
-        aApi.setExcData         = &setExcData;
         aApi.getBlop            = &getBlop;
         aApi.getBlopSize        = &getBlopSize;
-        aApi.setReferenceData   = &setReferenceData;
 
         return (&aApi);
     }
diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx
index 0025ab0..0be0fb3 100644
--- a/registry/source/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -46,17 +46,9 @@ struct RegistryTypeWriter_Api
     TypeWriterImpl          (TYPEREG_CALLTYPE *createEntry)         (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
     void                    (TYPEREG_CALLTYPE *acquire)             (TypeWriterImpl);
     void                    (TYPEREG_CALLTYPE *release)             (TypeWriterImpl);
-    void                    (TYPEREG_CALLTYPE *setUik)              (TypeWriterImpl, const RTUik*);
-    void                    (TYPEREG_CALLTYPE *setDoku)             (TypeWriterImpl, rtl_uString*);
-    void                    (TYPEREG_CALLTYPE *setFileName)         (TypeWriterImpl, rtl_uString*);
     void                    (TYPEREG_CALLTYPE *setFieldData)        (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
-    void                    (TYPEREG_CALLTYPE *setMethodData)       (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, RTMethodMode, sal_uInt16, sal_uInt16, rtl_uString*);
-    void                    (TYPEREG_CALLTYPE *setParamData)        (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*, rtl_uString*, RTParamMode);
-    void                    (TYPEREG_CALLTYPE *setExcData)          (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*);
     const sal_uInt8*        (TYPEREG_CALLTYPE *getBlop)             (TypeWriterImpl);
     sal_uInt32              (TYPEREG_CALLTYPE *getBlopSize)         (TypeWriterImpl);
-
-    void                    (TYPEREG_CALLTYPE *setReferenceData)    (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess);
 };
 
 /** the API initialization function.
commit cd0474555eed3e65c145c85ed21baab8f09258d2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 11:13:32 2015 +0200

    Make RegistryTypeReader non-copyable
    
    (and note the operator == vs. = typo)
    
    Change-Id: I4567927f3f702f8e74b168becce4002e84d5c7a0

diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 15e3f2f..aa8d61a 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -1749,26 +1749,9 @@ RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
     m_hImpl = createEntry(buffer, bufferLen, copyData);
 }
 
-RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
-    : m_hImpl(toCopy.m_hImpl)
-{ typereg_reader_acquire(m_hImpl); }
-
-
 RegistryTypeReader::~RegistryTypeReader()
 { typereg_reader_release(m_hImpl); }
 
-RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
-{
-    if (m_hImpl != toAssign.m_hImpl)
-    {
-        typereg_reader_release(m_hImpl);
-        m_hImpl = toAssign.m_hImpl;
-        typereg_reader_acquire(m_hImpl);
-    }
-
-    return *this;
-}
-
 RTTypeClass RegistryTypeReader::getTypeClass() const
 {  return typereg_reader_getTypeClass(m_hImpl); }
 
diff --git a/registry/source/reflread.hxx b/registry/source/reflread.hxx
index a4f3b9f..6912fa8 100644
--- a/registry/source/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -51,16 +51,9 @@ public:
                               sal_uInt32 bufferLen,
                               bool copyData);
 
-    /// Copy constructcor
-    RegistryTypeReader(const RegistryTypeReader& toCopy);
-
     /// Destructor. The Destructor frees the data block if the copyData flag was TRUE.
     ~RegistryTypeReader();
 
-    /// Assign operator
-    RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
-
-
     /** returns the typeclass of the type represented by this blob.
 
         This function will always return the type class without the internal
@@ -113,7 +106,9 @@ public:
      */
     rtl::OUString  getFieldFileName( sal_uInt16 index ) const;
 
-protected:
+private:
+    RegistryTypeReader(RegistryTypeReader &) = delete;
+    void operator =(RegistryTypeReader) = delete;
 
     /// stores the handle of an implementation class
     TypeReaderImpl                                              m_hImpl;
commit a843c457044acc3155b0d3c49534e78569c69d96
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 11:11:14 2015 +0200

    Remove RegistryTypeReader_Api indirection
    
    Change-Id: I43710d057043a258ec9ab94bca0703434098e6c9

diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 33343e2..15e3f2f 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -1741,31 +1741,90 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName(
     rtl_uString_new(pSuperTypeName);
 }
 
-RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api()
-{
-    static RegistryTypeReader_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0};
-    if (!aApi.acquire)
-    {
-        aApi.createEntry            = &createEntry;
-        aApi.acquire                = &typereg_reader_acquire;
-        aApi.release                = &typereg_reader_release;
-        aApi.getTypeClass           = &typereg_reader_getTypeClass;
-        aApi.getTypeName            = &typereg_reader_getTypeName;
-        aApi.getSuperTypeName       = &getSuperTypeName;
-        aApi.getFieldCount          = &getFieldCount;
-        aApi.getFieldName           = &typereg_reader_getFieldName;
-        aApi.getFieldType           = &typereg_reader_getFieldTypeName;
-        aApi.getFieldAccess         = &typereg_reader_getFieldFlags;
-        aApi.getFieldConstValue     = &getFieldConstValue;
-        aApi.getFieldDoku           = &typereg_reader_getFieldDocumentation;
-        aApi.getFieldFileName       = &typereg_reader_getFieldFileName;
-
-        return (&aApi);
-    }
-    else
+RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
+                                              sal_uInt32 bufferLen,
+                                              bool copyData)
+    : m_hImpl(NULL)
+{
+    m_hImpl = createEntry(buffer, bufferLen, copyData);
+}
+
+RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
+    : m_hImpl(toCopy.m_hImpl)
+{ typereg_reader_acquire(m_hImpl); }
+
+
+RegistryTypeReader::~RegistryTypeReader()
+{ typereg_reader_release(m_hImpl); }
+
+RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
+{
+    if (m_hImpl != toAssign.m_hImpl)
     {
-        return (&aApi);
+        typereg_reader_release(m_hImpl);
+        m_hImpl = toAssign.m_hImpl;
+        typereg_reader_acquire(m_hImpl);
     }
+
+    return *this;
+}
+
+RTTypeClass RegistryTypeReader::getTypeClass() const
+{  return typereg_reader_getTypeClass(m_hImpl); }
+
+rtl::OUString RegistryTypeReader::getTypeName() const
+{
+    rtl::OUString sRet;
+    typereg_reader_getTypeName(m_hImpl, &sRet.pData);
+    return sRet;
+}
+
+rtl::OUString RegistryTypeReader::getSuperTypeName() const
+{
+    rtl::OUString sRet;
+    ::getSuperTypeName(m_hImpl, &sRet.pData);
+    return sRet;
+}
+
+sal_uInt32 RegistryTypeReader::getFieldCount() const
+{   return ::getFieldCount(m_hImpl); }
+
+rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
+{
+    rtl::OUString sRet;
+    typereg_reader_getFieldName(m_hImpl, &sRet.pData, index);
+    return sRet;
+}
+
+rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
+{
+    rtl::OUString sRet;
+    typereg_reader_getFieldTypeName(m_hImpl, &sRet.pData, index);
+    return sRet;
+}
+
+RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
+{  return typereg_reader_getFieldFlags(m_hImpl, index); }
+
+RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
+{
+    RTConstValue ret;
+    ret.m_type = ::getFieldConstValue(m_hImpl, index, &ret.m_value);
+    return ret;
+}
+
+rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
+{
+    rtl::OUString sRet;
+    typereg_reader_getFieldDocumentation(m_hImpl, &sRet.pData, index);
+    return sRet;
+}
+
+rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
+{
+    rtl::OUString sRet;
+    typereg_reader_getFieldFileName(m_hImpl, &sRet.pData, index);
+    return sRet;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/registry/source/reflread.hxx b/registry/source/reflread.hxx
index 5d6fc0c..a4f3b9f 100644
--- a/registry/source/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -27,50 +27,10 @@
 /// Implememetation handle
 typedef void* TypeReaderImpl;
 
-/****************************************************************************
-
-    C-Api
-
-*****************************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** specifies a collection of function pointers which represents the complete registry type reader C-API.
-
-    This funtions pointers are used by the C++ wrapper to call the C-API.
-*/
-struct RegistryTypeReader_Api
-{
-    TypeReaderImpl      (TYPEREG_CALLTYPE *createEntry)         (const sal_uInt8*, sal_uInt32, bool);
-    void                (TYPEREG_CALLTYPE *acquire)             (TypeReaderImpl);
-    void                (TYPEREG_CALLTYPE *release)             (TypeReaderImpl);
-    RTTypeClass         (TYPEREG_CALLTYPE *getTypeClass)        (TypeReaderImpl);
-    void                (TYPEREG_CALLTYPE *getTypeName)         (TypeReaderImpl, rtl_uString**);
-    void                (TYPEREG_CALLTYPE *getSuperTypeName)    (TypeReaderImpl, rtl_uString**);
-    sal_uInt32          (TYPEREG_CALLTYPE *getFieldCount)       (TypeReaderImpl);
-    void                (TYPEREG_CALLTYPE *getFieldName)        (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getFieldType)        (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    RTFieldAccess       (TYPEREG_CALLTYPE *getFieldAccess)      (TypeReaderImpl, sal_uInt16);
-    RTValueType         (TYPEREG_CALLTYPE *getFieldConstValue)  (TypeReaderImpl, sal_uInt16, RTConstValueUnion*);
-    void                (TYPEREG_CALLTYPE *getFieldDoku)        (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getFieldFileName)    (TypeReaderImpl, rtl_uString**, sal_uInt16);
-};
-
-/** the API initialization function.
-*/
-RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api();
-
-#ifdef __cplusplus
-}
-#endif
-
 /** RegistryTypeReades reads a binary type blob.
 
     This class provides the necessary functions to read type information
     for all kinds of types of a type blob.
-    The class is inline and use a C-Api.
 
     @deprecated
     use typereg::Reader instead
@@ -87,18 +47,18 @@ public:
                         The block can be copied to ensure that the data
                         is valid for the lifetime of this instance.
      */
-    inline RegistryTypeReader(const sal_uInt8* buffer,
+    RegistryTypeReader(const sal_uInt8* buffer,
                               sal_uInt32 bufferLen,
                               bool copyData);
 
     /// Copy constructcor
-    inline RegistryTypeReader(const RegistryTypeReader& toCopy);
+    RegistryTypeReader(const RegistryTypeReader& toCopy);
 
     /// Destructor. The Destructor frees the data block if the copyData flag was TRUE.
-    inline ~RegistryTypeReader();
+    ~RegistryTypeReader();
 
     /// Assign operator
-    inline RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
+    RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
 
 
     /** returns the typeclass of the type represented by this blob.
@@ -106,158 +66,59 @@ public:
         This function will always return the type class without the internal
         RT_TYPE_PUBLISHED flag set.
      */
-    inline RTTypeClass      getTypeClass() const;
+    RTTypeClass      getTypeClass() const;
 
     /** returns the full qualified name of the type.
      */
-    inline rtl::OUString  getTypeName() const;
+    rtl::OUString  getTypeName() const;
 
     /** returns the full qualified name of the supertype.
      */
-    inline rtl::OUString  getSuperTypeName() const;
+    rtl::OUString  getSuperTypeName() const;
 
     /** returns the number of fields (attributes/properties, enum values or number
         of constants in a module).
 
      */
-    inline sal_uInt32       getFieldCount() const;
+    sal_uInt32       getFieldCount() const;
 
     /** returns the name of the field specified by index.
      */
-    inline rtl::OUString  getFieldName( sal_uInt16 index ) const;
+    rtl::OUString  getFieldName( sal_uInt16 index ) const;
 
     /** returns the full qualified name of the field specified by index.
      */
-    inline rtl::OUString  getFieldType( sal_uInt16 index ) const;
+    rtl::OUString  getFieldType( sal_uInt16 index ) const;
 
     /** returns the access mode of the field specified by index.
      */
-    inline RTFieldAccess    getFieldAccess( sal_uInt16 index ) const;
+    RTFieldAccess    getFieldAccess( sal_uInt16 index ) const;
 
     /** returns the value of the field specified by index.
 
         This function returns the value of an enum value or of a constant.
      */
-    inline RTConstValue     getFieldConstValue( sal_uInt16 index ) const;
+    RTConstValue     getFieldConstValue( sal_uInt16 index ) const;
 
     /** returns the documentation string for the field specified by index.
 
         Each field of a type can have their own documentation.
      */
-    inline rtl::OUString  getFieldDoku( sal_uInt16 index ) const;
+    rtl::OUString  getFieldDoku( sal_uInt16 index ) const;
 
     /** returns the IDL filename of the field specified by index.
 
         The IDL filename of a field can differ from the filename of the ype itself
         because modules and also constants can be defined in different IDL files.
      */
-    inline rtl::OUString  getFieldFileName( sal_uInt16 index ) const;
+    rtl::OUString  getFieldFileName( sal_uInt16 index ) const;
 
 protected:
 
-    /// stores the registry type reader Api.
-    const RegistryTypeReader_Api*                               m_pApi;
     /// stores the handle of an implementation class
     TypeReaderImpl                                              m_hImpl;
 };
 
-
-
-inline RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
-                                              sal_uInt32 bufferLen,
-                                              bool copyData)
-    : m_pApi(initRegistryTypeReader_Api())
-    , m_hImpl(NULL)
-    {
-        m_hImpl = m_pApi->createEntry(buffer, bufferLen, copyData);
-    }
-
-
-inline RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
-    : m_pApi(toCopy.m_pApi)
-    , m_hImpl(toCopy.m_hImpl)
-    { m_pApi->acquire(m_hImpl); }
-
-
-inline RegistryTypeReader::~RegistryTypeReader()
-    {  m_pApi->release(m_hImpl); }
-
-inline RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
-{
-    if (m_hImpl != toAssign.m_hImpl)
-    {
-        m_pApi->release(m_hImpl);
-        m_hImpl = toAssign.m_hImpl;
-        m_pApi->acquire(m_hImpl);
-    }
-
-    return *this;
-}
-
-
-
-
-
-
-
-inline RTTypeClass RegistryTypeReader::getTypeClass() const
-    {  return m_pApi->getTypeClass(m_hImpl); }
-
-inline rtl::OUString RegistryTypeReader::getTypeName() const
-    {
-        rtl::OUString sRet;
-        m_pApi->getTypeName(m_hImpl, &sRet.pData);
-        return sRet;
-    }
-
-inline rtl::OUString RegistryTypeReader::getSuperTypeName() const
-    {
-        rtl::OUString sRet;
-        m_pApi->getSuperTypeName(m_hImpl, &sRet.pData);
-        return sRet;
-    }
-
-inline sal_uInt32 RegistryTypeReader::getFieldCount() const
-    {   return m_pApi->getFieldCount(m_hImpl); }
-
-inline rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
-    {
-        rtl::OUString sRet;
-        m_pApi->getFieldName(m_hImpl, &sRet.pData, index);
-        return sRet;
-    }
-
-inline rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
-    {
-        rtl::OUString sRet;
-        m_pApi->getFieldType(m_hImpl, &sRet.pData, index);
-        return sRet;
-    }
-
-inline RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
-    {  return m_pApi->getFieldAccess(m_hImpl, index); }
-
-inline RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
-    {
-        RTConstValue ret;
-        ret.m_type = m_pApi->getFieldConstValue(m_hImpl, index, &ret.m_value);
-        return ret;
-    }
-
-inline rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
-    {
-        rtl::OUString sRet;
-        m_pApi->getFieldDoku(m_hImpl, &sRet.pData, index);
-        return sRet;
-    }
-
-inline rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
-    {
-        rtl::OUString sRet;
-        m_pApi->getFieldFileName(m_hImpl, &sRet.pData, index);
-        return sRet;
-    }
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit cfde943f59b0cf63c46cbe061fd37e53201d2363
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 10:53:47 2015 +0200

    Remove unused functions
    
    Change-Id: Ib615ff7eb12232b0b83664af134744d96754ffd8

diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 1dc6a47..33343e2 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -288,7 +288,6 @@ public:
     double              readDoubleConstant(sal_uInt16 index);
     const sal_Unicode*  readStringConstant(sal_uInt16 index);
         // throws std::bad_alloc
-    void                readUIK(sal_uInt16 index, RTUik* uik);
 };
 
 ConstantPool::~ConstantPool()
@@ -582,29 +581,6 @@ const sal_Unicode* ConstantPool::readStringConstant(sal_uInt16 index)
     return aString;
 }
 
-void ConstantPool::readUIK(sal_uInt16 index, RTUik* uik)
-{
-    if (index == 0)
-    {
-        uik->m_Data1 = 0;
-        uik->m_Data2 = 0;
-        uik->m_Data3 = 0;
-        uik->m_Data4 = 0;
-        uik->m_Data5 = 0;
-    }
-    else if (m_pIndex && (index <= m_numOfEntries))
-    {
-        if (readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_TAG) == CP_TAG_UIK)
-        {
-            uik->m_Data1 = readUINT32(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK1);
-            uik->m_Data2 = readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK2);
-            uik->m_Data3 = readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK3);
-            uik->m_Data4 = readUINT32(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK4);
-            uik->m_Data5 = readUINT32(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK5);
-        }
-    }
-}
-
 /**************************************************************************
 
     class FieldList
@@ -1325,32 +1301,6 @@ typereg_Version TYPEREG_CALLTYPE typereg_reader_getVersion(void * handle) {
     return TYPEREG_VERSION_0;
 }
 
-static sal_uInt16 TYPEREG_CALLTYPE getMinorVersion(TypeReaderImpl hEntry)
-{
-    TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
-    if (pEntry != nullptr) {
-        try {
-            return pEntry->readUINT16(OFFSET_MINOR_VERSION);
-        } catch (BlopObject::BoundsError &) {
-            SAL_WARN("registry", "bad data");
-        }
-    }
-    return 0;
-}
-
-static sal_uInt16 TYPEREG_CALLTYPE getMajorVersion(TypeReaderImpl hEntry)
-{
-    TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
-    if (pEntry != nullptr) {
-        try {
-            return pEntry->readUINT16(OFFSET_MAJOR_VERSION);
-        } catch (BlopObject::BoundsError &) {
-            SAL_WARN("registry", "bad data");
-        }
-    }
-    return 0;
-}
-
 RTTypeClass TYPEREG_CALLTYPE typereg_reader_getTypeClass(void * hEntry)
 {
     TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1413,20 +1363,6 @@ static void TYPEREG_CALLTYPE getSuperTypeName(TypeReaderImpl hEntry, rtl_uString
     rtl_uString_new(pSuperTypeName);
 }
 
-static void TYPEREG_CALLTYPE getUik(TypeReaderImpl hEntry, RTUik* uik)
-{
-    TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
-
-    if (pEntry != NULL)
-    {
-        try {
-            pEntry->m_pCP->readUIK(pEntry->readUINT16(OFFSET_UIK), uik);
-        } catch (BlopObject::BoundsError &) {
-            SAL_WARN("registry", "bad data");
-        }
-    }
-}
-
 void TYPEREG_CALLTYPE typereg_reader_getDocumentation(void * hEntry, rtl_uString** pDoku)
 {
     TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1584,11 +1520,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodCount(void * hEntry)
     return pEntry->m_pMethods->m_numOfEntries;
 }
 
-static sal_uInt32 TYPEREG_CALLTYPE getMethodCount(TypeReaderImpl hEntry)
-{
-    return typereg_reader_getMethodCount(hEntry);
-}
-
 void TYPEREG_CALLTYPE typereg_reader_getMethodName(void * hEntry, rtl_uString** pMethodName, sal_uInt16 index)
 {
     TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1615,11 +1546,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodParameterCount(
     return pEntry->m_pMethods->getMethodParamCount(index);
 }
 
-static sal_uInt32 TYPEREG_CALLTYPE getMethodParamCount(TypeReaderImpl hEntry, sal_uInt16 index)
-{
-    return typereg_reader_getMethodParameterCount(hEntry, index);
-}
-
 void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void * hEntry, rtl_uString** pMethodParamType, sal_uInt16 index, sal_uInt16 paramIndex)
 {
     TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1671,11 +1597,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodExceptionCount(
     return pEntry->m_pMethods->getMethodExcCount(index);
 }
 
-static sal_uInt32 TYPEREG_CALLTYPE getMethodExcCount(TypeReaderImpl hEntry, sal_uInt16 index)
-{
-    return typereg_reader_getMethodExceptionCount(hEntry, index);
-}
-
 void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void * hEntry, rtl_uString** pMethodExcpType, sal_uInt16 index, sal_uInt16 excIndex)
 {
     TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1742,11 +1663,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getReferenceCount(void * hEntry)
     return pEntry->m_pReferences->m_numOfEntries;
 }
 
-static sal_uInt32 TYPEREG_CALLTYPE getReferenceCount(TypeReaderImpl hEntry)
-{
-    return typereg_reader_getReferenceCount(hEntry);
-}
-
 void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void * hEntry, rtl_uString** pReferenceName, sal_uInt16 index)
 {
     TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1827,20 +1743,15 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName(
 
 RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api()
 {
-    static RegistryTypeReader_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    static RegistryTypeReader_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0};
     if (!aApi.acquire)
     {
         aApi.createEntry            = &createEntry;
         aApi.acquire                = &typereg_reader_acquire;
         aApi.release                = &typereg_reader_release;
-        aApi.getMinorVersion        = &getMinorVersion;
-        aApi.getMajorVersion        = &getMajorVersion;
         aApi.getTypeClass           = &typereg_reader_getTypeClass;
         aApi.getTypeName            = &typereg_reader_getTypeName;
         aApi.getSuperTypeName       = &getSuperTypeName;
-        aApi.getUik                 = &getUik;
-        aApi.getDoku                = &typereg_reader_getDocumentation;
-        aApi.getFileName            = &typereg_reader_getFileName;
         aApi.getFieldCount          = &getFieldCount;
         aApi.getFieldName           = &typereg_reader_getFieldName;
         aApi.getFieldType           = &typereg_reader_getFieldTypeName;
@@ -1848,22 +1759,6 @@ RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api()
         aApi.getFieldConstValue     = &getFieldConstValue;
         aApi.getFieldDoku           = &typereg_reader_getFieldDocumentation;
         aApi.getFieldFileName       = &typereg_reader_getFieldFileName;
-        aApi.getMethodCount         = &getMethodCount;
-        aApi.getMethodName          = &typereg_reader_getMethodName;
-        aApi.getMethodParamCount    = &getMethodParamCount;
-        aApi.getMethodParamType = &typereg_reader_getMethodParameterTypeName;
-        aApi.getMethodParamName     = &typereg_reader_getMethodParameterName;
-        aApi.getMethodParamMode     = &typereg_reader_getMethodParameterFlags;
-        aApi.getMethodExcCount      = &getMethodExcCount;
-        aApi.getMethodExcType = &typereg_reader_getMethodExceptionTypeName;
-        aApi.getMethodReturnType    = &typereg_reader_getMethodReturnTypeName;
-        aApi.getMethodMode          = &typereg_reader_getMethodFlags;
-        aApi.getMethodDoku          = &typereg_reader_getMethodDocumentation;
-        aApi.getReferenceCount      = &getReferenceCount;
-        aApi.getReferenceName       = &typereg_reader_getReferenceTypeName;
-        aApi.getReferenceType       = &typereg_reader_getReferenceSort;
-        aApi.getReferenceDoku       = &typereg_reader_getReferenceDocumentation;
-        aApi.getReferenceAccess     = &typereg_reader_getReferenceFlags;
 
         return (&aApi);
     }
diff --git a/registry/source/reflread.hxx b/registry/source/reflread.hxx
index 9cd9447..5d6fc0c 100644
--- a/registry/source/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -46,12 +46,7 @@ struct RegistryTypeReader_Api
     TypeReaderImpl      (TYPEREG_CALLTYPE *createEntry)         (const sal_uInt8*, sal_uInt32, bool);
     void                (TYPEREG_CALLTYPE *acquire)             (TypeReaderImpl);
     void                (TYPEREG_CALLTYPE *release)             (TypeReaderImpl);
-    sal_uInt16          (TYPEREG_CALLTYPE *getMinorVersion)     (TypeReaderImpl);
-    sal_uInt16          (TYPEREG_CALLTYPE *getMajorVersion)     (TypeReaderImpl);
     RTTypeClass         (TYPEREG_CALLTYPE *getTypeClass)        (TypeReaderImpl);
-    void                (TYPEREG_CALLTYPE *getUik)              (TypeReaderImpl, RTUik*);
-    void                (TYPEREG_CALLTYPE *getDoku)             (TypeReaderImpl, rtl_uString**);
-    void                (TYPEREG_CALLTYPE *getFileName)         (TypeReaderImpl, rtl_uString**);
     void                (TYPEREG_CALLTYPE *getTypeName)         (TypeReaderImpl, rtl_uString**);
     void                (TYPEREG_CALLTYPE *getSuperTypeName)    (TypeReaderImpl, rtl_uString**);
     sal_uInt32          (TYPEREG_CALLTYPE *getFieldCount)       (TypeReaderImpl);
@@ -61,23 +56,6 @@ struct RegistryTypeReader_Api
     RTValueType         (TYPEREG_CALLTYPE *getFieldConstValue)  (TypeReaderImpl, sal_uInt16, RTConstValueUnion*);
     void                (TYPEREG_CALLTYPE *getFieldDoku)        (TypeReaderImpl, rtl_uString**, sal_uInt16);
     void                (TYPEREG_CALLTYPE *getFieldFileName)    (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    sal_uInt32          (TYPEREG_CALLTYPE *getMethodCount)      (TypeReaderImpl);
-    void                (TYPEREG_CALLTYPE *getMethodName)       (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    sal_uInt32          (TYPEREG_CALLTYPE *getMethodParamCount) (TypeReaderImpl, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getMethodParamType)  (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getMethodParamName)  (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
-    RTParamMode         (TYPEREG_CALLTYPE *getMethodParamMode)  (TypeReaderImpl, sal_uInt16, sal_uInt16);
-    sal_uInt32          (TYPEREG_CALLTYPE *getMethodExcCount)   (TypeReaderImpl, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getMethodExcType)    (TypeReaderImpl, rtl_uString**, sal_uInt16, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getMethodReturnType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    RTMethodMode        (TYPEREG_CALLTYPE *getMethodMode)       (TypeReaderImpl, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getMethodDoku)       (TypeReaderImpl, rtl_uString**, sal_uInt16);
-
-    sal_uInt32          (TYPEREG_CALLTYPE *getReferenceCount)   (TypeReaderImpl);
-    void                (TYPEREG_CALLTYPE *getReferenceName)    (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    RTReferenceType     (TYPEREG_CALLTYPE *getReferenceType)    (TypeReaderImpl, sal_uInt16);
-    void                (TYPEREG_CALLTYPE *getReferenceDoku)    (TypeReaderImpl, rtl_uString**, sal_uInt16);
-    RTFieldAccess       (TYPEREG_CALLTYPE *getReferenceAccess)  (TypeReaderImpl, sal_uInt16);
 };
 
 /** the API initialization function.
commit cade2b8f9f9c39fc7bc6960f5faf591860be58ae
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 10:20:29 2015 +0200

    No need for a C API here
    
    Change-Id: Ie453a7c97a762932884c5c41b13607a170368107

diff --git a/registry/inc/registry.h b/registry/inc/regapi.hxx
similarity index 98%
rename from registry/inc/registry.h
rename to registry/inc/regapi.hxx
index 8af32fa..c84dab4 100644
--- a/registry/inc/registry.h
+++ b/registry/inc/regapi.hxx
@@ -17,18 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_REGISTRY_INC_REGISTRY_H
-#define INCLUDED_REGISTRY_INC_REGISTRY_H
+#ifndef INCLUDED_REGISTRY_INC_REGAPI_HXX
+#define INCLUDED_REGISTRY_INC_REGAPI_HXX
 
 #include <stddef.h>
 #include <rtl/ustring.h>
 #include <registry/regtype.h>
 #include <registry/regdllapi.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif  /* __cplusplus */
-
 /** This function creates the specified key.
 
     If the key already exists in the registry, the function opens the key only.
@@ -295,7 +291,7 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_freeValueList(RegValueType valueTyp
  */
 REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getResolvedKeyName(RegKeyHandle hKey,
                                                     rtl_uString* keyName,
-                                                   sal_Bool firstLinkOnly,
+                                                   bool firstLinkOnly,
                                                       rtl_uString** pResolvedName);
 
 /** This function loads registry information from a file and save it under the
@@ -350,8 +346,8 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_saveKey(RegKeyHandle hKey,
 REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_mergeKey(RegKeyHandle hKey,
                                            rtl_uString* keyName,
                                            rtl_uString* regFileName,
-                                           sal_Bool bWarnings,
-                                           sal_Bool bReport);
+                                           bool bWarnings,
+                                           bool bReport);
 
 
 /** This function creates a new registry with the specified name and creates a root key.
@@ -388,7 +384,7 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_getName(RegHandle hRegistry, rtl_uS
     @param  hReg identifies a currently open registry.
     @return TRUE if accessmode is read only else FALSE.
 */
-REG_DLLPUBLIC sal_Bool REGISTRY_CALLTYPE reg_isReadOnly(RegHandle hReg);
+REG_DLLPUBLIC bool REGISTRY_CALLTYPE reg_isReadOnly(RegHandle hReg);
 
 
 /** This function opens a registry with the specified name.
@@ -431,10 +427,6 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_destroyRegistry(RegHandle hRegistry
 */
 REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_dumpRegistry(RegKeyHandle hKey);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/registry/source/keyimpl.hxx b/registry/source/keyimpl.hxx
index 148aded..e7cb810 100644
--- a/registry/source/keyimpl.hxx
+++ b/registry/source/keyimpl.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_REGISTRY_SOURCE_KEYIMPL_HXX
 #define INCLUDED_REGISTRY_SOURCE_KEYIMPL_HXX
 
-#include <registry.h>
+#include <regapi.hxx>
 #include "regimpl.hxx"
 #include <rtl/ustring.hxx>
 
diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx
index e1cf283..70d4a78 100644
--- a/registry/source/regimpl.hxx
+++ b/registry/source/regimpl.hxx
@@ -23,7 +23,7 @@
 #include <set>
 #include <unordered_map>
 
-#include <registry.h>
+#include <regapi.hxx>
 #include <rtl/ustring.hxx>
 #include <osl/mutex.hxx>
 #include <store/store.hxx>
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index bc73fcb6..0b2ec2a 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -18,7 +18,7 @@
  */
 
 
-#include <registry.h>
+#include <regapi.hxx>
 #include <registry/registry.hxx>
 
 #include <osl/process.h>
@@ -485,8 +485,8 @@ RegError REGISTRY_CALLTYPE reg_saveKey(RegKeyHandle hKey,
 RegError REGISTRY_CALLTYPE reg_mergeKey(RegKeyHandle hKey,
                                         rtl_uString* keyName,
                                         rtl_uString* regFileName,
-                                        sal_Bool bWarnings,
-                                        sal_Bool bReport)
+                                        bool bWarnings,
+                                        bool bReport)
 {
     ORegKey *pKey;
 
@@ -541,7 +541,7 @@ RegError REGISTRY_CALLTYPE reg_getName(RegHandle hRegistry, rtl_uString** pName)
 
 //  reg_isReadOnly
 
-sal_Bool REGISTRY_CALLTYPE reg_isReadOnly(RegHandle hRegistry)
+bool REGISTRY_CALLTYPE reg_isReadOnly(RegHandle hRegistry)
 {
     return isReadOnly(hRegistry);
 }
diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx
index 0475110..ed624db 100644
--- a/registry/source/regkey.cxx
+++ b/registry/source/regkey.cxx
@@ -907,7 +907,7 @@ RegError REGISTRY_CALLTYPE reg_freeValueList(RegValueType valueType,
 
 RegError REGISTRY_CALLTYPE reg_getResolvedKeyName(RegKeyHandle hKey,
                                                     rtl_uString* keyName,
-                                                    sal_Bool firstLinkOnly,
+                                                    bool firstLinkOnly,
                                                       rtl_uString** pResolvedName)
 {
     if (!hKey)
diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx
index 3682d90..5b2ae7d 100644
--- a/registry/tools/regview.cxx
+++ b/registry/tools/regview.cxx
@@ -18,7 +18,7 @@
  */
 
 
-#include "registry.h"
+#include "regapi.hxx"
 #include "fileurl.hxx"
 
 #include "rtl/ustring.hxx"
commit 6556043364877c0ac74c07b509856dccfe52e43a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 3 10:16:12 2015 +0200

    Move module-private includes from include/registry/ to registry/
    
    Change-Id: I72bdd6627a191a65d5c3b479c100e30442a8bb9e

diff --git a/registry/Executable_regview.mk b/registry/Executable_regview.mk
index 12baef2..62b46ac 100644
--- a/registry/Executable_regview.mk
+++ b/registry/Executable_regview.mk
@@ -9,6 +9,11 @@
 
 $(eval $(call gb_Executable_Executable,regview))
 
+$(eval $(call gb_Executable_set_include,regview, \
+    $$(INCLUDE) \
+    -I$(SRCDIR)/registry/inc \
+))
+
 $(eval $(call gb_Executable_use_libraries,regview,\
     sal \
     reg \
diff --git a/registry/Library_reg.mk b/registry/Library_reg.mk
index d389d86..7994d02 100644
--- a/registry/Library_reg.mk
+++ b/registry/Library_reg.mk
@@ -14,6 +14,11 @@ $(eval $(call gb_Library_add_defs,reg,\
 	-DREG_DLLIMPLEMENTATION \
 ))
 
+$(eval $(call gb_Library_set_include,reg, \
+    $$(INCLUDE) \
+    -I$(SRCDIR)/registry/inc \
+))
+
 $(eval $(call gb_Library_use_external,reg,boost_headers))
 
 $(eval $(call gb_Library_use_libraries,reg,\
diff --git a/include/registry/registry.h b/registry/inc/registry.h
similarity index 99%
rename from include/registry/registry.h
rename to registry/inc/registry.h
index 68e6014..8af32fa 100644
--- a/include/registry/registry.h
+++ b/registry/inc/registry.h
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_REGISTRY_REGISTRY_H
-#define INCLUDED_REGISTRY_REGISTRY_H
+#ifndef INCLUDED_REGISTRY_INC_REGISTRY_H
+#define INCLUDED_REGISTRY_INC_REGISTRY_H
 
 #include <stddef.h>
 #include <rtl/ustring.h>
diff --git a/registry/source/keyimpl.hxx b/registry/source/keyimpl.hxx
index ddfbac4..148aded 100644
--- a/registry/source/keyimpl.hxx
+++ b/registry/source/keyimpl.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_REGISTRY_SOURCE_KEYIMPL_HXX
 #define INCLUDED_REGISTRY_SOURCE_KEYIMPL_HXX
 
-#include <registry/registry.h>
+#include <registry.h>
 #include "regimpl.hxx"
 #include <rtl/ustring.hxx>
 
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 8d14bf6..1dc6a47 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -27,7 +27,7 @@
 #include <sal/types.h>
 #include <osl/endian.h>
 #include <osl/diagnose.h>
-#include <registry/reflread.hxx>
+#include <reflread.hxx>
 #include <sal/log.hxx>
 
 #include "registry/typereg_reader.hxx"
diff --git a/include/registry/reflread.hxx b/registry/source/reflread.hxx
similarity index 98%
rename from include/registry/reflread.hxx
rename to registry/source/reflread.hxx
index a298909..9cd9447 100644
--- a/include/registry/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -17,10 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_REGISTRY_REFLREAD_HXX
-#define INCLUDED_REGISTRY_REFLREAD_HXX
+#ifndef INCLUDED_REGISTRY_SOURCE_REFLREAD_HXX
+#define INCLUDED_REGISTRY_SOURCE_REFLREAD_HXX
 
-#include <registry/regdllapi.h>
 #include <registry/refltype.hxx>
 #include <registry/regtype.h>
 #include <rtl/ustring.hxx>
@@ -83,7 +82,7 @@ struct RegistryTypeReader_Api
 
 /** the API initialization function.
 */
-REG_DLLPUBLIC RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api();
+RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api();
 
 #ifdef __cplusplus
 }
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index 3096b83..ea26929 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -26,7 +26,7 @@
 #include "rtl/string.hxx"
 #include "rtl/ustring.hxx"
 
-#include "registry/reflwrit.hxx"
+#include "reflwrit.hxx"
 #include "registry/version.h"
 #include "registry/writer.h"
 
diff --git a/include/registry/reflwrit.hxx b/registry/source/reflwrit.hxx
similarity index 97%
rename from include/registry/reflwrit.hxx
rename to registry/source/reflwrit.hxx
index 45b2788..0025ab0 100644
--- a/include/registry/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -17,10 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_REGISTRY_REFLWRIT_HXX
-#define INCLUDED_REGISTRY_REFLWRIT_HXX
+#ifndef INCLUDED_REGISTRY_SOURCE_REFLWRIT_HXX
+#define INCLUDED_REGISTRY_SOURCE_REFLWRIT_HXX
 
-#include <registry/regdllapi.h>
 #include <registry/refltype.hxx>
 #include <registry/regtype.h>
 #include <rtl/ustring.hxx>
@@ -62,7 +61,7 @@ struct RegistryTypeWriter_Api
 
 /** the API initialization function.
 */
-REG_DLLPUBLIC RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api();
+RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api();
 
 #ifdef __cplusplus
 }
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index e20b41d..d31458a 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -31,9 +31,9 @@
 #include <unistd.h>
 #endif
 
-#include <registry/reflread.hxx>
+#include <reflread.hxx>
 
-#include <registry/reflwrit.hxx>
+#include <reflwrit.hxx>
 
 #include "registry/reader.hxx"
 #include "registry/refltype.hxx"
diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx
index 6d38cb7..e1cf283 100644
--- a/registry/source/regimpl.hxx
+++ b/registry/source/regimpl.hxx
@@ -23,7 +23,7 @@
 #include <set>
 #include <unordered_map>
 
-#include <registry/registry.h>
+#include <registry.h>
 #include <rtl/ustring.hxx>
 #include <osl/mutex.hxx>
 #include <store/store.hxx>
diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx
index 345e0bf..bc73fcb6 100644
--- a/registry/source/registry.cxx
+++ b/registry/source/registry.cxx
@@ -18,7 +18,7 @@
  */
 
 
-#include <registry/registry.h>
+#include <registry.h>
 #include <registry/registry.hxx>
 
 #include <osl/process.h>
diff --git a/registry/tools/regview.cxx b/registry/tools/regview.cxx
index e48e0d8..3682d90 100644
--- a/registry/tools/regview.cxx
+++ b/registry/tools/regview.cxx
@@ -18,7 +18,7 @@
  */
 
 
-#include "registry/registry.h"
+#include "registry.h"
 #include "fileurl.hxx"
 
 #include "rtl/ustring.hxx"


More information about the Libreoffice-commits mailing list