diff --git a/lib3270.cbp b/lib3270.cbp index 671c57e..286c69b 100644 --- a/lib3270.cbp +++ b/lib3270.cbp @@ -210,6 +210,7 @@ + @@ -230,7 +231,6 @@ - diff --git a/src/core/ansi.c b/src/core/ansi.c index d79dd27..bc55047 100644 --- a/src/core/ansi.c +++ b/src/core/ansi.c @@ -41,6 +41,7 @@ #endif // _WIN32 #include +#include #if defined(X3270_ANSI) /*[*/ diff --git a/src/core/connect.c b/src/core/connect.c index ff5d762..652a8f7 100644 --- a/src/core/connect.c +++ b/src/core/connect.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #if defined(HAVE_LIBSSL) diff --git a/src/core/ctlr.c b/src/core/ctlr.c index f020174..fce1bee 100644 --- a/src/core/ctlr.c +++ b/src/core/ctlr.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/src/core/cursor.c b/src/core/cursor.c index 36fa865..6c3987b 100644 --- a/src/core/cursor.c +++ b/src/core/cursor.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "kybdc.h" #include "ctlrc.h" diff --git a/src/core/host.c b/src/core/host.c index 8bd0883..de14f98 100644 --- a/src/core/host.c +++ b/src/core/host.c @@ -56,6 +56,7 @@ #include #include #include +#include /** * @brief Called from timer to attempt an automatic reconnection. diff --git a/src/core/iocalls.c b/src/core/iocalls.c index 8d6d376..f51f380 100644 --- a/src/core/iocalls.c +++ b/src/core/iocalls.c @@ -50,6 +50,7 @@ #include #include +#include #define MILLION 1000000L // diff --git a/src/core/keyboard/kybd.c b/src/core/keyboard/kybd.c index ce6efe2..bc564a1 100644 --- a/src/core/keyboard/kybd.c +++ b/src/core/keyboard/kybd.c @@ -42,6 +42,7 @@ struct ta; #include #include #include +#include #ifndef ANDROID #include diff --git a/src/core/paste.c b/src/core/paste.c index 72e4d1e..483df4f 100644 --- a/src/core/paste.c +++ b/src/core/paste.c @@ -79,6 +79,7 @@ #include #include #include +#include /*---[ Struct ]-------------------------------------------------------------------------------------------------*/ diff --git a/src/core/screen.c b/src/core/screen.c index f934b2f..59561d0 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -52,6 +52,7 @@ #include "togglesc.h" #include #include +#include #if defined(_WIN32) #include diff --git a/src/core/telnet.c b/src/core/telnet.c index 870a266..060d185 100644 --- a/src/core/telnet.c +++ b/src/core/telnet.c @@ -104,6 +104,7 @@ #include #include #include +#include #if !defined(TELOPT_NAWS) /*[*/ #define TELOPT_NAWS 31 diff --git a/src/core/toggles.c b/src/core/toggles.c index cd51a6c..c9010d6 100644 --- a/src/core/toggles.c +++ b/src/core/toggles.c @@ -18,7 +18,7 @@ * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin * St, Fifth Floor, Boston, MA 02110-1301 USA * - * Este programa está nomeado como toggles.c e possui 253 linhas de código. + * Este programa está nomeado como toggles.c e possui - linhas de código. * * Contatos: * @@ -31,9 +31,9 @@ */ -/* - * toggles.c - * This module handles toggles. +/** + * @file toggles.c + * @brief This module handles toggles. */ #include @@ -48,7 +48,7 @@ #endif // !WIN32 #include -#include "toggle.h" +#include #include #include "ansic.h" @@ -250,10 +250,10 @@ LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *session, LIB3270_TOGGLE i static void toggle_notify(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE ix) { trace("%s: ix=%d upcall=%p",__FUNCTION__,ix,t->upcall); - t->upcall(session, t, TT_INTERACTIVE); + t->upcall(session, t, LIB3270_TOGGLE_TYPE_INTERACTIVE); if(session->cbk.update_toggle) - session->cbk.update_toggle(session,ix,t->value,TT_INTERACTIVE,toggle_info[ix].name); + session->cbk.update_toggle(session,ix,t->value,LIB3270_TOGGLE_TYPE_INTERACTIVE,toggle_info[ix].name); } @@ -362,7 +362,7 @@ void initialize_toggles(H3270 *session) { session->toggle[f].value = toggle_info[f].def; if(session->toggle[f].value) - session->toggle[f].upcall(session,&session->toggle[f],TT_INITIAL); + session->toggle[f].upcall(session,&session->toggle[f],LIB3270_TOGGLE_TYPE_INITIAL); } } @@ -373,7 +373,7 @@ void initialize_toggles(H3270 *session) void shutdown_toggles(H3270 *session) { #if defined(X3270_TRACE) - static const LIB3270_TOGGLE disable_on_shutdown[] = {DS_TRACE, EVENT_TRACE, SCREEN_TRACE}; + static const LIB3270_TOGGLE disable_on_shutdown[] = {LIB3270_TOGGLE_DS_TRACE, LIB3270_TOGGLE_EVENT_TRACE, LIB3270_TOGGLE_SCREEN_TRACE}; size_t f; @@ -383,21 +383,21 @@ void shutdown_toggles(H3270 *session) #endif } -LIB3270_EXPORT const char * lib3270_get_toggle_label(LIB3270_TOGGLE_ID ix) +LIB3270_EXPORT const char * lib3270_get_toggle_label(LIB3270_TOGGLE ix) { if(ix < LIB3270_TOGGLE_COUNT) return toggle_info[ix].label; return ""; } -LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE_ID ix) +LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE ix) { if(ix < LIB3270_TOGGLE_COUNT) return toggle_info[ix].description; return ""; } -LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix) +LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE ix) { if(ix < LIB3270_TOGGLE_COUNT) return toggle_info[ix].name; diff --git a/src/core/trace_ds.c b/src/core/trace_ds.c index c2a1f44..37a073c 100644 --- a/src/core/trace_ds.c +++ b/src/core/trace_ds.c @@ -62,7 +62,7 @@ #include "telnetc.h" #include "trace_dsc.h" #include "utilc.h" -#include "toggle.h" +#include /* Maximum size of a tracefile header. */ #define MAX_HEADER_SIZE (10*1024) @@ -88,7 +88,7 @@ static void trace_ds_s(H3270 *hSession, char *s, Boolean can_break) int len = strlen(s); Boolean nl = False; - if (!lib3270_get_toggle(hSession,DS_TRACE) || !len) + if (!lib3270_get_toggle(hSession,LIB3270_TOGGLE_DS_TRACE) || !len) return; if (s && s[len-1] == '\n') @@ -131,7 +131,7 @@ void trace_ds(H3270 *hSession, const char *fmt, ...) char * text; va_list args; - if (!lib3270_get_toggle(hSession,DS_TRACE)) + if (!lib3270_get_toggle(hSession,LIB3270_TOGGLE_DS_TRACE)) return; va_start(args, fmt); @@ -148,7 +148,7 @@ void trace_ds_nb(H3270 *hSession, const char *fmt, ...) char *text; va_list args; - if (!lib3270_get_toggle(hSession,DS_TRACE)) + if (!lib3270_get_toggle(hSession,LIB3270_TOGGLE_DS_TRACE)) return; va_start(args, fmt); @@ -166,7 +166,7 @@ void trace_dsn(H3270 *session, const char *fmt, ...) { va_list args; - if (!lib3270_get_toggle(session,DS_TRACE)) + if (!lib3270_get_toggle(session,LIB3270_TOGGLE_DS_TRACE)) return; /* print out message */ diff --git a/src/core/windows/connect.c b/src/core/windows/connect.c index c6a4203..ddb98d8 100644 --- a/src/core/windows/connect.c +++ b/src/core/windows/connect.c @@ -41,6 +41,7 @@ #include #include #include +#include #ifdef HAVE_ICONV #include diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 54829d5..e6c865a 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -850,77 +850,6 @@ LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned char *chr, unsigned short *attr); /** - * @brief get toggle state. - * - * @param h Session handle. - * @param ix Toggle id. - * - * @return 0 if the toggle is disabled, non zero if enabled. - * - */ - LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *h, LIB3270_TOGGLE ix); - - /** - * @brief Set toggle state. - * - * @param h Session handle. - * @param ix Toggle id. - * @param value New toggle state (non zero for true). - * - * @returns 0 if the toggle is already at the state, 1 if the toggle was changed; < 0 on error (sets errno). - */ - LIB3270_EXPORT int lib3270_set_toggle(H3270 *h, LIB3270_TOGGLE ix, int value); - - /** - * @brief Translate a string toggle name to the corresponding value. - * - * @param name Toggle name. - * - * @return Toggle ID or -1 if it's invalid. - * - */ - LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name); - - /** - * @brief Get the toggle name as string. - * - * @param id Toggle id - * - * @return Constant string with the toggle name or "" if invalid. - * - */ - LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE ix); - - /** - * @brief Get a long description of the toggle. - * - * @return Constant string with the toggle description. - * - */ - LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE ix); - - /** - * @brief Get a short description of the toggle (for menus). - * - * @return Constant string with the toggle label. - * - */ - LIB3270_EXPORT const char * lib3270_get_toggle_label(LIB3270_TOGGLE ix); - - /** - * @brief Revert toggle status. - * - * @param h Session handle. - * @param ix Toggle id. - * - * @return Toggle status. - */ - LIB3270_EXPORT int lib3270_toggle(H3270 *h, LIB3270_TOGGLE ix); - - LIB3270_EXPORT void lib3270_set_session_id(H3270 *hSession, char id); - LIB3270_EXPORT char lib3270_get_session_id(H3270 *hSession); - - /** * @brief IO flags. * */ diff --git a/src/include/lib3270/toggle.h b/src/include/lib3270/toggle.h new file mode 100644 index 0000000..2ee606e --- /dev/null +++ b/src/include/lib3270/toggle.h @@ -0,0 +1,107 @@ +/* + * "Software G3270, 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., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como toggle.h e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) + * + */ + +#ifndef LIB3270_TOGGLE_H_INCLUDED + + #define LIB3270_TOGGLE_H_INCLUDED 1 + + #include + + /** + * @brief get toggle state. + * + * @param h Session handle. + * @param ix Toggle id. + * + * @return 0 if the toggle is disabled, non zero if enabled. + * + */ + LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *h, LIB3270_TOGGLE ix); + + /** + * @brief Set toggle state. + * + * @param h Session handle. + * @param ix Toggle id. + * @param value New toggle state (non zero for true). + * + * @returns 0 if the toggle is already at the state, 1 if the toggle was changed; < 0 on error (sets errno). + */ + LIB3270_EXPORT int lib3270_set_toggle(H3270 *h, LIB3270_TOGGLE ix, int value); + + /** + * @brief Translate a string toggle name to the corresponding value. + * + * @param name Toggle name. + * + * @return Toggle ID or -1 if it's invalid. + * + */ + LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name); + + /** + * @brief Get the toggle name as string. + * + * @param id Toggle id + * + * @return Constant string with the toggle name or "" if invalid. + * + */ + LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE ix); + + /** + * @brief Get a long description of the toggle. + * + * @return Constant string with the toggle description. + * + */ + LIB3270_EXPORT const char * lib3270_get_toggle_description(LIB3270_TOGGLE ix); + + /** + * @brief Get a short description of the toggle (for menus). + * + * @return Constant string with the toggle label. + * + */ + LIB3270_EXPORT const char * lib3270_get_toggle_label(LIB3270_TOGGLE ix); + + /** + * @brief Revert toggle status. + * + * @param h Session handle. + * @param ix Toggle id. + * + * @return Toggle status. + */ + LIB3270_EXPORT int lib3270_toggle(H3270 *h, LIB3270_TOGGLE ix); + + LIB3270_EXPORT void lib3270_set_session_id(H3270 *hSession, char id); + LIB3270_EXPORT char lib3270_get_session_id(H3270 *hSession); + +#endif /* LIB3270_TOGGLE_H_INCLUDED */ diff --git a/src/include/toggle.h b/src/include/toggle.h deleted file mode 100644 index a8b427e..0000000 --- a/src/include/toggle.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * "Software G3270, 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., 51 Franklin - * St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Este programa está nomeado como toggle.h e possui 77 linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) - * licinio@bb.com.br (Licínio Luis Branco) - * kraucer@bb.com.br (Kraucer Fernandes Mazuco) - * - */ - -#ifndef TOGGLE3270_H_INCLUDED - - #define TOGGLE3270_H_INCLUDED 1 - - #include - - #define TT_INITIAL LIB3270_TOGGLE_TYPE_INITIAL - #define TT_INTERACTIVE LIB3270_TOGGLE_TYPE_INTERACTIVE - #define TT_ACTION LIB3270_TOGGLE_TYPE_ACTION - #define TT_FINAL LIB3270_TOGGLE_TYPE_FINAL - #define TT_UPDATE LIB3270_TOGGLE_TYPE_UPDATE - - #define MONOCASE LIB3270_TOGGLE_MONOCASE - #define ALT_CURSOR LIB3270_TOGGLE_ALT_CURSOR - #define CURSOR_BLINK LIB3270_TOGGLE_CURSOR_BLINK - #define SHOW_TIMING LIB3270_TOGGLE_SHOW_TIMING - #define CURSOR_POS LIB3270_TOGGLE_CURSOR_POS - #define DS_TRACE LIB3270_TOGGLE_DS_TRACE - #define SCROLL_BAR LIB3270_TOGGLE_SCROLL_BAR - #define LINE_WRAP LIB3270_TOGGLE_LINE_WRAP -// #define BLANK_FILL LIB3270_TOGGLE_BLANK_FILL - #define SCREEN_TRACE LIB3270_TOGGLE_SCREEN_TRACE - #define EVENT_TRACE LIB3270_TOGGLE_EVENT_TRACE -// #define MARGINED_PASTE LIB3270_TOGGLE_MARGINED_PASTE - #define RECTANGLE_SELECT LIB3270_TOGGLE_RECTANGLE_SELECT - #define CROSSHAIR LIB3270_TOGGLE_CROSSHAIR -// #define VISIBLE_CONTROL LIB3270_TOGGLE_VISIBLE_CONTROL - #define AID_WAIT LIB3270_TOGGLE_AID_WAIT - #define FULL_SCREEN LIB3270_TOGGLE_FULL_SCREEN - #define RECONNECT LIB3270_TOGGLE_RECONNECT -// #define INSERT LIB3270_TOGGLE_INSERT - #define KEYPAD LIB3270_TOGGLE_KEYPAD - #define SMART_PASTE LIB3270_TOGGLE_SMART_PASTE -// #define N_TOGGLES LIB3270_TOGGLE_COUNT - - #define LIB3270_TOGGLE_ID LIB3270_TOGGLE - -// #define register_3270_toggle_monitor(ix,callback) lib3270_register_tchange(NULL,ix,callback) - #define get_3270_toggle_by_name(x) lib3270_get_toggle_id(x) - - // Compatibility macros - #define register_tchange(ix,callback) register_3270_toggle_monitor(ix,callback) - #define do_toggle(ix) lib3270_toggle(NULL,ix) - - #define get_3270_toggle_name(ix) lib3270_get_toggle_name(ix) - #define get_toggle_name(ix) lib3270_get_toggle_name(ix) -// #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value) - #define get_toggle_by_name(name) lib3270_get_toggle_id(name) - -#endif /* TOGGLE3270_H_INCLUDED */ diff --git a/src/selection/actions.c b/src/selection/actions.c index 3106f20..d4fb48b 100644 --- a/src/selection/actions.c +++ b/src/selection/actions.c @@ -34,6 +34,7 @@ #include #include #include + #include #include "3270ds.h" /*--[ Implement ]------------------------------------------------------------------------------------*/ diff --git a/src/ssl/negotiate.c b/src/ssl/negotiate.c index 9444c71..fae2f91 100644 --- a/src/ssl/negotiate.c +++ b/src/ssl/negotiate.c @@ -53,6 +53,7 @@ #include #include #include +#include #include "hostc.h" // host_disconnect #include "trace_dsc.h" diff --git a/src/ssl/windows/curl.c b/src/ssl/windows/curl.c index 7ab0017..d589c0c 100644 --- a/src/ssl/windows/curl.c +++ b/src/ssl/windows/curl.c @@ -38,6 +38,7 @@ #include "private.h" #include +#include #define CRL_DATA_LENGTH 2048 diff --git a/src/ssl/windows/ldap.c b/src/ssl/windows/ldap.c index f592f80..bc76c3f 100644 --- a/src/ssl/windows/ldap.c +++ b/src/ssl/windows/ldap.c @@ -41,6 +41,7 @@ #include "private.h" #include #include +#include # ifndef LDAP_VENDOR_NAME # error Your Platform SDK is NOT sufficient for LDAP support! \ diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index 2601ee5..3970e2a 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -8,6 +8,7 @@ #include #include #include +#include #define MAX_ARGS 10 -- libgit2 0.21.2