f0957ccae4
This is the gsoc-2011 project to clean up and backport multibyte support from other nvi forks in a form we can use. USE_WIDECHAR is on unless building for the rescue crunchgen. This should allow editing in the native locale encoding. USE_ICONV depends on make.conf having 'WITH_ICONV=YES' for now. This adds the ability to do things like edit a KOI8-R file while having $LANG set to (say) en_US.UTF-8. iconv is used to transcode the characters for display. Other points: * It uses gencat and catopen/etc instead of homegrown msg catalog stuff. * A lot of stuff has been trimmed out, eg: the perl and tcl bindings which we could never use in base anyway. * It uses ncursesw when in widechar mode. This could be interesting. GSoC info: http://www.google-melange.com/gsoc/proposal/review/google/gsoc2011/zy/1 Repo at: https://github.com/lichray/nvi2 Obtained from: Zhihao Yuan <lichray@gmail.com>
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/*-
|
|
* Copyright (c) 1992, 1993, 1994
|
|
* The Regents of the University of California. All rights reserved.
|
|
* Copyright (c) 1992, 1993, 1994, 1995, 1996
|
|
* Keith Bostic. All rights reserved.
|
|
*
|
|
* See the LICENSE file for redistribution information.
|
|
*
|
|
* $Id: mark.h,v 10.6 2011/07/04 14:41:51 zy Exp $
|
|
*/
|
|
|
|
/*
|
|
* The MARK and LMARK structures define positions in the file. There are
|
|
* two structures because the mark subroutines are the only places where
|
|
* anything cares about something other than line and column.
|
|
*
|
|
* Because of the different interfaces used by the db(3) package, curses,
|
|
* and users, the line number is 1 based and the column number is 0 based.
|
|
* Additionally, it is known that the out-of-band line number is less than
|
|
* any legal line number. The line number is of type recno_t, as that's
|
|
* the underlying type of the database. The column number is of type size_t,
|
|
* guaranteeing that we can malloc a line.
|
|
*/
|
|
struct _mark {
|
|
#define OOBLNO 0 /* Out-of-band line number. */
|
|
recno_t lno; /* Line number. */
|
|
size_t cno; /* Column number. */
|
|
};
|
|
|
|
struct _lmark {
|
|
SLIST_ENTRY(_lmark) q; /* Linked list of marks. */
|
|
recno_t lno; /* Line number. */
|
|
size_t cno; /* Column number. */
|
|
/* XXXX Needed ? Can non ascii-chars be mark names ? */
|
|
CHAR_T name; /* Mark name. */
|
|
|
|
#define MARK_DELETED 0x01 /* Mark was deleted. */
|
|
#define MARK_USERSET 0x02 /* User set this mark. */
|
|
u_int8_t flags;
|
|
};
|
|
|
|
#define ABSMARK1 '\'' /* Absolute mark name. */
|
|
#define ABSMARK2 '`' /* Absolute mark name. */
|