This prefixes all externally-visible symbols of speakup with "spk_".
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static const int num_groups = sizeof(all_groups) / sizeof(struct msg_group_t);
-char *msg_get(enum msg_index_t index)
+char *spk_msg_get(enum msg_index_t index)
{
char *ch;
* -EINVAL - Invalid format specifiers in formatted message or illegal index.
* -ENOMEM - Unable to allocate memory.
*/
-ssize_t msg_set(enum msg_index_t index, char *text, size_t length)
+ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length)
{
int rc = 0;
char *newstr = NULL;
* Find a message group, given its name. Return a pointer to the structure
* if found, or NULL otherwise.
*/
-struct msg_group_t *find_msg_group(const char *group_name)
+struct msg_group_t *spk_find_msg_group(const char *group_name)
{
struct msg_group_t *group = NULL;
int i;
return group;
}
-void reset_msg_group(struct msg_group_t *group)
+void spk_reset_msg_group(struct msg_group_t *group)
{
unsigned long flags;
enum msg_index_t i;
}
/* Called at initialization time, to establish default messages. */
-void initialize_msgs(void)
+void spk_initialize_msgs(void)
{
memcpy(speakup_msgs, speakup_default_msgs,
sizeof(speakup_default_msgs));
}
/* Free user-supplied strings when module is unloaded: */
-void free_user_msgs(void)
+void spk_free_user_msgs(void)
{
enum msg_index_t index;
unsigned long flags;
enum msg_index_t end;
};
-extern char *msg_get(enum msg_index_t index);
-extern ssize_t msg_set(enum msg_index_t index, char *text, size_t length);
-extern struct msg_group_t *find_msg_group(const char *group_name);
-extern void reset_msg_group(struct msg_group_t *group);
-extern void initialize_msgs(void);
-extern void free_user_msgs(void);
+extern char *spk_msg_get(enum msg_index_t index);
+extern ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length);
+extern struct msg_group_t *spk_find_msg_group(const char *group_name);
+extern void spk_reset_msg_group(struct msg_group_t *group);
+extern void spk_initialize_msgs(void);
+extern void spk_free_user_msgs(void);
#endif
key &= 0xff;
for (i = 0; i < 6; i++) {
if (state & masks[i])
- synth_printf(" %s", msg_get(MSG_STATES_START + i));
+ synth_printf(" %s", spk_msg_get(MSG_STATES_START + i));
}
if ((key > 0) && (key <= num_key_names))
- synth_printf(" %s\n", msg_get(MSG_KEYNAMES_START + (key - 1)));
+ synth_printf(" %s\n", spk_msg_get(MSG_KEYNAMES_START + (key - 1)));
}
static int help_init(void)
char start = SPACE;
int i;
int num_funcs = MSG_FUNCNAMES_END - MSG_FUNCNAMES_START + 1;
-state_tbl = our_keys[0]+SHIFT_TBL_SIZE+2;
+state_tbl = spk_our_keys[0]+SHIFT_TBL_SIZE+2;
for (i = 0; i < num_funcs; i++) {
- char *cur_funcname = msg_get(MSG_FUNCNAMES_START + i);
+ char *cur_funcname = spk_msg_get(MSG_FUNCNAMES_START + i);
if (start == *cur_funcname)
continue;
start = *cur_funcname;
return 0;
}
-int handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
+int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
{
int i, n;
char *name;
help_init();
if (type == KT_LATIN) {
if (ch == SPACE) {
- special_handler = NULL;
- synth_printf("%s\n", msg_get(MSG_LEAVING_HELP));
+ spk_special_handler = NULL;
+ synth_printf("%s\n", spk_msg_get(MSG_LEAVING_HELP));
return 1;
}
ch |= 32; /* lower case */
if (ch < 'a' || ch > 'z')
return -1;
if (letter_offsets[ch-'a'] == -1) {
- synth_printf(msg_get(MSG_NO_COMMAND), ch);
+ synth_printf(spk_msg_get(MSG_NO_COMMAND), ch);
synth_printf("\n");
return 1;
}
cur_item--;
else
return -1;
- } else if (type == KT_SPKUP && ch == SPEAKUP_HELP && !special_handler) {
- special_handler = handle_help;
- synth_printf("%s\n", msg_get(MSG_HELP_INFO));
+ } else if (type == KT_SPKUP && ch == SPEAKUP_HELP && !spk_special_handler) {
+ spk_special_handler = spk_handle_help;
+ synth_printf("%s\n", spk_msg_get(MSG_HELP_INFO));
build_key_data(); /* rebuild each time in case new mapping */
return 1;
} else {
name = NULL;
if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) {
synth_printf("%s\n",
- msg_get(MSG_KEYNAMES_START + key-1));
+ spk_msg_get(MSG_KEYNAMES_START + key-1));
return 1;
}
for (i = 0; funcvals[i] != 0 && !name; i++) {
if (ch == funcvals[i])
- name = msg_get(MSG_FUNCNAMES_START + i);
+ name = spk_msg_get(MSG_FUNCNAMES_START + i);
}
if (!name)
return -1;
- kp = our_keys[key]+1;
+ kp = spk_our_keys[key]+1;
for (i = 0; i < nstates; i++) {
if (ch == kp[i])
break;
}
key += (state_tbl[i] << 8);
say_key(key);
- synth_printf(msg_get(MSG_KEYDESC), name);
+ synth_printf(spk_msg_get(MSG_KEYDESC), name);
synth_printf("\n");
return 1;
}
- name = msg_get(MSG_FUNCNAMES_START + cur_item);
+ name = spk_msg_get(MSG_FUNCNAMES_START + cur_item);
func = funcvals[cur_item];
synth_printf("%s", name);
if (key_offsets[func] == 0) {
- synth_printf(" %s\n", msg_get(MSG_IS_UNASSIGNED));
+ synth_printf(" %s\n", spk_msg_get(MSG_IS_UNASSIGNED));
return 1;
}
p_keys = key_data + key_offsets[func];
for (n = 0; p_keys[n]; n++) {
val = p_keys[n];
if (n > 0)
- synth_printf("%s ", msg_get(MSG_DISJUNCTION));
+ synth_printf("%s ", spk_msg_get(MSG_DISJUNCTION));
say_key(val);
}
return 1;
break;
if (strcmp("characters", attr->attr.name) == 0) {
len = scnprintf(buf_pointer, bufsize, "%d\t%s\n",
- i, characters[i]);
+ i, spk_characters[i]);
} else { /* show chartab entry */
if (IS_TYPE(i, B_CTL))
cp = "B_CTL";
outptr[desc_length] = '\0';
if (do_characters) {
- if (characters[index] != default_chars[index])
- kfree(characters[index]);
- characters[index] = desc;
+ if (spk_characters[index] != spk_default_chars[index])
+ kfree(spk_characters[index]);
+ spk_characters[index] = desc;
used++;
} else {
- charclass = chartab_get_value(keyword);
+ charclass = spk_chartab_get_value(keyword);
if (charclass == 0) {
rejected++;
cp = linefeed + 1;
if (reset) {
if (do_characters)
- reset_default_chars();
+ spk_reset_default_chars();
else
- reset_default_chartab();
+ spk_reset_default_chartab();
}
spk_unlock(flags);
u_char ch;
unsigned long flags;
spk_lock(flags);
- cp1 = key_buf + SHIFT_TBL_SIZE;
+ cp1 = spk_key_buf + SHIFT_TBL_SIZE;
num_keys = (int)(*cp1);
nstates = (int)cp1[1];
cp += sprintf(cp, "%d, %d, %d,\n", KEY_MAP_VER, num_keys, nstates);
return -ENOMEM;
}
if (strchr("dDrR", *in_buff)) {
- set_key_info(key_defaults, key_buf);
+ spk_set_key_info(spk_key_defaults, spk_key_buf);
pr_info("keymap set to default values\n");
kfree(in_buff);
spk_unlock(flags);
cp = in_buff;
cp1 = (u_char *)in_buff;
for (i = 0; i < 3; i++) {
- cp = s2uchar(cp, cp1);
+ cp = spk_s2uchar(cp, cp1);
cp1++;
}
i = (int)cp1[-2]+1;
i *= (int)cp1[-1]+1;
i += 2; /* 0 and last map ver */
if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 ||
- i+SHIFT_TBL_SIZE+4 >= sizeof(key_buf)) {
+ i+SHIFT_TBL_SIZE+4 >= sizeof(spk_key_buf)) {
pr_warn("i %d %d %d %d\n", i,
(int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
kfree(in_buff);
return -EINVAL;
}
while (--i >= 0) {
- cp = s2uchar(cp, cp1);
+ cp = spk_s2uchar(cp, cp1);
cp1++;
if (!(*cp))
break;
pr_warn("end %d %d %d %d\n", i,
(int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
} else {
- if (set_key_info(in_buff, key_buf)) {
- set_key_info(key_defaults, key_buf);
+ if (spk_set_key_info(in_buff, spk_key_buf)) {
+ spk_set_key_info(spk_key_defaults, spk_key_buf);
ret = -EINVAL;
pr_warn("set key failed\n");
}
spk_lock(flags);
if (ch&2) {
shut = 1;
- do_flush();
+ spk_do_flush();
} else {
shut = 0;
}
if (new_synth_name[len - 1] == '\n')
len--;
new_synth_name[len] = '\0';
- strlwr(new_synth_name);
+ spk_strlwr(new_synth_name);
if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) {
pr_warn("%s already in use\n", new_synth_name);
} else if (synth_init(new_synth_name) != 0) {
bytes = min_t(size_t, len, 250);
strncpy(tmp, ptr, bytes);
tmp[bytes] = '\0';
- xlate(tmp);
+ spk_xlate(tmp);
synth_printf("%s", tmp);
ptr += bytes;
len -= bytes;
short mask;
unsigned long flags;
- p_header = var_header_by_name(attr->attr.name);
+ p_header = spk_var_header_by_name(attr->attr.name);
if (p_header == NULL) {
pr_warn("p_header is null, attr->attr.name is %s\n",
attr->attr.name);
return -EINVAL;
}
- var = get_punc_var(p_header->var_id);
+ var = spk_get_punc_var(p_header->var_id);
if (var == NULL) {
pr_warn("var is null, p_header->var_id is %i\n",
p_header->var_id);
}
spk_lock(flags);
- pb = (struct st_bits_data *) &punc_info[var->value];
+ pb = (struct st_bits_data *) &spk_punc_info[var->value];
mask = pb->mask;
for (i = 33; i < 128; i++) {
if (!(spk_chartab[i]&mask))
if (x < 1 || x > 99)
return -EINVAL;
- p_header = var_header_by_name(attr->attr.name);
+ p_header = spk_var_header_by_name(attr->attr.name);
if (p_header == NULL) {
pr_warn("p_header is null, attr->attr.name is %s\n",
attr->attr.name);
return -EINVAL;
}
- var = get_punc_var(p_header->var_id);
+ var = spk_get_punc_var(p_header->var_id);
if (var == NULL) {
pr_warn("var is null, p_header->var_id is %i\n",
p_header->var_id);
spk_lock(flags);
if (*punc_buf == 'd' || *punc_buf == 'r')
- x = set_mask_bits(0, var->value, 3);
+ x = spk_set_mask_bits(0, var->value, 3);
else
- x = set_mask_bits(punc_buf, var->value, 3);
+ x = spk_set_mask_bits(punc_buf, var->value, 3);
spk_unlock(flags);
return count;
char ch;
unsigned long flags;
- param = var_header_by_name(attr->attr.name);
+ param = spk_var_header_by_name(attr->attr.name);
if (param == NULL)
return -EINVAL;
int value;
unsigned long flags;
- param = var_header_by_name(attr->attr.name);
+ param = spk_var_header_by_name(attr->attr.name);
if (param == NULL)
return -EINVAL;
if (param->data == NULL)
return 0;
ret = 0;
- cp = xlate((char *) buf);
+ cp = spk_xlate((char *) buf);
spk_lock(flags);
switch (param->var_type) {
else
len = E_SET;
speakup_s2i(cp, &value);
- ret = set_num_var(value, param, len);
+ ret = spk_set_num_var(value, param, len);
if (ret == E_RANGE) {
var_data = param->data;
pr_warn("value for %s out of range, expect %d to %d\n",
}
cp = (char *) buf;
cp[len] = '\0';
- ret = set_string_var(buf, param, len);
+ ret = spk_set_string_var(buf, param, len);
if (ret == E_TOOLONG)
pr_warn("value too long for %s\n",
attr->attr.name);
*/
if (strcmp(attr->attr.name, "voice") == 0) {
if (synth && synth->default_pitch) {
- param = var_header_by_name("pitch");
+ param = spk_var_header_by_name("pitch");
if (param) {
- set_num_var(synth->default_pitch[value], param,
+ spk_set_num_var(synth->default_pitch[value], param,
E_NEW_DEFAULT);
- set_num_var(0, param, E_DEFAULT);
+ spk_set_num_var(0, param, E_DEFAULT);
}
}
if (synth && synth->default_vol) {
- param = var_header_by_name("vol");
+ param = spk_var_header_by_name("vol");
if (param) {
- set_num_var(synth->default_vol[value], param,
+ spk_set_num_var(synth->default_vol[value], param,
E_NEW_DEFAULT);
- set_num_var(0, param, E_DEFAULT);
+ spk_set_num_var(0, param, E_DEFAULT);
}
}
}
if (bufsize <= 1)
break;
printed = scnprintf(buf_pointer, bufsize, "%d\t%s\n",
- index, msg_get(cursor));
+ index, spk_msg_get(cursor));
buf_pointer += printed;
bufsize -= printed;
}
continue;
}
- msg_stored = msg_set(curmessage, temp, desc_length);
+ msg_stored = spk_msg_set(curmessage, temp, desc_length);
if (msg_stored < 0) {
retval = msg_stored;
if (msg_stored == -ENOMEM)
}
if (reset)
- reset_msg_group(group);
+ spk_reset_msg_group(group);
report_msg_status(reset, received, used, rejected, group->name);
return retval;
struct kobj_attribute *attr, char *buf)
{
ssize_t retval = 0;
- struct msg_group_t *group = find_msg_group(attr->attr.name);
+ struct msg_group_t *group = spk_find_msg_group(attr->attr.name);
unsigned long flags;
BUG_ON(!group);
const char *buf, size_t count)
{
ssize_t retval = 0;
- struct msg_group_t *group = find_msg_group(attr->attr.name);
+ struct msg_group_t *group = spk_find_msg_group(attr->attr.name);
BUG_ON(!group);
retval = message_store_helper(buf, count, group);
char *synth_name;
module_param_named(synth, synth_name, charp, S_IRUGO);
-module_param_named(quiet, quiet_boot, bool, S_IRUGO);
+module_param_named(quiet, spk_quiet_boot, bool, S_IRUGO);
MODULE_PARM_DESC(synth, "Synth to start if speakup is built in.");
MODULE_PARM_DESC(quiet, "Do not announce when the synthesizer is found.");
-special_func special_handler;
+special_func spk_special_handler;
-short pitch_shift, synth_flags;
+short spk_pitch_shift, synth_flags;
static char buf[256];
-int attrib_bleep, bleeps, bleep_time = 10;
-int no_intr, spell_delay;
-int key_echo, say_word_ctl;
-int say_ctrl, bell_pos;
-short punc_mask;
-int punc_level, reading_punc;
-char str_caps_start[MAXVARLEN + 1] = "\0", str_caps_stop[MAXVARLEN + 1] = "\0";
-const struct st_bits_data punc_info[] = {
+int spk_attrib_bleep, spk_bleeps, spk_bleep_time = 10;
+int spk_no_intr, spk_spell_delay;
+int spk_key_echo, spk_say_word_ctl;
+int spk_say_ctrl, spk_bell_pos;
+short spk_punc_mask;
+int spk_punc_level, spk_reading_punc;
+char spk_str_caps_start[MAXVARLEN + 1] = "\0", spk_str_caps_stop[MAXVARLEN + 1] = "\0";
+const struct st_bits_data spk_punc_info[] = {
{"none", "", 0},
{"some", "/$%&@", SOME},
{"most", "$%&#()=+*/@^<>|\\", MOST},
static char mark_cut_flag;
#define MAX_KEY 160
-u_char *our_keys[MAX_KEY], *shift_table;
-u_char key_buf[600];
-const u_char key_defaults[] = {
+u_char *spk_our_keys[MAX_KEY], *spk_shift_table;
+u_char spk_key_buf[600];
+const u_char spk_key_defaults[] = {
#include "speakupmap.h"
};
/* array of 256 char pointers (one for each character description)
* initialized to default_chars and user selectable via
* /proc/speakup/characters */
-char *characters[256];
+char *spk_characters[256];
-char *default_chars[256] = {
+char *spk_default_chars[256] = {
/*000*/ "null", "^a", "^b", "^c", "^d", "^e", "^f", "^g",
/*008*/ "^h", "^i", "^j", "^k", "^l", "^m", "^n", "^o",
/*016*/ "^p", "^q", "^r", "^s", "^t", "^u", "^v", "^w",
};
struct task_struct *speakup_task;
-struct bleep unprocessed_sound;
+struct bleep spk_unprocessed_sound;
static int spk_keydown;
static u_char spk_lastkey, spk_close_press, keymap_flags;
static u_char last_keycode, this_speakup_key;
350, 370, 392, 414, 440, 466, 491, 523, 554, 587, 619, 659
};
short freq;
- int time = bleep_time;
+ int time = spk_bleep_time;
freq = vals[val % 12];
if (val > 11)
freq *= (1 << (val / 12));
- unprocessed_sound.freq = freq;
- unprocessed_sound.jiffies = msecs_to_jiffies(time);
- unprocessed_sound.active = 1;
+ spk_unprocessed_sound.freq = freq;
+ spk_unprocessed_sound.jiffies = msecs_to_jiffies(time);
+ spk_unprocessed_sound.active = 1;
/* We can only have 1 active sound at a time. */
}
spk_parked &= 0xfe;
speakup_date(vc);
if (synth != NULL)
- do_flush();
+ spk_do_flush();
}
static void speech_kill(struct vc_data *vc)
if (val == 2 || spk_killed) {
/* dead */
spk_shut_up &= ~0x40;
- synth_printf("%s\n", msg_get(MSG_IAM_ALIVE));
+ synth_printf("%s\n", spk_msg_get(MSG_IAM_ALIVE));
} else {
- synth_printf("%s\n", msg_get(MSG_YOU_KILLED_SPEAKUP));
+ synth_printf("%s\n", spk_msg_get(MSG_YOU_KILLED_SPEAKUP));
spk_shut_up |= 0x40;
}
}
{
if (spk_shut_up & 0x80) {
spk_shut_up &= 0x7f;
- synth_printf("%s\n", msg_get(MSG_HEY_THATS_BETTER));
+ synth_printf("%s\n", spk_msg_get(MSG_HEY_THATS_BETTER));
} else {
spk_shut_up |= 0x80;
- synth_printf("%s\n", msg_get(MSG_YOU_TURNED_ME_OFF));
+ synth_printf("%s\n", spk_msg_get(MSG_YOU_TURNED_ME_OFF));
}
speakup_date(vc);
}
{
if (spk_parked & 0x80) {
spk_parked = 0;
- synth_printf("%s\n", msg_get(MSG_UNPARKED));
+ synth_printf("%s\n", spk_msg_get(MSG_UNPARKED));
} else {
spk_parked |= 0x80;
- synth_printf("%s\n", msg_get(MSG_PARKED));
+ synth_printf("%s\n", spk_msg_get(MSG_PARKED));
}
}
if (!mark_cut_flag) {
mark_cut_flag = 1;
- xs = (u_short) spk_x;
- ys = (u_short) spk_y;
+ spk_xs = (u_short) spk_x;
+ spk_ys = (u_short) spk_y;
spk_sel_cons = vc;
- synth_printf("%s\n", msg_get(MSG_MARK));
+ synth_printf("%s\n", spk_msg_get(MSG_MARK));
return;
}
- xe = (u_short) spk_x;
- ye = (u_short) spk_y;
+ spk_xe = (u_short) spk_x;
+ spk_ye = (u_short) spk_y;
mark_cut_flag = 0;
- synth_printf("%s\n", msg_get(MSG_CUT));
+ synth_printf("%s\n", spk_msg_get(MSG_CUT));
speakup_clear_selection();
ret = speakup_set_selection(tty);
{
if (mark_cut_flag) {
mark_cut_flag = 0;
- synth_printf("%s\n", msg_get(MSG_MARK_CLEARED));
+ synth_printf("%s\n", spk_msg_get(MSG_MARK_CLEARED));
} else {
- synth_printf("%s\n", msg_get(MSG_PASTE));
+ synth_printf("%s\n", spk_msg_get(MSG_PASTE));
speakup_paste_selection(tty);
}
}
int fg = spk_attr & 0x0f;
int bg = spk_attr >> 4;
if (fg > 8) {
- synth_printf("%s ", msg_get(MSG_BRIGHT));
+ synth_printf("%s ", spk_msg_get(MSG_BRIGHT));
fg -= 8;
}
- synth_printf("%s", msg_get(MSG_COLORS_START + fg));
+ synth_printf("%s", spk_msg_get(MSG_COLORS_START + fg));
if (bg > 7) {
- synth_printf(" %s ", msg_get(MSG_ON_BLINKING));
+ synth_printf(" %s ", spk_msg_get(MSG_ON_BLINKING));
bg -= 8;
} else
- synth_printf(" %s ", msg_get(MSG_ON));
- synth_printf("%s\n", msg_get(MSG_COLORS_START + bg));
+ synth_printf(" %s ", spk_msg_get(MSG_ON));
+ synth_printf("%s\n", spk_msg_get(MSG_COLORS_START + bg));
}
enum {
static void announce_edge(struct vc_data *vc, int msg_id)
{
- if (bleeps & 1)
+ if (spk_bleeps & 1)
bleep(spk_y);
- if ((bleeps & 2) && (msg_id < edge_quiet))
- synth_printf("%s\n", msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
+ if ((spk_bleeps & 2) && (msg_id < edge_quiet))
+ synth_printf("%s\n", spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
}
static void speak_char(u_char ch)
{
- char *cp = characters[ch];
- struct var_t *direct = get_var(DIRECT);
+ char *cp = spk_characters[ch];
+ struct var_t *direct = spk_get_var(DIRECT);
if (direct && direct->u.n.value) {
if (IS_CHAR(ch, B_CAP)) {
- pitch_shift++;
- synth_printf("%s", str_caps_start);
+ spk_pitch_shift++;
+ synth_printf("%s", spk_str_caps_start);
}
synth_printf("%c", ch);
if (IS_CHAR(ch, B_CAP))
- synth_printf("%s", str_caps_stop);
+ synth_printf("%s", spk_str_caps_stop);
return;
}
if (cp == NULL) {
}
synth_buffer_add(SPACE);
if (IS_CHAR(ch, B_CAP)) {
- pitch_shift++;
- synth_printf("%s", str_caps_start);
+ spk_pitch_shift++;
+ synth_printf("%s", spk_str_caps_start);
synth_printf("%s", cp);
- synth_printf("%s", str_caps_stop);
+ synth_printf("%s", spk_str_caps_stop);
} else {
if (*cp == '^') {
- synth_printf("%s", msg_get(MSG_CTRL));
+ synth_printf("%s", spk_msg_get(MSG_CTRL));
cp++;
}
synth_printf("%s", cp);
spk_old_attr = spk_attr;
ch = get_char(vc, (u_short *) spk_pos, &spk_attr);
if (spk_attr != spk_old_attr) {
- if (attrib_bleep & 1)
+ if (spk_attrib_bleep & 1)
bleep(spk_y);
- if (attrib_bleep & 2)
+ if (spk_attrib_bleep & 2)
say_attributes(vc);
}
speak_char(ch & 0xff);
synth_printf("%s\n", phonetic[--ch]);
} else {
if (IS_CHAR(ch, B_NUM))
- synth_printf("%s ", msg_get(MSG_NUMBER));
+ synth_printf("%s ", spk_msg_get(MSG_NUMBER));
speak_char(ch);
}
}
}
/* get_word - will first check to see if the character under the
- * reading cursor is a space and if say_word_ctl is true it will
- * return the word space. If say_word_ctl is not set it will check to
+ * reading cursor is a space and if spk_say_word_ctl is true it will
+ * return the word space. If spk_say_word_ctl is not set it will check to
* see if there is a word starting on the next position to the right
* and return that word if it exists. If it does not exist it will
* move left to the beginning of any previous word on the line or the
ch = (char)get_char(vc, (u_short *) tmp_pos, &temp);
/* decided to take out the sayword if on a space (mis-information */
- if (say_word_ctl && ch == SPACE) {
+ if (spk_say_word_ctl && ch == SPACE) {
*buf = '\0';
- synth_printf("%s\n", msg_get(MSG_SPACE));
+ synth_printf("%s\n", spk_msg_get(MSG_SPACE));
return 0;
} else if ((tmpx < vc->vc_cols - 2)
&& (ch == SPACE || ch == 0 || IS_WDLM(ch))
static void say_word(struct vc_data *vc)
{
u_long cnt = get_word(vc);
- u_short saved_punc_mask = punc_mask;
+ u_short saved_punc_mask = spk_punc_mask;
if (cnt == 0)
return;
- punc_mask = PUNC;
+ spk_punc_mask = PUNC;
buf[cnt++] = SPACE;
spkup_write(buf, cnt);
- punc_mask = saved_punc_mask;
+ spk_punc_mask = saved_punc_mask;
}
static void say_prev_word(struct vc_data *vc)
static void spell_word(struct vc_data *vc)
{
static char *delay_str[] = { "", ",", ".", ". .", ". . ." };
- char *cp = buf, *str_cap = str_caps_stop;
- char *cp1, *last_cap = str_caps_stop;
+ char *cp = buf, *str_cap = spk_str_caps_stop;
+ char *cp1, *last_cap = spk_str_caps_stop;
u_char ch;
if (!get_word(vc))
return;
while ((ch = (u_char) *cp)) {
if (cp != buf)
- synth_printf(" %s ", delay_str[spell_delay]);
+ synth_printf(" %s ", delay_str[spk_spell_delay]);
if (IS_CHAR(ch, B_CAP)) {
- str_cap = str_caps_start;
- if (*str_caps_stop)
- pitch_shift++;
+ str_cap = spk_str_caps_start;
+ if (*spk_str_caps_stop)
+ spk_pitch_shift++;
else /* synth has no pitch */
- last_cap = str_caps_stop;
+ last_cap = spk_str_caps_stop;
} else
- str_cap = str_caps_stop;
+ str_cap = spk_str_caps_stop;
if (str_cap != last_cap) {
synth_printf("%s", str_cap);
last_cap = str_cap;
ch &= 31;
cp1 = phonetic[--ch];
} else {
- cp1 = characters[ch];
+ cp1 = spk_characters[ch];
if (*cp1 == '^') {
- synth_printf("%s", msg_get(MSG_CTRL));
+ synth_printf("%s", spk_msg_get(MSG_CTRL));
cp1++;
}
}
synth_printf("%s", cp1);
cp++;
}
- if (str_cap != str_caps_stop)
- synth_printf("%s", str_caps_stop);
+ if (str_cap != spk_str_caps_stop)
+ synth_printf("%s", spk_str_caps_stop);
}
static int get_line(struct vc_data *vc)
{
int i = get_line(vc);
char *cp;
- u_short saved_punc_mask = punc_mask;
+ u_short saved_punc_mask = spk_punc_mask;
if (i == 0) {
- synth_printf("%s\n", msg_get(MSG_BLANK));
+ synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
buf[i++] = '\n';
cp++;
synth_printf("%d, ", (cp - buf) + 1);
}
- punc_mask = punc_masks[reading_punc];
+ spk_punc_mask = spk_punc_masks[spk_reading_punc];
spkup_write(buf, i);
- punc_mask = saved_punc_mask;
+ spk_punc_mask = saved_punc_mask;
}
static void say_prev_line(struct vc_data *vc)
{
int i = 0;
u_char tmp;
- u_short saved_punc_mask = punc_mask;
+ u_short saved_punc_mask = spk_punc_mask;
spk_old_attr = spk_attr;
spk_attr = get_attributes((u_short *) from);
while (from < to) {
if (i < 1)
return i;
if (read_punc)
- punc_mask = punc_info[reading_punc].mask;
+ spk_punc_mask = spk_punc_info[spk_reading_punc].mask;
spkup_write(buf, i);
if (read_punc)
- punc_mask = saved_punc_mask;
+ spk_punc_mask = saved_punc_mask;
return i - 1;
}
start += from * 2;
if (say_from_to(vc, start, end, read_punc) <= 0)
if (cursor_track != read_all_mode)
- synth_printf("%s\n", msg_get(MSG_BLANK));
+ synth_printf("%s\n", spk_msg_get(MSG_BLANK));
}
/* Sentence Reading Commands */
{
u_long start, end, from, to;
if (win_start < 2) {
- synth_printf("%s\n", msg_get(MSG_NO_WINDOW));
+ synth_printf("%s\n", spk_msg_get(MSG_NO_WINDOW));
return;
}
start = vc->vc_origin + (win_top * vc->vc_size_row);
u_char ch;
spk_parked |= 0x01;
if (len == 0) {
- synth_printf("%s\n", msg_get(MSG_BLANK));
+ synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
for (i = 0; i < len; i++)
u_char ch;
spk_parked |= 0x01;
if (len == 0) {
- synth_printf("%s\n", msg_get(MSG_BLANK));
+ synth_printf("%s\n", spk_msg_get(MSG_BLANK));
return;
}
ch = buf[--len];
static void say_position(struct vc_data *vc)
{
- synth_printf(msg_get(MSG_POS_INFO), spk_y + 1, spk_x + 1,
+ synth_printf(spk_msg_get(MSG_POS_INFO), spk_y + 1, spk_x + 1,
vc->vc_num + 1);
synth_printf("\n");
}
u_char tmp;
u_short ch = get_char(vc, (u_short *) spk_pos, &tmp);
ch &= 0xff;
- synth_printf(msg_get(MSG_CHAR_INFO), ch, ch);
+ synth_printf(spk_msg_get(MSG_CHAR_INFO), ch, ch);
}
/* these are stub functions to keep keyboard.c happy. */
} else {
if ((last_type & CH_RPT) && rep_count > 2) {
synth_printf(" ");
- synth_printf(msg_get(MSG_REPEAT_DESC),
+ synth_printf(spk_msg_get(MSG_REPEAT_DESC),
++rep_count);
synth_printf(" ");
}
}
if (ch == spk_lastkey) {
rep_count = 0;
- if (key_echo == 1 && ch >= MINECHOCHAR)
+ if (spk_key_echo == 1 && ch >= MINECHOCHAR)
speak_char(ch);
} else if (char_type & B_ALPHA) {
if ((synth_flags & SF_DEC) && (last_type & PUNC))
} else if (char_type & B_NUM) {
rep_count = 0;
synth_printf("%c", ch);
- } else if (char_type & punc_mask) {
+ } else if (char_type & spk_punc_mask) {
speak_char(ch);
char_type &= ~PUNC; /* for dec nospell processing */
} else if (char_type & SYNTH_OK) {
if (in_count > 2 && rep_count > 2) {
if (last_type & CH_RPT) {
synth_printf(" ");
- synth_printf(msg_get(MSG_REPEAT_DESC2), ++rep_count);
+ synth_printf(spk_msg_get(MSG_REPEAT_DESC2), ++rep_count);
synth_printf(" ");
}
rep_count = 0;
case KVAL(K_SHIFT):
del_timer(&cursor_timer);
spk_shut_up &= 0xfe;
- do_flush();
+ spk_do_flush();
read_all_doc(vc);
break;
case KVAL(K_CTRL):
del_timer(&cursor_timer);
cursor_track = prev_cursor_track;
spk_shut_up &= 0xfe;
- do_flush();
+ spk_do_flush();
break;
}
} else {
spk_shut_up &= 0xfe;
- do_flush();
+ spk_do_flush();
}
- if (say_ctrl && value < NUM_CTL_LABELS)
- synth_printf("%s", msg_get(MSG_CTL_START + value));
+ if (spk_say_ctrl && value < NUM_CTL_LABELS)
+ synth_printf("%s", spk_msg_get(MSG_CTL_START + value));
spk_unlock(flags);
}
spk_lastkey = value;
spk_keydown++;
spk_parked &= 0xfe;
- if (key_echo == 2 && value >= MINECHOCHAR)
+ if (spk_key_echo == 2 && value >= MINECHOCHAR)
speak_char(value);
spk_unlock(flags);
}
-int set_key_info(const u_char *key_info, u_char *k_buffer)
+int spk_set_key_info(const u_char *key_info, u_char *k_buffer)
{
int i = 0, states, key_data_len;
const u_char *cp = key_info;
num_keys = *cp;
states = (int)cp[1];
key_data_len = (states + 1) * (num_keys + 1);
- if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(key_buf))
+ if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf))
return -2;
memset(k_buffer, 0, SHIFT_TBL_SIZE);
- memset(our_keys, 0, sizeof(our_keys));
- shift_table = k_buffer;
- our_keys[0] = shift_table;
+ memset(spk_our_keys, 0, sizeof(spk_our_keys));
+ spk_shift_table = k_buffer;
+ spk_our_keys[0] = spk_shift_table;
cp1 += SHIFT_TBL_SIZE;
memcpy(cp1, cp, key_data_len + 3);
/* get num_keys, states and data */
ch = *cp1++;
if (ch >= SHIFT_TBL_SIZE)
return -3;
- shift_table[ch] = i;
+ spk_shift_table[ch] = i;
}
keymap_flags = *cp1++;
while ((ch = *cp1)) {
if (ch >= MAX_KEY)
return -4;
- our_keys[ch] = cp1;
+ spk_our_keys[ch] = cp1;
cp1 += states + 1;
}
return 0;
cursor_track = prev_cursor_track;
if (++cursor_track >= CT_Max)
cursor_track = 0;
- synth_printf("%s\n", msg_get(MSG_CURSOR_MSGS_START + cursor_track));
+ synth_printf("%s\n", spk_msg_get(MSG_CURSOR_MSGS_START + cursor_track));
}
-void reset_default_chars(void)
+void spk_reset_default_chars(void)
{
int i;
/* First, free any non-default */
for (i = 0; i < 256; i++) {
- if ((characters[i] != NULL)
- && (characters[i] != default_chars[i]))
- kfree(characters[i]);
+ if ((spk_characters[i] != NULL)
+ && (spk_characters[i] != spk_default_chars[i]))
+ kfree(spk_characters[i]);
}
- memcpy(characters, default_chars, sizeof(default_chars));
+ memcpy(spk_characters, spk_default_chars, sizeof(spk_default_chars));
}
-void reset_default_chartab(void)
+void spk_reset_default_chartab(void)
{
memcpy(spk_chartab, default_chartab, sizeof(default_chartab));
}
if (type != KT_LATIN || (ch_type & B_NUM) || ch < SPACE)
return -1;
if (ch == SPACE) {
- synth_printf("%s\n", msg_get(MSG_EDIT_DONE));
- special_handler = NULL;
+ synth_printf("%s\n", spk_msg_get(MSG_EDIT_DONE));
+ spk_special_handler = NULL;
return 1;
}
if (mask < PUNC && !(ch_type & PUNC))
spk_chartab[ch] ^= mask;
speak_char(ch);
synth_printf(" %s\n",
- (spk_chartab[ch] & mask) ? msg_get(MSG_ON) :
- msg_get(MSG_OFF));
+ (spk_chartab[ch] & mask) ? spk_msg_get(MSG_ON) :
+ spk_msg_get(MSG_OFF));
return 1;
}
if (cursor_track != read_all_mode)
prev_cursor_track = cursor_track;
cursor_track = read_all_mode;
- reset_index_count(0);
+ spk_reset_index_count(0);
if (get_sentence_buf(vc, 0) == -1)
kbd_fakekey2(vc, RA_DOWN_ARROW);
else {
del_timer(&cursor_timer);
cursor_track = prev_cursor_track;
spk_shut_up &= 0xfe;
- do_flush();
+ spk_do_flush();
}
static void start_read_all_timer(struct vc_data *vc, int command)
cursor_con = vc->vc_num;
read_all_key = command;
- cursor_timeout = get_var(CURSOR_TIME);
+ cursor_timeout = spk_get_var(CURSOR_TIME);
mod_timer(&cursor_timer,
jiffies + msecs_to_jiffies(cursor_timeout->u.n.value));
}
switch (command) {
case RA_NEXT_SENT:
/* Get Current Sentence */
- get_index_count(&indcount, &sentcount);
+ spk_get_index_count(&indcount, &sentcount);
/*printk("%d %d ", indcount, sentcount); */
- reset_index_count(sentcount + 1);
+ spk_reset_index_count(sentcount + 1);
if (indcount == 1) {
if (!say_sentence_num(sentcount + 1, 0)) {
kbd_fakekey2(vc, RA_FIND_NEXT_SENT);
sn = 0;
if (!say_sentence_num(sentcount + 1, 1)) {
sn = 1;
- reset_index_count(sn);
+ spk_reset_index_count(sn);
} else
synth_insert_next_index(0);
if (!say_sentence_num(sn, 0)) {
case RA_FIND_PREV_SENT:
break;
case RA_TIMER:
- get_index_count(&indcount, &sentcount);
+ spk_get_index_count(&indcount, &sentcount);
if (indcount < 2)
kbd_fakekey2(vc, RA_DOWN_ARROW);
else
}
del_timer(&cursor_timer);
spk_shut_up &= 0xfe;
- do_flush();
+ spk_do_flush();
start_read_all_timer(vc, value + 1);
spk_unlock(flags);
return NOTIFY_STOP;
return;
}
spk_shut_up &= 0xfe;
- if (no_intr)
- do_flush();
+ if (spk_no_intr)
+ spk_do_flush();
/* the key press flushes if !no_inter but we want to flush on cursor
* moves regardless of no_inter state */
is_cursor = value + 1;
cursor_con = vc->vc_num;
if (cursor_track == CT_Highlight)
reset_highlight_buffers(vc);
- cursor_timeout = get_var(CURSOR_TIME);
+ cursor_timeout = spk_get_var(CURSOR_TIME);
mod_timer(&cursor_timer,
jiffies + msecs_to_jiffies(cursor_timeout->u.n.value));
spk_unlock(flags);
if (speakup_console[vc_num]->ht.ry[hc] != vc->vc_y)
return 0;
spk_parked |= 0x01;
- do_flush();
+ spk_do_flush();
spkup_write(speakup_console[vc_num]->ht.highbuf[hc],
speakup_console[vc_num]->ht.highsize[hc]);
spk_pos = spk_cp = speakup_console[vc_num]->ht.rpos[hc];
if (!spk_trylock(flags))
/* Speakup output, discard */
return;
- if (bell_pos && spk_keydown && (vc->vc_x == bell_pos - 1))
+ if (spk_bell_pos && spk_keydown && (vc->vc_x == spk_bell_pos - 1))
bleep(3);
if ((is_cursor) || (cursor_track == read_all_mode)) {
if (cursor_track == CT_Highlight)
return;
spk_lock(flags);
spk_shut_up &= 0xfe;
- if (no_intr)
- do_flush();
+ if (spk_no_intr)
+ spk_do_flush();
switch (value) {
case KVAL(K_CAPS):
- label = msg_get(MSG_KEYNAME_CAPSLOCK);
+ label = spk_msg_get(MSG_KEYNAME_CAPSLOCK);
on_off = vt_get_leds(fg_console, VC_CAPSLOCK);
break;
case KVAL(K_NUM):
- label = msg_get(MSG_KEYNAME_NUMLOCK);
+ label = spk_msg_get(MSG_KEYNAME_NUMLOCK);
on_off = vt_get_leds(fg_console, VC_NUMLOCK);
break;
case KVAL(K_HOLD):
- label = msg_get(MSG_KEYNAME_SCROLLLOCK);
+ label = spk_msg_get(MSG_KEYNAME_SCROLLLOCK);
on_off = vt_get_leds(fg_console, VC_SCROLLOCK);
if (speakup_console[vc->vc_num])
speakup_console[vc->vc_num]->tty_stopped = on_off;
}
if (on_off < 2)
synth_printf("%s %s\n",
- label, msg_get(MSG_STATUS_START + on_off));
+ label, spk_msg_get(MSG_STATUS_START + on_off));
spk_unlock(flags);
}
int var_id = (int)value - VAR_START;
int how = (var_id & 1) ? E_INC : E_DEC;
var_id = var_id / 2 + FIRST_SET_VAR;
- p_header = get_var_header(var_id);
+ p_header = spk_get_var_header(var_id);
if (p_header == NULL)
return -1;
if (p_header->var_type != VAR_NUM)
return -1;
var_data = p_header->data;
- if (set_num_var(1, p_header, how) != 0)
+ if (spk_set_num_var(1, p_header, how) != 0)
return -1;
if (!spk_close_press) {
for (pn = p_header->name; *pn; pn++) {
{
char info[40];
if (win_start > 1) {
- synth_printf("%s\n", msg_get(MSG_WINDOW_ALREADY_SET));
+ synth_printf("%s\n", spk_msg_get(MSG_WINDOW_ALREADY_SET));
return;
}
if (spk_x < win_left || spk_y < win_top) {
- synth_printf("%s\n", msg_get(MSG_END_BEFORE_START));
+ synth_printf("%s\n", spk_msg_get(MSG_END_BEFORE_START));
return;
}
if (win_start && spk_x == win_left && spk_y == win_top) {
win_left = 0;
win_right = vc->vc_cols - 1;
win_bottom = spk_y;
- snprintf(info, sizeof(info), msg_get(MSG_WINDOW_LINE),
+ snprintf(info, sizeof(info), spk_msg_get(MSG_WINDOW_LINE),
(int)win_top + 1);
} else {
if (!win_start) {
win_bottom = spk_y;
win_right = spk_x;
}
- snprintf(info, sizeof(info), msg_get(MSG_WINDOW_BOUNDARY),
- (win_start) ? msg_get(MSG_END) : msg_get(MSG_START),
+ snprintf(info, sizeof(info), spk_msg_get(MSG_WINDOW_BOUNDARY),
+ (win_start) ? spk_msg_get(MSG_END) : spk_msg_get(MSG_START),
(int)spk_y + 1, (int)spk_x + 1);
}
synth_printf("%s\n", info);
win_top = win_bottom = 0;
win_left = win_right = 0;
win_start = 0;
- synth_printf("%s\n", msg_get(MSG_WINDOW_CLEARED));
+ synth_printf("%s\n", spk_msg_get(MSG_WINDOW_CLEARED));
}
static void speakup_win_enable(struct vc_data *vc)
{
if (win_start < 2) {
- synth_printf("%s\n", msg_get(MSG_NO_WINDOW));
+ synth_printf("%s\n", spk_msg_get(MSG_NO_WINDOW));
return;
}
win_enabled ^= 1;
if (win_enabled)
- synth_printf("%s\n", msg_get(MSG_WINDOW_SILENCED));
+ synth_printf("%s\n", spk_msg_get(MSG_WINDOW_SILENCED));
else
- synth_printf("%s\n", msg_get(MSG_WINDOW_SILENCE_DISABLED));
+ synth_printf("%s\n", spk_msg_get(MSG_WINDOW_SILENCE_DISABLED));
}
static void speakup_bits(struct vc_data *vc)
{
int val = this_speakup_key - (FIRST_EDIT_BITS - 1);
- if (special_handler != NULL || val < 1 || val > 6) {
- synth_printf("%s\n", msg_get(MSG_ERROR));
+ if (spk_special_handler != NULL || val < 1 || val > 6) {
+ synth_printf("%s\n", spk_msg_get(MSG_ERROR));
return;
}
- pb_edit = &punc_info[val];
- synth_printf(msg_get(MSG_EDIT_PROMPT), pb_edit->name);
- special_handler = edit_bits;
+ pb_edit = &spk_punc_info[val];
+ synth_printf(spk_msg_get(MSG_EDIT_PROMPT), pb_edit->name);
+ spk_special_handler = edit_bits;
}
static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key)
if (ch < 'x' || ch > 'y') {
oops:
if (!spk_killed)
- synth_printf(" %s\n", msg_get(MSG_GOTO_CANCELED));
+ synth_printf(" %s\n", spk_msg_get(MSG_GOTO_CANCELED));
goto_buf[num = 0] = '\0';
- special_handler = NULL;
+ spk_special_handler = NULL;
return 1;
}
cp = speakup_s2i(goto_buf, &go_pos);
}
goto_buf[num = 0] = '\0';
do_goto:
- special_handler = NULL;
+ spk_special_handler = NULL;
spk_parked |= 0x01;
if (goto_x) {
spk_pos -= spk_x * 2;
static void speakup_goto(struct vc_data *vc)
{
- if (special_handler != NULL) {
- synth_printf("%s\n", msg_get(MSG_ERROR));
+ if (spk_special_handler != NULL) {
+ synth_printf("%s\n", spk_msg_get(MSG_ERROR));
return;
}
- synth_printf("%s\n", msg_get(MSG_GOTO));
- special_handler = handle_goto;
+ synth_printf("%s\n", spk_msg_get(MSG_GOTO));
+ spk_special_handler = handle_goto;
return;
}
static void speakup_help(struct vc_data *vc)
{
- handle_help(vc, KT_SPKUP, SPEAKUP_HELP, 0);
+ spk_handle_help(vc, KT_SPKUP, SPEAKUP_HELP, 0);
}
static void do_nothing(struct vc_data *vc)
spk_shut_up &= 0xfe;
this_speakup_key = value;
if (value < SPKUP_MAX_FUNC && spkup_handler[value]) {
- do_flush();
+ spk_do_flush();
(*spkup_handler[value]) (vc);
} else {
if (inc_dec_var(value) < 0)
}
if (keycode >= MAX_KEY)
goto no_map;
- key_info = our_keys[keycode];
+ key_info = spk_our_keys[keycode];
if (key_info == 0)
goto no_map;
/* Check valid read all mode keys */
}
}
shift_info = (shift_state & 0x0f) + key_speakup;
- offset = shift_table[shift_info];
+ offset = spk_shift_table[shift_info];
if (offset) {
new_key = key_info[offset];
if (new_key) {
if (up_flag || spk_killed)
goto out;
spk_shut_up &= 0xfe;
- do_flush();
+ spk_do_flush();
goto out;
}
if (up_flag)
if (last_keycode == keycode &&
last_spk_jiffy + MAX_DELAY > jiffies) {
spk_close_press = 1;
- offset = shift_table[shift_info + 32];
+ offset = spk_shift_table[shift_info + 32];
/* double press? */
if (offset && key_info[offset])
new_key = key_info[offset];
}
}
no_map:
- if (type == KT_SPKUP && special_handler == NULL) {
+ if (type == KT_SPKUP && spk_special_handler == NULL) {
do_spkup(vc, new_key);
spk_close_press = 0;
ret = 1;
|| (value == KVAL(K_LEFT))
|| (value == KVAL(K_RIGHT));
if ((cursor_track != read_all_mode) || !kh)
- if (!no_intr)
- do_flush();
- if (special_handler) {
+ if (!spk_no_intr)
+ spk_do_flush();
+ if (spk_special_handler) {
if (type == KT_SPEC && value == 1) {
value = '\n';
type = KT_LATIN;
type = KT_LATIN;
else if (value == 0x7f)
value = 8; /* make del = backspace */
- ret = (*special_handler) (vc, type, value, keycode);
+ ret = (*spk_special_handler) (vc, type, value, keycode);
spk_close_press = 0;
if (ret < 0)
bleep(9);
speakup_unregister_var(i);
for (i = 0; i < 256; i++) {
- if (characters[i] != default_chars[i])
- kfree(characters[i]);
+ if (spk_characters[i] != spk_default_chars[i])
+ kfree(spk_characters[i]);
}
- free_user_msgs();
+ spk_free_user_msgs();
}
/* call by: module_init() */
struct var_t *var;
/* These first few initializations cannot fail. */
- initialize_msgs(); /* Initialize arrays for i18n. */
- reset_default_chars();
- reset_default_chartab();
- strlwr(synth_name);
+ spk_initialize_msgs(); /* Initialize arrays for i18n. */
+ spk_reset_default_chars();
+ spk_reset_default_chartab();
+ spk_strlwr(synth_name);
spk_vars[0].u.n.high = vc->vc_cols;
for (var = spk_vars; var->var_id != MAXVARS; var++)
speakup_register_var(var);
for (var = synth_time_vars;
(var->var_id >= 0) && (var->var_id < MAXVARS); var++)
speakup_register_var(var);
- for (i = 1; punc_info[i].mask != 0; i++)
- set_mask_bits(0, i, 2);
+ for (i = 1; spk_punc_info[i].mask != 0; i++)
+ spk_set_mask_bits(0, i, 2);
- set_key_info(key_defaults, key_buf);
+ spk_set_key_info(spk_key_defaults, spk_key_buf);
/* From here on out, initializations can fail. */
err = speakup_add_virtual_keyboard();
goto error_kobjects;
}
- if (quiet_boot)
+ if (spk_quiet_boot)
spk_shut_up |= 0x01;
err = speakup_kobj_init();
speakup_unregister_var(i);
for (i = 0; i < 256; i++) {
- if (characters[i] != default_chars[i])
- kfree(characters[i]);
+ if (spk_characters[i] != spk_default_chars[i])
+ kfree(spk_characters[i]);
}
- free_user_msgs();
+ spk_free_user_msgs();
out:
return err;
/* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */
#define ishardspace(c) ((c) == ' ')
-unsigned short xs, ys, xe, ye; /* our region points */
+unsigned short spk_xs, spk_ys, spk_xe, spk_ye; /* our region points */
/* Variables for selection control. */
/* must not be disallocated */
int i, ps, pe;
struct vc_data *vc = vc_cons[fg_console].d;
- xs = limit(xs, vc->vc_cols - 1);
- ys = limit(ys, vc->vc_rows - 1);
- xe = limit(xe, vc->vc_cols - 1);
- ye = limit(ye, vc->vc_rows - 1);
- ps = ys * vc->vc_size_row + (xs << 1);
- pe = ye * vc->vc_size_row + (xe << 1);
+ spk_xs = limit(spk_xs, vc->vc_cols - 1);
+ spk_ys = limit(spk_ys, vc->vc_rows - 1);
+ spk_xe = limit(spk_xe, vc->vc_cols - 1);
+ spk_ye = limit(spk_ye, vc->vc_rows - 1);
+ ps = spk_ys * vc->vc_size_row + (spk_xs << 1);
+ pe = spk_ye * vc->vc_size_row + (spk_xe << 1);
if (ps > pe) {
/* make sel_start <= sel_end */
outb(1, speakup_info.port_tts + UART_FCR); /* Turn FIFO On */
}
-void stop_serial_interrupt(void)
+void spk_stop_serial_interrupt(void)
{
if (speakup_info.port_tts == 0)
return;
free_irq(serstate->irq, (void *) synth_readbuf_handler);
}
-int wait_for_xmitr(void)
+int spk_wait_for_xmitr(void)
{
int tmout = SPK_XMITR_TIMEOUT;
if ((synth->alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) {
int spk_serial_out(const char ch)
{
- if (synth->alive && wait_for_xmitr()) {
+ if (synth->alive && spk_wait_for_xmitr()) {
outb_p(ch, speakup_info.port_tts);
return 1;
}
#define E_UNDEF -1
extern int speakup_thread(void *data);
-extern void reset_default_chars(void);
-extern void reset_default_chartab(void);
+extern void spk_reset_default_chars(void);
+extern void spk_reset_default_chartab(void);
extern void synth_start(void);
void synth_insert_next_index(int sent_num);
-void reset_index_count(int sc);
-void get_index_count(int *linecount, int *sentcount);
-extern int set_key_info(const u_char *key_info, u_char *k_buffer);
-extern char *strlwr(char *s);
+void spk_reset_index_count(int sc);
+void spk_get_index_count(int *linecount, int *sentcount);
+extern int spk_set_key_info(const u_char *key_info, u_char *k_buffer);
+extern char *spk_strlwr(char *s);
extern char *speakup_s2i(char *start, int *dest);
-extern char *s2uchar(char *start, char *dest);
-extern char *xlate(char *s);
+extern char *spk_s2uchar(char *start, char *dest);
+extern char *spk_xlate(char *s);
extern int speakup_kobj_init(void);
extern void speakup_kobj_exit(void);
-extern int chartab_get_value(char *keyword);
+extern int spk_chartab_get_value(char *keyword);
extern void speakup_register_var(struct var_t *var);
extern void speakup_unregister_var(enum var_id_t var_id);
-extern struct st_var_header *get_var_header(enum var_id_t var_id);
-extern struct st_var_header *var_header_by_name(const char *name);
-extern struct punc_var_t *get_punc_var(enum var_id_t var_id);
-extern int set_num_var(int val, struct st_var_header *var, int how);
-extern int set_string_var(const char *page, struct st_var_header *var, int len);
-extern int set_mask_bits(const char *input, const int which, const int how);
-extern special_func special_handler;
-extern int handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key);
+extern struct st_var_header *spk_get_var_header(enum var_id_t var_id);
+extern struct st_var_header *spk_var_header_by_name(const char *name);
+extern struct punc_var_t *spk_get_punc_var(enum var_id_t var_id);
+extern int spk_set_num_var(int val, struct st_var_header *var, int how);
+extern int spk_set_string_var(const char *page, struct st_var_header *var, int len);
+extern int spk_set_mask_bits(const char *input, const int which, const int how);
+extern special_func spk_special_handler;
+extern int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key);
extern int synth_init(char *name);
extern void synth_release(void);
-extern void do_flush(void);
+extern void spk_do_flush(void);
extern void speakup_start_ttys(void);
extern void synth_buffer_add(char ch);
extern void synth_buffer_clear(void);
extern int synth_supports_indexing(void);
extern struct vc_data *spk_sel_cons;
-extern unsigned short xs, ys, xe, ye; /* our region points */
+extern unsigned short spk_xs, spk_ys, spk_xe, spk_ye; /* our region points */
extern wait_queue_head_t speakup_event;
extern struct kobject *speakup_kobj;
extern struct task_struct *speakup_task;
-extern const u_char key_defaults[];
+extern const u_char spk_key_defaults[];
/* Protect speakup synthesizer list */
extern struct mutex spk_mutex;
extern struct st_spk_t *speakup_console[];
extern struct spk_synth *synth;
-extern char pitch_buff[];
-extern u_char *our_keys[];
-extern short punc_masks[];
-extern char str_caps_start[], str_caps_stop[];
-extern const struct st_bits_data punc_info[];
-extern u_char key_buf[600];
-extern char *characters[];
-extern char *default_chars[];
+extern char spk_pitch_buff[];
+extern u_char *spk_our_keys[];
+extern short spk_punc_masks[];
+extern char spk_str_caps_start[], spk_str_caps_stop[];
+extern const struct st_bits_data spk_punc_info[];
+extern u_char spk_key_buf[600];
+extern char *spk_characters[];
+extern char *spk_default_chars[];
extern u_short spk_chartab[];
-extern int no_intr, say_ctrl, say_word_ctl, punc_level;
-extern int reading_punc, attrib_bleep, bleeps;
-extern int bleep_time, bell_pos;
-extern int spell_delay, key_echo;
-extern short punc_mask;
-extern short pitch_shift, synth_flags;
-extern bool quiet_boot;
+extern int spk_no_intr, spk_say_ctrl, spk_say_word_ctl, spk_punc_level;
+extern int spk_reading_punc, spk_attrib_bleep, spk_bleeps;
+extern int spk_bleep_time, spk_bell_pos;
+extern int spk_spell_delay, spk_key_echo;
+extern short spk_punc_mask;
+extern short spk_pitch_shift, synth_flags;
+extern bool spk_quiet_boot;
extern char *synth_name;
-extern struct bleep unprocessed_sound;
+extern struct bleep spk_unprocessed_sound;
/* Prototypes from fakekey.c. */
int speakup_add_virtual_keyboard(void);
struct var_t *full_time;
struct var_t *jiffy_delta;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
- full_time = get_var(FULL);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
+ full_time = spk_get_var(FULL);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
{
int failed;
- failed = serial_synth_probe(synth);
+ failed = spk_serial_synth_probe(synth);
if (failed == 0) {
spk_synth_immediate(synth, "\033=R\r");
mdelay(100);
.startup = SYNTH_START,
.checkval = SYNTH_CHECK,
.vars = vars,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = do_catch_up,
int delay_time_val = 0;
int jiffy_delta_val = 0;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
- full_time = get_var(FULL);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
+ full_time = spk_get_var(FULL);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
spk_unlock(flags);
{
int failed = 0;
- failed = serial_synth_probe(synth);
+ failed = spk_serial_synth_probe(synth);
if (failed == 0)
synth_version(synth);
synth->alive = !failed;
.startup = SYNTH_START,
.checkval = SYNTH_CHECK,
.vars = vars,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = spk_do_catch_up,
.startup = SYNTH_START,
.checkval = SYNTH_CHECK,
.vars = vars,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = do_catch_up,
int jiffy_delta_val = 0;
int delay_time_val = 0;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
int jiffy_delta_val;
int delay_time_val;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
spk_unlock(flags);
.vars = vars,
.default_pitch = ap_defaults,
.default_vol = g5_defaults,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = do_catch_up,
int jiffy_delta_val;
int delay_time_val;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
spk_unlock(flags);
int jiffy_delta_val;
int delay_time_val;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
spk_unlock(flags);
.startup = SYNTH_START,
.checkval = SYNTH_CHECK,
.vars = vars,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = spk_do_catch_up,
int full_time_val;
int jiffy_delta_val;
- jiffy_delta = get_var(JIFFY);
- delay_time = get_var(DELAY);
- full_time = get_var(FULL);
+ jiffy_delta = spk_get_var(JIFFY);
+ delay_time = spk_get_var(DELAY);
+ full_time = spk_get_var(FULL);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
spk_unlock(flags);
{
int failed = 0;
- failed = serial_synth_probe(synth);
+ failed = spk_serial_synth_probe(synth);
if (failed == 0)
synth_interrogate(synth);
synth->alive = !failed;
.startup = SYNTH_START,
.checkval = SYNTH_CHECK,
.vars = vars,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = spk_do_catch_up,
.startup = SYNTH_START,
.checkval = SYNTH_CHECK,
.vars = vars,
- .probe = serial_synth_probe,
+ .probe = spk_serial_synth_probe,
.release = spk_serial_release,
.synth_immediate = spk_synth_immediate,
.catch_up = spk_do_catch_up,
#define KT_SPKUP 15
extern const struct old_serial_port *spk_serial_init(int index);
-extern void stop_serial_interrupt(void);
-extern int wait_for_xmitr(void);
+extern void spk_stop_serial_interrupt(void);
+extern int spk_wait_for_xmitr(void);
extern unsigned char spk_serial_in(void);
extern unsigned char spk_serial_in_nowait(void);
extern int spk_serial_out(const char ch);
extern char synth_buffer_getc(void);
extern char synth_buffer_peek(void);
extern int synth_buffer_empty(void);
-extern struct var_t *get_var(enum var_id_t var_id);
+extern struct var_t *spk_get_var(enum var_id_t var_id);
extern ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf);
extern ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count);
-extern int serial_synth_probe(struct spk_synth *synth);
+extern int spk_serial_synth_probe(struct spk_synth *synth);
extern const char *spk_synth_immediate(struct spk_synth *synth, const char *buff);
extern void spk_do_catch_up(struct spk_synth *synth);
extern void spk_synth_flush(struct spk_synth *synth);
#define MAXSYNTHS 16 /* Max number of synths in array. */
static struct spk_synth *synths[MAXSYNTHS];
struct spk_synth *synth;
-char pitch_buff[32] = "";
+char spk_pitch_buff[32] = "";
static int module_status;
-bool quiet_boot;
+bool spk_quiet_boot;
struct speakup_info_t speakup_info = {
.spinlock = __SPIN_LOCK_UNLOCKED(speakup_info.spinlock),
static int do_synth_init(struct spk_synth *in_synth);
-int serial_synth_probe(struct spk_synth *synth)
+int spk_serial_synth_probe(struct spk_synth *synth)
{
const struct old_serial_port *ser;
int failed = 0;
synth->alive = 1;
return 0;
}
-EXPORT_SYMBOL_GPL(serial_synth_probe);
+EXPORT_SYMBOL_GPL(spk_serial_synth_probe);
/* Main loop of the progression thread: keep eating from the buffer
* and push to the serial port, waiting as needed
int delay_time_val;
int full_time_val;
- jiffy_delta = get_var(JIFFY);
- full_time = get_var(FULL);
- delay_time = get_var(DELAY);
+ jiffy_delta = spk_get_var(JIFFY);
+ full_time = spk_get_var(FULL);
+ delay_time = spk_get_var(DELAY);
spk_lock(flags);
jiffy_delta_val = jiffy_delta->u.n.value;
while ((ch = *buff)) {
if (ch == '\n')
ch = synth->procspeech;
- if (wait_for_xmitr())
+ if (spk_wait_for_xmitr())
outb(ch, speakup_info.port_tts);
else
return buff;
{
if (synth->alive)
return 1;
- if (!synth->alive && wait_for_xmitr() > 0) {
+ if (!synth->alive && spk_wait_for_xmitr() > 0) {
/* restart */
synth->alive = 1;
synth_printf("%s", synth->init);
synth_buffer_clear();
return;
}
- trigger_time = get_var(TRIGGER);
+ trigger_time = spk_get_var(TRIGGER);
if (!timer_pending(&thread_timer))
mod_timer(&thread_timer, jiffies +
msecs_to_jiffies(trigger_time->u.n.value));
}
-void do_flush(void)
+void spk_do_flush(void)
{
speakup_info.flushing = 1;
synth_buffer_clear();
if (synth->alive) {
- if (pitch_shift) {
- synth_printf("%s", pitch_buff);
- pitch_shift = 0;
+ if (spk_pitch_shift) {
+ synth_printf("%s", spk_pitch_buff);
+ spk_pitch_shift = 0;
}
}
wake_up_interruptible_all(&speakup_event);
static int index_count;
static int sentence_count;
-void reset_index_count(int sc)
+void spk_reset_index_count(int sc)
{
static int first = 1;
if (first)
}
}
-void get_index_count(int *linecount, int *sentcount)
+void spk_get_index_count(int *linecount, int *sentcount)
{
int ind = synth->get_index();
if (ind) {
for (var = synth->vars;
(var->var_id >= 0) && (var->var_id < MAXVARS); var++)
speakup_register_var(var);
- if (!quiet_boot)
+ if (!spk_quiet_boot)
synth_printf("%s found\n", synth->long_name);
if (synth->attributes.name
&& sysfs_create_group(speakup_kobj, &(synth->attributes)) < 0)
sysfs_remove_group(speakup_kobj, &(synth->attributes));
for (var = synth->vars; var->var_id != MAXVARS; var++)
speakup_unregister_var(var->var_id);
- stop_serial_interrupt();
+ spk_stop_serial_interrupt();
synth->release();
synth = NULL;
}
}
EXPORT_SYMBOL_GPL(synth_remove);
-short punc_masks[] = { 0, SOME, MOST, PUNC, PUNC|B_SYM };
+short spk_punc_masks[] = { 0, SOME, MOST, PUNC, PUNC|B_SYM };
DEFINE_WAIT(wait);
while (1) {
spk_lock(flags);
- our_sound = unprocessed_sound;
- unprocessed_sound.active = 0;
+ our_sound = spk_unprocessed_sound;
+ spk_unprocessed_sound.active = 0;
prepare_to_wait(&speakup_event, &wait,
TASK_INTERRUPTIBLE);
should_break = kthread_should_stop() ||
{ "ex_num", EXNUMBER, VAR_PROC, NULL, NULL },
{ "characters", CHARS, VAR_PROC, NULL, NULL },
{ "synth_direct", SYNTH_DIRECT, VAR_PROC, NULL, NULL },
- { "caps_start", CAPS_START, VAR_STRING, str_caps_start, NULL },
- { "caps_stop", CAPS_STOP, VAR_STRING, str_caps_stop, NULL },
+ { "caps_start", CAPS_START, VAR_STRING, spk_str_caps_start, NULL },
+ { "caps_stop", CAPS_STOP, VAR_STRING, spk_str_caps_stop, NULL },
{ "delay_time", DELAY, VAR_TIME, NULL, NULL },
{ "trigger_time", TRIGGER, VAR_TIME, NULL, NULL },
{ "jiffy_delta", JIFFY, VAR_TIME, NULL, NULL },
{ "full_time", FULL, VAR_TIME, NULL, NULL },
- { "spell_delay", SPELL_DELAY, VAR_NUM, &spell_delay, NULL },
- { "bleeps", BLEEPS, VAR_NUM, &bleeps, NULL },
- { "attrib_bleep", ATTRIB_BLEEP, VAR_NUM, &attrib_bleep, NULL },
- { "bleep_time", BLEEP_TIME, VAR_TIME, &bleep_time, NULL },
+ { "spell_delay", SPELL_DELAY, VAR_NUM, &spk_spell_delay, NULL },
+ { "bleeps", BLEEPS, VAR_NUM, &spk_bleeps, NULL },
+ { "attrib_bleep", ATTRIB_BLEEP, VAR_NUM, &spk_attrib_bleep, NULL },
+ { "bleep_time", BLEEP_TIME, VAR_TIME, &spk_bleep_time, NULL },
{ "cursor_time", CURSOR_TIME, VAR_TIME, NULL, NULL },
- { "punc_level", PUNC_LEVEL, VAR_NUM, &punc_level, NULL },
- { "reading_punc", READING_PUNC, VAR_NUM, &reading_punc, NULL },
- { "say_control", SAY_CONTROL, VAR_NUM, &say_ctrl, NULL },
- { "say_word_ctl", SAY_WORD_CTL, VAR_NUM, &say_word_ctl, NULL },
- { "no_interrupt", NO_INTERRUPT, VAR_NUM, &no_intr, NULL },
- { "key_echo", KEY_ECHO, VAR_NUM, &key_echo, NULL },
- { "bell_pos", BELL_POS, VAR_NUM, &bell_pos, NULL },
+ { "punc_level", PUNC_LEVEL, VAR_NUM, &spk_punc_level, NULL },
+ { "reading_punc", READING_PUNC, VAR_NUM, &spk_reading_punc, NULL },
+ { "say_control", SAY_CONTROL, VAR_NUM, &spk_say_ctrl, NULL },
+ { "say_word_ctl", SAY_WORD_CTL, VAR_NUM, &spk_say_word_ctl, NULL },
+ { "no_interrupt", NO_INTERRUPT, VAR_NUM, &spk_no_intr, NULL },
+ { "key_echo", KEY_ECHO, VAR_NUM, &spk_key_echo, NULL },
+ { "bell_pos", BELL_POS, VAR_NUM, &spk_bell_pos, NULL },
{ "rate", RATE, VAR_NUM, NULL, NULL },
{ "pitch", PITCH, VAR_NUM, NULL, NULL },
{ "vol", VOL, VAR_NUM, NULL, NULL },
{ -1, -1 },
};
-int chartab_get_value(char *keyword)
+int spk_chartab_get_value(char *keyword)
{
int value = 0;
p_header->data = var;
switch (p_header->var_type) {
case VAR_STRING:
- set_string_var(nothing, p_header, 0);
+ spk_set_string_var(nothing, p_header, 0);
break;
case VAR_NUM:
case VAR_TIME:
- set_num_var(0, p_header, E_DEFAULT);
+ spk_set_num_var(0, p_header, E_DEFAULT);
break;
default:
break;
p_header->data = NULL;
}
-struct st_var_header *get_var_header(enum var_id_t var_id)
+struct st_var_header *spk_get_var_header(enum var_id_t var_id)
{
struct st_var_header *p_header;
if (var_id < 0 || var_id >= MAXVARS)
return p_header;
}
-struct st_var_header *var_header_by_name(const char *name)
+struct st_var_header *spk_var_header_by_name(const char *name)
{
int i;
struct st_var_header *where = NULL;
return where;
}
-struct var_t *get_var(enum var_id_t var_id)
+struct var_t *spk_get_var(enum var_id_t var_id)
{
BUG_ON(var_id < 0 || var_id >= MAXVARS);
BUG_ON(!var_ptrs[var_id]);
return var_ptrs[var_id]->data;
}
-EXPORT_SYMBOL_GPL(get_var);
+EXPORT_SYMBOL_GPL(spk_get_var);
-struct punc_var_t *get_punc_var(enum var_id_t var_id)
+struct punc_var_t *spk_get_punc_var(enum var_id_t var_id)
{
struct punc_var_t *rv = NULL;
struct punc_var_t *where;
}
/* handlers for setting vars */
-int set_num_var(int input, struct st_var_header *var, int how)
+int spk_set_num_var(int input, struct st_var_header *var, int how)
{
int val;
short ret = 0;
if (p_val != NULL)
*p_val = val;
if (var->var_id == PUNC_LEVEL) {
- punc_mask = punc_masks[val];
+ spk_punc_mask = spk_punc_masks[val];
return ret;
}
if (var_data->u.n.multiplier != 0)
if (!var_data->u.n.synth_fmt)
return ret;
if (var->var_id == PITCH)
- cp = pitch_buff;
+ cp = spk_pitch_buff;
else
cp = buf;
if (!var_data->u.n.out_str)
return ret;
}
-int set_string_var(const char *page, struct st_var_header *var, int len)
+int spk_set_string_var(const char *page, struct st_var_header *var, int len)
{
int ret = 0;
struct var_t *var_data = var->data;
return ret;
}
-/* set_mask_bits sets or clears the punc/delim/repeat bits,
+/* spk_set_mask_bits sets or clears the punc/delim/repeat bits,
* if input is null uses the defaults.
* values for how: 0 clears bits of chars supplied,
* 1 clears allk, 2 sets bits for chars */
-int set_mask_bits(const char *input, const int which, const int how)
+int spk_set_mask_bits(const char *input, const int which, const int how)
{
u_char *cp;
- short mask = punc_info[which].mask;
+ short mask = spk_punc_info[which].mask;
if (how&1) {
- for (cp = (u_char *)punc_info[3].value; *cp; cp++)
+ for (cp = (u_char *)spk_punc_info[3].value; *cp; cp++)
spk_chartab[*cp] &= ~mask;
}
cp = (u_char *)input;
if (cp == 0)
- cp = punc_info[which].value;
+ cp = spk_punc_info[which].value;
else {
for ( ; *cp; cp++) {
if (*cp < SPACE)
return 0;
}
-char *strlwr(char *s)
+char *spk_strlwr(char *s)
{
char *p;
if (s == NULL)
return start;
}
-char *s2uchar(char *start, char *dest)
+char *spk_s2uchar(char *start, char *dest)
{
int val = 0;
while (*start && *start <= SPACE)
return start;
}
-char *xlate(char *s)
+char *spk_xlate(char *s)
{
static const char finds[] = "nrtvafe";
static const char subs[] = "\n\r\t\013\001\014\033";