Commit 4610dba14fc856607506858c734c324d095b7564

Authored by Perry Werneck
1 parent 209f9143
Exists in master

Ajustando simbolos.

Showing 3 changed files with 69 additions and 37 deletions   Show diff stats
Makefile.in
... ... @@ -67,8 +67,8 @@ CXX=@CXX@
67 67 CC=@CC@
68 68 LD=@CXX@
69 69  
70   -LIBS=-lpw3270cpp @LIBS@ @LIBICONV@
71   -CFLAGS=@CFLAGS@ @PYTHON_CFLAGS@
  70 +LIBS=-lpw3270cpp @LIBS@ @LIBICONV@ @DBUS_LIBS@
  71 +CFLAGS=@CFLAGS@ @PYTHON_CFLAGS@ @DBUS_CFLAGS@
72 72 LDFLAGS=@LDFLAGS@
73 73  
74 74 #---[ Rules ]----------------------------------------------------------------------------
... ... @@ -142,7 +142,7 @@ $(BINDBG)/$(LIBNAME): \
142 142 run: \
143 143 $(BINDBG)/$(LIBNAME)
144 144  
145   - php -d extension=$(BINDBG)/$(LIBNAME) testprograms/version.php
  145 + PYTHONPATH=$(BINDBG) python ./testprograms/sample.py
146 146  
147 147 cleanDebug: \
148 148 clean
... ...
configure.ac
... ... @@ -123,6 +123,14 @@ AC_SUBST(PYTHON_LIBS)
123 123 AC_SUBST(PYTHON_CFLAGS)
124 124  
125 125 dnl ---------------------------------------------------------------------------
  126 +dnl Check for D-Bus
  127 +dnl ---------------------------------------------------------------------------
  128 +
  129 +PKG_CHECK_MODULES( [DBUS], [dbus-1], AC_DEFINE(HAVE_DBUS), AC_MSG_NOTICE([ No DBUS support.]) )
  130 +AC_SUBST(DBUS_LIBS)
  131 +AC_SUBST(DBUS_CFLAGS)
  132 +
  133 +dnl ---------------------------------------------------------------------------
126 134 dnl Check for integer types & library functions
127 135 dnl ---------------------------------------------------------------------------
128 136  
... ... @@ -222,19 +230,19 @@ fi
222 230 dnl ---------------------------------------------------------------------------
223 231 dnl Check for compiler visibility flag
224 232 dnl ---------------------------------------------------------------------------
225   -AC_MSG_CHECKING(whether $CC accepts -fvisibility=hidden)
226   -AC_CACHE_VAL(app_cv_fvisibility_ok,
227   -[ac_save_cc="$CC"
228   -CC="$CC -fvisibility=hidden"
229   -AC_TRY_RUN([int main() { return 0; }],
230   - app_cv_fvisibility_ok=yes,
231   - app_cv_fvisibility_ok=no,
232   - app_cv_fvisibility_ok=no)
233   -CC="$ac_save_cc"])
234   -AC_MSG_RESULT($app_cv_fvisibility_ok)
235   -if test $app_cv_fvisibility_ok = yes; then
236   - CFLAGS="$CFLAGS -fvisibility=hidden"
237   -fi
  233 +dnl AC_MSG_CHECKING(whether $CC accepts -fvisibility=hidden)
  234 +dnl AC_CACHE_VAL(app_cv_fvisibility_ok,
  235 +dnl [ac_save_cc="$CC"
  236 +dnl CC="$CC -fvisibility=hidden"
  237 +dnl AC_TRY_RUN([int main() { return 0; }],
  238 +dnl app_cv_fvisibility_ok=yes,
  239 +dnl app_cv_fvisibility_ok=no,
  240 +dnl app_cv_fvisibility_ok=no)
  241 +dnl CC="$ac_save_cc"])
  242 +dnl AC_MSG_RESULT($app_cv_fvisibility_ok)
  243 +dnl if test $app_cv_fvisibility_ok = yes; then
  244 +dnl CFLAGS="$CFLAGS -fvisibility=hidden"
  245 +dnl fi
238 246  
239 247 dnl ---------------------------------------------------------------------------
240 248 dnl Check for pic
... ...
src/private.h
... ... @@ -43,6 +43,30 @@
43 43 #include <lib3270/config.h>
44 44 #include <pw3270/class.h>
45 45  
  46 + #if defined(_WIN32)
  47 +
  48 + #include <windows.h>
  49 +
  50 + #define DLL_PRIVATE extern
  51 + #define DLL_PUBLIC extern __declspec (dllexport)
  52 +
  53 + #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
  54 +
  55 + #define DLL_PRIVATE __hidden extern
  56 + #define DLL_PUBLIC extern
  57 +
  58 + #elif defined (HAVE_GNUC_VISIBILITY)
  59 +
  60 + #define DLL_PRIVATE __attribute__((visibility("hidden"))) extern
  61 + #define DLL_PUBLIC __attribute__((visibility("default"))) extern
  62 +
  63 + #else
  64 +
  65 + #error Unable to set visibility attribute
  66 +
  67 + #endif
  68 +
  69 +
46 70 using namespace std;
47 71  
48 72 typedef struct {
... ... @@ -57,34 +81,34 @@
57 81  
58 82 extern "C" {
59 83  
60   - PyObject * terminal_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
61   - int terminal_init(pw3270_TerminalObject *self, PyObject *args, PyObject *kwds);
62   - void terminal_dealloc(pw3270_TerminalObject * self);
  84 + DLL_PRIVATE PyObject * terminal_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
  85 + DLL_PRIVATE int terminal_init(pw3270_TerminalObject *self, PyObject *args, PyObject *kwds);
  86 + DLL_PRIVATE void terminal_dealloc(pw3270_TerminalObject * self);
63 87  
64   - PyObject * terminal_get_version(PyObject *self, PyObject *args);
65   - PyObject * terminal_get_revision(PyObject *self, PyObject *args);
  88 + DLL_PRIVATE PyObject * terminal_get_version(PyObject *self, PyObject *args);
  89 + DLL_PRIVATE PyObject * terminal_get_revision(PyObject *self, PyObject *args);
66 90  
67   - PyObject * terminal_is_connected(PyObject *self, PyObject *args);
68   - PyObject * terminal_is_ready(PyObject *self, PyObject *args);
  91 + DLL_PRIVATE PyObject * terminal_is_connected(PyObject *self, PyObject *args);
  92 + DLL_PRIVATE PyObject * terminal_is_ready(PyObject *self, PyObject *args);
69 93  
70   - PyObject * terminal_connect(PyObject *self, PyObject *args);
71   - PyObject * terminal_disconnect(PyObject *self, PyObject *args);
  94 + DLL_PRIVATE PyObject * terminal_connect(PyObject *self, PyObject *args);
  95 + DLL_PRIVATE PyObject * terminal_disconnect(PyObject *self, PyObject *args);
72 96  
73   - PyObject * terminal_get_string_at(PyObject *self, PyObject *args);
74   - PyObject * terminal_get_contents(PyObject *self);
75   - PyObject * terminal_set_string_at(PyObject *self, PyObject *args);
76   - PyObject * terminal_cmp_string_at(PyObject *self, PyObject *args);
  97 + DLL_PRIVATE PyObject * terminal_get_string_at(PyObject *self, PyObject *args);
  98 + DLL_PRIVATE PyObject * terminal_get_contents(PyObject *self);
  99 + DLL_PRIVATE PyObject * terminal_set_string_at(PyObject *self, PyObject *args);
  100 + DLL_PRIVATE PyObject * terminal_cmp_string_at(PyObject *self, PyObject *args);
77 101  
78   - PyObject * terminal_pfkey(PyObject *self, PyObject *args);
79   - PyObject * terminal_pakey(PyObject *self, PyObject *args);
80   - PyObject * terminal_enter(PyObject *self, PyObject *args);
81   - PyObject * terminal_action(PyObject *self, PyObject *args);
  102 + DLL_PRIVATE PyObject * terminal_pfkey(PyObject *self, PyObject *args);
  103 + DLL_PRIVATE PyObject * terminal_pakey(PyObject *self, PyObject *args);
  104 + DLL_PRIVATE PyObject * terminal_enter(PyObject *self, PyObject *args);
  105 + DLL_PRIVATE PyObject * terminal_action(PyObject *self, PyObject *args);
82 106  
83   - PyObject * terminal_is_protected_at(PyObject *self, PyObject *args);
84   - PyObject * terminal_set_cursor_at(PyObject *self, PyObject *args);
  107 + DLL_PRIVATE PyObject * terminal_is_protected_at(PyObject *self, PyObject *args);
  108 + DLL_PRIVATE PyObject * terminal_set_cursor_at(PyObject *self, PyObject *args);
85 109  
86   - PyObject * terminal_wait_for_ready(PyObject *self, PyObject *args);
87   - PyObject * terminal_wait_for_string_at(PyObject *self, PyObject *args);
  110 + DLL_PRIVATE PyObject * terminal_wait_for_ready(PyObject *self, PyObject *args);
  111 + DLL_PRIVATE PyObject * terminal_wait_for_string_at(PyObject *self, PyObject *args);
88 112  
89 113 }
90 114  
... ...