4.115
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Associate Pointer by Name |
---|
5 | * @ingroup Associativity |
---|
6 | */ |
---|
7 | |
---|
8 | #if HAVE_CONFIG_H |
---|
9 | #include "config.h" |
---|
10 | #endif |
---|
11 | |
---|
12 | #define INSIDE_ASSOC |
---|
13 | |
---|
14 | #include <rtems.h> |
---|
15 | #include <rtems/assoc.h> |
---|
16 | |
---|
17 | #include <string.h> /* strcat, strcmp */ |
---|
18 | |
---|
19 | |
---|
20 | const rtems_assoc_t *rtems_assoc_ptr_by_name( |
---|
21 | const rtems_assoc_t *ap, |
---|
22 | const char *name |
---|
23 | ) |
---|
24 | { |
---|
25 | const rtems_assoc_t *default_ap = 0; |
---|
26 | |
---|
27 | if (rtems_assoc_is_default(ap)) |
---|
28 | default_ap = ap++; |
---|
29 | |
---|
30 | for ( ; ap->name; ap++) |
---|
31 | if (strcmp(ap->name, name) == 0) |
---|
32 | return ap; |
---|
33 | |
---|
34 | return default_ap; |
---|
35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.