github.com/256dpi/max-go@v0.7.0/lib/max/ext_atombuf.h (about)

     1  #ifndef _EXT_ATOMBUF_H_
     2  #define _EXT_ATOMBUF_H_
     3  
     4  #include "ext_prefix.h"
     5  #include "ext_mess.h"
     6  
     7  /** The atombuf struct provides a way to pass a collection of atoms.
     8  	@ingroup atombuf
     9  */
    10  typedef struct atombuf {
    11  	long a_argc;			///< the number of atoms
    12  	t_atom a_argv[1];		///< the first of the array of atoms
    13  } t_atombuf;
    14  
    15  // atombuf functions
    16  
    17  BEGIN_USING_C_LINKAGE
    18  
    19  /**
    20  	Use atombuf_new() to create a new Atombuf from an array of t_atoms.
    21  	
    22  	@ingroup atombuf
    23  	@param	argc	Number of t_atoms in the argv array. May be 0.
    24  	@param	argv	Array of t_atoms. If creating an empty Atombuf, you may pass 0.
    25  	@return			atombuf_new() create a new #t_atombuf and returns a pointer to it. 
    26  					If 0 is returned, insufficient memory was available.
    27  */
    28  void *atombuf_new(long argc, t_atom *argv);
    29  
    30  
    31  /**
    32  	Use atombuf_free() to dispose of the memory used by a #t_atombuf.
    33  
    34  	@ingroup atombuf
    35  	@param	x	The #t_atombuf to free.
    36  */
    37  void atombuf_free(t_atombuf *x);
    38  
    39  
    40  /**
    41  	Use atombuf_text() to convert text to a #t_atom array in a #t_atombuf.
    42  	To use this routine to create a new Atombuf from the text buffer, first 
    43  	create a new empty t_atombuf with a call to atombuf_new(0,NULL).
    44  		
    45  	@ingroup atombuf
    46  	@param	x		Pointer to existing atombuf variable. 
    47  					The variable will be replaced by a new Atombuf containing the converted text.
    48  	@param	text	Handle to the text to be converted. It need not be zero-terminated.
    49  	@param	size	Number of characters in the text.
    50  */
    51  void atombuf_text(t_atombuf **x, char **text, long size);
    52  
    53  // undocumented
    54  
    55  short atombuf_totext(t_atombuf *x, char **text, long *size);
    56  long atombuf_count(t_atombuf *x);
    57  void atombuf_set(t_atombuf *x, long start, long num);
    58  long atombuf_replacepoundargs(t_atombuf *x, long argc, t_atom *argv);
    59  short atombuf_next(t_atombuf* x, long* count, t_atom* atom);
    60  void atombuf_replace(t_atombuf** x, t_symbol* s, long ac, t_atom* av);
    61  void atombuf_prepend(t_atombuf** x, t_symbol* s, long ac, t_atom* av);
    62  void atombuf_append(t_atombuf** x, t_symbol* s, long ac, t_atom* av);
    63  void* atombuf_eval(t_atombuf* x, long ac, t_atom* av, t_object* to);
    64  
    65  END_USING_C_LINKAGE
    66  
    67  #endif // #ifndef _EXT_ATOMBUF_H_