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