"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "markdown.h" between
discount-2.2.4.tar.bz2 and discount-2.2.6.tar.bz2

About: Discount is an implementation of the "Markdown" markup language (written in C).

markdown.h  (discount-2.2.4.tar.bz2):markdown.h  (discount-2.2.6.tar.bz2)
#ifndef _MARKDOWN_D #ifndef _MARKDOWN_D
#define _MARKDOWN_D #define _MARKDOWN_D
#include "config.h" #include "config.h"
#include "cstring.h" #include "cstring.h"
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#elif HAVE_STDINT_H
# include <stdint.h>
#endif
/* flags, captured into a named type
*/
typedef DWORD mkd_flag_t;
#define is_flag_set(flags, item) ((flags) & (item))
#define set_flag(flags, item) ((flags) |= (item))
#define clear_flag(flags, item) ((flags) &= ~(item))
/* each input line is read into a Line, which contains the line, /* each input line is read into a Line, which contains the line,
* the offset of the first non-space character [this assumes * the offset of the first non-space character [this assumes
* that all tabs will be expanded to spaces!], and a pointer to * that all tabs will be expanded to spaces!], and a pointer to
* the next line. * the next line.
*/ */
typedef enum { chk_text, chk_code, typedef enum { chk_text, chk_code,
chk_hr, chk_dash, chk_hr, chk_dash,
chk_tilde, chk_backtick, chk_tilde, chk_backtick,
chk_equal } line_type; chk_equal } line_type;
typedef struct line { typedef struct line {
skipping to change at line 86 skipping to change at line 100
typedef STRING(block) Qblock; typedef STRING(block) Qblock;
typedef char* (*mkd_callback_t)(const char*, const int, void*); typedef char* (*mkd_callback_t)(const char*, const int, void*);
typedef void (*mkd_free_t)(char*, void*); typedef void (*mkd_free_t)(char*, void*);
typedef struct callback_data { typedef struct callback_data {
void *e_data; /* private data for callbacks */ void *e_data; /* private data for callbacks */
mkd_callback_t e_url; /* url edit callback */ mkd_callback_t e_url; /* url edit callback */
mkd_callback_t e_flags; /* extra href flags callback */ mkd_callback_t e_flags; /* extra href flags callback */
mkd_callback_t e_anchor; /* callback for anchor types */
mkd_free_t e_free; /* edit/flags callback memory deallocator */ mkd_free_t e_free; /* edit/flags callback memory deallocator */
mkd_callback_t e_codefmt; /* codeblock formatter (for highlighting) */
} Callback_data; } Callback_data;
struct escaped { struct escaped {
char *text; char *text;
struct escaped *up; struct escaped *up;
} ; } ;
struct footnote_list { struct footnote_list {
int reference; int reference;
STRING(Footnote) note; STRING(Footnote) note;
skipping to change at line 111 skipping to change at line 127
*/ */
typedef struct mmiot { typedef struct mmiot {
Cstring out; Cstring out;
Cstring in; Cstring in;
Qblock Q; Qblock Q;
char last; /* last text character added to out */ char last; /* last text character added to out */
int isp; int isp;
struct escaped *esc; struct escaped *esc;
char *ref_prefix; char *ref_prefix;
struct footnote_list *footnotes; struct footnote_list *footnotes;
DWORD flags; mkd_flag_t flags;
#define MKD_NOLINKS 0x00000001 #define MKD_NOLINKS 0x00000001
#define MKD_NOIMAGE 0x00000002 #define MKD_NOIMAGE 0x00000002
#define MKD_NOPANTS 0x00000004 #define MKD_NOPANTS 0x00000004
#define MKD_NOHTML 0x00000008 #define MKD_NOHTML 0x00000008
#define MKD_STRICT 0x00000010 #define MKD_STRICT 0x00000010
#define MKD_TAGTEXT 0x00000020 #define MKD_TAGTEXT 0x00000020
#define MKD_NO_EXT 0x00000040 #define MKD_NO_EXT 0x00000040
#define MKD_CDATA 0x00000080 #define MKD_CDATA 0x00000080
#define MKD_NOSUPERSCRIPT 0x00000100 #define MKD_NOSUPERSCRIPT 0x00000100
#define MKD_NORELAXED 0x00000200 #define MKD_NORELAXED 0x00000200
skipping to change at line 186 skipping to change at line 202
/* /*
* economy FILE-type structure for pulling characters out of a * economy FILE-type structure for pulling characters out of a
* fixed-length string. * fixed-length string.
*/ */
struct string_stream { struct string_stream {
const char *data; /* the unread data */ const char *data; /* the unread data */
int size; /* and how much is there? */ int size; /* and how much is there? */
} ; } ;
extern int mkd_firstnonblank(Line *); extern int mkd_firstnonblank(Line *);
extern int mkd_compile(Document *, DWORD); extern int mkd_compile(Document *, mkd_flag_t);
extern int mkd_document(Document *, char **); extern int mkd_document(Document *, char **);
extern int mkd_generatehtml(Document *, FILE *); extern int mkd_generatehtml(Document *, FILE *);
extern int mkd_css(Document *, char **); extern int mkd_css(Document *, char **);
extern int mkd_generatecss(Document *, FILE *); extern int mkd_generatecss(Document *, FILE *);
#define mkd_style mkd_generatecss #define mkd_style mkd_generatecss
extern int mkd_xml(char *, int , char **); extern int mkd_xml(char *, int , char **);
extern int mkd_generatexml(char *, int, FILE *); extern int mkd_generatexml(char *, int, FILE *);
extern void mkd_cleanup(Document *); extern void mkd_cleanup(Document *);
extern int mkd_line(char *, int, char **, DWORD); extern int mkd_line(char *, int, char **, mkd_flag_t);
extern int mkd_generateline(char *, int, FILE*, DWORD); extern int mkd_generateline(char *, int, FILE*, mkd_flag_t);
#define mkd_text mkd_generateline #define mkd_text mkd_generateline
extern void mkd_basename(Document*, char *); extern void mkd_basename(Document*, char *);
typedef int (*mkd_sta_function_t)(const int,const void*); typedef int (*mkd_sta_function_t)(const int,const void*);
extern void mkd_string_to_anchor(char*,int, mkd_sta_function_t, void*, int, DWOR D); extern void mkd_string_to_anchor(char*,int, mkd_sta_function_t, void*, int, MMIO T *);
extern Document *mkd_in(FILE *, DWORD); extern Document *mkd_in(FILE *, mkd_flag_t);
extern Document *mkd_string(const char*,int, DWORD); extern Document *mkd_string(const char*, int, mkd_flag_t);
extern Document *gfm_in(FILE *, DWORD); extern Document *gfm_in(FILE *, mkd_flag_t);
extern Document *gfm_string(const char*,int, DWORD); extern Document *gfm_string(const char*,int, mkd_flag_t);
extern void mkd_initialize(); extern void mkd_initialize();
extern void mkd_shlib_destructor(); extern void mkd_shlib_destructor();
extern void mkd_ref_prefix(Document*, char*); extern void mkd_ref_prefix(Document*, char*);
/* internal resource handling functions. /* internal resource handling functions.
*/ */
extern void ___mkd_freeLine(Line *); extern void ___mkd_freeLine(Line *);
extern void ___mkd_freeLines(Line *); extern void ___mkd_freeLines(Line *);
extern void ___mkd_freeParagraph(Paragraph *); extern void ___mkd_freeParagraph(Paragraph *);
extern void ___mkd_freefootnote(Footnote *); extern void ___mkd_freefootnote(Footnote *);
extern void ___mkd_freefootnotes(MMIOT *); extern void ___mkd_freefootnotes(MMIOT *);
extern void ___mkd_initmmiot(MMIOT *, void *); extern void ___mkd_initmmiot(MMIOT *, void *);
extern void ___mkd_freemmiot(MMIOT *, void *); extern void ___mkd_freemmiot(MMIOT *, void *);
extern void ___mkd_freeLineRange(Line *, Line *); extern void ___mkd_freeLineRange(Line *, Line *);
extern void ___mkd_xml(char *, int, FILE *); extern void ___mkd_xml(char *, int, FILE *);
extern void ___mkd_reparse(char *, int, int, MMIOT*, char*); extern void ___mkd_reparse(char *, int, mkd_flag_t, MMIOT*, char*);
extern void ___mkd_emblock(MMIOT*); extern void ___mkd_emblock(MMIOT*);
extern void ___mkd_tidy(Cstring *); extern void ___mkd_tidy(Cstring *);
extern Document *__mkd_new_Document(); extern Document *__mkd_new_Document();
extern void __mkd_enqueue(Document*, Cstring *); extern void __mkd_enqueue(Document*, Cstring *);
extern void __mkd_trim_line(Line *, int); extern void __mkd_trim_line(Line *, int);
extern int __mkd_io_strget(struct string_stream *); extern int __mkd_io_strget(struct string_stream *);
/* utility function to do some operation and exit the current function /* utility function to do some operation and exit the current function
 End of changes. 10 change blocks. 
10 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)