bookloupe/bookloupe.h
author ali <ali@juiblex.co.uk>
Mon Sep 23 21:18:27 2013 +0100 (2013-09-23)
changeset 103 adc06e9e8470
parent 94 3f655b1b0d93
child 111 f805130deb6f
child 123 ddb5ddba6ef3
child 136 2f3762ff90d8
permissions -rw-r--r--
Fix bug #12: Balanced square brackets test should recognize multi-line [Illustration] tags
     1 #ifndef BOOKLOUPE_H
     2 #define BOOKLOUPE_H
     3 
     4 /* special characters */
     5 #define CHAR_SPACE	  32
     6 #define CHAR_TAB	   9
     7 #define CHAR_LF		  10
     8 #define CHAR_CR		  13
     9 #define CHAR_DQUOTE	  34
    10 #define CHAR_SQUOTE	  39
    11 #define CHAR_OPEN_SQUOTE  96
    12 #define CHAR_TILDE	 126
    13 #define CHAR_ASTERISK	  42
    14 #define CHAR_FORESLASH	  47
    15 #define CHAR_CARAT	  94
    16 
    17 #define CHAR_UNDERSCORE    '_'
    18 #define CHAR_OPEN_CBRACK   '{'
    19 #define CHAR_CLOSE_CBRACK  '}'
    20 #define CHAR_OPEN_RBRACK   '('
    21 #define CHAR_CLOSE_RBRACK  ')'
    22 #define CHAR_OPEN_SBRACK   '['
    23 #define CHAR_CLOSE_SBRACK  ']'
    24 
    25 #define CHAR_LS_QUOTE	  0x2018
    26 #define CHAR_RS_QUOTE	  0x2019
    27 
    28 #define CHAR_IS_SQUOTE(c)	((c)==CHAR_SQUOTE || (c)==CHAR_OPEN_SQUOTE || \
    29 				 (c)==CHAR_LS_QUOTE || (c)==CHAR_RS_QUOTE)
    30 
    31 #define CHAR_IS_APOSTROPHE(c)	((c)==CHAR_SQUOTE || (c)==CHAR_RS_QUOTE)
    32 
    33 #define CHAR_IS_CLOSING_QUOTE(c) \
    34     ((c)==CHAR_DQUOTE || (c)==CHAR_SQUOTE || (c)==CHAR_RS_QUOTE)
    35 
    36 /* longest and shortest normal PG line lengths */
    37 #define LONGEST_PG_LINE   75
    38 #define WAY_TOO_LONG      80
    39 #define SHORTEST_PG_LINE  55
    40 
    41 enum {
    42     ECHO_SWITCH,
    43     SQUOTE_SWITCH,
    44     TYPO_SWITCH,
    45     QPARA_SWITCH,
    46     PARANOID_SWITCH,
    47     LINE_END_SWITCH,
    48     OVERVIEW_SWITCH,
    49     STDOUT_SWITCH,
    50     HEADER_SWITCH,
    51     WEB_SWITCH,
    52     VERBOSE_SWITCH,
    53     MARKUP_SWITCH,
    54     USERTYPO_SWITCH,
    55     DP_SWITCH,
    56     SWITNO
    57 };
    58 
    59 struct first_pass_results {
    60     long firstline,astline;
    61     long footerline,totlen,binlen,alphalen,endquote_count,shortline,dotcomma;
    62     long fslashline,hyphens,longline,verylongline,htmcount,standalone_digit;
    63     long spacedash,emdash,space_emdash,non_PG_space_emdash,PG_space_emdash;
    64     int Dutchcount,Frenchcount;
    65 };
    66 
    67 struct warnings {
    68     int shortline,longline,bin,dash,dotcomma,ast,fslash,digit,hyphen;
    69     int endquote;
    70     gboolean isDutch,isFrench;
    71 };
    72 
    73 struct line_properties {
    74     unsigned int len,blen;
    75     gunichar start;
    76 };
    77 
    78 struct parities {
    79     int dquote,squote;
    80 };
    81 
    82 extern gboolean pswit[SWITNO];
    83 
    84 extern long cnt_dquot,cnt_squot,cnt_brack,cnt_bin,cnt_odd,cnt_long,cnt_short;
    85 extern long cnt_punct,cnt_dash,cnt_word,cnt_html,cnt_lineend,cnt_spacend;
    86 extern long linecnt,checked_linecnt;
    87 
    88 #endif /* BOOKOUPE_H */