summaryrefslogtreecommitdiff
path: root/jim-eventloop.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2014-01-11 21:13:16 +1000
committerSteve Bennett <steveb@workware.net.au>2014-01-21 16:10:19 +1000
commitfcfb8169cfa5fefe5610bcc4297500ead2dfaf42 (patch)
tree01f5b859d134e7f164a3b6935bffe9607d6fb05b /jim-eventloop.c
parent30a78d4c698c3d47ecf2d399cd553d9e4340c788 (diff)
many comment changes, some small code changes
Sweep through and clean up all (most) of the comments in the code. While there, adjust some variable and function names to be more consistent, and make a few small code changes - again, mostly for consistency. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-eventloop.c')
-rw-r--r--jim-eventloop.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/jim-eventloop.c b/jim-eventloop.c
index 936103b..22ca5ff 100644
--- a/jim-eventloop.c
+++ b/jim-eventloop.c
@@ -1,4 +1,3 @@
-
/* Jim - A small embeddable Tcl interpreter
*
* Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
@@ -84,8 +83,7 @@ typedef struct Jim_FileEvent
typedef struct Jim_TimeEvent
{
jim_wide id; /* time event identifier. */
- int mode; /* restart, repetitive .. UK */
- long initialms; /* initial relativ timer value UK */
+ long initialms; /* initial relative timer value */
jim_wide when; /* milliseconds */
Jim_TimeProc *timeProc;
Jim_EventFinalizerProc *finalizerProc;
@@ -207,7 +205,6 @@ jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide milliseconds,
te = Jim_Alloc(sizeof(*te));
te->id = id;
- te->mode = 0;
te->initialms = milliseconds;
te->when = JimGetTime(eventLoop) + milliseconds;
te->timeProc = proc;
@@ -323,17 +320,16 @@ jim_wide Jim_DeleteTimeHandler(Jim_Interp *interp, jim_wide id)
/* Process every pending time event, then every pending file event
* (that may be registered by time event callbacks just processed).
- * Without special flags the function sleeps until some file event
- * fires, or when the next time event occurrs (if any).
+ * The behaviour depends upon the setting of flags:
*
* If flags is 0, the function does nothing and returns.
- * if flags has JIM_ALL_EVENTS set, all the kind of events are processed.
+ * if flags has JIM_ALL_EVENTS set, all event types are processed.
* if flags has JIM_FILE_EVENTS set, file events are processed.
* if flags has JIM_TIME_EVENTS set, time events are processed.
- * if flags has JIM_DONT_WAIT set the function returns ASAP until all
- * the events that's possible to process without to wait are processed.
+ * if flags has JIM_DONT_WAIT set, the function returns as soon as all
+ * the events that are possible to process without waiting are processed.
*
- * The function returns the number of events processed or -1 if
+ * Returns the number of events processed or -1 if
* there are no matching handlers, or -2 on error.
*/
int Jim_ProcessEvents(Jim_Interp *interp, int flags)