summaryrefslogtreecommitdiffstats
path: root/src/LYPrettySrc.h
blob: aa5906346cc8804a5d3df4928e89d96273847be1 (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
 * $LynxId: LYPrettySrc.h,v 1.13 2020/01/21 21:38:33 tom Exp $
 */
#ifndef LYPrettySrc_H
#define LYPrettySrc_H

#ifdef USE_PRETTYSRC

#include <HTMLDTD.h>

#ifdef __cplusplus
extern "C" {
#endif
    extern BOOL psrc_convert_string;

    /*whether HTML_put_string should convert string passed with 
       TRANSLATE_AND_UNESCAPE_TO_STD */
    extern BOOL psrc_view;
    extern BOOLEAN LYpsrc;

/*
 * This is used for tracking down whether the SGML engine was initialized
 * ==TRUE if yes.  It's value is meaningful if psrc_view = TRUE
 */
    extern BOOL sgml_in_psrc_was_initialized;

    extern BOOL psrc_nested_call;	/* this is used when distinguishing whether 

					   the current call is nested or not in HTML.c HTML_{start,end}_element.
					   It ==FALSE if psrc_view==FALSE || sgml_in_psrc_was_initialized==TRUE */

    extern BOOL psrc_first_tag;	/* this is also used in HTML.c to trigger the 

				   1st tag to perform special.
				 */

    extern BOOL mark_htext_as_source;

/* here is a list of lexeme codes. */
    typedef enum {
	HTL_comm = 0,
	HTL_tag,
	HTL_attrib,
	HTL_attrval,
	HTL_abracket,
	HTL_entity,
	HTL_href,
	HTL_entire,
	HTL_badseq,
	HTL_badtag,
	HTL_badattr,
	HTL_sgmlspecial,
	HTL_num_lexemes
    } HTlexeme;

    typedef struct _HT_tagspec {
	struct _HT_tagspec *next;	/* 0 at the last */
#ifdef USE_COLOR_STYLE
	int style;		/* precalculated value of the style */
	char *class_name;
#endif
	/* these will be passed to HTML_start_element */
	HTMLElement element;
	BOOL *present;
	char **value;

	BOOL start;		/* if true, then this starts element, otherwise - ends */
    } HT_tagspec;

    extern char *HTL_tagspecs[HTL_num_lexemes];
    extern HT_tagspec *lexeme_start[HTL_num_lexemes];
    extern HT_tagspec *lexeme_end[HTL_num_lexemes];

    extern int html_src_parse_tagspec(char *ts, HTlexeme lexeme,
				      int checkonly, int isstart);
    extern void HTMLSRC_init_caches(int dont_exit);
    extern void html_src_clean_item(HTlexeme l);
    extern void html_src_clean_data(void);
    extern void html_src_on_lynxcfg_reload(void);

/* these 2 vars tell what kind of transform should be applied to tag names
  and attribute names. 0 - lowercase, 1 - as is, 2 uppercase. */
    extern int tagname_transform;
    extern int attrname_transform;

    extern BOOLEAN psrcview_no_anchor_numbering;

#ifdef __cplusplus
}
#endif
#endif				/* ifdef USE_PRETTYSRC */
#endif				/* LYPrettySrc_H */