error.c
Go to the documentation of this file.
1 #include "error.h"
2 
3 #include <stdlib.h>
4 #include <stdio.h>
5 
71 unsigned int RCSline=0; /*defined in the yac module*/
72 
78 unsigned int RPNline=0;
79 
80 void Error(const char *s)
81 {
82  fprintf(stderr,"\nERROR: %s.\n\n",s);
83  fflush(stdout);
84  fflush(stderr);
85  exit(EXIT_FAILURE);
86 }
87 
88 int Readcuiksystemerror(const char *s)
89 {
90  char ErrorText[500];
91 
92  sprintf(ErrorText,"\nSyntax Error in .cuik file at line %u (%s)",RCSline,s);
93  Error(ErrorText);
94 
95  return(EXIT_FAILURE);
96 }
97 
98 int ReadParameterserror(const char *s)
99 {
100  char ErrorText[500];
101 
102  sprintf(ErrorText,"\nSyntax Error in .param file at line %u (%s)",RPNline,s);
103  Error(ErrorText);
104 
105  return(EXIT_FAILURE);
106 }
107 
108 void ReadcuiksystemSemanticError(const char *s)
109 {
110  char ErrorText[500];
111 
112  sprintf(ErrorText,"\nSemantic Error at line %u: %s",RCSline,s);
113  Error(ErrorText);
114 }
115 
116 void Warning(const char *s)
117 {
118  fprintf(stderr,"\nWARNING: %s.\n\n",s);
119  fflush(stderr);
120 }
void Error(const char *s)
General error function.
Definition: error.c:80
Error and warning functions.
void ReadcuiksystemSemanticError(const char *s)
Semantic errors in .cuik files.
Definition: error.c:108
void Warning(const char *s)
General warning function.
Definition: error.c:116
int ReadParameterserror(const char *s)
Syntax errors in .param files.
Definition: error.c:98
int Readcuiksystemerror(const char *s)
Syntax errors in .cuik files.
Definition: error.c:88
unsigned int RPNline
Number of the line currently parsed when reading a .param file.
Definition: error.c:78
unsigned int RCSline
Number of the line currently parsed when reading a .cuik file.
Definition: error.c:71