comparison libao2/ao_nas.c @ 28192:bc49998d5745

Move several of the ao_nas int-to-string maps into .rodata
author reimar
date Thu, 01 Jan 2009 11:51:52 +0000
parents 5723b671a0f6
children e45b08f2f5d3
comparison
equal deleted inserted replaced
28191:a39df27439b9 28192:bc49998d5745
42 #include "libaf/af_format.h" 42 #include "libaf/af_format.h"
43 43
44 /* NAS_FRAG_SIZE must be a power-of-two value */ 44 /* NAS_FRAG_SIZE must be a power-of-two value */
45 #define NAS_FRAG_SIZE 4096 45 #define NAS_FRAG_SIZE 4096
46 46
47 static char *nas_event_types[] = { 47 static const char * const nas_event_types[] = {
48 "Undefined", 48 "Undefined",
49 "Undefined", 49 "Undefined",
50 "ElementNotify", 50 "ElementNotify",
51 "GrabNotify", 51 "GrabNotify",
52 "MonitorNotify", 52 "MonitorNotify",
53 "BucketNotify", 53 "BucketNotify",
54 "DeviceNotify" 54 "DeviceNotify"
55 }; 55 };
56 56
57 static char *nas_elementnotify_kinds[] = { 57 static const char * const nas_elementnotify_kinds[] = {
58 "LowWater", 58 "LowWater",
59 "HighWater", 59 "HighWater",
60 "State", 60 "State",
61 "Unknown" 61 "Unknown"
62 }; 62 };
63 63
64 static char *nas_states[] = { 64 static const char * const nas_states[] = {
65 "Stop", 65 "Stop",
66 "Start", 66 "Start",
67 "Pause", 67 "Pause",
68 "Any" 68 "Any"
69 }; 69 };
70 70
71 static char *nas_reasons[] = { 71 static const char * const nas_reasons[] = {
72 "User", 72 "User",
73 "Underrun", 73 "Underrun",
74 "Overrun", 74 "Overrun",
75 "EOF", 75 "EOF",
76 "Watermark", 76 "Watermark",
77 "Hardware", 77 "Hardware",
78 "Any" 78 "Any"
79 }; 79 };
80 80
81 static char* nas_reason(unsigned int reason) 81 static const char* nas_reason(unsigned int reason)
82 { 82 {
83 if (reason > 6) reason = 6; 83 if (reason > 6) reason = 6;
84 return nas_reasons[reason]; 84 return nas_reasons[reason];
85 } 85 }
86 86
87 static char* nas_elementnotify_kind(unsigned int kind) 87 static const char* nas_elementnotify_kind(unsigned int kind)
88 { 88 {
89 if (kind > 2) kind = 3; 89 if (kind > 2) kind = 3;
90 return nas_elementnotify_kinds[kind]; 90 return nas_elementnotify_kinds[kind];
91 } 91 }
92 92
93 static char* nas_event_type(unsigned int type) { 93 static const char* nas_event_type(unsigned int type) {
94 if (type > 6) type = 0; 94 if (type > 6) type = 0;
95 return nas_event_types[type]; 95 return nas_event_types[type];
96 } 96 }
97 97
98 static char* nas_state(unsigned int state) { 98 static const char* nas_state(unsigned int state) {
99 if (state>3) state = 3; 99 if (state>3) state = 3;
100 return nas_states[state]; 100 return nas_states[state];
101 } 101 }
102 102
103 static ao_info_t info = 103 static ao_info_t info =