Linked List Module
+ Collaboration diagram for Linked List Module:

Functions

void * jit_linklist_new (void)
 Constructs instance of t_jit_linklist. More...
 
t_atom_long jit_linklist_getsize (t_jit_linklist *x)
 Retrieves the linked list size. More...
 
void * jit_linklist_getindex (t_jit_linklist *x, long index)
 Retrieves the object at the specified list index. More...
 
t_atom_long jit_linklist_objptr2index (t_jit_linklist *x, void *p)
 Retrieves the list index for an object pointer. More...
 
t_atom_long jit_linklist_makearray (t_jit_linklist *x, void **a, long max)
 Flatten the linked list into an array. More...
 
t_atom_long jit_linklist_insertindex (t_jit_linklist *x, void *o, long index)
 Insert object at specified index. More...
 
t_atom_long jit_linklist_append (t_jit_linklist *x, void *o)
 Append object to the end of the linked list. More...
 
t_atom_long jit_linklist_deleteindex (t_jit_linklist *x, long index)
 Delete object at specified index, freeing the object. More...
 
t_atom_long jit_linklist_chuckindex (t_jit_linklist *x, long index)
 Remove object at specified index, without freeing the object. More...
 
void jit_linklist_clear (t_jit_linklist *x)
 Clears the linked list, freeing all objects in list. More...
 
void jit_linklist_chuck (t_jit_linklist *x)
 Removes all objects from the linked list, without freeing any objects in list. More...
 
void jit_linklist_reverse (t_jit_linklist *x)
 Reverses the order of objects in the linked list. More...
 
void jit_linklist_rotate (t_jit_linklist *x, long i)
 Rotates the order of objects in the linked list, by the specified number of indeces. More...
 
void jit_linklist_shuffle (t_jit_linklist *x)
 Randomizes the order of objects in the linked list. More...
 
void jit_linklist_swap (t_jit_linklist *x, long a, long b)
 Swap list location of the indeces specified. More...
 
void jit_linklist_findfirst (t_jit_linklist *x, void **o, long cmpfn(void *, void *), void *cmpdata)
 Retrieves the first object that satisfies the comparison function. More...
 
void jit_linklist_findall (t_jit_linklist *x, t_jit_linklist **out, long cmpfn(void *, void *), void *cmpdata)
 Retrieves a linked list of all objects that satisfy the comparison function. More...
 
t_atom_long jit_linklist_findcount (t_jit_linklist *x, long cmpfn(void *, void *), void *cmpdata)
 Retrieves the number of objects that satisfy the comparison function. More...
 
void jit_linklist_methodall (t_jit_linklist *x, t_symbol *s,...)
 Calls a method on all objects in linked list. More...
 
void * jit_linklist_methodindex (t_jit_linklist *x, long i, t_symbol *s,...)
 Calls a method on the object at the specified index. More...
 
void jit_linklist_sort (t_jit_linklist *x, long cmpfn(void *, void *))
 Sorts linked list based on the provided comparison function. More...
 

Detailed Description

Function Documentation

t_atom_long jit_linklist_append ( t_jit_linklist x,
void *  o 
)

Append object to the end of the linked list.

Parameters
xt_jit_linklist object pointer
oobject pointer
Returns
new list length, or -1 if unsuccessful
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_append().

Referenced by jit_matrix_op(), max_jit_classex_addattr(), and max_jit_obex_proxy_new().

+ Here is the call graph for this function:

void jit_linklist_chuck ( t_jit_linklist x)

Removes all objects from the linked list, without freeing any objects in list.

To remove all objects from the linked list, freeing the objects, use the jit_linklist_clear method.

Parameters
xt_jit_linklist object pointer
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_chuck().

Referenced by jit_matrix_op(), and jit_object_importattrs().

+ Here is the call graph for this function:

t_atom_long jit_linklist_chuckindex ( t_jit_linklist x,
long  index 
)

Remove object at specified index, without freeing the object.

This method will not free the object. To remove from the linked list and free the object, use the jit_linklist_deleteindex method.

Parameters
xt_jit_linklist object pointer
indexindex to remove (zero based)
Returns
index removed, or -1 if unsuccessful
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_chuckindex().

+ Here is the call graph for this function:

void jit_linklist_clear ( t_jit_linklist x)

Clears the linked list, freeing all objects in list.

To remove all elements from the linked list without freeing the objects, use the jit_linklist_chuck method.

Parameters
xt_jit_linklist object pointer
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_clear().

+ Here is the call graph for this function:

t_atom_long jit_linklist_deleteindex ( t_jit_linklist x,
long  index 
)

Delete object at specified index, freeing the object.

To remove from the linked list without freeing the object, use the jit_linklist_chuckindex method.

Parameters
xt_jit_linklist object pointer
indexindex to delete (zero based)
Returns
index deleted, or -1 if unsuccessful
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_deleteindex().

+ Here is the call graph for this function:

void jit_linklist_findall ( t_jit_linklist x,
t_jit_linklist **  out,
long   cmpfnvoid *, void *,
void *  cmpdata 
)

Retrieves a linked list of all objects that satisfy the comparison function.

Parameters
xt_jit_linklist object pointer
outpointer to linked list containing all objects found found (set to NULL, if not found)
cmpfncomparison function pointer (should returns 1 if object matches data, otherwise 0)
cmpdataopaque data used in comparison function
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_findall().

+ Here is the call graph for this function:

t_atom_long jit_linklist_findcount ( t_jit_linklist x,
long   cmpfnvoid *, void *,
void *  cmpdata 
)

Retrieves the number of objects that satisfy the comparison function.

Parameters
xt_jit_linklist object pointer
cmpfncomparison function pointer (should returns 1 if object matches data, otherwise 0)
cmpdataopaque data used in comparison function
Returns
number object objects that satisfy the comparison function
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_chuck(), linklist_findall(), and linklist_getsize().

+ Here is the call graph for this function:

void jit_linklist_findfirst ( t_jit_linklist x,
void **  o,
long   cmpfnvoid *, void *,
void *  cmpdata 
)

Retrieves the first object that satisfies the comparison function.

Parameters
xt_jit_linklist object pointer
opointer to object pointer found (set to NULL, if not found)
cmpfncomparison function pointer (should returns 1 if object matches data, otherwise 0)
cmpdataopaque data used in comparison function
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_findfirst().

Referenced by max_jit_obex_attr_get(), and max_jit_obex_attr_set().

+ Here is the call graph for this function:

void* jit_linklist_getindex ( t_jit_linklist x,
long  index 
)

Retrieves the object at the specified list index.

Parameters
xt_jit_linklist object pointer
indexlist index ()
Returns
object pointer
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_getindex().

Referenced by jit_object_importattrs().

+ Here is the call graph for this function:

t_atom_long jit_linklist_getsize ( t_jit_linklist x)

Retrieves the linked list size.

Parameters
xt_jit_linklist object pointer
Returns
linked list size
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_getsize().

Referenced by jit_object_importattrs().

+ Here is the call graph for this function:

t_atom_long jit_linklist_insertindex ( t_jit_linklist x,
void *  o,
long  index 
)

Insert object at specified index.

Parameters
xt_jit_linklist object pointer
oobject pointer
indexindex (zero based)
Returns
index inserted at, or -1 if unsuccessful
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_insertindex().

+ Here is the call graph for this function:

t_atom_long jit_linklist_makearray ( t_jit_linklist x,
void **  a,
long  max 
)

Flatten the linked list into an array.

Parameters
xt_jit_linklist object pointer
aarray pointer
maxmaximum array size
Returns
number of object pointers copied into array
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_makearray().

+ Here is the call graph for this function:

void jit_linklist_methodall ( t_jit_linklist x,
t_symbol s,
  ... 
)

Calls a method on all objects in linked list.

Equivalent to calling jit_object_method on the object at each index.

Parameters
xt_jit_linklist object pointer
smethod name
...untyped arguments
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_methodall().

+ Here is the call graph for this function:

void* jit_linklist_methodindex ( t_jit_linklist x,
long  i,
t_symbol s,
  ... 
)

Calls a method on the object at the specified index.

Equivalent to calling jit_object_method on the object.

Parameters
xt_jit_linklist object pointer
iindex
smethod name
...untyped arguments
Returns
method return value
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_methodindex().

+ Here is the call graph for this function:

void* jit_linklist_new ( void  )

Constructs instance of t_jit_linklist.

Returns
t_jit_linklist object pointer
Warning
While exported, it is recommend to use jit_object_new to construct a t_jit_linklist object.

References linklist_new().

Referenced by jit_matrix_op(), max_jit_classex_addattr(), and max_jit_obex_proxy_new().

+ Here is the call graph for this function:

t_atom_long jit_linklist_objptr2index ( t_jit_linklist x,
void *  p 
)

Retrieves the list index for an object pointer.

Parameters
xt_jit_linklist object pointer
pobject pointer
Returns
object's list index (zero based), or -1 if not present
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_objptr2index().

+ Here is the call graph for this function:

void jit_linklist_reverse ( t_jit_linklist x)

Reverses the order of objects in the linked list.

Parameters
xt_jit_linklist object pointer
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_reverse().

+ Here is the call graph for this function:

void jit_linklist_rotate ( t_jit_linklist x,
long  i 
)

Rotates the order of objects in the linked list, by the specified number of indeces.

Parameters
xt_jit_linklist object pointer
irotation index count
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_rotate().

+ Here is the call graph for this function:

void jit_linklist_shuffle ( t_jit_linklist x)

Randomizes the order of objects in the linked list.

Parameters
xt_jit_linklist object pointer
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_shuffle().

+ Here is the call graph for this function:

void jit_linklist_sort ( t_jit_linklist x,
long   cmpfnvoid *, void * 
)

Sorts linked list based on the provided comparison function.

Parameters
xt_jit_linklist object pointer
cmpfncomparison function pointer (returns 0 if a>b, otherwise 1)
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_sort().

+ Here is the call graph for this function:

void jit_linklist_swap ( t_jit_linklist x,
long  a,
long  b 
)

Swap list location of the indeces specified.

Parameters
xt_jit_linklist object pointer
aindex a
bindex b
Warning
While exported, it is recommend to use jit_object_method to call methods on an object when the object may not be an instance of t_jit_linklist, but instead an object that supports some portion of the t_jit_linklist interface. One instance where this is the case is inside of a MOP matrix_calc method, where the arguments can be either an instance of t_jit_linklist, or t_jit_matrix which has a getindex method.

References linklist_swap().

+ Here is the call graph for this function:

  Copyright © 2015, Cycling '74