Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Sep 2013 01:31:55 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255584 - head/contrib/unbound/libunbound
Message-ID:  <201309150131.r8F1Vtj3017571@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Sun Sep 15 01:31:55 2013
New Revision: 255584
URL: http://svnweb.freebsd.org/changeset/base/255584

Log:
  Wholesale constification.
  
  Approved by:	re (blanket)

Modified:
  head/contrib/unbound/libunbound/context.c
  head/contrib/unbound/libunbound/context.h
  head/contrib/unbound/libunbound/libunbound.c
  head/contrib/unbound/libunbound/unbound.h

Modified: head/contrib/unbound/libunbound/context.c
==============================================================================
--- head/contrib/unbound/libunbound/context.c	Sun Sep 15 01:29:00 2013	(r255583)
+++ head/contrib/unbound/libunbound/context.c	Sun Sep 15 01:31:55 2013	(r255584)
@@ -124,7 +124,7 @@ find_id(struct ub_ctx* ctx, int* id)
 }
 
 struct ctx_query* 
-context_new(struct ub_ctx* ctx, char* name, int rrtype, int rrclass, 
+context_new(struct ub_ctx* ctx, const char* name, int rrtype, int rrclass,
 	ub_callback_t cb, void* cbarg)
 {
 	struct ctx_query* q = (struct ctx_query*)calloc(1, sizeof(*q));

Modified: head/contrib/unbound/libunbound/context.h
==============================================================================
--- head/contrib/unbound/libunbound/context.h	Sun Sep 15 01:29:00 2013	(r255583)
+++ head/contrib/unbound/libunbound/context.h	Sun Sep 15 01:31:55 2013	(r255584)
@@ -234,8 +234,8 @@ void context_query_delete(struct ctx_que
  * @param cbarg: user arg for async queries.
  * @return new ctx_query or NULL for malloc failure.
  */
-struct ctx_query* context_new(struct ub_ctx* ctx, char* name, int rrtype,
-        int rrclass, ub_callback_t cb, void* cbarg);
+struct ctx_query* context_new(struct ub_ctx* ctx, const char* name,
+	int rrtype, int rrclass, ub_callback_t cb, void* cbarg);
 
 /**
  * Get a new alloc. Creates a new one or uses a cached one.

Modified: head/contrib/unbound/libunbound/libunbound.c
==============================================================================
--- head/contrib/unbound/libunbound/libunbound.c	Sun Sep 15 01:29:00 2013	(r255583)
+++ head/contrib/unbound/libunbound/libunbound.c	Sun Sep 15 01:31:55 2013	(r255584)
@@ -229,7 +229,7 @@ ub_ctx_delete(struct ub_ctx* ctx)
 }
 
 int 
-ub_ctx_set_option(struct ub_ctx* ctx, char* opt, char* val)
+ub_ctx_set_option(struct ub_ctx* ctx, const char* opt, const char* val)
 {
 	lock_basic_lock(&ctx->cfglock);
 	if(ctx->finalized) {
@@ -245,7 +245,7 @@ ub_ctx_set_option(struct ub_ctx* ctx, ch
 }
 
 int
-ub_ctx_get_option(struct ub_ctx* ctx, char* opt, char** str)
+ub_ctx_get_option(struct ub_ctx* ctx, const char* opt, char** str)
 {
 	int r;
 	lock_basic_lock(&ctx->cfglock);
@@ -258,7 +258,7 @@ ub_ctx_get_option(struct ub_ctx* ctx, ch
 }
 
 int 
-ub_ctx_config(struct ub_ctx* ctx, char* fname)
+ub_ctx_config(struct ub_ctx* ctx, const char* fname)
 {
 	lock_basic_lock(&ctx->cfglock);
 	if(ctx->finalized) {
@@ -274,7 +274,7 @@ ub_ctx_config(struct ub_ctx* ctx, char* 
 }
 
 int 
-ub_ctx_add_ta(struct ub_ctx* ctx, char* ta)
+ub_ctx_add_ta(struct ub_ctx* ctx, const char* ta)
 {
 	char* dup = strdup(ta);
 	if(!dup) return UB_NOMEM;
@@ -294,7 +294,7 @@ ub_ctx_add_ta(struct ub_ctx* ctx, char* 
 }
 
 int 
-ub_ctx_add_ta_file(struct ub_ctx* ctx, char* fname)
+ub_ctx_add_ta_file(struct ub_ctx* ctx, const char* fname)
 {
 	char* dup = strdup(fname);
 	if(!dup) return UB_NOMEM;
@@ -314,7 +314,7 @@ ub_ctx_add_ta_file(struct ub_ctx* ctx, c
 }
 
 int 
-ub_ctx_trustedkeys(struct ub_ctx* ctx, char* fname)
+ub_ctx_trustedkeys(struct ub_ctx* ctx, const char* fname)
 {
 	char* dup = strdup(fname);
 	if(!dup) return UB_NOMEM;
@@ -547,7 +547,7 @@ ub_wait(struct ub_ctx* ctx)
 }
 
 int 
-ub_resolve(struct ub_ctx* ctx, char* name, int rrtype, 
+ub_resolve(struct ub_ctx* ctx, const char* name, int rrtype, 
 	int rrclass, struct ub_result** result)
 {
 	struct ctx_query* q;
@@ -591,7 +591,7 @@ ub_resolve(struct ub_ctx* ctx, char* nam
 }
 
 int 
-ub_resolve_async(struct ub_ctx* ctx, char* name, int rrtype, 
+ub_resolve_async(struct ub_ctx* ctx, const char* name, int rrtype, 
 	int rrclass, void* mydata, ub_callback_t callback, int* async_id)
 {
 	struct ctx_query* q;
@@ -732,7 +732,7 @@ ub_strerror(int err)
 }
 
 int 
-ub_ctx_set_fwd(struct ub_ctx* ctx, char* addr)
+ub_ctx_set_fwd(struct ub_ctx* ctx, const char* addr)
 {
 	struct sockaddr_storage storage;
 	socklen_t stlen;
@@ -804,7 +804,7 @@ ub_ctx_set_fwd(struct ub_ctx* ctx, char*
 }
 
 int 
-ub_ctx_resolvconf(struct ub_ctx* ctx, char* fname)
+ub_ctx_resolvconf(struct ub_ctx* ctx, const char* fname)
 {
 	FILE* in;
 	int numserv = 0;
@@ -890,7 +890,7 @@ ub_ctx_resolvconf(struct ub_ctx* ctx, ch
 }
 
 int
-ub_ctx_hosts(struct ub_ctx* ctx, char* fname)
+ub_ctx_hosts(struct ub_ctx* ctx, const char* fname)
 {
 	FILE* in;
 	char buf[1024], ldata[1024];

Modified: head/contrib/unbound/libunbound/unbound.h
==============================================================================
--- head/contrib/unbound/libunbound/unbound.h	Sun Sep 15 01:29:00 2013	(r255583)
+++ head/contrib/unbound/libunbound/unbound.h	Sun Sep 15 01:31:55 2013	(r255584)
@@ -245,7 +245,7 @@ void ub_ctx_delete(struct ub_ctx* ctx);
  * @param val: value of the option.
  * @return: 0 if OK, else error.
  */
-int ub_ctx_set_option(struct ub_ctx* ctx, char* opt, char* val);
+int ub_ctx_set_option(struct ub_ctx* ctx, const char* opt, const char* val);
 
 /**
  * Get an option from the context.
@@ -261,7 +261,7 @@ int ub_ctx_set_option(struct ub_ctx* ctx
  * 	returned in the string.
  * @return 0 if OK else an error code (malloc failure, syntax error).
  */
-int ub_ctx_get_option(struct ub_ctx* ctx, char* opt, char** str);
+int ub_ctx_get_option(struct ub_ctx* ctx, const char* opt, char** str);
 
 /**
  * setup configuration for the given context.
@@ -273,7 +273,7 @@ int ub_ctx_get_option(struct ub_ctx* ctx
  * 	routines exist.
  * @return: 0 if OK, else error.
  */
-int ub_ctx_config(struct ub_ctx* ctx, char* fname);
+int ub_ctx_config(struct ub_ctx* ctx, const char* fname);
 
 /**
  * Set machine to forward DNS queries to, the caching resolver to use. 
@@ -292,7 +292,7 @@ int ub_ctx_config(struct ub_ctx* ctx, ch
  * 	If the addr is NULL, forwarding is disabled.
  * @return 0 if OK, else error.
  */
-int ub_ctx_set_fwd(struct ub_ctx* ctx, char* addr);
+int ub_ctx_set_fwd(struct ub_ctx* ctx, const char* addr);
 
 /**
  * Read list of nameservers to use from the filename given.
@@ -308,7 +308,7 @@ int ub_ctx_set_fwd(struct ub_ctx* ctx, c
  * @param fname: file name string. If NULL "/etc/resolv.conf" is used.
  * @return 0 if OK, else error.
  */
-int ub_ctx_resolvconf(struct ub_ctx* ctx, char* fname);
+int ub_ctx_resolvconf(struct ub_ctx* ctx, const char* fname);
 
 /**
  * Read list of hosts from the filename given.
@@ -321,7 +321,7 @@ int ub_ctx_resolvconf(struct ub_ctx* ctx
  * @param fname: file name string. If NULL "/etc/hosts" is used.
  * @return 0 if OK, else error.
  */
-int ub_ctx_hosts(struct ub_ctx* ctx, char* fname);
+int ub_ctx_hosts(struct ub_ctx* ctx, const char* fname);
 
 /**
  * Add a trust anchor to the given context.
@@ -334,7 +334,7 @@ int ub_ctx_hosts(struct ub_ctx* ctx, cha
  * 	[domainname] [TTL optional] [type] [class optional] [rdata contents]
  * @return 0 if OK, else error.
  */
-int ub_ctx_add_ta(struct ub_ctx* ctx, char* ta);
+int ub_ctx_add_ta(struct ub_ctx* ctx, const char* ta);
 
 /**
  * Add trust anchors to the given context.
@@ -345,7 +345,7 @@ int ub_ctx_add_ta(struct ub_ctx* ctx, ch
  * @param fname: filename of file with keyfile with trust anchors.
  * @return 0 if OK, else error.
  */
-int ub_ctx_add_ta_file(struct ub_ctx* ctx, char* fname);
+int ub_ctx_add_ta_file(struct ub_ctx* ctx, const char* fname);
 
 /**
  * Add trust anchors to the given context.
@@ -357,7 +357,7 @@ int ub_ctx_add_ta_file(struct ub_ctx* ct
  * 	anchors.
  * @return 0 if OK, else error.
  */
-int ub_ctx_trustedkeys(struct ub_ctx* ctx, char* fname);
+int ub_ctx_trustedkeys(struct ub_ctx* ctx, const char* fname);
 
 /**
  * Set debug output (and error output) to the specified stream.
@@ -442,7 +442,7 @@ int ub_process(struct ub_ctx* ctx);
  * 	in that case (out of memory).
  * @return 0 if OK, else error.
  */
-int ub_resolve(struct ub_ctx* ctx, char* name, int rrtype, 
+int ub_resolve(struct ub_ctx* ctx, const char* name, int rrtype, 
 	int rrclass, struct ub_result** result);
 
 /**
@@ -473,7 +473,7 @@ int ub_resolve(struct ub_ctx* ctx, char*
  *	cancel the query.
  * @return 0 if OK, else error.
  */
-int ub_resolve_async(struct ub_ctx* ctx, char* name, int rrtype, 
+int ub_resolve_async(struct ub_ctx* ctx, const char* name, int rrtype, 
 	int rrclass, void* mydata, ub_callback_t callback, int* async_id);
 
 /**



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309150131.r8F1Vtj3017571>