Atombufs

An Atombuf is an alternative to Binbufs for temporary storage of atoms. More...

+ Collaboration diagram for Atombufs:

Data Structures

struct  t_atombuf
 The atombuf struct provides a way to pass a collection of atoms. More...
 

Functions

BEGIN_USING_C_LINKAGE void * atombuf_new (long argc, t_atom *argv)
 Use atombuf_new() to create a new Atombuf from an array of t_atoms. More...
 
void atombuf_free (t_atombuf *x)
 Use atombuf_free() to dispose of the memory used by a t_atombuf. More...
 
void atombuf_text (t_atombuf **x, char **text, long size)
 Use atombuf_text() to convert text to a t_atom array in a t_atombuf. More...
 

Detailed Description

An Atombuf is an alternative to Binbufs for temporary storage of atoms.

Its principal advantage is that the internal structure is publicly available so you can manipulate the atoms in place. The standard Max text objects (message box, object box, comment) use the Atombuf structure to store their text (each word of text is stored as a t_symbol or a number).

Function Documentation

void atombuf_free ( t_atombuf x)

Use atombuf_free() to dispose of the memory used by a t_atombuf.

Parameters
xThe t_atombuf to free.
BEGIN_USING_C_LINKAGE void* atombuf_new ( long  argc,
t_atom argv 
)

Use atombuf_new() to create a new Atombuf from an array of t_atoms.

Parameters
argcNumber of t_atoms in the argv array. May be 0.
argvArray of t_atoms. If creating an empty Atombuf, you may pass 0.
Returns
atombuf_new() create a new t_atombuf and returns a pointer to it. If 0 is returned, insufficient memory was available.
void atombuf_text ( t_atombuf **  x,
char **  text,
long  size 
)

Use atombuf_text() to convert text to a t_atom array in a t_atombuf.

To use this routine to create a new Atombuf from the text buffer, first create a new empty t_atombuf with a call to atombuf_new(0,NULL).

Parameters
xPointer to existing atombuf variable. The variable will be replaced by a new Atombuf containing the converted text.
textHandle to the text to be converted. It need not be zero-terminated.
sizeNumber of characters in the text.
  Copyright © 2015, Cycling '74