remove ultrix support
[oweals/cde.git] / cde / lib / tt / bin / dbck / options.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
24 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
25 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
26 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
27 /*%%  $XConsortium: options.h /main/3 1995/10/20 16:25:40 rswiston $                                                     */
28 /* -*-C++-*-
29  *
30  * options.h
31  *
32  * Class definitions for classes to parse and hold options from
33  * the command lines.
34  *
35  * Part of the ToolTalk/Link Service data base inspect and repair tool.
36  * 
37  * Copyright (c) 1990 by Sun Microsystems, Inc.
38  */
39
40 #ifndef _OPTIONS_H
41 #define _OPTIONS_H
42 #include "util/tt_string.h"
43 #include "binkey.h"     
44
45 // Options common to both ttdbck and lsdbck
46
47 class Dbck_options : public _Tt_object {
48
49       public:
50         Dbck_options();
51         int                     set_opts(int argc, char **argv);
52
53         const _Tt_string_list_ptr       &dbdirectories() const {
54                 return _dbdirectories;};
55
56         // Selection options
57
58         virtual int             selecting_p()   const{
59                 return _sel_filename_p | _sel_objid_p | _sel_type_p;
60         }
61         int                     sel_filename_p()const{return _sel_filename_p;};
62         const _Tt_string       &sel_filename()  const{return _sel_filename;};
63         int                     sel_objid_p()   const{return _sel_objid_p;};   
64         _Tt_db_key_ptr          sel_objid_key() const{return _sel_objid_key;}; 
65         int                     sel_type_p()    const{return _sel_type_p;};
66         const _Tt_string       &sel_type()      const{return _sel_type;};
67
68         // Diagnosis options
69
70         virtual int             diagnosing_p()  const{
71                 return _diag_badform_p | _diag_exist_p;
72         };
73         int                     diag_badform_p()const{return _diag_badform_p;};
74         int                     diag_exist_p()  {return _diag_exist_p;};
75
76         // Display options
77
78         virtual int             displaying_p()  const{
79                 return _disp_id_p | _disp_mand_p | _disp_prop_p;
80         };
81         int                     disp_id_p()     const{return _disp_id_p;};
82         int                     disp_mand_p()   const{return _disp_mand_p;};
83         int                     disp_prop_p()   const{return _disp_prop_p;};
84
85         // Repair options
86
87         // Note repair_netisam_p is not included in repairing_p since
88         // netisam repair occurs *before* inspection, instead of after.
89
90         virtual int             repairing_p()   const{
91                 return _repair_type_p | _repair_delete_p;
92         };
93         int                     repair_netisam_p() const{return _repair_netisam_p;};
94         int                     repair_type_p() const{return _repair_type_p;};
95         const _Tt_string       &repair_type()   const{return _repair_type;};
96         int                     repair_delete_p() const{return _repair_delete_p;};
97         int                     debug_level()   const{return _debug_level;};
98
99         virtual char *          type_string() const {
100                 return "Dbck_options";
101         };
102         virtual void            print(FILE *f = stdout) const;
103
104       protected:
105         _Tt_string_list_ptr     _dbdirectories;
106
107         // Selection options
108
109         int                     _sel_filename_p;
110         _Tt_string              _sel_filename;  // shell wildcard pattern
111         int                     _sel_objid_p;   
112         _Tt_db_key_ptr          _sel_objid_key; 
113         int                     _sel_type_p;
114         _Tt_string              _sel_type;      // shell wildcard pattern
115
116         // Diagnosis options
117
118         int                     _diag_badform_p;        
119         int                     _diag_exist_p;
120
121         // Display options
122
123         int                     _disp_id_p;
124         int                     _disp_mand_p;
125         int                     _disp_prop_p;
126
127         // Repair options
128
129         int                     _repair_netisam_p;
130         int                     _repair_type_p;
131         _Tt_string              _repair_type;
132         int                     _repair_delete_p;
133
134         int                     _debug_level;
135         virtual char *          optstring()=0;
136         virtual int             set_option(int optchar, const char *optval)=0;
137         int                     set_common_option(int optchar,
138                                                   const char *optval);
139 };
140 #endif