aboutsummaryrefslogtreecommitdiff
path: root/jim.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2009-07-28 15:46:40 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 10:11:02 +1000
commit462954132b1830a7e470436bf751fe8e86291c72 (patch)
treee4a917e94147dda69ecf9b74df2a9f2605edc99c /jim.h
parent981bd5980a5f2ef5e1a527dd3bd90d9f6cfaa632 (diff)
downloadjimtcl-462954132b1830a7e470436bf751fe8e86291c72.zip
jimtcl-462954132b1830a7e470436bf751fe8e86291c72.tar.gz
jimtcl-462954132b1830a7e470436bf751fe8e86291c72.tar.bz2
Lots of improvements
jim --- Add a unique id facility to jim (Jim_GetId()) Remove unused jim_vasprintf(), Jim_AppendString_sprintf() Remove duplicate output in Jim_Panic() Add support for catch -signal aio --- Use this for aio handles aio automatically creates stdin, stdout and stderr channels Jim_AioFilehandle() returns the 'FILE *' filehandle for a channel If JIM_TCL_COMPAT is set, create top level open, close, read, puts, etc. load ---- load core command split out into jim-load.c package ------- package core command split out into jim-package.c added 'package list' posix ----- Remove os.sleep, os.usleep, os.sethostname, os.signal, pit, Jpit Most of these are in 'signal'
Diffstat (limited to 'jim.h')
-rw-r--r--jim.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/jim.h b/jim.h
index 6f06229..c6d7fa3 100644
--- a/jim.h
+++ b/jim.h
@@ -141,9 +141,10 @@ extern "C" {
#define JIM_RETURN 2
#define JIM_BREAK 3
#define JIM_CONTINUE 4
-#define JIM_EVAL 5
-#define JIM_EXIT 6
-#define JIM_ERR_ADDSTACK 7
+#define JIM_SIGNAL 5
+#define JIM_EVAL 6
+#define JIM_EXIT 7
+#define JIM_ERR_ADDSTACK 8
#define JIM_MAX_NESTING_DEPTH 10000 /* default max nesting depth */
/* Some function get an integer argument with flags to change
@@ -477,6 +478,10 @@ typedef struct Jim_Interp {
int maxNestingDepth; /* Used for infinite loop detection. */
int returnCode; /* Completion code to return on JIM_RETURN. */
int exitCode; /* Code to return to the OS on JIM_EXIT. */
+ int signal; /* A caught signal, or 0 if none */
+ int signal_level; /* A nesting level of catch -signal */
+ long id; /* Hold unique id for various purposes */
+ const char *(*signal_to_name)(int sig); /* Returns a name for the signal number */
Jim_CallFrame *framePtr; /* Pointer to the current call frame */
Jim_CallFrame *topFramePtr; /* toplevel/global frame pointer. */
struct Jim_HashTable commands; /* Commands hash table */
@@ -510,9 +515,6 @@ typedef struct Jim_Interp {
a command. It is set to what the user specified
via Jim_CreateCommand(). */
- struct Jim_HashTable stub; /* Stub hash table to export API */
- /* Jim_GetApi() function pointer, used to bootstrap the STUB table */
- int (*getApiFuncPtr)(struct Jim_Interp *, const char *, void *);
struct Jim_CallFrame *freeFramesList; /* list of CallFrame structures. */
struct Jim_HashTable assocData; /* per-interp storage for use by packages */
Jim_PrngState *prngState; /* per interpreter Random Number Gen. state. */
@@ -539,6 +541,9 @@ typedef struct Jim_Interp {
(i)->result = _resultObjPtr_; \
} while(0)
+/* Use this for filehandles, etc. which need a unique id */
+#define Jim_GetId(i) (++(i)->id)
+
/* Reference structure. The interpreter pointer is held within privdata member in HashTable */
#define JIM_REFERENCE_TAGLEN 7 /* The tag is fixed-length, because the reference
string representation must be fixed length. */
@@ -824,6 +829,10 @@ int Jim_StringToWide(const char *str, jim_wide *widePtr, int base);
/* jim-load.c */
int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName);
+
+/* jim-aio.c */
+FILE *Jim_AioFilehandle(Jim_Interp *interp, Jim_Obj *command);
+
#ifdef __cplusplus
}
#endif