Functions to handle items.
FossilOrigin-Name: 3e6122f6f3f260d1f83cc688fe38643869225fc5c0604a7582f83a35af7fc883
This commit is contained in:
parent
3dcf0d92cf
commit
2e5ad63544
28
src/capwap/item.c
Normal file
28
src/capwap/item.c
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
#include "item.h"
|
||||
#include "capwap_items.h"
|
||||
|
||||
struct cw_item * cw_item_get_by_id(int id,struct cw_item *table)
|
||||
{
|
||||
int i;
|
||||
while (table->id != CW_ITEM_NONE) {
|
||||
if (table->id == id)
|
||||
return table;
|
||||
table++;
|
||||
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
struct cw_item * cw_item_get_by_name(const char *name,struct cw_item *table)
|
||||
{
|
||||
int i;
|
||||
while (table->id != CW_ITEM_NONE) {
|
||||
if (!strcmp(table->cfgname,name))
|
||||
return table;
|
||||
table++;
|
||||
|
||||
}
|
||||
return NULL;
|
||||
}
|
Loading…
Reference in New Issue
Block a user