LibreOffice: uno/environment.h File Reference

LibreOffice LibreOffice 25.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
environment.h File Reference
`#include "cppu/cppudllapi.h"`
`#include "rtl/ustring.h"`
`#include <stdarg.h>`

Go to the source code of this file.

## Classes
struct | _uno_Environment
| The binary specification of a UNO environment. More...
struct | _uno_ExtEnvironment
| The binary specification of a UNO environment supporting interface registration. More...

## Macros
#define | UNO_INIT_ENVIRONMENT "uno_initEnvironment"

## Typedefs
typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment | uno_Environment
| The binary specification of a UNO environment.
typedef void(*) | uno_freeProxyFunc(struct _uno_ExtEnvironment *pEnv, void *pProxy)
| Generic function pointer declaration to free a proxy object if it is not needed by the environment anymore.
typedef void *(*) | uno_memAlloc(sal_Size nBytes)
| Generic function pointer declaration to allocate memory.
typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment | uno_ExtEnvironment
| The binary specification of a UNO environment supporting interface registration.
typedef void(*) | uno_initEnvironmentFunc(uno_Environment *pEnv)
| Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a disposing callback.
typedef void | uno_EnvCallee(va_list *pParam)
| Typedef for variable argument function.

## Functions
CPPU_DLLPUBLIC void | uno_getEnvironment (uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
| Gets a specific environment.
CPPU_DLLPUBLIC void | uno_getRegisteredEnvironments (uno_Environment ***pppEnvs, sal_Int32 *pnLen, uno_memAlloc memAlloc, rtl_uString *pEnvDcp) SAL_THROW_EXTERN_C()
| Gets all specified environments.
CPPU_DLLPUBLIC void | uno_createEnvironment (uno_Environment **ppEnv, rtl_uString *pEnvDcp, void *pContext) SAL_THROW_EXTERN_C()
| Creates an environment.
CPPU_DLLPUBLIC void | uno_dumpEnvironment (void *stream, uno_Environment *pEnv, const char *pFilter) SAL_THROW_EXTERN_C()
| Dumps out environment information, i.e.
CPPU_DLLPUBLIC void | uno_dumpEnvironmentByName (void *stream, rtl_uString *pEnvDcp, const char *pFilter) SAL_THROW_EXTERN_C()
| Dumps out environment information, i.e.
CPPU_DLLPUBLIC void | uno_getCurrentEnvironment (uno_Environment **ppEnv, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
| Returns the current Environment.
CPPU_DLLPUBLIC void | uno_Environment_invoke_v (uno_Environment *pEnv, uno_EnvCallee *pCallee, va_list *pParam) SAL_THROW_EXTERN_C()
| Invoke the passed function in the given environment.
CPPU_DLLPUBLIC void | uno_Environment_invoke (uno_Environment *pEnv, uno_EnvCallee *pCallee,...) SAL_THROW_EXTERN_C()
| Invoke the passed function in the given environment.
CPPU_DLLPUBLIC void | uno_Environment_enter (uno_Environment *pEnv) SAL_THROW_EXTERN_C()
| Enter an environment explicitly.
CPPU_DLLPUBLIC int | uno_Environment_isValid (uno_Environment *pEnv, rtl_uString **pReason) SAL_THROW_EXTERN_C()
| Check if a particular environment is currently valid, so that objects of that environment might be called.

## Macro Definition Documentation

## ◆ UNO_INIT_ENVIRONMENT

#define UNO_INIT_ENVIRONMENT "uno_initEnvironment"

## Typedef Documentation

## ◆ uno_EnvCallee

typedef void uno_EnvCallee(va_list *pParam)

Typedef for variable argument function.

## ◆ uno_Environment

typedef struct SAL_DLLPUBLIC_RTTI _uno_Environment uno_Environment

The binary specification of a UNO environment.

## ◆ uno_ExtEnvironment

typedef struct SAL_DLLPUBLIC_RTTI _uno_ExtEnvironment uno_ExtEnvironment

The binary specification of a UNO environment supporting interface registration.

## ◆ uno_freeProxyFunc

typedef void(*) uno_freeProxyFunc(struct _uno_ExtEnvironment *pEnv, void *pProxy)

Generic function pointer declaration to free a proxy object if it is not needed by the environment anymore.

Any proxy object must register itself on first acquire() call and revoke itself on last release() call. This can happen several times because the environment caches proxy objects until the environment explicitly frees the proxy object calling this function.

Parameters

  pEnv | environment
  pProxy | proxy pointer

## ◆ uno_initEnvironmentFunc

typedef void(*) uno_initEnvironmentFunc(uno_Environment *pEnv)

Function exported by some bridge library providing acquireInterface(), releaseInterface(); may set a disposing callback.

Parameters

  pEnv | environment to be initialized

## ◆ uno_memAlloc

typedef void *(*) uno_memAlloc(sal_Size nBytes)

Generic function pointer declaration to allocate memory.

Used with getRegisteredInterfaces().

Parameters

  nBytes | amount of memory in bytes

Returns
  pointer to allocated memory

## Function Documentation

## ◆ uno_createEnvironment()

CPPU_DLLPUBLIC void uno_createEnvironment | ( | uno_Environment ** | ppEnv,
|  | rtl_uString * | pEnvDcp,
|  | void * | pContext )

Creates an environment.

The new environment is anonymous (NOT publicly registered/ accessible).

Parameters

  ppEnv | out parameter of environment; given environment will be released
  pEnvDcp | descriptor of environment
  pContext | context pointer (e.g., to distinguish java vm); set 0 if not needed

## ◆ uno_dumpEnvironment()

CPPU_DLLPUBLIC void uno_dumpEnvironment | ( | void * | stream,
|  | uno_Environment * | pEnv,
|  | const char * | pFilter )

Dumps out environment information, i.e.

registered interfaces.

Parameters

  stream | output stream (FILE *)
  pEnv | environment to be dumped
  pFilter | if not null, filters output

## ◆ uno_dumpEnvironmentByName()

CPPU_DLLPUBLIC void uno_dumpEnvironmentByName | ( | void * | stream,
|  | rtl_uString * | pEnvDcp,
|  | const char * | pFilter )

Dumps out environment information, i.e.

registered interfaces.

Parameters

  stream | output stream (FILE *)
  pEnvDcp | descriptor of environment to be dumped
  pFilter | if not null, filters output

## ◆ uno_Environment_enter()

CPPU_DLLPUBLIC void uno_Environment_enter | ( | uno_Environment * | pEnv | ) |

Enter an environment explicitly.

Parameters

  pEnv | the environment to enter; NULL leaves all environments

Since
  UDK 3.2.7

## ◆ uno_Environment_invoke()

CPPU_DLLPUBLIC void uno_Environment_invoke | ( | uno_Environment * | pEnv,
|  | uno_EnvCallee * | pCallee,
|  |  | ... )

Invoke the passed function in the given environment.

Parameters

  pEnv | the target environment
  pCallee | the function to call
  ... | the parameters passed to the function

Since
  UDK 3.2.7

## ◆ uno_Environment_invoke_v()

CPPU_DLLPUBLIC void uno_Environment_invoke_v | ( | uno_Environment * | pEnv,
|  | uno_EnvCallee * | pCallee,
|  | va_list * | pParam )

Invoke the passed function in the given environment.

Parameters

  pEnv | the target environment
  pCallee | the function to call
  pParam | the parameter pointer passed to the function

Since
  UDK 3.2.7

## ◆ uno_Environment_isValid()

CPPU_DLLPUBLIC int uno_Environment_isValid | ( | uno_Environment * | pEnv,
|  | rtl_uString ** | pReason )

Check if a particular environment is currently valid, so that objects of that environment might be called.

Parameters

  pEnv | the environment
  pReason | the reason, if it is not valid

Returns
  1 == valid, 0 == invalid

Since
  UDK 3.2.7

## ◆ uno_getCurrentEnvironment()

CPPU_DLLPUBLIC void uno_getCurrentEnvironment | ( | uno_Environment ** | ppEnv,
|  | rtl_uString * | pTypeName )

Returns the current Environment.

In case no Environment has explicitly been entered, a purpose free default environment gets returned (e.g. the "uno" or "gcc3" Environment).

Parameters

  ppEnv | inout parameter; a given environment will be released
  pTypeName | the optional type of the environment, falls back to "uno"

Since
  UDK 3.2.7

## ◆ uno_getEnvironment()

CPPU_DLLPUBLIC void uno_getEnvironment | ( | uno_Environment ** | ppEnv,
|  | rtl_uString * | pEnvDcp,
|  | void * | pContext )

Gets a specific environment.

If the specified environment does not exist, then a default one is created and registered. The environment revokes itself on last release() call.

Parameters

  ppEnv | inout parameter of environment; given environment will be released
  pEnvDcp | descriptor of environment
  pContext | some context pointer (e.g., to distinguish java vm; set 0 if not needed)

## ◆ uno_getRegisteredEnvironments()

CPPU_DLLPUBLIC void uno_getRegisteredEnvironments | ( | uno_Environment *** | pppEnvs,
|  | sal_Int32 * | pnLen,
|  | uno_memAlloc | memAlloc,
|  | rtl_uString * | pEnvDcp )

Gets all specified environments.

Caller has to release returned environments and free allocated memory.

Parameters

  pppEnvs | out param; pointer to array of environments
  pnLen | out param; length of array
  memAlloc | function for allocating memory that is passed back
  pEnvDcp | descriptor of environments; 0 defaults to all