summaryrefslogtreecommitdiffstats
path: root/avahi-common
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-common')
-rw-r--r--avahi-common/Makefile.am2
-rw-r--r--avahi-common/defs.h3
-rw-r--r--avahi-common/domain.c21
3 files changed, 14 insertions, 12 deletions
diff --git a/avahi-common/Makefile.am b/avahi-common/Makefile.am
index 972e9ad..670c855 100644
--- a/avahi-common/Makefile.am
+++ b/avahi-common/Makefile.am
@@ -40,12 +40,14 @@ avahi_commoninclude_HEADERS = \
llist.h \
rlist.h
+if ENABLE_TESTS
noinst_PROGRAMS = \
strlst-test \
domain-test \
alternative-test \
timeval-test \
watch-test
+endif
lib_LTLIBRARIES = \
libavahi-common.la
diff --git a/avahi-common/defs.h b/avahi-common/defs.h
index 67bdddc..3b8c2a5 100644
--- a/avahi-common/defs.h
+++ b/avahi-common/defs.h
@@ -154,7 +154,6 @@ typedef enum {
/** Some flags for publishing functions */
typedef enum {
- AVAHI_PUBLISH_NULL = 0,
AVAHI_PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
AVAHI_PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
AVAHI_PUBLISH_NO_ANNOUNCE = 4, /**< For raw records: Do not announce this RR to other hosts */
@@ -166,7 +165,6 @@ typedef enum {
/** Some flags for lookup functions */
typedef enum {
- AVAHI_LOOKUP_NULL = 0,
AVAHI_LOOKUP_USE_WIDE_AREA = 1, /**< Force lookup via wide area DNS */
AVAHI_LOOKUP_USE_MULTICAST = 2, /**< Force lookup via multicast DNS */
AVAHI_LOOKUP_NO_TXT = 4, /**< When doing service resolving, don't lookup TXT record */
@@ -175,7 +173,6 @@ typedef enum {
/** Some flags for lookup callback functions */
typedef enum {
- AVAHI_LOOKUP_RESULT_NULL = 0,
AVAHI_LOOKUP_RESULT_CACHED = 1, /**< This response originates from the cache */
AVAHI_LOOKUP_RESULT_WIDE_AREA = 2, /**< This response originates from wide area DNS */
AVAHI_LOOKUP_RESULT_MULTICAST = 4, /**< This response originates from multicast DNS */
diff --git a/avahi-common/domain.c b/avahi-common/domain.c
index f2e4395..e82411f 100644
--- a/avahi-common/domain.c
+++ b/avahi-common/domain.c
@@ -530,19 +530,22 @@ int avahi_service_name_join(char *p, size_t size, const char *name, const char *
return AVAHI_OK;
}
+#ifndef HAVE_STRLCPY
-char *avahi_strlcpy(char *dest, const char *src, size_t n) {
+static size_t strlcpy(char *dest, const char *src, size_t n) {
assert(dest);
assert(src);
-
- if (n == 0)
- return dest;
-
- strncpy(dest, src, n-1);
- dest[n-1] = 0;
- return dest;
+
+ if (n > 0) {
+ strncpy(dest, src, n-1);
+ dest[n-1] = 0;
+ }
+
+ return strlen(src);
}
+#endif
+
int avahi_service_name_split(const char *p, char *name, size_t name_size, char *type, size_t type_size, char *domain, size_t domain_size) {
enum {
NAME,
@@ -574,7 +577,7 @@ int avahi_service_name_split(const char *p, char *name, size_t name_size, char *
switch (state) {
case NAME:
- avahi_strlcpy(name, buf, name_size);
+ strlcpy(name, buf, name_size);
state = TYPE;
break;