File: setup.c

package info (click to toggle)
ruby-bluecloth 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 884 kB
  • sloc: ansic: 3,489; ruby: 2,506; makefile: 5
file content (47 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* markdown: a C implementation of John Gruber's Markdown markup language.
 *
 * Copyright (C) 2007 David L Parsons.
 * The redistribution terms are provided in the COPYRIGHT file that must
 * be distributed with this source code.
 */
#include "config.h"

#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>

#include "cstring.h"
#include "markdown.h"
#include "amalloc.h"
#include "tags.h"
    
static int need_to_setup = 1;
static int need_to_initrng = 1;

void
mkd_initialize()
{

    if ( need_to_initrng ) {
	need_to_initrng = 0;
	INITRNG(time(0));
    }
    if ( need_to_setup ) {
	need_to_setup = 0;
	mkd_prepare_tags();
    }
}


void
mkd_shlib_destructor()
{
    if ( !need_to_setup ) {
	need_to_setup = 1;
	mkd_deallocate_tags();
    }
}