new version of TecsServer and conversion utility M.Z.

This commit is contained in:
cvs
2004-06-15 06:03:33 +00:00
parent ce6001e443
commit e5fa7645b0
130 changed files with 7279 additions and 126 deletions

View File

@@ -243,9 +243,14 @@ int CocPutThisVar(CocVar *var, void *base, StrBuf *buf, int separator) {
int CocGetVar(const char *name, StrBuf *buf, int separator) {
CocVar *var;
void *base;
static char msg[128];
var=CocFindVar(name, &base);
if (var==NULL) ERR_MSG("undefined variable");
if (var==NULL) {
str_copy(msg, "undefined variable ; ");
str_append(msg, name);
ERR_MSG(msg);
}
ERR_I(CocGetThisVar(var, base, buf, separator));
return(0);
OnError: str_copy(err_name, name); ErrTxt(err_name,0); return(-1);
@@ -277,11 +282,11 @@ void CocFreeVarList(void) {
char *CocReadVars(char *str, char stop){
int i, l;
char *eql, *cr, buf[80];
char *eql, *cr, buf[256];
StrBuf sbuf;
/* interprete variables until stop character appeares */
i=sscanf(str, "%79s%n", buf, &l);
i=sscanf(str, "%255s%n", buf, &l);
while (i>0 && buf[0]!=stop) {
if (buf[0]=='!') {
cr=strchr(str, '\n');
@@ -293,7 +298,7 @@ char *CocReadVars(char *str, char stop){
*eql='\0';
if (eql[1] == '\'' || eql[1]== '"') {
eql=strchr(str, '=');
StrNLink(&sbuf, eql+1, 80);
StrNLink(&sbuf, eql+1, 256);
ERR_I(CocGetVar(buf, &sbuf, StrNONE));
str = sbuf.buf + sbuf.rdpos;
} else {
@@ -302,7 +307,7 @@ char *CocReadVars(char *str, char stop){
ERR_I(CocGetVar(buf, &sbuf, ' '));
}
}
i=sscanf(str, "%79s%n", buf, &l);
i=sscanf(str, "%255s%n", buf, &l);
}
return str;
OnError: return NULL;