]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/as.c
Fix searching for ASes
[people/ms/libloc.git] / src / as.c
index f1f01ac9c7f2e8e968a7c0f5ae24f3710796c140..8be229ad72596a4b41dc0daa0bf29d13f50c0f37 100644 (file)
--- a/src/as.c
+++ b/src/as.c
@@ -14,6 +14,7 @@
        Lesser General Public License for more details.
 */
 
+#include <ctype.h>
 #include <endian.h>
 #include <errno.h>
 #include <stdint.h>
@@ -128,3 +129,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;
+}