main.cc (2762:470f9e55fe54) main.cc (2763:c3741c707d53)
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 152 unchanged lines hidden (view full) ---

161 if (!host)
162 host = getenv("HOST");
163
164 if (host)
165 ccprintf(out, "M5 executing on %s\n", host);
166}
167
168
1/*
2 * Copyright (c) 2000-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 152 unchanged lines hidden (view full) ---

161 if (!host)
162 host = getenv("HOST");
163
164 if (host)
165 ccprintf(out, "M5 executing on %s\n", host);
166}
167
168
169extern "C" { void init_main(); }
169extern "C" { void init_cc_main(); }
170
171int
172main(int argc, char **argv)
173{
174 // Saze off program name
175 myProgName = argv[0];
176
177 sayHello(cerr);

--- 75 unchanged lines hidden (view full) ---

253
254 if (setenv("PYTHONPATH", newpath.c_str(), true) == -1)
255 fatal("setenv: %s\n", strerror(errno));
256
257 // initialize embedded Python interpreter
258 Py_Initialize();
259 PySys_SetArgv(argc, argv);
260
170
171int
172main(int argc, char **argv)
173{
174 // Saze off program name
175 myProgName = argv[0];
176
177 sayHello(cerr);

--- 75 unchanged lines hidden (view full) ---

253
254 if (setenv("PYTHONPATH", newpath.c_str(), true) == -1)
255 fatal("setenv: %s\n", strerror(errno));
256
257 // initialize embedded Python interpreter
258 Py_Initialize();
259 PySys_SetArgv(argc, argv);
260
261 // initialize SWIG 'main' module
262 init_main();
261 // initialize SWIG 'cc_main' module
262 init_cc_main();
263
264 if (argc > 0) {
265 // extra arg(s): first is script file, remaining ones are args
266 // to script file
267 char *filename = argv[0];
268 FILE *fp = fopen(filename, "r");
269 if (!fp) {
270 fatal("cannot open file '%s'\n", filename);

--- 287 unchanged lines hidden ---
263
264 if (argc > 0) {
265 // extra arg(s): first is script file, remaining ones are args
266 // to script file
267 char *filename = argv[0];
268 FILE *fp = fopen(filename, "r");
269 if (!fp) {
270 fatal("cannot open file '%s'\n", filename);

--- 287 unchanged lines hidden ---