41 # define LTDL_GLOBAL RTLD_GLOBAL
44 # define LTDL_GLOBAL DL_GLOBAL
46 # define LTDL_GLOBAL 0
51 #include <tdeio/authinfo.h>
52 extern "C" TDEIO::AuthInfo* _tdeioslave_init_tdeio() {
return new TDEIO::AuthInfo(); }
54 int main(
int argc,
char **argv)
58 fprintf(stderr,
"Usage: tdeioslave <slave-lib> <protocol> <tdelauncher-socket> <app-socket>\n\nThis program is part of TDE.\n");
61 TQCString libpath = argv[1];
63 if (libpath.isEmpty())
65 fprintf(stderr,
"library path is empty.\n");
70 lt_dlhandle handle = lt_dlopen( libpath.data() );
73 const char * ltdlError = lt_dlerror();
74 fprintf(stderr,
"could not open %s: %s", libpath.data(), ltdlError != 0 ? ltdlError :
"(null)" );
78 lt_ptr sym = lt_dlsym( handle,
"kdemain");
81 sym = lt_dlsym( handle,
"main");
84 const char * ltdlError = lt_dlerror();
85 fprintf(stderr,
"Could not find main: %s\n", ltdlError != 0 ? ltdlError :
"(null)" );
90 int (*func)(int,
char *[]) = (
int (*)(int,
char *[])) sym;
92 exit( func(argc-1, argv+1));