tools/llvm: Do not build with symbols
[minix3.git] / external / bsd / nvi / dist / vi / v_zexit.c
blob334c729d2d7ebfd699b05221ed04b98a6851fc10
1 /* $NetBSD: v_zexit.c,v 1.2 2013/11/22 15:52:06 christos Exp $ */
2 /*-
3 * Copyright (c) 1992, 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: v_zexit.c,v 10.7 2001/06/25 15:19:37 skimo Exp (Berkeley) Date: 2001/06/25 15:19:37 ";
15 #endif /* not lint */
17 #include <sys/types.h>
18 #include <sys/queue.h>
19 #include <sys/time.h>
21 #include <bitstring.h>
22 #include <limits.h>
23 #include <stdio.h>
24 #include <string.h>
26 #include "../common/common.h"
27 #include "vi.h"
30 * v_zexit -- ZZ
31 * Save the file and exit.
33 * PUBLIC: int v_zexit __P((SCR *, VICMD *));
35 int
36 v_zexit(SCR *sp, VICMD *vp)
38 /* Write back any modifications. */
39 if (F_ISSET(sp->ep, F_MODIFIED) &&
40 file_write(sp, NULL, NULL, NULL, FS_ALL))
41 return (1);
43 /* Check to make sure it's not a temporary file. */
44 if (file_m3(sp, 0))
45 return (1);
47 /* Check for more files to edit. */
48 if (ex_ncheck(sp, 0))
49 return (1);
51 F_SET(sp, SC_EXIT);
52 return (0);