Annotation of doom/m_argv.c, revision 1.1.1.2

1.1       root        1: // Emacs style mode select   -*- C++ -*- 
                      2: //-----------------------------------------------------------------------------
                      3: //
                      4: // $Id:$
                      5: //
                      6: // Copyright (C) 1993-1996 by id Software, Inc.
                      7: //
1.1.1.2 ! root        8: // This program is free software; you can redistribute it and/or
        !             9: // modify it under the terms of the GNU General Public License
        !            10: // as published by the Free Software Foundation; either version 2
        !            11: // of the License, or (at your option) any later version.
1.1       root       12: //
1.1.1.2 ! root       13: // This program is distributed in the hope that it will be useful,
1.1       root       14: // but WITHOUT ANY WARRANTY; without even the implied warranty of
1.1.1.2 ! root       15: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        !            16: // GNU General Public License for more details.
1.1       root       17: //
                     18: // $Log:$
                     19: //
                     20: // DESCRIPTION:
                     21: //
                     22: //-----------------------------------------------------------------------------
                     23: 
                     24: static const char
                     25: rcsid[] = "$Id: m_argv.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
                     26: 
                     27: 
                     28: #include <string.h>
                     29: 
                     30: int            myargc;
                     31: char**         myargv;
                     32: 
                     33: 
                     34: 
                     35: 
                     36: //
                     37: // M_CheckParm
                     38: // Checks for the given parameter
                     39: // in the program's command line arguments.
                     40: // Returns the argument number (1 to argc-1)
                     41: // or 0 if not present
                     42: int M_CheckParm (char *check)
                     43: {
                     44:     int                i;
                     45: 
                     46:     for (i = 1;i<myargc;i++)
                     47:     {
                     48:        if ( !strcasecmp(check, myargv[i]) )
                     49:            return i;
                     50:     }
                     51: 
                     52:     return 0;
                     53: }
                     54: 
                     55: 
                     56: 
                     57: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.