Commit eba00a83e7c404579fcd69527942ce41e5d37a27

Authored by Perry Werneck
1 parent 662a8eb2
Exists in master and in 1 other branch develop

Preparing to move all ipc modules to this project removing then from

lib3270.
pw3270-plugin-ipc.cbp
@@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
107 </Unit> 107 </Unit>
108 <Unit filename="src/include/config.h" /> 108 <Unit filename="src/include/config.h" />
109 <Unit filename="src/include/config.h.in" /> 109 <Unit filename="src/include/config.h.in" />
110 - <Unit filename="src/include/lib3270/ipc.h" /> 110 + <Unit filename="src/include/lib3270/ipc-glib.h" />
111 <Unit filename="src/plugin/plugin.c"> 111 <Unit filename="src/plugin/plugin.c">
112 <Option compilerVar="CC" /> 112 <Option compilerVar="CC" />
113 </Unit> 113 </Unit>
src/core/constants.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include <lib3270.h> 35 #include <lib3270.h>
36 #include <lib3270/actions.h> 36 #include <lib3270/actions.h>
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 38
39 const IPC_METHOD_INT_ARG * ipc3270_get_int_arg_methods() { 39 const IPC_METHOD_INT_ARG * ipc3270_get_int_arg_methods() {
40 40
src/core/convert.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include <lib3270.h> 35 #include <lib3270.h>
36 #include <lib3270/actions.h> 36 #include <lib3270/actions.h>
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 38
39 gchar * ipc3270_convert_output_string(GObject *object, const gchar *string, GError **error) { 39 gchar * ipc3270_convert_output_string(GObject *object, const gchar *string, GError **error) {
40 return g_convert_with_fallback(string,-1,ipc3270_get_display_charset(object),"UTF-8","?",NULL,NULL,error); 40 return g_convert_with_fallback(string,-1,ipc3270_get_display_charset(object),"UTF-8","?",NULL,NULL,error);
src/core/getproperties.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 */ 33 */
34 34
35 #include <config.h> 35 #include <config.h>
36 -#include <lib3270/ipc.h> 36 +#include <lib3270/ipc-glib.h>
37 #include <lib3270.h> 37 #include <lib3270.h>
38 #include <lib3270/properties.h> 38 #include <lib3270/properties.h>
39 #include <lib3270/trace.h> 39 #include <lib3270/trace.h>
src/core/linux/gobject.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
src/core/linux/gobject.h
@@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
47 #include <gio/gio.h> 47 #include <gio/gio.h>
48 48
49 #include <lib3270.h> 49 #include <lib3270.h>
50 - #include <lib3270/ipc.h> 50 + #include <lib3270/ipc-glib.h>
51 51
52 G_BEGIN_DECLS 52 G_BEGIN_DECLS
53 53
src/core/linux/start.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include "gobject.h" 35 #include "gobject.h"
36 #include <lib3270.h> 36 #include <lib3270.h>
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 38
39 #include <dbus/dbus-glib.h> 39 #include <dbus/dbus-glib.h>
40 #include <dbus/dbus-glib-bindings.h> 40 #include <dbus/dbus-glib-bindings.h>
src/core/linux/stop.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include "gobject.h" 35 #include "gobject.h"
36 #include <lib3270.h> 36 #include <lib3270.h>
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 38
39 #include <dbus/dbus-glib.h> 39 #include <dbus/dbus-glib.h>
40 #include <dbus/dbus-glib-bindings.h> 40 #include <dbus/dbus-glib-bindings.h>
src/core/methods.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include <config.h> 35 #include <config.h>
36 #include <string.h> 36 #include <string.h>
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 #include <lib3270.h> 38 #include <lib3270.h>
39 #include <lib3270/actions.h> 39 #include <lib3270/actions.h>
40 #include <lib3270/trace.h> 40 #include <lib3270/trace.h>
src/core/setproperties.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 */ 33 */
34 34
35 #include <config.h> 35 #include <config.h>
36 -#include <lib3270/ipc.h> 36 +#include <lib3270/ipc-glib.h>
37 #include <lib3270.h> 37 #include <lib3270.h>
38 #include <lib3270/properties.h> 38 #include <lib3270/properties.h>
39 #include <lib3270/trace.h> 39 #include <lib3270/trace.h>
src/core/tools.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Contatos: 23 * Contatos:
24 * 24 *
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 */ 28 */
29 29
30 #include <lib3270.h> 30 #include <lib3270.h>
31 -#include <lib3270/ipc.h> 31 +#include <lib3270/ipc-glib.h>
32 32
33 /*--[ Implement ]------------------------------------------------------------------------------------*/ 33 /*--[ Implement ]------------------------------------------------------------------------------------*/
34 34
src/core/windows/gobject.c
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 #include <lib3270.h> 31 #include <lib3270.h>
32 #include <lib3270/actions.h> 32 #include <lib3270/actions.h>
33 #include <lib3270/properties.h> 33 #include <lib3270/properties.h>
34 -#include <lib3270/ipc.h> 34 +#include <lib3270/ipc-glib.h>
35 35
36 /*--[ Widget definition ]----------------------------------------------------------------------------*/ 36 /*--[ Widget definition ]----------------------------------------------------------------------------*/
37 37
src/core/windows/gobject.h
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 #include <gio/gio.h> 48 #include <gio/gio.h>
49 49
50 #include <lib3270.h> 50 #include <lib3270.h>
51 - #include <lib3270/ipc.h> 51 + #include <lib3270/ipc-glib.h>
52 52
53 #define PIPE_BUFFER_LENGTH 8192 53 #define PIPE_BUFFER_LENGTH 8192
54 54
@@ -88,7 +88,7 @@ @@ -88,7 +88,7 @@
88 GObjectClass parent; 88 GObjectClass parent;
89 }; 89 };
90 90
91 - G_GNUC_INTERNAL GSourceFuncs ipc3270_source_funcs; 91 + G_GNUC_INTERNAL GSourceFuncs ipc3270_source_funcs;
92 92
93 G_GNUC_INTERNAL void ipc3270_release_object(ipc3270 *object); 93 G_GNUC_INTERNAL void ipc3270_release_object(ipc3270 *object);
94 G_GNUC_INTERNAL void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source); 94 G_GNUC_INTERNAL void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source);
src/core/windows/inout.c
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 */ 35 */
36 36
37 #include <config.h> 37 #include <config.h>
38 - #include <lib3270/ipc.h> 38 + #include <lib3270/ipc-glib.h>
39 #include <string.h> 39 #include <string.h>
40 #include <stdlib.h> 40 #include <stdlib.h>
41 41
src/core/windows/pipesource.c
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 */ 28 */
29 29
30 #include "gobject.h" 30 #include "gobject.h"
31 -#include <lib3270/ipc.h> 31 +#include <lib3270/ipc-glib.h>
32 #include <lib3270/trace.h> 32 #include <lib3270/trace.h>
33 33
34 void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source) { 34 void ipc3270_wait_for_client(IPC3270_PIPE_SOURCE *source) {
src/core/windows/start.c
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 #include <lib3270.h> 31 #include <lib3270.h>
32 #include <lib3270/actions.h> 32 #include <lib3270/actions.h>
33 #include <lib3270/properties.h> 33 #include <lib3270/properties.h>
34 -#include <lib3270/ipc.h> 34 +#include <lib3270/ipc-glib.h>
35 35
36 void ipc3270_export_object(GObject *object, const char *name, GError G_GNUC_UNUSED(**error)) { 36 void ipc3270_export_object(GObject *object, const char *name, GError G_GNUC_UNUSED(**error)) {
37 37
src/core/windows/stop.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include "gobject.h" 35 #include "gobject.h"
36 #include <lib3270.h> 36 #include <lib3270.h>
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 38
39 void ipc3270_release_object(ipc3270 *object) { 39 void ipc3270_release_object(ipc3270 *object) {
40 40
src/include/lib3270/ipc-glib.h 0 → 100644
@@ -0,0 +1,121 @@ @@ -0,0 +1,121 @@
  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. Registro no INPI sob
  5 + * o nome G3270.
  6 + *
  7 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  8 + *
  9 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  10 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  11 + * Free Software Foundation.
  12 + *
  13 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  14 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  15 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  16 + * obter mais detalhes.
  17 + *
  18 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  19 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  20 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  21 + *
  22 + * Este programa está nomeado como - e possui - linhas de código.
  23 + *
  24 + * Contatos:
  25 + *
  26 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  27 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  28 + *
  29 + */
  30 +
  31 + /**
  32 + * @brief Common definitions for pw3270 IPC plugin.
  33 + *
  34 + * @author Perry Werneck <perry.werneck@gmail.com>
  35 + *
  36 + */
  37 +
  38 +#ifndef PW3270_IPC_H_INCLUDED
  39 +
  40 + #define PW3270_IPC_H_INCLUDED
  41 +
  42 + #ifdef _WIN32
  43 +
  44 + #define PW3270_IPC_SESSION_BUS_NAME "\\\\.\\pipe\\%s\\%c"
  45 +
  46 + #else
  47 +
  48 + #define PW3270_IPC_SESSION_BUS_NAME "br.com.bb.%s.%c"
  49 + #define PW3270_IPC_SESSION_INTERFACE_NAME "br.com.bb.tn3270.session"
  50 + #define PW3270_IPC_SESSION_OBJECT_PATH "/br/com/bb/tn3270/session"
  51 +
  52 + #define PW3270_IPC_SERVICE_BUS_NAME "br.com.bb.tn3270.service"
  53 + #define PW3270_IPC_SERVICE_INTERFACE_NAME "br.com.bb.tn3270.service"
  54 + #define PW3270_IPC_SERVICE_OBJECT_PATH "/br/com/bb/tn3270/service"
  55 +
  56 + #endif // _WIN32
  57 +
  58 + #include <glib.h>
  59 + #include <gtk/gtk.h>
  60 + #include <lib3270.h>
  61 +
  62 + G_BEGIN_DECLS
  63 +
  64 + #define GLIB_TYPE_IPC3270 (ipc3270_get_type ())
  65 + #define IPC3270(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLIB_TYPE_IPC3270, ipc3270))
  66 + #define IPC3270_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLIB_TYPE_IPC3270, ipc3270Class))
  67 + #define IS_IPC3270(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLIB_TYPE_IPC3270))
  68 + #define IS_IPC3270_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIB_TYPE_IPC3270))
  69 + #define IPC3270_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLIB_TYPE_IPC3270, ipc3270Class))
  70 +
  71 + typedef struct _ipc3270 ipc3270;
  72 + typedef struct _ipc3270Class ipc3270Class;
  73 +
  74 + GObject * ipc3270_new();
  75 + GType ipc3270_get_type(void);
  76 + void ipc3270_set_session(GObject *object, H3270 *hSession);
  77 + void ipc3270_export_object(GObject *object, const char *name, GError **error);
  78 +
  79 + gchar * ipc3270_convert_output_string(GObject *object, const gchar *string, GError **error);
  80 + gchar * ipc3270_convert_input_string(GObject *object, const gchar *string, GError **error);
  81 + GVariant * ipc3270_GVariant_from_input_string(GObject *object, char *string, GError **error);
  82 +
  83 + void ipc3270_add_terminal_introspection(GString *string);
  84 +
  85 + const gchar * ipc3270_get_display_charset(GObject *object);
  86 + H3270 * ipc3270_get_session(GObject *object);
  87 +
  88 + void ipc3270_set_error(GObject *object, int errcode, GError **error);
  89 +
  90 + GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *parameters, GError **error);
  91 + gboolean ipc3270_set_property(GObject *object, const gchar *property_name, GVariant *value, GError **error);
  92 + GVariant * ipc3270_get_property(GObject *object, const gchar *property_name, GError **error);
  93 +
  94 + #ifdef _WIN32
  95 + unsigned char * ipc3270_pack(const gchar *name, int id, GVariant *values, size_t * szPacket);
  96 + unsigned char * ipc3270_pack_value(const gchar *name, int id, GVariant *value, size_t * szPacket);
  97 + unsigned char * ipc3270_pack_error(const GError *error, size_t * szPacket);
  98 + GVariant * ipc3270_unpack(const unsigned char *packet, int *id);
  99 + #endif // _WIN32
  100 +
  101 + G_END_DECLS
  102 +
  103 + #if ! GLIB_CHECK_VERSION(2,44,0)
  104 + G_GNUC_INTERNAL void ipc3270_autoptr_cleanup_generic_gfree(void *p);
  105 + #define g_autofree __attribute__((cleanup(ipc3270_autoptr_cleanup_generic_gfree)))
  106 + #endif // ! GLIB(2,44,0)
  107 +
  108 + #ifdef DEBUG
  109 + #define debug( fmt, ... ) fprintf(stderr,"%s(%d) " fmt "\n", __FILE__, (int) __LINE__, __VA_ARGS__ ); fflush(stderr);
  110 + #else
  111 + #define debug(...) /* __VA_ARGS */
  112 + #endif
  113 +
  114 + typedef struct _ipc_method_int_arg {
  115 + const gchar *name;
  116 + int (*call)(H3270 *hSession, int keycode);
  117 + } IPC_METHOD_INT_ARG;
  118 +
  119 + const IPC_METHOD_INT_ARG * ipc3270_get_int_arg_methods();
  120 +
  121 +#endif // PW3270_IPC_H_INCLUDED
src/include/lib3270/ipc.h
@@ -1,121 +0,0 @@ @@ -1,121 +0,0 @@
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. Registro no INPI sob  
5 - * o nome G3270.  
6 - *  
7 - * Copyright (C) <2008> <Banco do Brasil S.A.>  
8 - *  
9 - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob  
10 - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela  
11 - * Free Software Foundation.  
12 - *  
13 - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER  
14 - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO  
15 - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para  
16 - * obter mais detalhes.  
17 - *  
18 - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este  
19 - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin  
20 - * St, Fifth Floor, Boston, MA 02110-1301 USA  
21 - *  
22 - * Este programa está nomeado como - e possui - linhas de código.  
23 - *  
24 - * Contatos:  
25 - *  
26 - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)  
27 - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)  
28 - *  
29 - */  
30 -  
31 - /**  
32 - * @brief Common definitions for pw3270 IPC plugin.  
33 - *  
34 - * @author Perry Werneck <perry.werneck@gmail.com>  
35 - *  
36 - */  
37 -  
38 -#ifndef PW3270_IPC_H_INCLUDED  
39 -  
40 - #define PW3270_IPC_H_INCLUDED  
41 -  
42 - #ifdef _WIN32  
43 -  
44 - #define PW3270_IPC_SESSION_BUS_NAME "\\\\.\\pipe\\%s\\%c"  
45 -  
46 - #else  
47 -  
48 - #define PW3270_IPC_SESSION_BUS_NAME "br.com.bb.%s.%c"  
49 - #define PW3270_IPC_SESSION_INTERFACE_NAME "br.com.bb.tn3270.session"  
50 - #define PW3270_IPC_SESSION_OBJECT_PATH "/br/com/bb/tn3270/session"  
51 -  
52 - #define PW3270_IPC_SERVICE_BUS_NAME "br.com.bb.tn3270.service"  
53 - #define PW3270_IPC_SERVICE_INTERFACE_NAME "br.com.bb.tn3270.service"  
54 - #define PW3270_IPC_SERVICE_OBJECT_PATH "/br/com/bb/tn3270/service"  
55 -  
56 - #endif // _WIN32  
57 -  
58 - #include <glib.h>  
59 - #include <gtk/gtk.h>  
60 - #include <lib3270.h>  
61 -  
62 - G_BEGIN_DECLS  
63 -  
64 - #define GLIB_TYPE_IPC3270 (ipc3270_get_type ())  
65 - #define IPC3270(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLIB_TYPE_IPC3270, ipc3270))  
66 - #define IPC3270_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLIB_TYPE_IPC3270, ipc3270Class))  
67 - #define IS_IPC3270(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLIB_TYPE_IPC3270))  
68 - #define IS_IPC3270_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIB_TYPE_IPC3270))  
69 - #define IPC3270_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLIB_TYPE_IPC3270, ipc3270Class))  
70 -  
71 - typedef struct _ipc3270 ipc3270;  
72 - typedef struct _ipc3270Class ipc3270Class;  
73 -  
74 - GObject * ipc3270_new();  
75 - GType ipc3270_get_type(void);  
76 - void ipc3270_set_session(GObject *object, H3270 *hSession);  
77 - void ipc3270_export_object(GObject *object, const char *name, GError **error);  
78 -  
79 - gchar * ipc3270_convert_output_string(GObject *object, const gchar *string, GError **error);  
80 - gchar * ipc3270_convert_input_string(GObject *object, const gchar *string, GError **error);  
81 - GVariant * ipc3270_GVariant_from_input_string(GObject *object, char *string, GError **error);  
82 -  
83 - void ipc3270_add_terminal_introspection(GString *string);  
84 -  
85 - const gchar * ipc3270_get_display_charset(GObject *object);  
86 - H3270 * ipc3270_get_session(GObject *object);  
87 -  
88 - void ipc3270_set_error(GObject *object, int errcode, GError **error);  
89 -  
90 - GVariant * ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *parameters, GError **error);  
91 - gboolean ipc3270_set_property(GObject *object, const gchar *property_name, GVariant *value, GError **error);  
92 - GVariant * ipc3270_get_property(GObject *object, const gchar *property_name, GError **error);  
93 -  
94 - #ifdef _WIN32  
95 - unsigned char * ipc3270_pack(const gchar *name, int id, GVariant *values, size_t * szPacket);  
96 - unsigned char * ipc3270_pack_value(const gchar *name, int id, GVariant *value, size_t * szPacket);  
97 - unsigned char * ipc3270_pack_error(const GError *error, size_t * szPacket);  
98 - GVariant * ipc3270_unpack(const unsigned char *packet, int *id);  
99 - #endif // _WIN32  
100 -  
101 - G_END_DECLS  
102 -  
103 - #if ! GLIB_CHECK_VERSION(2,44,0)  
104 - G_GNUC_INTERNAL void ipc3270_autoptr_cleanup_generic_gfree(void *p);  
105 - #define g_autofree __attribute__((cleanup(ipc3270_autoptr_cleanup_generic_gfree)))  
106 - #endif // ! GLIB(2,44,0)  
107 -  
108 - #ifdef DEBUG  
109 - #define debug( fmt, ... ) fprintf(stderr,"%s(%d) " fmt "\n", __FILE__, (int) __LINE__, __VA_ARGS__ ); fflush(stderr);  
110 - #else  
111 - #define debug(...) /* __VA_ARGS */  
112 - #endif  
113 -  
114 - typedef struct _ipc_method_int_arg {  
115 - const gchar *name;  
116 - int (*call)(H3270 *hSession, int keycode);  
117 - } IPC_METHOD_INT_ARG;  
118 -  
119 - const IPC_METHOD_INT_ARG * ipc3270_get_int_arg_methods();  
120 -  
121 -#endif // PW3270_IPC_H_INCLUDED  
src/plugin/plugin.c
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 31
32 /** 32 /**
33 - * @brief IPC Plugin startup/stop for linux. 33 + * @brief IPC Plugin startup/stop.
34 * 34 *
35 */ 35 */
36 36
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 43
44 #include "private.h" 44 #include "private.h"
45 #include <v3270.h> 45 #include <v3270.h>
46 - #include <lib3270/ipc.h> 46 + #include <lib3270/ipc-glib.h>
47 47
48 int pw3270_plugin_stop(GtkWidget G_GNUC_UNUSED(*window), GtkWidget *terminal) { 48 int pw3270_plugin_stop(GtkWidget G_GNUC_UNUSED(*window), GtkWidget *terminal) {
49 debug("%s(%p)",__FUNCTION__,g_object_get_data(G_OBJECT(terminal),"ipc-object-info")); 49 debug("%s(%p)",__FUNCTION__,g_object_get_data(G_OBJECT(terminal),"ipc-object-info"));
src/plugin/private.h
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 #define PRIVATE_H_INCLUDED 38 #define PRIVATE_H_INCLUDED
39 39
40 #include <config.h> 40 #include <config.h>
41 - #include <lib3270/ipc.h> 41 + #include <lib3270/ipc-glib.h>
42 42
43 int pw3270_plugin_start(GtkWidget *window, GtkWidget *terminal); 43 int pw3270_plugin_start(GtkWidget *window, GtkWidget *terminal);
44 int pw3270_plugin_stop(GtkWidget *window, GtkWidget *terminal); 44 int pw3270_plugin_stop(GtkWidget *window, GtkWidget *terminal);
src/service/getproperties.c
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include <config.h> 35 #include <config.h>
36 #include "private.h" 36 #include "private.h"
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 #include <lib3270.h> 38 #include <lib3270.h>
39 #include <lib3270/properties.h> 39 #include <lib3270/properties.h>
40 40
src/service/linux/start.c
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 */ 32 */
33 33
34 #include <config.h> 34 #include <config.h>
35 -#include <lib3270/ipc.h> 35 +#include <lib3270/ipc-glib.h>
36 #include "../private.h" 36 #include "../private.h"
37 37
38 static GDBusNodeInfo *introspection_data = NULL; 38 static GDBusNodeInfo *introspection_data = NULL;
src/service/methods.c
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 #include <config.h> 35 #include <config.h>
36 #include "private.h" 36 #include "private.h"
37 #include <string.h> 37 #include <string.h>
38 -#include <lib3270/ipc.h> 38 +#include <lib3270/ipc-glib.h>
39 #include <lib3270.h> 39 #include <lib3270.h>
40 #include <lib3270/actions.h> 40 #include <lib3270/actions.h>
41 41
src/service/service.c
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 #include <errno.h> 30 #include <errno.h>
31 #include <string.h> 31 #include <string.h>
32 #include <stdlib.h> 32 #include <stdlib.h>
33 -#include <lib3270/ipc.h> 33 +#include <lib3270/ipc-glib.h>
34 34
35 #ifndef _WIN32 35 #ifndef _WIN32
36 #include <signal.h> 36 #include <signal.h>
src/service/session.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Contatos: 23 * Contatos:
24 * 24 *
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 */ 28 */
29 29
30 #include "private.h" 30 #include "private.h"
31 -#include <lib3270/ipc.h> 31 +#include <lib3270/ipc-glib.h>
32 32
33 struct _session { 33 struct _session {
34 GObject parent; 34 GObject parent;
src/service/setproperties.c
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin 18 * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
19 * St, Fifth Floor, Boston, MA 02110-1301 USA 19 * St, Fifth Floor, Boston, MA 02110-1301 USA
20 * 20 *
21 - * Este programa está nomeado como main.c e possui - linhas de código. 21 + * Este programa está nomeado como - e possui - linhas de código.
22 * 22 *
23 * Referências: 23 * Referências:
24 * 24 *
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 #include <config.h> 35 #include <config.h>
36 #include "private.h" 36 #include "private.h"
37 -#include <lib3270/ipc.h> 37 +#include <lib3270/ipc-glib.h>
38 #include <lib3270.h> 38 #include <lib3270.h>
39 #include <lib3270/properties.h> 39 #include <lib3270/properties.h>
40 40
src/testprogram/testprogram.c
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 #include <config.h> 37 #include <config.h>
38 #include <v3270.h> 38 #include <v3270.h>
39 #include <v3270/trace.h> 39 #include <v3270/trace.h>
40 - #include <lib3270/ipc.h> 40 + #include <lib3270/ipc-glib.h>
41 #include <string.h> 41 #include <string.h>
42 #include <stdlib.h> 42 #include <stdlib.h>
43 43