rtl_bootstrap_set_InitFileName()
This function must be called before getting individual bootstrap settings.%APPDATA%\libreoffice\4\user
(Windows)/home/<user name>/.config/libreoffice/4/user
(Linux)~/Library/Application Support/LibreOffice/4/user
(macOS)/assets/rc
(Android, in the app's .apk archive)rtl_bootstrap_args_open()
and to close it you use rtl_bootstrap_args_close()
The open function returns a handle to the bootstrap settings file. To get the ini file you call on rtl_bootstrap_get_iniNamefrom_handle()
rtl_bootstrap_get()
and to set a value you call rtl_bootstrap_set().
Bootstrap_Impl::expandValue()
and Bootstrap_Impl::expandMacros()
). Basically, the key and/or value can contain a macro that will be expanded - the syntax is ${file:key}
, where file is the ini file, and key is the value to be looked up in the ini file. In fact, it also handles nested macros, so you can have ${file:${file:key}}
or ${${file:key}:${file:key}}
or even (if you are insane) ${${file:${file:key}}:${file:${file:${file:key}}}}
.Bootstrap_Impl::getValue()
, there are some special hardcoded values. They are:_OS
_ARCH
CPPU_ENV
APP_DATA_DIR
(for both Android and iOS)ORIGIN
(gets the path to the ini file)-env:
switch (the function name is rather confusingly called getAmbienceValue()
...). These are:SYSUSERCONFIG
SYSUSERHOME
SYSBINDIR
${.override:file:value}
osl::Profile
lookup - the syntax for this is ${key}
. However, this does not allow for expanding macros, so you can't do something like ${${file:key}}
. A comment in the code actually states that it:...erroneously does not recursively expand macros in the resulting replacement text (and if it did, it would fail to detect cycles that pass through here)
Bootstrap_Impl::getValue()
allows for a default value to be optionally specified.rtl_getProcessID()
_gets a UUID that represents the process ID, _but does not use the Ethernet address. rtl_getAppCommandArg()
and rtl_getAppCommandArgCount()
gets the command line arguments, but ignores the ones set by -env:
Reference
class. It is largely equivalent to std::shared_ptr
, using reference counting to own a pointer, but is less fully featured. The functions are defined in include/rtl/ref.hxx
template <class reference_type> Reference(reference_type*);
shared_ptr <class U> shared_ptr(U*);
Reference<reference_type> operator= &(reference_type*);
shared_ptr& operator= (const shared_ptr&) noexcept;
Reference<reference_type>& set(reference_type*);
shared_ptr& operator= (const shared_ptr&) noexcept;
reference_type* get() const;
element_type* get() const noexcept;
reference_type& operator* () const;
element_type& operator* () const noexcept;
reference_type* operator-> () const;
element_type* operator-> () const noexcept;
Reference<reference_type>& clear();
template<class U> void reset(U*);
bool is() const;
operator bool() const noexcept;
swap()
functionvoid swap(shared_ptr&) noexcept;
use_count()
functionlong int use_count() const noexcept;
unique()
functionbool unique() const noexcept;
bridges
module, which bridges C++ ABIs, Java JNI and Microsoft .NET to UNO and back).rtl_allocateMemory(sal_Size Bytes)
malloc(size_t bytes)
rtl_reallocateMemory(void *p, sal_Size Bytes)
realloc(void *p, size_t bytes)
rtl_freeMemory(void *p)
free(void *p)
rtl_allocateZeroMemory
allocates memory, but uses memset
to zero out that memory via memset
. rtl_secureZeroMemory
fills a block of memory with zeroes in a way that is guaranteed to be secure (for Unix it is implemented casting the pointer to a volatile char pointer, then it zeroes out each byte in a loop - the volatile pointer ensures that the compiler will not optimize this away. rtl_secureZeroMemory
and rtl_freeZeroMemory
do similar things.