m_argv.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Emacs style mode select -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  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.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // $Log:$
  18. //
  19. // DESCRIPTION:
  20. //
  21. //-----------------------------------------------------------------------------
  22. static const char
  23. rcsid[] = "$Id: m_argv.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
  24. #include <string.h>
  25. int myargc;
  26. char** myargv;
  27. //
  28. // M_CheckParm
  29. // Checks for the given parameter
  30. // in the program's command line arguments.
  31. // Returns the argument number (1 to argc-1)
  32. // or 0 if not present
  33. int M_CheckParm (char *check)
  34. {
  35. int i;
  36. for (i = 1;i<myargc;i++)
  37. {
  38. if ( !strcasecmp(check, myargv[i]) )
  39. return i;
  40. }
  41. return 0;
  42. }