Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

error.c

Go to the documentation of this file.
00001 #include "error.h"
00002 
00003 #include <stdlib.h>
00004 #include <stdio.h>
00005 
00071 unsigned int RCSline=0; /*defined in the yac module*/
00072 
00078 unsigned int RPNline=0; 
00079 
00080 void Error(const char *s)
00081 {
00082   fprintf(stderr,"\nERROR: %s.\n\n",s);
00083   fflush(stdout);
00084   fflush(stderr);
00085   exit(EXIT_FAILURE);
00086 }
00087 
00088 int Readcuiksystemerror(const char *s) 
00089 { 
00090   char ErrorText[500];
00091 
00092   sprintf(ErrorText,"\nSyntax Error in .cuik file at line %u (%s)",RCSline,s);
00093   Error(ErrorText);
00094 
00095   return(EXIT_FAILURE);
00096 }
00097 
00098 int ReadParameterserror(const char *s)
00099 { 
00100   char ErrorText[500];
00101 
00102   sprintf(ErrorText,"\nSyntax Error in .param file at line %u (%s)",RPNline,s);
00103   Error(ErrorText);
00104 
00105   return(EXIT_FAILURE);
00106 }
00107 
00108 void ReadcuiksystemSemanticError(const char *s)
00109 {
00110    char ErrorText[500];
00111 
00112   sprintf(ErrorText,"\nSemantic Error at line %u: %s",RCSline,s);
00113   Error(ErrorText); 
00114 }
00115 
00116 void Warning(const char *s)
00117 {
00118   fprintf(stderr,"\nWARNING: %s.\n",s);
00119   fflush(stderr);
00120 }