1 #include <linux/ctype.h>
65 if (!
strcmp(keyword,
"ALPHA"))
67 else if (!
strcmp(keyword,
"B_CTL"))
69 else if (!
strcmp(keyword,
"WDLM"))
71 else if (!
strcmp(keyword,
"A_PUNC"))
73 else if (!
strcmp(keyword,
"PUNC"))
75 else if (!
strcmp(keyword,
"NUM"))
77 else if (!
strcmp(keyword,
"A_CAP"))
79 else if (!
strcmp(keyword,
"B_CAPSYM"))
81 else if (!
strcmp(keyword,
"B_SYM"))
93 if (var_ptrs[0] ==
NULL) {
95 p_header = &var_headers[
i];
96 var_ptrs[p_header->
var_id] = p_header;
100 p_header = var_ptrs[var->
var_id];
103 p_header->
data = var;
122 p_header = var_ptrs[
var_id];
129 if (var_id < 0 || var_id >=
MAXVARS)
131 p_header = var_ptrs[
var_id];
145 if (
strcmp(name, var_ptrs[i]->name) == 0)
157 BUG_ON(!var_ptrs[var_id]);
168 while ((where->
var_id != -1) && (rv ==
NULL)) {
169 if (where->
var_id == var_id)
182 int *p_val = var->
p_val;
187 if (var_data ==
NULL)
191 if (input < var_data->
u.n.low || input > var_data->
u.
n.high)
194 var_data->
u.
n.default_val =
input;
198 val = var_data->
u.
n.default_val;
204 val = var_data->
u.
n.value;
207 else if (how ==
E_DEC)
209 if (val < var_data->
u.n.low || val > var_data->
u.
n.high)
212 var_data->
u.
n.value =
val;
223 if (var_data->
u.
n.multiplier != 0)
224 val *= var_data->
u.
n.multiplier;
225 val += var_data->
u.
n.offset;
230 return (status != 0) ? status :
ret;
232 if (!var_data->
u.
n.synth_fmt)
238 if (!var_data->
u.
n.out_str)
239 l =
sprintf(cp, var_data->
u.
n.synth_fmt, (
int)val);
242 var_data->
u.
n.synth_fmt, var_data->
u.
n.out_str[val]);
251 if (var_data ==
NULL)
256 if (!var_data->
u.
s.default_val)
260 var->
p_val = var_data->
u.
s.default_val;
261 if (var->
p_val != var_data->
u.
s.default_val)
263 }
else if (var->
p_val)
326 if (ch ==
'-' || ch ==
'+')
328 if (*start < '0' || *start >
'9')
330 val = (*start) -
'0';
332 while (*start >=
'0' && *start <=
'9') {
334 val += (*start) -
'0';
347 while (*start && *start <=
SPACE)
349 while (*start >=
'0' && *start <=
'9') {
351 val += (*start) -
'0';
362 static const char finds[] =
"nrtvafe";
363 static const char subs[] =
"\n\r\t\013\001\014\033";
364 static const char hx[] =
"0123456789abcdefABCDEF";
365 char *
p =
s, *
p1, *p2,
c;
367 while ((p =
strchr(p,
'\\'))) {
371 *p++ = subs[p2-finds];
373 }
else if (*p1 >=
'0' && *p1 <=
'7') {
375 while (num < 256 && *p1 >=
'0' && *p1 <=
'7') {
380 }
else if (*p1 ==
'x' &&
385 c = (c -
'7') & 0x0f;