Overview: Linked list

Summary
Overview: Linked list
AboutSome of the libquvi API functions use Linked list.
ExampleBasic example, create a linked list, iterate and release.

About

Some of the libquvi API functions use Linked list.  You can also use the <Linked list API> in your own applications.

Example

Basic example, create a linked list, iterate and release.

quvi_llst_node_t curr = NULL;
quvi_llst_node_t llst = NULL;

quvi_llst_append(&llst, strdup("foo"));
quvi_llst_append(&llst, strdup("bar"));
assert(quvi_llst_size(llst) == 2);

curr = llst;
while (curr)
  {
    chars = (char*) quvi_llst_data(curr);
    assert(s != NULL);
    puts(s);
    curr = quvi_llst_next(curr);
  }

quvi_llst_free(&llst);
assert(llst == NULL);
Close