head 1.8; access; symbols RELENG_4_0_0_RELEASE:1.6 RELENG_4:1.6.0.2 RELENG_4_BP:1.6 RELENG_3_4_0_RELEASE:1.2.10.3 RELENG_3_3_0_RELEASE:1.2.10.3 RELENG_3_2_PAO:1.2.0.12 RELENG_3_2_PAO_BP:1.2 RELENG_3_2_0_RELEASE:1.2 RELENG_3_1_0_RELEASE:1.2 RELENG_3:1.2.0.10 RELENG_3_BP:1.2 RELENG_2_2_8_RELEASE:1.2 RELENG_3_0_0_RELEASE:1.2 RELENG_2_2_7_RELEASE:1.2 RELENG_2_2_6_RELEASE:1.2 RELENG_2_2_5_RELEASE:1.2 bsd_44_lite_2:1.1.1.1 RELENG_2_2_2_RELEASE:1.2 RELENG_2_2_1_RELEASE:1.2 RELENG_2_2_0_RELEASE:1.2 RELENG_2_1_7_RELEASE:1.2 RELENG_2_1_6_1_RELEASE:1.2 RELENG_2_1_6_RELEASE:1.2 RELENG_2_2:1.2.0.8 RELENG_2_2_BP:1.2 RELENG_2_1_5_RELEASE:1.2 RELENG_2_1_0_RELEASE:1.2 RELENG_2_1_0:1.2.0.6 RELENG_2_1_0_BP:1.2 RELENG_2_0_5_RELEASE:1.2 RELENG_2_0_5:1.2.0.4 RELENG_2_0_5_BP:1.2 RELENG_2_0_5_ALPHA:1.2 RELEASE_2_0:1.2 BETA_2_0:1.2 ALPHA_2_0:1.2.0.2 bsd_44_lite:1.1.1.1 CSRG:1.1.1; locks; comment @ * @; 1.8 date 2000.05.22.23.34.52; author tim; state Exp; branches; next 1.7; 1.7 date 2000.05.14.03.30.58; author hoek; state Exp; branches; next 1.6; 1.6 date 99.09.03.22.31.15; author hoek; state Exp; branches; next 1.5; 1.5 date 99.08.28.01.04.16; author peter; state Exp; branches; next 1.4; 1.4 date 99.06.01.20.02.33; author hoek; state Exp; branches; next 1.3; 1.3 date 99.05.30.18.06.55; author hoek; state Exp; branches; next 1.2; 1.2 date 94.09.22.01.19.07; author ache; state Exp; branches 1.2.10.1; next 1.1; 1.1 date 94.05.27.12.30.45; author rgrimes; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 94.05.27.12.30.46; author rgrimes; state Exp; branches; next ; 1.2.10.1 date 99.07.28.06.09.50; author hoek; state Exp; branches; next 1.2.10.2; 1.2.10.2 date 99.07.28.06.17.11; author hoek; state Exp; branches; next 1.2.10.3; 1.2.10.3 date 99.08.29.15.31.15; author peter; state Exp; branches; next ; desc @@ 1.8 log @Add E_SYSTEM error. @ text @/* * Copyright (c) 1988 Mark Nudleman * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)less.h 8.1 (Berkeley) 6/6/93 * * $FreeBSD: src/usr.bin/more/less.h,v 1.7 2000/05/14 03:30:58 hoek Exp $ */ #define MAXVARLENGTH (20) #define NULL_POSITION ((off_t)(-1)) #define EOI (0) #define READ_INTR (-2) /* Special chars used to tell put_line() to do something special */ #define UL_CHAR '\201' /* Enter underline mode */ #define UE_CHAR '\202' /* Exit underline mode */ #define BO_CHAR '\203' /* Enter boldface mode */ #define BE_CHAR '\204' /* Exit boldface mode */ #define CONTROL_CHAR(c) (!isprint(c)) #define CARAT_CHAR(c) ((c == '\177') ? '?' : (c | 0100)) #define TOP (0) #define TOP_PLUS_ONE (1) #define BOTTOM (-1) #define BOTTOM_PLUS_ONE (-2) #define MIDDLE (-3) /* The return type of runmacro() */ enum runmacro { OK=0, TOOMACRO, BADMACRO, NOMACRO, BADCOMMAND }; #define NOFLAGS 0 #define FORCE_OPEN 0 /* edit() flag */ #define NO_FORCE_OPEN 1 /* edit() flag */ #ifdef DEFINEGLOBALS #define GLOBAL(var, val) var = val #else #define GLOBAL(var, val) extern var #endif /* * This style of error-reporting (see also command.c) is only used by some * code. Eventually most of the code should use it, since it is becoming * inconvenient to have John Q. random function() calling error(). * * This style of error-reporting still leaves somewhat to be desired.... * * Note that more(1) needs to potentially work under low-memory conditions * (such as may occur when all available memory has been sucked-up by * the file buffer in ch.c). */ /* Be careful about ordering correctly!! (must match deferrinit_) */ enum error { E_OK=0, E_AMBIG, E_BADMATH, E_BADVAR, E_BOGCOM, E_CANTPARSE, E_CANTXPND, E_COMPLIM, E_EXTERN, E_NOMAC, E_MALLOC, E_NONUM, E_NOSTR, E_NOTOG, E_SYSTEM, E_NULL }; /* Listed here for reference only. Be careful about ordering correctly!! */ #define deferrinit_ { \ "", /* E_OK */ \ "ambigious macro", /* E_AMBIG */ \ "invalid arithmetic expression", /* E_BADMATH */ \ "bad variable", /* E_BADVAR */ \ "bogus command", /* E_BOGCOM */ \ "could not parse command string", /* E_CANTPARSE */ \ "could not expand macro", /* E_CANTXPND */ \ "compile time limit", /* E_COMPLIM */ \ "external dependency error", /* E_EXTERN */ \ "could not find match for macro", /* E_NOMAC */ \ "malloc() failed", /* E_MALLOC */ \ "missing numeric argument to command", /* E_NONUM */ \ "missing string argument to command", /* E_NOSTR */ \ "bad n-toggle argument to command", /* E_NOTOG */ \ "system error", /* E_SYSTEM */ \ "to the unknown error", /* E_NULL */ \ } GLOBAL(const char *deferr[], deferrinit_ ); /* * It is possible for erreur to become unsynchronized from errstr if * its users aren't careful. Access through the macros is considered * careful. */ GLOBAL(enum error erreur, NULL); GLOBAL(char *errstr, NULL); /* must point be null or free()'ble */ #define SETERR(e) do { \ erreur = (e); \ if (errstr) free(errstr); \ errstr = NULL; \ } while (0) /* SETERRSTR() also exists. It is in command.c */ /* * An emalloc() traditionally never fails, but fmalloc() may fail, hence * the non-standard name. The fmalloc() is just syntactic sugar that sets * erreur for the user. * * fmalloc(size, pointer-to-new-memory); * * Don't compile this puppy with -Wall or she'll squeel loud! */ #define FMALLOC(s,v) ((((v) = malloc(s)) ? 0 : \ ((errstr ? free(errstr), errstr=NULL : 0), erreur = E_MALLOC)), (v)) @ 1.7 log @Allow bookmarks to cross files. @ text @d36 1 a36 1 * $FreeBSD: src/usr.bin/more/less.h,v 1.6 1999/09/03 22:31:15 hoek Exp $ d89 1 a89 1 E_NOSTR, E_NOTOG, E_NULL }; d107 1 @ 1.6 log @Thorough revamp of how input commands are processed. This allows customization of user keys (documentation pending). The only key whose semantics have changed is the capital 'N' key, which now performs a repeat-search in the opposite direction (just like in vi). This commit is a little bulkier than what I had originally planned. I'm not completely happy with the direction it went, but it's definately an improvement, and the alternative is to continue becoming irrelevant compared to GNU less. (Does anyone even _use_ /usr/bin/more these days?) @ text @d36 1 a36 1 * $FreeBSD: src/usr.bin/more/less.h,v 1.5 1999/08/28 01:04:16 peter Exp $ a45 2 #define NO_HORIZ_OFF (-1) /* Wrap lines like normal */ d64 4 a73 1 d112 1 a112 1 * It is possible for erreur to become dis-synchronized from errstr if d133 1 a133 1 * Don't compile this puppy with -Wall... @ 1.5 log @$Id$ -> $FreeBSD$ @ text @d36 1 a36 1 * $FreeBSD$ d39 2 d63 71 a133 1 #define A_INVALID -1 d135 2 a136 32 #define A_AGAIN_SEARCH 1 #define A_B_LINE 2 #define A_B_SCREEN 3 #define A_B_SCROLL 4 #define A_B_SEARCH 5 #define A_DIGIT 6 #define A_EXAMINE 7 #define A_FREPAINT 8 #define A_F_LINE 9 #define A_F_SCREEN 10 #define A_F_SCROLL 11 #define A_F_SEARCH 12 #define A_GOEND 13 #define A_GOLINE 14 #define A_GOMARK 15 #define A_HELP 16 #define A_NEXT_FILE 17 #define A_PERCENT 18 #define A_PREFIX 19 #define A_PREV_FILE 20 #define A_QUIT 21 #define A_REPAINT 22 #define A_SETMARK 23 #define A_STAT 24 #define A_VISUAL 25 #define A_TAGFILE 26 #define A_FILE_LIST 27 #define A_L_COL 28 #define A_R_COL 29 #define A_HOME 30 #define A_NEXTTAG 31 #define A_PREVTAG 32 @ 1.4 log @Grok gtags too. @ text @d36 1 a36 1 * $Id: less.h,v 1.3 1999/05/30 18:06:55 hoek Exp $ @ 1.3 log @General code cleanup [incomplete]. Make the arrow keys work. @ text @d36 1 a36 1 * $Id$ d93 2 @ 1.2 log @1) Make ctype-aware expect chars in range 0200-0204 treated as controls in any case. 2) Fix bug with incorrect column position when standouts occurse 3) Fix bug when last standouted char cause clearing next line in standout @ text @d35 2 a38 2 #define RECOMP d44 2 d90 3 @ 1.2.10.1 log @commit-notes @ text @a34 2 * * $Id: less.h,v 1.4 1999/06/01 20:02:33 hoek Exp $ d37 2 a43 2 #define NO_HORIZ_OFF (-1) /* Wrap lines like normal */ a87 5 #define A_L_COL 28 #define A_R_COL 29 #define A_HOME 30 #define A_NEXTTAG 31 #define A_PREVTAG 32 @ 1.2.10.2 log @[Whoops... used ci -m instead of -F on the last commit...] MFC: misc incidental cleanup, gtags support, better line-number passing to $EDITOR, working arrow keys, $Id$ to manpage @ text @d36 1 a36 1 * $Id: less.h,v 1.2.10.1 1999/07/28 06:09:50 hoek Exp $ @ 1.2.10.3 log @$Id$ -> $FreeBSD$ @ text @d36 1 a36 1 * $FreeBSD$ @ 1.1 log @Initial revision @ text @d50 1 a50 1 #define CONTROL_CHAR(c) (iscntrl(c)) @ 1.1.1.1 log @BSD 4.4 Lite Usr.bin Sources @ text @@