Commit c0100454 authored by Pavel Machek's avatar Pavel Machek

Added more convient interface for ea_find.

What is special about int default;? Compiler chokes on that!
parent fe95ab68
......@@ -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 */
......@@ -70,6 +70,15 @@ ea_find(ea_list *e, unsigned id)
return a;
ea_get_int(ea_list *e, unsigned id, int def)
eattr *a = ea_find(e, id);
if (!a)
return def;
return a->;
static inline void
ea_do_sort(ea_list *e)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment