Fri, 09 Apr 2004 05:29:37 +0000
[gaim-migrate @ 9375]
wow.
| 7831 | 1 | /** |
| 2 | * @file tcl_win32.c Gaim Tcl Windows Init | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
| 6 | * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> | |
| 7 | * | |
| 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 | ||
| 30 | typedef Tcl_Interp* (CALLBACK* LPFNTCLCREATEINTERP)(); | |
| 31 | typedef void (CALLBACK* LPFNTKINIT)(Tcl_Interp*); | |
| 32 | ||
| 33 | LPFNTCLCREATEINTERP wtcl_CreateInterp = NULL; | |
| 34 | LPFNTKINIT wtk_Init = NULL; | |
| 35 | ||
| 36 | BOOL tcl_win32_init() { | |
| 37 | if(!(wtcl_CreateInterp=(LPFNTCLCREATEINTERP)wgaim_find_and_loadproc("tcl84.dll", "Tcl_CreateInterp"))) { | |
| 38 | gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tcl_CreateInterp\n"); | |
| 39 | return FALSE; | |
| 40 | } | |
| 41 | ||
| 42 | if(!(wtk_Init=(LPFNTKINIT)wgaim_find_and_loadproc("tk84.dll", "Tk_Init"))) { | |
| 43 | gaim_debug(GAIM_DEBUG_INFO, "tcl", "tcl_win32_init error loading Tk_Init\n"); | |
| 44 | return FALSE; | |
| 45 | } | |
| 46 | return TRUE; | |
| 47 | } | |
| 48 | ||
| 49 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { | |
| 50 | switch( fdwReason ) { | |
| 51 | case DLL_PROCESS_ATTACH: | |
| 52 | return tcl_win32_init(); | |
| 53 | ||
| 54 | case DLL_THREAD_ATTACH: | |
| 55 | break; | |
| 56 | ||
| 57 | case DLL_THREAD_DETACH: | |
| 58 | break; | |
| 59 | ||
| 60 | case DLL_PROCESS_DETACH: | |
| 61 | break; | |
| 62 | } | |
| 63 | return TRUE; | |
| 64 | } | |
| 65 | ||
| 66 |