5 #ifndef AISC_LOCATION_H
6 #define AISC_LOCATION_H
16 void print_internal(
const char *msg,
const char *msg_type,
const char *launcher_file,
int launcher_line)
const;
18 void fprint_location(
const char *file,
int line, FILE *fp)
const {
19 fprintf(fp,
"%s:%i: ", file, line);
21 void fprint_location(FILE *fp)
const {
22 fprint_location(path, linenr, fp);
26 static int global_error_count;
32 : linenr(linenr_), path(strdup(path_)) { }
34 : linenr(other.linenr), path(strdup(other.path)) { }
36 linenr = other.linenr;
37 freedup(path, other.path);
48 print_internal(err,
"Error", launcher_file, launcher_line);
52 print_internal(msg,
"Warning", launcher_file, launcher_line);
55 print_internal(
NULp, prefix,
NULp, 0);
70 return linenr == other.linenr && strcmp(path, other.path) == 0;
76 #error aisc_location.h included twice
77 #endif // AISC_LOCATION_H
const char * get_path() const
Location(int linenr_, const char *path_)
Location & operator=(const Location &other)
bool operator!=(const Location &other) const
void print_warning_internal(const char *msg, const char *launcher_file, int launcher_line) const
static int get_error_count()
bool operator==(const Location &other) const
static void announce_exit_pc(const Location &exitingHere)
static const Location & guess_pc()
Location(const Location &other)
void start_message(const char *prefix) const
#define aisc_assert(cond)
void print_error_internal(const char *err, const char *launcher_file, int launcher_line) const