Roland Mainz
2013-07-11 15:14:09 UTC
--------
nv_putsub(np,0,0,ARRAY_UNDEF);
before calling
_nv_unset(np,NV_RDONLY);
Ok... so a function to clear an associative/indexed array would look like this:(Slightly) offtopic: How can I clear a plain string array (e.g. $
typeset -a ar #) via the C API (without having to resort to
|sh_trap()| to do it...) ?
You can dotypeset -a ar #) via the C API (without having to resort to
|sh_trap()| to do it...) ?
nv_putsub(np,0,0,ARRAY_UNDEF);
before calling
_nv_unset(np,NV_RDONLY);
-- snip --
void nv_clear_array(Namval_t* np)
{
nv_putsub(np,0,0,ARRAY_UNDEF);
_nv_unset(np,NV_RDONLY);
}
-- snip --
... right ?
Next question: How do I clear a compound variable using the libshell C API ?
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)