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