Sha256: 2303117852800795764a04c24726388405aa5794c26e1cd3ccbabf6c6f805789

Contents?: true

Size: 769 Bytes

Versions: 57

Compression:

Stored size: 769 Bytes

Contents

#include <stdlib.h>

#include "cmark-gfm.h"

cmark_llist *cmark_llist_append(cmark_mem *mem, cmark_llist *head, void *data) {
  cmark_llist *tmp;
  cmark_llist *new_node = (cmark_llist *) mem->calloc(1, sizeof(cmark_llist));

  new_node->data = data;
  new_node->next = NULL;

  if (!head)
    return new_node;

  for (tmp = head; tmp->next; tmp=tmp->next);

  tmp->next = new_node;

  return head;
}

void cmark_llist_free_full(cmark_mem *mem, cmark_llist *head, cmark_free_func free_func) {
  cmark_llist *tmp, *prev;

  for (tmp = head; tmp;) {
    if (free_func)
      free_func(mem, tmp->data);

    prev = tmp;
    tmp = tmp->next;
    mem->free(prev);
  }
}

void cmark_llist_free(cmark_mem *mem, cmark_llist *head) {
  cmark_llist_free_full(mem, head, NULL);
}

Version data entries

57 entries across 57 versions & 5 rubygems

Version Path
commonmarker-0.23.11 ext/commonmarker/linked_list.c
markly-0.12.1 ext/markly/linked_list.c
markly-0.12.0 ext/markly/linked_list.c
markly-0.11.0 ext/markly/linked_list.c
markly-0.10.0 ext/markly/linked_list.c
markly-0.9.1 ext/markly/linked_list.c
commonmarker-0.23.10 ext/commonmarker/linked_list.c
markly-0.9.0 ext/markly/linked_list.c
markly-0.8.1 ext/markly/linked_list.c
markly-0.8.0 ext/markly/linked_list.c
qiita_marker-0.23.9.0 ext/qiita_marker/linked_list.c
commonmarker-0.23.9 ext/commonmarker/linked_list.c
commonmarker-0.23.8 ext/commonmarker/linked_list.c
commonmarker-0.23.7 ext/commonmarker/linked_list.c
qiita_marker-0.23.6.2 ext/qiita_marker/linked_list.c
commonmarker-0.23.7.pre1 ext/commonmarker/linked_list.c
qiita_marker-0.23.6.1 ext/qiita_marker/linked_list.c
qiita_marker-0.23.6.0 ext/qiita_marker/linked_list.c
commonmarker-0.23.6 ext/commonmarker/linked_list.c
qiita_marker-0.23.5.1 ext/qiita_marker/linked_list.c