"Fossies" - the Fresh Open Source Software Archive

Member "userinfo-2.5/src/ui.h" (15 Jan 2015, 2572 Bytes) of package /linux/privat/userinfo-2.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ui.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.4_vs_2.5.

    1 /*
    2     Copyright (C) 2001-2015 Ben Kibbey <bjk@luxsci.net>
    3 
    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.
    8 
    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.
   13 
   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
   17 */
   18 #ifndef UI_H
   19 #define UI_H
   20 
   21 #ifdef HAVE_LIBGEN_H
   22 #include <libgen.h>
   23 #endif
   24 
   25 #ifdef HAVE_DLFCN_H
   26 #include <dlfcn.h>
   27 #endif
   28 
   29 #ifdef HAVE_STRING_H
   30 #include <string.h>
   31 #endif
   32 
   33 #ifdef HAVE_ERR_H
   34 #include <err.h>
   35 #endif
   36 
   37 #ifdef HAVE_LIMITS_H
   38 #include <limits.h>
   39 #endif
   40 
   41 #ifdef HAVE_PATHS_H
   42 #include <paths.h>
   43 #else
   44 #ifndef _PATH_DEV
   45 #define _PATH_DEV   "/dev/"
   46 #endif
   47 #endif
   48 
   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
   52 #define UNKNOWN     "!"
   53 #define NONE        "-"
   54 #define ON      "1"
   55 #define OFF     "0"
   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)
   63 
   64 enum {
   65     OUTPUT_DONE,
   66     OUTPUT_APPEND
   67 };
   68 
   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,
   76                const int, char *);
   77 
   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. */
   82     char **argv;
   83     int argc;
   84 } **modules;
   85 
   86 static int verbose, delimchar, multichar, usefile;
   87 static int followsymlinks;
   88 static char tf[TIMEBUFSIZE];
   89 static int chaining;
   90 static int chain_output;
   91 static int module_total;
   92 
   93 #ifdef HAVE___PROGNAME
   94 extern char *__progname;
   95 #else
   96 static char *__progname;
   97 #endif
   98 
   99 #ifdef WITH_DMALLOC
  100 #include <dmalloc.h>
  101 #endif
  102 
  103 #endif