GLOBAL.C 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. Copyright (C) 1994-1995 Apogee Software, Ltd.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #include "global.h"
  16. #include "ipxsetup.h"
  17. #include <stdarg.h>
  18. #include <stdlib.h>
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include <dos.h>
  22. /*
  23. =================
  24. =
  25. = Error
  26. =
  27. = For abnormal program terminations
  28. =
  29. =================
  30. */
  31. void Error (char *error, ...)
  32. {
  33. va_list argptr;
  34. Shutdown();
  35. if (error)
  36. {
  37. va_start (argptr,error);
  38. vprintf (error,argptr);
  39. va_end (argptr);
  40. printf ("\n\n");
  41. // exit (1);
  42. }
  43. // printf ("Clean exit from SERSETUP\n");
  44. exit (error != (char *) NULL);
  45. }
  46. /*
  47. =================
  48. =
  49. = CheckParm
  50. =
  51. = Checks for the given parameter in the program's command line arguments
  52. =
  53. = Returns the argument number (1 to argc-1) or 0 if not present
  54. =
  55. =================
  56. */
  57. int CheckParm (char *check)
  58. {
  59. int i;
  60. for (i = 1;i<_argc;i++)
  61. if ( !stricmp(check,_argv[i]) )
  62. return i;
  63. return 0;
  64. }