X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubus.git;a=blobdiff_plain;f=ubusd_id.c;h=8d9fede2dd10296db2d8abc189bc3075fb216150;hp=a9cfeae88be255057ad1407d977619d80c654e36;hb=6f4e11e1db399074273944329883f9c35e7daef6;hpb=fa989780bda3ad10fcbb637390d59afe2b32ba81 diff --git a/ubusd_id.c b/ubusd_id.c index a9cfeae..8d9fede 100644 --- a/ubusd_id.c +++ b/ubusd_id.c @@ -1,7 +1,21 @@ +/* + * Copyright (C) 2011 Felix Fietkau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + */ + #include #include #include #include +#include #include "ubusmsg.h" #include "ubusd_id.h" @@ -18,14 +32,9 @@ static int ubus_cmp_id(const void *k1, const void *k2, void *ptr) return *id1 > *id2; } -static int ubus_cmp_str(const void *k1, const void *k2, void *ptr) -{ - return strcmp(k1, k2); -} - void ubus_init_string_tree(struct avl_tree *tree, bool dup) { - avl_init(tree, ubus_cmp_str, dup, NULL); + avl_init(tree, avl_strcmp, dup, NULL); } void ubus_init_id_tree(struct avl_tree *tree)