diff --git a/pw3270.cbp b/pw3270.cbp
index 4cc691c..42b01e3 100644
--- a/pw3270.cbp
+++ b/pw3270.cbp
@@ -9,8 +9,8 @@
-
-
+
+
@@ -20,8 +20,8 @@
-
-
+
+
@@ -35,20 +35,20 @@
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -56,307 +56,310 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
+
-
-
-
+
-
-
+
+
+
-
+
+
-
+
-
-
-
-
+
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
-
+
-
-
+
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
-
-
+
-
-
+
+
-
+
+
-
-
+
-
-
+
+
-
+
+
-
+
-
+
+
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+
diff --git a/src/include/lib3270.h b/src/include/lib3270.h
index e4ebab5..c63805e 100644
--- a/src/include/lib3270.h
+++ b/src/include/lib3270.h
@@ -246,6 +246,16 @@
} LIB3270_OPTION;
+ #define LIB3270_OPTION_COUNT 2
+
+ typedef struct _lib3270_option_entry
+ {
+ LIB3270_OPTION value;
+ const char * key;
+ const char * text;
+ const char * tooltip;
+ } LIB3270_OPTION_ENTRY;
+
/**
* SSL state
*
@@ -968,6 +978,8 @@
LIB3270_EXPORT LIB3270_OPTION lib3270_get_options(H3270 *hSession);
LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt);
+ LIB3270_EXPORT const LIB3270_OPTION_ENTRY * lib3270_get_option_list(void);
+
#ifdef __cplusplus
}
diff --git a/src/lib3270/options.c b/src/lib3270/options.c
new file mode 100644
index 0000000..34a9f89
--- /dev/null
+++ b/src/lib3270/options.c
@@ -0,0 +1,83 @@
+/*
+ * "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. 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 options.c e possui - linhas de código.
+ *
+ * Contatos:
+ *
+ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
+ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
+ * licinio@bb.com.br (Licínio Luis Branco)
+ * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
+ *
+ */
+
+#include "globals.h"
+
+/*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/
+
+
+/*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/
+
+ static const const LIB3270_OPTION_ENTRY options[LIB3270_OPTION_COUNT+1] =
+ {
+ {
+ LIB3270_OPTION_COLOR8,
+ "color8",
+ N_( "_8 colors" ),
+ N_( "If active, pw3270 will respond to a Query(Color) with a list of 8 supported colors." )
+ },
+
+ {
+ LIB3270_OPTION_AS400,
+ "as400",
+ N_( "Host is AS_400" ),
+ NULL
+ },
+
+ {
+ 0,
+ NULL,
+ NULL,
+ NULL
+ }
+
+ };
+
+
+
+/*---[ Implement ]------------------------------------------------------------------------------------------------------------*/
+
+LIB3270_EXPORT LIB3270_OPTION lib3270_get_options(H3270 *hSession)
+{
+ CHECK_SESSION_HANDLE(hSession);
+ return hSession->options;
+}
+
+LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt)
+{
+ CHECK_SESSION_HANDLE(hSession);
+ hSession->options = opt;
+}
+
+LIB3270_EXPORT const LIB3270_OPTION_ENTRY * lib3270_get_option_list(void)
+{
+ return options;
+}
diff --git a/src/lib3270/session.c b/src/lib3270/session.c
index 2f26953..ae32dd6 100644
--- a/src/lib3270/session.c
+++ b/src/lib3270/session.c
@@ -454,14 +454,3 @@ LIB3270_EXPORT void * lib3270_get_widget(H3270 *h)
return h->widget;
}
-LIB3270_EXPORT LIB3270_OPTION lib3270_get_options(H3270 *hSession)
-{
- CHECK_SESSION_HANDLE(hSession);
- return hSession->options;
-}
-
-LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt)
-{
- CHECK_SESSION_HANDLE(hSession);
- hSession->options = opt;
-}
diff --git a/src/lib3270/sources.mak b/src/lib3270/sources.mak
index 401c173..1f9ce6b 100644
--- a/src/lib3270/sources.mak
+++ b/src/lib3270/sources.mak
@@ -28,12 +28,12 @@
TERMINAL_SOURCES = bounds.c ctlr.c util.c toggles.c screen.c selection.c kybd.c telnet.c \
host.c sf.c ansi.c resolver.c tables.c utf8.c charset.c \
version.c session.c state.c html.c trace_ds.c see.c \
- paste.c
+ paste.c
# Network I/O Sources
NETWORK_SOURCES = iocalls.c proxy.c
# Full library sources
SOURCES = $(TERMINAL_SOURCES) $(NETWORK_SOURCES) ft.c ft_cut.c ft_dft.c glue.c resources.c \
- rpq.c macros.c fallbacks.c log.c
+ rpq.c macros.c fallbacks.c log.c options.c
diff --git a/src/pw3270/dialog.c b/src/pw3270/dialog.c
index f6eb271..ce534c9 100644
--- a/src/pw3270/dialog.c
+++ b/src/pw3270/dialog.c
@@ -32,42 +32,18 @@
#include "globals.h"
#include
- static const struct _lib3270_options
- {
- LIB3270_OPTION value;
- const gchar * key;
- const gchar * text;
- const gchar * tooltip;
- } lib3270_options[] =
- {
- {
- LIB3270_OPTION_COLOR8,
- "color8",
- N_( "_8 colors" ),
- N_( "If active, pw3270 will respond to a Query(Color) with a list of 8 supported colors." )
- },
-
- {
- LIB3270_OPTION_AS400,
- "as400",
- N_( "Host is AS_400" ),
- NULL
- },
-
- };
-
-
/*--[ Globals ]--------------------------------------------------------------------------------------*/
void load_3270_options_from_config(GtkWidget *widget)
{
int f;
- LIB3270_OPTION opt = 0;
+ LIB3270_OPTION opt = 0;
+ const LIB3270_OPTION_ENTRY *options = lib3270_get_option_list();
- for(f=0;f 1);
{
@@ -446,12 +424,12 @@
int f;
LIB3270_OPTION opt = 0;
- for(f=0;f