source: golgotha/src/i4/main/nrm_main.cc @ 608

Last change on this file since 608 was 80, checked in by Sam Hocevar, 15 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.2 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "main/main.hh"
10#include "string/string.hh"
11#include "error/error.hh"
12#include "file/file.hh"
13
14#include <stdlib.h>
15
16
17class tmp_main_str : public i4_const_str
18{
19public:
20  tmp_main_str();
21  void set_ptr(char *_ptr)
22  {
23    ptr=_ptr;
24    len=strlen(ptr);
25  }
26};
27
28w32           i4_global_argc;
29i4_const_str *i4_global_argv;
30
31
32void *i4_stack_base=0;
33
34int main(int argc, char **argv)
35{
36  long t;
37  i4_stack_base=(void *)(&t);
38
39
40  tmp_main_str *tmp=(tmp_main_str *)malloc(sizeof(tmp_main_str)*(argc+1));
41  w32 i;
42  for (i=0; i<argc; i++)
43    tmp[i].set_ptr(argv[i]);
44
45  i4_global_argc=argc;
46  i4_global_argv=tmp;
47  i4_main(argc,tmp);
48  free(tmp);
49 
50  return 1;
51}
Note: See TracBrowser for help on using the repository browser.