[sr-dev] how to assign value to a pvar?

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 10 11:56:26 CET 2009



On 10.11.2009 11:51 Uhr, Juha Heinanen wrote:
> Daniel-Constantin Mierla writes:
>
>  > there is an example in group module - get_user_group() function.
>
> daniel,
>
> thanks for the pointer.  i'll take a look at it.  i don't use that
> module and thus missed it.
>
> it would still be interesting to know what i'm doing wrong with my try to
> use pv_set_spec_value:
>
>      pv_val.ri = count;
>      pv_val.flags = PV_VAL_INT;
>      if (_count) {
>  	if (pv_set_spec_value(msg, (pv_spec_t *)_count, EQ_T, &pv_val) == 0) {
>
>  > However, you can do a new pseudo-variable:
>  > $rr_count or so, where get function counts the number of routes.
>
> yes, at stage two.  at this point i want to have all needed
> functions in nathelper module, so that not too many files need to be
> patched by those who want to try this feature out.
>
>   
you have to set:

pv_val.flags = PV_TYPE_INT;

-- hope is ok, since I tried to remember from memory. The errors shows 
that the type is considered to be string, in your case.

You can add the pv in any of the modules, does not have to be in "pv" 
module... then you can move it later. There are many modules exporting 
PVs ... htable, tmx, ...

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the sr-dev mailing list