bookloupe/bookloupe.h
changeset 94 3f655b1b0d93
child 103 adc06e9e8470
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/bookloupe/bookloupe.h	Sat Sep 21 18:28:40 2013 +0100
     1.3 @@ -0,0 +1,87 @@
     1.4 +#ifndef BOOKLOUPE_H
     1.5 +#define BOOKLOUPE_H
     1.6 +
     1.7 +/* special characters */
     1.8 +#define CHAR_SPACE	  32
     1.9 +#define CHAR_TAB	   9
    1.10 +#define CHAR_LF		  10
    1.11 +#define CHAR_CR		  13
    1.12 +#define CHAR_DQUOTE	  34
    1.13 +#define CHAR_SQUOTE	  39
    1.14 +#define CHAR_OPEN_SQUOTE  96
    1.15 +#define CHAR_TILDE	 126
    1.16 +#define CHAR_ASTERISK	  42
    1.17 +#define CHAR_FORESLASH	  47
    1.18 +#define CHAR_CARAT	  94
    1.19 +
    1.20 +#define CHAR_UNDERSCORE    '_'
    1.21 +#define CHAR_OPEN_CBRACK   '{'
    1.22 +#define CHAR_CLOSE_CBRACK  '}'
    1.23 +#define CHAR_OPEN_RBRACK   '('
    1.24 +#define CHAR_CLOSE_RBRACK  ')'
    1.25 +#define CHAR_OPEN_SBRACK   '['
    1.26 +#define CHAR_CLOSE_SBRACK  ']'
    1.27 +
    1.28 +#define CHAR_LS_QUOTE	  0x2018
    1.29 +#define CHAR_RS_QUOTE	  0x2019
    1.30 +
    1.31 +#define CHAR_IS_SQUOTE(c)	((c)==CHAR_SQUOTE || (c)==CHAR_OPEN_SQUOTE || \
    1.32 +				 (c)==CHAR_LS_QUOTE || (c)==CHAR_RS_QUOTE)
    1.33 +
    1.34 +#define CHAR_IS_APOSTROPHE(c)	((c)==CHAR_SQUOTE || (c)==CHAR_RS_QUOTE)
    1.35 +
    1.36 +#define CHAR_IS_CLOSING_QUOTE(c) \
    1.37 +    ((c)==CHAR_DQUOTE || (c)==CHAR_SQUOTE || (c)==CHAR_RS_QUOTE)
    1.38 +
    1.39 +/* longest and shortest normal PG line lengths */
    1.40 +#define LONGEST_PG_LINE   75
    1.41 +#define WAY_TOO_LONG      80
    1.42 +#define SHORTEST_PG_LINE  55
    1.43 +
    1.44 +enum {
    1.45 +    ECHO_SWITCH,
    1.46 +    SQUOTE_SWITCH,
    1.47 +    TYPO_SWITCH,
    1.48 +    QPARA_SWITCH,
    1.49 +    PARANOID_SWITCH,
    1.50 +    LINE_END_SWITCH,
    1.51 +    OVERVIEW_SWITCH,
    1.52 +    STDOUT_SWITCH,
    1.53 +    HEADER_SWITCH,
    1.54 +    WEB_SWITCH,
    1.55 +    VERBOSE_SWITCH,
    1.56 +    MARKUP_SWITCH,
    1.57 +    USERTYPO_SWITCH,
    1.58 +    DP_SWITCH,
    1.59 +    SWITNO
    1.60 +};
    1.61 +
    1.62 +struct first_pass_results {
    1.63 +    long firstline,astline;
    1.64 +    long footerline,totlen,binlen,alphalen,endquote_count,shortline,dotcomma;
    1.65 +    long fslashline,hyphens,longline,verylongline,htmcount,standalone_digit;
    1.66 +    long spacedash,emdash,space_emdash,non_PG_space_emdash,PG_space_emdash;
    1.67 +    int Dutchcount,Frenchcount;
    1.68 +};
    1.69 +
    1.70 +struct warnings {
    1.71 +    int shortline,longline,bin,dash,dotcomma,ast,fslash,digit,hyphen;
    1.72 +    int endquote;
    1.73 +    gboolean isDutch,isFrench;
    1.74 +};
    1.75 +
    1.76 +struct line_properties {
    1.77 +    unsigned int len,blen;
    1.78 +    gunichar start;
    1.79 +};
    1.80 +
    1.81 +struct parities {
    1.82 +    int dquote,squote;
    1.83 +};
    1.84 +
    1.85 +struct pending {
    1.86 +    char *dquote,*squote,*rbrack,*sbrack,*cbrack,*unders;
    1.87 +    long squot;
    1.88 +};
    1.89 +
    1.90 +#endif /* BOOKOUPE_H */