aboutsummaryrefslogtreecommitdiff
path: root/jim.c
diff options
context:
space:
mode:
authorantirez <antirez>2005-03-14 13:11:26 +0000
committerantirez <antirez>2005-03-14 13:11:26 +0000
commita14ede31a66f7e54b326a53ec123e7dd2e2f1dab (patch)
treed15d3498cc7c5e84f5873152afa4151a81993229 /jim.c
parentef496182fab1cc1b9ca186be00a202423c6ab8c3 (diff)
downloadjimtcl-a14ede31a66f7e54b326a53ec123e7dd2e2f1dab.zip
jimtcl-a14ede31a66f7e54b326a53ec123e7dd2e2f1dab.tar.gz
jimtcl-a14ede31a66f7e54b326a53ec123e7dd2e2f1dab.tar.bz2
more fixes to allow inclusion of jim.h into C++ programs.
Diffstat (limited to 'jim.c')
-rw-r--r--jim.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/jim.c b/jim.c
index f566cd7..40ebc13 100644
--- a/jim.c
+++ b/jim.c
@@ -1,7 +1,7 @@
/* Jim - A small embeddable Tcl interpreter
* Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
*
- * $Id: jim.c,v 1.102 2005/03/14 09:16:36 antirez Exp $
+ * $Id: jim.c,v 1.103 2005/03/14 13:11:26 antirez Exp $
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -7328,14 +7328,15 @@ err:
* API Input/Export functions
* ---------------------------------------------------------------------------*/
-void *Jim_GetApi(Jim_Interp *interp, const char *funcname)
+int Jim_GetApi(Jim_Interp *interp, const char *funcname, void *targetPtrPtr)
{
Jim_HashEntry *he;
he = Jim_FindHashEntry(&interp->stub, funcname);
if (!he)
- return NULL;
- return he->val;
+ return JIM_ERR;
+ memcpy(targetPtrPtr, &he->val, sizeof(void*));
+ return JIM_OK;
}
int Jim_RegisterApi(Jim_Interp *interp, const char *funcname, void *funcptr)