summaryrefslogtreecommitdiff
path: root/include/LibreOfficeKit/LibreOfficeKitInit.h
AgeCommit message (Collapse)Author
2020-10-24Fix remaining invalid usages of __FreeBSD_kernel__ define.Gleb Popov
Change-Id: Ib4b412353dc93434a5669fd92d220f64d9747fe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104710 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-10-16Fix another misuse of __FreeBSD_kernel__ define in LibreOfficeKitInit.h.Gleb Popov
The #if in question clearly checks for an operating system, not the kernel only. Fixes build on FreeBSD. Change-Id: Ib9452056a0d28f685fbae0b4bca65ed814cfd1cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104371 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-03-11android: Separate the Android-specific setup from the actual LOK init.Jan Holesovsky
Change-Id: I433376dfea0a43c63827ba15308a614f3466fb71 Reviewed-on: https://gerrit.libreoffice.org/67875 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2018-11-03No need to mark libreofficekit_hook_2 with default visibility for iOSTor Lillqvist
Change-Id: Ib7b54ebed1c66324c79c116bd4d1e08ebaa1eac9 Reviewed-on: https://gerrit.libreoffice.org/62797 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-10-25Verify that we are actually passed a URL, not a pathnameTor Lillqvist
Sure, the test could be even more strict and actually do a case-insensitive check for an initial "file:" or "vnd.sun.star.pathname:". Change-Id: Ic252aeccdec708138530075d1f38fa348d1e469e
2018-07-27Related: rhbz#1602589 add comments to coverity annotationsCaolán McNamara
Change-Id: I88c941832a0d682ea4b6028c28edd48cf5df38f7 Reviewed-on: https://gerrit.libreoffice.org/58093 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-07-19Avoid gcc: "specified bound depends on the length of the source argument"Tor Lillqvist
Just use memcpy(). Change-Id: Icb705acb6c12baf28684c763a77da7abc514ea6d Reviewed-on: https://gerrit.libreoffice.org/57714 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2018-07-09lok: export preinit helper, and share code variously.Michael Meeks
Change-Id: I09f2992c4ba45ce91190a9f61dd0fedd0eb8a581 Reviewed-on: https://gerrit.libreoffice.org/57145 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-01LibreOfficeKit: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski
Change-Id: Id8dd284a9db04eae458593d8e411b44223d16a8e Reviewed-on: https://gerrit.libreoffice.org/49040 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-12Repair windows build break.jan Iversen
Forgot to isolate extern declaration, mac/linux had no problem, but windows breaks. Change-Id: Ib09119661225193d9cfb1cd9118b78cf7d9bd2f4
2018-01-12iOS, stop trying to do dynamic load in init()jan Iversen
LibreOfficeKit, tries traditionally to load a dylib, and locate the symbols, for iOS this is already linked to a single Kit.o. Code is changed to a simple call Change-Id: Ie94a447260cb3007e7e2b56c1b67896ad40d79d3
2017-11-23iOS, cleaned unused parameterjan Iversen
Change-Id: Iac097d9a4578ef7dcb47006a422703ab06a8284e
2017-11-04Make Windows error reporting more robustMike Kaganski
https://msdn.microsoft.com/en-us/library/ms679351 describes that "it is unsafe to take an arbitrary system error code returned from an API and use FORMAT_MESSAGE_FROM_SYSTEM without FORMAT_MESSAGE_IGNORE_INSERTS" Previously in case when an error string would contain inserts, function returned error, so the error message wasn't shown (at least it didn't crash, thanks to nullptr as the function's last argument). As the function may fail, we now pre-nullify the buffer pointer to avoid dereferencing uninitialized pointer later (though at least for some Windows versions, the function nullifies the pointer in case of FORMAT_MESSAGE_ALLOCATE_BUFFER, but there's no explicit guarantee of this). Also release of allocated buffer is changed to recommended use of HeapFree. The code that doesn't make use of OUString is left directly calling FormatMessage, to avoid introducing new dependencies. Where it makes sense, we now use WindowsErrorString from <comphelper/windowserrorstring.hxx> Change-Id: I834c08eb6d92987e7d3d01e2c36ec55e42aea848 Reviewed-on: https://gerrit.libreoffice.org/44206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-23loplugin:includeform: libreofficekitStephan Bergmann
Change-Id: I58a78a6339a0c8ef1b509604e8b79a339497cf8f
2017-10-19Consistently use #include <LibreOfficeKit/...> in include/LibreOfficeKitStephan Bergmann
Some of the include files there had used #include "..." while others had used #include <LibreOfficeKit/...> for references among those include files. In preparation for loplugin:includeform, consolidate on the latter (even if that's clearly a misuse of the <...> form). Change-Id: If142c844863e4e63b6fd8f2200732972860befd3 Reviewed-on: https://gerrit.libreoffice.org/43558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-17iOS, changed define to IOSjan Iversen
TARGET_OS_IPHONE not defined, but IOS are. Change-Id: I5a12b0cb386b8968101264f8fb17d745e5c1790f
2017-09-29LibreOfficeKitInit.h: release memory after lok_dlerror() on WindowsMike Kaganski
When _WIN32 is defined, lok_dlerror() uses FormatMessageA() call with FORMAT_MESSAGE_ALLOCATE_BUFFER flag [1] to get returned error string. This string is required to be released after use with LocalFree() (or HeapFree(), since LocalFree() is not available in recent SDKs). However, there is no mention in the header that this is required, nor lok_dlopen() that uses it does any cleanup. If the calling application is expected to be terminated in case of error, then that is no problem; but the header might be used in any external client application which we know nothing of. This adds corresponding cleanup function. Change-Id: I1f14cc5d9e10fe086c3646faaf0e19f2a7a6dd56 Reviewed-on: https://gerrit.libreoffice.org/42360 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-09-18Some more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874 Reviewed-on: https://gerrit.libreoffice.org/42419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-06-01Fix typosAndrea Gelmini
Change-Id: I3cd50e374c45bc1c400b24c8fffd6d8f5cd1de56 Reviewed-on: https://gerrit.libreoffice.org/38208 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-29LibreOfficeKit, changed test for iOS.jan Iversen
Replaced __APPLE__ && __arm*__ with TARGET_OS_IPHONE, which is set by xCode when compiling for iOS independent of CPU. Change-Id: Icd3418894841de45c731c21e5211b1cc4ff2e54a Reviewed-on: https://gerrit.libreoffice.org/38106 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@libreoffice.org>
2017-04-06lokit: this was supposed to be plain C functionsThorsten Behrens
Change-Id: I22c568edd297fcc53a8d4fb826e12ee0cea59432 Reviewed-on: https://gerrit.libreoffice.org/36176 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-04-06lokit: make this build on windows, silence extra warningsThorsten Behrens
Change-Id: I78d5ce58d55d27eaa0256a0c1ddffed3a5f2cf91 Reviewed-on: https://gerrit.libreoffice.org/36175 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-04-06lokit: avoid null pointer access w/ undefined LOPath varGabriel Herrera
Change-Id: I777fa58a138d453a108b0c65dcfd667d3da25999 Reviewed-on: https://gerrit.libreoffice.org/36174 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-03-22Consistently mark function definitions in LibreOfficeKitInit.h as staticStephan Bergmann
...to give them internal linkage in both C and C++. Of those definitions that were not marked as static: * Those that had not been marked as inline had external linkage in both C and C++, so would have caused ODR violations were LibreOfficeKitInit.h included in multiple translation units. * Those that had been marked as inline lacked an external defintion in C. (Which 3f02b2aa51e32c46d5b6610480bc1ba22156a3ec "LOK init: avoid non-inline function definition in header file" had apparently faied to take into account.) (IOS_SWIFTCBRIDGE introduced in 028ef4748e53aa8f72c6464ce6bbeeb28c61d30c "LibreOfficeKitInit.h modified to avoid ODR" becomes unnecessary again.) Change-Id: Ibb8033cdbac87b20fa0e3b203b99571c1a7e7234 Reviewed-on: https://gerrit.libreoffice.org/35491 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-20LibreOfficeKitInit.h modified to avoid ODR.jan Iversen
As discussed in IRC, the prev. version would cause an ODR the use of _cplusplus have been changed to IOS_SWIFTCBRIDGE Change-Id: If18610858cb56780347bb28f909619db4aac85b0
2017-03-19ios LibreOfficeLight LOkit integrationjan Iversen
Integrated LibreOfficeLight into gbuild. added lo.xcconfig and Resources (needed to link with LO and run LO) added swift --> C interface for LOkit add known commands from JS client added C++ condition in LibreOfficekitInit.h (inline no good in a C file) Change-Id: I19ebe8912546408bf701c96c0c63541d6e37cad8 Reviewed-on: https://gerrit.libreoffice.org/35430 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@libreoffice.org>
2017-02-16ios update to make TiledLibreOffice compile/linkjan Iversen
changes needed to make TiledLibreOffice compile/link for ios-simulator. Remark: autogen.input need to have --disable-pdfium due to a missing <Carbon/Carbon.h> Change-Id: I3e1af26d99c35c3c552510f28e13a7e530fca09f Reviewed-on: https://gerrit.libreoffice.org/34145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@libreoffice.org>
2016-08-20Check arm64 tooTor Lillqvist
Change-Id: I51f89eb05f7844a7b0a99eab1587bbe333b96b09
2016-08-18Better fix for Objective-CTor Lillqvist
Not sure what the exact mechanism of the problem is, but anyway, this helps. Change-Id: I5812381af0e4f12fcbdd06eafb1eedc170ffb608
2016-08-17Revert "These 'inline' keywords are fairly pointless"Tor Lillqvist
Nah, they are a good idea in most cases. This reverts commit 1c8e4f74c63312fca5898452fae4ba32268fce65.
2016-08-17These 'inline' keywords are fairly pointlessTor Lillqvist
Change-Id: I1018ca4954282d0b62a254d509e29493588960c1
2016-08-09LOK init: strcpy() -> strncpy()Miklos Vajna
'strcpy' is insecure as it does not provide bounding of the memory buffer in general, so let's avoid it even here. Change-Id: If39319a2df7ddd9297938bc0be67fe5f8a2af962 Reviewed-on: https://gerrit.libreoffice.org/27999 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-04LOK init: avoid non-inline function definition in header fileMiklos Vajna
To prevent possible ODR violations. Change-Id: Ic9538244a0bf3760808904d2bcf608151c53f899 Reviewed-on: https://gerrit.libreoffice.org/27883 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-19In lok_init_2, allow vnd.sun.star.pathname user_profile_urlStephan Bergmann
...which takes a raw filesystem pathname that is internally converted to a file URL (similarly to what is supported for the INIFILENAME and URE_BOOTSTRAP bootstrap variables in rtl::Bootstrap). That way, the gtktiledviewer executable doesn't need to try convert a pathname into a URL. Also adapted various parameter names to make it obvious that URLs get passed, not pathnames. Change-Id: I33ab31fe142d94ee47885033ef48278ef5ff55a2 Reviewed-on: https://gerrit.libreoffice.org/24241 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-03-08New LOK_LOADLIB_GLOBAL to let clients control dlopen(RTLD_GLOBAL)Stephan Bergmann
...in LibreOfficeKintInit.h's lok_loadlib, now that RTLD_GLOBAL isn't only needed for UBSan (62b124b2704adf11a63681164d05a8eb49dfb105 "Ensure RTTI symbol visibility for Linux Clang -fsanitize=function,vptr") but also for -stdlib=libc++ on Linux (see <https://whatofhow.wordpress.com/2016/03/01/libclibcabi-on-linux/>). Change-Id: I24ed6612c3d922eba695423d46af5635c77f7077
2016-02-04Include headers using OpenBSD toocoypu
OpenBSD ports patch: http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/editors/libreoffice/patches/patch-include_LibreOfficeKit_LibreOfficeKitInit_h Change-Id: Ia3cebb41ca72bf022cc409814bed575cfbcfbf64 Reviewed-on: https://gerrit.libreoffice.org/22079 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-01-19Make LibreOffice kit usable on windowsOliver Specht
Uses Ascii variants of LoadLibrary,Get/SetEnvironmentVariable_A_ and adds a freeError function includes windows.h instead of pre/postwin.h Change-Id: I88b7e3ed3818078efec5688e207da47dc4049b98 Reviewed-on: https://gerrit.libreoffice.org/21600 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-12-07improve error message for nonexist. pathDavid Tardon
... which is currently somewhat misleading, because it mentions libmerged.so. Change-Id: I1ab21ce0fe2f94eba1831c2c977d900827f320f1
2015-12-07tdf#96243 don't crash if LibO install. wasn't foundDavid Tardon
Change-Id: I538e7238feb711a7d71faf745033264894f688f4
2015-11-28-Werror,-Wunused-functionStephan Bergmann
Change-Id: Icb5476f117ec44f5a4dc3026595305293b99fdd8
2015-11-28-Wmicrosoft-castStephan Bergmann
Change-Id: I205861dd46d635b4b7be87ec8eb84cb70d8bf4d7
2015-11-12Windows header sanitizationAshod Nakashian
Isolation of windows headers using prewin.h and postwin.h headers and making headers dependent on them more self contained. Conversion of TCHAR to WCHAR and LPCTSTR to LPCWSTR etc. and cleanup of unnecessary casts. Change-Id: I7eff5c477d9223a064bfb4d962ff6d61960ee69c Reviewed-on: https://gerrit.libreoffice.org/19901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-10-20Add DLOPEN_LIBS to configure for some cases where -ldl is neededRichard PALO
use std::sqrt in vcldemo.cxx Change-Id: I24d8ba15ee267d0cad3b063df9b7cfd8d284f4ee Reviewed-on: https://gerrit.libreoffice.org/18591 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-08-18lok: namespace and re-work various types & helper functions.Michael Meeks
Change-Id: I36e2a01822883251f9556fcde0e0a9830356ac98 Reviewed-on: https://gerrit.libreoffice.org/17833 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-04-24Don't be fooled by the dummy libsofficeapp.so in the mergedlib caseTor Lillqvist
Change-Id: If4bc9ee28091680fad78fbba585e0470f87dc830
2015-04-23No F_OK on Windows eitherTor Lillqvist
Change-Id: I5ecb340ffef46cca11492ddf7c1cd771d275cac1
2015-04-23No <unistd.h> on _WIN32Tor Lillqvist
Change-Id: I9bbeb434185b1517e120b1df9d474d913c867cf1
2015-04-23Improve error handlingTor Lillqvist
Change-Id: Id8661cb315f2f3a1bb398bce4f898342d5cce338
2015-04-23More informative error message after dlopen() or LoadLibrary() has failedTor Lillqvist
Change-Id: Iedf956c9bd78d1d23e5ee68772a000f90a39810e Reviewed-on: https://gerrit.libreoffice.org/15492 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2015-04-16CID#1294411: dlhandle is "leaked"Tor Lillqvist
Change-Id: Ie8dafb4d5dfd2ab09d71bc509f91e5c2c483bfb8