Sha256: daeeefcb721709b5ae87cd0ef0158a1aa82c963e07b4a316d986f05e0b6a6ee9

Contents?: true

Size: 1008 Bytes

Versions: 96

Compression:

Stored size: 1008 Bytes

Contents

#include <stdlib.h>

#include "plugin.h"

extern cmark_mem CMARK_DEFAULT_MEM_ALLOCATOR;

int cmark_plugin_register_syntax_extension(cmark_plugin    * plugin,
                                        cmark_syntax_extension * extension) {
  plugin->syntax_extensions = cmark_llist_append(&CMARK_DEFAULT_MEM_ALLOCATOR, plugin->syntax_extensions, extension);
  return 1;
}

cmark_plugin *
cmark_plugin_new(void) {
  cmark_plugin *res = (cmark_plugin *) CMARK_DEFAULT_MEM_ALLOCATOR.calloc(1, sizeof(cmark_plugin));

  res->syntax_extensions = NULL;

  return res;
}

void
cmark_plugin_free(cmark_plugin *plugin) {
  cmark_llist_free_full(&CMARK_DEFAULT_MEM_ALLOCATOR,
                        plugin->syntax_extensions,
                        (cmark_free_func) cmark_syntax_extension_free);
  CMARK_DEFAULT_MEM_ALLOCATOR.free(plugin);
}

cmark_llist *
cmark_plugin_steal_syntax_extensions(cmark_plugin *plugin) {
  cmark_llist *res = plugin->syntax_extensions;

  plugin->syntax_extensions = NULL;
  return res;
}

Version data entries

96 entries across 95 versions & 5 rubygems

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