Naming of statics

This commit is contained in:
James Booth
2012-02-12 22:09:07 +00:00
parent b71f61d400
commit 7aa1d931a0
6 changed files with 164 additions and 150 deletions

View File

@@ -4,12 +4,12 @@
#include "jabber.h"
#include "windows.h"
static int cmd_quit(void);
static int cmd_help(void);
static int cmd_who(void);
static int cmd_msg(char *cmd);
static int cmd_close(char *cmd);
static int cmd_default(char *cmd);
static int _cmd_quit(void);
static int _cmd_help(void);
static int _cmd_who(void);
static int _cmd_msg(char *cmd);
static int _cmd_close(char *cmd);
static int _cmd_default(char *cmd);
int handle_start_command(char *cmd)
{
@@ -18,7 +18,7 @@ int handle_start_command(char *cmd)
if (strcmp(cmd, "/quit") == 0) {
result = QUIT_PROF;
} else if (strncmp(cmd, "/help", 5) == 0) {
cons_help();
win_cons_help();
result = AWAIT_COMMAND;
} else if (strncmp(cmd, "/connect ", 9) == 0) {
char *user;
@@ -32,7 +32,7 @@ int handle_start_command(char *cmd)
jabber_connect(user, passwd);
result = START_MAIN;
} else {
cons_bad_command(cmd);
win_cons_bad_command(cmd);
result = AWAIT_COMMAND;
}
@@ -45,17 +45,17 @@ int handle_command(char *cmd)
{
int result = FALSE;
if (strcmp(cmd, "/quit") == 0) {
result = cmd_quit();
result = _cmd_quit();
} else if (strncmp(cmd, "/help", 5) == 0) {
result = cmd_help();
result = _cmd_help();
} else if (strncmp(cmd, "/who", 4) == 0) {
result = cmd_who();
result = _cmd_who();
} else if (strncmp(cmd, "/msg ", 5) == 0) {
result = cmd_msg(cmd);
result = _cmd_msg(cmd);
} else if (strncmp(cmd, "/close", 6) == 0) {
result = cmd_close(cmd);
result = _cmd_close(cmd);
} else {
result = cmd_default(cmd);
result = _cmd_default(cmd);
}
inp_clear();
@@ -64,26 +64,26 @@ int handle_command(char *cmd)
}
static int cmd_quit(void)
static int _cmd_quit(void)
{
return FALSE;
}
static int cmd_help(void)
static int _cmd_help(void)
{
cons_help();
win_cons_help();
return TRUE;
}
static int cmd_who(void)
static int _cmd_who(void)
{
jabber_roster_request();
return TRUE;
}
static int cmd_msg(char *cmd)
static int _cmd_msg(char *cmd)
{
char *usr_msg = NULL;
char *usr = NULL;
@@ -95,33 +95,33 @@ static int cmd_msg(char *cmd)
msg = strndup(cmd+5+strlen(usr)+1, strlen(cmd)-(5+strlen(usr)+1));
if (msg != NULL) {
jabber_send(msg, usr);
show_outgoing_msg("me", usr, msg);
win_show_outgoing_msg("me", usr, msg);
}
}
return TRUE;
}
static int cmd_close(char *cmd)
static int _cmd_close(char *cmd)
{
if (in_chat()) {
close_win();
if (win_in_chat()) {
win_close_win();
} else {
cons_bad_command(cmd);
win_cons_bad_command(cmd);
}
return TRUE;
}
static int cmd_default(char *cmd)
static int _cmd_default(char *cmd)
{
if (in_chat()) {
if (win_in_chat()) {
char recipient[100] = "";
get_recipient(recipient);
win_get_recipient(recipient);
jabber_send(cmd, recipient);
show_outgoing_msg("me", recipient, cmd);
win_show_outgoing_msg("me", recipient, cmd);
} else {
cons_bad_command(cmd);
win_cons_bad_command(cmd);
}
return TRUE;