1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
15 #include <osl/module.h>
16 #include <sal/types.h>
17 #include <liblibreoffice.hxx>
24 #define TARGET_LIB SAL_MODULENAME( "sofficeapp" )
27 typedef LibLibreOffice
*(HookFunction
)(void);
30 SAL_DLLPUBLIC_EXPORT LibLibreOffice
*lo_init( const char *install_path
)
34 char* imp_lib
= (char *) malloc( strlen (install_path
) + sizeof( TARGET_LIB
) + 2 );
37 fprintf( stderr
, "failed to open library : not enough memory\n");
40 strcpy( imp_lib
, install_path
);
41 strcat( imp_lib
, "/" );
42 strcat( imp_lib
, TARGET_LIB
);
43 void *dlhandle
= dlopen( imp_lib
, RTLD_LAZY
);
46 fprintf( stderr
, "failed to open library '%s'\n", imp_lib
);
51 HookFunction
*pSym
= (HookFunction
*) dlsym( dlhandle
, "liblibreoffice_hook" );
53 fprintf( stderr
, "failed to find hook in library '%s'\n", imp_lib
);
62 #endif // LINUX - port me !
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */