~benklop/+junk/lcdproc

« back to all changes in this revision

Viewing changes to shared/LL.h

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Tallon
  • Date: 2006-07-23 20:23:48 UTC
  • mfrom: (3 sarge)
  • mto: (3.1.1 sid) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060723202348-3ngyais3pem8xyrm
Tags: upstream-0.5.0
ImportĀ upstreamĀ versionĀ 0.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
    For errors, the general convention is that "0" means success, and
32
32
    a negative number means failure.  Check LL.c to be sure, though.
33
 
    
 
33
 
34
34
  *******************************************************************
35
35
 
36
36
  To change the data, try this:
73
73
      my_data = (my_data *)LL_Get(list);
74
74
      ... do something to it ...
75
75
    } while(LL_Next(list) == 0);
76
 
  
 
76
 
77
77
  *******************************************************************
78
 
  
 
78
 
79
79
  You can also treat the list like a stack, or a queue.  Just use the
80
80
  following functions:
81
 
  
 
81
 
82
82
    LL_Push()      // Regular stack stuff: add, remove, peek, rotate
83
83
    LL_Pop()
84
84
    LL_Top()
191
191
// Searching...
192
192
void *LL_Find (LinkedList * list, int compare (void *, void *), void *value);
193
193
 
 
194
// Array operation...
 
195
void *LL_GetByIndex (LinkedList * list, int index);  // gets the nth node, 0 being the first
 
196
 
194
197
// Sorts the list...
195
198
int LL_Sort (LinkedList * list, int compare (void *, void *));
196
199