Symbol Object

The symobject class is a simple object that wraps a t_symbol* together with a couple of additional fields. More...

+ Collaboration diagram for Symbol Object:

Data Structures

struct  t_symobject
 The symobject data structure. More...

Functions

void * symobject_new (t_symbol *sym)
 The symobject data structure.
long symobject_linklist_match (void *a, void *b)
 Utility for searching a linklist containing symobjects.

Detailed Description

The symobject class is a simple object that wraps a t_symbol* together with a couple of additional fields.

It is useful for storing symbols, possibly with additional flags or pointers, into a Hash Table or Linked List.

Version:
5.0

Function Documentation

long symobject_linklist_match ( void *  a,
void *  b 
)

Utility for searching a linklist containing symobjects.

Parameters:
a(opaque)
b(opaque)
Returns:
Returns true if a match is found, otherwise returns false.
Remarks:
The following example shows one common use of the this method.
    t_symobject *item = NULL;
    long        index;
    t_symbol    *textsym;
    
    textsym = gensym("something to look for");

    // search for a symobject with the symbol 'something to look for'
    index = linklist_findfirst(s_ll_history, (void **)&item, symobject_linklist_match, textsym);
    if(index == -1){
        // symobject not found.
    }
    else{
        do something with the symobject, or with the index of the symbobject in the linklist
    }   
void* symobject_new ( t_symbol sym)

The symobject data structure.

Parameters:
symA symbol with which to initialize the new symobject.
Returns:
Pointer to the new symobject instance.