Commit ab0061ad47d794ff6b0a1eb1f145760ae9eb3021
1 parent
a76e4aa2
Exists in
master
and in
1 other branch
Implementing windows DLL initialization.
Showing
2 changed files
with
74 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,71 @@ | @@ -0,0 +1,71 @@ | ||
1 | +/* | ||
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | ||
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | ||
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | ||
5 | + * | ||
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | ||
7 | + * | ||
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | ||
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | ||
10 | + * Free Software Foundation. | ||
11 | + * | ||
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | ||
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | ||
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | ||
15 | + * obter mais detalhes. | ||
16 | + * | ||
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | ||
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | ||
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | + * | ||
21 | + * Este programa está nomeado como - e possui - linhas de código. | ||
22 | + * | ||
23 | + * Contatos: | ||
24 | + * | ||
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | ||
27 | + * | ||
28 | + */ | ||
29 | + | ||
30 | + #include <config.h> | ||
31 | + | ||
32 | + #include <winsock2.h> | ||
33 | + #include <windows.h> | ||
34 | + | ||
35 | + #include <internals.h> | ||
36 | + #include <locale.h> | ||
37 | + #include <libintl.h> | ||
38 | + | ||
39 | +/*---[ Implement ]-----------------------------------------------------------------------------------------*/ | ||
40 | + | ||
41 | +BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwcallpurpose, LPVOID G_GNUC_UNUSED(lpvResvd)) | ||
42 | +{ | ||
43 | + switch(dwcallpurpose) | ||
44 | + { | ||
45 | + case DLL_PROCESS_ATTACH: | ||
46 | + { | ||
47 | + char lpFilename[4096]; | ||
48 | + | ||
49 | + memset(lpFilename,0,sizeof(lpFilename)); | ||
50 | + DWORD szPath = GetModuleFileName(hInstance,lpFilename,4095); | ||
51 | + lpFilename[szPath] = 0; | ||
52 | + | ||
53 | + char * ptr = strrchr(lpFilename,'\\'); | ||
54 | + if(ptr) | ||
55 | + ptr[1] = 0; | ||
56 | + | ||
57 | + strncat(lpFilename,"locale",4095); | ||
58 | + | ||
59 | + bindtextdomain(GETTEXT_PACKAGE,lpFilename); | ||
60 | + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); | ||
61 | + | ||
62 | + } | ||
63 | + break; | ||
64 | + | ||
65 | + case DLL_PROCESS_DETACH: | ||
66 | + break; | ||
67 | + | ||
68 | + } | ||
69 | + | ||
70 | + return TRUE; | ||
71 | +} |
v3270.cbp
@@ -355,6 +355,9 @@ | @@ -355,6 +355,9 @@ | ||
355 | <Unit filename="src/terminal/widget.c"> | 355 | <Unit filename="src/terminal/widget.c"> |
356 | <Option compilerVar="CC" /> | 356 | <Option compilerVar="CC" /> |
357 | </Unit> | 357 | </Unit> |
358 | + <Unit filename="src/terminal/windows/init.c"> | ||
359 | + <Option compilerVar="CC" /> | ||
360 | + </Unit> | ||
358 | <Unit filename="src/terminal/windows/iosource.c"> | 361 | <Unit filename="src/terminal/windows/iosource.c"> |
359 | <Option compilerVar="CC" /> | 362 | <Option compilerVar="CC" /> |
360 | </Unit> | 363 | </Unit> |