1 /* $Id: ui.h,v 2.3 2005-07-30 15:46:52 bjk Exp $ */
3 Copyright (C) 2001-2005 Ben Kibbey <bjk@arbornet.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
46 #define _PATH_DEV "/dev/"
50 #define COPYRIGHT "Copyright (c) 2001-2005 " PACKAGE_BUGREPORT
51 #define STAT(file, sstat) ((followsymlinks) ? stat(file, sstat) : lstat(file, sstat))
52 #define TIMEBUFSIZE 64
57 #define MODULE_DUP 0x001
58 #define MODULE_OUTPUT 0x002
59 #define MODULE_CHAINED 0x004
60 #define MODULE_CHAINABLE 0x008
61 #define MODULE_VERBOSE 0x010
62 #define SET_FLAG(var, f) (var |= f)
63 #define TEST_FLAG(var, f) (var & f)
71 /* These are functions found in loadable modules. */
72 typedef void (module_init
) (int *);
73 typedef void (module_exit
) (void);
74 typedef void (module_help
) (void);
75 typedef char *(module_options_init
) (char **);
76 typedef int (module_options
) (int argc
, char **argv
);
77 typedef int (module_exec
) (char ***, const struct passwd
*, const int,
81 char name
[64]; /* The filename of the module. */
82 void *m
; /* The module handle. */
83 unsigned flags
; /* dup, chained, chainable, and output. */
86 static int verbose
, delimchar
, multichar
, usefile
;
87 static int followsymlinks
;
88 static char tf
[TIMEBUFSIZE
];
90 static int chain_output
;
91 static int module_index
;
93 #ifdef HAVE___PROGNAME
94 extern char *__progname
;
96 static char *__progname
;