Commit 7f81d74bc67d97cc24854da7566c0e41d32340de
1 parent
522bb782
Exists in
master
and in
1 other branch
Updating version, changing timer management, adding setting for unlock delay.
Showing
1 changed file
with
6 additions
and
29 deletions
Show diff stats
iocallback.c
@@ -43,14 +43,11 @@ | @@ -43,14 +43,11 @@ | ||
43 | #include <glib.h> | 43 | #include <glib.h> |
44 | #include "../globals.h" | 44 | #include "../globals.h" |
45 | 45 | ||
46 | -// static int static_CallAndWait(int(*callback)(H3270 *session, void *), H3270 *session, void *parm); | ||
47 | -static void static_RemoveSource(void *id); | ||
48 | - | ||
49 | static void * static_AddSource(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata); | 46 | static void * static_AddSource(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata); |
50 | -static void static_RemoveSource(void *id); | 47 | +static void static_RemoveSource(H3270 *session, void *id); |
51 | 48 | ||
52 | -static void * static_AddTimeOut(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session)); | ||
53 | -static void static_RemoveTimeOut(void * timer); | 49 | +static void * static_AddTimeOut(H3270 *session, unsigned long interval_ms, void (*proc)(H3270 *session)); |
50 | +static void static_RemoveTimeOut(H3270 *session, void * timer); | ||
54 | static int static_Sleep(H3270 *hSession, int seconds); | 51 | static int static_Sleep(H3270 *hSession, int seconds); |
55 | static int static_RunPendingEvents(H3270 *hSession, int wait); | 52 | static int static_RunPendingEvents(H3270 *hSession, int wait); |
56 | 53 | ||
@@ -116,32 +113,12 @@ static void * static_AddSource(H3270 *session, int fd, LIB3270_IO_FLAG flag, voi | @@ -116,32 +113,12 @@ static void * static_AddSource(H3270 *session, int fd, LIB3270_IO_FLAG flag, voi | ||
116 | return src; | 113 | return src; |
117 | } | 114 | } |
118 | 115 | ||
119 | -/* | ||
120 | -static void * static_AddOutput(int source, H3270 *session, void (*fn)(H3270 *session)) | ||
121 | -{ | ||
122 | - return AddSource(source,session,G_IO_OUT|G_IO_HUP|G_IO_ERR,fn); | ||
123 | -} | ||
124 | - | ||
125 | - | ||
126 | -static void * static_AddInput(int source, H3270 *session, void (*fn)(H3270 *session)) | ||
127 | -{ | ||
128 | - return AddSource(source,session,G_IO_IN|G_IO_HUP|G_IO_ERR,fn); | ||
129 | -} | ||
130 | -*/ | ||
131 | - | ||
132 | -static void static_RemoveSource(void *id) | 116 | +static void static_RemoveSource(H3270 *session, void *id) |
133 | { | 117 | { |
134 | if(id) | 118 | if(id) |
135 | g_source_destroy((GSource *) id); | 119 | g_source_destroy((GSource *) id); |
136 | } | 120 | } |
137 | 121 | ||
138 | -/* | ||
139 | -static void * static_AddExcept(int source, H3270 *session, void (*fn)(H3270 *session)) | ||
140 | -{ | ||
141 | - return AddSource(source,session,G_IO_HUP|G_IO_ERR,fn); | ||
142 | -} | ||
143 | -*/ | ||
144 | - | ||
145 | static gboolean do_timer(TIMER *t) | 122 | static gboolean do_timer(TIMER *t) |
146 | { | 123 | { |
147 | if(!t->remove) | 124 | if(!t->remove) |
@@ -149,7 +126,7 @@ static gboolean do_timer(TIMER *t) | @@ -149,7 +126,7 @@ static gboolean do_timer(TIMER *t) | ||
149 | return FALSE; | 126 | return FALSE; |
150 | } | 127 | } |
151 | 128 | ||
152 | -static void * static_AddTimeOut(unsigned long interval, H3270 *session, void (*call)(H3270 *session)) | 129 | +static void * static_AddTimeOut(H3270 *session, unsigned long interval, void (*call)(H3270 *session)) |
153 | { | 130 | { |
154 | TIMER *t = g_malloc0(sizeof(TIMER)); | 131 | TIMER *t = g_malloc0(sizeof(TIMER)); |
155 | 132 | ||
@@ -162,7 +139,7 @@ static void * static_AddTimeOut(unsigned long interval, H3270 *session, void (*c | @@ -162,7 +139,7 @@ static void * static_AddTimeOut(unsigned long interval, H3270 *session, void (*c | ||
162 | return t; | 139 | return t; |
163 | } | 140 | } |
164 | 141 | ||
165 | -static void static_RemoveTimeOut(void * timer) | 142 | +static void static_RemoveTimeOut(H3270 *session, void * timer) |
166 | { | 143 | { |
167 | ((TIMER *) timer)->remove++; | 144 | ((TIMER *) timer)->remove++; |
168 | } | 145 | } |