Commit b1c5d8c6 authored by simonmar's avatar simonmar

[project @ 2003-01-29 09:54:31 by simonmar]

- re-instate setProgArgv, it is used in System.Environment (bah, could
  have sworn I grepped for it and found nothing...)

- Remove init_stack symbol from the Linker's symbol table; this is
  now static.
parent 7fc7b66e
/* ----------------------------------------------------------------------------
* $Id: RtsAPI.h,v 1.32 2003/01/28 16:30:07 simonmar Exp $
* $Id: RtsAPI.h,v 1.33 2003/01/29 09:54:31 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -36,6 +36,7 @@ extern void startupHaskell ( int argc, char *argv[],
extern void shutdownHaskell ( void );
extern void shutdownHaskellAndExit ( int exitCode );
extern void getProgArgv ( int *argc, char **argv[] );
extern void setProgArgv ( int argc, char *argv[] );
/* ----------------------------------------------------------------------------
......
/* -----------------------------------------------------------------------------
* $Id: Linker.c,v 1.111 2003/01/28 17:05:32 simonmar Exp $
* $Id: Linker.c,v 1.112 2003/01/29 09:54:32 simonmar Exp $
*
* (c) The GHC Team, 2000, 2001
*
......@@ -295,7 +295,6 @@ typedef struct _RtsSymbolVal {
Maybe_ForeignObj \
Maybe_Stable_Names \
Sym(StgReturn) \
Sym(init_stack) \
SymX(stg_enter_info) \
SymX(stg_enter_ret) \
SymX(stg_gc_void_info) \
......@@ -444,6 +443,7 @@ typedef struct _RtsSymbolVal {
SymX(rts_mkWord64) \
SymX(rts_mkWord8) \
SymX(run_queue_hd) \
SymX(setProgArgv) \
SymX(startupHaskell) \
SymX(shutdownHaskell) \
SymX(shutdownHaskellAndExit) \
......
/* -----------------------------------------------------------------------------
* $Id: RtsStartup.c,v 1.68 2003/01/28 16:30:06 simonmar Exp $
* $Id: RtsStartup.c,v 1.69 2003/01/29 09:54:33 simonmar Exp $
*
* (c) The GHC Team, 1998-2002
*
......@@ -177,9 +177,9 @@ startupHaskell(int argc, char *argv[], void (*init_root)(void))
/* -----------------------------------------------------------------------------
Getting the program's arguments.
Getting/Setting the program's arguments.
This is used by System.Environment.getArgs.
These are used by System.Environment.
-------------------------------------------------------------------------- */
void
......@@ -189,6 +189,18 @@ getProgArgv(int *argc, char **argv[])
*argv = prog_argv;
}
void
setProgArgv(int argc, char *argv[])
{
/* Usually this is done by startupHaskell, so we don't need to call this.
However, sometimes Hugs wants to change the arguments which Haskell
getArgs >>= ... will be fed. So you can do that by calling here
_after_ calling startupHaskell.
*/
prog_argc = argc;
prog_argv = argv;
}
/* -----------------------------------------------------------------------------
Per-module initialisation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment