Skip to content

Commit

Permalink
staging: speakup: Prefix externally-visible symbols
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Thibault authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent a129be8 commit ca2beaf
Show file tree
Hide file tree
Showing 26 changed files with 384 additions and 384 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/speakup/i18n.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -576,7 +576,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;
Expand All @@ -590,7 +590,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;
Expand All @@ -606,14 +606,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;
Expand Down
12 changes: 6 additions & 6 deletions drivers/staging/speakup/i18n.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
36 changes: 18 additions & 18 deletions drivers/staging/speakup/keyhelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,20 @@ 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)
{
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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down
Loading

0 comments on commit ca2beaf

Please sign in to comment.