0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-17 08:38:42 +00:00

Added more convient interface for ea_find.

What is special about int default;? Compiler chokes on that!
This commit is contained in:
Pavel Machek 2000-05-10 06:54:40 +00:00
parent fe95ab6816
commit c0100454cf
2 changed files with 10 additions and 0 deletions

View File

@ -324,6 +324,7 @@ typedef struct ea_list {
#define EALF_CACHED 4 /* Attributes belonging to cached rta */
eattr *ea_find(ea_list *, unsigned ea);
int ea_get_int(ea_list *, unsigned ea, int def);
void ea_dump(ea_list *);
void ea_sort(ea_list *); /* Sort entries in all sub-lists */
unsigned ea_scan(ea_list *); /* How many bytes do we need for merged ea_list */

View File

@ -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)
{