Newer
Older
buffer[j] = '\0';
while(j < (int)strlen(format) && format[j] != '%') j++;
strncpy(buffer, format, j);
buffer[j]='\0';
return List_Nbr(list)-i;
}
if(j != (int)strlen(format))
return -1;
return 0;
}

Christophe Geuzaine
committed
void FixRelativePath(const char *in, char *out)
{
if(in[0] == '/' || in[0] == '\\' || (strlen(in)>2 && in[1] == ':')){
// do nothing: 'in' is an absolute path
strcpy(out, in);
}
else{
// append 'in' to the path of the parent file
strcpy(out, gmsh_yyname);
int i = strlen(out)-1 ;
while(i >= 0 && gmsh_yyname[i] != '/' && gmsh_yyname[i] != '\\') i-- ;
out[i+1] = '\0';
strcat(out, in);
}
}
void yyerror(char *s)
{
Msg::Error("'%s', line %d : %s (%s)", gmsh_yyname, gmsh_yylineno - 1, s, gmsh_yytext);
}
void yymsg(int level, const char *fmt, ...)
va_list args;
va_start(args, fmt);
vsprintf(tmp, fmt, args);
va_end(args);

Christophe Geuzaine
committed
if(level == 0){
Msg::Error("'%s', line %d : %s", gmsh_yyname, gmsh_yylineno - 1, tmp);
gmsh_yyerrorstate++;
}
else
Msg::Warning("'%s', line %d : %s", gmsh_yyname, gmsh_yylineno - 1, tmp);
}