xref: /netbsd-src/usr.bin/talk/talk.h (revision 68168df687839776c137f90832075bcd1dead31d)
1*68168df6Sjoerg /*	$NetBSD: talk.h,v 1.9 2011/09/06 18:32:03 joerg Exp $	*/
251207773Sjtc 
361f28255Scgd /*
451207773Sjtc  * Copyright (c) 1983, 1993
551207773Sjtc  *	The Regents of the University of California.  All rights reserved.
661f28255Scgd  *
761f28255Scgd  * Redistribution and use in source and binary forms, with or without
861f28255Scgd  * modification, are permitted provided that the following conditions
961f28255Scgd  * are met:
1061f28255Scgd  * 1. Redistributions of source code must retain the above copyright
1161f28255Scgd  *    notice, this list of conditions and the following disclaimer.
1261f28255Scgd  * 2. Redistributions in binary form must reproduce the above copyright
1361f28255Scgd  *    notice, this list of conditions and the following disclaimer in the
1461f28255Scgd  *    documentation and/or other materials provided with the distribution.
1589aaa1bbSagc  * 3. Neither the name of the University nor the names of its contributors
1661f28255Scgd  *    may be used to endorse or promote products derived from this software
1761f28255Scgd  *    without specific prior written permission.
1861f28255Scgd  *
1961f28255Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2061f28255Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2161f28255Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2261f28255Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2361f28255Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2461f28255Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2561f28255Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2661f28255Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2761f28255Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2861f28255Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2961f28255Scgd  * SUCH DAMAGE.
3061f28255Scgd  *
3151207773Sjtc  *	@(#)talk.h	8.1 (Berkeley) 6/6/93
3261f28255Scgd  */
3361f28255Scgd 
347ccd2afaSchristos #include <sys/param.h>
3532a9e65fSlukem #include <sys/types.h>
3632a9e65fSlukem #include <sys/socket.h>
3732a9e65fSlukem #include <netinet/in.h>
3832a9e65fSlukem #include <protocols/talkd.h>
3961f28255Scgd #include <curses.h>
4032a9e65fSlukem #include <string.h>
4161f28255Scgd 
4261f28255Scgd extern	int sockt;
4361f28255Scgd extern	int curses_initialized;
4461f28255Scgd extern	int invitation_waiting;
4561f28255Scgd 
46c2293a6fSlukem extern	const char *current_state;
4761f28255Scgd extern	int current_line;
4861f28255Scgd 
4961f28255Scgd typedef struct xwin {
5061f28255Scgd 	WINDOW	*x_win;
5161f28255Scgd 	int	x_nlines;
5261f28255Scgd 	int	x_ncols;
5361f28255Scgd 	int	x_line;
5461f28255Scgd 	int	x_col;
5561f28255Scgd 	char	kill;
5661f28255Scgd 	char	cerase;
5761f28255Scgd 	char	werase;
5861f28255Scgd } xwin_t;
5961f28255Scgd 
6061f28255Scgd extern	xwin_t my_win;
6161f28255Scgd extern	xwin_t his_win;
6261f28255Scgd extern	WINDOW *line_win;
6332a9e65fSlukem 
64*68168df6Sjoerg void	announce_invite(void);
65*68168df6Sjoerg int	check_local(void);
66*68168df6Sjoerg void	ctl_transact(struct in_addr, CTL_MSG, int, CTL_RESPONSE *);
67*68168df6Sjoerg void	display(xwin_t *, char *, int);
68*68168df6Sjoerg void	disp_msg(int);
69*68168df6Sjoerg void	end_msgs(void);
70*68168df6Sjoerg void	get_addrs(const char *, const char *);
71*68168df6Sjoerg void	get_names(int, char **);
72*68168df6Sjoerg void	init_display(void);
73*68168df6Sjoerg void	invite_remote(void);
74*68168df6Sjoerg int	look_for_invite(CTL_RESPONSE *);
75*68168df6Sjoerg int	max(int, int);
76*68168df6Sjoerg void	message(const char *);
77*68168df6Sjoerg void	open_ctl(void);
78*68168df6Sjoerg void	open_sockt(void);
79*68168df6Sjoerg void	print_addr(struct sockaddr_in);
80*68168df6Sjoerg void	p_error(const char *) __dead;
81*68168df6Sjoerg void	quit(void) __dead;
82*68168df6Sjoerg int	readwin(WINDOW *, int, int);
83*68168df6Sjoerg void	re_invite(int) __dead;
84*68168df6Sjoerg void	send_delete(void);
85*68168df6Sjoerg void	set_edit_chars(void);
86*68168df6Sjoerg void	sig_sent(int) __dead;
87*68168df6Sjoerg void	start_msgs(void);
88*68168df6Sjoerg void	talk(void) __dead;
89*68168df6Sjoerg void	xscroll(xwin_t *, int);
90