Commit 537c82b01a9a949f9a1fe13fe1d844a107fe8020
1 parent
a586d4ab
Exists in
master
Implementando API VB.NET
Showing
8 changed files
with
118 additions
and
32 deletions
Show diff stats
src/native/actions.cc
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin |
19 | 19 | * St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | * |
21 | - * Este programa está nomeado como set.cc e possui - linhas de código. | |
21 | + * Este programa está nomeado como actions.cc e possui - linhas de código. | |
22 | 22 | * |
23 | 23 | * Contatos: |
24 | 24 | * | ... | ... |
src/native/get.cc
... | ... | @@ -36,16 +36,18 @@ |
36 | 36 | * @brief Obtém a versão da biblioteca. |
37 | 37 | * |
38 | 38 | */ |
39 | - void tn3270_get_version(h3270::session *ses, char* str, int strlen) { | |
39 | + int tn3270_get_version(h3270::session *ses, char* str, int strlen) { | |
40 | 40 | strncpy(str,ses->get_version().c_str(),strlen); |
41 | + return 0; | |
41 | 42 | } |
42 | 43 | |
43 | 44 | /** |
44 | 45 | * @brief Obtém a revisão da biblioteca. |
45 | 46 | * |
46 | 47 | */ |
47 | - void tn3270_get_revision(h3270::session *ses, char* str, int strlen) { | |
48 | + int tn3270_get_revision(h3270::session *ses, char* str, int strlen) { | |
48 | 49 | strncpy(str,ses->get_revision().c_str(),strlen); |
50 | + return 0; | |
49 | 51 | } |
50 | 52 | |
51 | 53 | int tn3270_get_cstate(h3270::session *ses) { | ... | ... |
src/native/init.cc
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin |
19 | 19 | * St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | * |
21 | - * Este programa está nomeado como private.h e possui - linhas de código. | |
21 | + * Este programa está nomeado como init.cc e possui - linhas de código. | |
22 | 22 | * |
23 | 23 | * Contatos: |
24 | 24 | * |
... | ... | @@ -47,7 +47,8 @@ |
47 | 47 | * @brief Destrói uma sessão. |
48 | 48 | * |
49 | 49 | */ |
50 | - void tn3270_destroy_session(h3270::session *ses) { | |
50 | + int tn3270_destroy_session(h3270::session *ses) { | |
51 | 51 | delete ses; |
52 | + return 0; | |
52 | 53 | } |
53 | 54 | ... | ... |
src/native/private.h
... | ... | @@ -70,10 +70,10 @@ |
70 | 70 | |
71 | 71 | DLL_PUBLIC h3270::session * tn3270_create_session(const char *name); |
72 | 72 | |
73 | - DLL_PUBLIC void tn3270_destroy_session(h3270::session *ses); | |
73 | + DLL_PUBLIC int tn3270_destroy_session(h3270::session *ses); | |
74 | 74 | |
75 | - DLL_PUBLIC void tn3270_get_version(h3270::session *ses, char* str, int strlen); | |
76 | - DLL_PUBLIC void tn3270_get_revision(h3270::session *ses, char* str, int strlen); | |
75 | + DLL_PUBLIC int tn3270_get_version(h3270::session *ses, char* str, int strlen); | |
76 | + DLL_PUBLIC int tn3270_get_revision(h3270::session *ses, char* str, int strlen); | |
77 | 77 | |
78 | 78 | DLL_PUBLIC int tn3270_connect(h3270::session *ses, const char *host, time_t wait); |
79 | 79 | DLL_PUBLIC int tn3270_disconnect(h3270::session *ses); |
... | ... | @@ -86,17 +86,17 @@ |
86 | 86 | DLL_PUBLIC int tn3270_get_program_message(h3270::session *ses); |
87 | 87 | DLL_PUBLIC int tn3270_get_secure(h3270::session *ses); |
88 | 88 | |
89 | - DLL_PUBLIC void tn3270_get_string(h3270::session *ses, int addr, char* str, int strlen); | |
90 | - DLL_PUBLIC void tn3270_get_string_at(h3270::session *ses, int row, int col, char* str, int strlen); | |
89 | + DLL_PUBLIC int tn3270_get_string(h3270::session *ses, int addr, char* str, int strlen); | |
90 | + DLL_PUBLIC int tn3270_get_string_at(h3270::session *ses, int row, int col, char* str, int strlen); | |
91 | 91 | |
92 | - DLL_PUBLIC void tn3270_set_string_at(h3270::session *ses, int row, int col, const char* str); | |
92 | + DLL_PUBLIC int tn3270_set_string_at(h3270::session *ses, int row, int col, const char* str); | |
93 | 93 | |
94 | 94 | DLL_PUBLIC int tn3270_wait_for_string_at(h3270::session *ses, int row, int col, const char *key, int timeout); |
95 | 95 | DLL_PUBLIC int tn3270_cmp_string_at(h3270::session *ses, int row, int col, const char* str); |
96 | 96 | |
97 | - DLL_PUBLIC void tn3270_set_unlock_delay(h3270::session *ses, int ms); | |
98 | - DLL_PUBLIC void tn3270_set_cursor_position(h3270::session *ses, int row, int col); | |
99 | - DLL_PUBLIC void tn3270_set_cursor_addr(h3270::session *ses, int addr); | |
97 | + DLL_PUBLIC int tn3270_set_unlock_delay(h3270::session *ses, int ms); | |
98 | + DLL_PUBLIC int tn3270_set_cursor_position(h3270::session *ses, int row, int col); | |
99 | + DLL_PUBLIC int tn3270_set_cursor_addr(h3270::session *ses, int addr); | |
100 | 100 | |
101 | 101 | DLL_PUBLIC int tn3270_enter(h3270::session *ses); |
102 | 102 | DLL_PUBLIC int tn3270_pfkey(h3270::session *ses, int key); | ... | ... |
src/native/screen.cc
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin |
19 | 19 | * St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 | * |
21 | - * Este programa está nomeado como set.cc e possui - linhas de código. | |
21 | + * Este programa está nomeado como screen.cc e possui - linhas de código. | |
22 | 22 | * |
23 | 23 | * Contatos: |
24 | 24 | * |
... | ... | @@ -31,18 +31,21 @@ |
31 | 31 | |
32 | 32 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
33 | 33 | |
34 | -void tn3270_get_string(h3270::session *ses, int addr, char* str, int strlen) { | |
34 | +int tn3270_get_string(h3270::session *ses, int addr, char* str, int strlen) { | |
35 | 35 | memset(str,0,strlen); |
36 | 36 | strncpy(str,ses->get_string(addr,strlen).c_str(),strlen); |
37 | + return 0; | |
37 | 38 | } |
38 | 39 | |
39 | -void tn3270_get_string_at(h3270::session *ses, int row, int col, char* str, int strlen) { | |
40 | +int tn3270_get_string_at(h3270::session *ses, int row, int col, char* str, int strlen) { | |
40 | 41 | memset(str,0,strlen); |
41 | 42 | strncpy(str,ses->get_string_at(row,col,strlen).c_str(),strlen); |
43 | + return 0; | |
42 | 44 | } |
43 | 45 | |
44 | -void tn3270_set_string_at(h3270::session *ses, int row, int col, const char* str) { | |
46 | +int tn3270_set_string_at(h3270::session *ses, int row, int col, const char* str) { | |
45 | 47 | ses->set_string_at(row,col,str); |
48 | + return 0; | |
46 | 49 | } |
47 | 50 | |
48 | 51 | int tn3270_wait_for_string_at(h3270::session *ses, int row, int col, const char *key, int timeout) { | ... | ... |
src/native/set.cc
... | ... | @@ -31,15 +31,19 @@ |
31 | 31 | |
32 | 32 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
33 | 33 | |
34 | -void tn3270_set_unlock_delay(h3270::session *ses, int ms) { | |
34 | +int tn3270_set_unlock_delay(h3270::session *ses, int ms) { | |
35 | 35 | ses->set_unlock_delay((unsigned short) ms); |
36 | + return 0; | |
36 | 37 | } |
37 | 38 | |
38 | -void tn3270_set_cursor_position(h3270::session *ses, int row, int col) { | |
39 | +int tn3270_set_cursor_position(h3270::session *ses, int row, int col) { | |
39 | 40 | ses->set_cursor_position(row,col); |
41 | + return 0; | |
40 | 42 | } |
41 | 43 | |
42 | -void tn3270_set_cursor_addr(h3270::session *ses, int addr) { | |
44 | +int tn3270_set_cursor_addr(h3270::session *ses, int addr) { | |
43 | 45 | ses->set_cursor_addr(addr); |
46 | + return 0; | |
44 | 47 | } |
45 | 48 | |
49 | + | ... | ... |
src/pw3270-sharp/pw3270-sharp.cs
... | ... | @@ -51,13 +51,13 @@ namespace pw3270 { |
51 | 51 | extern static IntPtr tn3270_create_session(string name); |
52 | 52 | |
53 | 53 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
54 | - extern static void tn3270_destroy_session(IntPtr session); | |
54 | + extern static int tn3270_destroy_session(IntPtr session); | |
55 | 55 | |
56 | 56 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
57 | - extern static void tn3270_get_version(IntPtr session, StringBuilder str, int strlen); | |
57 | + extern static int tn3270_get_version(IntPtr session, StringBuilder str, int strlen); | |
58 | 58 | |
59 | 59 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
60 | - extern static void tn3270_get_revision(IntPtr session, StringBuilder str, int strlen); | |
60 | + extern static int tn3270_get_revision(IntPtr session, StringBuilder str, int strlen); | |
61 | 61 | |
62 | 62 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
63 | 63 | extern static int tn3270_connect(IntPtr Session, string host, int wait); |
... | ... | @@ -84,13 +84,13 @@ namespace pw3270 { |
84 | 84 | extern static int tn3270_get_secure(IntPtr Session); |
85 | 85 | |
86 | 86 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
87 | - extern static void tn3270_get_string(IntPtr Session, int addr, StringBuilder str, int strlen); | |
87 | + extern static int tn3270_get_string(IntPtr Session, int addr, StringBuilder str, int strlen); | |
88 | 88 | |
89 | 89 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
90 | - extern static void tn3270_get_string_at(IntPtr Session, int row, int col, StringBuilder str, int strlen); | |
90 | + extern static int tn3270_get_string_at(IntPtr Session, int row, int col, StringBuilder str, int strlen); | |
91 | 91 | |
92 | 92 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
93 | - extern static void tn3270_set_string_at(IntPtr Session, int row, int col, string str); | |
93 | + extern static int tn3270_set_string_at(IntPtr Session, int row, int col, string str); | |
94 | 94 | |
95 | 95 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
96 | 96 | extern static int tn3270_wait_for_string_at(IntPtr Session, int row, int col, string key, int timeout); |
... | ... | @@ -99,13 +99,13 @@ namespace pw3270 { |
99 | 99 | extern static int tn3270_cmp_string_at(IntPtr Session, int row, int col, string str); |
100 | 100 | |
101 | 101 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
102 | - extern static void tn3270_set_unlock_delay(IntPtr Session, int ms); | |
102 | + extern static int tn3270_set_unlock_delay(IntPtr Session, int ms); | |
103 | 103 | |
104 | 104 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
105 | - extern static void tn3270_set_cursor_position(IntPtr Session, int row, int col); | |
105 | + extern static int tn3270_set_cursor_position(IntPtr Session, int row, int col); | |
106 | 106 | |
107 | 107 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
108 | - extern static void tn3270_set_cursor_addr(IntPtr Session, int addr); | |
108 | + extern static int tn3270_set_cursor_addr(IntPtr Session, int addr); | |
109 | 109 | |
110 | 110 | [DllImport ("lib3270-mono",CallingConvention=CallingConvention.Cdecl)] |
111 | 111 | extern static int tn3270_enter(IntPtr Session); | ... | ... |
testprograms/vbclass.vb
... | ... | @@ -41,11 +41,87 @@ Public Class pw3270 |
41 | 41 | End Function |
42 | 42 | |
43 | 43 | <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ |
44 | - Private Shared Function tn3270_get_version(ByVal hSession As IntPtr, ByVal buffer As StringBuilder, ByVal strlen as Integer) as Long | |
44 | + Private Shared Function tn3270_get_version(ByVal hSession As IntPtr, ByVal buffer As StringBuilder, ByVal strlen as Integer) as Integer | |
45 | 45 | End Function |
46 | 46 | |
47 | 47 | <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ |
48 | - Private Shared Function tn3270_get_revision(ByVal hSession As IntPtr, ByVal buffer As StringBuilder, ByVal strlen as Integer) as Long | |
48 | + Private Shared Function tn3270_get_revision(ByVal hSession As IntPtr, ByVal buffer As StringBuilder, ByVal strlen as Integer) as Integer | |
49 | + End Function | |
50 | + | |
51 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
52 | + Private Shared Function tn3270_connect(ByVal hSession As IntPtr, ByVal buffer As StringBuilder, ByVal seconds as Integer) as Integer | |
53 | + End Function | |
54 | + | |
55 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
56 | + Private Shared Function tn3270_is_connected(ByVal hSession As IntPtr) as Integer | |
57 | + End Function | |
58 | + | |
59 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
60 | + Private Shared Function tn3270_disconnect(ByVal hSession As IntPtr) as Integer | |
61 | + End Function | |
62 | + | |
63 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
64 | + Private Shared Function tn3270_wait_for_ready(ByVal hSession As IntPtr, ByVal seconds as Integer) as Integer | |
65 | + End Function | |
66 | + | |
67 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
68 | + Private Shared Function tn3270_wait(ByVal hSession As IntPtr, ByVal seconds as Integer) as Integer | |
69 | + End Function | |
70 | + | |
71 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
72 | + Private Shared Function tn3270_get_cstate(ByVal hSession As IntPtr) as Integer | |
73 | + End Function | |
74 | + | |
75 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
76 | + Private Shared Function tn3270_get_program_message(ByVal hSession As IntPtr) as Integer | |
77 | + End Function | |
78 | + | |
79 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
80 | + Private Shared Function tn3270_get_secure(ByVal hSession As IntPtr) as Integer | |
81 | + End Function | |
82 | + | |
83 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
84 | + Private Shared Function tn3270_get_string(ByVal hSession As IntPtr, ByVal addr as Integer, ByVal buffer As StringBuilder, ByVal strlen as Integer) as Integer | |
85 | + End Function | |
86 | + | |
87 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
88 | + Private Shared Function tn3270_get_string_at(ByVal hSession As IntPtr, ByVal row as Integer, ByVal col as Integer, ByVal buffer As StringBuilder, ByVal strlen as Integer) as Integer | |
89 | + End Function | |
90 | + | |
91 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
92 | + Private Shared Function tn3270_set_string_at(ByVal hSession As IntPtr, ByVal row as Integer, ByVal col as Integer, ByVal buffer As StringBuilder) as Integer | |
93 | + End Function | |
94 | + | |
95 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
96 | + Private Shared Function tn3270_wait_for_string_at(ByVal hSession As IntPtr, ByVal row as Integer, ByVal col as Integer, ByVal key As StringBuilder, ByVal timeout as Integer) as Integer | |
97 | + End Function | |
98 | + | |
99 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
100 | + Private Shared Function tn3270_cmp_string_at(ByVal hSession As IntPtr, ByVal row as Integer, ByVal col as Integer, ByVal buffer As StringBuilder) as Integer | |
101 | + End Function | |
102 | + | |
103 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
104 | + Private Shared Function tn3270_set_unlock_delay(ByVal hSession As IntPtr, ByVal ms as Integer) as Integer | |
105 | + End Function | |
106 | + | |
107 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
108 | + Private Shared Function tn3270_set_cursor_position(ByVal hSession As IntPtr, ByVal row as Integer, ByVal col as Integer) as Integer | |
109 | + End Function | |
110 | + | |
111 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
112 | + Private Shared Function tn3270_set_cursor_addr(ByVal hSession As IntPtr, ByVal addr as Integer) as Integer | |
113 | + End Function | |
114 | + | |
115 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
116 | + Private Shared Function tn3270_enter(ByVal hSession As IntPtr) as Integer | |
117 | + End Function | |
118 | + | |
119 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
120 | + Private Shared Function tn3270_pfkey(ByVal hSession As IntPtr, ByVal key as Integer) as Integer | |
121 | + End Function | |
122 | + | |
123 | + <DllImport("lib3270-mono", CallingConvention := CallingConvention.Cdecl)> _ | |
124 | + Private Shared Function tn3270_pakey(ByVal hSession As IntPtr, ByVal key as Integer) as Integer | |
49 | 125 | End Function |
50 | 126 | |
51 | 127 | Private Shared hSession As IntPtr | ... | ... |