diff options
author | Daniel Kempenich <dan.kempenich@gmail.com> | 2023-01-17 23:02:56 -0600 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2023-01-27 08:47:01 +0100 |
commit | a7fffb5c0f95bffb37ff1854841c3fcf4d1a5f9c (patch) | |
tree | 0b4e70e0c4e56d85a27a0755a96f8da158fc6b8c /include | |
parent | c01cb1d685b70bc9ef102e08eba6ea3e928ae59c (diff) | |
download | libevent-a7fffb5c0f95bffb37ff1854841c3fcf4d1a5f9c.tar.gz |
Replace magic numbers with consts for evdns_base_resolv_conf_parse() errors
Diffstat (limited to 'include')
-rw-r--r-- | include/event2/dns.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/include/event2/dns.h b/include/event2/dns.h index be61e783..17a00cff 100644 --- a/include/event2/dns.h +++ b/include/event2/dns.h @@ -261,6 +261,21 @@ struct event_base; * @see DNS_OPTION_NAMESERVERS_NO_DEFAULT */ #define EVDNS_BASE_NAMESERVERS_NO_DEFAULT 0x10000 +/* No errors */ +#define EVDNS_ERROR_NONE 0 +/* Failed to open file */ +#define EVDNS_ERROR_FAILED_TO_OPEN_FILE 1 +/* Failed to stat file */ +#define EVDNS_ERROR_FAILED_TO_STAT_FILE 2 +/* File too large */ +#define EVDNS_ERROR_FILE_TOO_LARGE 3 +/* Out of memory */ +#define EVDNS_ERROR_OUT_OF_MEMORY 4 +/* Short read from file */ +#define EVDNS_ERROR_SHORT_READ_FROM_FILE 5 +/* No nameservers configured */ +#define EVDNS_ERROR_NO_NAMESERVERS_CONFIGURED 6 + /** Initialize the asynchronous DNS library. @@ -511,9 +526,13 @@ int evdns_base_set_option(struct evdns_base *base, const char *option, const cha The following directives are not parsed from the file: sortlist, rotate, no-check-names, inet6, debug. - If this function encounters an error, the possible return values are: 1 = - failed to open file, 2 = failed to stat file, 3 = file too large, 4 = out of - memory, 5 = short read from file, 6 = no nameservers listed in the file + If this function encounters an error, the possible return values are: + EVDNS_ERROR_FAILED_TO_OPEN_FILE (1) - failed to open file + EVDNS_ERROR_FAILED_TO_STAT_FILE (2) - failed to stat file + EVDNS_ERROR_FILE_TOO_LARGE (3) - file too large + EVDNS_ERROR_OUT_OF_MEMORY (4) - out of memory + EVDNS_ERROR_SHORT_READ_FROM_FILE (5) - short read from file + EVDNS_ERROR_NO_NAMESERVERS_CONFIGURED (6) - no nameservers configured. @param base the evdns_base to which to apply this operation @param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC| |