LibreOffice Module bridges (master) 1
gcc3_wasm/cpp2uno.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <typelib/typedescription.hxx>
11#include <vtablefactory.hxx>
12
13using namespace ::com::sun::star::uno;
14
16
18{
19};
20
21VtableFactory::Slot* VtableFactory::mapBlockToVtable(void* block)
22{
23 return static_cast<Slot*>(block) + 2;
24}
25
26std::size_t VtableFactory::getBlockSize(sal_Int32 slotCount)
27{
28 return (slotCount + 2) * sizeof(Slot);
29}
30
31VtableFactory::Slot* VtableFactory::initializeBlock(void* block, sal_Int32 slotCount, sal_Int32,
32 typelib_InterfaceTypeDescription*)
33{
34 Slot* slots = mapBlockToVtable(block);
35 return slots + slotCount;
36}
37
38unsigned char* VtableFactory::addLocalFunctions(Slot**, unsigned char*,
39 typelib_InterfaceTypeDescription const*, sal_Int32,
40 sal_Int32, sal_Int32)
41{
42 std::abort();
43}
44
45void VtableFactory::flushCode(unsigned char const*, unsigned char const*) {}
46
47/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Hand out vtable structures for interface type descriptions.
static Slot * mapBlockToVtable(void *block)
Given a pointer to a block, turn it into a vtable pointer.
static void flushCode(unsigned char const *begin, unsigned char const *end)
Flush all the generated code snippets of a vtable, on platforms that require it.
static unsigned char * addLocalFunctions(Slot **slots, unsigned char *code, sal_PtrDiff writetoexecdiff, typelib_InterfaceTypeDescription const *type, sal_Int32 functionOffset, sal_Int32 functionCount, sal_Int32 vtableOffset)
Fill the vtable slots corresponding to all local (i.e., not inherited) functions of a given interface...
static Slot * initializeBlock(void *block, sal_Int32 slotCount, sal_Int32 vtableNumber, typelib_InterfaceTypeDescription *type)
Initialize a raw vtable block.
static std::size_t getBlockSize(sal_Int32 slotCount)
Calculate the size of a raw vtable block.