2 Copyright (C) 2001-2015 Ben Kibbey <bjk@luxsci.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02110-1301 USA
45 #define _PATH_DEV "/dev/"
49 #define COPYRIGHT "Copyright (C) 2001-2015 " PACKAGE_BUGREPORT
50 #define STAT(file, sstat) ((followsymlinks) ? stat(file, sstat) : lstat(file, sstat))
51 #define TIMEBUFSIZE 64
56 #define MODULE_DUP 0x001
57 #define MODULE_OUTPUT 0x002
58 #define MODULE_CHAINED 0x004
59 #define MODULE_CHAINABLE 0x008
60 #define MODULE_VERBOSE 0x010
61 #define SET_FLAG(var, f) (var |= f)
62 #define TEST_FLAG(var, f) (var & f)
69 /* These are functions found in loadable modules. */
70 typedef void (module_init
) (int *);
71 typedef void (module_exit
) (void);
72 typedef void (module_help
) (void);
73 typedef char *(module_options_init
) (char **);
74 typedef int (module_options
) (int argc
, char **argv
);
75 typedef int (module_exec
) (char ***, const struct passwd
*, const int,
78 static struct module_s
{
79 char name
[PATH_MAX
]; /* The filename of the module. */
80 void *m
; /* The module handle. */
81 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_total
;
93 #ifdef HAVE___PROGNAME
94 extern char *__progname
;
96 static char *__progname
;