2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
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 $ */
32 * Class definitions for classes to parse and hold options from
35 * Part of the ToolTalk/Link Service data base inspect and repair tool.
37 * Copyright (c) 1990 by Sun Microsystems, Inc.
42 #include "util/tt_string.h"
45 // Options common to both ttdbck and lsdbck
47 class Dbck_options : public _Tt_object {
51 int set_opts(int argc, char **argv);
53 const _Tt_string_list_ptr &dbdirectories() const {
54 return _dbdirectories;};
58 virtual int selecting_p() const{
59 return _sel_filename_p | _sel_objid_p | _sel_type_p;
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;};
70 virtual int diagnosing_p() const{
71 return _diag_badform_p | _diag_exist_p;
73 int diag_badform_p()const{return _diag_badform_p;};
74 int diag_exist_p() {return _diag_exist_p;};
78 virtual int displaying_p() const{
79 return _disp_id_p | _disp_mand_p | _disp_prop_p;
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;};
87 // Note repair_netisam_p is not included in repairing_p since
88 // netisam repair occurs *before* inspection, instead of after.
90 virtual int repairing_p() const{
91 return _repair_type_p | _repair_delete_p;
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;};
99 virtual char * type_string() const {
100 return "Dbck_options";
102 virtual void print(FILE *f = stdout) const;
105 _Tt_string_list_ptr _dbdirectories;
110 _Tt_string _sel_filename; // shell wildcard pattern
112 _Tt_db_key_ptr _sel_objid_key;
114 _Tt_string _sel_type; // shell wildcard pattern
129 int _repair_netisam_p;
131 _Tt_string _repair_type;
132 int _repair_delete_p;
135 virtual char * optstring()=0;
136 virtual int set_option(int optchar, const char *optval)=0;
137 int set_common_option(int optchar,