Sync OpenBSD patchset 438:

Split the server code handling clients, jobs and windows off into separate
files from server.c (merging server-msg.c into the client file) and rather than
iterating over each set after poll(), allow a callback to be specified when the
fd is added and just walk once over the returned pollfds calling each callback
where needed.

More to come, getting this in so it is tested.
This commit is contained in:
Tiago Cunha
2009-10-23 17:49:47 +00:00
parent 9ad2347258
commit cc9ef11985
7 changed files with 1209 additions and 1167 deletions

19
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.483 2009-10-23 17:32:26 tcunha Exp $ */
/* $Id: tmux.h,v 1.484 2009-10-23 17:49:47 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -1515,8 +1515,19 @@ extern struct clients clients;
extern struct clients dead_clients;
int server_start(char *);
/* server-msg.c */
int server_msg_dispatch(struct client *);
/* server-client.c */
void server_client_create(int);
void server_client_lost(struct client *);
void server_client_callback(int, int, void *);
void server_client_loop(void);
/* server-job.c */
void server_job_callback(int, int, void *);
void server_job_loop(void);
/* server-window.c */
void server_window_callback(int, int, void *);
void server_window_loop(void);
/* server-fn.c */
void server_fill_environ(struct session *, struct environ *);
@ -1848,7 +1859,7 @@ void buffer_write8(struct buffer *, uint8_t);
uint8_t buffer_read8(struct buffer *);
/* buffer-poll.c */
int buffer_poll(struct pollfd *, struct buffer *, struct buffer *);
int buffer_poll(int, int, struct buffer *, struct buffer *);
/* log.c */
void log_open_tty(int);