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 #include <netdb.h> 41 #include <unistd.h> 42 #include <stdio.h> 43 #include <stdlib.h> 44 #include <string.h> 45 #include <curses.h> 46 #include <sys/types.h> 47 #include <widec.h> 48 #include <wctype.h> 49 #include <sys/socket.h> 50 #include <netinet/in.h> 51 #include <arpa/inet.h> 52 #include <netdb.h> 53 54 #define forever for(;;) 55 56 #define BUF_SIZE 512 57 58 FILE *popen(); 59 60 extern int sockt; 61 extern int curses_initialized; 62 extern int invitation_waiting; 63 64 extern char *current_state; 65 extern int current_line; 66 67 typedef struct xwin { 68 WINDOW *x_win; 69 int x_nlines; 70 int x_ncols; 71 int x_line; 72 int x_col; 73 char kill; 74 char cerase; 75 char werase; 76 } xwin_t; 77 78 extern xwin_t my_win; 79 extern xwin_t rem_win; 80 extern WINDOW *line_win; 81 82 /* function prototypes */ 83 84 void get_names(int, char * argv[]); 85 void init_display(); 86 void open_ctl(); 87 void open_sockt(); 88 void start_msgs(); 89 void end_msgs(); 90 int check_local(); 91 void invite_remote(); 92 void set_edit_chars(); 93 void talk(); 94 void get_addrs(char *, char*); 95 void send_delete(); 96 void ctl_transact(); 97 void message(char *); 98 void p_error(char *); 99 void quit(); 100 int display(xwin_t *, char *, int); 101