• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeinit
 

tdeinit

  • tdeinit
tdeioslave.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 1999-2000 Waldo Bastian <bastian@kde.org>
4  * (c) 1999 Mario Weilguni <mweilguni@sime.com>
5  * (c) 2001 Lubos Lunak <l.lunak@kde.org>
6  *
7  * $Id$
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License version 2 as published by the Free Software Foundation.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB. If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <errno.h>
31 
32 #include <tqstring.h>
33 
34 #include "ltdl.h"
35 
36 #ifdef HAVE_DLFCN_H
37 # include <dlfcn.h>
38 #endif
39 
40 #ifdef RTLD_GLOBAL
41 # define LTDL_GLOBAL RTLD_GLOBAL
42 #else
43 # ifdef DL_GLOBAL
44 # define LTDL_GLOBAL DL_GLOBAL
45 # else
46 # define LTDL_GLOBAL 0
47 # endif
48 #endif
49 
50 /* These are to link libtdeio even if 'smart' linker is used */
51 #include <tdeio/authinfo.h>
52 extern "C" TDEIO::AuthInfo* _tdeioslave_init_tdeio() { return new TDEIO::AuthInfo(); }
53 
54 int main(int argc, char **argv)
55 {
56  if (argc < 5)
57  {
58  fprintf(stderr, "Usage: tdeioslave <slave-lib> <protocol> <tdelauncher-socket> <app-socket>\n\nThis program is part of TDE.\n");
59  exit(1);
60  }
61  TQCString libpath = argv[1];
62 
63  if (libpath.isEmpty())
64  {
65  fprintf(stderr, "library path is empty.\n");
66  exit(1);
67  }
68  lt_dlinit();
69 
70  lt_dlhandle handle = lt_dlopen( libpath.data() );
71  if (!handle )
72  {
73  const char * ltdlError = lt_dlerror();
74  fprintf(stderr, "could not open %s: %s", libpath.data(), ltdlError != 0 ? ltdlError : "(null)" );
75  exit(1);
76  }
77 
78  lt_ptr sym = lt_dlsym( handle, "kdemain");
79  if (!sym )
80  {
81  sym = lt_dlsym( handle, "main");
82  if (!sym )
83  {
84  const char * ltdlError = lt_dlerror();
85  fprintf(stderr, "Could not find main: %s\n", ltdlError != 0 ? ltdlError : "(null)" );
86  exit(1);
87  }
88  }
89 
90  int (*func)(int, char *[]) = (int (*)(int, char *[])) sym;
91 
92  exit( func(argc-1, argv+1)); /* Launch! */
93 }

tdeinit

Skip menu "tdeinit"
  • Main Page
  • File List
  • Related Pages

tdeinit

Skip menu "tdeinit"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeinit by doxygen 1.8.8
This website is maintained by Timothy Pearson.