summaryrefslogtreecommitdiffstats
path: root/avahi-common/domain.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-12 21:01:28 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-12 21:01:28 +0000
commit6e35536bddb52c8e6bc201265c77a846d879b5a3 (patch)
treef00a3475d91759f1fe3d36df2757cc8f230e9234 /avahi-common/domain.c
parent5d047523c87ba11aad8c384f7ffde25b4dd746ed (diff)
* implement hashmap
* de-glib-ify rr.[ch], rrlist.[ch] git-svn-id: file:///home/lennart/svn/public/avahi/trunk@306 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common/domain.c')
-rw-r--r--avahi-common/domain.c55
1 files changed, 4 insertions, 51 deletions
diff --git a/avahi-common/domain.c b/avahi-common/domain.c
index b1e7cfe..5a51a39 100644
--- a/avahi-common/domain.c
+++ b/avahi-common/domain.c
@@ -227,32 +227,7 @@ int avahi_binary_domain_cmp(const char *a, const char *b) {
}
}
-unsigned avahi_strhash(const char *p) {
- unsigned hash = 0;
-
- for (; *p; p++)
- hash = 31 * hash + *p;
-
- return hash;
-}
-
-unsigned avahi_domain_hash(const char *s) {
- unsigned hash = 0;
-
- for (;;) {
- char c[65];
-
- if (!avahi_unescape_label(&s, c, sizeof(c)))
- return hash;
-
- if (!c[0])
- continue;
-
- hash += avahi_strhash(avahi_strdown(c));
- }
-}
-
-int avahi_valid_service_type(const char *t) {
+int avahi_is_valid_service_type(const char *t) {
const char *p;
assert(t);
@@ -280,7 +255,7 @@ int avahi_valid_service_type(const char *t) {
return 1;
}
-int avahi_valid_domain_name(const char *t) {
+int avahi_is_valid_domain_name(const char *t) {
const char *p, *dp;
int dot = 0;
@@ -319,7 +294,7 @@ int avahi_valid_domain_name(const char *t) {
return 1;
}
-int avahi_valid_service_name(const char *t) {
+int avahi_is_valid_service_name(const char *t) {
assert(t);
if (*t == 0)
@@ -331,7 +306,7 @@ int avahi_valid_service_name(const char *t) {
return 1;
}
-int avahi_valid_host_name(const char *t) {
+int avahi_is_valid_host_name(const char *t) {
assert(t);
if (*t == 0)
@@ -345,25 +320,3 @@ int avahi_valid_host_name(const char *t) {
return 1;
}
-
-char *avahi_strdown(char *s) {
- char *c;
-
- assert(s);
-
- for (c = s; *c; c++)
- *c = (char) tolower(*c);
-
- return s;
-}
-
-char *avahi_strup(char *s) {
- char *c;
- assert(s);
-
- for (c = s; *c; c++)
- *c = (char) toupper(*c);
-
- return s;
-}
-