]> git.ipfire.org Git - location/libloc.git/blobdiff - src/as.c
Make package compile on Mac OS X
[location/libloc.git] / src / as.c
index f1f01ac9c7f2e8e968a7c0f5ae24f3710796c140..947bfd2872b662aa7fce571328e689fe72f1f8c3 100644 (file)
--- a/src/as.c
+++ b/src/as.c
        Lesser General Public License for more details.
 */
 
-#include <endian.h>
+#include <ctype.h>
 #include <errno.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_ENDIAN_H
+#  include <endian.h>
+#endif
+
 #include <loc/libloc.h>
 #include <loc/as.h>
+#include <loc/compat.h>
 #include <loc/format.h>
 #include <loc/private.h>
 #include <loc/stringpool.h>
@@ -128,3 +133,11 @@ int loc_as_to_database_v0(struct loc_as* as, struct loc_stringpool* pool,
 
        return 0;
 }
+
+int loc_as_match_string(struct loc_as* as, const char* string) {
+       // Search if string is in name
+       if (strcasestr(as->name, string) != NULL)
+               return 1;
+
+       return 0;
+}