summaryrefslogtreecommitdiff
path: root/src/systemd/sd-resolve.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-19 23:54:58 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-20 00:03:10 +0100
commit151b9b9662a90455262ce575a8a8ae74bf4ff336 (patch)
tree3e82f3233050d75d23fd69bfdd83aa850727395a /src/systemd/sd-resolve.h
parent3db729cb8e6822114e9323f4041dcdc080f2fb3c (diff)
downloadsystemd-151b9b9662a90455262ce575a8a8ae74bf4ff336.tar.gz
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
Diffstat (limited to 'src/systemd/sd-resolve.h')
-rw-r--r--src/systemd/sd-resolve.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/systemd/sd-resolve.h b/src/systemd/sd-resolve.h
index 14f45573b0..df69e4b809 100644
--- a/src/systemd/sd-resolve.h
+++ b/src/systemd/sd-resolve.h
@@ -68,7 +68,7 @@ int sd_resolve_wait(sd_resolve *resolve, uint64_t timeout_usec);
* getaddrinfo(3). The function returns a new query object. When the
* query is completed you may retrieve the results using
* sd_resolve_getaddrinfo_done(). */
-int sd_resolve_getaddrinfo(sd_resolve *resolve, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_query **q);
+int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char *node, const char *service, const struct addrinfo *hints);
/** Retrieve the results of a preceding sd_resolve_getaddrinfo()
* call. Returns a addrinfo structure and a return value compatible
@@ -90,7 +90,7 @@ void sd_resolve_freeaddrinfo(struct addrinfo *ai);
* query is completed you may retrieve the results using
* sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero
* if you want to query the hostname (resp. the service name). */
-int sd_resolve_getnameinfo(sd_resolve *resolve, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv, sd_resolve_query **q);
+int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **q, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv);
/** Retrieve the results of a preceding sd_resolve_getnameinfo()
* call. Returns the hostname and the service name in ret_host and
@@ -103,13 +103,13 @@ int sd_resolve_getnameinfo_done(sd_resolve_query* q, char **ret_host, char **ret
* compatible with the ones of libc's res_query(3). The function returns a new
* query object. When the query is completed you may retrieve the results using
* sd_resolve_res_done(). */
-int sd_resolve_res_query(sd_resolve *resolve, const char *dname, int class, int type, sd_resolve_query **q);
+int sd_resolve_res_query(sd_resolve *resolve, sd_resolve_query **q, const char *dname, int class, int type);
/** Issue an resolver query on the specified session. The arguments are
* compatible with the ones of libc's res_search(3). The function returns a new
* query object. When the query is completed you may retrieve the results using
* sd_resolve_res_done(). */
-int sd_resolve_res_search(sd_resolve *resolve, const char *dname, int class, int type, sd_resolve_query **q);
+int sd_resolve_res_search(sd_resolve *resolve, sd_resolve_query **q, const char *dname, int class, int type);
/** Retrieve the results of a preceding sd_resolve_res_query() or
* resolve_res_search call. The query object q is destroyed by this