[mw-devel] [Git][arthur/mw][master] Remove some unused functions
Andrew Price
welshbyte at sucs.org
Mon Oct 12 21:54:23 BST 2015
Andrew Price pushed to branch master at Justin Mitchell / mw
Commits:
f4874663 by Andrew Price at 2015-10-12T21:02:00Z
Remove some unused functions
- - - - -
8 changed files:
- src/client/who.c
- src/client/who.h
- src/gags.c
- src/gags.h
- src/server/servsock.c
- src/server/servsock.h
- src/str_util.c
- src/str_util.h
Changes:
=====================================
src/client/who.c
=====================================
--- a/src/client/who.c
+++ b/src/client/who.c
@@ -30,27 +30,6 @@ extern struct person *user;
extern struct room myroom;
extern long userposn;
-/* called only by cmdline flags */
-void what_list(void) {
- struct person u;
- int ufile;
- time_t t;
- char * timestr;
-
- ufile=userdb_open(O_RDONLY);
- if (ufile < 0) return; /* whoops */
-
- while (read(ufile, &u, sizeof(u))) {
- if (! u_del(u.status)) {
- t = (time_t) u.dowhen;
- timestr = ctime(&t);
- timestr[strlen(timestr) - 1] = 0; // Strip the \n
- if (u.dowhen && u.doing[0] != 0) printf("%s | %s %s (%s ago)\n", timestr, u.name, u.doing, itime(time(0)-u.dowhen));
- }
- }
- close(ufile);
-}
-
char *itime(unsigned long t)
{
static char out[7];
=====================================
src/client/who.h
=====================================
--- a/src/client/who.h
+++ b/src/client/who.h
@@ -8,7 +8,6 @@ void check_copies(int32_t where);
char *itime(unsigned long t);
void display_wholist(int type);
void update_wholist(ipc_message_t *msg);
-void what_list(void);
char *part_who_talk(const char *text, int status);
char *part_who(const char *text, int status);
json_t * grab_wholist(void);
=====================================
src/gags.c
=====================================
--- a/src/gags.c
+++ b/src/gags.c
@@ -442,12 +442,6 @@ int gag_code(const char *str)
return(0);
}
-const char *ungag_name(unsigned long chatmode)
-{
- int gnum = (chatmode & CM_GAGMASK) >> CM_GAGSHIFT;
- return gag_type(gnum);
-}
-
/***************************************************************
* the gag filters
*/
=====================================
src/gags.h
=====================================
--- a/src/gags.h
+++ b/src/gags.h
@@ -22,6 +22,5 @@ char * apply_gag(struct person *speaker, const char *text);
GagInfo *gag_find(int num);
int gag_code(const char *str);
const char *gag_type(int type);
-const char *ungag_name(unsigned long chatmode);
#endif /* GAGS_H */
=====================================
src/server/servsock.c
=====================================
--- a/src/server/servsock.c
+++ b/src/server/servsock.c
@@ -509,25 +509,6 @@ void msg_attach_to_all(ipc_message_t *msg)
close(users_fd);
}
-/* send copy to specific session/connection by PID */
-void msg_attach_to_pid(ipc_message_t *msg, uint32_t pid)
-{
- struct list_head *pos;
- list_for_each(pos, &connection_list) {
- ipc_connection_t *c = list_entry(pos, ipc_connection_t, list);
- if (c->state == IPCSTATE_VALID) {
- if (pid == 0) {
- /* broadcast */
- msg_attach(msg, c);
- } else
- if (pid == c->addr) {
- /* unicast */
- msg_attach(msg, c);
- }
- }
- }
-}
-
/* send msg to all sessions of user idetified by userid/posn */
int msg_attach_to_userid(ipc_message_t *msg, uint32_t userposn)
{
=====================================
src/server/servsock.h
=====================================
--- a/src/server/servsock.h
+++ b/src/server/servsock.h
@@ -11,7 +11,6 @@ void watch_mainsock(int mainsock);
void write_socket(ipc_connection_t *conn);
void process_msg(ipc_connection_t *conn, ipc_message_t *msg);
void msg_attach_to_all(ipc_message_t *msg);
-void msg_attach_to_pid(ipc_message_t *msg, uint32_t pid);
int msg_attach_to_userid(ipc_message_t *msg, uint32_t userposn);
int msg_attach_to_username(ipc_message_t *msg, const char *username);
void msg_attach_to_channel(ipc_message_t *msg, int channel, const char * exclude);
=====================================
src/str_util.c
=====================================
--- a/src/str_util.c
+++ b/src/str_util.c
@@ -209,7 +209,7 @@ char *strip_colours(const char *text)
}
k++;
}
-
+
continue;
}
new[j++]=text[i++];
@@ -218,18 +218,6 @@ char *strip_colours(const char *text)
return(new);
}
-/* Strip any trailing quote characters (^a) that may have been left at the end
- * * of a buffer by snprintf() truncating a quoted string.
- * */
-void strip_quote(char *a)
-{
- char *end = a + strlen(a);
-
- /* Step back through quote chars */
- while (end > a && *(--end) == '\001')
- *end = '\0';
-}
-
char *quotetext(const char *a)
{
int count;
=====================================
src/str_util.h
=====================================
--- a/src/str_util.h
+++ b/src/str_util.h
@@ -10,7 +10,6 @@ int allspace(char *in);
void strlower(char *szString);
void escprintf(const char *szFormat, ...);
char *strip_colours(const char *text);
-void strip_quote(char *a);
char *quotetext(const char *a);
#endif /* STR_UTIL_H */
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/f4874663eae0a68e4de16f277580629716ab3070
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20151012/a218cd84/attachment.html>
More information about the mw-devel
mailing list