dancer-xml Reference  0.8.2.1
Macros | Functions | Variables
db2html.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <getopt.h>
#include "dancer-xml.h"
#include "config.h"

Macros

#define _GNU_SOURCE
 

Functions

static void clear_counter (int min)
 clear some counter More...
 
static int replace_external_entity (const char *s)
 
static int convert_print (const char *s, int verbatim)
 remove exceeding space, and remove special-chars More...
 
static const char * getatrstring (dxml_element *e, const char *attr)
 
static int get_paratype (dxml_element *b, int verbatim)
 handle para-type ones which can contain PCDATA More...
 
static int get_bookchapter (dxml_element *b, int paraenter)
 Handle chapter and sect*. More...
 
static int maybe_label_start (dxml_element *b)
 Add a label and self-link. More...
 
static void maybe_label_end (int labelt)
 ends a label conditionally. More...
 
static int get_table (dxml_element *b_parent)
 Process table element. More...
 
static int get_itemizedlist (dxml_element *b)
 Process itemized list. More...
 
static int get_bothtypes (dxml_element *b, int inlinetype)
 Something that appears inside the para elements and outside the para elements. More...
 
static int recursebook (dxml_element *b)
 Handle book element, and check for each chapter in the book. More...
 
int main (int argc, char **argv)
 

Variables

int counter_chapter [5] ={0,0,0,0,0}
 chapter counter array More...
 
const int c_chapter = 0
 
const int c_sect1 = 1
 
const int c_sect2 = 2
 
const int c_sect3 = 3
 

Macro Definition Documentation

#define _GNU_SOURCE

Function Documentation

static void clear_counter ( int  min)
static

clear some counter

Parameters
minthe minimum counter number

References counter_chapter.

Referenced by get_bookchapter(), and recursebook().

static int convert_print ( const char *  s,
int  verbatim 
)
static

remove exceeding space, and remove special-chars

Parameters
sThe string to print
verbatimpreserve carriage returns?

References replace_external_entity().

Referenced by get_bookchapter(), get_paratype(), main(), and recursebook().

static int get_bookchapter ( dxml_element b,
int  paraenter 
)
static
static int get_bothtypes ( dxml_element b,
int  inlinetype 
)
static

Something that appears inside the para elements and outside the para elements.

Returns
1 on match.
0 on no-match
Parameters
inlinetype1 if it is inside para

References dxml_element::child, dxml_element::element_name, and get_paratype().

Referenced by get_bookchapter(), and get_paratype().

static int get_itemizedlist ( dxml_element b)
static
static int get_paratype ( dxml_element b,
int  verbatim 
)
static

handle para-type ones which can contain PCDATA

Returns
0 on success
Parameters
verbatimwhether it is in screen env. or not.

References dxml_element::child, convert_print(), dxml_dump_element(), dxml_element::element_name, dxml_element::element_type_pcdata, get_bookchapter(), get_bothtypes(), get_itemizedlist(), getatrstring(), and dxml_element::next.

Referenced by get_bookchapter(), get_bothtypes(), get_table(), and getatrstring().

static int get_table ( dxml_element b_parent)
static
static const char* getatrstring ( dxml_element e,
const char *  attr 
)
static
int main ( int  argc,
char **  argv 
)
static void maybe_label_end ( int  labelt)
static

ends a label conditionally.

Parameters
labeltwhether to require end of label

Referenced by get_bookchapter(), get_table(), and recursebook().

static int maybe_label_start ( dxml_element b)
static

Add a label and self-link.

Needs to be accompanied with maybe_label_end, and the return value of this function needs to be sent there.

Returns
0 on no label
1 if need to terminate the label exists.

References getatrstring().

Referenced by get_bookchapter(), get_table(), and recursebook().

static int recursebook ( dxml_element b)
static
static int replace_external_entity ( const char *  s)
static

Referenced by convert_print().

Variable Documentation

const int c_chapter = 0

Referenced by get_bookchapter(), and recursebook().

const int c_sect1 = 1

Referenced by get_bookchapter().

const int c_sect2 = 2

Referenced by get_bookchapter().

const int c_sect3 = 3

Referenced by get_bookchapter().

int counter_chapter[5] ={0,0,0,0,0}

chapter counter array

Referenced by clear_counter(), get_bookchapter(), and recursebook().