Annotation of doom/m_argv.c, revision 1.1.1.3

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.3 ! root        8: // This source is available for distribution and/or modification
        !             9: // only under the terms of the DOOM Source Code License as
        !            10: // published by id Software. All rights reserved.
1.1       root       11: //
1.1.1.3 ! root       12: // The source is distributed in the hope that it will be useful,
1.1       root       13: // but WITHOUT ANY WARRANTY; without even the implied warranty of
1.1.1.3 ! root       14: // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
        !            15: // for more details.
1.1       root       16: //
                     17: // $Log:$
                     18: //
                     19: // DESCRIPTION:
                     20: //
                     21: //-----------------------------------------------------------------------------
                     22: 
                     23: static const char
                     24: rcsid[] = "$Id: m_argv.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
                     25: 
                     26: 
                     27: #include <string.h>
                     28: 
1.1.1.3 ! root       29: #define strcasecmp strcmp
        !            30: 
1.1       root       31: int            myargc;
                     32: char**         myargv;
                     33: 
                     34: 
                     35: 
                     36: 
                     37: //
                     38: // M_CheckParm
                     39: // Checks for the given parameter
                     40: // in the program's command line arguments.
                     41: // Returns the argument number (1 to argc-1)
                     42: // or 0 if not present
                     43: int M_CheckParm (char *check)
                     44: {
                     45:     int                i;
                     46: 
                     47:     for (i = 1;i<myargc;i++)
                     48:     {
                     49:        if ( !strcasecmp(check, myargv[i]) )
                     50:            return i;
                     51:     }
                     52: 
                     53:     return 0;
                     54: }
                     55: 
                     56: 
                     57: 
                     58: 

unix.superglobalmegacorp.com

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