[Devel] exporting pseudo variables

Daniel-Constantin Mierla daniel at voice-system.ro
Fri Apr 28 13:21:12 CEST 2006



On 04/28/2006 12:23 PM, Klaus Darilion wrote:

> Klaus Darilion wrote:
>
>> Klaus Darilion wrote:
>>
>>> Klaus Darilion wrote:
>>>
>>>> Hi!
>>>>
>>>> I'm studying how to export pseudo variables.
>>>>
>>>> In tm.c there is this code:
>>>>
>>>>         if(xl_add_extra("T_branch_idx", it_get_tm_branch_idx, 100 
>>>> )!=0)
>>>
>>>
>>> btw: what means type=100 ?
>>
>>
>> shouldn't it be
>> xl_add_extra("T_branch_idx", it_get_tm_branch_idx, XL_ITEM_EXTRA )
>>                                                     ^^^^^^^^^^
>>
>> or how do I export new pseudo variables?
>
>
> Are there somewhere developer docs for pseudo variables? e.g. 
> xl_value_t members?

not very much :-)

Here is some description:

There are a set of flags which specifies the type of value, the names 
are more or less suggestive.

#define XL_VAL_NULL            1
#define XL_VAL_EMPTY        2
#define XL_VAL_STR            4
#define XL_VAL_INT            8
#define XL_TYPE_INT            16

typedef struct _xl_value
{
    str rs; // the string value
    int ri; // the integer value
    int flags; // combination of flags
} xl_value_t, *xl_value_p;

There can be combination of flags, so that both string and integer 
fields are filled. If the primary type is integer the XL_TYPE_INT flag 
is set as well.

For example, the pseudovariable for time in string format sets both 
fields, rs is the string formatted time, ri is the timestamp and the 
flags are set to XL_VAL_STR|XL_VAL_INT.

The plans are to use the flags parameter of the functions from items.c 
to force the result to a certain type.

Cheers,
Daniel


>
> regards
> klaus
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>



More information about the Devel mailing list