Roland Mainz wrote:
> Roland Mainz wrote:
> > Tomas Heran wrote:
> > > Roland Mainz wrote:
> > > > Do SMF propperties support arrays ? I'm currently looking at CR #6218143
> > > > ("Xserver doesn't parse SMF server_args correctly") and IMO one of the
> > > > better solutions would be to have an array of arguments (similar like
> > > > argv) to handle values with { <space>, <tab>, <newline> } (e.g. the
> > > > default content of the IFS variable (see sh(1))) correctly...
> > >
> > > yes, arrays of values are supported. Please have a look here (property
> > > 'domain') for an example xml manifest file:
> > >
> > > http://src.opensolaris.org./source/xref/onnv/onnv-gate/usr/src/cmd/cmd-inet/usr.lib/mdnsd/multicast.xml#111
> >
> > Thanks! :-)
> 
> How can I figure out whether a value an "astring" or an "astring_list" ?
> 
> http://src.opensolaris.org./source/xref/onnv/onnv-gate/usr/src/cmd/cmd-inet/usr.lib/mdnsd/multicast.xml#111
> defines the "domain" property like this:
> -- snip --
> 111 <property name='domain' type='astring'>
> 112     <astring_list>
> 113             <value_node value='local'/>
> 114             <value_node value='254.169.in-addr.arpa'/>
> 115             <value_node value='8.e.f.ip6.arpa'/>
> 116             <value_node value='9.e.f.ip6.arpa'/>
> 117             <value_node value='a.e.f.ip6.arpa'/>
> 118             <value_node value='b.e.f.ip6.arpa'/>
> 119     </astring_list>
> 120 </property>
> -- snip --
> 
> However when I "crawl" the SMF properly tree using my "svcproptree1.ksh"
> script
> (http://svn.genunix.org/repos/on/branches/ksh93/gisburn/scripts/svcproptree1.ksh
> ; it may require the ksh93-integration update1 version of ksh93) I am
> getting the following output:
> -- snip --
> $ svcproptree1.ksh "network/dns/multicast:default" list | grep
> "mdns.*domain"
> #loading completed.
> #parsing completed.
> svc.proptree[network/dns/multicast:default/].properties[nss_mdns_config/domain].datatype=astring
> svc.proptree[network/dns/multicast:default/].properties[nss_mdns_config/domain].value='local
> b.e.f.ip6.arpa a.e.f.ip6.arpa 9.e.f.ip6.arpa 8.e.f.ip6.arpa
> 254.169.in-addr.arpa'
> #done.
> -- snip --
> ... which means the application doesn't see whether the value is a
> normal "astring" or an array of one or multiple "astring" values...

I forgot to explain what I want:
1. I need a way to distinguish between "astring" and "astring_list"
2. If the value is a "astring_list" I need the number of elements in the
"astring_list"
3. I need a way to access individual elements in the "astring_list" by
index number

Note the whole stuff needs to work even if the value nodes contain
special (shell) characters like { <space>, <tab>, <newline>,
'vertical_tab' '\\', '\''
etc. } ...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to