aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjames <>2008-03-07 14:17:01 +0000
committerjames <>2008-03-07 14:17:01 +0000
commitaff494fd2b799a5a06bdbac86e5ddfa7a20b74de (patch)
treebf2d3697795139ca335f4918b95464c2c9361cfc /apps
parent79ba927ea0d883d505f6f7aa5aed6f7fa902d19d (diff)
downloadsympathy-aff494fd2b799a5a06bdbac86e5ddfa7a20b74de.tar.gz
sympathy-aff494fd2b799a5a06bdbac86e5ddfa7a20b74de.tar.bz2
sympathy-aff494fd2b799a5a06bdbac86e5ddfa7a20b74de.zip
*** empty log message ***
Diffstat (limited to 'apps')
-rw-r--r--apps/clients.c13
-rw-r--r--apps/expand.c45
-rw-r--r--apps/sympathy.c37
3 files changed, 54 insertions, 41 deletions
diff --git a/apps/clients.c b/apps/clients.c
index b8d1a4e..d040431 100644
--- a/apps/clients.c
+++ b/apps/clients.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.22 2008/03/07 14:16:44 james
+ * *** empty log message ***
+ *
* Revision 1.21 2008/03/07 14:13:40 james
* *** empty log message ***
*
@@ -134,9 +137,9 @@ client_execute_message (Client * client, IPC_Msg * m, Context * c)
client_initialize (client, c);
break;
case IPC_MSG_TYPE_KILLME:
- client->dead++;
- break;
-
+ client->dead++;
+ break;
+
default:
log_f (c->l, "<Unhandled message type %d>", m->hdr.type);
}
@@ -237,8 +240,8 @@ clients_post_select (Clients * cs, Context * ctx, fd_set * rfds,
if (c->s->msg) {
client_execute_message (c, c->s->msg, ctx);
socket_consume_msg (c->s);
- if (c->dead)
- deaded++;
+ if (c->dead)
+ deaded++;
}
}
diff --git a/apps/expand.c b/apps/expand.c
index a0ce888..8ce384d 100644
--- a/apps/expand.c
+++ b/apps/expand.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.3 2008/03/07 14:16:44 james
+ * *** empty log message ***
+ *
* Revision 1.2 2008/03/07 14:13:40 james
* *** empty log message ***
*
@@ -100,7 +103,7 @@ hex (const char **in)
(*in)++;
while (**in) {
- printf("%c %d\n",**in,x);
+ printf ("%c %d\n", **in, x);
if (!my_isxdigit (**in))
return x;
x <<= 4;
@@ -111,7 +114,7 @@ hex (const char **in)
}
char *
-expand (const char *in,int *len)
+expand (const char *in, int *len)
{
const char *iptr = in;
int l;
@@ -123,56 +126,57 @@ expand (const char *in,int *len)
l = strlen (in);
optr = ret = malloc (l + 1);
- if (!ret) return ret;
+ if (!ret)
+ return ret;
+
-
- l=0;
+ l = 0;
while (*iptr) {
if (*iptr == '\\') {
- iptr++;
+ iptr++;
switch (*iptr) {
case '\'':
case '\"':
case '\?':
case '\\':
*(optr++) = *(iptr++);
- l++;
+ l++;
break;
case 'a':
*(optr++) = '\a';
- l++;
+ l++;
iptr++;
break;
case 'b':
*(optr++) = '\b';
- l++;
+ l++;
iptr++;
break;
case 'f':
*(optr++) = '\f';
- l++;
+ l++;
iptr++;
break;
case 'n':
*(optr++) = '\n';
- l++;
+ l++;
iptr++;
break;
case 'r':
*(optr++) = '\r';
- l++;
+ l++;
iptr++;
break;
case 't':
*(optr++) = '\t';
- l++;
+ l++;
iptr++;
break;
case 'v':
*(optr++) = '\v';
- l++;
+ l++;
iptr++;
break;
case '0':
@@ -184,25 +188,26 @@ expand (const char *in,int *len)
case '6':
case '7':
*(optr++) = octal (&iptr);
- l++;
+ l++;
break;
case 'x':
*(optr++) = hex (&iptr);
- l++;
+ l++;
break;
default:
*(optr++) = '\\';
- l++;
+ l++;
*(optr++) = *(iptr++);
- l++;
+ l++;
}
} else {
*(optr++) = *(iptr++);
- l++;
+ l++;
}
}
- if (*len) *len=l;
+ if (*len)
+ *len = l;
*(optr++) = 0;
diff --git a/apps/sympathy.c b/apps/sympathy.c
index d40caba..ef120ec 100644
--- a/apps/sympathy.c
+++ b/apps/sympathy.c
@@ -11,6 +11,9 @@ static char rcsid[] =
/*
* $Log$
+ * Revision 1.40 2008/03/07 14:16:44 james
+ * *** empty log message ***
+ *
* Revision 1.39 2008/03/07 14:13:40 james
* *** empty log message ***
*
@@ -148,7 +151,7 @@ static char rcsid[] =
#include "mainloop.h"
extern void usage (void);
-extern char * expand(const char *,int *);
+extern char *expand (const char *, int *);
static char hostname[1024];
char *socket_dirs[] =
@@ -431,18 +434,20 @@ get_hostname (void)
strcat (hostname, ".");
}
-void send_to_server(Socket *c,char *s)
+void
+send_to_server (Socket * c, char *s)
{
-int n;
+ int n;
-s=expand(s,&n);
+ s = expand (s, &n);
-if (!n) return;
+ if (!n)
+ return;
-while (n--) {
- ipc_msg_send_key (c, *(uint8_t *)s);
- s++;
-}
+ while (n--) {
+ ipc_msg_send_key (c, *(uint8_t *) s);
+ s++;
+ }
ipc_msg_send_killme (c);
}
@@ -781,11 +786,11 @@ main (int argc, char *argv[])
}
if (oflags['I']) {
- if (!client_socket)
+ if (!client_socket)
fatal_moan ("-I requires either -c or -r", oargs['k']);
- if (!oargs['I'])
+ if (!oargs['I'])
fatal_moan ("-I requires an arugment");
- send_to_server(client_socket,oargs['I']);
+ send_to_server (client_socket, oargs['I']);
} else {
if (client_socket)
@@ -806,13 +811,13 @@ main (int argc, char *argv[])
ansi->set_title (ansi, oargs['k']);
}
}
- }
+ }
- ctx->v = vt102_new (&size);
- ctx->h = history_new (history);
+ ctx->v = vt102_new (&size);
+ ctx->h = history_new (history);
- mainloop (ctx, ansi, server_socket, client_socket);
+ mainloop (ctx, ansi, server_socket, client_socket);
if (ansi) {
ansi->close (ansi);