003 File Manager
Current Path:
/usr/src/contrib/nvi/vi
usr
/
src
/
contrib
/
nvi
/
vi
/
📁
..
📄
extern.h
(4.47 KB)
📄
getc.c
(4.47 KB)
📄
v_at.c
(2.63 KB)
📄
v_ch.c
(5.44 KB)
📄
v_cmd.c
(12.03 KB)
📄
v_delete.c
(2.28 KB)
📄
v_ex.c
(13.78 KB)
📄
v_increment.c
(5.4 KB)
📄
v_init.c
(2.33 KB)
📄
v_itxt.c
(12.1 KB)
📄
v_left.c
(6.25 KB)
📄
v_mark.c
(5.25 KB)
📄
v_match.c
(3.87 KB)
📄
v_paragraph.c
(7.83 KB)
📄
v_put.c
(2.81 KB)
📄
v_redraw.c
(627 B)
📄
v_replace.c
(5.32 KB)
📄
v_right.c
(3.02 KB)
📄
v_screen.c
(1.34 KB)
📄
v_scroll.c
(11.57 KB)
📄
v_search.c
(13.59 KB)
📄
v_section.c
(6.21 KB)
📄
v_sentence.c
(8.21 KB)
📄
v_status.c
(658 B)
📄
v_txt.c
(76.56 KB)
📄
v_ulcase.c
(3.38 KB)
📄
v_undo.c
(4.19 KB)
📄
v_util.c
(2.85 KB)
📄
v_word.c
(12.82 KB)
📄
v_xchar.c
(2.09 KB)
📄
v_yank.c
(2.2 KB)
📄
v_z.c
(3.38 KB)
📄
v_zexit.c
(940 B)
📄
vi.c
(29.95 KB)
📄
vi.h
(15.76 KB)
📄
vs_line.c
(14.42 KB)
📄
vs_msg.c
(21.57 KB)
📄
vs_refresh.c
(23.58 KB)
📄
vs_relative.c
(6.96 KB)
📄
vs_smap.c
(27.8 KB)
📄
vs_split.c
(21.91 KB)
Editing: v_util.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. */ #include "config.h" #include <sys/types.h> #include <sys/queue.h> #include <sys/time.h> #include <bitstring.h> #include <ctype.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "../common/common.h" #include "vi.h" /* * v_eof -- * Vi end-of-file error. * * PUBLIC: void v_eof(SCR *, MARK *); */ void v_eof(SCR *sp, MARK *mp) { recno_t lno; if (mp == NULL) v_emsg(sp, NULL, VIM_EOF); else { if (db_last(sp, &lno)) return; if (mp->lno >= lno) v_emsg(sp, NULL, VIM_EOF); else msgq(sp, M_BERR, "195|Movement past the end-of-file"); } } /* * v_eol -- * Vi end-of-line error. * * PUBLIC: void v_eol(SCR *, MARK *); */ void v_eol(SCR *sp, MARK *mp) { size_t len; if (mp == NULL) v_emsg(sp, NULL, VIM_EOL); else { if (db_get(sp, mp->lno, DBG_FATAL, NULL, &len)) return; if (mp->cno == len - 1) v_emsg(sp, NULL, VIM_EOL); else msgq(sp, M_BERR, "196|Movement past the end-of-line"); } } /* * v_nomove -- * Vi no cursor movement error. * * PUBLIC: void v_nomove(SCR *); */ void v_nomove(SCR *sp) { msgq(sp, M_BERR, "197|No cursor movement made"); } /* * v_sof -- * Vi start-of-file error. * * PUBLIC: void v_sof(SCR *, MARK *); */ void v_sof(SCR *sp, MARK *mp) { if (mp == NULL || mp->lno == 1) msgq(sp, M_BERR, "198|Already at the beginning of the file"); else msgq(sp, M_BERR, "199|Movement past the beginning of the file"); } /* * v_sol -- * Vi start-of-line error. * * PUBLIC: void v_sol(SCR *); */ void v_sol(SCR *sp) { msgq(sp, M_BERR, "200|Already in the first column"); } /* * v_isempty -- * Return if the line contains nothing but white-space characters. * * PUBLIC: int v_isempty(CHAR_T *, size_t); */ int v_isempty(CHAR_T *p, size_t len) { for (; len--; ++p) if (!isblank(*p)) return (0); return (1); } /* * v_emsg -- * Display a few common vi messages. * * PUBLIC: void v_emsg(SCR *, char *, vim_t); */ void v_emsg(SCR *sp, char *p, vim_t which) { switch (which) { case VIM_COMBUF: msgq(sp, M_ERR, "201|Buffers should be specified before the command"); break; case VIM_EMPTY: msgq(sp, M_BERR, "209|The file is empty"); break; case VIM_EOF: msgq(sp, M_BERR, "202|Already at end-of-file"); break; case VIM_EOL: msgq(sp, M_BERR, "203|Already at end-of-line"); break; case VIM_NOCOM: case VIM_NOCOM_B: msgq(sp, which == VIM_NOCOM_B ? M_BERR : M_ERR, "204|%s isn't a vi command", p); break; case VIM_WRESIZE: msgq(sp, M_ERR, "Window resize interrupted text input mode"); break; case VIM_USAGE: msgq(sp, M_ERR, "205|Usage: %s", p); break; } }
Upload File
Create Folder