summaryrefslogtreecommitdiffstats
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-05-10 08:54:40 +0200
committerPavel Machek <pavel@ucw.cz>2000-05-10 08:54:40 +0200
commitc0100454cf37833d23fdb9d24412de659f683c12 (patch)
treea1e632070155a9660885f0a9a3eff0e1ec5eacfd /nest/rt-attr.c
parentfe95ab68164f0c9f18e65f7965ac4d93b24bef97 (diff)
downloadbird-c0100454cf37833d23fdb9d24412de659f683c12.tar
bird-c0100454cf37833d23fdb9d24412de659f683c12.zip
Added more convient interface for ea_find.
What is special about int default;? Compiler chokes on that!
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r--nest/rt-attr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index d2e5ae9..53e85a6 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -70,6 +70,15 @@ ea_find(ea_list *e, unsigned id)
return a;
}
+int
+ea_get_int(ea_list *e, unsigned id, int def)
+{
+ eattr *a = ea_find(e, id);
+ if (!a)
+ return def;
+ return a->u.data;
+}
+
static inline void
ea_do_sort(ea_list *e)
{