~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to alpine/conftype.h

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: conftype.h 245 2006-11-18 02:46:41Z hubert@u.washington.edu $
 
3
 *
 
4
 * ========================================================================
 
5
 * Copyright 2006 University of Washington
 
6
 *
 
7
 * Licensed under the Apache License, Version 2.0 (the "License");
 
8
 * you may not use this file except in compliance with the License.
 
9
 * You may obtain a copy of the License at
 
10
 *
 
11
 *     http://www.apache.org/licenses/LICENSE-2.0
 
12
 *
 
13
 * ========================================================================
 
14
 */
 
15
 
 
16
#ifndef PINE_CONFTYPE_INCLUDED
 
17
#define PINE_CONFTYPE_INCLUDED
 
18
 
 
19
 
 
20
#include "keymenu.h"
 
21
#include "help.h"
 
22
#include "flagmaint.h"
 
23
#include "context.h"
 
24
#include "listsel.h"
 
25
#include "../pith/pattern.h"
 
26
#include "../pith/conf.h"
 
27
#include "../pith/ldap.h"
 
28
 
 
29
 
 
30
typedef enum {ListMode, SingleMode} ScreenMode;
 
31
 
 
32
 
 
33
typedef struct edit_arb {
 
34
    struct variable *v;
 
35
    ARBHDR_S        *a;
 
36
    struct edit_arb *next;
 
37
} EARB_S;
 
38
 
 
39
 
 
40
typedef struct conf_line {
 
41
    char             *varname,                  /* alloc'd var name string   */
 
42
                     *value;                    /* alloc'd var value string  */
 
43
    short             varoffset;                /* offset from screen left   */
 
44
    short             valoffset;                /* offset from screen left   */
 
45
    short             val2offset;               /* offset from screen left   */
 
46
    struct variable  *var;                      /* pointer to pinerc var     */
 
47
    long              varmem;                   /* value's index, if list    */
 
48
                                                /* tool to manipulate values */
 
49
    int               (*tool)(struct pine *, int, struct conf_line **, unsigned);
 
50
    struct key_menu  *keymenu;                  /* tool-specific  keymenu    */
 
51
    HelpType          help;                     /* variable's help text      */
 
52
    char             *help_title;
 
53
    unsigned          flags;
 
54
    struct conf_line *varnamep;         /* pointer to varname        */
 
55
    struct conf_line *headingp;         /* pointer to heading        */
 
56
    struct conf_line *next, *prev;
 
57
    union flag_or_context_data {
 
58
        struct flag_conf {
 
59
            struct flag_table **ftbl;   /* address of start of table */
 
60
            struct flag_table  *fp;     /* pointer into table for each row */
 
61
        } f;
 
62
        struct context_and_screen {
 
63
            CONTEXT_S  *ct;
 
64
            CONT_SCR_S *cs;
 
65
        } c;
 
66
        struct role_conf {
 
67
            PAT_LINE_S *patline;
 
68
            PAT_S      *pat;
 
69
            PAT_S     **selected;
 
70
        } r;
 
71
        struct abook_conf {
 
72
            char **selected;
 
73
            char  *abookname;
 
74
        } b;
 
75
        EARB_S **earb;
 
76
        struct list_select {
 
77
            LIST_SEL_S *lsel;
 
78
            ScreenMode *listmode;
 
79
        } l;
 
80
#ifdef  ENABLE_LDAP
 
81
        struct entry_and_screen {
 
82
            LDAP          *ld;
 
83
            LDAPMessage   *res;
 
84
            LDAP_SERV_S   *info_used;
 
85
            char          *serv;
 
86
            ADDR_CHOOSE_S *ac;
 
87
        } a;
 
88
#endif
 
89
        struct take_export_val {
 
90
            int         selected;
 
91
            char       *exportval;
 
92
            ScreenMode *listmode;
 
93
        } t;
 
94
    } d;
 
95
} CONF_S;
 
96
 
 
97
 
 
98
/*
 
99
 * Valid for flags argument of config screen tools or flags field in CONF_S
 
100
 */
 
101
#define CF_CHANGES      0x0001          /* Have been earlier changes */
 
102
#define CF_NOSELECT     0x0002          /* This line is unselectable */
 
103
#define CF_NOHILITE     0x0004          /* Don't highlight varname   */
 
104
#define CF_NUMBER       0x0008          /* Input should be numeric   */
 
105
#define CF_INVISIBLEVAR 0x0010          /* Don't show the varname    */
 
106
#define CF_PRINTER      0x0020          /* Printer config line       */
 
107
#define CF_H_LINE       0x0040          /* Horizontal line           */
 
108
#define CF_B_LINE       0x0080          /* Blank line                */
 
109
#define CF_CENTERED     0x0100          /* Centered text             */
 
110
#define CF_STARTITEM    0x0200          /* Start of an "item"        */
 
111
#define CF_PRIVATE      0x0400          /* Private flag for tool     */
 
112
#define CF_DOUBLEVAR    0x0800          /* Line has 2 settable vars  */
 
113
#define CF_VAR2         0x1000          /* Cursor on 2nd of 2 vars   */
 
114
#define CF_COLORSAMPLE  0x2000          /* Show color sample here    */
 
115
#define CF_POT_SLCTBL   0x4000          /* Potentially selectable    */
 
116
#define CF_INHERIT      0x8000          /* Inherit Defaults line     */
 
117
 
 
118
 
 
119
typedef struct save_config {
 
120
    union {
 
121
        char  *p;
 
122
        char **l;
 
123
    } saved_user_val;
 
124
} SAVED_CONFIG_S;
 
125
 
 
126
 
 
127
typedef struct conf_screen {
 
128
    CONF_S  *current,
 
129
            *prev,
 
130
            *top_line;
 
131
    int      ro_warning,
 
132
             deferred_ro_warning;
 
133
} OPT_SCREEN_S;
 
134
 
 
135
 
 
136
/* exported protoypes */
 
137
 
 
138
 
 
139
#endif /* PINE_CONFTYPE_INCLUDED */