1 /* $NetBSD: mark.h,v 1.2 2013/11/22 15:52:05 christos Exp $ */ 2 /*- 3 * Copyright (c) 1992, 1993, 1994 4 * The Regents of the University of California. All rights reserved. 5 * Copyright (c) 1992, 1993, 1994, 1995, 1996 6 * Keith Bostic. All rights reserved. 7 * 8 * See the LICENSE file for redistribution information. 9 * 10 * Id: mark.h,v 10.5 2000/07/14 14:29:16 skimo Exp (Berkeley) Date: 2000/07/14 14:29:16 11 */ 12 13 /* 14 * The MARK and LMARK structures define positions in the file. There are 15 * two structures because the mark subroutines are the only places where 16 * anything cares about something other than line and column. 17 * 18 * Because of the different interfaces used by the db(3) package, curses, 19 * and users, the line number is 1 based and the column number is 0 based. 20 * Additionally, it is known that the out-of-band line number is less than 21 * any legal line number. The line number is of type db_recno_t, as that's 22 * the underlying type of the database. The column number is of type size_t, 23 * guaranteeing that we can malloc a line. 24 */ 25 struct _mark { 26 #define OOBLNO 0 /* Out-of-band line number. */ 27 db_recno_t lno; /* Line number. */ 28 size_t cno; /* Column number. */ 29 }; 30 31 struct _lmark { 32 LIST_ENTRY(_lmark) q; /* Linked list of marks. */ 33 db_recno_t lno; /* Line number. */ 34 size_t cno; /* Column number. */ 35 /* XXXX Needed ? Can non ascii-chars be mark names ? */ 36 CHAR_T name; /* Mark name. */ 37 38 #define MARK_DELETED 0x01 /* Mark was deleted. */ 39 #define MARK_USERSET 0x02 /* User set this mark. */ 40 u_int8_t flags; 41 }; 42 43 #define ABSMARK1 '\'' /* Absolute mark name. */ 44 #define ABSMARK2 '`' /* Absolute mark name. */ 45