chiark / gitweb /
tries to set geometry but only works for size it seems
[chiark-utils.git] / cprogs / rwbuffer.h
1 /*
2  * rwbuffer.h
3  * common declarations for readbuffer/writebuffer
4  *
5  * readbuffer and writebuffer are:
6  *  Copyright (C) 1997-1998,2000-2001 Ian Jackson <ian@chiark.greenend.org.uk>
7  *
8  * readbuffer is part of chiark backup, a system for backing up GNU/Linux and
9  * other UN*X-compatible machines, as used on chiark.greenend.org.uk.
10  * chiark backup is:
11  *  Copyright (C) 1997-1998,2000-2001 Ian Jackson <ian@chiark.greenend.org.uk>
12  *  Copyright (C) 1999 Peter Maydell <pmaydell@chiark.greenend.org.uk>
13  *
14  * This is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as
16  * published by the Free Software Foundation; either version 2,
17  * or (at your option) any later version.
18  *
19  * This is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public
25  * License along with this file; if not, write to the Free Software
26  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  *
28  */
29
30 #ifndef RWBUFFER_H
31 #define RWBUFFER_H
32
33 #include <sys/time.h>
34 #include <sys/types.h>
35 #include <unistd.h>
36 #include <fcntl.h>
37 #include <stdio.h>
38 #include <assert.h>
39 #include <ctype.h>
40 #include <stdlib.h>
41 #include <errno.h>
42 #include <time.h>
43 #include <sys/mman.h>
44 #include <sys/socket.h>
45 #include <netinet/in.h>
46 #include <arpa/inet.h>
47 #include <sys/un.h>
48 #include <netdb.h>
49
50 #include "dlist.h"
51
52
53 int min(int a, int b);
54 void callselect(void);
55 void startup(const char *const *argv);
56 void startupcore(void);
57 void *xmalloc(size_t sz);
58 void nonblock(int fd, int yesno);
59
60 extern const char *progname; /* must be defined by main .c file */
61
62 extern unsigned char *buf, *wp, *rp;
63 extern int used, seeneof, maxselfd;
64 extern size_t buffersize;
65 extern fd_set readfds;
66 extern fd_set writefds;
67
68
69 void wrbufcore_startup(void);
70 void wrbufcore_prepselect(int rdfd, int wrfd);
71 void wrbufcore_afterselect(int rdfd, int wrfd);
72 void fdsetset(int fd, fd_set *set);
73 void wrbuf_report(const char *m);
74
75
76 #endif /*RWBUFFER_H*/