Commit 3876a0de authored by Samuel Thibault's avatar Samuel Thibault Committed by Greg Kroah-Hartman

staging: speakup: Prefix externally-visible symbols

commit ca2beaf8 upstream.

This prefixes all externally-visible symbols of speakup with "spk_".
Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72cb2a7f
......@@ -390,7 +390,7 @@ static struct msg_group_t all_groups[] = {
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;
......@@ -540,7 +540,7 @@ static int fmt_validate(char *template, char *user)
* -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;
......@@ -575,7 +575,7 @@ ssize_t msg_set(enum msg_index_t index, char *text, size_t length)
* 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;
......@@ -589,7 +589,7 @@ struct msg_group_t *find_msg_group(const char *group_name)
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;
......@@ -605,14 +605,14 @@ void reset_msg_group(struct msg_group_t *group)
}
/* 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;
......
......@@ -218,11 +218,11 @@ struct msg_group_t {
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
......@@ -115,10 +115,10 @@ static void say_key(int key)
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)
......@@ -126,9 +126,9 @@ 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;
......@@ -137,7 +137,7 @@ state_tbl = our_keys[0]+SHIFT_TBL_SIZE+2;
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;
......@@ -147,15 +147,15 @@ int handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
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;
}
......@@ -169,47 +169,47 @@ int handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key)
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;
......
......@@ -41,7 +41,7 @@ static ssize_t chars_chartab_show(struct kobject *kobj,
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";
......@@ -185,12 +185,12 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
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;
......@@ -206,9 +206,9 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
if (reset) {
if (do_characters)
reset_default_chars();
spk_reset_default_chars();
else
reset_default_chartab();
spk_reset_default_chartab();
}
spk_unlock(flags);
......@@ -232,7 +232,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
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);
......@@ -271,7 +271,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
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);
......@@ -282,14 +282,14 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
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);
......@@ -297,7 +297,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
return -EINVAL;
}
while (--i >= 0) {
cp = s2uchar(cp, cp1);
cp = spk_s2uchar(cp, cp1);
cp1++;
if (!(*cp))
break;
......@@ -307,8 +307,8 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
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");
}
......@@ -343,7 +343,7 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
spk_lock(flags);
if (ch&2) {
shut = 1;
do_flush();
spk_do_flush();
} else {
shut = 0;
}
......@@ -388,7 +388,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr,
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) {
......@@ -417,7 +417,7 @@ static ssize_t synth_direct_store(struct kobject *kobj,
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;
......@@ -455,14 +455,14 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr,
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);
......@@ -470,7 +470,7 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr,
}
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))
......@@ -497,14 +497,14 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
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);
......@@ -520,9 +520,9 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
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;
......@@ -542,7 +542,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
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;
......@@ -599,13 +599,13 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
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) {
......@@ -618,7 +618,7 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
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",
......@@ -636,7 +636,7 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
}
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);
......@@ -652,19 +652,19 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
*/
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);
}
}
}
......@@ -694,7 +694,7 @@ static ssize_t message_show_helper(char *buf, enum msg_index_t first,
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;
}
......@@ -788,7 +788,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
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)
......@@ -802,7 +802,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
}
if (reset)
reset_msg_group(group);
spk_reset_msg_group(group);
report_msg_status(reset, received, used, rejected, group->name);
return retval;
......@@ -812,7 +812,7 @@ static ssize_t message_show(struct kobject *kobj,
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);
......@@ -826,7 +826,7 @@ static ssize_t message_store(struct kobject *kobj, struct kobj_attribute *attr,
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);
......
This diff is collapsed.
......@@ -10,7 +10,7 @@
/* 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 */
......@@ -51,12 +51,12 @@ int speakup_set_selection(struct tty_struct *tty)
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 */
......
......@@ -116,7 +116,7 @@ static void start_serial_interrupt(int irq)
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;
......@@ -130,7 +130,7 @@ void stop_serial_interrupt(void)
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)) {
......@@ -195,7 +195,7 @@ EXPORT_SYMBOL_GPL(spk_serial_in_nowait);
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;
}
......
......@@ -50,34 +50,34 @@
#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);
......@@ -90,35 +90,35 @@ extern void synth_write(const char *buf, size_t count);
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);
......
......@@ -182,9 +182,9 @@ static void do_catch_up(struct spk_synth *synth)
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;
......
......@@ -128,7 +128,7 @@ static int synth_probe(struct spk_synth *synth)
{
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);
......
......@@ -112,7 +112,7 @@ static struct spk_synth synth_apollo = {
.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,
......@@ -145,9 +145,9 @@ static void do_catch_up(struct spk_synth *synth)
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);
......
......@@ -162,7 +162,7 @@ static int synth_probe(struct spk_synth *synth)
{
int failed = 0;
failed = serial_synth_probe(synth);
failed = spk_serial_synth_probe(synth);
if (failed == 0)
synth_version(synth);
synth->alive = !failed;
......
......@@ -100,7 +100,7 @@ static struct spk_synth synth_bns = {
.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,
......
......@@ -130,7 +130,7 @@ static struct spk_synth synth_decext = {
.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,
......@@ -162,8 +162,8 @@ static void do_catch_up(struct spk_synth *synth)
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;
......
......@@ -375,8 +375,8 @@ static void do_catch_up(struct spk_synth *synth)
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);
......
......@@ -134,7 +134,7 @@ static struct spk_synth synth_dectlk = {
.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,
......@@ -214,8 +214,8 @@ static void do_catch_up(struct spk_synth *synth)
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);
......
......@@ -198,8 +198,8 @@ static void do_catch_up(struct spk_synth *synth)
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);
......
......@@ -102,7 +102,7 @@ static struct spk_synth synth_dummy = {
.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,
......
......@@ -184,9 +184,9 @@ static void do_catch_up(struct spk_synth *synth)
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);
......
......@@ -161,7 +161,7 @@ static int synth_probe(struct spk_synth *synth)
{
int failed = 0;
failed = serial_synth_probe(synth);
failed = spk_serial_synth_probe(synth);
if (failed == 0)
synth_interrogate(synth);
synth->alive = !failed;
......
......@@ -107,7 +107,7 @@ static struct spk_synth synth_spkout = {
.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,
......
......@@ -100,7 +100,7 @@ static struct spk_synth synth_txprt = {
.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,
......
......@@ -45,8 +45,8 @@
#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);
......@@ -55,13 +55,13 @@ extern void spk_serial_release(void);
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);
......
......@@ -20,9 +20,9 @@
#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),
......@@ -32,7 +32,7 @@ EXPORT_SYMBOL_GPL(speakup_info);
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;
......@@ -59,7 +59,7 @@ int serial_synth_probe(struct spk_synth *synth)
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
......@@ -79,9 +79,9 @@ void spk_do_catch_up(struct spk_synth *synth)
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;
......@@ -139,7 +139,7 @@ const char *spk_synth_immediate(struct spk_synth *synth, const char *buff)
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;
......@@ -166,7 +166,7 @@ int spk_synth_is_alive_restart(struct spk_synth *synth)
{
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);
......@@ -192,20 +192,20 @@ void synth_start(void)
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);
......@@ -241,7 +241,7 @@ EXPORT_SYMBOL_GPL(synth_printf);
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)
......@@ -277,7 +277,7 @@ void synth_insert_next_index(int sent_num)
}
}
void get_index_count(int *linecount, int *sentcount)
void spk_get_index_count(int *linecount, int *sentcount)
{
int ind = synth->get_index();
if (ind) {
......@@ -384,7 +384,7 @@ static int do_synth_init(struct spk_synth *in_synth)
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)
......@@ -412,7 +412,7 @@ void synth_release(void)
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;
}
......@@ -460,4 +460,4 @@ void synth_remove(struct spk_synth *in_synth)
}
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 };
......@@ -23,8 +23,8 @@ int speakup_thread(void *data)
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() ||
......
......@@ -16,24 +16,24 @@ static struct st_var_header var_headers[] = {
{ "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 },
......@@ -58,7 +58,7 @@ static struct punc_var_t punc_vars[] = {
{ -1, -1 },
};
int chartab_get_value(char *keyword)
int spk_chartab_get_value(char *keyword)
{
int value = 0;
......@@ -103,11 +103,11 @@ void speakup_register_var(struct var_t *var)
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;
......@@ -123,7 +123,7 @@ void speakup_unregister_var(enum var_id_t var_id)
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)
......@@ -134,7 +134,7 @@ struct st_var_header *get_var_header(enum var_id_t var_id)
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;
......@@ -151,15 +151,15 @@ struct st_var_header *var_header_by_name(const char *name)
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;
......@@ -175,7 +175,7 @@ struct punc_var_t *get_punc_var(enum var_id_t var_id)
}
/* 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;
......@@ -217,7 +217,7 @@ int set_num_var(int input, struct st_var_header *var, int how)
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)
......@@ -232,7 +232,7 @@ int set_num_var(int input, struct st_var_header *var, int how)
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)
......@@ -244,7 +244,7 @@ int set_num_var(int input, struct st_var_header *var, int how)
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;
......@@ -267,21 +267,21 @@ int set_string_var(const char *page, struct st_var_header *var, int len)
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)
......@@ -308,7 +308,7 @@ int set_mask_bits(const char *input, const int which, const int how)
return 0;
}
char *strlwr(char *s)
char *spk_strlwr(char *s)
{
char *p;
if (s == NULL)
......@@ -341,7 +341,7 @@ char *speakup_s2i(char *start, int *dest)
return start;
}
char *s2uchar(char *start, char *dest)
char *spk_s2uchar(char *start, char *dest)
{
int val = 0;
while (*start && *start <= SPACE)
......@@ -357,7 +357,7 @@ char *s2uchar(char *start, char *dest)
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";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment