chiark / gitweb /
sd-resolv: rename to sd-resolve
[elogind.git] / src / systemd / sd-resolve.h
similarity index 52%
rename from src/systemd/sd-resolv.h
rename to src/systemd/sd-resolve.h
index 21e2413542379dc31fd52fd55bf5422c6e1d9993..2023f11e7294eebf76ee0f81ad510ddb00c3f4e6 100644 (file)
@@ -1,7 +1,7 @@
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
-#ifndef foosdresolvhfoo
-#define foosdresolvhfoo
+#ifndef foosdresolvehfoo
+#define foosdresolvehfoo
 
 /***
   This file is part of systemd.
 
 /***
   This file is part of systemd.
@@ -33,125 +33,125 @@ _SD_BEGIN_DECLARATIONS;
  *
  * \section moo Method of operation
  *
  *
  * \section moo Method of operation
  *
- * To use libresolv allocate an sd_resolv_t object with
- * sd_resolv_new(). This will spawn a number of worker threads (or processes, depending on what is available) which
+ * To use sd-resolve allocate an sd_resolve_t object with
+ * sd_resolve_new(). This will spawn a number of worker threads (or processes, depending on what is available) which
  * are subsequently used to process the queries the controlling
  * are subsequently used to process the queries the controlling
- * program issues via sd_resolv_getaddrinfo() and
- * sd_resolv_getnameinfo(). Use sd_resolv_free() to shut down the worker
+ * program issues via sd_resolve_getaddrinfo() and
+ * sd_resolve_getnameinfo(). Use sd_resolve_free() to shut down the worker
  * threads/processes.
  *
  * threads/processes.
  *
- * Since libresolv may fork off new processes you have to make sure that
+ * Since sd-resolve may fork off new processes you have to make sure that
  * your program is not irritated by spurious SIGCHLD signals.
  */
 
  * your program is not irritated by spurious SIGCHLD signals.
  */
 
-/** An opaque libresolv session structure */
-typedef struct sd_resolv sd_resolv_t;
+/** An opaque sd-resolve session structure */
+typedef struct sd_resolve sd_resolve_t;
 
 
-/** An opaque libresolv query structure */
-typedef struct sd_resolv_query sd_resolv_query_t;
+/** An opaque sd-resolve query structure */
+typedef struct sd_resolve_query sd_resolve_query_t;
 
 
-/** Allocate a new libresolv session with n_proc worker processes/threads */
-sd_resolv_t* sd_resolv_new(unsigned n_proc);
+/** Allocate a new sd-resolve session with n_proc worker processes/threads */
+sd_resolve_t* sd_resolve_new(unsigned n_proc);
 
 
-/** Free a libresolv session. This destroys all attached
- * sd_resolv_query_t objects automatically */
-void sd_resolv_free(sd_resolv_t *resolv);
+/** Free a sd-resolve session. This destroys all attached
+ * sd_resolve_query_t objects automatically */
+void sd_resolve_free(sd_resolve_t *resolve);
 
 /** Return the UNIX file descriptor to select() for readability
 
 /** Return the UNIX file descriptor to select() for readability
- * on. Use this function to integrate libresolv with your custom main
+ * on. Use this function to integrate sd-resolve with your custom main
  * loop. */
  * loop. */
-int sd_resolv_fd(sd_resolv_t *resolv);
+int sd_resolve_fd(sd_resolve_t *resolve);
 
 /** Process pending responses. After this function is called you can
 
 /** Process pending responses. After this function is called you can
- * get the next completed query object(s) using sd_resolv_getnext(). If
+ * get the next completed query object(s) using sd_resolve_getnext(). If
  * block is non-zero wait until at least one response has been
  * processed. If block is zero, process all pending responses and
  * return. */
  * block is non-zero wait until at least one response has been
  * processed. If block is zero, process all pending responses and
  * return. */
-int sd_resolv_wait(sd_resolv_t *resolv, int block);
+int sd_resolve_wait(sd_resolve_t *resolve, int block);
 
 /** Issue a name to address query on the specified session. The
  * arguments are compatible with the ones of libc's
  * getaddrinfo(3). The function returns a new query object. When the
  * query is completed you may retrieve the results using
 
 /** Issue a name to address query on the specified session. The
  * arguments are compatible with the ones of libc's
  * getaddrinfo(3). The function returns a new query object. When the
  * query is completed you may retrieve the results using
- * sd_resolv_getaddrinfo_done().*/
-sd_resolv_query_t* sd_resolv_getaddrinfo(sd_resolv_t *resolv, const char *node, const char *service, const struct addrinfo *hints);
+ * sd_resolve_getaddrinfo_done().*/
+sd_resolve_query_t* sd_resolve_getaddrinfo(sd_resolve_t *resolve, const char *node, const char *service, const struct addrinfo *hints);
 
 
-/** Retrieve the results of a preceding sd_resolv_getaddrinfo()
+/** Retrieve the results of a preceding sd_resolve_getaddrinfo()
  * call. Returns a addrinfo structure and a return value compatible
  * with libc's getaddrinfo(3). The query object q is destroyed by this
  * call and may not be used any further. Make sure to free the
  * call. Returns a addrinfo structure and a return value compatible
  * with libc's getaddrinfo(3). The query object q is destroyed by this
  * call and may not be used any further. Make sure to free the
- * returned addrinfo structure with sd_resolv_freeaddrinfo() and not
+ * returned addrinfo structure with sd_resolve_freeaddrinfo() and not
  * libc's freeaddrinfo(3)! If the query is not completed yet EAI_AGAIN
  * is returned.*/
  * libc's freeaddrinfo(3)! If the query is not completed yet EAI_AGAIN
  * is returned.*/
-int sd_resolv_getaddrinfo_done(sd_resolv_t *resolv, sd_resolv_query_t* q, struct addrinfo **ret_res);
+int sd_resolve_getaddrinfo_done(sd_resolve_t *resolve, sd_resolve_query_t* q, struct addrinfo **ret_res);
 
 /** Issue an address to name query on the specified session. The
  * arguments are compatible with the ones of libc's
  * getnameinfo(3). The function returns a new query object. When the
  * query is completed you may retrieve the results using
 
 /** Issue an address to name query on the specified session. The
  * arguments are compatible with the ones of libc's
  * getnameinfo(3). The function returns a new query object. When the
  * query is completed you may retrieve the results using
- * sd_resolv_getnameinfo_done(). Set gethost (resp. getserv) to non-zero
+ * sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero
  * if you want to query the hostname (resp. the service name). */
  * if you want to query the hostname (resp. the service name). */
-sd_resolv_query_t* sd_resolv_getnameinfo(sd_resolv_t *resolv, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv);
+sd_resolve_query_t* sd_resolve_getnameinfo(sd_resolve_t *resolve, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv);
 
 
-/** Retrieve the results of a preceding sd_resolv_getnameinfo()
+/** Retrieve the results of a preceding sd_resolve_getnameinfo()
  * call. Returns the hostname and the service name in ret_host and
  * ret_serv. The query object q is destroyed by this call and may not
  * be used any further. If the query is not completed yet EAI_AGAIN is
  * returned. */
  * call. Returns the hostname and the service name in ret_host and
  * ret_serv. The query object q is destroyed by this call and may not
  * be used any further. If the query is not completed yet EAI_AGAIN is
  * returned. */
-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 sd_resolve_getnameinfo_done(sd_resolve_t *resolve, sd_resolve_query_t* q, char *ret_host, size_t hostlen, char *ret_serv, size_t servlen);
 
 
-/** Issue a resolver query on the specified session. The arguments are
+/** Issue a resolveer query on the specified session. The arguments are
  * 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
  * 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_resolv_res_done().  */
-sd_resolv_query_t* sd_resolv_res_query(sd_resolv_t *resolv, const char *dname, int class, int type);
+ * sd_resolve_res_done().  */
+sd_resolve_query_t* sd_resolve_res_query(sd_resolve_t *resolve, const char *dname, int class, int type);
 
 
-/** Issue an resolver query on the specified session. The arguments are
+/** Issue an resolveer 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
  * 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_resolv_res_done().  */
-sd_resolv_query_t* sd_resolv_res_search(sd_resolv_t *resolv, const char *dname, int class, int type);
+ * sd_resolve_res_done().  */
+sd_resolve_query_t* sd_resolve_res_search(sd_resolve_t *resolve, const char *dname, int class, int type);
 
 
-/** Retrieve the results of a preceding sd_resolv_res_query() or
- * resolv_res_search call.  The query object q is destroyed by this
+/** Retrieve the results of a preceding sd_resolve_res_query() or
+ * resolve_res_search call.  The query object q is destroyed by this
  * call and may not be used any further. Returns a pointer to the
  * answer of the res_query call. If the query is not completed yet
  * -EAGAIN is returned, on failure -errno is returned, otherwise the
  * length of answer is returned. Make sure to free the answer is a
  * call and may not be used any further. Returns a pointer to the
  * answer of the res_query call. If the query is not completed yet
  * -EAGAIN is returned, on failure -errno is returned, otherwise the
  * length of answer is returned. Make sure to free the answer is a
- * call to sd_resolv_freeanswer(). */
-int sd_resolv_res_done(sd_resolv_t *resolv, sd_resolv_query_t* q, unsigned char **answer);
+ * call to sd_resolve_freeanswer(). */
+int sd_resolve_res_done(sd_resolve_t *resolve, sd_resolve_query_t* q, unsigned char **answer);
 
 /** Return the next completed query object. If no query has been
  * completed yet, return NULL. Please note that you need to run
 
 /** Return the next completed query object. If no query has been
  * completed yet, return NULL. Please note that you need to run
- * sd_resolv_wait() before this function will return sensible data.  */
-sd_resolv_query_t* sd_resolv_getnext(sd_resolv_t *resolv);
+ * sd_resolve_wait() before this function will return sensible data.  */
+sd_resolve_query_t* sd_resolve_getnext(sd_resolve_t *resolve);
 
 /** Return the number of query objects (completed or not) attached to
  * this session */
 
 /** Return the number of query objects (completed or not) attached to
  * this session */
-int sd_resolv_getnqueries(sd_resolv_t *resolv);
+int sd_resolve_getnqueries(sd_resolve_t *resolve);
 
 /** Cancel a currently running query. q is is destroyed by this call
  * and may not be used any futher. */
 
 /** Cancel a currently running query. q is is destroyed by this call
  * and may not be used any futher. */
-void sd_resolv_cancel(sd_resolv_t *resolv, sd_resolv_query_t* q);
+void sd_resolve_cancel(sd_resolve_t *resolve, sd_resolve_query_t* q);
 
 /** Free the addrinfo structure as returned by
 
 /** Free the addrinfo structure as returned by
- * sd_resolv_getaddrinfo_done(). Make sure to use this functions instead
+ * sd_resolve_getaddrinfo_done(). Make sure to use this functions instead
  * of the libc's freeaddrinfo()! */
  * of the libc's freeaddrinfo()! */
-void sd_resolv_freeaddrinfo(struct addrinfo *ai);
+void sd_resolve_freeaddrinfo(struct addrinfo *ai);
 
 
-/** Free the answer data as returned by sd_resolv_res_done().*/
-void sd_resolv_freeanswer(unsigned char *answer);
+/** 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 */
 
 /** Returns non-zero when the query operation specified by q has been completed */
-int sd_resolv_isdone(sd_resolv_t *resolv, sd_resolv_query_t*q);
+int sd_resolve_isdone(sd_resolve_t *resolve, sd_resolve_query_t*q);
 
 /** Assign some opaque userdata with a query object */
 
 /** Assign some opaque userdata with a query object */
-void sd_resolv_setuserdata(sd_resolv_t *resolv, sd_resolv_query_t *q, void *userdata);
+void sd_resolve_setuserdata(sd_resolve_t *resolve, sd_resolve_query_t *q, void *userdata);
 
 /** Return userdata assigned to a query object. Use
 
 /** Return userdata assigned to a query object. Use
- * sd_resolv_setuserdata() to set this data. If no data has been set
+ * sd_resolve_setuserdata() to set this data. If no data has been set
  * prior to this call it returns NULL. */
  * prior to this call it returns NULL. */
-void* sd_resolv_getuserdata(sd_resolv_t *resolv, sd_resolv_query_t *q);
+void* sd_resolve_getuserdata(sd_resolve_t *resolve, sd_resolve_query_t *q);
 
 _SD_END_DECLARATIONS;
 
 
 _SD_END_DECLARATIONS;