Git fork

ws.h: move declarations for ws.c functions from cache.h

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Elijah Newren and committed by
Junio C Hamano
64122313 d4ff2072

+40 -28
+1
apply.c
··· 32 32 #include "entry.h" 33 33 #include "setup.h" 34 34 #include "symlinks.h" 35 + #include "ws.h" 35 36 #include "wrapper.h" 36 37 37 38 struct gitdiff_data {
-26
cache.h
··· 603 603 /* diff.c */ 604 604 extern int diff_auto_refresh_index; 605 605 606 - /* 607 - * whitespace rules. 608 - * used by both diff and apply 609 - * last two digits are tab width 610 - */ 611 - #define WS_BLANK_AT_EOL 0100 612 - #define WS_SPACE_BEFORE_TAB 0200 613 - #define WS_INDENT_WITH_NON_TAB 0400 614 - #define WS_CR_AT_EOL 01000 615 - #define WS_BLANK_AT_EOF 02000 616 - #define WS_TAB_IN_INDENT 04000 617 - #define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF) 618 - #define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8) 619 - #define WS_TAB_WIDTH_MASK 077 620 - /* All WS_* -- when extended, adapt diff.c emit_symbol */ 621 - #define WS_RULE_MASK 07777 622 - extern unsigned whitespace_rule_cfg; 623 - unsigned whitespace_rule(struct index_state *, const char *); 624 - unsigned parse_whitespace_rule(const char *); 625 - unsigned ws_check(const char *line, int len, unsigned ws_rule); 626 - void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws); 627 - char *whitespace_error_string(unsigned ws); 628 - void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *); 629 - int ws_blank_line(const char *line, int len); 630 - #define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK) 631 - 632 606 /* ls-files */ 633 607 void overlay_tree_on_index(struct index_state *istate, 634 608 const char *tree_name, const char *prefix);
+1
config.c
··· 35 35 #include "setup.h" 36 36 #include "trace2.h" 37 37 #include "worktree.h" 38 + #include "ws.h" 38 39 #include "wrapper.h" 39 40 #include "write-or-die.h" 40 41
+1
diff.c
··· 41 41 #include "object-name.h" 42 42 #include "setup.h" 43 43 #include "strmap.h" 44 + #include "ws.h" 44 45 #include "wrapper.h" 45 46 46 47 #ifdef NO_FAST_WORKING_DIRECTORY
-1
environment.c
··· 67 67 enum eol core_eol = EOL_UNSET; 68 68 int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN; 69 69 char *check_roundtrip_encoding = "SHIFT-JIS"; 70 - unsigned whitespace_rule_cfg = WS_DEFAULT_RULE; 71 70 enum branch_track git_branch_track = BRANCH_TRACK_REMOTE; 72 71 enum rebase_setup_type autorebase = AUTOREBASE_NEVER; 73 72 enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
+4 -1
ws.c
··· 3 3 * 4 4 * Copyright (c) 2007 Junio C Hamano 5 5 */ 6 - #include "cache.h" 6 + #include "git-compat-util.h" 7 7 #include "attr.h" 8 8 #include "strbuf.h" 9 + #include "ws.h" 10 + 11 + unsigned whitespace_rule_cfg = WS_DEFAULT_RULE; 9 12 10 13 static struct whitespace_rule { 11 14 const char *rule_name;
+33
ws.h
··· 1 + #ifndef WS_H 2 + #define WS_H 3 + 4 + struct index_state; 5 + struct strbuf; 6 + 7 + /* 8 + * whitespace rules. 9 + * used by both diff and apply 10 + * last two digits are tab width 11 + */ 12 + #define WS_BLANK_AT_EOL 0100 13 + #define WS_SPACE_BEFORE_TAB 0200 14 + #define WS_INDENT_WITH_NON_TAB 0400 15 + #define WS_CR_AT_EOL 01000 16 + #define WS_BLANK_AT_EOF 02000 17 + #define WS_TAB_IN_INDENT 04000 18 + #define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF) 19 + #define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8) 20 + #define WS_TAB_WIDTH_MASK 077 21 + /* All WS_* -- when extended, adapt diff.c emit_symbol */ 22 + #define WS_RULE_MASK 07777 23 + extern unsigned whitespace_rule_cfg; 24 + unsigned whitespace_rule(struct index_state *, const char *); 25 + unsigned parse_whitespace_rule(const char *); 26 + unsigned ws_check(const char *line, int len, unsigned ws_rule); 27 + void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws); 28 + char *whitespace_error_string(unsigned ws); 29 + void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *); 30 + int ws_blank_line(const char *line, int len); 31 + #define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK) 32 + 33 + #endif /* WS_H */