diff options
author | oharboe <oharboe> | 2009-10-08 10:47:23 +0000 |
---|---|---|
committer | oharboe <oharboe> | 2009-10-08 10:47:23 +0000 |
commit | a0ccba0dbbc8ab8e8461ced52919804ef34ba4f9 (patch) | |
tree | 55f60586a88a0b38ade22e978c2d0ed7e6a66796 /jim-eventloop.h | |
parent | 064acfa10de1d2176086f5dc4fd01f6c13bda209 (diff) | |
download | jimtcl-a0ccba0dbbc8ab8e8461ced52919804ef34ba4f9.zip jimtcl-a0ccba0dbbc8ab8e8461ced52919804ef34ba4f9.tar.gz jimtcl-a0ccba0dbbc8ab8e8461ced52919804ef34ba4f9.tar.bz2 |
2009-10-08 Øyvind Harboe
* jim.c/h: bring in changes from OpenOCD. Warnings and
some bug fixes. Copyright list updated in jim.c
Diffstat (limited to 'jim-eventloop.h')
-rw-r--r-- | jim-eventloop.h | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/jim-eventloop.h b/jim-eventloop.h index e09170e..ddb6fc9 100644 --- a/jim-eventloop.h +++ b/jim-eventloop.h @@ -2,25 +2,25 @@ * * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org> * Copyright 2005 Clemens Hintze <c.hintze@gmx.net> - * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> - * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com + * Copyright 2005 patthoyts - Pat Thoyts <patthoyts@users.sf.net> + * Copyright 2008 oharboe - Øyvind Harboe - oyvind.harboe@zylin.com * Copyright 2008 Andrew Lunn <andrew@lunn.ch> * Copyright 2008 Duane Ellis <openocd@duaneellis.com> * Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de> - * + * * The FreeBSD license - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE JIM TCL PROJECT ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -33,7 +33,7 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the Jim Tcl Project. @@ -63,18 +63,16 @@ typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData); #define JIM_EVENT_EXCEPTION 4 #define JIM_EVENT_FEOF 8 -#ifndef __JIM_EVENTLOOP_CORE__ -# if defined JIM_EXTENSION || defined JIM_EMBEDDED -# define JIM_API(x) (*x) -# define JIM_STATIC -# else -# define JIM_API(x) (*x) -# define JIM_STATIC extern -# endif -#else -# define JIM_API(x) x -# define JIM_STATIC static -#endif /* __JIM_EVENTLOOP_CORE__ */ +#define JIM_API(x) x +#define JIM_STATIC + +JIM_STATIC int Jim_EventLoopOnLoad(Jim_Interp *interp); + +/* --- POSIX version of Jim_ProcessEvents, for now the only available --- */ +#define JIM_FILE_EVENTS 1 +#define JIM_TIME_EVENTS 2 +#define JIM_ALL_EVENTS (JIM_FILE_EVENTS | JIM_TIME_EVENTS) +#define JIM_DONT_WAIT 4 JIM_STATIC void JIM_API(Jim_CreateFileHandler) (Jim_Interp *interp, void *handle, int mask, @@ -97,17 +95,6 @@ JIM_STATIC int JIM_API(Jim_ProcessEvents) (Jim_Interp *interp, int flags); #define JIM_GET_API(name) \ Jim_GetApi(interp, "Jim_" #name, ((void *)&Jim_ ## name)) -#if defined(JIM_EXTENSION) || defined(JIM_EMBEDDED) -/* This must be included "inline" inside the extension */ -static void Jim_ImportEventloopAPI(Jim_Interp *interp) -{ - JIM_GET_API(CreateFileHandler); - JIM_GET_API(DeleteFileHandler); - JIM_GET_API(CreateTimeHandler); - JIM_GET_API(DeleteTimeHandler); - JIM_GET_API(ProcessEvents); -} -#endif /* defined JIM_EXTENSION || defined JIM_EMBEDDED */ #undef JIM_GET_API #endif /* __JIM_EVENTLOOP_CORE__ */ |