mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-15 05:32:17 +02:00
MEDIUM: errors: implement parsing context type
Create a parsing_ctx structure. This type is used to store information about the current file/line parsed. A global context is created and can be manipulated when haproxy is in STARTING mode. When starting is over, the context is resetted and should not be accessed anymore.
This commit is contained in:
@@ -60,12 +60,22 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
void usermsgs_clr(void);
|
||||
void usermsgs_clr(const char *prefix);
|
||||
int usermsgs_empty(void);
|
||||
const char *usermsgs_str(void);
|
||||
|
||||
/************ Error reporting functions ***********/
|
||||
|
||||
struct usermsgs_ctx {
|
||||
const char *prefix; /* prefix of every output */
|
||||
const char *file; /* related filename for config parsing */
|
||||
int line; /* related line number for config parsing */
|
||||
enum obj_type *obj; /* related proxy, server, ... */
|
||||
};
|
||||
void set_usermsgs_ctx(const char *file, int line, enum obj_type *obj);
|
||||
void register_parsing_obj(enum obj_type *obj);
|
||||
void reset_usermsgs_ctx(void);
|
||||
|
||||
/*
|
||||
* Displays the message on stderr with the date and pid. Overrides the quiet
|
||||
* mode during startup.
|
||||
|
||||
Reference in New Issue
Block a user