minix/external/bsd/nvi/dist/common/cut.h
Lionel Sambuc 84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00

79 lines
2.6 KiB
C

/* $NetBSD: cut.h,v 1.3 2013/11/25 22:43:46 christos Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1991, 1993, 1994, 1995, 1996
* Keith Bostic. All rights reserved.
*
* See the LICENSE file for redistribution information.
*
* Id: cut.h,v 10.9 2000/07/22 17:31:18 skimo Exp (Berkeley) Date: 2000/07/22 17:31:18
*/
typedef struct _texth TEXTH; /* TEXT list head structure. */
TAILQ_HEAD(_texth, _text);
/* Cut buffers. */
struct _cb {
LIST_ENTRY(_cb) q; /* Linked list of cut buffers. */
TEXTH textq; /* Linked list of TEXT structures. */
/* XXXX Needed ? Can non ascii-chars be cut buffer names ? */
ARG_CHAR_T name; /* Cut buffer name. */
size_t len; /* Total length of cut text. */
#define CB_LMODE 0x01 /* Cut was in line mode. */
u_int8_t flags;
};
/* Lines/blocks of text. */
struct _text { /* Text: a linked list of lines. */
TAILQ_ENTRY(_text) q; /* Linked list of text structures. */
CHAR_T *lb; /* Line buffer. */
size_t lb_len; /* Line buffer length. */
size_t len; /* Line length. */
/* These fields are used by the vi text input routine. */
db_recno_t lno; /* 1-N: file line. */
size_t cno; /* 0-N: file character in line. */
size_t ai; /* 0-N: autoindent bytes. */
size_t insert; /* 0-N: bytes to insert (push). */
size_t offset; /* 0-N: initial, unerasable chars. */
size_t owrite; /* 0-N: chars to overwrite. */
size_t R_erase; /* 0-N: 'R' erase count. */
size_t sv_cno; /* 0-N: Saved line cursor. */
size_t sv_len; /* 0-N: Saved line length. */
/*
* These fields returns information from the vi text input routine.
*
* The termination condition. Note, this field is only valid if the
* text input routine returns success.
* TERM_BS: User backspaced over the prompt.
* TERM_CEDIT: User entered <edit-char>.
* TERM_CR: User entered <carriage-return>; no data.
* TERM_ESC: User entered <escape>; no data.
* TERM_OK: Data available.
* TERM_SEARCH: Incremental search.
*/
enum {
TERM_BS, TERM_CEDIT, TERM_CR, TERM_ESC, TERM_OK, TERM_SEARCH
} term;
};
/*
* Get named buffer 'name'.
* Translate upper-case buffer names to lower-case buffer names.
*/
#define CBNAME(sp, cbp, nch) { \
ARG_CHAR_T L__name; \
L__name = ISUPPER(nch) ? TOLOWER(nch) : (nch); \
for (cbp = sp->wp->cutq.lh_first; \
cbp != NULL; cbp = cbp->q.le_next) \
if (cbp->name == L__name) \
break; \
}
/* Flags to the cut() routine. */
#define CUT_LINEMODE 0x01 /* Cut in line mode. */
#define CUT_NUMOPT 0x02 /* Numeric buffer: optional. */
#define CUT_NUMREQ 0x04 /* Numeric buffer: required. */