4.104.114.84.95
Line | |
---|
1 | /* |
---|
2 | * assoc.c |
---|
3 | * rtems assoc routines |
---|
4 | * |
---|
5 | * $Id$ |
---|
6 | */ |
---|
7 | |
---|
8 | #if HAVE_CONFIG_H |
---|
9 | #include "config.h" |
---|
10 | #endif |
---|
11 | |
---|
12 | #include <rtems.h> |
---|
13 | #include <rtems/assoc.h> |
---|
14 | |
---|
15 | #include <stdio.h> /* sprintf */ |
---|
16 | #include <string.h> /* strcat, strcmp */ |
---|
17 | |
---|
18 | #define STREQ(a,b) (strcmp((a), (b)) == 0) |
---|
19 | #define rtems_assoc_is_default(ap) ((ap)->name && STREQ(ap->name, RTEMS_ASSOC_DEFAULT_NAME)) |
---|
20 | |
---|
21 | /* |
---|
22 | * what to return if a value is not found |
---|
23 | * this is not reentrant, but it really shouldn't be invoked anyway |
---|
24 | */ |
---|
25 | |
---|
26 | const char * |
---|
27 | rtems_assoc_name_bad( |
---|
28 | uint32_t bad_value |
---|
29 | ) |
---|
30 | { |
---|
31 | #ifdef RTEMS_DEBUG |
---|
32 | static char bad_buffer[32]; |
---|
33 | |
---|
34 | sprintf(bad_buffer, "< %d [0x%x] >", bad_value, bad_value); |
---|
35 | #else |
---|
36 | static char bad_buffer[32] = "<assoc.c: BAD NAME>"; |
---|
37 | #endif |
---|
38 | return bad_buffer; |
---|
39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.