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. 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

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.
1 t_symobject *item = NULL;
2 long index;
3 t_symbol *textsym;
4 
5 textsym = gensym("something to look for");
6 
7 // search for a symobject with the symbol 'something to look for'
8 index = linklist_findfirst(s_ll_history, (void **)&item, symobject_linklist_match, textsym);
9 if(index == -1){
10  // symobject not found.
11 }
12 else{
13  do something with the symobject, or with the index of the symbobject in the linklist
14 }
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.
  Copyright © 2015, Cycling '74