chiark
/
gitweb
/
~ianmdlvl
/
sympathy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[sympathy.git]
/
apps
/
sympathyd.c
diff --git
a/apps/sympathyd.c
b/apps/sympathyd.c
index 820f4d9703b986d220f20773f8e8b369f649624f..2e45ed1b8d74f2c0eedbc4243608a9f0342a4693 100644
(file)
--- a/
apps/sympathyd.c
+++ b/
apps/sympathyd.c
@@
-10,6
+10,9
@@
static char rcsid[] = "$Id$";
/*
* $Log$
/*
* $Log$
+ * Revision 1.5 2008/02/13 18:05:06 james
+ * *** empty log message ***
+ *
* Revision 1.4 2008/02/13 17:21:55 james
* *** empty log message ***
*
* Revision 1.4 2008/02/13 17:21:55 james
* *** empty log message ***
*
@@
-24,16
+27,18
@@
static char rcsid[] = "$Id$";
*
*/
*
*/
-#include
"sympathy.h"
+#include
<sympathy.h>
-#include
-void main (int argc,char *argv[])
+#include "client.h"
+#include "clients.h"
+
+int main (int argc,char *argv[])
{
{
- fd_set rfd
, wfd
;
+ fd_set rfd
s, wfds
;
ANSI a = { 0 };
Context c;
Socket *s, *cs;
ANSI a = { 0 };
Context c;
Socket *s, *cs;
- Client
*
*clients;
+ Client
s
*clients;
s = socket_listen ("socket");
s = socket_listen ("socket");
@@
-55,34
+60,35
@@
void main (int argc,char *argv[])
struct timeval tv = { 0, 100000 };
struct timeval tv = { 0, 100000 };
- FD_ZERO (&rfd);
- FD_ZERO (&wfd);
+ FD_ZERO (&rfd
s
);
+ FD_ZERO (&wfd
s
);
- tty_pre_select (c.t, &rfd);
- tty_pre_select (a.terminal, &rfd);
+ tty_pre_select (c.t, &rfd
s,&wfds
);
+ tty_pre_select (a.terminal, &rfd
s,&wfds
);
- socket_pre_select (s, &rfd
, &wfd
);
+ socket_pre_select (s, &rfd
s, &wfds
);
- client
_pre_select (client
s);
+ client
s_pre_select (clients,&rfds,&wfd
s);
- select (FD_SETSIZE, &rfd, NULL, NULL, &tv);
+ select (FD_SETSIZE, &rfd
s
, NULL, NULL, &tv);
- cs = socket_post_select (s, &rfd
, &wfd
);
+ cs = socket_post_select (s, &rfd
s, &wfds
);
if (cs)
{
/*New client connexion */
if (cs)
{
/*New client connexion */
- clients_new
(clients, cs,
c);
+ clients_new
_client (clients, cs, &
c);
}
}
- clients_post_select (clients, c, &rfds, &wfds);
- if (FD_ISSET (c->t->rfd, &rfds))
+ clients_post_select (clients, &c, &rfds, &wfds);
+
+ if (FD_ISSET (c.t->rfd, &rfds))
{
char buf[1024];
int red;
{
char buf[1024];
int red;
- red = c
->t->recv (c->
t, buf, sizeof (buf));
+ red = c
.t->recv (c.
t, buf, sizeof (buf));
if (red < 0)
break;
if (red < 0)
break;
@@
-90,7
+96,7
@@
void main (int argc,char *argv[])
if (red)
{
clients_output (clients, buf, red);
if (red)
{
clients_output (clients, buf, red);
- vt102_parse (c, buf, red);
+ vt102_parse (
&
c, buf, red);
}
}
}
}