xref: /titanic_52/usr/src/cmd/cmd-inet/usr.bin/talk/talk.h (revision 5c51f1241dbbdf2656d0e10011981411ed0c9673)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1998 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 /*
31  * University Copyright- Copyright (c) 1982, 1986, 1988
32  * The Regents of the University of California
33  * All Rights Reserved
34  *
35  * University Acknowledgment- Portions of this document are derived from
36  * software developed by the University of California, Berkeley, and its
37  * contributors.
38  */
39 
40 #pragma ident	"%Z%%M%	%I%	%E% SMI"
41 
42 #include <netdb.h>
43 #include <unistd.h>
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <string.h>
47 #include <curses.h>
48 #include <sys/types.h>
49 #include <widec.h>
50 #include <wctype.h>
51 #include <sys/socket.h>
52 #include <netinet/in.h>
53 #include <arpa/inet.h>
54 #include <netdb.h>
55 
56 #define	forever		for(;;)
57 
58 #define	BUF_SIZE	512
59 
60 FILE *popen();
61 
62 extern int sockt;
63 extern int curses_initialized;
64 extern int invitation_waiting;
65 
66 extern char *current_state;
67 extern int current_line;
68 
69 typedef struct xwin {
70 	WINDOW *x_win;
71 	int x_nlines;
72 	int x_ncols;
73 	int x_line;
74 	int x_col;
75 	char kill;
76 	char cerase;
77 	char werase;
78 } xwin_t;
79 
80 extern xwin_t my_win;
81 extern xwin_t rem_win;
82 extern WINDOW *line_win;
83 
84 /* function prototypes */
85 
86 void get_names(int, char * argv[]);
87 void init_display();
88 void open_ctl();
89 void open_sockt();
90 void start_msgs();
91 void end_msgs();
92 int check_local();
93 void invite_remote();
94 void set_edit_chars();
95 void talk();
96 void get_addrs(char *, char*);
97 void send_delete();
98 void ctl_transact();
99 void message(char *);
100 void p_error(char *);
101 void quit();
102 int display(xwin_t *, char *, int);
103