tools/llvm: Do not build with symbols
[minix3.git] / external / bsd / nvi / dist / ex / ex_stop.c
blob63de34c8958e8e8d0ed7d3a4ab668a2102d43101
1 /* $NetBSD: ex_stop.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */
2 /*-
3 * Copyright (c) 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.
8 * See the LICENSE file for redistribution information.
9 */
11 #include "config.h"
13 #ifndef lint
14 static const char sccsid[] = "Id: ex_stop.c,v 10.11 2001/06/25 15:19:20 skimo Exp (Berkeley) Date: 2001/06/25 15:19:20 ";
15 #endif /* not lint */
17 #include <sys/types.h>
18 #include <sys/queue.h>
20 #include <bitstring.h>
21 #include <errno.h>
22 #include <limits.h>
23 #include <stdio.h>
24 #include <string.h>
25 #include <unistd.h>
27 #include "../common/common.h"
30 * ex_stop -- :stop[!]
31 * :suspend[!]
32 * Suspend execution.
34 * PUBLIC: int ex_stop __P((SCR *, EXCMD *));
36 int
37 ex_stop(SCR *sp, EXCMD *cmdp)
39 int allowed;
41 /* For some strange reason, the force flag turns off autowrite. */
42 if (!FL_ISSET(cmdp->iflags, E_C_FORCE) && file_aw(sp, FS_ALL))
43 return (1);
45 if (sp->gp->scr_suspend(sp, &allowed))
46 return (1);
47 if (!allowed)
48 ex_emsg(sp, NULL, EXM_NOSUSPEND);
49 return (0);