[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building loadable builtin
From: |
Chet Ramey |
Subject: |
Re: Building loadable builtin |
Date: |
Thu, 14 Apr 2022 14:52:27 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 |
On 4/14/22 1:48 PM, Robert E. Griffith wrote:
Are there any resources available for understanding the bash internals more?
Only the source code.
Is this an appropriate place to ask questions on that or is there better
place for that?
You can ask on help-bash too, since this isn't really a bug per se. You'll
get help here, though.
Currently I am trying to figure out how to properly create a nameref var.
I specified the att_nameref attribute to make_local_variable but when I
examine the variable back in the script it is a simple variable and not a
nameref. I see specific functions in variables.h for creating arrays but
not one for namerefs.
in builtin..
// local -n this="$oid"
SHELL_VAR* this=make_local_variable("this",att_nameref);
That's not the right set of flags for make_local_variable. The constants in
variables.h beginning with MKLOC_ are the ones for the `flags' argument.
You set a variable's attributes separately from creating it.
What you probably want is something like
this = make_local_variable("this", 0);
if (this)
VSETATTR(this, att_nameref);
(not knowing what else you're doing).
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/