[systemd-devel] [PATCH] sd-resolv: declare functions from .h public
Daniel Buch
boogiewasthere at gmail.com
Tue Jan 14 14:37:55 PST 2014
Hi,
I'm perfectly fine if we skip this patch, and to my understanding there is
no benefits and only corresponds to external linkage.
2014/1/14 Tom Gundersen <teg at jklm.no>
> Hi Daniel,
>
> I guess we should only do this once we decide to export the API. I
> guess we won't be doing that for a few releases (we'll use it
> internally first to make sure it is the way we want it).
>
> Or are there any benefits to these annotations even when the symbols
> are not exported?
>
> -t
>
> On Tue, Jan 14, 2014 at 3:04 PM, Daniel Buch <boogiewasthere at gmail.com>
> wrote:
> > ---
> > src/libsystemd/sd-resolv.c | 38 +++++++++++++++++++-------------------
> > 1 file changed, 19 insertions(+), 19 deletions(-)
> >
> > diff --git a/src/libsystemd/sd-resolv.c b/src/libsystemd/sd-resolv.c
> > index b8288ba..cd79a6c 100644
> > --- a/src/libsystemd/sd-resolv.c
> > +++ b/src/libsystemd/sd-resolv.c
> > @@ -414,7 +414,7 @@ static void* thread_worker(void *p) {
> > return NULL;
> > }
> >
> > -sd_resolv_t* sd_resolv_new(unsigned n_proc) {
> > +_public_ sd_resolv_t* sd_resolv_new(unsigned n_proc) {
> > sd_resolv_t *resolv = NULL;
> > int i, r;
> >
> > @@ -468,7 +468,7 @@ fail:
> > return NULL;
> > }
> >
> > -void sd_resolv_free(sd_resolv_t *resolv) {
> > +_public_ void sd_resolv_free(sd_resolv_t *resolv) {
> > int i;
> > int saved_errno = errno;
> > unsigned p;
> > @@ -511,7 +511,7 @@ void sd_resolv_free(sd_resolv_t *resolv) {
> > errno = saved_errno;
> > }
> >
> > -int sd_resolv_fd(sd_resolv_t *resolv) {
> > +_public_ int sd_resolv_fd(sd_resolv_t *resolv) {
> > assert(resolv);
> >
> > return resolv->fds[RESPONSE_RECV_FD];
> > @@ -709,7 +709,7 @@ static int handle_response(sd_resolv_t *resolv,
> const packet_t *packet, size_t l
> > return 0;
> > }
> >
> > -int sd_resolv_wait(sd_resolv_t *resolv, int block) {
> > +_public_ int sd_resolv_wait(sd_resolv_t *resolv, int block) {
> > int handled = 0;
> > assert(resolv);
> >
> > @@ -787,7 +787,7 @@ static sd_resolv_query_t *alloc_query(sd_resolv_t
> *resolv) {
> > return q;
> > }
> >
> > -sd_resolv_query_t* sd_resolv_getaddrinfo(sd_resolv_t *resolv, const
> char *node, const char *service, const struct addrinfo *hints) {
> > +_public_ sd_resolv_query_t* sd_resolv_getaddrinfo(sd_resolv_t *resolv,
> const char *node, const char *service, const struct addrinfo *hints) {
> > addrinfo_request_t data[BUFSIZE/sizeof(addrinfo_request_t) + 1]
> = {};
> > addrinfo_request_t *req = data;
> > sd_resolv_query_t *q;
> > @@ -840,7 +840,7 @@ fail:
> > return NULL;
> > }
> >
> > -int sd_resolv_getaddrinfo_done(sd_resolv_t *resolv, sd_resolv_query_t*
> q, struct addrinfo **ret_res) {
> > +_public_ int sd_resolv_getaddrinfo_done(sd_resolv_t *resolv,
> sd_resolv_query_t* q, struct addrinfo **ret_res) {
> > int ret;
> > assert(resolv);
> > assert(q);
> > @@ -871,7 +871,7 @@ int sd_resolv_getaddrinfo_done(sd_resolv_t *resolv,
> sd_resolv_query_t* q, struct
> > return ret;
> > }
> >
> > -sd_resolv_query_t* sd_resolv_getnameinfo(sd_resolv_t *resolv, const
> struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv) {
> > +_public_ sd_resolv_query_t* sd_resolv_getnameinfo(sd_resolv_t *resolv,
> const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int
> getserv) {
> > nameinfo_request_t data[BUFSIZE/sizeof(nameinfo_request_t) + 1]
> = {};
> > nameinfo_request_t *req = data;
> > sd_resolv_query_t *q;
> > @@ -917,7 +917,7 @@ fail:
> > return NULL;
> > }
> >
> > -int sd_resolv_getnameinfo_done(sd_resolv_t *resolv, sd_resolv_query_t*
> q, char *ret_host, size_t hostlen, char *ret_serv, size_t servlen) {
> > +_public_ int sd_resolv_getnameinfo_done(sd_resolv_t *resolv,
> sd_resolv_query_t* q, char *ret_host, size_t hostlen, char *ret_serv,
> size_t servlen) {
> > int ret;
> > assert(resolv);
> > assert(q);
> > @@ -1002,15 +1002,15 @@ fail:
> > return NULL;
> > }
> >
> > -sd_resolv_query_t* sd_resolv_res_query(sd_resolv_t *resolv, const char
> *dname, int class, int type) {
> > +_public_ sd_resolv_query_t* sd_resolv_res_query(sd_resolv_t *resolv,
> const char *dname, int class, int type) {
> > return resolv_res(resolv, REQUEST_RES_QUERY, dname, class,
> type);
> > }
> >
> > -sd_resolv_query_t* sd_resolv_res_search(sd_resolv_t *resolv, const char
> *dname, int class, int type) {
> > +_public_ sd_resolv_query_t* sd_resolv_res_search(sd_resolv_t *resolv,
> const char *dname, int class, int type) {
> > return resolv_res(resolv, REQUEST_RES_SEARCH, dname, class,
> type);
> > }
> >
> > -int sd_resolv_res_done(sd_resolv_t *resolv, sd_resolv_query_t* q,
> unsigned char **answer) {
> > +_public_ int sd_resolv_res_done(sd_resolv_t *resolv, sd_resolv_query_t*
> q, unsigned char **answer) {
> > int ret;
> > assert(resolv);
> > assert(q);
> > @@ -1043,17 +1043,17 @@ int sd_resolv_res_done(sd_resolv_t *resolv,
> sd_resolv_query_t* q, unsigned char
> > return ret < 0 ? -errno : ret;
> > }
> >
> > -sd_resolv_query_t* sd_resolv_getnext(sd_resolv_t *resolv) {
> > +_public_ sd_resolv_query_t* sd_resolv_getnext(sd_resolv_t *resolv) {
> > assert(resolv);
> > return resolv->done_head;
> > }
> >
> > -int sd_resolv_getnqueries(sd_resolv_t *resolv) {
> > +_public_ int sd_resolv_getnqueries(sd_resolv_t *resolv) {
> > assert(resolv);
> > return resolv->n_queries;
> > }
> >
> > -void sd_resolv_cancel(sd_resolv_t *resolv, sd_resolv_query_t* q) {
> > +_public_ void sd_resolv_cancel(sd_resolv_t *resolv, sd_resolv_query_t*
> q) {
> > int i;
> > int saved_errno = errno;
> >
> > @@ -1089,7 +1089,7 @@ void sd_resolv_cancel(sd_resolv_t *resolv,
> sd_resolv_query_t* q) {
> > errno = saved_errno;
> > }
> >
> > -void sd_resolv_freeaddrinfo(struct addrinfo *ai) {
> > +_public_ void sd_resolv_freeaddrinfo(struct addrinfo *ai) {
> > int saved_errno = errno;
> >
> > while (ai) {
> > @@ -1105,7 +1105,7 @@ void sd_resolv_freeaddrinfo(struct addrinfo *ai) {
> > errno = saved_errno;
> > }
> >
> > -void sd_resolv_freeanswer(unsigned char *answer) {
> > +_public_ void sd_resolv_freeanswer(unsigned char *answer) {
> > int saved_errno = errno;
> >
> > if (!answer)
> > @@ -1116,7 +1116,7 @@ void sd_resolv_freeanswer(unsigned char *answer) {
> > errno = saved_errno;
> > }
> >
> > -int sd_resolv_isdone(sd_resolv_t *resolv, sd_resolv_query_t*q) {
> > +_public_ int sd_resolv_isdone(sd_resolv_t *resolv, sd_resolv_query_t*q)
> {
> > assert(resolv);
> > assert(q);
> > assert(q->resolv == resolv);
> > @@ -1124,7 +1124,7 @@ int sd_resolv_isdone(sd_resolv_t *resolv,
> sd_resolv_query_t*q) {
> > return q->done;
> > }
> >
> > -void sd_resolv_setuserdata(sd_resolv_t *resolv, sd_resolv_query_t *q,
> void *userdata) {
> > +_public_ void sd_resolv_setuserdata(sd_resolv_t *resolv,
> sd_resolv_query_t *q, void *userdata) {
> > assert(q);
> > assert(resolv);
> > assert(q->resolv = resolv);
> > @@ -1132,7 +1132,7 @@ void sd_resolv_setuserdata(sd_resolv_t *resolv,
> sd_resolv_query_t *q, void *user
> > q->userdata = userdata;
> > }
> >
> > -void* sd_resolv_getuserdata(sd_resolv_t *resolv, sd_resolv_query_t *q) {
> > +_public_ void* sd_resolv_getuserdata(sd_resolv_t *resolv,
> sd_resolv_query_t *q) {
> > assert(q);
> > assert(resolv);
> > assert(q->resolv = resolv);
> > --
> > 1.8.5.2
> >
> > _______________________________________________
> > systemd-devel mailing list
> > systemd-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140114/69f58409/attachment.html>
More information about the systemd-devel
mailing list