- added new scriptcontext with devser
This commit is contained in:
23
stringdict.c
23
stringdict.c
@ -179,6 +179,11 @@
|
||||
else
|
||||
{
|
||||
strncpy(pResult,sVal.value,iLen);
|
||||
/* strncpy is not guaranteed to be '\0' terminated */
|
||||
if (iLen > 0 && pResult[iLen-1] != '\0') {
|
||||
/* overflow */
|
||||
pResult[iLen-1] = '\0';
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -186,6 +191,24 @@
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
char *StringDictGetShort(pStringDict self, char *name)
|
||||
{
|
||||
SDE sVal;
|
||||
int iRet;
|
||||
|
||||
iRet = LLDnodePtr2First(self->iList);
|
||||
while(iRet != 0)
|
||||
{
|
||||
LLDnodeDataTo(self->iList,&sVal);
|
||||
if(strcmp(sVal.name,name) == 0)
|
||||
{
|
||||
return sVal.value;
|
||||
}
|
||||
iRet = LLDnodePtr2Next(self->iList);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
int StringDictDelete(pStringDict self, char *name)
|
||||
{
|
||||
|
Reference in New Issue
Block a user