1 /*
2  * $LynxId: LYPrettySrc.h,v 1.13 2020/01/21 21:38:33 tom Exp $
3  */
4 #ifndef LYPrettySrc_H
5 #define LYPrettySrc_H
6 
7 #ifdef USE_PRETTYSRC
8 
9 #include <HTMLDTD.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14     extern BOOL psrc_convert_string;
15 
16     /*whether HTML_put_string should convert string passed with
17        TRANSLATE_AND_UNESCAPE_TO_STD */
18     extern BOOL psrc_view;
19     extern BOOLEAN LYpsrc;
20 
21 /*
22  * This is used for tracking down whether the SGML engine was initialized
23  * ==TRUE if yes.  It's value is meaningful if psrc_view = TRUE
24  */
25     extern BOOL sgml_in_psrc_was_initialized;
26 
27     extern BOOL psrc_nested_call;	/* this is used when distinguishing whether
28 
29 					   the current call is nested or not in HTML.c HTML_{start,end}_element.
30 					   It ==FALSE if psrc_view==FALSE || sgml_in_psrc_was_initialized==TRUE */
31 
32     extern BOOL psrc_first_tag;	/* this is also used in HTML.c to trigger the
33 
34 				   1st tag to perform special.
35 				 */
36 
37     extern BOOL mark_htext_as_source;
38 
39 /* here is a list of lexeme codes. */
40     typedef enum {
41 	HTL_comm = 0,
42 	HTL_tag,
43 	HTL_attrib,
44 	HTL_attrval,
45 	HTL_abracket,
46 	HTL_entity,
47 	HTL_href,
48 	HTL_entire,
49 	HTL_badseq,
50 	HTL_badtag,
51 	HTL_badattr,
52 	HTL_sgmlspecial,
53 	HTL_num_lexemes
54     } HTlexeme;
55 
56     typedef struct _HT_tagspec {
57 	struct _HT_tagspec *next;	/* 0 at the last */
58 #ifdef USE_COLOR_STYLE
59 	int style;		/* precalculated value of the style */
60 	char *class_name;
61 #endif
62 	/* these will be passed to HTML_start_element */
63 	HTMLElement element;
64 	BOOL *present;
65 	char **value;
66 
67 	BOOL start;		/* if true, then this starts element, otherwise - ends */
68     } HT_tagspec;
69 
70     extern char *HTL_tagspecs[HTL_num_lexemes];
71     extern HT_tagspec *lexeme_start[HTL_num_lexemes];
72     extern HT_tagspec *lexeme_end[HTL_num_lexemes];
73 
74     extern int html_src_parse_tagspec(char *ts, HTlexeme lexeme,
75 				      int checkonly, int isstart);
76     extern void HTMLSRC_init_caches(int dont_exit);
77     extern void html_src_clean_item(HTlexeme l);
78     extern void html_src_clean_data(void);
79     extern void html_src_on_lynxcfg_reload(void);
80 
81 /* these 2 vars tell what kind of transform should be applied to tag names
82   and attribute names. 0 - lowercase, 1 - as is, 2 uppercase. */
83     extern int tagname_transform;
84     extern int attrname_transform;
85 
86     extern BOOLEAN psrcview_no_anchor_numbering;
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 #endif				/* ifdef USE_PRETTYSRC */
92 #endif				/* LYPrettySrc_H */
93