return 0;
}
-int JimStringCompare(const char *s1, int l1, const char *s2, int l2,
+static int JimStringCompare(const char *s1, int l1, const char *s2, int l2,
int nocase)
{
unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2;
/* Search 's1' inside 's2', starting to search from char 'index' of 's2'.
* The index of the first occurrence of s1 in s2 is returned.
* If s1 is not found inside s2, -1 is returned. */
-int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t)
+static int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t)
{
int i;
return -1;
}
-int Jim_WideToString(char *buf, jim_wide wideValue)
+static int Jim_WideToString(char *buf, jim_wide wideValue)
{
const char *fmt = "%" JIM_WIDE_MODIFIER;
return sprintf(buf, fmt, wideValue);
}
-int Jim_StringToWide(const char *str, jim_wide *widePtr, int base)
+static int Jim_StringToWide(const char *str, jim_wide *widePtr, int base)
{
char *endptr;
return JIM_OK;
}
-int Jim_StringToIndex(const char *str, int *intPtr)
+static int Jim_StringToIndex(const char *str, int *intPtr)
{
char *endptr;
return JIM_REFERENCE_SPACE;
}
-int Jim_DoubleToString(char *buf, double doubleValue)
+static int Jim_DoubleToString(char *buf, double doubleValue)
{
char *s;
int len;
return len;
}
-int Jim_StringToDouble(const char *str, double *doublePtr)
+static int Jim_StringToDouble(const char *str, double *doublePtr)
{
char *endptr;
free(ptr);
}
-void *Jim_Realloc(void *ptr, int size)
+static void *Jim_Realloc(void *ptr, int size)
{
/* We allocate zero length arrayes, etc. to use a single orthogonal codepath */
if (size == 0)
return copy;
}
-char *Jim_StrDupLen(const char *s, int l)
+static char *Jim_StrDupLen(const char *s, int l)
{
char *copy = Jim_Alloc(l + 1);
/* -------------------------- hash functions -------------------------------- */
/* Thomas Wang's 32 bit Mix Function */
-unsigned int Jim_IntHashFunction(unsigned int key)
+static unsigned int Jim_IntHashFunction(unsigned int key)
{
key += ~(key << 15);
key ^= (key >> 10);
/* Generic hash function (we are using to multiply by 9 and add the byte
* as Tcl) */
-unsigned int Jim_GenHashFunction(const unsigned char *buf, int len)
+static unsigned int Jim_GenHashFunction(const unsigned char *buf, int len)
{
unsigned int h = 0;
while (len--)
/* Initialize a parser context.
* 'prg' is a pointer to the program text, linenr is the line
* number of the first line contained in the program. */
-void JimParserInit(struct JimParserCtx *pc, const char *prg,
+static void JimParserInit(struct JimParserCtx *pc, const char *prg,
int len, int linenr)
{
pc->prg = prg;
static int JimParseListSep(struct JimParserCtx *pc);
static int JimParseListStr(struct JimParserCtx *pc);
-int JimParseList(struct JimParserCtx *pc)
+static int JimParseList(struct JimParserCtx *pc)
{
if (pc->len == 0) {
pc->tstart = pc->tend = pc->p;
/* Low-level string append. Use it only against objects
* of type "string". */
-void StringAppendString(Jim_Obj *objPtr, const char *str, int len)
+static void StringAppendString(Jim_Obj *objPtr, const char *str, int len)
{
int needlen;
return JimStringMatch(pattern, patternLen, string, stringLen, nocase);
}
-int Jim_StringCompareObj(Jim_Obj *firstObjPtr,
+static int Jim_StringCompareObj(Jim_Obj *firstObjPtr,
Jim_Obj *secondObjPtr, int nocase)
{
const char *s1, *s2;
}
}
-int qsortCompareStringPointers(const void *a, const void *b)
+static int qsortCompareStringPointers(const void *a, const void *b)
{
char * const *sa = (char * const *)a;
char * const *sb = (char * const *)b;
return JIM_OK;
}
-ScriptObj *Jim_GetScript(Jim_Interp *interp, Jim_Obj *objPtr)
+static ScriptObj *Jim_GetScript(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &scriptObjType) {
SetScriptFromAny(interp, objPtr);
* object that is *guaranteed* to be in the form VARNAME(INDEX).
* The 'index' part is [subst]ituted, and is used to lookup a key inside
* the [dict]ionary contained in variable VARNAME. */
-Jim_Obj *Jim_ExpandDictSugar(Jim_Interp *interp, Jim_Obj *objPtr)
+static Jim_Obj *Jim_ExpandDictSugar(Jim_Interp *interp, Jim_Obj *objPtr)
{
Jim_Obj *varObjPtr, *keyObjPtr, *dictObjPtr, *resObjPtr;
Jim_Obj *substKeyObjPtr = NULL;
Jim_Free(val);
}
-unsigned int JimReferencesHTHashFunction(const void *key)
+static unsigned int JimReferencesHTHashFunction(const void *key)
{
/* Only the least significant bits are used. */
const jim_wide *widePtr = key;
return intValue; /* identity function. */
}
-const void *JimReferencesHTKeyDup(void *privdata, const void *key)
+static const void *JimReferencesHTKeyDup(void *privdata, const void *key)
{
void *copy = Jim_Alloc(sizeof(jim_wide));
JIM_NOTUSED(privdata);
return copy;
}
-int JimReferencesHTKeyCompare(void *privdata, const void *key1,
+static int JimReferencesHTKeyCompare(void *privdata, const void *key1,
const void *key2)
{
JIM_NOTUSED(privdata);
return memcmp(key1, key2, sizeof(jim_wide)) == 0;
}
-void JimReferencesHTKeyDestructor(void *privdata, const void *key)
+static void JimReferencesHTKeyDestructor(void *privdata, const void *key)
{
JIM_NOTUSED(privdata);
return 0;
}
-int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
+static int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
{
jim_wide wideValue;
int i, len;
/* Returns the malloc-ed representation of a string
* using backslash to quote special chars. */
-char *BackslashQuoteString(const char *s, int len, int *qlenPtr)
+static char *BackslashQuoteString(const char *s, int len, int *qlenPtr)
{
char *q = Jim_Alloc(len*2 + 1), *p;
*
* NOTE: this function can be called only against objects
* with internal type of List. */
-void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc,
+static void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc,
Jim_Obj *const *elemVec)
{
int currentLen = listPtr->internalRep.listValue.len;
/* Appends every element of appendListPtr into listPtr.
* Both have to be of the list type. */
-void ListAppendList(Jim_Obj *listPtr, Jim_Obj *appendListPtr)
+static void ListAppendList(Jim_Obj *listPtr, Jim_Obj *appendListPtr)
{
int i, oldLen = listPtr->internalRep.listValue.len;
int appendLen = appendListPtr->internalRep.listValue.len;
/* Returns a list composed of the elements in the specified range.
* first and start are directly accepted as Jim_Objects and
* processed for the end?-index? case. */
-Jim_Obj *Jim_ListRange(Jim_Interp *interp, Jim_Obj *listObjPtr, Jim_Obj *firstObjPtr, Jim_Obj *lastObjPtr)
+static Jim_Obj *Jim_ListRange(Jim_Interp *interp, Jim_Obj *listObjPtr,
+ Jim_Obj *firstObjPtr, Jim_Obj *lastObjPtr)
{
int first, last;
int len, rangeLen;
*
* Keys and Values are Jim objects. */
-unsigned int JimObjectHTHashFunction(const void *key)
+static unsigned int JimObjectHTHashFunction(const void *key)
{
const char *str;
Jim_Obj *objPtr = (Jim_Obj*) key;
return h;
}
-int JimObjectHTKeyCompare(void *privdata, const void *key1, const void *key2)
+static int JimObjectHTKeyCompare(void *privdata, const void *key1, const void *key2)
{
JIM_NOTUSED(privdata);
/* Add an element, higher-level interface for DictAddElement().
* If valueObjPtr == NULL, the key is removed if it exists. */
-int Jim_DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr,
+static int Jim_DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr,
Jim_Obj *keyObjPtr, Jim_Obj *valueObjPtr)
{
if (Jim_IsShared(objPtr))
#define JIM_EXPR_OPERATORS_NUM \
(sizeof(Jim_ExprOperators)/sizeof(struct Jim_ExprOperator))
-int JimParseExpression(struct JimParserCtx *pc)
+static int JimParseExpression(struct JimParserCtx *pc)
{
/* Discard spaces and quoted newline */
while (*(pc->p) == ' ' ||
return JIM_OK;
}
-struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname)
+static struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname)
{
int i;
for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++)
return NULL;
}
-struct Jim_ExprOperator *JimExprOperatorInfoByOpcode(int opcode)
+static struct Jim_ExprOperator *JimExprOperatorInfoByOpcode(int opcode)
{
int i;
for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++)
return JIM_ERR;
}
-ExprByteCode *Jim_GetExpression(Jim_Interp *interp, Jim_Obj *objPtr)
+static ExprByteCode *Jim_GetExpression(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &exprObjType) {
if (SetExprFromAny(interp, objPtr) != JIM_OK)
}
#endif /* WIN32 */
-int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
+static int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
{
Jim_Obj *libPathObjPtr;
int prefixc, i;
return JIM_ERR;
}
#else /* JIM_DYNLIB */
-int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
+static int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
{
JIM_NOTUSED(interp);
JIM_NOTUSED(pathName);
* (and increments argc by reference accordingly), performing
* expansion of the list object if 'expand' is non-zero, or
* just adding objPtr to argv if 'expand' is zero. */
-void Jim_ExpandArgument(Jim_Interp *interp, Jim_Obj ***argv,
+static void Jim_ExpandArgument(Jim_Interp *interp, Jim_Obj ***argv,
int *argcPtr, int expand, Jim_Obj *objPtr)
{
if (!expand) {
/* This method takes the string representation of an object
* as a Tcl string where to perform [subst]itution, and generates
* the pre-parsed internal representation. */
-int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags)
+static int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags)
{
int scriptTextLen;
const char *scriptText = Jim_GetString(objPtr, &scriptTextLen);
return JIM_OK;
}
-ScriptObj *Jim_GetSubst(Jim_Interp *interp, Jim_Obj *objPtr, int flags)
+static ScriptObj *Jim_GetSubst(Jim_Interp *interp, Jim_Obj *objPtr, int flags)
{
struct ScriptObj *script = Jim_GetIntRepPtr(objPtr);