Imported Upstream version 20080610
Andreas Beckmann
9 years ago
6 | 6 | #ifndef MAXLOGNAME |
7 | 7 | #define MAXLOGNAME LOGIN_NAME_MAX |
8 | 8 | #endif |
9 | #define HAVE_ARC4RANDOM | |
9 | #define HAVE_ARC4RANDOM_EXT | |
10 | #define HAVE_NOSTRTONUM | |
11 | #define HAVE_NOSTRLCPY | |
12 | #define HAVE_NOSTRLCAT | |
13 | #define HAVE_NOFGETLN | |
14 | #define GNU_LS |
0 | /* $OpenBSD: file.c,v 1.64 2006/12/24 01:20:53 kjell Exp $ */ | |
0 | /* $OpenBSD: file.c,v 1.65 2008/03/21 08:01:20 pyr Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
253 | 253 | if (ro == TRUE) |
254 | 254 | curbp->b_flag |= BFREADONLY; |
255 | 255 | |
256 | if (startrow) | |
256 | if (startrow) { | |
257 | 257 | gotoline(FFARG, startrow); |
258 | startrow = 0; | |
259 | } | |
258 | 260 | |
259 | 261 | undo_add_modified(); |
260 | 262 | return (status); |
0 | /* $OpenBSD: funmap.c,v 1.27 2007/05/28 17:52:17 kjell Exp $ */ | |
1 | /* | |
2 | * Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved. | |
3 | * | |
4 | * Redistribution and use in source and binary forms, with or without | |
5 | * modification, are permitted provided that the following conditions | |
6 | * are met: | |
7 | * 1. Redistributions of source code must retain the above copyright | |
8 | * notice, this list of conditions and the following disclaimer. | |
9 | * 2. Redistributions in binary form must reproduce the above copyright | |
10 | * notice, this list of conditions and the following disclaimer in the | |
11 | * documentation and/or other materials provided with the distribution. | |
12 | * | |
13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
15 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
16 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
19 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
20 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
23 | */ | |
0 | /* $OpenBSD: funmap.c,v 1.28 2008/06/10 00:19:31 kjell Exp $ */ | |
1 | ||
2 | /* This file is in the public domain */ | |
3 | ||
24 | 4 | #include "def.h" |
25 | 5 | #include "kbd.h" |
26 | 6 | #include "funmap.h" |
0 | /* $OpenBSD: funmap.h,v 1.6 2005/11/18 20:56:52 deraadt Exp $ */ | |
1 | /* | |
2 | * Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved. | |
3 | * | |
4 | * Redistribution and use in source and binary forms, with or without | |
5 | * modification, are permitted provided that the following conditions | |
6 | * are met: | |
7 | * 1. Redistributions of source code must retain the above copyright | |
8 | * notice, this list of conditions and the following disclaimer. | |
9 | * 2. Redistributions in binary form must reproduce the above copyright | |
10 | * notice, this list of conditions and the following disclaimer in the | |
11 | * documentation and/or other materials provided with the distribution. | |
12 | * | |
13 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
15 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
16 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
17 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
18 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
19 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
20 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
21 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
22 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
23 | */ | |
0 | /* $OpenBSD: funmap.h,v 1.7 2008/06/10 00:19:31 kjell Exp $ */ | |
1 | ||
2 | /* This file is in the public domain */ | |
24 | 3 | |
25 | 4 | void funmap_init(void); |
26 | 5 | PF name_function(const char *); |
0 | /* $OpenBSD: grep.c,v 1.34 2007/05/28 17:52:17 kjell Exp $ */ | |
1 | /* | |
2 | * Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. | |
3 | * Copyright (c) 2005 Kjell Wooding <kjell@openbsd.org>. | |
4 | * All rights reserved. | |
5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | |
14 | * | |
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
25 | */ | |
0 | /* $OpenBSD: grep.c,v 1.35 2008/06/10 00:19:31 kjell Exp $ */ | |
1 | ||
2 | /* This file is in the public domain */ | |
26 | 3 | |
27 | 4 | #include "def.h" |
28 | 5 | #include "kbd.h" |
0 | /* $OpenBSD: macro.c,v 1.12 2007/03/29 17:37:15 kjell Exp $ */ | |
0 | /* $OpenBSD: macro.c,v 1.13 2008/06/10 02:39:22 kjell Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
10 | 10 | #include "key.h" |
11 | 11 | #include "macro.h" |
12 | 12 | |
13 | int inmacro = FALSE; | |
14 | int macrodef = FALSE; | |
13 | int inmacro = FALSE; /* Macro playback in progess */ | |
14 | int macrodef = FALSE; /* Macro recording in progress */ | |
15 | 15 | int macrocount = 0; |
16 | 16 | |
17 | 17 | struct line *maclhead = NULL; |
69 | 69 | PF funct; |
70 | 70 | |
71 | 71 | if (macrodef || |
72 | (macrocount >= MAXMACRO && macro[MAXMACRO].m_funct != finishmacro)) | |
72 | (macrocount >= MAXMACRO && macro[MAXMACRO - 1].m_funct | |
73 | != finishmacro)) { | |
74 | ewprintf("Macro too long. Aborting."); | |
73 | 75 | return (FALSE); |
76 | } | |
74 | 77 | |
75 | 78 | if (macrocount == 0) |
76 | 79 | return (TRUE); |
0 | /* $OpenBSD: main.c,v 1.56 2007/02/20 04:39:45 cloder Exp $ */ | |
0 | /* $OpenBSD: main.c,v 1.57 2008/05/29 19:58:15 sobrado Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
33 | 33 | static void |
34 | 34 | usage() |
35 | 35 | { |
36 | fprintf(stderr, "usage: %s [+line] [-n] [-f mode] [file ...]\n", | |
36 | fprintf(stderr, "usage: %s [-n] [-f mode] [+number] [file ...]\n", | |
37 | 37 | __progname); |
38 | 38 | exit(1); |
39 | 39 | } |
0 | .\" $OpenBSD: mg.1,v 1.32 2007/05/31 19:20:13 jmc Exp $ | |
0 | .\" $OpenBSD: mg.1,v 1.36 2008/05/29 19:58:15 sobrado Exp $ | |
1 | 1 | .\" |
2 | .Dd $Mdocdate: July 4 2007 $ | |
2 | .Dd $Mdocdate: June 10 2008 $ | |
3 | 3 | .Dt MG 1 |
4 | 4 | .Os |
5 | 5 | .Sh NAME |
7 | 7 | .Nd emacs-like text editor |
8 | 8 | .Sh SYNOPSIS |
9 | 9 | .Nm mg |
10 | .Op Ar options | |
11 | .Op Ar file ... | |
10 | .Op Fl n | |
11 | .Op Fl f Ar mode | |
12 | .Op + Ns Ar number | |
13 | .Op Ar | |
12 | 14 | .Sh DESCRIPTION |
13 | 15 | .Nm |
14 | 16 | is intended to be a small, fast, and portable editor for |
22 | 24 | .Pp |
23 | 25 | The options are as follows: |
24 | 26 | .Bl -tag -width Ds |
25 | .It Ar +number | |
27 | .It + Ns Ar number | |
26 | 28 | Go to the line specified by number (do not insert |
27 | 29 | a space between the "+" sign and the number). |
28 | 30 | If a negative number is specified, the line number counts |
29 | 31 | backwards from the end of the file i.e. +-1 will be the last |
30 | 32 | line of the file, +-2 will be second last, and so on. |
31 | .It Fl f Ar <mode> | |
33 | .It Fl f Ar mode | |
32 | 34 | Run the mode command for all buffers created from |
33 | 35 | arguments on the command line, including the |
34 | 36 | scratch buffer and all files. |
0 | /* $OpenBSD: theo.c,v 1.101 2007/08/28 17:57:16 jasper Exp $ */ | |
0 | /* $OpenBSD: theo.c,v 1.104 2008/06/08 21:35:21 henning Exp $ */ | |
1 | 1 | /* |
2 | 2 | * Copyright (c) 2002 Artur Grabowski <art@openbsd.org> |
3 | 3 | * All rights reserved. |
191 | 191 | "cache aliasing is a problem that would have stopped in 1992 if someone had killed about 5 people who worked at Sun.", |
192 | 192 | "Don't spread rumours about me being gentle.", |
193 | 193 | "If municipal water filtering equipment was built by the gcc developers, the western world would be dead by now.", |
194 | "kettenis supported a new machine in my basement and all I got to do was fix a 1 character typo in his html page commit.", | |
195 | "industry told us a lesson: when you're an asshole, they mail you hardware", | |
194 | 196 | }; |
195 | 197 | |
196 | 198 | static const int ntalk = sizeof(talk)/sizeof(talk[0]); |
0 | /* $OpenBSD: ttyio.c,v 1.31 2006/04/03 05:03:34 deraadt Exp $ */ | |
0 | /* $OpenBSD: ttyio.c,v 1.32 2008/02/05 12:53:38 reyk Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
144 | 144 | return; |
145 | 145 | |
146 | 146 | while ((written = write(fileno(stdout), buf, nobuf)) != nobuf) { |
147 | if (written == -1) | |
147 | if (written == -1) { | |
148 | if (errno == EINTR) | |
149 | continue; | |
148 | 150 | panic("ttflush write failed"); |
151 | } | |
149 | 152 | buf += written; |
150 | 153 | nobuf -= written; |
151 | 154 | } |