2 Copyright (C) 1995-2011, The AROS Development Team. All rights reserved.
6 #include <proto/exec.h>
10 void initDefaultInterpreterState(ShellState
*ss
)
16 /* Preset the first bytes to "C:" to handle C: multiassigns */
20 for (i
= 0; i
< MAXARGS
; ++i
)
22 struct SArg
*a
= ss
->args
+ i
;
42 LONG
pushInterpreterState(ShellState
*ss
)
44 ShellState
*tmp_ss
= (ShellState
*)AllocMem(sizeof(*ss
), MEMF_LOCAL
);
49 initDefaultInterpreterState(ss
);
54 return ERROR_NO_FREE_STORE
;
57 void popInterpreterState(ShellState
*ss
)
59 ShellState
*tmp_ss
= ss
->stack
;
63 for (i
= 0; i
< ss
->argcount
; ++i
)
68 FreeMem((APTR
) a
->def
, a
->deflen
+ 1);
74 FreeMem(tmp_ss
, sizeof(*ss
));
77 initDefaultInterpreterState(ss
);