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

20.5 freem_set()

Sets a FreeM local node, global node, or writable SSV node.

Synopsis

short freem_set(freem_ref_t *ref);

Parameters

freem_ref_t

This parameter is a pointer to a freem_ref_t struct. The caller must allocate the memory for this struct.

Return Value

Returns OK on success, or one of the other error values defined in merr.h.

Example

This example sets the value blue into global node ^car("color").

#include <stdio.h>
#include <string.h>
#include <freem.h>

int main(int argc, char **argv, char **envp)
{
    freem_ref_t ref;

    /* we're setting a global */
    ref.reftype = MREF_RT_GLOBAL;

    /* access global "car" */
    strcpy(ref.name, "car");

    /* set up the subscripts */
    ref.subscript_count = 1;
    strcpy(ref.subscripts[0], "color");
 

    /* use the USER namespace */
    freem_init("USER");

    /* write the data out */
    freem_set(&ref);
    
}

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

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