it's LINES, not ROWS!
[nvi.git] / common / options.h
blob5480839e58bf46608fa193786186be5066a84e6c
1 /*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
7 * $Id: options.h,v 8.13 1993/12/10 16:31:26 bostic Exp $ (Berkeley) $Date: 1993/12/10 16:31:26 $
8 */
10 struct _option {
11 union {
12 u_long val; /* Value or boolean. */
13 char *str; /* String. */
14 } o_u;
15 size_t len; /* String length. */
17 #define OPT_ALLOCATED 0x01 /* Allocated space. */
18 #define OPT_SELECTED 0x02 /* Selected for display. */
19 #define OPT_SET 0x04 /* Set (display for the user). */
20 u_char flags;
23 struct _optlist {
24 char *name; /* Name. */
25 /* Change function. */
26 int (*func) __P((SCR *, OPTION *, char *, u_long));
27 /* Type of object. */
28 enum { OPT_0BOOL, OPT_1BOOL, OPT_NUM, OPT_STR } type;
30 #define OPT_NEVER 0x01 /* Never display the option. */
31 #define OPT_NOSAVE 0x02 /* Mkexrc command doesn't save. */
32 #define OPT_NOSTR 0x04 /* String that takes a "no". */
33 u_int flags;
36 /* Clear, set, test boolean options. */
37 #define O_SET(sp, o) (sp)->opts[(o)].o_u.val = 1
38 #define O_CLR(sp, o) (sp)->opts[(o)].o_u.val = 0
39 #define O_ISSET(sp, o) ((sp)->opts[(o)].o_u.val)
41 /* Get option values. */
42 #define O_LEN(sp, o) (sp)->opts[(o)].len
43 #define O_STR(sp, o) (sp)->opts[(o)].o_u.str
44 #define O_VAL(sp, o) (sp)->opts[(o)].o_u.val
46 /* Option routines. */
47 enum optdisp { NO_DISPLAY, ALL_DISPLAY, CHANGED_DISPLAY, SELECT_DISPLAY };
49 int opts_copy __P((SCR *, SCR *));
50 void opts_dump __P((SCR *, enum optdisp));
51 void opts_free __P((SCR *));
52 int opts_init __P((SCR *));
53 int opts_save __P((SCR *, FILE *));
54 int opts_set __P((SCR *, ARGS *[]));
56 /* Per-option change routines. */
57 int f_altwerase __P((SCR *, OPTION *, char *, u_long));
58 int f_columns __P((SCR *, OPTION *, char *, u_long));
59 int f_keytime __P((SCR *, OPTION *, char *, u_long));
60 int f_leftright __P((SCR *, OPTION *, char *, u_long));
61 int f_lines __P((SCR *, OPTION *, char *, u_long));
62 int f_lisp __P((SCR *, OPTION *, char *, u_long));
63 int f_list __P((SCR *, OPTION *, char *, u_long));
64 int f_matchtime __P((SCR *, OPTION *, char *, u_long));
65 int f_mesg __P((SCR *, OPTION *, char *, u_long));
66 int f_modeline __P((SCR *, OPTION *, char *, u_long));
67 int f_number __P((SCR *, OPTION *, char *, u_long));
68 int f_optimize __P((SCR *, OPTION *, char *, u_long));
69 int f_paragraph __P((SCR *, OPTION *, char *, u_long));
70 int f_readonly __P((SCR *, OPTION *, char *, u_long));
71 int f_ruler __P((SCR *, OPTION *, char *, u_long));
72 int f_section __P((SCR *, OPTION *, char *, u_long));
73 int f_shiftwidth __P((SCR *, OPTION *, char *, u_long));
74 int f_sidescroll __P((SCR *, OPTION *, char *, u_long));
75 int f_tabstop __P((SCR *, OPTION *, char *, u_long));
76 int f_tags __P((SCR *, OPTION *, char *, u_long));
77 int f_term __P((SCR *, OPTION *, char *, u_long));
78 int f_ttywerase __P((SCR *, OPTION *, char *, u_long));
79 int f_w1200 __P((SCR *, OPTION *, char *, u_long));
80 int f_w300 __P((SCR *, OPTION *, char *, u_long));
81 int f_w9600 __P((SCR *, OPTION *, char *, u_long));
82 int f_window __P((SCR *, OPTION *, char *, u_long));
83 int f_wrapmargin __P((SCR *, OPTION *, char *, u_long));