bookloupe/bookloupe.h
author ali <ali@juiblex.co.uk>
Sat Oct 26 18:47:33 2013 +0100 (2013-10-26)
changeset 101 f44c530f80da
parent 97 c45fa3843618
child 102 ff0aa9b1397a
permissions -rw-r--r--
Fix bug #24: Accept alternate form of newline
     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 #define CHAR_LD_QUOTE	  0x201C
    28 #define CHAR_RD_QUOTE	  0x201D
    29 
    30 #define CHAR_IS_SQUOTE(c)	((c)==CHAR_SQUOTE || (c)==CHAR_OPEN_SQUOTE || \
    31 				 (c)==CHAR_LS_QUOTE || (c)==CHAR_RS_QUOTE)
    32 
    33 #define CHAR_IS_DQUOTE(c)	((c)==CHAR_DQUOTE || (c)==CHAR_LD_QUOTE || \
    34 				 (c)==CHAR_RD_QUOTE)
    35 
    36 #define CHAR_IS_APOSTROPHE(c)	((c)==CHAR_SQUOTE || (c)==CHAR_RS_QUOTE)
    37 
    38 /* longest and shortest normal PG line lengths */
    39 #define LONGEST_PG_LINE   75
    40 #define WAY_TOO_LONG      80
    41 #define SHORTEST_PG_LINE  55
    42 
    43 enum {
    44     ECHO_SWITCH,
    45     SQUOTE_SWITCH,
    46     TYPO_SWITCH,
    47     QPARA_SWITCH,
    48     PARANOID_SWITCH,
    49     LINE_END_SWITCH,
    50     OVERVIEW_SWITCH,
    51     STDOUT_SWITCH,
    52     HEADER_SWITCH,
    53     WEB_SWITCH,
    54     VERBOSE_SWITCH,
    55     MARKUP_SWITCH,
    56     USERTYPO_SWITCH,
    57     DP_SWITCH,
    58     SWITNO
    59 };
    60 
    61 enum {
    62     DOS_NEWLINES,
    63     UNIX_NEWLINES,
    64     OS9_NEWLINES,
    65 };
    66 
    67 struct dash_results {
    68     long base,space,non_PG_space,PG_space;
    69 };
    70 
    71 struct first_pass_results {
    72     long firstline,astline;
    73     long footerline,totlen,binlen,alphalen,endquote_count,shortline,dotcomma;
    74     long fslashline,hyphens,longline,verylongline,htmcount,standalone_digit;
    75     long spacedash;
    76     struct dash_results emdash;
    77     int newlines;
    78     int Dutchcount,Frenchcount;
    79 };
    80 
    81 struct warnings {
    82     int shortline,longline,bin,dash,dotcomma,ast,fslash,digit,hyphen;
    83     int endquote,newlines;
    84     gboolean isDutch,isFrench;
    85 };
    86 
    87 struct line_properties {
    88     unsigned int len,blen;
    89     gunichar start;
    90 };
    91 
    92 struct parities {
    93     int dquote,squote;
    94 };
    95 
    96 extern gboolean pswit[SWITNO];
    97 
    98 extern long cnt_quote,cnt_brack,cnt_bin,cnt_odd,cnt_long,cnt_short,cnt_punct;
    99 extern long cnt_dash,cnt_word,cnt_html,cnt_lineend,cnt_spacend,linecnt;
   100 extern long checked_linecnt;
   101 
   102 #endif /* BOOKOUPE_H */