/* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * System : * Subsystem : * Module : * $Source: /home/cvs/cvsroot/onelan/onelan/src/mplib1/util/pipeclean.c,v $ * $Author: mpoole $ * $Date: 2002/10/07 09:37:30 $ * $Revision: 1.2 $ * ******************************************************************************* * * Change History * * $Log: pipeclean.c,v $ * Revision 1.2 2002/10/07 09:37:30 mpoole * Initial checkin of mplib1-3.1.0 * * Revision 1.1 2002/10/07 09:37:09 mpoole * Initial checkin of mplib1-3.1.0 * * ******************************************************************************* */ #ident "$Header: /home/cvs/cvsroot/onelan/onelan/src/mplib1/util/pipeclean.c,v 1.2 2002/10/07 09:37:30 mpoole Exp $" /* ------------------------------------------------------------------ Include files ------------------------------------------------------------------ */ #include #include #include #include #include #include #include #include #include #include #include /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ Code starts here ------------------------------------------------------------------ */ static void usage ( const char *progname, const char *errstr ) { if (errstr) fprintf( stderr, "Error: %s\n", errstr ); fprintf(stderr, "\nUsage: %s [ -f filename ] [ -d directory ]\n", progname ); exit(1); return; } int main (int argc, char *argv[] ) { char *cp=NULL; int optc; while ((optc = getopt(argc, argv, "d:f:")) != EOF) switch(optc) { case 'd' : /* Specify directory */ cp = optarg; break; case 'f' : /* Specify config file */ read_config_file(optarg); break; default: usage( argv[0], "Invalid argument supplied" ); break; } if (cp==NULL || *cp=='\0') cp = eval_config_default( "PIPE_DIR", "$HOME/pipe" ); scan_dead_pipes( cp ); return(0); } /* -- End of File -- */