1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

sd-resolve: rename get_next() and get_n_queries() + cleanup

This commit is contained in:
Daniel Buch 2014-01-18 14:30:28 +01:00 committed by Tom Gundersen
parent 885d1c80d9
commit 127b55d5a4
3 changed files with 5 additions and 9 deletions

1
TODO
View File

@ -38,7 +38,6 @@ Features:
- maybe simplify function calls that take a sd_resolve_query object, to not also require the matching sd_resolve?
- maybe drop the "n_proc" parameter to sd_resolve_new()?
- change all functions to return "int" and negative errno errors
- getnext and getnqueries should be renamed to get_next() and get_n_queries(), i.e. functions that are not modelled directly after the libc counterparts don't need to be a single word...
* New service property: maximum CPU and wallclock runtime for a service

View File

@ -1043,12 +1043,12 @@ int sd_resolve_res_done(sd_resolve *resolve, sd_resolve_query* q, unsigned char
return ret < 0 ? -errno : ret;
}
sd_resolve_query* sd_resolve_getnext(sd_resolve *resolve) {
sd_resolve_query* sd_resolve_get_next(sd_resolve *resolve) {
assert(resolve);
return resolve->done_head;
}
int sd_resolve_getnqueries(sd_resolve *resolve) {
int sd_resolve_get_n_queries(sd_resolve *resolve) {
assert(resolve);
return resolve->n_queries;
}

View File

@ -63,7 +63,7 @@ void sd_resolve_free(sd_resolve *resolve);
int sd_resolve_fd(sd_resolve *resolve);
/** Process pending responses. After this function is called you can
* get the next completed query object(s) using sd_resolve_getnext(). If
* get the next completed query object(s) using sd_resolve_get_next(). If
* block is non-zero wait until at least one response has been
* processed. If block is zero, process all pending responses and
* return. */
@ -124,11 +124,11 @@ int sd_resolve_res_done(sd_resolve *resolve, sd_resolve_query* q, unsigned char
/** Return the next completed query object. If no query has been
* completed yet, return NULL. Please note that you need to run
* sd_resolve_wait() before this function will return sensible data. */
sd_resolve_query* sd_resolve_getnext(sd_resolve *resolve);
sd_resolve_query* sd_resolve_get_next(sd_resolve *resolve);
/** Return the number of query objects (completed or not) attached to
* this session */
int sd_resolve_getnqueries(sd_resolve *resolve);
int sd_resolve_get_n_queries(sd_resolve *resolve);
/** Cancel a currently running query. q is is destroyed by this call
* and may not be used any futher. */
@ -139,9 +139,6 @@ void sd_resolve_cancel(sd_resolve *resolve, sd_resolve_query* q);
* of the libc's freeaddrinfo()! */
void sd_resolve_freeaddrinfo(struct addrinfo *ai);
/** Free the answer data as returned by sd_resolve_res_done().*/
void sd_resolve_freeanswer(unsigned char *answer);
/** Returns non-zero when the query operation specified by q has been completed */
int sd_resolve_isdone(sd_resolve *resolve, sd_resolve_query*q);