LibreOffice Module bridges (master) 1
gcc3_linux_powerpc/uno2cpp.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <exception>
23#include <malloc.h>
24#include <typeinfo>
25
26#include <com/sun/star/uno/Exception.hpp>
27#include <com/sun/star/uno/RuntimeException.hpp>
28#include <com/sun/star/uno/genfunc.hxx>
30#include <uno/data.h>
31
32#include "bridge.hxx"
33#include "types.hxx"
34#include "unointerfaceproxy.hxx"
35#include "vtables.hxx"
36
37#include "share.hxx"
38
39
40using namespace ::com::sun::star::uno;
41
42namespace
43{
44
45
46static void callVirtualMethod(
47 void * pAdjustedThisPtr,
48 sal_Int32 nVtableIndex,
49 void * pRegisterReturn,
50 typelib_TypeClass eReturnType,
51 char * pPT,
52 sal_Int32 * pStackLongs,
53 sal_Int32 nStackLongs)
54{
55
56 // parameter list is mixed list of * and values
57 // reference parameters are pointers
58
59 // the basic idea here is to use gpr[8] as a storage area for
60 // the future values of registers r3 to r10 needed for the call,
61 // and similarly fpr[8] as a storage area for the future values
62 // of floating point registers f1 to f8
63
64 unsigned long * mfunc; // actual function to be invoked
65 int gpr[8]; // storage for gpregisters, map to r3-r10
66 int off; // offset used to find function
67#ifndef __NO_FPRS__
68 double fpr[8]; // storage for fpregisters, map to f1-f8
69 int f; // number of fprs mapped so far
70 double dret; // temporary function return values
71#endif
72 int n; // number of gprs mapped so far
73 long *p; // pointer to parameter overflow area
74 int c; // character of parameter type being decoded
75 int iret, iret2;
76
77 // Because of the Power PC calling conventions we could be passing
78 // parameters in both register types and on the stack. To create the
79 // stack parameter area we need we now simply allocate local
80 // variable storage param[] that is at least the size of the parameter stack
81 // (more than enough space) which we can overwrite the parameters into.
82
83 // Note: This keeps us from having to decode the signature twice and
84 // prevents problems with later local variables.
85
86 // Note: could require up to 2*nStackLongs words of parameter stack area
87 // if the call has many float parameters (i.e. floats take up only 1
88 // word on the stack but double takes 2 words in parameter area in the
89 // stack frame.
90
91 // Update! Floats on the outgoing parameter stack only take up 1 word
92 // (stfs is used) which is not correct according to the ABI but we
93 // will match what the compiler does until this is figured out
94
95 // this grows the current stack to the appropriate size
96 // and sets the outgoing stack pointer p to the right place
97 __asm__ __volatile__ (
98 "rlwinm %0,%0,3,3,28\n\t"
99 "addi %0,%0,22\n\t"
100 "rlwinm %0,%0,0,4,28\n\t"
101 "lwz 0,0(1)\n\t"
102 "subf 1,%0,1\n\t"
103 "stw 0,0(1)\n\t"
104 : : "r" (nStackLongs) : "0" );
105
106 __asm__ __volatile__ ( "addi %0,1,8" : "=r" (p) : );
107
108 // never called
109 // if (! pAdjustedThisPtr ) dummy_can_throw_anything("xxx"); // address something
110
111
112 // now begin to load the C++ function arguments into storage
113 n = 0;
114#ifndef __NO_FPRS__
115 f = 0;
116#endif
117
118 // now we need to parse the entire signature string */
119 // until we get the END indicator */
120
121 // treat complex return pointer like any other parameter
122
123#if 0
124 /* Let's figure out what is really going on here*/
125 fprintf(stderr,"callVirtualMethod parameters string is %s\n",pPT);
126 int k = nStackLongs;
127 long * q = (long *)pStackLongs;
128 while (k > 0) {
129 fprintf(stderr,"uno stack is: %x\n",*q);
130 k--;
131 q++;
132 }
133#endif
134
135 /* parse the argument list up to the ending ) */
136 while (*pPT != 'X') {
137 c = *pPT;
138 switch (c) {
139 case 'D': /* type is double */
140#ifndef __NO_FPRS__
141 if (f < 8) {
142 fpr[f++] = *((double *)pStackLongs); /* store in register */
143#else
144 if (n & 1)
145 n++;
146 if (n < 8) {
147 gpr[n++] = *pStackLongs;
148 gpr[n++] = *(pStackLongs+1);
149#endif
150 } else {
151 if (((long) p) & 4)
152 p++;
153 *p++ = *pStackLongs; /* or on the parameter stack */
154 *p++ = *(pStackLongs + 1);
155 }
156 pStackLongs += 2;
157 break;
158
159 case 'F': /* type is float */
160 /* this assumes that floats are stored as 1 32 bit word on param
161 stack and that if passed in parameter stack to C, should be
162 as double word.
163
164 Whoops: the abi is not actually followed by gcc, need to
165 store floats as a *single* word on outgoing parameter stack
166 to match what gcc actually does
167 */
168#ifndef __NO_FPRS__
169 if (f < 8) {
170 fpr[f++] = *((float *)pStackLongs);
171#else
172 if (n < 8) {
173 gpr[n++] = *pStackLongs;
174#endif
175 } else {
176#if 0 /* if abi were followed */
177 if (((long) p) & 4)
178 p++;
179 *((double *)p) = *((float *)pStackLongs);
180 p += 2;
181#else
182 *((float *)p) = *((float *)pStackLongs);
183 p += 1;
184#endif
185 }
186 pStackLongs += 1;
187 break;
188
189 case 'H': /* type is long long */
190 if (n & 1) n++; /* note even elements gpr[] will map to
191 odd registers*/
192 if (n <= 6) {
193 gpr[n++] = *pStackLongs;
194 gpr[n++] = *(pStackLongs+1);
195 } else {
196 if (((long) p) & 4)
197 p++;
198 *p++ = *pStackLongs;
199 *p++ = *(pStackLongs+1);
200 }
201 pStackLongs += 2;
202 break;
203
204 case 'S':
205 if (n < 8) {
206 gpr[n++] = *((unsigned short*)pStackLongs);
207 } else {
208 *p++ = *((unsigned short *)pStackLongs);
209 }
210 pStackLongs += 1;
211 break;
212
213 case 'B':
214 if (n < 8) {
215 gpr[n++] = *((char *)pStackLongs);
216 } else {
217 *p++ = *((char *)pStackLongs);
218 }
219 pStackLongs += 1;
220 break;
221
222 default:
223 if (n < 8) {
224 gpr[n++] = *pStackLongs;
225 } else {
226 *p++ = *pStackLongs;
227 }
228 pStackLongs += 1;
229 break;
230 }
231 pPT++;
232 }
233
234 /* figure out the address of the function we need to invoke */
235 off = nVtableIndex;
236 off = off * 4; // 4 bytes per slot
237 mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable
238 mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset
239 mfunc = *((unsigned long **)mfunc); // the function is stored at the address
240 typedef void (*FunctionCall)(sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32);
241 FunctionCall ptr = (FunctionCall)mfunc;
242
243 /* Set up the machine registers and invoke the function */
244
245 __asm__ __volatile__ (
246 "lwz 3, 0(%0)\n\t"
247 "lwz 4, 4(%0)\n\t"
248 "lwz 5, 8(%0)\n\t"
249 "lwz 6, 12(%0)\n\t"
250 "lwz 7, 16(%0)\n\t"
251 "lwz 8, 20(%0)\n\t"
252 "lwz 9, 24(%0)\n\t"
253 "lwz 10, 28(%0)\n\t"
254#ifndef __NO_FPRS__
255 "lfd 1, 0(%1)\n\t"
256 "lfd 2, 8(%1)\n\t"
257 "lfd 3, 16(%1)\n\t"
258 "lfd 4, 24(%1)\n\t"
259 "lfd 5, 32(%1)\n\t"
260 "lfd 6, 40(%1)\n\t"
261 "lfd 7, 48(%1)\n\t"
262 "lfd 8, 56(%1)\n\t"
263 : : "r" (gpr), "r" (fpr)
264#else
265 : : "r" (gpr)
266#endif
267 : "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"
268 );
269
270 // tell gcc that r3 to r10 are not available to it for doing the TOC and exception munge on the func call
271 register sal_uInt32 r3 __asm__("r3");
272 register sal_uInt32 r4 __asm__("r4");
273 register sal_uInt32 r5 __asm__("r5");
274 register sal_uInt32 r6 __asm__("r6");
275 register sal_uInt32 r7 __asm__("r7");
276 register sal_uInt32 r8 __asm__("r8");
277 register sal_uInt32 r9 __asm__("r9");
278 register sal_uInt32 r10 __asm__("r10");
279
280 (*ptr)(r3, r4, r5, r6, r7, r8, r9, r10);
281
282 __asm__ __volatile__ (
283 "mr %0, 3\n\t"
284 "mr %1, 4\n\t"
285#ifndef __NO_FPRS__
286 "fmr %2, 1\n\t"
287 : "=r" (iret), "=r" (iret2), "=f" (dret)
288#else
289 : "=r" (iret), "=r" (iret2)
290#endif
291 : );
292
293 switch( eReturnType )
294 {
295 case typelib_TypeClass_HYPER:
296 case typelib_TypeClass_UNSIGNED_HYPER:
297 ((long*)pRegisterReturn)[0] = iret;
298 ((long*)pRegisterReturn)[1] = iret2;
299 case typelib_TypeClass_LONG:
300 case typelib_TypeClass_UNSIGNED_LONG:
301 case typelib_TypeClass_ENUM:
302 ((long*)pRegisterReturn)[0] = iret;
303 break;
304 case typelib_TypeClass_CHAR:
305 case typelib_TypeClass_SHORT:
306 case typelib_TypeClass_UNSIGNED_SHORT:
307 *(unsigned short*)pRegisterReturn = (unsigned short)iret;
308 break;
309 case typelib_TypeClass_BOOLEAN:
310 case typelib_TypeClass_BYTE:
311 *(unsigned char*)pRegisterReturn = (unsigned char)iret;
312 break;
313 case typelib_TypeClass_FLOAT:
314#ifndef __NO_FPRS__
315 *(float*)pRegisterReturn = (float)dret;
316#else
317 ((unsigned int*)pRegisterReturn)[0] = iret;
318#endif
319 break;
320 case typelib_TypeClass_DOUBLE:
321#ifndef __NO_FPRS__
322 *(double*)pRegisterReturn = dret;
323#else
324 ((unsigned int*)pRegisterReturn)[0] = iret;
325 ((unsigned int*)pRegisterReturn)[1] = iret2;
326#endif
327 break;
328 default:
329 break;
330 }
331}
332
333
334static void cpp_call(
337 typelib_TypeDescriptionReference * pReturnTypeRef,
338 sal_Int32 nParams, typelib_MethodParameter * pParams,
339 void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
340{
341 // max space for: [complex ret ptr], values|ptr ...
342 char * pCppStack =
343 (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) );
344 char * pCppStackStart = pCppStack;
345
346 // need to know parameter types for callVirtualMethod so generate a signature string
347 char * pParamType = (char *) alloca(nParams+2);
348 char * pPT = pParamType;
349
350 // return
351 typelib_TypeDescription * pReturnTypeDescr = 0;
352 TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
353 // assert(pReturnTypeDescr);
354
355 void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
356
357 if (pReturnTypeDescr)
358 {
359 if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
360 {
361 pCppReturn = pUnoReturn; // direct way for simple types
362 }
363 else
364 {
365 // complex return via ptr
366 pCppReturn = *(void **)pCppStack =
368 ? alloca( pReturnTypeDescr->nSize ): pUnoReturn); // direct way
369 *pPT++ = 'I'; //signify that a complex return type on stack
370 pCppStack += sizeof(void *);
371 }
372 }
373 // push this
374 void* pAdjustedThisPtr = reinterpret_cast< void **>(pThis->getCppI()) + aVtableSlot.offset;
375 *(void**)pCppStack = pAdjustedThisPtr;
376 pCppStack += sizeof( void* );
377 *pPT++ = 'I';
378
379 // stack space
380 // static_assert(sizeof(void *) == sizeof(sal_Int32), "### unexpected size!");
381 // args
382 void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams );
383 // indices of values this have to be converted (interface conversion cpp<=>uno)
384 sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams);
385 // type descriptions for reconversions
386 typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
387
388 sal_Int32 nTempIndices = 0;
389
390 for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
391 {
392 const typelib_MethodParameter & rParam = pParams[nPos];
393 typelib_TypeDescription * pParamTypeDescr = 0;
394 TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
395
396 if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
397 {
398 uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr,
399 pThis->getBridge()->getUno2Cpp() );
400
401 switch (pParamTypeDescr->eTypeClass)
402 {
403
404 // we need to know type of each param so that we know whether to use
405 // gpr or fpr to pass in parameters:
406 // Key: I - int, long, pointer, etc means pass in gpr
407 // B - byte value passed in gpr
408 // S - short value passed in gpr
409 // F - float value pass in fpr
410 // D - double value pass in fpr
411 // H - long long int pass in proper pairs of gpr (3,4) (5,6), etc
412 // X - indicates end of parameter description string
413
414 case typelib_TypeClass_LONG:
415 case typelib_TypeClass_UNSIGNED_LONG:
416 case typelib_TypeClass_ENUM:
417 *pPT++ = 'I';
418 break;
419 case typelib_TypeClass_SHORT:
420 case typelib_TypeClass_CHAR:
421 case typelib_TypeClass_UNSIGNED_SHORT:
422 *pPT++ = 'S';
423 break;
424 case typelib_TypeClass_BOOLEAN:
425 case typelib_TypeClass_BYTE:
426 *pPT++ = 'B';
427 break;
428 case typelib_TypeClass_FLOAT:
429 *pPT++ = 'F';
430 break;
431 case typelib_TypeClass_DOUBLE:
432 *pPT++ = 'D';
433 pCppStack += sizeof(sal_Int32); // extra long
434 break;
435 case typelib_TypeClass_HYPER:
436 case typelib_TypeClass_UNSIGNED_HYPER:
437 *pPT++ = 'H';
438 pCppStack += sizeof(sal_Int32); // extra long
439 default:
440 break;
441 }
442
443 // no longer needed
444 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
445 }
446 else // ptr to complex value | ref
447 {
448 if (! rParam.bIn) // is pure out
449 {
450 // cpp out is constructed mem, uno out is not!
452 *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
453 pParamTypeDescr );
454 pTempIndices[nTempIndices] = nPos; // default constructed for cpp call
455 // will be released at reconversion
456 ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
457 }
458 // is in/inout
459 else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr ))
460 {
462 *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
463 pUnoArgs[nPos], pParamTypeDescr,
464 pThis->getBridge()->getUno2Cpp() );
465
466 pTempIndices[nTempIndices] = nPos; // has to be reconverted
467 // will be released at reconversion
468 ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
469 }
470 else // direct way
471 {
472 *(void **)pCppStack = pCppArgs[nPos] = pUnoArgs[nPos];
473 // no longer needed
474 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
475 }
476 // KBH: FIXME: is this the right way to pass these
477 *pPT++='I';
478 }
479 pCppStack += sizeof(sal_Int32); // standard parameter length
480 }
481
482 // terminate the signature string
483 *pPT++='X';
484 *pPT=0;
485
486 try
487 {
488 assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)");
489 try {
491 pAdjustedThisPtr, aVtableSlot.index,
492 pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
493 (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
494 } catch (css::uno::Exception &) {
495 throw;
496 } catch (std::exception & e) {
497 throw css::uno::RuntimeException(
498 "C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
499 + o3tl::runtimeToOUString(e.what()));
500 } catch (...) {
501 throw css::uno::RuntimeException("C++ code threw unknown exception");
502 }
503 // NO exception occurred...
504 *ppUnoExc = 0;
505
506 // reconvert temporary params
507 for ( ; nTempIndices--; )
508 {
509 sal_Int32 nIndex = pTempIndices[nTempIndices];
510 typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices];
511
512 if (pParams[nIndex].bIn)
513 {
514 if (pParams[nIndex].bOut) // inout
515 {
516 uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
517 uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
518 pThis->getBridge()->getCpp2Uno() );
519 }
520 }
521 else // pure out
522 {
523 uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
524 pThis->getBridge()->getCpp2Uno() );
525 }
526 // destroy temp cpp param => cpp: every param was constructed
527 uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
528
529 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
530 }
531 // return value
532 if (pCppReturn && pUnoReturn != pCppReturn)
533 {
534 uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr,
535 pThis->getBridge()->getCpp2Uno() );
536 uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release );
537 }
538 }
539 catch (...)
540 {
541 // fill uno exception
543
544 // temporary params
545 for ( ; nTempIndices--; )
546 {
547 sal_Int32 nIndex = pTempIndices[nTempIndices];
548 // destroy temp cpp param => cpp: every param was constructed
549 uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndices], cpp_release );
550 TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
551 }
552 // return type
553 if (pReturnTypeDescr)
554 TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
555 }
556}
557
558}
559
560namespace bridges::cpp_uno::shared {
561
563 uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr,
564 void * pReturn, void * pArgs[], uno_Any ** ppException )
565{
566 // is my surrogate
568 = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI);
569
570 switch (pMemberDescr->eTypeClass)
571 {
572 case typelib_TypeClass_INTERFACE_ATTRIBUTE:
573 {
574
575 VtableSlot aVtableSlot(
577 reinterpret_cast<
578 typelib_InterfaceAttributeTypeDescription const * >(
579 pMemberDescr)));
580
581 if (pReturn)
582 {
583 // dependent dispatch
584 cpp_call(
585 pThis, aVtableSlot,
586 ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
587 0, 0, // no params
588 pReturn, pArgs, ppException );
589 }
590 else
591 {
592 // is SET
593 typelib_MethodParameter aParam;
594 aParam.pTypeRef =
595 ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
596 aParam.bIn = sal_True;
597 aParam.bOut = sal_False;
598
599 typelib_TypeDescriptionReference * pReturnTypeRef = 0;
600 OUString aVoidName("void");
602 &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
603
604 // dependent dispatch
605 aVtableSlot.index += 1; //get then set method
606 cpp_call(
607 pThis, aVtableSlot,
608 pReturnTypeRef,
609 1, &aParam,
610 pReturn, pArgs, ppException );
611
613 }
614
615 break;
616 }
617 case typelib_TypeClass_INTERFACE_METHOD:
618 {
619
620 VtableSlot aVtableSlot(
622 reinterpret_cast<
623 typelib_InterfaceMethodTypeDescription const * >(
624 pMemberDescr)));
625 switch (aVtableSlot.index)
626 {
627 // standard calls
628 case 1: // acquire uno interface
629 (*pUnoI->acquire)( pUnoI );
630 *ppException = 0;
631 break;
632 case 2: // release uno interface
633 (*pUnoI->release)( pUnoI );
634 *ppException = 0;
635 break;
636 case 0: // queryInterface() opt
637 {
638 typelib_TypeDescription * pTD = 0;
639 TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
640 if (pTD)
641 {
642 uno_Interface * pInterface = 0;
643 (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)(
644 pThis->pBridge->getUnoEnv(),
645 (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD );
646
647 if (pInterface)
648 {
649 ::uno_any_construct(
650 reinterpret_cast< uno_Any * >( pReturn ),
651 &pInterface, pTD, 0 );
652 (*pInterface->release)( pInterface );
653 TYPELIB_DANGER_RELEASE( pTD );
654 *ppException = 0;
655 break;
656 }
657 TYPELIB_DANGER_RELEASE( pTD );
658 }
659 } // else perform queryInterface()
660 default:
661 // dependent dispatch
662 cpp_call(
663 pThis, aVtableSlot,
664 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
665 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
666 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
667 pReturn, pArgs, ppException );
668 }
669 break;
670 }
671 default:
672 {
673 ::com::sun::star::uno::RuntimeException aExc(
674 "illegal member type description!",
676
677 Type const & rExcType = cppu::UnoType<decltype(aExc)>::get();
678 // binary identical null reference
679 ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
680 }
681 }
682}
683
684}
685
686/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
uno_Mapping * getUno2Cpp()
Definition: bridge.hxx:73
uno_ExtEnvironment * getUnoEnv()
Definition: bridge.hxx:70
uno_Mapping * getCpp2Uno()
Definition: bridge.hxx:72
A uno proxy wrapping a cpp interface.
com::sun::star::uno::XInterface * getCppI()
void SAL_CALL uno_destructData(void *pValue, typelib_TypeDescription *pTypeDescr, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
void SAL_CALL uno_constructData(void *pMem, typelib_TypeDescription *pTypeDescr) SAL_THROW_EXTERN_C()
void SAL_CALL uno_copyAndConvertData(void *pDest, void *pSource, typelib_TypeDescription *pTypeDescr, uno_Mapping *mapping) SAL_THROW_EXTERN_C()
char const * name
register sal_uInt32 r28 __asm__("%r28")
void callVirtualMethod(void *pThis, sal_uInt32 nVtableIndex, void *pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) __attribute__((noinline))
static void cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy *pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, typelib_TypeDescriptionReference *pReturnTypeRef, sal_Int32 nParams, typelib_MethodParameter *pParams, void *pUnoReturn, void *pUnoArgs[], uno_Any **ppUnoExc)
sal_Int32 nIndex
void * p
sal_Int64 n
sal_uInt16 nPos
struct _typelib_TypeDescription typelib_TypeDescription
Definition: msvc/except.hxx:53
struct _uno_Any uno_Any
Definition: msvc/except.hxx:32
void fillUnoException(uno_Any *pUnoExc, uno_Mapping *pCpp2Uno)
void unoInterfaceProxyDispatch(uno_Interface *pUnoI, typelib_TypeDescription const *pMemberDescr, void *pReturn, void **pArgs, uno_Any **ppException)
VtableSlot getVtableSlot(typelib_InterfaceAttributeTypeDescription const *ifcMember)
Calculates the vtable slot associated with an interface attribute member.
Definition: vtables.cxx:132
bool isSimpleType(typelib_TypeClass typeClass)
Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, UNSIGNED SHORT,...
Definition: types.cxx:28
bool relatesToInterfaceType(typelib_TypeDescription const *type)
Determines whether a type relates to an interface type (is itself an interface type,...
Definition: types.cxx:41
Type
OUString runtimeToOUString(char const *runtimeString)
Represents a vtable slot of a C++ class.
Definition: vtables.hxx:60
sal_Int32 index
The index within the vtable.
Definition: vtables.hxx:76
sal_Int32 offset
The offset of the vtable.
Definition: vtables.hxx:68
void SAL_CALL typelib_typedescriptionreference_new(typelib_TypeDescriptionReference **ppTDR, typelib_TypeClass eTypeClass, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
void SAL_CALL typelib_typedescriptionreference_release(typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
#define sal_True
#define sal_False