diff --git a/hllapi.cbp b/hllapi.cbp
index 1caf025..4d5fd6d 100644
--- a/hllapi.cbp
+++ b/hllapi.cbp
@@ -44,6 +44,7 @@
+
diff --git a/src/core/hllapi.cc b/src/core/hllapi.cc
index 0510818..8f171dd 100644
--- a/src/core/hllapi.cc
+++ b/src/core/hllapi.cc
@@ -114,7 +114,7 @@ HLLAPI_API_CALL hllapi(const LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc
}
-static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc) {
+static int invalid_request(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
*rc = HLLAPI_STATUS_BAD_PARAMETER;
return *rc;
}
@@ -149,17 +149,17 @@ static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc)
}
-static int disconnect_ps(char *buffer, unsigned short *length, unsigned short *rc) {
+static int disconnect_ps(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
*rc = hllapi_deinit();
return HLLAPI_STATUS_SUCCESS;
}
-static int get_library_revision(char *buffer, unsigned short *length, unsigned short *rc) {
+static int get_library_revision(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
*rc = hllapi_get_revision();
return HLLAPI_STATUS_SUCCESS;
}
-static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) {
+static int get_cursor_position(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
try {
@@ -181,7 +181,7 @@ static int get_cursor_position(char *buffer, unsigned short *length, unsigned sh
}
-static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) {
+static int set_cursor_position(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
try {
@@ -247,7 +247,7 @@ static int search_ps(char *buffer, unsigned short *length, unsigned short *ps) {
size_t pos = string::npos;
- if(length > 0) {
+ if(length) {
pos = getSession().find(string((const char *) buffer,(size_t) length).c_str());
@@ -280,7 +280,7 @@ static int search_ps(char *buffer, unsigned short *length, unsigned short *ps) {
}
-static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) {
+static int copy_ps(char *buffer, unsigned short *length, unsigned short GNUC_UNUSED(*rc)) {
//
// Data String Preallocated target string the size of your host presentation space. This can vary depending on how your host presentation space
@@ -351,7 +351,7 @@ static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) {
}
-static int wait_system(char *buffer, unsigned short *length, unsigned short *rc) {
+static int wait_system(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
//
// Checks the status of the host-connected presentation space. If the session is
@@ -372,6 +372,7 @@ static int wait_system(char *buffer, unsigned short *length, unsigned short *rc)
//
int state = hllapi_wait_for_ready(60);
+ *rc = (unsigned short) state;
return (state == HLLAPI_STATUS_WAITING ? HLLAPI_STATUS_TIMEOUT : state);
}
@@ -399,12 +400,14 @@ static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps
return hllapi_emulate_input(text,*length,0);
}
-static int reset_system(char *buffer, unsigned short *length, unsigned short *rc) {
- return hllapi_kybdreset();
+static int reset_system(char GNUC_UNUSED(*buffer), unsigned short GNUC_UNUSED(*length), unsigned short *rc) {
+ int state = hllapi_kybdreset();
+ *rc = (unsigned short) state;
+ return state;
}
-static int pause_system(char *buffer, unsigned short *length, unsigned short *rc) {
+static int pause_system(char GNUC_UNUSED(*buffer), unsigned short *length, unsigned short *rc) {
if(!*length)
{
@@ -427,7 +430,10 @@ static int pause_system(char *buffer, unsigned short *length, unsigned short *rc
}
// Pause "flexivel", aguarda mudança no conteúdo da tela!!!
- return hllapi_wait_for_change((*length) / 2);
+ int state = hllapi_wait_for_change((*length) / 2);
+
+ *rc = (unsigned short) state;
+ return state;
}
diff --git a/src/core/private.h b/src/core/private.h
index c64ec21..21c9fb0 100644
--- a/src/core/private.h
+++ b/src/core/private.h
@@ -42,6 +42,23 @@
#include
#include
+ //
+ // Compiler-specific #defines.
+ //
+ // Reference: GLIBC gmacros.h
+ //
+ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+
+ #define GNUC_UNUSED \
+ __attribute__((__unused__))
+
+ #else
+
+ #define GNUC_UNUSED
+
+ #endif
+
+
using std::runtime_error;
using std::string;
using TN3270::Host;
diff --git a/src/core/set.cc b/src/core/set.cc
index 13578d6..a99beef 100644
--- a/src/core/set.cc
+++ b/src/core/set.cc
@@ -118,7 +118,7 @@
}
- HLLAPI_API_CALL hllapi_emulate_input(const LPSTR text, WORD length, WORD pasting)
+ HLLAPI_API_CALL hllapi_emulate_input(const LPSTR text, WORD length, WORD GNUC_UNUSED(pasting))
{
if(!(text && *text))
return HLLAPI_STATUS_BAD_PARAMETER;
diff --git a/src/core/tools.cc b/src/core/tools.cc
index c4f206e..127c876 100644
--- a/src/core/tools.cc
+++ b/src/core/tools.cc
@@ -32,75 +32,6 @@
/*--[ Implement ]------------------------------------------------------------------------------------*/
- HLLAPI_API_CALL hllapi_get_datadir(LPSTR datadir) {
-
- LSTATUS rc;
- HKEY hKey = 0;
- unsigned long szDatadir = strlen(datadir);
-
- static const char * keys[] = {
-
- "Software\\" LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME),
- "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME),
-
-#ifdef LIB3270_NAME
- "Software\\" LIB3270_STRINGIZE_VALUE_OF(LIB3270_NAME),
- "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" LIB3270_STRINGIZE_VALUE_OF(LIB3270_NAME),
-#endif
-
- "Software\\pw3270",
- "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\pw3270"
- };
-
- size_t ix;
-
- string installLocation;
-
- *datadir = 0;
-
- for(ix = 0; !*datadir && ix < (sizeof(keys)/sizeof(keys[0])); ix++) {
-
- rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE,keys[ix],0,KEY_QUERY_VALUE,&hKey);
- if(rc == ERROR_SUCCESS) {
-
- unsigned long datatype; // #defined in winnt.h (predefined types 0-11)
- unsigned long datalen = (unsigned long) szDatadir;
-
- memset(datadir,0,datalen);
-
- rc = RegQueryValueExA(hKey,"InstallLocation",NULL,&datatype,(LPBYTE) datadir,&datalen);
- if(rc != ERROR_SUCCESS) {
- *datadir = 0; // Just in case
- }
-
- RegCloseKey(hKey);
-
- }
-
- }
-
-
-
- /*
- #ifdef _WIN32
- HKEY hKey = 0;
- unsigned long datalen = strlen(datadir);
-
- *datadir = 0;
-
- if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\pw3270",0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS)
- {
- unsigned long datatype; // #defined in winnt.h (predefined types 0-11)
- if(RegQueryValueExA(hKey,"datadir",NULL,&datatype,(LPBYTE) datadir,&datalen) != ERROR_SUCCESS)
- *datadir = 0;
- RegCloseKey(hKey);
- }
-#endif // _WIN32
-*/
-
- return *datadir;
- }
-
DWORD hllapi_translate_error(LIB3270_KEYBOARD_LOCK_STATE state) {
// Is unlocked.
diff --git a/src/core/windows/init.cc b/src/core/windows/init.cc
index 8d29ed1..b4a519a 100644
--- a/src/core/windows/init.cc
+++ b/src/core/windows/init.cc
@@ -70,7 +70,7 @@
static HANDLE hModule = 0;
static HANDLE hEventLog = 0;
- BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwcallpurpose, LPVOID lpvResvd) {
+ BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwcallpurpose, LPVOID GNUC_UNUSED(lpvResvd)) {
switch(dwcallpurpose) {
case DLL_PROCESS_ATTACH:
hModule = hInstance;
diff --git a/src/core/windows/tools.cc b/src/core/windows/tools.cc
new file mode 100644
index 0000000..327824e
--- /dev/null
+++ b/src/core/windows/tools.cc
@@ -0,0 +1,103 @@
+/*
+ * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
+ * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
+ * aplicativos mainframe. Registro no INPI sob o nome G3270.
+ *
+ * Copyright (C) <2008>
+ *
+ * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
+ * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
+ * Free Software Foundation.
+ *
+ * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
+ * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
+ * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
+ * obter mais detalhes.
+ *
+ * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
+ * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA, 02111-1307, USA
+ *
+ * Este programa está nomeado como - e possui - linhas de código.
+ *
+ * Contatos:
+ *
+ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
+ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
+ *
+ */
+
+ #include "../private.h"
+ #include
+
+/*--[ Implement ]------------------------------------------------------------------------------------*/
+
+ HLLAPI_API_CALL hllapi_get_datadir(LPSTR datadir) {
+
+ LSTATUS rc;
+ HKEY hKey = 0;
+ unsigned long szDatadir = strlen(datadir);
+
+ static const char * keys[] = {
+
+ "Software\\" LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME),
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" LIB3270_STRINGIZE_VALUE_OF(PRODUCT_NAME),
+
+#ifdef LIB3270_NAME
+ "Software\\" LIB3270_STRINGIZE_VALUE_OF(LIB3270_NAME),
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" LIB3270_STRINGIZE_VALUE_OF(LIB3270_NAME),
+#endif
+
+ "Software\\pw3270",
+ "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\pw3270"
+ };
+
+ size_t ix;
+
+ string installLocation;
+
+ *datadir = 0;
+
+ for(ix = 0; !*datadir && ix < (sizeof(keys)/sizeof(keys[0])); ix++) {
+
+ rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE,keys[ix],0,KEY_QUERY_VALUE,&hKey);
+ if(rc == ERROR_SUCCESS) {
+
+ unsigned long datatype; // #defined in winnt.h (predefined types 0-11)
+ unsigned long datalen = (unsigned long) szDatadir;
+
+ memset(datadir,0,datalen);
+
+ rc = RegQueryValueExA(hKey,"InstallLocation",NULL,&datatype,(LPBYTE) datadir,&datalen);
+ if(rc != ERROR_SUCCESS) {
+ *datadir = 0; // Just in case
+ }
+
+ RegCloseKey(hKey);
+
+ }
+
+ }
+
+
+
+ /*
+ #ifdef _WIN32
+ HKEY hKey = 0;
+ unsigned long datalen = strlen(datadir);
+
+ *datadir = 0;
+
+ if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\pw3270",0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS)
+ {
+ unsigned long datatype; // #defined in winnt.h (predefined types 0-11)
+ if(RegQueryValueExA(hKey,"datadir",NULL,&datatype,(LPBYTE) datadir,&datalen) != ERROR_SUCCESS)
+ *datadir = 0;
+ RegCloseKey(hKey);
+ }
+#endif // _WIN32
+*/
+
+ return *datadir;
+ }
+
diff --git a/win/hllapi.nsi b/win/hllapi.nsi
index f8778d3..0905a3c 100644
--- a/win/hllapi.nsi
+++ b/win/hllapi.nsi
@@ -4,11 +4,11 @@
Name "hllapi"
Caption "hllapi - PW3270 HLLAPI Module"
-outfile "hllapi-5.2.19.9-x86_64.exe"
+outfile "hllapi-5.2.19.9-i686.exe"
XPStyle on
-installDir "$PROGRAMFILES64\hllapi"
+installDir "$PROGRAMFILES\hllapi"
# Get installation folder from registry if available
InstallDirRegKey HKLM "Software\hllapi" "InstallLocation"
@@ -17,10 +17,10 @@ RequestExecutionLevel admin
# Properties
VIProductVersion "5.2.19.9"
-VIFileVersion "19.9.23.14"
+VIFileVersion "19.9.23.15"
VIAddVersionKey "ProductVersion" "5.2.19.9"
-VIAddVersionKey "FileVersion" "19.9.23.14"
+VIAddVersionKey "FileVersion" "19.9.23.15"
VIAddVersionKey "ProductName" "hllapi"
VIAddVersionKey "FileDescription" "PW3270 HLLAPI Module"
@@ -51,7 +51,7 @@ SubSection "hllapi" SecMain
Section "Core" SecCore
- SetRegView 64
+ SetRegView 32
${DisableX64FSRedirection}
# define the output path for this file
@@ -107,7 +107,7 @@ Section "Uninstall"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\hllapi"
DeleteRegKey HKLM "Software\hllapi"
- SetRegView 64
+ SetRegView 32
DeleteRegKey HKLM "Software\hllapi"
SectionEnd
--
libgit2 0.21.2