Remove #ifndef __cplusplus around wchar related stuff in include/wchar.h
[dragonfly.git] / contrib / nvi / ip / ip.h
blobf7798c3121b4e45469b2921396c95d13c5f2dbf2
1 /*-
2 * Copyright (c) 1996
3 * Keith Bostic. All rights reserved.
5 * See the LICENSE file for redistribution information.
7 * @(#)ip.h 8.3 (Berkeley) 10/13/96
8 */
10 typedef struct _ip_private {
11 int i_fd; /* Input file descriptor. */
12 int o_fd; /* Output file descriptor. */
14 size_t row; /* Current row. */
15 size_t col; /* Current column. */
17 size_t iblen; /* Input buffer length. */
18 size_t iskip; /* Returned input buffer. */
19 char ibuf[256]; /* Input buffer. */
21 #define IP_SCR_VI_INIT 0x0001 /* Vi screen initialized. */
22 u_int32_t flags;
23 } IP_PRIVATE;
25 #define IPP(sp) ((IP_PRIVATE *)((sp)->gp->ip_private))
26 #define GIPP(gp) ((IP_PRIVATE *)((gp)->ip_private))
28 /* The screen line relative to a specific window. */
29 #define RLNO(sp, lno) (sp)->woff + (lno)
32 * The IP protocol consists of frames, each containing:
34 * <IPO_><object>
36 * XXX
37 * We should have a marking byte, 0xaa to delimit frames.
40 #define IPO_CODE 1 /* An event specification. */
41 #define IPO_INT 2 /* 4-byte, network order integer. */
42 #define IPO_STR 3 /* IPO_INT: followed by N bytes. */
44 #define IPO_CODE_LEN 1
45 #define IPO_INT_LEN 4
47 /* A structure that can hold the information for any frame. */
48 typedef struct _ip_buf {
49 int code; /* Event code. */
50 const char *str; /* String. */
51 size_t len; /* String length. */
52 u_int32_t val1; /* First value. */
53 u_int32_t val2; /* Second value. */
54 } IP_BUF;
57 * Screen/editor IP_CODE's.
59 * The program structure depends on the event loop being able to return
60 * IPO_EOF/IPOE_ERR multiple times -- eventually enough things will end
61 * due to the events that vi will reach the command level for the screen,
62 * at which point the exit flags will be set and vi will exit.
64 * IP events sent from the screen to vi.
66 #define IPO_EOF 1 /* End of input (NOT ^D). */
67 #define IPO_ERR 2 /* Input error. */
68 #define IPO_INTERRUPT 3 /* Interrupt. */
69 #define IPO_QUIT 4 /* Quit. */
70 #define IPO_RESIZE 5 /* Screen resize: IPO_INT, IPO_INT. */
71 #define IPO_SIGHUP 6 /* SIGHUP. */
72 #define IPO_SIGTERM 7 /* SIGTERM. */
73 #define IPO_STRING 8 /* Input string: IPO_STR. */
74 #define IPO_WRITE 9 /* Write. */
77 * IP events sent from vi to the screen.
79 #define IPO_ADDSTR 1 /* Add a string: IPO_STR. */
80 #define IPO_ATTRIBUTE 2 /* Set screen attribute: IPO_INT, IPO_INT. */
81 #define IPO_BELL 3 /* Beep/bell/flash the terminal. */
82 #define IPO_BUSY 4 /* Display a busy message: IPO_STR. */
83 #define IPO_CLRTOEOL 5 /* Clear to the end of the line. */
84 #define IPO_DELETELN 6 /* Delete a line. */
85 #define IPO_INSERTLN 7 /* Insert a line. */
86 #define IPO_MOVE 8 /* Move the cursor: IPO_INT, IPO_INT. */
87 #define IPO_REDRAW 9 /* Redraw the screen. */
88 #define IPO_REFRESH 10 /* Refresh the screen. */
89 #define IPO_RENAME 11 /* Rename the screen: IPO_STR. */
90 #define IPO_REWRITE 12 /* Rewrite a line: IPO_INT. */
92 #include "ip_extern.h"