]> git.meshlink.io Git - catta/blobdiff - avahi-compat-howl/text.c
from now on we enforce a strict whitespace regime
[catta] / avahi-compat-howl / text.c
index 3b717bef610cd54d02ecfdb7b11b0f73861fd2d9..178ca73602bb1bba046e571d020ac450fb4811d2 100644 (file)
@@ -2,17 +2,17 @@
 
 /***
   This file is part of avahi.
+
   avahi is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
+
   avahi is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
   Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public
   License along with avahi; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -44,12 +44,12 @@ struct _sw_text_record {
 static size_t strlcpy(char *dest, const char *src, size_t n) {
     assert(dest);
     assert(src);
-    
+
     if (n > 0) {
         strncpy(dest, src, n-1);
         dest[n-1] = 0;
     }
-    
+
     return strlen(src);
 }
 
@@ -59,17 +59,17 @@ sw_result sw_text_record_init(sw_text_record *self) {
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(*self = avahi_new(struct _sw_text_record, 1))) {
         *self = NULL;
         return SW_E_UNKNOWN;
     }
-    
+
     (*self)->strlst = NULL;
     (*self)->buffer = NULL;
     (*self)->buffer_size = 0;
     (*self)->buffer_valid = 0;
-    
+
     return SW_OKAY;
 }
 
@@ -89,12 +89,12 @@ sw_result sw_text_record_add_string(
     sw_const_string string) {
 
     AvahiStringList *n;
-    
+
     assert(self);
     assert(string);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(n = avahi_string_list_add(self->strlst, string)))
         return SW_E_UNKNOWN;
 
@@ -112,7 +112,7 @@ sw_result sw_text_record_add_key_and_string_value(
 
     assert(self);
     assert(key);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!(n = avahi_string_list_add_pair(self->strlst, key, val)))
@@ -134,7 +134,7 @@ sw_result sw_text_record_add_key_and_binary_value(
     assert(self);
     assert(key);
     assert(len || !val);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!(n = avahi_string_list_add_pair_arbitrary(self->strlst, key, val, len)))
@@ -152,10 +152,10 @@ static int rebuild(sw_text_record self) {
         return 0;
 
     self->buffer_size = avahi_string_list_serialize(self->strlst, NULL, 0);
-    
+
     if (!(self->buffer = avahi_realloc(self->buffer, self->buffer_size + 1)))
         return -1;
-        
+
     avahi_string_list_serialize(self->strlst, self->buffer, self->buffer_size);
     self->buffer_valid = 1;
 
@@ -177,7 +177,7 @@ sw_uint32 sw_text_record_len(sw_text_record self) {
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (rebuild(self) < 0)
         return (uint32_t) -1;
 
@@ -186,7 +186,7 @@ sw_uint32 sw_text_record_len(sw_text_record self) {
 
 struct _sw_text_record_iterator {
     AvahiStringList *strlst, *index;
-    
+
 };
 
 sw_result sw_text_record_iterator_init(
@@ -198,7 +198,7 @@ sw_result sw_text_record_iterator_init(
     assert(self);
 
     AVAHI_WARN_LINKAGE;
-    
+
     if (!(*self = avahi_new(struct _sw_text_record_iterator, 1))) {
         *self = NULL;
         return SW_E_UNKNOWN;
@@ -211,7 +211,7 @@ sw_result sw_text_record_iterator_init(
     }
 
     (*self)->index = (*self)->strlst = avahi_string_list_reverse(txt);
-    
+
     return SW_OKAY;
 }
 
@@ -222,7 +222,7 @@ sw_result sw_text_record_iterator_fina(sw_text_record_iterator self) {
 
     avahi_string_list_free(self->strlst);
     avahi_free(self);
-    
+
     return SW_OKAY;
 }
 
@@ -234,10 +234,10 @@ sw_result sw_text_record_iterator_next(
 
     char *mkey = NULL, *mvalue = NULL;
     size_t msize = 0;
-    
+
     assert(self);
     assert(key);
-    
+
     AVAHI_WARN_LINKAGE;
 
     if (!self->index)
@@ -250,7 +250,7 @@ sw_result sw_text_record_iterator_next(
     memset(val, 0, SW_TEXT_RECORD_MAX_LEN);
     memcpy(val, mvalue, msize);
     *val_len = msize;
-    
+
     avahi_free(mkey);
     avahi_free(mvalue);