*
* Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
* Copyright 2005 Clemens Hintze <c.hintze@gmx.net>
*
* 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>
* Copyright 2008 Andrew Lunn <andrew@lunn.ch>
* Copyright 2008 Duane Ellis <openocd@duaneellis.com>
* Copyright 2008 Uwe Klein <uklein@klein-messgeraete.de>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 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.
* 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
* 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
* 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.
* 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.
*
* 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.
*
* [By Duane Ellis, openocd@duaneellis.com, 8/18/8]
*
* Belief is "Jim" would greatly benifit if Jim Internals where
* [By Duane Ellis, openocd@duaneellis.com, 8/18/8]
*
* Belief is "Jim" would greatly benifit if Jim Internals where
typedef void (Jim_DupInternalRepProc)(struct Jim_Interp *interp,
struct Jim_Obj *srcPtr, Jim_Obj *dupPtr);
typedef void (Jim_UpdateStringProc)(struct Jim_Obj *objPtr);
typedef void (Jim_DupInternalRepProc)(struct Jim_Interp *interp,
struct Jim_Obj *srcPtr, Jim_Obj *dupPtr);
typedef void (Jim_UpdateStringProc)(struct Jim_Obj *objPtr);
typedef struct Jim_ObjType {
const char *name; /* The name of the type. */
Jim_FreeInternalRepProc *freeIntRepProc;
typedef struct Jim_ObjType {
const char *name; /* The name of the type. */
Jim_FreeInternalRepProc *freeIntRepProc;
- * e = Jim_Nvp_name2value(interp, yn, "y", &result);
+ * e = Jim_Nvp_name2value(interp, yn, "y", &result);
* returns &yn[0];
* e = Jim_Nvp_name2value(interp, yn, "n", &result);
* returns &yn[1];
* returns &yn[0];
* e = Jim_Nvp_name2value(interp, yn, "n", &result);
* returns &yn[1];
/* -----------------------------------------------------------------------------
* Exported API prototypes.
/* -----------------------------------------------------------------------------
* Exported API prototypes.
const char *cmdName, Jim_CmdProc cmdProc, void *privData,
Jim_DelCmdProc delProc);
const char *cmdName, Jim_CmdProc cmdProc, void *privData,
Jim_DelCmdProc delProc);
const char *cmdName, Jim_Obj *argListObjPtr, Jim_Obj *staticsListObjPtr,
Jim_Obj *bodyObjPtr, int arityMin, int arityMax);
JIM_STATIC int JIM_API(Jim_DeleteCommand) (Jim_Interp *interp,
const char *cmdName);
const char *cmdName, Jim_Obj *argListObjPtr, Jim_Obj *staticsListObjPtr,
Jim_Obj *bodyObjPtr, int arityMin, int arityMax);
JIM_STATIC int JIM_API(Jim_DeleteCommand) (Jim_Interp *interp,
const char *cmdName);
const char *oldName, const char *newName);
JIM_STATIC Jim_Cmd * JIM_API(Jim_GetCommand) (Jim_Interp *interp,
Jim_Obj *objPtr, int flags);
const char *oldName, const char *newName);
JIM_STATIC Jim_Cmd * JIM_API(Jim_GetCommand) (Jim_Interp *interp,
Jim_Obj *objPtr, int flags);
Jim_Obj *const *argv, const char *msg);
JIM_STATIC int JIM_API(Jim_GetEnum) (Jim_Interp *interp, Jim_Obj *objPtr,
const char * const *tablePtr, int *indexPtr, const char *name, int flags);
Jim_Obj *const *argv, const char *msg);
JIM_STATIC int JIM_API(Jim_GetEnum) (Jim_Interp *interp, Jim_Obj *objPtr,
const char * const *tablePtr, int *indexPtr, const char *name, int flags);
/* API import/export functions */
JIM_STATIC int JIM_API(Jim_GetApi) (Jim_Interp *interp, const char *funcname,
void *targetPtrPtr);
/* API import/export functions */
JIM_STATIC int JIM_API(Jim_GetApi) (Jim_Interp *interp, const char *funcname,
void *targetPtrPtr);
JIM_STATIC int JIM_API(Jim_Nvp_value2name_obj)(Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *value_obj, Jim_Nvp **result);
/** prints a nice 'unknown' parameter error message to the 'result' */
JIM_STATIC int JIM_API(Jim_Nvp_value2name_obj)(Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *value_obj, Jim_Nvp **result);
/** prints a nice 'unknown' parameter error message to the 'result' */
* \param interp - the interpeter
* \param argc - arg count
* \param argv - the objects
*
* \returns string pointer holding the text.
* \param interp - the interpeter
* \param argc - arg count
* \param argv - the objects
*
* \returns string pointer holding the text.
* Note, next call to this function will free the old (last) string.
*
* For example might want do this:
* Note, next call to this function will free the old (last) string.
*
* For example might want do this:
JIM_STATIC const char *JIM_API(Jim_Debug_ArgvString)(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
JIM_STATIC const char *JIM_API(Jim_Debug_ArgvString)(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
*
* Some TCL objects have various "configuration" values.
* For example - in Tcl/Tk the "buttons" have many options.
*
* Some TCL objects have various "configuration" values.
* For example - in Tcl/Tk the "buttons" have many options.
*
* Jim_GetOpt_Setup(&goi, interp, argc, argv);
*
*
* Jim_GetOpt_Setup(&goi, interp, argc, argv);
*
* .. not enough args error ..
* }
* Jim_GetOpt_String(&goi, &cp, NULL);
* .. not enough args error ..
* }
* Jim_GetOpt_String(&goi, &cp, NULL);
* Jim_GetOptSetup(&goi, interp, argc, argv);
* \endcode
*/
* Jim_GetOptSetup(&goi, interp, argc, argv);
* \endcode
*/
* // option was not recognized
* // pass 'hadprefix = 0' because there is no prefix
* Jim_GetOpt_NvpUnknown(&goi, cmd_options, 0);
* return e;
* }
*
* // option was not recognized
* // pass 'hadprefix = 0' because there is no prefix
* Jim_GetOpt_NvpUnknown(&goi, cmd_options, 0);
* return e;
* }
*
* case OPT_SEX:
* // handle: --sex male | female | lots | needmore
* e = Jim_GetOpt_Nvp(&goi, &nvp_sex, &n);
* case OPT_SEX:
* // handle: --sex male | female | lots | needmore
* e = Jim_GetOpt_Nvp(&goi, &nvp_sex, &n);
JIM_GET_API(Nvp_name2value);
JIM_GET_API(Nvp_name2value_nocase);
JIM_GET_API(Nvp_name2value_simple);
JIM_GET_API(Nvp_name2value);
JIM_GET_API(Nvp_name2value_nocase);
JIM_GET_API(Nvp_name2value_simple);