Max API  8.0.2
Symbol Object

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

Data Structures

struct  t_symobject
 The symobject data structure. More...
 

Functions

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

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

◆ symobject_linklist_match()

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
}

◆ symobject_new()

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.