Tue, 07 Mar 2006 05:09:51 +0000
[gaim-migrate @ 15808]
Whitespace and warning fixes
| 7831 | 1 | /** |
| 2 | * @file tcl_win32.c Gaim Tcl Windows Init | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 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 | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program 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 | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 21 | */ | |
| 22 | #include "internal.h" | |
| 23 | #include "debug.h" | |
| 24 | #include <tcl.h> | |
| 25 | ||
| 26 | #ifdef HAVE_TK | |
| 27 | #include <tk.h> | |
| 28 | #endif | |
| 29 | ||
| 12405 | 30 | typedef Tcl_Interp* (CALLBACK* LPFNTCLCREATEINTERP)(void); |
| 7831 | 31 | typedef void (CALLBACK* LPFNTKINIT)(Tcl_Interp*); |
| 32 | ||
| 33 | LPFNTCLCREATEINTERP wtcl_CreateInterp = NULL; | |
| 34 | LPFNTKINIT wtk_Init = NULL; | |
| 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 | 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 | 47 | } |
| 48 | ||
| 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 | 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 | 60 | } |
| 61 |