plugins/tcl/tcl_win32.c

Tue, 07 Mar 2006 05:09:51 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Tue, 07 Mar 2006 05:09:51 +0000
changeset 13434
84a853406b14
parent 12405
4575a63da9a6
permissions
-rw-r--r--

[gaim-migrate @ 15808]
Whitespace and warning fixes

7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
1 /**
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
2 * @file tcl_win32.c Gaim Tcl Windows Init
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
3 *
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
4 * gaim
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
5 *
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
6 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com>
13434
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
7 *
7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
11 * (at your option) any later version.
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
12 *
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
16 * GNU General Public License for more details.
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
17 *
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
21 */
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
22 #include "internal.h"
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
23 #include "debug.h"
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
24 #include <tcl.h>
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
25
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
26 #ifdef HAVE_TK
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
27 #include <tk.h>
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
28 #endif
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
29
12405
4575a63da9a6 [gaim-migrate @ 14712]
Richard Laager <rlaager@pidgin.im>
parents: 7831
diff changeset
30 typedef Tcl_Interp* (CALLBACK* LPFNTCLCREATEINTERP)(void);
7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
31 typedef void (CALLBACK* LPFNTKINIT)(Tcl_Interp*);
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
32
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
33 LPFNTCLCREATEINTERP wtcl_CreateInterp = NULL;
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
34 LPFNTKINIT wtk_Init = NULL;
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
35
13434
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
36 static BOOL tcl_win32_init() {
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
37 if(!(wtcl_CreateInterp = (LPFNTCLCREATEINTERP) wgaim_find_and_loadproc("tcl84.dll", "Tcl_CreateInterp"))) {
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
38 gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tcl_CreateInterp\n");
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
39 return FALSE;
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
40 }
7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
41
13434
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
42 if(!(wtk_Init = (LPFNTKINIT) wgaim_find_and_loadproc("tk84.dll", "Tk_Init"))) {
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
43 gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tk_Init\n");
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
44 return FALSE;
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
45 }
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
46 return TRUE;
7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
47 }
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
48
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
49 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
13434
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
50 switch (fdwReason) {
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
51 case DLL_PROCESS_ATTACH:
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
52 return tcl_win32_init();
7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
53
13434
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
54 case DLL_THREAD_ATTACH:
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
55 case DLL_THREAD_DETACH:
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
56 case DLL_PROCESS_DETACH:
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
57 break;
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
58 }
84a853406b14 [gaim-migrate @ 15808]
Daniel Atallah <datallah@pidgin.im>
parents: 12405
diff changeset
59 return TRUE;
7831
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
60 }
54076c9af6ad [gaim-migrate @ 8483]
Herman Bloggs <herman@bluedigits.com>
parents:
diff changeset
61

mercurial