[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.1 freem_ref_t Data Structure

The libfreem API uses a struct of type freem_ref_t in order to communicate state, pass in values, and return results.

The data structure, defined in ‘freem.h’, looks like this:

typedef struct freem_ref_t {

    /*
     * The 'reftype' field can be one of:
     * 
     *  MREF_RT_LOCAL
     *  MREF_RT_GLOBAL
     *  MREF_RT_SSV
     */
    short reftype;

    /*
     * The 'name' field is the name of the local variable,
     * global variable, or SSV (without ^ or ^$).
     */
    char name[256];    

    /*
     * Returned data goes in a string, so you've got to figure out the
     * whole M canonical number thing yourself. Good luck. :-)
     */
    char value[STRLEN];   

    short status;

    unsigned int subscript_count;
    char subscripts[255][256];

} freem_ref_t;

freem_ref_t Members

reftype

The ‘reftype’ member determines whether we are operating on a local variable, a global variable, or a structured system variable. It may be set to any of following constants: MREF_RT_LOCAL, MREF_RT_GLOBAL, or MREF_RT_SSV.

name

The ‘name’ member contains the name of the global, local, or SSV to be accessed. You must not include leading characters, such as ^ or ^$.

value

This member contains the value read from or the value to be written to the global, local, or SSV.

status

This member gives us various API status values after the API call returns. In general, this value is also returned by each API function.

subscript_count

The number of subscripts to be passed into the API function being called. This value represents the maximum index into the first dimension of the subscripts array.

subscripts

A two-dimensional array containing the subscripts to which we are referring in this API call.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by root on October 14, 2020 using texi2html 1.82.