Graphviz 13.1.2~dev.20250807.2324
Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/*
18 * standalone mini error interface
19 */
20
21#include <stdarg.h>
22#include <errno.h>
23
24 typedef struct Error_info_s {
25 int errors;
26 int indent;
27 int line;
29 int trace;
30 char *file;
31 char *id;
33
34#define ERROR_INFO 0 /* info message -- no err_id */
35#define ERROR_WARNING 1 /* warning message */
36#define ERROR_ERROR 2 /* error message -- no err_exit */
37#define ERROR_FATAL 3 /* error message with err_exit */
38#define ERROR_PANIC ERROR_LEVEL /* panic message with err_exit */
39
40#define ERROR_LEVEL 0x00ff /* level portion of status */
41#define ERROR_USAGE 0x0800 /* usage message */
42
43/* support for extra API misuse warnings if available */
44#ifdef __GNUC__
45 #define PRINTF_LIKE(index, first) __attribute__((format(printf, index, first)))
46#else
47 #define PRINTF_LIKE(index, first) /* nothing */
48#endif
49
51
52 extern void setTraceLevel (int);
53 extern void setErrorLine (int);
54 extern void setErrorFileLine (char*, int);
55 extern void setErrorId (char*);
56 extern void setErrorErrors (int);
57 extern int getErrorErrors (void);
58
59 extern void error(int, const char *, ...) PRINTF_LIKE(2, 3);
60 extern void errorf(void *, void *, int, const char *, ...) PRINTF_LIKE(4, 5);
61 extern void errorv(const char *, int, const char *, va_list);
62
63#undef PRINTF_LIKE
64
65#ifdef __cplusplus
66}
67#endif
void setTraceLevel(int)
Definition error.c:32
void setErrorFileLine(char *, int)
Definition error.c:25
void errorf(void *, void *, int, const char *,...)
Definition error.c:89
int getErrorErrors(void)
Definition error.c:31
Error_info_t error_info
Definition error.c:22
struct Error_info_s Error_info_t
void setErrorErrors(int)
Definition error.c:30
void setErrorId(char *)
Definition error.c:29
void setErrorLine(int)
Definition error.c:24
#define PRINTF_LIKE(index, first)
Definition error.h:47
void errorv(const char *, int, const char *, va_list)
Definition error.c:34
table Syntax error
Definition htmlparse.y:294
int trace
Definition error.h:29
int indent
Definition error.h:26
char * id
Definition error.h:31
int warnings
Definition error.h:28
char * file
Definition error.h:30
int line
Definition error.h:27
int errors
Definition error.h:25