Fossil SCM
Merge trunk. Some issues identified by [d4a6d3c1ec] are now improved. (1) is fixed, though clicking/tabbing outside the entry field also triggers a submit which may prove annoying. (2) and (3) are still broken. (4) is better because "With/Without Files" is now a checkbox simply labeled "Files". (5) is closer to being feasible, perhaps if "Tag Filter:" is changed to "Filter:".
Commit
74fe9587f86ea2cb32cbffd87f8d6a2b21d3734c
Parent
9b960af1294ee94…
45 files changed
+2
-2
+2
-2
+2
-2
+2
-2
+4
-2
+4
-2
+4
-2
+4
-2
+4
-2
+2
-2
+2
-2
+4
-4
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+10
-10
+2
-2
+1
-1
+6
-2
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+2
-2
+9
-9
+3
-7
+12
-12
+3
-3
+94
-78
+1
-1
+2
-2
+8
-16
+8
-16
+3
-3
+1
-1
+2
-2
+4
-4
~
skins/black_and_white/css.txt
~
skins/blitz/css.txt
~
skins/blitz_no_logo/css.txt
~
skins/default/css.txt
~
skins/eagle/css.txt
~
skins/enhanced1/css.txt
~
skins/khaki/css.txt
~
skins/original/css.txt
~
skins/plain_gray/css.txt
~
skins/rounded1/css.txt
~
skins/xekri/css.txt
~
src/bisect.c
~
src/branch.c
~
src/builtin.c
~
src/cgi.c
~
src/db.c
~
src/diff.c
~
src/dispatch.c
~
src/doc.c
~
src/file.c
~
src/finfo.c
~
src/fshell.c
~
src/import.c
~
src/info.c
~
src/main.c
~
src/markdown.c
~
src/merge3.c
~
src/moderate.c
~
src/name.c
~
src/printf.c
~
src/regexp.c
~
src/report.c
~
src/search.c
~
src/setup.c
~
src/skins.c
~
src/statrep.c
~
src/style.c
~
src/th_main.c
~
src/th_tcl.c
~
src/timeline.c
~
src/timeline.c
~
src/unicode.c
~
src/vfile.c
~
src/wiki.c
~
src/wikiformat.c
+2
-2
| --- skins/black_and_white/css.txt | ||
| +++ skins/black_and_white/css.txt | ||
| @@ -106,16 +106,16 @@ | ||
| 106 | 106 | border-width:1px 0px; |
| 107 | 107 | background-color: #eee; |
| 108 | 108 | color: #333; |
| 109 | 109 | } |
| 110 | 110 | div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, |
| 111 | -div.sectionmenu>a.button:visited { | |
| 111 | +div.sectionmenu>a.button:visited, div.submenu label { | |
| 112 | 112 | padding: 3px 10px 3px 10px; |
| 113 | 113 | color: #333; |
| 114 | 114 | text-decoration: none; |
| 115 | 115 | } |
| 116 | -div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 116 | +div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { | |
| 117 | 117 | color: #eee; |
| 118 | 118 | background-color: #333; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /* All page content from the bottom of the menu or submenu down to |
| 122 | 122 |
| --- skins/black_and_white/css.txt | |
| +++ skins/black_and_white/css.txt | |
| @@ -106,16 +106,16 @@ | |
| 106 | border-width:1px 0px; |
| 107 | background-color: #eee; |
| 108 | color: #333; |
| 109 | } |
| 110 | div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, |
| 111 | div.sectionmenu>a.button:visited { |
| 112 | padding: 3px 10px 3px 10px; |
| 113 | color: #333; |
| 114 | text-decoration: none; |
| 115 | } |
| 116 | div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 117 | color: #eee; |
| 118 | background-color: #333; |
| 119 | } |
| 120 | |
| 121 | /* All page content from the bottom of the menu or submenu down to |
| 122 |
| --- skins/black_and_white/css.txt | |
| +++ skins/black_and_white/css.txt | |
| @@ -106,16 +106,16 @@ | |
| 106 | border-width:1px 0px; |
| 107 | background-color: #eee; |
| 108 | color: #333; |
| 109 | } |
| 110 | div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, |
| 111 | div.sectionmenu>a.button:visited, div.submenu label { |
| 112 | padding: 3px 10px 3px 10px; |
| 113 | color: #333; |
| 114 | text-decoration: none; |
| 115 | } |
| 116 | div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { |
| 117 | color: #eee; |
| 118 | background-color: #333; |
| 119 | } |
| 120 | |
| 121 | /* All page content from the bottom of the menu or submenu down to |
| 122 |
+2
-2
| --- skins/blitz/css.txt | ||
| +++ skins/blitz/css.txt | ||
| @@ -894,19 +894,19 @@ | ||
| 894 | 894 | |
| 895 | 895 | .submenu input, .submenu select { |
| 896 | 896 | margin: 0 0 0 5px; |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | -.submenu a { | |
| 899 | +.submenu a, .submenu label { | |
| 900 | 900 | color: #3b5c6b; |
| 901 | 901 | padding: 5px 15px; |
| 902 | 902 | text-decoration: none; |
| 903 | 903 | border: 1px solid transparent; |
| 904 | 904 | border-radius: 5px; |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | -.submenu a:hover { | |
| 907 | +.submenu a:hover, .submenu label:hover { | |
| 908 | 908 | border: 1px solid #ccc; |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | |
| 912 | 912 | /* Section |
| 913 | 913 |
| --- skins/blitz/css.txt | |
| +++ skins/blitz/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
| --- skins/blitz/css.txt | |
| +++ skins/blitz/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a, .submenu label { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover, .submenu label:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
+2
-2
| --- skins/blitz_no_logo/css.txt | ||
| +++ skins/blitz_no_logo/css.txt | ||
| @@ -894,19 +894,19 @@ | ||
| 894 | 894 | |
| 895 | 895 | .submenu input, .submenu select { |
| 896 | 896 | margin: 0 0 0 5px; |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | -.submenu a { | |
| 899 | +.submenu a, .submenu label { | |
| 900 | 900 | color: #3b5c6b; |
| 901 | 901 | padding: 5px 15px; |
| 902 | 902 | text-decoration: none; |
| 903 | 903 | border: 1px solid transparent; |
| 904 | 904 | border-radius: 5px; |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | -.submenu a:hover { | |
| 907 | +.submenu a:hover, .submenu label:hover { | |
| 908 | 908 | border: 1px solid #ccc; |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | |
| 912 | 912 | /* Section |
| 913 | 913 |
| --- skins/blitz_no_logo/css.txt | |
| +++ skins/blitz_no_logo/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
| --- skins/blitz_no_logo/css.txt | |
| +++ skins/blitz_no_logo/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a, .submenu label { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover, .submenu label:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
+2
-2
| --- skins/default/css.txt | ||
| +++ skins/default/css.txt | ||
| @@ -104,17 +104,17 @@ | ||
| 104 | 104 | margin-top: 10px; |
| 105 | 105 | padding: 10px; |
| 106 | 106 | border-bottom: 1px solid #ccc; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -.submenu a { | |
| 109 | +.submenu a, .submenu label { | |
| 110 | 110 | padding: 10px 11px; |
| 111 | 111 | text-decoration:none; |
| 112 | 112 | color: #777; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | -.submenu a:hover { | |
| 115 | +.submenu a:hover, .submenu label:hover { | |
| 116 | 116 | padding: 6px 10px; |
| 117 | 117 | border: 1px solid #ccc; |
| 118 | 118 | border-radius: 5px; |
| 119 | 119 | color: #000; |
| 120 | 120 | } |
| 121 | 121 |
| --- skins/default/css.txt | |
| +++ skins/default/css.txt | |
| @@ -104,17 +104,17 @@ | |
| 104 | margin-top: 10px; |
| 105 | padding: 10px; |
| 106 | border-bottom: 1px solid #ccc; |
| 107 | } |
| 108 | |
| 109 | .submenu a { |
| 110 | padding: 10px 11px; |
| 111 | text-decoration:none; |
| 112 | color: #777; |
| 113 | } |
| 114 | |
| 115 | .submenu a:hover { |
| 116 | padding: 6px 10px; |
| 117 | border: 1px solid #ccc; |
| 118 | border-radius: 5px; |
| 119 | color: #000; |
| 120 | } |
| 121 |
| --- skins/default/css.txt | |
| +++ skins/default/css.txt | |
| @@ -104,17 +104,17 @@ | |
| 104 | margin-top: 10px; |
| 105 | padding: 10px; |
| 106 | border-bottom: 1px solid #ccc; |
| 107 | } |
| 108 | |
| 109 | .submenu a, .submenu label { |
| 110 | padding: 10px 11px; |
| 111 | text-decoration:none; |
| 112 | color: #777; |
| 113 | } |
| 114 | |
| 115 | .submenu a:hover, .submenu label:hover { |
| 116 | padding: 6px 10px; |
| 117 | border: 1px solid #ccc; |
| 118 | border-radius: 5px; |
| 119 | color: #000; |
| 120 | } |
| 121 |
+4
-2
| --- skins/eagle/css.txt | ||
| +++ skins/eagle/css.txt | ||
| @@ -73,16 +73,18 @@ | ||
| 73 | 73 | text-align: center; |
| 74 | 74 | background-color: #485D7B; |
| 75 | 75 | color: white; |
| 76 | 76 | } |
| 77 | 77 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 78 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 78 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 79 | +div.submenu label { | |
| 79 | 80 | padding: 3px 10px 3px 10px; |
| 80 | 81 | color: white; |
| 81 | 82 | text-decoration: none; |
| 82 | 83 | } |
| 83 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 84 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 85 | +div.submenu label:hover { | |
| 84 | 86 | text-decoration: underline; |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | /* All page content from the bottom of the menu or submenu down to |
| 88 | 90 | ** the footer */ |
| 89 | 91 |
| --- skins/eagle/css.txt | |
| +++ skins/eagle/css.txt | |
| @@ -73,16 +73,18 @@ | |
| 73 | text-align: center; |
| 74 | background-color: #485D7B; |
| 75 | color: white; |
| 76 | } |
| 77 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 78 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 79 | padding: 3px 10px 3px 10px; |
| 80 | color: white; |
| 81 | text-decoration: none; |
| 82 | } |
| 83 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 84 | text-decoration: underline; |
| 85 | } |
| 86 | |
| 87 | /* All page content from the bottom of the menu or submenu down to |
| 88 | ** the footer */ |
| 89 |
| --- skins/eagle/css.txt | |
| +++ skins/eagle/css.txt | |
| @@ -73,16 +73,18 @@ | |
| 73 | text-align: center; |
| 74 | background-color: #485D7B; |
| 75 | color: white; |
| 76 | } |
| 77 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 78 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 79 | div.submenu label { |
| 80 | padding: 3px 10px 3px 10px; |
| 81 | color: white; |
| 82 | text-decoration: none; |
| 83 | } |
| 84 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 85 | div.submenu label:hover { |
| 86 | text-decoration: underline; |
| 87 | } |
| 88 | |
| 89 | /* All page content from the bottom of the menu or submenu down to |
| 90 | ** the footer */ |
| 91 |
+4
-2
| --- skins/enhanced1/css.txt | ||
| +++ skins/enhanced1/css.txt | ||
| @@ -71,16 +71,18 @@ | ||
| 71 | 71 | text-align: center; |
| 72 | 72 | background-color: #456878; |
| 73 | 73 | color: white; |
| 74 | 74 | } |
| 75 | 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 76 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 77 | +div.submenu label { | |
| 77 | 78 | padding: 3px 10px 3px 10px; |
| 78 | 79 | color: white; |
| 79 | 80 | text-decoration: none; |
| 80 | 81 | } |
| 81 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 82 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 83 | +div.submenu label:hover { | |
| 82 | 84 | color: #558195; |
| 83 | 85 | background-color: white; |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /* All page content from the bottom of the menu or submenu down to |
| 87 | 89 |
| --- skins/enhanced1/css.txt | |
| +++ skins/enhanced1/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 77 | padding: 3px 10px 3px 10px; |
| 78 | color: white; |
| 79 | text-decoration: none; |
| 80 | } |
| 81 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 82 | color: #558195; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
| --- skins/enhanced1/css.txt | |
| +++ skins/enhanced1/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 77 | div.submenu label { |
| 78 | padding: 3px 10px 3px 10px; |
| 79 | color: white; |
| 80 | text-decoration: none; |
| 81 | } |
| 82 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 83 | div.submenu label:hover { |
| 84 | color: #558195; |
| 85 | background-color: white; |
| 86 | } |
| 87 | |
| 88 | /* All page content from the bottom of the menu or submenu down to |
| 89 |
+4
-2
| --- skins/khaki/css.txt | ||
| +++ skins/khaki/css.txt | ||
| @@ -69,16 +69,18 @@ | ||
| 69 | 69 | text-align: center; |
| 70 | 70 | background-color: #c0af58; |
| 71 | 71 | color: white; |
| 72 | 72 | } |
| 73 | 73 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 74 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 74 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 75 | +div.submenu label { | |
| 75 | 76 | padding: 3px 10px 3px 10px; |
| 76 | 77 | color: white; |
| 77 | 78 | text-decoration: none; |
| 78 | 79 | } |
| 79 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 80 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover | |
| 81 | +div.submenu label:hover { | |
| 80 | 82 | color: #a09048; |
| 81 | 83 | background-color: white; |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | /* All page content from the bottom of the menu or submenu down to |
| 85 | 87 |
| --- skins/khaki/css.txt | |
| +++ skins/khaki/css.txt | |
| @@ -69,16 +69,18 @@ | |
| 69 | text-align: center; |
| 70 | background-color: #c0af58; |
| 71 | color: white; |
| 72 | } |
| 73 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 74 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 75 | padding: 3px 10px 3px 10px; |
| 76 | color: white; |
| 77 | text-decoration: none; |
| 78 | } |
| 79 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 80 | color: #a09048; |
| 81 | background-color: white; |
| 82 | } |
| 83 | |
| 84 | /* All page content from the bottom of the menu or submenu down to |
| 85 |
| --- skins/khaki/css.txt | |
| +++ skins/khaki/css.txt | |
| @@ -69,16 +69,18 @@ | |
| 69 | text-align: center; |
| 70 | background-color: #c0af58; |
| 71 | color: white; |
| 72 | } |
| 73 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 74 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 75 | div.submenu label { |
| 76 | padding: 3px 10px 3px 10px; |
| 77 | color: white; |
| 78 | text-decoration: none; |
| 79 | } |
| 80 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover |
| 81 | div.submenu label:hover { |
| 82 | color: #a09048; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
+4
-2
| --- skins/original/css.txt | ||
| +++ skins/original/css.txt | ||
| @@ -71,16 +71,18 @@ | ||
| 71 | 71 | text-align: center; |
| 72 | 72 | background-color: #456878; |
| 73 | 73 | color: white; |
| 74 | 74 | } |
| 75 | 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 76 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 77 | +div.submenu label { | |
| 77 | 78 | padding: 3px 10px 3px 10px; |
| 78 | 79 | color: white; |
| 79 | 80 | text-decoration: none; |
| 80 | 81 | } |
| 81 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 82 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 83 | +div.submenu label:hover { | |
| 82 | 84 | color: #558195; |
| 83 | 85 | background-color: white; |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /* All page content from the bottom of the menu or submenu down to |
| 87 | 89 |
| --- skins/original/css.txt | |
| +++ skins/original/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 77 | padding: 3px 10px 3px 10px; |
| 78 | color: white; |
| 79 | text-decoration: none; |
| 80 | } |
| 81 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 82 | color: #558195; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
| --- skins/original/css.txt | |
| +++ skins/original/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 77 | div.submenu label { |
| 78 | padding: 3px 10px 3px 10px; |
| 79 | color: white; |
| 80 | text-decoration: none; |
| 81 | } |
| 82 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 83 | div.submenu label:hover { |
| 84 | color: #558195; |
| 85 | background-color: white; |
| 86 | } |
| 87 | |
| 88 | /* All page content from the bottom of the menu or submenu down to |
| 89 |
+4
-2
| --- skins/plain_gray/css.txt | ||
| +++ skins/plain_gray/css.txt | ||
| @@ -71,16 +71,18 @@ | ||
| 71 | 71 | text-align: center; |
| 72 | 72 | background-color: #606060; |
| 73 | 73 | color: white; |
| 74 | 74 | } |
| 75 | 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 76 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 77 | +div.submenu label { | |
| 77 | 78 | padding: 3px 10px 3px 10px; |
| 78 | 79 | color: white; |
| 79 | 80 | text-decoration: none; |
| 80 | 81 | } |
| 81 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 82 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 83 | +div.submenu label:hover { | |
| 82 | 84 | color: #404040; |
| 83 | 85 | background-color: white; |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /* All page content from the bottom of the menu or submenu down to |
| 87 | 89 |
| --- skins/plain_gray/css.txt | |
| +++ skins/plain_gray/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #606060; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 77 | padding: 3px 10px 3px 10px; |
| 78 | color: white; |
| 79 | text-decoration: none; |
| 80 | } |
| 81 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 82 | color: #404040; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
| --- skins/plain_gray/css.txt | |
| +++ skins/plain_gray/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #606060; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 77 | div.submenu label { |
| 78 | padding: 3px 10px 3px 10px; |
| 79 | color: white; |
| 80 | text-decoration: none; |
| 81 | } |
| 82 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 83 | div.submenu label:hover { |
| 84 | color: #404040; |
| 85 | background-color: white; |
| 86 | } |
| 87 | |
| 88 | /* All page content from the bottom of the menu or submenu down to |
| 89 |
+2
-2
| --- skins/rounded1/css.txt | ||
| +++ skins/rounded1/css.txt | ||
| @@ -84,11 +84,11 @@ | ||
| 84 | 84 | div.mainmenu a, div.mainmenu a:visited { |
| 85 | 85 | padding: 3px 10px 3px 10px; |
| 86 | 86 | color: white; |
| 87 | 87 | text-decoration: none; |
| 88 | 88 | } |
| 89 | -div.submenu a, div.submenu a:visited, a.button, | |
| 89 | +div.submenu a, div.submenu a:visited, a.button, div.submenu label | |
| 90 | 90 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 91 | 91 | padding: 2px 8px; |
| 92 | 92 | color: #000; |
| 93 | 93 | font-family: Arial; |
| 94 | 94 | text-decoration: none; |
| @@ -102,11 +102,11 @@ | ||
| 102 | 102 | div.mainmenu a:hover { |
| 103 | 103 | color: #000; |
| 104 | 104 | background-color: white; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | -div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 107 | +div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { | |
| 108 | 108 | background-color: #c0c0c0; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /* All page content from the bottom of the menu or submenu down to |
| 112 | 112 | ** the footer */ |
| 113 | 113 |
| --- skins/rounded1/css.txt | |
| +++ skins/rounded1/css.txt | |
| @@ -84,11 +84,11 @@ | |
| 84 | div.mainmenu a, div.mainmenu a:visited { |
| 85 | padding: 3px 10px 3px 10px; |
| 86 | color: white; |
| 87 | text-decoration: none; |
| 88 | } |
| 89 | div.submenu a, div.submenu a:visited, a.button, |
| 90 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 91 | padding: 2px 8px; |
| 92 | color: #000; |
| 93 | font-family: Arial; |
| 94 | text-decoration: none; |
| @@ -102,11 +102,11 @@ | |
| 102 | div.mainmenu a:hover { |
| 103 | color: #000; |
| 104 | background-color: white; |
| 105 | } |
| 106 | |
| 107 | div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 108 | background-color: #c0c0c0; |
| 109 | } |
| 110 | |
| 111 | /* All page content from the bottom of the menu or submenu down to |
| 112 | ** the footer */ |
| 113 |
| --- skins/rounded1/css.txt | |
| +++ skins/rounded1/css.txt | |
| @@ -84,11 +84,11 @@ | |
| 84 | div.mainmenu a, div.mainmenu a:visited { |
| 85 | padding: 3px 10px 3px 10px; |
| 86 | color: white; |
| 87 | text-decoration: none; |
| 88 | } |
| 89 | div.submenu a, div.submenu a:visited, a.button, div.submenu label |
| 90 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 91 | padding: 2px 8px; |
| 92 | color: #000; |
| 93 | font-family: Arial; |
| 94 | text-decoration: none; |
| @@ -102,11 +102,11 @@ | |
| 102 | div.mainmenu a:hover { |
| 103 | color: #000; |
| 104 | background-color: white; |
| 105 | } |
| 106 | |
| 107 | div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { |
| 108 | background-color: #c0c0c0; |
| 109 | } |
| 110 | |
| 111 | /* All page content from the bottom of the menu or submenu down to |
| 112 | ** the footer */ |
| 113 |
+2
-2
| --- skins/xekri/css.txt | ||
| +++ skins/xekri/css.txt | ||
| @@ -158,17 +158,17 @@ | ||
| 158 | 158 | border-top: 1px solid #0a0; |
| 159 | 159 | border-radius: 0; |
| 160 | 160 | display: block; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | -div.mainmenu a, div.submenu a { | |
| 163 | +div.mainmenu a, div.submenu a, div.submenu label { | |
| 164 | 164 | color: #000; |
| 165 | 165 | padding: 0 0.75rem; |
| 166 | 166 | text-decoration: none; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | -div.mainmenu a:hover, div.submenu a:hover { | |
| 169 | +div.mainmenu a:hover, div.submenu a:hover, div.submenu label:hover { | |
| 170 | 170 | color: #fff; |
| 171 | 171 | text-shadow: 0px 0px 6px #0f0; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | div.submenu * { |
| 175 | 175 |
| --- skins/xekri/css.txt | |
| +++ skins/xekri/css.txt | |
| @@ -158,17 +158,17 @@ | |
| 158 | border-top: 1px solid #0a0; |
| 159 | border-radius: 0; |
| 160 | display: block; |
| 161 | } |
| 162 | |
| 163 | div.mainmenu a, div.submenu a { |
| 164 | color: #000; |
| 165 | padding: 0 0.75rem; |
| 166 | text-decoration: none; |
| 167 | } |
| 168 | |
| 169 | div.mainmenu a:hover, div.submenu a:hover { |
| 170 | color: #fff; |
| 171 | text-shadow: 0px 0px 6px #0f0; |
| 172 | } |
| 173 | |
| 174 | div.submenu * { |
| 175 |
| --- skins/xekri/css.txt | |
| +++ skins/xekri/css.txt | |
| @@ -158,17 +158,17 @@ | |
| 158 | border-top: 1px solid #0a0; |
| 159 | border-radius: 0; |
| 160 | display: block; |
| 161 | } |
| 162 | |
| 163 | div.mainmenu a, div.submenu a, div.submenu label { |
| 164 | color: #000; |
| 165 | padding: 0 0.75rem; |
| 166 | text-decoration: none; |
| 167 | } |
| 168 | |
| 169 | div.mainmenu a:hover, div.submenu a:hover, div.submenu label:hover { |
| 170 | color: #fff; |
| 171 | text-shadow: 0px 0px 6px #0f0; |
| 172 | } |
| 173 | |
| 174 | div.submenu * { |
| 175 |
+4
-4
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -75,11 +75,11 @@ | ||
| 75 | 75 | ** Return the value of a boolean bisect option. |
| 76 | 76 | */ |
| 77 | 77 | int bisect_option(const char *zName){ |
| 78 | 78 | unsigned int i; |
| 79 | 79 | int r = -1; |
| 80 | - for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ | |
| 80 | + for(i=0; i<count(aBisectOption); i++){ | |
| 81 | 81 | if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){ |
| 82 | 82 | char *zLabel = mprintf("bisect-%s", zName); |
| 83 | 83 | char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault); |
| 84 | 84 | if( is_truth(z) ) r = 1; |
| 85 | 85 | if( is_false(z) ) r = 0; |
| @@ -406,21 +406,21 @@ | ||
| 406 | 406 | }else if( strncmp(zCmd, "chart", n)==0 ){ |
| 407 | 407 | bisect_chart(1); |
| 408 | 408 | }else if( strncmp(zCmd, "options", n)==0 ){ |
| 409 | 409 | if( g.argc==3 ){ |
| 410 | 410 | unsigned int i; |
| 411 | - for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ | |
| 411 | + for(i=0; i<count(aBisectOption); i++){ | |
| 412 | 412 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 413 | 413 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 414 | 414 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 415 | 415 | fossil_free(z); |
| 416 | 416 | comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags); |
| 417 | 417 | } |
| 418 | 418 | }else if( g.argc==4 || g.argc==5 ){ |
| 419 | 419 | unsigned int i; |
| 420 | 420 | n = strlen(g.argv[3]); |
| 421 | - for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ | |
| 421 | + for(i=0; i<count(aBisectOption); i++){ | |
| 422 | 422 | if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){ |
| 423 | 423 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 424 | 424 | if( g.argc==5 ){ |
| 425 | 425 | db_lset(z, g.argv[4]); |
| 426 | 426 | } |
| @@ -427,11 +427,11 @@ | ||
| 427 | 427 | fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 428 | 428 | fossil_free(z); |
| 429 | 429 | break; |
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | - if( i>=sizeof(aBisectOption)/sizeof(aBisectOption[0]) ){ | |
| 432 | + if( i>=count(aBisectOption) ){ | |
| 433 | 433 | fossil_fatal("no such bisect option: %s", g.argv[3]); |
| 434 | 434 | } |
| 435 | 435 | }else{ |
| 436 | 436 | usage("options ?NAME? ?VALUE?"); |
| 437 | 437 | } |
| 438 | 438 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -75,11 +75,11 @@ | |
| 75 | ** Return the value of a boolean bisect option. |
| 76 | */ |
| 77 | int bisect_option(const char *zName){ |
| 78 | unsigned int i; |
| 79 | int r = -1; |
| 80 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 81 | if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){ |
| 82 | char *zLabel = mprintf("bisect-%s", zName); |
| 83 | char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault); |
| 84 | if( is_truth(z) ) r = 1; |
| 85 | if( is_false(z) ) r = 0; |
| @@ -406,21 +406,21 @@ | |
| 406 | }else if( strncmp(zCmd, "chart", n)==0 ){ |
| 407 | bisect_chart(1); |
| 408 | }else if( strncmp(zCmd, "options", n)==0 ){ |
| 409 | if( g.argc==3 ){ |
| 410 | unsigned int i; |
| 411 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 412 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 413 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 414 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 415 | fossil_free(z); |
| 416 | comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags); |
| 417 | } |
| 418 | }else if( g.argc==4 || g.argc==5 ){ |
| 419 | unsigned int i; |
| 420 | n = strlen(g.argv[3]); |
| 421 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 422 | if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){ |
| 423 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 424 | if( g.argc==5 ){ |
| 425 | db_lset(z, g.argv[4]); |
| 426 | } |
| @@ -427,11 +427,11 @@ | |
| 427 | fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 428 | fossil_free(z); |
| 429 | break; |
| 430 | } |
| 431 | } |
| 432 | if( i>=sizeof(aBisectOption)/sizeof(aBisectOption[0]) ){ |
| 433 | fossil_fatal("no such bisect option: %s", g.argv[3]); |
| 434 | } |
| 435 | }else{ |
| 436 | usage("options ?NAME? ?VALUE?"); |
| 437 | } |
| 438 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -75,11 +75,11 @@ | |
| 75 | ** Return the value of a boolean bisect option. |
| 76 | */ |
| 77 | int bisect_option(const char *zName){ |
| 78 | unsigned int i; |
| 79 | int r = -1; |
| 80 | for(i=0; i<count(aBisectOption); i++){ |
| 81 | if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){ |
| 82 | char *zLabel = mprintf("bisect-%s", zName); |
| 83 | char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault); |
| 84 | if( is_truth(z) ) r = 1; |
| 85 | if( is_false(z) ) r = 0; |
| @@ -406,21 +406,21 @@ | |
| 406 | }else if( strncmp(zCmd, "chart", n)==0 ){ |
| 407 | bisect_chart(1); |
| 408 | }else if( strncmp(zCmd, "options", n)==0 ){ |
| 409 | if( g.argc==3 ){ |
| 410 | unsigned int i; |
| 411 | for(i=0; i<count(aBisectOption); i++){ |
| 412 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 413 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 414 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 415 | fossil_free(z); |
| 416 | comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags); |
| 417 | } |
| 418 | }else if( g.argc==4 || g.argc==5 ){ |
| 419 | unsigned int i; |
| 420 | n = strlen(g.argv[3]); |
| 421 | for(i=0; i<count(aBisectOption); i++){ |
| 422 | if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){ |
| 423 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 424 | if( g.argc==5 ){ |
| 425 | db_lset(z, g.argv[4]); |
| 426 | } |
| @@ -427,11 +427,11 @@ | |
| 427 | fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 428 | fossil_free(z); |
| 429 | break; |
| 430 | } |
| 431 | } |
| 432 | if( i>=count(aBisectOption) ){ |
| 433 | fossil_fatal("no such bisect option: %s", g.argv[3]); |
| 434 | } |
| 435 | }else{ |
| 436 | usage("options ?NAME? ?VALUE?"); |
| 437 | } |
| 438 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -350,11 +350,11 @@ | ||
| 350 | 350 | int show_colors = PB("colors"); |
| 351 | 351 | login_check_credentials(); |
| 352 | 352 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 353 | 353 | style_header("Branches"); |
| 354 | 354 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 355 | - style_submenu_binary("colors", "Color", "B/W", 0); | |
| 355 | + style_submenu_checkbox("colors", "Use Branch Colors", 0); | |
| 356 | 356 | login_anonymous_available(); |
| 357 | 357 | |
| 358 | 358 | db_prepare(&q, brlistQuery/*works-like:""*/); |
| 359 | 359 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 360 | 360 | @ <div class="brlist"><table id="branchlisttable"> |
| 361 | 361 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -350,11 +350,11 @@ | |
| 350 | int show_colors = PB("colors"); |
| 351 | login_check_credentials(); |
| 352 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 353 | style_header("Branches"); |
| 354 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 355 | style_submenu_binary("colors", "Color", "B/W", 0); |
| 356 | login_anonymous_available(); |
| 357 | |
| 358 | db_prepare(&q, brlistQuery/*works-like:""*/); |
| 359 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 360 | @ <div class="brlist"><table id="branchlisttable"> |
| 361 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -350,11 +350,11 @@ | |
| 350 | int show_colors = PB("colors"); |
| 351 | login_check_credentials(); |
| 352 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 353 | style_header("Branches"); |
| 354 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 355 | style_submenu_checkbox("colors", "Use Branch Colors", 0); |
| 356 | login_anonymous_available(); |
| 357 | |
| 358 | db_prepare(&q, brlistQuery/*works-like:""*/); |
| 359 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 360 | @ <div class="brlist"><table id="branchlisttable"> |
| 361 |
+2
-2
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -33,11 +33,11 @@ | ||
| 33 | 33 | ** Return a pointer to built-in content |
| 34 | 34 | */ |
| 35 | 35 | const unsigned char *builtin_file(const char *zFilename, int *piSize){ |
| 36 | 36 | int lwr, upr, i, c; |
| 37 | 37 | lwr = 0; |
| 38 | - upr = sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]) - 1; | |
| 38 | + upr = count(aBuiltinFiles) - 1; | |
| 39 | 39 | while( upr>=lwr ){ |
| 40 | 40 | i = (upr+lwr)/2; |
| 41 | 41 | c = strcmp(aBuiltinFiles[i].zName,zFilename); |
| 42 | 42 | if( c<0 ){ |
| 43 | 43 | lwr = i+1; |
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | ** |
| 61 | 61 | ** List the names and sizes of all built-in resources. |
| 62 | 62 | */ |
| 63 | 63 | void test_builtin_list(void){ |
| 64 | 64 | int i; |
| 65 | - for(i=0; i<sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]); i++){ | |
| 65 | + for(i=0; i<count(aBuiltinFiles); i++){ | |
| 66 | 66 | fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /* |
| 71 | 71 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -33,11 +33,11 @@ | |
| 33 | ** Return a pointer to built-in content |
| 34 | */ |
| 35 | const unsigned char *builtin_file(const char *zFilename, int *piSize){ |
| 36 | int lwr, upr, i, c; |
| 37 | lwr = 0; |
| 38 | upr = sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]) - 1; |
| 39 | while( upr>=lwr ){ |
| 40 | i = (upr+lwr)/2; |
| 41 | c = strcmp(aBuiltinFiles[i].zName,zFilename); |
| 42 | if( c<0 ){ |
| 43 | lwr = i+1; |
| @@ -60,11 +60,11 @@ | |
| 60 | ** |
| 61 | ** List the names and sizes of all built-in resources. |
| 62 | */ |
| 63 | void test_builtin_list(void){ |
| 64 | int i; |
| 65 | for(i=0; i<sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]); i++){ |
| 66 | fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -33,11 +33,11 @@ | |
| 33 | ** Return a pointer to built-in content |
| 34 | */ |
| 35 | const unsigned char *builtin_file(const char *zFilename, int *piSize){ |
| 36 | int lwr, upr, i, c; |
| 37 | lwr = 0; |
| 38 | upr = count(aBuiltinFiles) - 1; |
| 39 | while( upr>=lwr ){ |
| 40 | i = (upr+lwr)/2; |
| 41 | c = strcmp(aBuiltinFiles[i].zName,zFilename); |
| 42 | if( c<0 ){ |
| 43 | lwr = i+1; |
| @@ -60,11 +60,11 @@ | |
| 60 | ** |
| 61 | ** List the names and sizes of all built-in resources. |
| 62 | */ |
| 63 | void test_builtin_list(void){ |
| 64 | int i; |
| 65 | for(i=0; i<count(aBuiltinFiles); i++){ |
| 66 | fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 |
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -719,11 +719,11 @@ | ||
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | zName = 0; |
| 722 | 722 | showBytes = 0; |
| 723 | 723 | }else{ |
| 724 | - nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); | |
| 724 | + nArg = tokenize_line(zLine, count(azArg), azArg); | |
| 725 | 725 | for(i=0; i<nArg; i++){ |
| 726 | 726 | int c = fossil_tolower(azArg[i][0]); |
| 727 | 727 | int n = strlen(azArg[i]); |
| 728 | 728 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 729 | 729 | i++; |
| 730 | 730 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -719,11 +719,11 @@ | |
| 719 | } |
| 720 | } |
| 721 | zName = 0; |
| 722 | showBytes = 0; |
| 723 | }else{ |
| 724 | nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); |
| 725 | for(i=0; i<nArg; i++){ |
| 726 | int c = fossil_tolower(azArg[i][0]); |
| 727 | int n = strlen(azArg[i]); |
| 728 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 729 | i++; |
| 730 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -719,11 +719,11 @@ | |
| 719 | } |
| 720 | } |
| 721 | zName = 0; |
| 722 | showBytes = 0; |
| 723 | }else{ |
| 724 | nArg = tokenize_line(zLine, count(azArg), azArg); |
| 725 | for(i=0; i<nArg; i++){ |
| 726 | int c = fossil_tolower(azArg[i][0]); |
| 727 | int n = strlen(azArg[i]); |
| 728 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 729 | i++; |
| 730 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2799,11 +2799,11 @@ | ||
| 2799 | 2799 | */ |
| 2800 | 2800 | const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2801 | 2801 | int lwr, mid, upr, c; |
| 2802 | 2802 | int n = (int)strlen(zName) + !allowPrefix; |
| 2803 | 2803 | lwr = 0; |
| 2804 | - upr = ArraySize(aSetting)-2; | |
| 2804 | + upr = count(aSetting)-2; | |
| 2805 | 2805 | while( upr>=lwr ){ |
| 2806 | 2806 | mid = (upr+lwr)/2; |
| 2807 | 2807 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2808 | 2808 | if( c<0 ){ |
| 2809 | 2809 | upr = mid - 1; |
| 2810 | 2810 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2799,11 +2799,11 @@ | |
| 2799 | */ |
| 2800 | const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2801 | int lwr, mid, upr, c; |
| 2802 | int n = (int)strlen(zName) + !allowPrefix; |
| 2803 | lwr = 0; |
| 2804 | upr = ArraySize(aSetting)-2; |
| 2805 | while( upr>=lwr ){ |
| 2806 | mid = (upr+lwr)/2; |
| 2807 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2808 | if( c<0 ){ |
| 2809 | upr = mid - 1; |
| 2810 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2799,11 +2799,11 @@ | |
| 2799 | */ |
| 2800 | const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2801 | int lwr, mid, upr, c; |
| 2802 | int n = (int)strlen(zName) + !allowPrefix; |
| 2803 | lwr = 0; |
| 2804 | upr = count(aSetting)-2; |
| 2805 | while( upr>=lwr ){ |
| 2806 | mid = (upr+lwr)/2; |
| 2807 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2808 | if( c<0 ){ |
| 2809 | upr = mid - 1; |
| 2810 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1068,11 +1068,11 @@ | ||
| 1068 | 1068 | if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen); |
| 1069 | 1069 | if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen); |
| 1070 | 1070 | return aM; |
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | - if( nRight < (sizeof(aBuf)/sizeof(aBuf[0]))-1 ){ | |
| 1073 | + if( nRight < count(aBuf)-1 ){ | |
| 1074 | 1074 | pToFree = 0; |
| 1075 | 1075 | a = aBuf; |
| 1076 | 1076 | }else{ |
| 1077 | 1077 | a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) ); |
| 1078 | 1078 | } |
| 1079 | 1079 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1068,11 +1068,11 @@ | |
| 1068 | if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen); |
| 1069 | if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen); |
| 1070 | return aM; |
| 1071 | } |
| 1072 | |
| 1073 | if( nRight < (sizeof(aBuf)/sizeof(aBuf[0]))-1 ){ |
| 1074 | pToFree = 0; |
| 1075 | a = aBuf; |
| 1076 | }else{ |
| 1077 | a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) ); |
| 1078 | } |
| 1079 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1068,11 +1068,11 @@ | |
| 1068 | if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen); |
| 1069 | if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen); |
| 1070 | return aM; |
| 1071 | } |
| 1072 | |
| 1073 | if( nRight < count(aBuf)-1 ){ |
| 1074 | pToFree = 0; |
| 1075 | a = aBuf; |
| 1076 | }else{ |
| 1077 | a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) ); |
| 1078 | } |
| 1079 |
+1
-1
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -69,11 +69,11 @@ | ||
| 69 | 69 | ** The page_index.h file is generated by the mkindex program which scans all |
| 70 | 70 | ** source code files looking for header comments on the functions that |
| 71 | 71 | ** implement command and webpages. |
| 72 | 72 | */ |
| 73 | 73 | #include "page_index.h" |
| 74 | -#define MX_COMMAND (sizeof(aCommand)/sizeof(aCommand[0])) | |
| 74 | +#define MX_COMMAND count(aCommand) | |
| 75 | 75 | |
| 76 | 76 | /* |
| 77 | 77 | ** Given a command or webpage name in zName, find the corresponding CmdOrPage |
| 78 | 78 | ** object and return a pointer to that object in *ppCmd. |
| 79 | 79 | ** |
| 80 | 80 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | ** The page_index.h file is generated by the mkindex program which scans all |
| 70 | ** source code files looking for header comments on the functions that |
| 71 | ** implement command and webpages. |
| 72 | */ |
| 73 | #include "page_index.h" |
| 74 | #define MX_COMMAND (sizeof(aCommand)/sizeof(aCommand[0])) |
| 75 | |
| 76 | /* |
| 77 | ** Given a command or webpage name in zName, find the corresponding CmdOrPage |
| 78 | ** object and return a pointer to that object in *ppCmd. |
| 79 | ** |
| 80 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | ** The page_index.h file is generated by the mkindex program which scans all |
| 70 | ** source code files looking for header comments on the functions that |
| 71 | ** implement command and webpages. |
| 72 | */ |
| 73 | #include "page_index.h" |
| 74 | #define MX_COMMAND count(aCommand) |
| 75 | |
| 76 | /* |
| 77 | ** Given a command or webpage name in zName, find the corresponding CmdOrPage |
| 78 | ** object and return a pointer to that object in *ppCmd. |
| 79 | ** |
| 80 |
+10
-10
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -54,11 +54,11 @@ | ||
| 54 | 54 | if( !looks_like_binary(pBlob) ) { |
| 55 | 55 | return 0; /* Plain text */ |
| 56 | 56 | } |
| 57 | 57 | x = (const unsigned char*)blob_buffer(pBlob); |
| 58 | 58 | n = blob_size(pBlob); |
| 59 | - for(i=0; i<ArraySize(aMime); i++){ | |
| 59 | + for(i=0; i<count(aMime); i++){ | |
| 60 | 60 | if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){ |
| 61 | 61 | return aMime[i].zMimetype; |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | return "unknown/unknown"; |
| @@ -293,11 +293,11 @@ | ||
| 293 | 293 | ** Verify that all entries in the aMime[] table are in sorted order. |
| 294 | 294 | ** Abort with a fatal error if any is out-of-order. |
| 295 | 295 | */ |
| 296 | 296 | static void mimetype_verify(void){ |
| 297 | 297 | int i; |
| 298 | - for(i=1; i<ArraySize(aMime); i++){ | |
| 298 | + for(i=1; i<count(aMime); i++){ | |
| 299 | 299 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 300 | 300 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 301 | 301 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 302 | 302 | } |
| 303 | 303 | } |
| @@ -331,11 +331,11 @@ | ||
| 331 | 331 | len = strlen(z); |
| 332 | 332 | if( len<sizeof(zSuffix)-1 ){ |
| 333 | 333 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 334 | 334 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 335 | 335 | first = 0; |
| 336 | - last = ArraySize(aMime) - 1; | |
| 336 | + last = count(aMime) - 1; | |
| 337 | 337 | while( first<=last ){ |
| 338 | 338 | int c; |
| 339 | 339 | i = (first+last)/2; |
| 340 | 340 | c = fossil_strcmp(zSuffix, aMime[i].zSuffix); |
| 341 | 341 | if( c==0 ) return aMime[i].zMimetype; |
| @@ -384,11 +384,11 @@ | ||
| 384 | 384 | @ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'> |
| 385 | 385 | @ <thead> |
| 386 | 386 | @ <tr><th>Suffix<th>Mimetype |
| 387 | 387 | @ </thead> |
| 388 | 388 | @ <tbody> |
| 389 | - for(i=0; i<ArraySize(aMime); i++){ | |
| 389 | + for(i=0; i<count(aMime); i++){ | |
| 390 | 390 | @ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 391 | 391 | } |
| 392 | 392 | @ </tbody></table> |
| 393 | 393 | output_table_sorting_javascript("mimeTable","tt",1); |
| 394 | 394 | style_footer(); |
| @@ -593,11 +593,11 @@ | ||
| 593 | 593 | login_check_credentials(); |
| 594 | 594 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 595 | 595 | blob_init(&title, 0, 0); |
| 596 | 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | 597 | db_begin_transaction(); |
| 598 | - while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ | |
| 598 | + while( rid==0 && (++nMiss)<=count(azSuffix) ){ | |
| 599 | 599 | zName = P("name"); |
| 600 | 600 | if( isUV ){ |
| 601 | 601 | if( zName==0 ) zName = "index.wiki"; |
| 602 | 602 | i = 0; |
| 603 | 603 | }else{ |
| @@ -606,14 +606,14 @@ | ||
| 606 | 606 | zCheckin = mprintf("%.*s", i, zName); |
| 607 | 607 | if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){ |
| 608 | 608 | zCheckin = "tip"; |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | - if( nMiss==ArraySize(azSuffix) ){ | |
| 611 | + if( nMiss==count(azSuffix) ){ | |
| 612 | 612 | zName = "404.md"; |
| 613 | 613 | }else if( zName[i]==0 ){ |
| 614 | - assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); | |
| 614 | + assert( nMiss>=0 && nMiss<count(azSuffix) ); | |
| 615 | 615 | zName = azSuffix[nMiss]; |
| 616 | 616 | }else if( !isUV ){ |
| 617 | 617 | zName += i; |
| 618 | 618 | } |
| 619 | 619 | while( zName[0]=='/' ){ zName++; } |
| @@ -623,11 +623,11 @@ | ||
| 623 | 623 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 624 | 624 | } |
| 625 | 625 | if( nMiss==0 ) zOrigName = zName; |
| 626 | 626 | if( !file_is_simple_pathname(zName, 1) ){ |
| 627 | 627 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 628 | - assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); | |
| 628 | + assert( nMiss>=0 && nMiss<count(azSuffix) ); | |
| 629 | 629 | zName = mprintf("%s%s", zName, azSuffix[nMiss]); |
| 630 | 630 | if( !file_is_simple_pathname(zName, 1) ){ |
| 631 | 631 | goto doc_not_found; |
| 632 | 632 | } |
| 633 | 633 | }else{ |
| @@ -686,11 +686,11 @@ | ||
| 686 | 686 | Blob tail = BLOB_INITIALIZER; |
| 687 | 687 | markdown_to_html(&filebody, &title, &tail); |
| 688 | 688 | if( blob_size(&title)>0 ){ |
| 689 | 689 | style_header("%s", blob_str(&title)); |
| 690 | 690 | }else{ |
| 691 | - style_header("%s", nMiss>=ArraySize(azSuffix)? | |
| 691 | + style_header("%s", nMiss>=count(azSuffix)? | |
| 692 | 692 | "Not Found" : zDfltTitle); |
| 693 | 693 | } |
| 694 | 694 | convert_href_and_output(&tail); |
| 695 | 695 | style_footer(); |
| 696 | 696 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| @@ -719,11 +719,11 @@ | ||
| 719 | 719 | #endif |
| 720 | 720 | }else{ |
| 721 | 721 | cgi_set_content_type(zMime); |
| 722 | 722 | cgi_set_content(&filebody); |
| 723 | 723 | } |
| 724 | - if( nMiss>=ArraySize(azSuffix) ) cgi_set_status(404, "Not Found"); | |
| 724 | + if( nMiss>=count(azSuffix) ) cgi_set_status(404, "Not Found"); | |
| 725 | 725 | db_end_transaction(0); |
| 726 | 726 | return; |
| 727 | 727 | |
| 728 | 728 | /* Jump here when unable to locate the document */ |
| 729 | 729 | doc_not_found: |
| 730 | 730 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | if( !looks_like_binary(pBlob) ) { |
| 55 | return 0; /* Plain text */ |
| 56 | } |
| 57 | x = (const unsigned char*)blob_buffer(pBlob); |
| 58 | n = blob_size(pBlob); |
| 59 | for(i=0; i<ArraySize(aMime); i++){ |
| 60 | if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){ |
| 61 | return aMime[i].zMimetype; |
| 62 | } |
| 63 | } |
| 64 | return "unknown/unknown"; |
| @@ -293,11 +293,11 @@ | |
| 293 | ** Verify that all entries in the aMime[] table are in sorted order. |
| 294 | ** Abort with a fatal error if any is out-of-order. |
| 295 | */ |
| 296 | static void mimetype_verify(void){ |
| 297 | int i; |
| 298 | for(i=1; i<ArraySize(aMime); i++){ |
| 299 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 300 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 301 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 302 | } |
| 303 | } |
| @@ -331,11 +331,11 @@ | |
| 331 | len = strlen(z); |
| 332 | if( len<sizeof(zSuffix)-1 ){ |
| 333 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 334 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 335 | first = 0; |
| 336 | last = ArraySize(aMime) - 1; |
| 337 | while( first<=last ){ |
| 338 | int c; |
| 339 | i = (first+last)/2; |
| 340 | c = fossil_strcmp(zSuffix, aMime[i].zSuffix); |
| 341 | if( c==0 ) return aMime[i].zMimetype; |
| @@ -384,11 +384,11 @@ | |
| 384 | @ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'> |
| 385 | @ <thead> |
| 386 | @ <tr><th>Suffix<th>Mimetype |
| 387 | @ </thead> |
| 388 | @ <tbody> |
| 389 | for(i=0; i<ArraySize(aMime); i++){ |
| 390 | @ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 391 | } |
| 392 | @ </tbody></table> |
| 393 | output_table_sorting_javascript("mimeTable","tt",1); |
| 394 | style_footer(); |
| @@ -593,11 +593,11 @@ | |
| 593 | login_check_credentials(); |
| 594 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 595 | blob_init(&title, 0, 0); |
| 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | db_begin_transaction(); |
| 598 | while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ |
| 599 | zName = P("name"); |
| 600 | if( isUV ){ |
| 601 | if( zName==0 ) zName = "index.wiki"; |
| 602 | i = 0; |
| 603 | }else{ |
| @@ -606,14 +606,14 @@ | |
| 606 | zCheckin = mprintf("%.*s", i, zName); |
| 607 | if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){ |
| 608 | zCheckin = "tip"; |
| 609 | } |
| 610 | } |
| 611 | if( nMiss==ArraySize(azSuffix) ){ |
| 612 | zName = "404.md"; |
| 613 | }else if( zName[i]==0 ){ |
| 614 | assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); |
| 615 | zName = azSuffix[nMiss]; |
| 616 | }else if( !isUV ){ |
| 617 | zName += i; |
| 618 | } |
| 619 | while( zName[0]=='/' ){ zName++; } |
| @@ -623,11 +623,11 @@ | |
| 623 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 624 | } |
| 625 | if( nMiss==0 ) zOrigName = zName; |
| 626 | if( !file_is_simple_pathname(zName, 1) ){ |
| 627 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 628 | assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); |
| 629 | zName = mprintf("%s%s", zName, azSuffix[nMiss]); |
| 630 | if( !file_is_simple_pathname(zName, 1) ){ |
| 631 | goto doc_not_found; |
| 632 | } |
| 633 | }else{ |
| @@ -686,11 +686,11 @@ | |
| 686 | Blob tail = BLOB_INITIALIZER; |
| 687 | markdown_to_html(&filebody, &title, &tail); |
| 688 | if( blob_size(&title)>0 ){ |
| 689 | style_header("%s", blob_str(&title)); |
| 690 | }else{ |
| 691 | style_header("%s", nMiss>=ArraySize(azSuffix)? |
| 692 | "Not Found" : zDfltTitle); |
| 693 | } |
| 694 | convert_href_and_output(&tail); |
| 695 | style_footer(); |
| 696 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| @@ -719,11 +719,11 @@ | |
| 719 | #endif |
| 720 | }else{ |
| 721 | cgi_set_content_type(zMime); |
| 722 | cgi_set_content(&filebody); |
| 723 | } |
| 724 | if( nMiss>=ArraySize(azSuffix) ) cgi_set_status(404, "Not Found"); |
| 725 | db_end_transaction(0); |
| 726 | return; |
| 727 | |
| 728 | /* Jump here when unable to locate the document */ |
| 729 | doc_not_found: |
| 730 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | if( !looks_like_binary(pBlob) ) { |
| 55 | return 0; /* Plain text */ |
| 56 | } |
| 57 | x = (const unsigned char*)blob_buffer(pBlob); |
| 58 | n = blob_size(pBlob); |
| 59 | for(i=0; i<count(aMime); i++){ |
| 60 | if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){ |
| 61 | return aMime[i].zMimetype; |
| 62 | } |
| 63 | } |
| 64 | return "unknown/unknown"; |
| @@ -293,11 +293,11 @@ | |
| 293 | ** Verify that all entries in the aMime[] table are in sorted order. |
| 294 | ** Abort with a fatal error if any is out-of-order. |
| 295 | */ |
| 296 | static void mimetype_verify(void){ |
| 297 | int i; |
| 298 | for(i=1; i<count(aMime); i++){ |
| 299 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 300 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 301 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 302 | } |
| 303 | } |
| @@ -331,11 +331,11 @@ | |
| 331 | len = strlen(z); |
| 332 | if( len<sizeof(zSuffix)-1 ){ |
| 333 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 334 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 335 | first = 0; |
| 336 | last = count(aMime) - 1; |
| 337 | while( first<=last ){ |
| 338 | int c; |
| 339 | i = (first+last)/2; |
| 340 | c = fossil_strcmp(zSuffix, aMime[i].zSuffix); |
| 341 | if( c==0 ) return aMime[i].zMimetype; |
| @@ -384,11 +384,11 @@ | |
| 384 | @ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'> |
| 385 | @ <thead> |
| 386 | @ <tr><th>Suffix<th>Mimetype |
| 387 | @ </thead> |
| 388 | @ <tbody> |
| 389 | for(i=0; i<count(aMime); i++){ |
| 390 | @ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 391 | } |
| 392 | @ </tbody></table> |
| 393 | output_table_sorting_javascript("mimeTable","tt",1); |
| 394 | style_footer(); |
| @@ -593,11 +593,11 @@ | |
| 593 | login_check_credentials(); |
| 594 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 595 | blob_init(&title, 0, 0); |
| 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | db_begin_transaction(); |
| 598 | while( rid==0 && (++nMiss)<=count(azSuffix) ){ |
| 599 | zName = P("name"); |
| 600 | if( isUV ){ |
| 601 | if( zName==0 ) zName = "index.wiki"; |
| 602 | i = 0; |
| 603 | }else{ |
| @@ -606,14 +606,14 @@ | |
| 606 | zCheckin = mprintf("%.*s", i, zName); |
| 607 | if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){ |
| 608 | zCheckin = "tip"; |
| 609 | } |
| 610 | } |
| 611 | if( nMiss==count(azSuffix) ){ |
| 612 | zName = "404.md"; |
| 613 | }else if( zName[i]==0 ){ |
| 614 | assert( nMiss>=0 && nMiss<count(azSuffix) ); |
| 615 | zName = azSuffix[nMiss]; |
| 616 | }else if( !isUV ){ |
| 617 | zName += i; |
| 618 | } |
| 619 | while( zName[0]=='/' ){ zName++; } |
| @@ -623,11 +623,11 @@ | |
| 623 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 624 | } |
| 625 | if( nMiss==0 ) zOrigName = zName; |
| 626 | if( !file_is_simple_pathname(zName, 1) ){ |
| 627 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 628 | assert( nMiss>=0 && nMiss<count(azSuffix) ); |
| 629 | zName = mprintf("%s%s", zName, azSuffix[nMiss]); |
| 630 | if( !file_is_simple_pathname(zName, 1) ){ |
| 631 | goto doc_not_found; |
| 632 | } |
| 633 | }else{ |
| @@ -686,11 +686,11 @@ | |
| 686 | Blob tail = BLOB_INITIALIZER; |
| 687 | markdown_to_html(&filebody, &title, &tail); |
| 688 | if( blob_size(&title)>0 ){ |
| 689 | style_header("%s", blob_str(&title)); |
| 690 | }else{ |
| 691 | style_header("%s", nMiss>=count(azSuffix)? |
| 692 | "Not Found" : zDfltTitle); |
| 693 | } |
| 694 | convert_href_and_output(&tail); |
| 695 | style_footer(); |
| 696 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| @@ -719,11 +719,11 @@ | |
| 719 | #endif |
| 720 | }else{ |
| 721 | cgi_set_content_type(zMime); |
| 722 | cgi_set_content(&filebody); |
| 723 | } |
| 724 | if( nMiss>=count(azSuffix) ) cgi_set_status(404, "Not Found"); |
| 725 | db_end_transaction(0); |
| 726 | return; |
| 727 | |
| 728 | /* Jump here when unable to locate the document */ |
| 729 | doc_not_found: |
| 730 |
+2
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1290,11 +1290,11 @@ | ||
| 1290 | 1290 | azDirs[1] = fossil_getenv("TEMP"); |
| 1291 | 1291 | azDirs[2] = fossil_getenv("TMP"); |
| 1292 | 1292 | #endif |
| 1293 | 1293 | |
| 1294 | 1294 | |
| 1295 | - for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){ | |
| 1295 | + for(i=0; i<count(azDirs); i++){ | |
| 1296 | 1296 | if( azDirs[i]==0 ) continue; |
| 1297 | 1297 | if( !file_isdir(azDirs[i]) ) continue; |
| 1298 | 1298 | zDir = azDirs[i]; |
| 1299 | 1299 | break; |
| 1300 | 1300 | } |
| @@ -1407,11 +1407,11 @@ | ||
| 1407 | 1407 | const char *file_is_win_reserved(const char *zPath){ |
| 1408 | 1408 | static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 1409 | 1409 | static char zReturn[5]; |
| 1410 | 1410 | int i; |
| 1411 | 1411 | while( zPath[0] ){ |
| 1412 | - for(i=0; i<ArraySize(azRes); i++){ | |
| 1412 | + for(i=0; i<count(azRes); i++){ | |
| 1413 | 1413 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 1414 | 1414 | && ((i>=4 && fossil_isdigit(zPath[3]) |
| 1415 | 1415 | && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0)) |
| 1416 | 1416 | || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0))) |
| 1417 | 1417 | ){ |
| 1418 | 1418 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1290,11 +1290,11 @@ | |
| 1290 | azDirs[1] = fossil_getenv("TEMP"); |
| 1291 | azDirs[2] = fossil_getenv("TMP"); |
| 1292 | #endif |
| 1293 | |
| 1294 | |
| 1295 | for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){ |
| 1296 | if( azDirs[i]==0 ) continue; |
| 1297 | if( !file_isdir(azDirs[i]) ) continue; |
| 1298 | zDir = azDirs[i]; |
| 1299 | break; |
| 1300 | } |
| @@ -1407,11 +1407,11 @@ | |
| 1407 | const char *file_is_win_reserved(const char *zPath){ |
| 1408 | static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 1409 | static char zReturn[5]; |
| 1410 | int i; |
| 1411 | while( zPath[0] ){ |
| 1412 | for(i=0; i<ArraySize(azRes); i++){ |
| 1413 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 1414 | && ((i>=4 && fossil_isdigit(zPath[3]) |
| 1415 | && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0)) |
| 1416 | || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0))) |
| 1417 | ){ |
| 1418 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1290,11 +1290,11 @@ | |
| 1290 | azDirs[1] = fossil_getenv("TEMP"); |
| 1291 | azDirs[2] = fossil_getenv("TMP"); |
| 1292 | #endif |
| 1293 | |
| 1294 | |
| 1295 | for(i=0; i<count(azDirs); i++){ |
| 1296 | if( azDirs[i]==0 ) continue; |
| 1297 | if( !file_isdir(azDirs[i]) ) continue; |
| 1298 | zDir = azDirs[i]; |
| 1299 | break; |
| 1300 | } |
| @@ -1407,11 +1407,11 @@ | |
| 1407 | const char *file_is_win_reserved(const char *zPath){ |
| 1408 | static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 1409 | static char zReturn[5]; |
| 1410 | int i; |
| 1411 | while( zPath[0] ){ |
| 1412 | for(i=0; i<count(azRes); i++){ |
| 1413 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 1414 | && ((i>=4 && fossil_isdigit(zPath[3]) |
| 1415 | && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0)) |
| 1416 | || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0))) |
| 1417 | ){ |
| 1418 |
+1
-1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -454,11 +454,11 @@ | ||
| 454 | 454 | int aParent[GR_MAX_RAIL]; |
| 455 | 455 | |
| 456 | 456 | db_bind_int(&qparent, ":fid", frid); |
| 457 | 457 | db_bind_int(&qparent, ":mid", fmid); |
| 458 | 458 | db_bind_int(&qparent, ":fnid", fnid); |
| 459 | - while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 459 | + while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ | |
| 460 | 460 | aParent[nParent] = db_column_int(&qparent, 0); |
| 461 | 461 | nParent++; |
| 462 | 462 | } |
| 463 | 463 | db_reset(&qparent); |
| 464 | 464 | if( zBr==0 ) zBr = "trunk"; |
| 465 | 465 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -454,11 +454,11 @@ | |
| 454 | int aParent[GR_MAX_RAIL]; |
| 455 | |
| 456 | db_bind_int(&qparent, ":fid", frid); |
| 457 | db_bind_int(&qparent, ":mid", fmid); |
| 458 | db_bind_int(&qparent, ":fnid", fnid); |
| 459 | while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ |
| 460 | aParent[nParent] = db_column_int(&qparent, 0); |
| 461 | nParent++; |
| 462 | } |
| 463 | db_reset(&qparent); |
| 464 | if( zBr==0 ) zBr = "trunk"; |
| 465 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -454,11 +454,11 @@ | |
| 454 | int aParent[GR_MAX_RAIL]; |
| 455 | |
| 456 | db_bind_int(&qparent, ":fid", frid); |
| 457 | db_bind_int(&qparent, ":mid", fmid); |
| 458 | db_bind_int(&qparent, ":fnid", fnid); |
| 459 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 460 | aParent[nParent] = db_column_int(&qparent, 0); |
| 461 | nParent++; |
| 462 | } |
| 463 | db_reset(&qparent); |
| 464 | if( zBr==0 ) zBr = "trunk"; |
| 465 |
+6
-2
| --- src/fshell.c | ||
| +++ src/fshell.c | ||
| @@ -25,10 +25,11 @@ | ||
| 25 | 25 | ** It allows multiple commands to be issued without having to reenter the |
| 26 | 26 | ** crypto phasephrase for each command. |
| 27 | 27 | */ |
| 28 | 28 | #include "config.h" |
| 29 | 29 | #include "fshell.h" |
| 30 | +#include "linenoise.h" | |
| 30 | 31 | #include <ctype.h> |
| 31 | 32 | |
| 32 | 33 | #ifndef _WIN32 |
| 33 | 34 | #include <sys/types.h> |
| 34 | 35 | #include <sys/wait.h> |
| @@ -55,16 +56,19 @@ | ||
| 55 | 56 | int mxArg = 0; |
| 56 | 57 | int n, i; |
| 57 | 58 | char **azArg = 0; |
| 58 | 59 | int fDebug; |
| 59 | 60 | pid_t childPid; |
| 60 | - char zLine[10000]; | |
| 61 | + char *zLine = 0; | |
| 61 | 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 62 | 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 63 | 64 | db_close(0); |
| 64 | 65 | sqlite3_shutdown(); |
| 65 | - while( printf("fossil> "),fflush(stdout),fgets(zLine, sizeof(zLine), stdin) ){ | |
| 66 | + while( (free(zLine), zLine = linenoise("fossil> ")) ){ | |
| 67 | + /* Remember shell history within the current session */ | |
| 68 | + linenoiseHistoryAdd(zLine); | |
| 69 | + | |
| 66 | 70 | /* Parse the line of input */ |
| 67 | 71 | n = (int)strlen(zLine); |
| 68 | 72 | for(i=0, nArg=1; i<n; i++){ |
| 69 | 73 | while( fossil_isspace(zLine[i]) ){ i++; } |
| 70 | 74 | if( i>=n ) break; |
| 71 | 75 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -25,10 +25,11 @@ | |
| 25 | ** It allows multiple commands to be issued without having to reenter the |
| 26 | ** crypto phasephrase for each command. |
| 27 | */ |
| 28 | #include "config.h" |
| 29 | #include "fshell.h" |
| 30 | #include <ctype.h> |
| 31 | |
| 32 | #ifndef _WIN32 |
| 33 | #include <sys/types.h> |
| 34 | #include <sys/wait.h> |
| @@ -55,16 +56,19 @@ | |
| 55 | int mxArg = 0; |
| 56 | int n, i; |
| 57 | char **azArg = 0; |
| 58 | int fDebug; |
| 59 | pid_t childPid; |
| 60 | char zLine[10000]; |
| 61 | fDebug = find_option("debug", 0, 0)!=0; |
| 62 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 63 | db_close(0); |
| 64 | sqlite3_shutdown(); |
| 65 | while( printf("fossil> "),fflush(stdout),fgets(zLine, sizeof(zLine), stdin) ){ |
| 66 | /* Parse the line of input */ |
| 67 | n = (int)strlen(zLine); |
| 68 | for(i=0, nArg=1; i<n; i++){ |
| 69 | while( fossil_isspace(zLine[i]) ){ i++; } |
| 70 | if( i>=n ) break; |
| 71 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -25,10 +25,11 @@ | |
| 25 | ** It allows multiple commands to be issued without having to reenter the |
| 26 | ** crypto phasephrase for each command. |
| 27 | */ |
| 28 | #include "config.h" |
| 29 | #include "fshell.h" |
| 30 | #include "linenoise.h" |
| 31 | #include <ctype.h> |
| 32 | |
| 33 | #ifndef _WIN32 |
| 34 | #include <sys/types.h> |
| 35 | #include <sys/wait.h> |
| @@ -55,16 +56,19 @@ | |
| 56 | int mxArg = 0; |
| 57 | int n, i; |
| 58 | char **azArg = 0; |
| 59 | int fDebug; |
| 60 | pid_t childPid; |
| 61 | char *zLine = 0; |
| 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 64 | db_close(0); |
| 65 | sqlite3_shutdown(); |
| 66 | while( (free(zLine), zLine = linenoise("fossil> ")) ){ |
| 67 | /* Remember shell history within the current session */ |
| 68 | linenoiseHistoryAdd(zLine); |
| 69 | |
| 70 | /* Parse the line of input */ |
| 71 | n = (int)strlen(zLine); |
| 72 | for(i=0, nArg=1; i<n; i++){ |
| 73 | while( fossil_isspace(zLine[i]) ){ i++; } |
| 74 | if( i>=n ) break; |
| 75 |
+1
-1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1612,11 +1612,11 @@ | ||
| 1612 | 1612 | {"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3}, |
| 1613 | 1613 | {"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3}, |
| 1614 | 1614 | {"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2}, |
| 1615 | 1615 | }, *renOpt = renOpts; |
| 1616 | 1616 | int i; |
| 1617 | - for( i = 0; i < sizeof(renOpts) / sizeof(*renOpts); ++i, ++renOpt ){ | |
| 1617 | + for( i = 0; i < count(renOpts); ++i, ++renOpt ){ | |
| 1618 | 1618 | if( 1 << svnFlag & renOpt->format ){ |
| 1619 | 1619 | const char *zArgument = find_option(renOpt->zOpt, 0, 1); |
| 1620 | 1620 | if( zArgument ){ |
| 1621 | 1621 | const char *sep = strchr(zArgument, '%'); |
| 1622 | 1622 | if( !sep ){ |
| 1623 | 1623 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1612,11 +1612,11 @@ | |
| 1612 | {"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3}, |
| 1613 | {"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3}, |
| 1614 | {"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2}, |
| 1615 | }, *renOpt = renOpts; |
| 1616 | int i; |
| 1617 | for( i = 0; i < sizeof(renOpts) / sizeof(*renOpts); ++i, ++renOpt ){ |
| 1618 | if( 1 << svnFlag & renOpt->format ){ |
| 1619 | const char *zArgument = find_option(renOpt->zOpt, 0, 1); |
| 1620 | if( zArgument ){ |
| 1621 | const char *sep = strchr(zArgument, '%'); |
| 1622 | if( !sep ){ |
| 1623 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1612,11 +1612,11 @@ | |
| 1612 | {"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3}, |
| 1613 | {"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3}, |
| 1614 | {"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2}, |
| 1615 | }, *renOpt = renOpts; |
| 1616 | int i; |
| 1617 | for( i = 0; i < count(renOpts); ++i, ++renOpt ){ |
| 1618 | if( 1 << svnFlag & renOpt->format ){ |
| 1619 | const char *zArgument = find_option(renOpt->zOpt, 0, 1); |
| 1620 | if( zArgument ){ |
| 1621 | const char *sep = strchr(zArgument, '%'); |
| 1622 | if( !sep ){ |
| 1623 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2248,11 +2248,11 @@ | ||
| 2248 | 2248 | { "#91d680", 0 }, |
| 2249 | 2249 | |
| 2250 | 2250 | |
| 2251 | 2251 | { "custom", "##" }, |
| 2252 | 2252 | }; |
| 2253 | - int nColor = sizeof(aColor)/sizeof(aColor[0])-1; | |
| 2253 | + int nColor = count(aColor)-1; | |
| 2254 | 2254 | int stdClrFound = 0; |
| 2255 | 2255 | int i; |
| 2256 | 2256 | |
| 2257 | 2257 | if( zIdPropagate ){ |
| 2258 | 2258 | @ <div><label> |
| 2259 | 2259 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2248,11 +2248,11 @@ | |
| 2248 | { "#91d680", 0 }, |
| 2249 | |
| 2250 | |
| 2251 | { "custom", "##" }, |
| 2252 | }; |
| 2253 | int nColor = sizeof(aColor)/sizeof(aColor[0])-1; |
| 2254 | int stdClrFound = 0; |
| 2255 | int i; |
| 2256 | |
| 2257 | if( zIdPropagate ){ |
| 2258 | @ <div><label> |
| 2259 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2248,11 +2248,11 @@ | |
| 2248 | { "#91d680", 0 }, |
| 2249 | |
| 2250 | |
| 2251 | { "custom", "##" }, |
| 2252 | }; |
| 2253 | int nColor = count(aColor)-1; |
| 2254 | int stdClrFound = 0; |
| 2255 | int i; |
| 2256 | |
| 2257 | if( zIdPropagate ){ |
| 2258 | @ <div><label> |
| 2259 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2350,11 +2350,11 @@ | ||
| 2350 | 2350 | if( zBrowser==0 ){ |
| 2351 | 2351 | static const char *const azBrowserProg[] = |
| 2352 | 2352 | { "xdg-open", "gnome-open", "firefox", "google-chrome" }; |
| 2353 | 2353 | int i; |
| 2354 | 2354 | zBrowser = "echo"; |
| 2355 | - for(i=0; i<sizeof(azBrowserProg)/sizeof(azBrowserProg[0]); i++){ | |
| 2355 | + for(i=0; i<count(azBrowserProg); i++){ | |
| 2356 | 2356 | if( binaryOnPath(azBrowserProg[i]) ){ |
| 2357 | 2357 | zBrowser = azBrowserProg[i]; |
| 2358 | 2358 | break; |
| 2359 | 2359 | } |
| 2360 | 2360 | } |
| 2361 | 2361 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2350,11 +2350,11 @@ | |
| 2350 | if( zBrowser==0 ){ |
| 2351 | static const char *const azBrowserProg[] = |
| 2352 | { "xdg-open", "gnome-open", "firefox", "google-chrome" }; |
| 2353 | int i; |
| 2354 | zBrowser = "echo"; |
| 2355 | for(i=0; i<sizeof(azBrowserProg)/sizeof(azBrowserProg[0]); i++){ |
| 2356 | if( binaryOnPath(azBrowserProg[i]) ){ |
| 2357 | zBrowser = azBrowserProg[i]; |
| 2358 | break; |
| 2359 | } |
| 2360 | } |
| 2361 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2350,11 +2350,11 @@ | |
| 2350 | if( zBrowser==0 ){ |
| 2351 | static const char *const azBrowserProg[] = |
| 2352 | { "xdg-open", "gnome-open", "firefox", "google-chrome" }; |
| 2353 | int i; |
| 2354 | zBrowser = "echo"; |
| 2355 | for(i=0; i<count(azBrowserProg); i++){ |
| 2356 | if( binaryOnPath(azBrowserProg[i]) ){ |
| 2357 | zBrowser = azBrowserProg[i]; |
| 2358 | break; |
| 2359 | } |
| 2360 | } |
| 2361 |
+1
-1
| --- src/markdown.c | ||
| +++ src/markdown.c | ||
| @@ -295,11 +295,11 @@ | ||
| 295 | 295 | /* binary search of the tag */ |
| 296 | 296 | key.text = data; |
| 297 | 297 | key.size = i; |
| 298 | 298 | return bsearch(&key, |
| 299 | 299 | block_tags, |
| 300 | - (sizeof block_tags)/(sizeof block_tags[0]), | |
| 300 | + count(block_tags), | |
| 301 | 301 | sizeof block_tags[0], |
| 302 | 302 | cmp_html_tag); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| 306 | 306 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -295,11 +295,11 @@ | |
| 295 | /* binary search of the tag */ |
| 296 | key.text = data; |
| 297 | key.size = i; |
| 298 | return bsearch(&key, |
| 299 | block_tags, |
| 300 | (sizeof block_tags)/(sizeof block_tags[0]), |
| 301 | sizeof block_tags[0], |
| 302 | cmp_html_tag); |
| 303 | } |
| 304 | |
| 305 | |
| 306 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -295,11 +295,11 @@ | |
| 295 | /* binary search of the tag */ |
| 296 | key.text = data; |
| 297 | key.size = i; |
| 298 | return bsearch(&key, |
| 299 | block_tags, |
| 300 | count(block_tags), |
| 301 | sizeof block_tags[0], |
| 302 | cmp_html_tag); |
| 303 | } |
| 304 | |
| 305 | |
| 306 |
+1
-1
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -316,11 +316,11 @@ | ||
| 316 | 316 | const char *z = blob_buffer(p); |
| 317 | 317 | int n = blob_size(p) - len + 1; |
| 318 | 318 | assert( len==(int)strlen(mergeMarker[1]) ); |
| 319 | 319 | assert( len==(int)strlen(mergeMarker[2]) ); |
| 320 | 320 | assert( len==(int)strlen(mergeMarker[3]) ); |
| 321 | - assert( sizeof(mergeMarker)/sizeof(mergeMarker[0])==4 ); | |
| 321 | + assert( count(mergeMarker)==4 ); | |
| 322 | 322 | for(i=0; i<n; ){ |
| 323 | 323 | for(j=0; j<4; j++){ |
| 324 | 324 | if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1; |
| 325 | 325 | } |
| 326 | 326 | while( i<n && z[i]!='\n' ){ i++; } |
| 327 | 327 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -316,11 +316,11 @@ | |
| 316 | const char *z = blob_buffer(p); |
| 317 | int n = blob_size(p) - len + 1; |
| 318 | assert( len==(int)strlen(mergeMarker[1]) ); |
| 319 | assert( len==(int)strlen(mergeMarker[2]) ); |
| 320 | assert( len==(int)strlen(mergeMarker[3]) ); |
| 321 | assert( sizeof(mergeMarker)/sizeof(mergeMarker[0])==4 ); |
| 322 | for(i=0; i<n; ){ |
| 323 | for(j=0; j<4; j++){ |
| 324 | if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1; |
| 325 | } |
| 326 | while( i<n && z[i]!='\n' ){ i++; } |
| 327 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -316,11 +316,11 @@ | |
| 316 | const char *z = blob_buffer(p); |
| 317 | int n = blob_size(p) - len + 1; |
| 318 | assert( len==(int)strlen(mergeMarker[1]) ); |
| 319 | assert( len==(int)strlen(mergeMarker[2]) ); |
| 320 | assert( len==(int)strlen(mergeMarker[3]) ); |
| 321 | assert( count(mergeMarker)==4 ); |
| 322 | for(i=0; i<n; ){ |
| 323 | for(j=0; j<4; j++){ |
| 324 | if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1; |
| 325 | } |
| 326 | while( i<n && z[i]!='\n' ){ i++; } |
| 327 |
+1
-1
| --- src/moderate.c | ||
| +++ src/moderate.c | ||
| @@ -67,11 +67,11 @@ | ||
| 67 | 67 | "mlink", "fid", |
| 68 | 68 | "tagxref", "srcid", |
| 69 | 69 | "tagxref", "rid", |
| 70 | 70 | }; |
| 71 | 71 | int i; |
| 72 | - for(i=0; i<sizeof(aTabField)/sizeof(aTabField[0]); i+=2){ | |
| 72 | + for(i=0; i<count(aTabField); i+=2){ | |
| 73 | 73 | if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d", |
| 74 | 74 | aTabField[i], aTabField[i+1], rid) ) return 1; |
| 75 | 75 | } |
| 76 | 76 | return 0; |
| 77 | 77 | } |
| 78 | 78 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -67,11 +67,11 @@ | |
| 67 | "mlink", "fid", |
| 68 | "tagxref", "srcid", |
| 69 | "tagxref", "rid", |
| 70 | }; |
| 71 | int i; |
| 72 | for(i=0; i<sizeof(aTabField)/sizeof(aTabField[0]); i+=2){ |
| 73 | if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d", |
| 74 | aTabField[i], aTabField[i+1], rid) ) return 1; |
| 75 | } |
| 76 | return 0; |
| 77 | } |
| 78 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -67,11 +67,11 @@ | |
| 67 | "mlink", "fid", |
| 68 | "tagxref", "srcid", |
| 69 | "tagxref", "rid", |
| 70 | }; |
| 71 | int i; |
| 72 | for(i=0; i<count(aTabField); i+=2){ |
| 73 | if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d", |
| 74 | aTabField[i], aTabField[i+1], rid) ) return 1; |
| 75 | } |
| 76 | return 0; |
| 77 | } |
| 78 |
+1
-1
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -1204,11 +1204,11 @@ | ||
| 1204 | 1204 | char *zId = aCollide[i].azHit[j]; |
| 1205 | 1205 | if( zId==0 ) continue; |
| 1206 | 1206 | @ %z(href("%R/whatis/%s",zId))%h(zId)</a> |
| 1207 | 1207 | } |
| 1208 | 1208 | } |
| 1209 | - for(i=4; i<ArraySize(aCollide); i++){ | |
| 1209 | + for(i=4; i<count(aCollide); i++){ | |
| 1210 | 1210 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1211 | 1211 | fossil_free(aCollide[i].azHit[j]); |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1204,11 +1204,11 @@ | |
| 1204 | char *zId = aCollide[i].azHit[j]; |
| 1205 | if( zId==0 ) continue; |
| 1206 | @ %z(href("%R/whatis/%s",zId))%h(zId)</a> |
| 1207 | } |
| 1208 | } |
| 1209 | for(i=4; i<ArraySize(aCollide); i++){ |
| 1210 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1211 | fossil_free(aCollide[i].azHit[j]); |
| 1212 | } |
| 1213 | } |
| 1214 | } |
| 1215 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1204,11 +1204,11 @@ | |
| 1204 | char *zId = aCollide[i].azHit[j]; |
| 1205 | if( zId==0 ) continue; |
| 1206 | @ %z(href("%R/whatis/%s",zId))%h(zId)</a> |
| 1207 | } |
| 1208 | } |
| 1209 | for(i=4; i<count(aCollide); i++){ |
| 1210 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1211 | fossil_free(aCollide[i].azHit[j]); |
| 1212 | } |
| 1213 | } |
| 1214 | } |
| 1215 |
+2
-2
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | { 'n', 0, 0, etSIZE, 0, 0 }, |
| 159 | 159 | { '%', 0, 0, etPERCENT, 0, 0 }, |
| 160 | 160 | { 'p', 16, 0, etPOINTER, 0, 1 }, |
| 161 | 161 | { '/', 0, 0, etPATH, 0, 0 }, |
| 162 | 162 | }; |
| 163 | -#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) | |
| 163 | +#define etNINFO count(fmtinfo) | |
| 164 | 164 | |
| 165 | 165 | /* |
| 166 | 166 | ** "*val" is a double such that 0.1 <= *val < 10.0 |
| 167 | 167 | ** Return the ascii code for the leading digit of *val, then |
| 168 | 168 | ** multiply "*val" by 10.0 to renormalize. |
| @@ -970,11 +970,11 @@ | ||
| 970 | 970 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 971 | 971 | va_start(ap, zFormat); |
| 972 | 972 | vfprintf(out, zFormat, ap); |
| 973 | 973 | fprintf(out, "\n"); |
| 974 | 974 | va_end(ap); |
| 975 | - for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){ | |
| 975 | + for(i=0; i<count(azEnv); i++){ | |
| 976 | 976 | char *p; |
| 977 | 977 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 978 | 978 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 979 | 979 | fossil_path_free(p); |
| 980 | 980 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 981 | 981 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -158,11 +158,11 @@ | |
| 158 | { 'n', 0, 0, etSIZE, 0, 0 }, |
| 159 | { '%', 0, 0, etPERCENT, 0, 0 }, |
| 160 | { 'p', 16, 0, etPOINTER, 0, 1 }, |
| 161 | { '/', 0, 0, etPATH, 0, 0 }, |
| 162 | }; |
| 163 | #define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) |
| 164 | |
| 165 | /* |
| 166 | ** "*val" is a double such that 0.1 <= *val < 10.0 |
| 167 | ** Return the ascii code for the leading digit of *val, then |
| 168 | ** multiply "*val" by 10.0 to renormalize. |
| @@ -970,11 +970,11 @@ | |
| 970 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 971 | va_start(ap, zFormat); |
| 972 | vfprintf(out, zFormat, ap); |
| 973 | fprintf(out, "\n"); |
| 974 | va_end(ap); |
| 975 | for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){ |
| 976 | char *p; |
| 977 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 978 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 979 | fossil_path_free(p); |
| 980 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 981 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -158,11 +158,11 @@ | |
| 158 | { 'n', 0, 0, etSIZE, 0, 0 }, |
| 159 | { '%', 0, 0, etPERCENT, 0, 0 }, |
| 160 | { 'p', 16, 0, etPOINTER, 0, 1 }, |
| 161 | { '/', 0, 0, etPATH, 0, 0 }, |
| 162 | }; |
| 163 | #define etNINFO count(fmtinfo) |
| 164 | |
| 165 | /* |
| 166 | ** "*val" is a double such that 0.1 <= *val < 10.0 |
| 167 | ** Return the ascii code for the leading digit of *val, then |
| 168 | ** multiply "*val" by 10.0 to renormalize. |
| @@ -970,11 +970,11 @@ | |
| 970 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 971 | va_start(ap, zFormat); |
| 972 | vfprintf(out, zFormat, ap); |
| 973 | fprintf(out, "\n"); |
| 974 | va_end(ap); |
| 975 | for(i=0; i<count(azEnv); i++){ |
| 976 | char *p; |
| 977 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 978 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 979 | fossil_path_free(p); |
| 980 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 981 |
+1
-1
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -205,11 +205,11 @@ | ||
| 205 | 205 | in.i++; |
| 206 | 206 | } |
| 207 | 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ | |
| 210 | + if( pRe->nState<=count(aSpace)*2 ){ | |
| 211 | 211 | pToFree = 0; |
| 212 | 212 | aStateSet[0].aState = aSpace; |
| 213 | 213 | }else{ |
| 214 | 214 | pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState ); |
| 215 | 215 | if( pToFree==0 ) return -1; |
| 216 | 216 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -205,11 +205,11 @@ | |
| 205 | in.i++; |
| 206 | } |
| 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 208 | } |
| 209 | |
| 210 | if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ |
| 211 | pToFree = 0; |
| 212 | aStateSet[0].aState = aSpace; |
| 213 | }else{ |
| 214 | pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState ); |
| 215 | if( pToFree==0 ) return -1; |
| 216 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -205,11 +205,11 @@ | |
| 205 | in.i++; |
| 206 | } |
| 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 208 | } |
| 209 | |
| 210 | if( pRe->nState<=count(aSpace)*2 ){ |
| 211 | pToFree = 0; |
| 212 | aStateSet[0].aState = aSpace; |
| 213 | }else{ |
| 214 | pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState ); |
| 215 | if( pToFree==0 ) return -1; |
| 216 |
+2
-2
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -198,14 +198,14 @@ | ||
| 198 | 198 | }; |
| 199 | 199 | int i; |
| 200 | 200 | if( fossil_strncmp(zArg1, "fx_", 3)==0 ){ |
| 201 | 201 | break; |
| 202 | 202 | } |
| 203 | - for(i=0; i<sizeof(azAllowed)/sizeof(azAllowed[0]); i++){ | |
| 203 | + for(i=0; i<count(azAllowed); i++){ | |
| 204 | 204 | if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break; |
| 205 | 205 | } |
| 206 | - if( i>=sizeof(azAllowed)/sizeof(azAllowed[0]) ){ | |
| 206 | + if( i>=count(azAllowed) ){ | |
| 207 | 207 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 208 | 208 | rc = SQLITE_DENY; |
| 209 | 209 | }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){ |
| 210 | 210 | rc = SQLITE_IGNORE; |
| 211 | 211 | } |
| 212 | 212 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -198,14 +198,14 @@ | |
| 198 | }; |
| 199 | int i; |
| 200 | if( fossil_strncmp(zArg1, "fx_", 3)==0 ){ |
| 201 | break; |
| 202 | } |
| 203 | for(i=0; i<sizeof(azAllowed)/sizeof(azAllowed[0]); i++){ |
| 204 | if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break; |
| 205 | } |
| 206 | if( i>=sizeof(azAllowed)/sizeof(azAllowed[0]) ){ |
| 207 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 208 | rc = SQLITE_DENY; |
| 209 | }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){ |
| 210 | rc = SQLITE_IGNORE; |
| 211 | } |
| 212 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -198,14 +198,14 @@ | |
| 198 | }; |
| 199 | int i; |
| 200 | if( fossil_strncmp(zArg1, "fx_", 3)==0 ){ |
| 201 | break; |
| 202 | } |
| 203 | for(i=0; i<count(azAllowed); i++){ |
| 204 | if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break; |
| 205 | } |
| 206 | if( i>=count(azAllowed) ){ |
| 207 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 208 | rc = SQLITE_DENY; |
| 209 | }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){ |
| 210 | rc = SQLITE_IGNORE; |
| 211 | } |
| 212 |
+9
-9
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -418,11 +418,11 @@ | ||
| 418 | 418 | sqlite3_value **argv |
| 419 | 419 | ){ |
| 420 | 420 | const char *azDoc[5]; |
| 421 | 421 | int nDoc; |
| 422 | 422 | int rc; |
| 423 | - for(nDoc=0; nDoc<ArraySize(azDoc) && nDoc<argc; nDoc++){ | |
| 423 | + for(nDoc=0; nDoc<count(azDoc) && nDoc<argc; nDoc++){ | |
| 424 | 424 | azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]); |
| 425 | 425 | if( azDoc[nDoc]==0 ) azDoc[nDoc] = ""; |
| 426 | 426 | } |
| 427 | 427 | rc = search_match(&gSearch, nDoc, azDoc); |
| 428 | 428 | sqlite3_result_int(context, rc); |
| @@ -657,11 +657,11 @@ | ||
| 657 | 657 | }; |
| 658 | 658 | int i; |
| 659 | 659 | if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC); |
| 660 | 660 | if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT); |
| 661 | 661 | if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI); |
| 662 | - for(i=0; i<ArraySize(aSetng); i++){ | |
| 662 | + for(i=0; i<count(aSetng); i++){ | |
| 663 | 663 | unsigned int m = aSetng[i].m; |
| 664 | 664 | if( (srchFlags & m)==0 ) continue; |
| 665 | 665 | if( ((knownGood|knownBad) & m)!=0 ) continue; |
| 666 | 666 | if( db_get_boolean(aSetng[i].zKey,0) ){ |
| 667 | 667 | knownGood |= m; |
| @@ -892,11 +892,11 @@ | ||
| 892 | 892 | { SRCH_DOC, 'd' }, |
| 893 | 893 | { SRCH_TKT, 't' }, |
| 894 | 894 | { SRCH_WIKI, 'w' }, |
| 895 | 895 | }; |
| 896 | 896 | int i; |
| 897 | - for(i=0; i<ArraySize(aMask); i++){ | |
| 897 | + for(i=0; i<count(aMask); i++){ | |
| 898 | 898 | if( srchFlags & aMask[i].m ){ |
| 899 | 899 | blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c); |
| 900 | 900 | zSep = " OR "; |
| 901 | 901 | } |
| 902 | 902 | } |
| @@ -1070,11 +1070,11 @@ | ||
| 1070 | 1070 | }; |
| 1071 | 1071 | const char *zY = PD("y","all"); |
| 1072 | 1072 | unsigned newFlags = srchFlags; |
| 1073 | 1073 | int i; |
| 1074 | 1074 | @ <select size='1' name='y'> |
| 1075 | - for(i=0; i<ArraySize(aY); i++){ | |
| 1075 | + for(i=0; i<count(aY); i++){ | |
| 1076 | 1076 | if( (aY[i].m & srchFlags)==0 ) continue; |
| 1077 | 1077 | cgi_printf("<option value='%s'", aY[i].z); |
| 1078 | 1078 | if( fossil_strcmp(zY,aY[i].z)==0 ){ |
| 1079 | 1079 | newFlags &= aY[i].m; |
| 1080 | 1080 | cgi_printf(" selected"); |
| @@ -1727,17 +1727,17 @@ | ||
| 1727 | 1727 | int iAction = 0; |
| 1728 | 1728 | db_find_and_open_repository(0, 0); |
| 1729 | 1729 | if( g.argc>2 ){ |
| 1730 | 1730 | zSubCmd = g.argv[2]; |
| 1731 | 1731 | n = (int)strlen(zSubCmd); |
| 1732 | - for(i=0; i<ArraySize(aCmd); i++){ | |
| 1732 | + for(i=0; i<count(aCmd); i++){ | |
| 1733 | 1733 | if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break; |
| 1734 | 1734 | } |
| 1735 | - if( i>=ArraySize(aCmd) ){ | |
| 1735 | + if( i>=count(aCmd) ){ | |
| 1736 | 1736 | Blob all; |
| 1737 | 1737 | blob_init(&all,0,0); |
| 1738 | - for(i=0; i<ArraySize(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); | |
| 1738 | + for(i=0; i<count(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); | |
| 1739 | 1739 | fossil_fatal("unknown \"%s\" - should be on of:%s", |
| 1740 | 1740 | zSubCmd, blob_str(&all)); |
| 1741 | 1741 | return; |
| 1742 | 1742 | } |
| 1743 | 1743 | iCmd = aCmd[i].iCmd; |
| @@ -1757,11 +1757,11 @@ | ||
| 1757 | 1757 | /* Adjust search settings */ |
| 1758 | 1758 | if( iCmd==3 || iCmd==4 ){ |
| 1759 | 1759 | const char *zCtrl; |
| 1760 | 1760 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1761 | 1761 | zCtrl = g.argv[3]; |
| 1762 | - for(j=0; j<ArraySize(aSetng); j++){ | |
| 1762 | + for(j=0; j<count(aSetng); j++){ | |
| 1763 | 1763 | if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){ |
| 1764 | 1764 | db_set_int(aSetng[j].zSetting, iCmd-3, 0); |
| 1765 | 1765 | } |
| 1766 | 1766 | } |
| 1767 | 1767 | } |
| @@ -1778,11 +1778,11 @@ | ||
| 1778 | 1778 | if( iAction>=2 ){ |
| 1779 | 1779 | search_rebuild_index(); |
| 1780 | 1780 | } |
| 1781 | 1781 | |
| 1782 | 1782 | /* Always show the status before ending */ |
| 1783 | - for(i=0; i<ArraySize(aSetng); i++){ | |
| 1783 | + for(i=0; i<count(aSetng); i++){ | |
| 1784 | 1784 | fossil_print("%-16s %s\n", aSetng[i].zName, |
| 1785 | 1785 | db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off"); |
| 1786 | 1786 | } |
| 1787 | 1787 | fossil_print("%-16s %s\n", "Porter stemmer:", |
| 1788 | 1788 | db_get_boolean("search-stemmer",0) ? "on" : "off"); |
| 1789 | 1789 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -418,11 +418,11 @@ | |
| 418 | sqlite3_value **argv |
| 419 | ){ |
| 420 | const char *azDoc[5]; |
| 421 | int nDoc; |
| 422 | int rc; |
| 423 | for(nDoc=0; nDoc<ArraySize(azDoc) && nDoc<argc; nDoc++){ |
| 424 | azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]); |
| 425 | if( azDoc[nDoc]==0 ) azDoc[nDoc] = ""; |
| 426 | } |
| 427 | rc = search_match(&gSearch, nDoc, azDoc); |
| 428 | sqlite3_result_int(context, rc); |
| @@ -657,11 +657,11 @@ | |
| 657 | }; |
| 658 | int i; |
| 659 | if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC); |
| 660 | if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT); |
| 661 | if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI); |
| 662 | for(i=0; i<ArraySize(aSetng); i++){ |
| 663 | unsigned int m = aSetng[i].m; |
| 664 | if( (srchFlags & m)==0 ) continue; |
| 665 | if( ((knownGood|knownBad) & m)!=0 ) continue; |
| 666 | if( db_get_boolean(aSetng[i].zKey,0) ){ |
| 667 | knownGood |= m; |
| @@ -892,11 +892,11 @@ | |
| 892 | { SRCH_DOC, 'd' }, |
| 893 | { SRCH_TKT, 't' }, |
| 894 | { SRCH_WIKI, 'w' }, |
| 895 | }; |
| 896 | int i; |
| 897 | for(i=0; i<ArraySize(aMask); i++){ |
| 898 | if( srchFlags & aMask[i].m ){ |
| 899 | blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c); |
| 900 | zSep = " OR "; |
| 901 | } |
| 902 | } |
| @@ -1070,11 +1070,11 @@ | |
| 1070 | }; |
| 1071 | const char *zY = PD("y","all"); |
| 1072 | unsigned newFlags = srchFlags; |
| 1073 | int i; |
| 1074 | @ <select size='1' name='y'> |
| 1075 | for(i=0; i<ArraySize(aY); i++){ |
| 1076 | if( (aY[i].m & srchFlags)==0 ) continue; |
| 1077 | cgi_printf("<option value='%s'", aY[i].z); |
| 1078 | if( fossil_strcmp(zY,aY[i].z)==0 ){ |
| 1079 | newFlags &= aY[i].m; |
| 1080 | cgi_printf(" selected"); |
| @@ -1727,17 +1727,17 @@ | |
| 1727 | int iAction = 0; |
| 1728 | db_find_and_open_repository(0, 0); |
| 1729 | if( g.argc>2 ){ |
| 1730 | zSubCmd = g.argv[2]; |
| 1731 | n = (int)strlen(zSubCmd); |
| 1732 | for(i=0; i<ArraySize(aCmd); i++){ |
| 1733 | if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break; |
| 1734 | } |
| 1735 | if( i>=ArraySize(aCmd) ){ |
| 1736 | Blob all; |
| 1737 | blob_init(&all,0,0); |
| 1738 | for(i=0; i<ArraySize(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); |
| 1739 | fossil_fatal("unknown \"%s\" - should be on of:%s", |
| 1740 | zSubCmd, blob_str(&all)); |
| 1741 | return; |
| 1742 | } |
| 1743 | iCmd = aCmd[i].iCmd; |
| @@ -1757,11 +1757,11 @@ | |
| 1757 | /* Adjust search settings */ |
| 1758 | if( iCmd==3 || iCmd==4 ){ |
| 1759 | const char *zCtrl; |
| 1760 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1761 | zCtrl = g.argv[3]; |
| 1762 | for(j=0; j<ArraySize(aSetng); j++){ |
| 1763 | if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){ |
| 1764 | db_set_int(aSetng[j].zSetting, iCmd-3, 0); |
| 1765 | } |
| 1766 | } |
| 1767 | } |
| @@ -1778,11 +1778,11 @@ | |
| 1778 | if( iAction>=2 ){ |
| 1779 | search_rebuild_index(); |
| 1780 | } |
| 1781 | |
| 1782 | /* Always show the status before ending */ |
| 1783 | for(i=0; i<ArraySize(aSetng); i++){ |
| 1784 | fossil_print("%-16s %s\n", aSetng[i].zName, |
| 1785 | db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off"); |
| 1786 | } |
| 1787 | fossil_print("%-16s %s\n", "Porter stemmer:", |
| 1788 | db_get_boolean("search-stemmer",0) ? "on" : "off"); |
| 1789 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -418,11 +418,11 @@ | |
| 418 | sqlite3_value **argv |
| 419 | ){ |
| 420 | const char *azDoc[5]; |
| 421 | int nDoc; |
| 422 | int rc; |
| 423 | for(nDoc=0; nDoc<count(azDoc) && nDoc<argc; nDoc++){ |
| 424 | azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]); |
| 425 | if( azDoc[nDoc]==0 ) azDoc[nDoc] = ""; |
| 426 | } |
| 427 | rc = search_match(&gSearch, nDoc, azDoc); |
| 428 | sqlite3_result_int(context, rc); |
| @@ -657,11 +657,11 @@ | |
| 657 | }; |
| 658 | int i; |
| 659 | if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC); |
| 660 | if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT); |
| 661 | if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI); |
| 662 | for(i=0; i<count(aSetng); i++){ |
| 663 | unsigned int m = aSetng[i].m; |
| 664 | if( (srchFlags & m)==0 ) continue; |
| 665 | if( ((knownGood|knownBad) & m)!=0 ) continue; |
| 666 | if( db_get_boolean(aSetng[i].zKey,0) ){ |
| 667 | knownGood |= m; |
| @@ -892,11 +892,11 @@ | |
| 892 | { SRCH_DOC, 'd' }, |
| 893 | { SRCH_TKT, 't' }, |
| 894 | { SRCH_WIKI, 'w' }, |
| 895 | }; |
| 896 | int i; |
| 897 | for(i=0; i<count(aMask); i++){ |
| 898 | if( srchFlags & aMask[i].m ){ |
| 899 | blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c); |
| 900 | zSep = " OR "; |
| 901 | } |
| 902 | } |
| @@ -1070,11 +1070,11 @@ | |
| 1070 | }; |
| 1071 | const char *zY = PD("y","all"); |
| 1072 | unsigned newFlags = srchFlags; |
| 1073 | int i; |
| 1074 | @ <select size='1' name='y'> |
| 1075 | for(i=0; i<count(aY); i++){ |
| 1076 | if( (aY[i].m & srchFlags)==0 ) continue; |
| 1077 | cgi_printf("<option value='%s'", aY[i].z); |
| 1078 | if( fossil_strcmp(zY,aY[i].z)==0 ){ |
| 1079 | newFlags &= aY[i].m; |
| 1080 | cgi_printf(" selected"); |
| @@ -1727,17 +1727,17 @@ | |
| 1727 | int iAction = 0; |
| 1728 | db_find_and_open_repository(0, 0); |
| 1729 | if( g.argc>2 ){ |
| 1730 | zSubCmd = g.argv[2]; |
| 1731 | n = (int)strlen(zSubCmd); |
| 1732 | for(i=0; i<count(aCmd); i++){ |
| 1733 | if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break; |
| 1734 | } |
| 1735 | if( i>=count(aCmd) ){ |
| 1736 | Blob all; |
| 1737 | blob_init(&all,0,0); |
| 1738 | for(i=0; i<count(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); |
| 1739 | fossil_fatal("unknown \"%s\" - should be on of:%s", |
| 1740 | zSubCmd, blob_str(&all)); |
| 1741 | return; |
| 1742 | } |
| 1743 | iCmd = aCmd[i].iCmd; |
| @@ -1757,11 +1757,11 @@ | |
| 1757 | /* Adjust search settings */ |
| 1758 | if( iCmd==3 || iCmd==4 ){ |
| 1759 | const char *zCtrl; |
| 1760 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1761 | zCtrl = g.argv[3]; |
| 1762 | for(j=0; j<count(aSetng); j++){ |
| 1763 | if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){ |
| 1764 | db_set_int(aSetng[j].zSetting, iCmd-3, 0); |
| 1765 | } |
| 1766 | } |
| 1767 | } |
| @@ -1778,11 +1778,11 @@ | |
| 1778 | if( iAction>=2 ){ |
| 1779 | search_rebuild_index(); |
| 1780 | } |
| 1781 | |
| 1782 | /* Always show the status before ending */ |
| 1783 | for(i=0; i<count(aSetng); i++){ |
| 1784 | fossil_print("%-16s %s\n", aSetng[i].zName, |
| 1785 | db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off"); |
| 1786 | } |
| 1787 | fossil_print("%-16s %s\n", "Porter stemmer:", |
| 1788 | db_get_boolean("search-stemmer",0) ? "on" : "off"); |
| 1789 |
+3
-7
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -19,14 +19,10 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include <assert.h> |
| 22 | 22 | #include "setup.h" |
| 23 | 23 | |
| 24 | -#if INTERFACE | |
| 25 | -#define ArraySize(x) (sizeof(x)/sizeof(x[0])) | |
| 26 | -#endif | |
| 27 | - | |
| 28 | 24 | /* |
| 29 | 25 | ** Output a single entry for a menu generated using an HTML table. |
| 30 | 26 | ** If zLink is not NULL or an empty string, then it is the page that |
| 31 | 27 | ** the menu entry will hyperlink to. If zLink is NULL or "", then |
| 32 | 28 | ** the menu entry has no hyperlink - it is disabled. |
| @@ -944,18 +940,18 @@ | ||
| 944 | 940 | admin_log("Set option [%q] to [%q].", |
| 945 | 941 | zVar, iQ ? "on" : "off"); |
| 946 | 942 | iVal = iQ; |
| 947 | 943 | } |
| 948 | 944 | } |
| 949 | - @ <input type="checkbox" name="%s(zQParm)" | |
| 945 | + @ <label><input type="checkbox" name="%s(zQParm)" | |
| 950 | 946 | if( iVal ){ |
| 951 | 947 | @ checked="checked" |
| 952 | 948 | } |
| 953 | 949 | if( disabled ){ |
| 954 | 950 | @ disabled="disabled" |
| 955 | 951 | } |
| 956 | - @ /> <b>%s(zLabel)</b> | |
| 952 | + @ /> <b>%s(zLabel)</b></label> | |
| 957 | 953 | } |
| 958 | 954 | |
| 959 | 955 | /* |
| 960 | 956 | ** Generate an entry box for an attribute. |
| 961 | 957 | */ |
| @@ -1431,11 +1427,11 @@ | ||
| 1431 | 1427 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1432 | 1428 | } |
| 1433 | 1429 | |
| 1434 | 1430 | @ <hr /> |
| 1435 | 1431 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1436 | - "tdf", "0", ArraySize(azTimeFormats)/2, azTimeFormats); | |
| 1432 | + "tdf", "0", count(azTimeFormats)/2, azTimeFormats); | |
| 1437 | 1433 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1438 | 1434 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1439 | 1435 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1440 | 1436 | @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> |
| 1441 | 1437 | |
| 1442 | 1438 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -19,14 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "setup.h" |
| 23 | |
| 24 | #if INTERFACE |
| 25 | #define ArraySize(x) (sizeof(x)/sizeof(x[0])) |
| 26 | #endif |
| 27 | |
| 28 | /* |
| 29 | ** Output a single entry for a menu generated using an HTML table. |
| 30 | ** If zLink is not NULL or an empty string, then it is the page that |
| 31 | ** the menu entry will hyperlink to. If zLink is NULL or "", then |
| 32 | ** the menu entry has no hyperlink - it is disabled. |
| @@ -944,18 +940,18 @@ | |
| 944 | admin_log("Set option [%q] to [%q].", |
| 945 | zVar, iQ ? "on" : "off"); |
| 946 | iVal = iQ; |
| 947 | } |
| 948 | } |
| 949 | @ <input type="checkbox" name="%s(zQParm)" |
| 950 | if( iVal ){ |
| 951 | @ checked="checked" |
| 952 | } |
| 953 | if( disabled ){ |
| 954 | @ disabled="disabled" |
| 955 | } |
| 956 | @ /> <b>%s(zLabel)</b> |
| 957 | } |
| 958 | |
| 959 | /* |
| 960 | ** Generate an entry box for an attribute. |
| 961 | */ |
| @@ -1431,11 +1427,11 @@ | |
| 1431 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1432 | } |
| 1433 | |
| 1434 | @ <hr /> |
| 1435 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1436 | "tdf", "0", ArraySize(azTimeFormats)/2, azTimeFormats); |
| 1437 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1438 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1439 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1440 | @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> |
| 1441 | |
| 1442 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -19,14 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "setup.h" |
| 23 | |
| 24 | /* |
| 25 | ** Output a single entry for a menu generated using an HTML table. |
| 26 | ** If zLink is not NULL or an empty string, then it is the page that |
| 27 | ** the menu entry will hyperlink to. If zLink is NULL or "", then |
| 28 | ** the menu entry has no hyperlink - it is disabled. |
| @@ -944,18 +940,18 @@ | |
| 940 | admin_log("Set option [%q] to [%q].", |
| 941 | zVar, iQ ? "on" : "off"); |
| 942 | iVal = iQ; |
| 943 | } |
| 944 | } |
| 945 | @ <label><input type="checkbox" name="%s(zQParm)" |
| 946 | if( iVal ){ |
| 947 | @ checked="checked" |
| 948 | } |
| 949 | if( disabled ){ |
| 950 | @ disabled="disabled" |
| 951 | } |
| 952 | @ /> <b>%s(zLabel)</b></label> |
| 953 | } |
| 954 | |
| 955 | /* |
| 956 | ** Generate an entry box for an attribute. |
| 957 | */ |
| @@ -1431,11 +1427,11 @@ | |
| 1427 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1428 | } |
| 1429 | |
| 1430 | @ <hr /> |
| 1431 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1432 | "tdf", "0", count(azTimeFormats)/2, azTimeFormats); |
| 1433 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1434 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1435 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1436 | @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> |
| 1437 | |
| 1438 |
+12
-12
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -100,18 +100,18 @@ | ||
| 100 | 100 | Blob err = BLOB_INITIALIZER; |
| 101 | 101 | if( strchr(zName, '/')!=0 ){ |
| 102 | 102 | zAltSkinDir = fossil_strdup(zName); |
| 103 | 103 | return 0; |
| 104 | 104 | } |
| 105 | - for(i=0; i<ArraySize(aBuiltinSkin); i++){ | |
| 105 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 106 | 106 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){ |
| 107 | 107 | pAltSkin = &aBuiltinSkin[i]; |
| 108 | 108 | return 0; |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | blob_appendf(&err, "available skins: %s", aBuiltinSkin[0].zLabel); |
| 112 | - for(i=1; i<ArraySize(aBuiltinSkin); i++){ | |
| 112 | + for(i=1; i<count(aBuiltinSkin); i++){ | |
| 113 | 113 | blob_append(&err, " ", 1); |
| 114 | 114 | blob_append(&err, aBuiltinSkin[i].zLabel, -1); |
| 115 | 115 | } |
| 116 | 116 | return blob_str(&err); |
| 117 | 117 | } |
| @@ -163,11 +163,11 @@ | ||
| 163 | 163 | /* |
| 164 | 164 | ** Return a pointer to a SkinDetail element. Return 0 if not found. |
| 165 | 165 | */ |
| 166 | 166 | static struct SkinDetail *skin_detail_find(const char *zName){ |
| 167 | 167 | int lwr = 0; |
| 168 | - int upr = ArraySize(aSkinDetail); | |
| 168 | + int upr = count(aSkinDetail); | |
| 169 | 169 | while( upr>=lwr ){ |
| 170 | 170 | int mid = (upr+lwr)/2; |
| 171 | 171 | int c = fossil_strcmp(aSkinDetail[mid].zName, zName); |
| 172 | 172 | if( c==0 ) return &aSkinDetail[mid]; |
| 173 | 173 | if( c<0 ){ |
| @@ -283,11 +283,11 @@ | ||
| 283 | 283 | ** Return true if there exists a skin name "zSkinName". |
| 284 | 284 | */ |
| 285 | 285 | static int skinExists(const char *zSkinName){ |
| 286 | 286 | int i; |
| 287 | 287 | if( zSkinName==0 ) return 0; |
| 288 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 288 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 289 | 289 | if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1; |
| 290 | 290 | } |
| 291 | 291 | return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName); |
| 292 | 292 | } |
| 293 | 293 | |
| @@ -304,11 +304,11 @@ | ||
| 304 | 304 | char *zLabel; |
| 305 | 305 | static const char *azType[] = { "css", "header", "footer", "details" }; |
| 306 | 306 | int i; |
| 307 | 307 | Blob val; |
| 308 | 308 | blob_zero(&val); |
| 309 | - for(i=0; i<sizeof(azType)/sizeof(azType[0]); i++){ | |
| 309 | + for(i=0; i<count(azType); i++){ | |
| 310 | 310 | if( zName ){ |
| 311 | 311 | zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]); |
| 312 | 312 | z = builtin_text(zLabel); |
| 313 | 313 | fossil_free(zLabel); |
| 314 | 314 | }else{ |
| @@ -427,11 +427,11 @@ | ||
| 427 | 427 | login_needed(0); |
| 428 | 428 | return; |
| 429 | 429 | } |
| 430 | 430 | db_begin_transaction(); |
| 431 | 431 | zCurrent = getSkin(0); |
| 432 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 432 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 433 | 433 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | /* Process requests to delete a user-defined skin */ |
| 437 | 437 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| @@ -458,11 +458,11 @@ | ||
| 458 | 458 | int seen = 0; |
| 459 | 459 | |
| 460 | 460 | /* Check to see if the current skin is already saved. If it is, there |
| 461 | 461 | ** is no need to create a backup */ |
| 462 | 462 | zCurrent = getSkin(0); |
| 463 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 463 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 464 | 464 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 465 | 465 | seen = 1; |
| 466 | 466 | break; |
| 467 | 467 | } |
| 468 | 468 | } |
| @@ -476,11 +476,11 @@ | ||
| 476 | 476 | " %Q,now())", zCurrent |
| 477 | 477 | ); |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | seen = 0; |
| 481 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 481 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 482 | 482 | if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){ |
| 483 | 483 | seen = 1; |
| 484 | 484 | zCurrent = aBuiltinSkin[i].zSQL; |
| 485 | 485 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 486 | 486 | break; |
| @@ -513,11 +513,11 @@ | ||
| 513 | 513 | @ is restarted without the override.</p> |
| 514 | 514 | @ |
| 515 | 515 | } |
| 516 | 516 | @ <h2>Available Skins:</h2> |
| 517 | 517 | @ <table border="0"> |
| 518 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 518 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 519 | 519 | z = aBuiltinSkin[i].zDesc; |
| 520 | 520 | @ <tr><td>%d(i+1).<td>%h(z)<td> <td> |
| 521 | 521 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 522 | 522 | @ (Currently In Use) |
| 523 | 523 | seenCurrent = 1; |
| @@ -597,20 +597,20 @@ | ||
| 597 | 597 | if( !g.perm.Setup ){ |
| 598 | 598 | login_needed(0); |
| 599 | 599 | return; |
| 600 | 600 | } |
| 601 | 601 | ii = atoi(PD("w","0")); |
| 602 | - if( ii<0 || ii>ArraySize(aSkinAttr) ) ii = 0; | |
| 602 | + if( ii<0 || ii>count(aSkinAttr) ) ii = 0; | |
| 603 | 603 | zBasis = PD("basis","default"); |
| 604 | 604 | zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile); |
| 605 | 605 | db_begin_transaction(); |
| 606 | 606 | if( P("revert")!=0 ){ |
| 607 | 607 | db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile); |
| 608 | 608 | cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt)); |
| 609 | 609 | } |
| 610 | 610 | style_header("%s", aSkinAttr[ii].zTitle); |
| 611 | - for(j=0; j<ArraySize(aSkinAttr); j++){ | |
| 611 | + for(j=0; j<count(aSkinAttr); j++){ | |
| 612 | 612 | if( j==ii ) continue; |
| 613 | 613 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 614 | 614 | "%R/setup_skinedit?w=%d&basis=%h",j,zBasis); |
| 615 | 615 | } |
| 616 | 616 | style_submenu_element("Skins", "%R/setup_skin"); |
| @@ -622,11 +622,11 @@ | ||
| 622 | 622 | aSkinAttr[ii].zFile, builtin_text(zDflt), 0); |
| 623 | 623 | @ <br /> |
| 624 | 624 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 625 | 625 | @ <hr /> |
| 626 | 626 | @ Baseline: <select size='1' name='basis'> |
| 627 | - for(j=0; j<ArraySize(aBuiltinSkin); j++){ | |
| 627 | + for(j=0; j<count(aBuiltinSkin); j++){ | |
| 628 | 628 | cgi_printf("<option value='%h'%s>%h</option>\n", |
| 629 | 629 | aBuiltinSkin[j].zLabel, |
| 630 | 630 | fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "", |
| 631 | 631 | aBuiltinSkin[j].zDesc |
| 632 | 632 | ); |
| 633 | 633 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -100,18 +100,18 @@ | |
| 100 | Blob err = BLOB_INITIALIZER; |
| 101 | if( strchr(zName, '/')!=0 ){ |
| 102 | zAltSkinDir = fossil_strdup(zName); |
| 103 | return 0; |
| 104 | } |
| 105 | for(i=0; i<ArraySize(aBuiltinSkin); i++){ |
| 106 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){ |
| 107 | pAltSkin = &aBuiltinSkin[i]; |
| 108 | return 0; |
| 109 | } |
| 110 | } |
| 111 | blob_appendf(&err, "available skins: %s", aBuiltinSkin[0].zLabel); |
| 112 | for(i=1; i<ArraySize(aBuiltinSkin); i++){ |
| 113 | blob_append(&err, " ", 1); |
| 114 | blob_append(&err, aBuiltinSkin[i].zLabel, -1); |
| 115 | } |
| 116 | return blob_str(&err); |
| 117 | } |
| @@ -163,11 +163,11 @@ | |
| 163 | /* |
| 164 | ** Return a pointer to a SkinDetail element. Return 0 if not found. |
| 165 | */ |
| 166 | static struct SkinDetail *skin_detail_find(const char *zName){ |
| 167 | int lwr = 0; |
| 168 | int upr = ArraySize(aSkinDetail); |
| 169 | while( upr>=lwr ){ |
| 170 | int mid = (upr+lwr)/2; |
| 171 | int c = fossil_strcmp(aSkinDetail[mid].zName, zName); |
| 172 | if( c==0 ) return &aSkinDetail[mid]; |
| 173 | if( c<0 ){ |
| @@ -283,11 +283,11 @@ | |
| 283 | ** Return true if there exists a skin name "zSkinName". |
| 284 | */ |
| 285 | static int skinExists(const char *zSkinName){ |
| 286 | int i; |
| 287 | if( zSkinName==0 ) return 0; |
| 288 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 289 | if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1; |
| 290 | } |
| 291 | return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName); |
| 292 | } |
| 293 | |
| @@ -304,11 +304,11 @@ | |
| 304 | char *zLabel; |
| 305 | static const char *azType[] = { "css", "header", "footer", "details" }; |
| 306 | int i; |
| 307 | Blob val; |
| 308 | blob_zero(&val); |
| 309 | for(i=0; i<sizeof(azType)/sizeof(azType[0]); i++){ |
| 310 | if( zName ){ |
| 311 | zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]); |
| 312 | z = builtin_text(zLabel); |
| 313 | fossil_free(zLabel); |
| 314 | }else{ |
| @@ -427,11 +427,11 @@ | |
| 427 | login_needed(0); |
| 428 | return; |
| 429 | } |
| 430 | db_begin_transaction(); |
| 431 | zCurrent = getSkin(0); |
| 432 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 433 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 434 | } |
| 435 | |
| 436 | /* Process requests to delete a user-defined skin */ |
| 437 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| @@ -458,11 +458,11 @@ | |
| 458 | int seen = 0; |
| 459 | |
| 460 | /* Check to see if the current skin is already saved. If it is, there |
| 461 | ** is no need to create a backup */ |
| 462 | zCurrent = getSkin(0); |
| 463 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 464 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 465 | seen = 1; |
| 466 | break; |
| 467 | } |
| 468 | } |
| @@ -476,11 +476,11 @@ | |
| 476 | " %Q,now())", zCurrent |
| 477 | ); |
| 478 | } |
| 479 | } |
| 480 | seen = 0; |
| 481 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 482 | if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){ |
| 483 | seen = 1; |
| 484 | zCurrent = aBuiltinSkin[i].zSQL; |
| 485 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 486 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | @ is restarted without the override.</p> |
| 514 | @ |
| 515 | } |
| 516 | @ <h2>Available Skins:</h2> |
| 517 | @ <table border="0"> |
| 518 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 519 | z = aBuiltinSkin[i].zDesc; |
| 520 | @ <tr><td>%d(i+1).<td>%h(z)<td> <td> |
| 521 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 522 | @ (Currently In Use) |
| 523 | seenCurrent = 1; |
| @@ -597,20 +597,20 @@ | |
| 597 | if( !g.perm.Setup ){ |
| 598 | login_needed(0); |
| 599 | return; |
| 600 | } |
| 601 | ii = atoi(PD("w","0")); |
| 602 | if( ii<0 || ii>ArraySize(aSkinAttr) ) ii = 0; |
| 603 | zBasis = PD("basis","default"); |
| 604 | zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile); |
| 605 | db_begin_transaction(); |
| 606 | if( P("revert")!=0 ){ |
| 607 | db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile); |
| 608 | cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt)); |
| 609 | } |
| 610 | style_header("%s", aSkinAttr[ii].zTitle); |
| 611 | for(j=0; j<ArraySize(aSkinAttr); j++){ |
| 612 | if( j==ii ) continue; |
| 613 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 614 | "%R/setup_skinedit?w=%d&basis=%h",j,zBasis); |
| 615 | } |
| 616 | style_submenu_element("Skins", "%R/setup_skin"); |
| @@ -622,11 +622,11 @@ | |
| 622 | aSkinAttr[ii].zFile, builtin_text(zDflt), 0); |
| 623 | @ <br /> |
| 624 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 625 | @ <hr /> |
| 626 | @ Baseline: <select size='1' name='basis'> |
| 627 | for(j=0; j<ArraySize(aBuiltinSkin); j++){ |
| 628 | cgi_printf("<option value='%h'%s>%h</option>\n", |
| 629 | aBuiltinSkin[j].zLabel, |
| 630 | fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "", |
| 631 | aBuiltinSkin[j].zDesc |
| 632 | ); |
| 633 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -100,18 +100,18 @@ | |
| 100 | Blob err = BLOB_INITIALIZER; |
| 101 | if( strchr(zName, '/')!=0 ){ |
| 102 | zAltSkinDir = fossil_strdup(zName); |
| 103 | return 0; |
| 104 | } |
| 105 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 106 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){ |
| 107 | pAltSkin = &aBuiltinSkin[i]; |
| 108 | return 0; |
| 109 | } |
| 110 | } |
| 111 | blob_appendf(&err, "available skins: %s", aBuiltinSkin[0].zLabel); |
| 112 | for(i=1; i<count(aBuiltinSkin); i++){ |
| 113 | blob_append(&err, " ", 1); |
| 114 | blob_append(&err, aBuiltinSkin[i].zLabel, -1); |
| 115 | } |
| 116 | return blob_str(&err); |
| 117 | } |
| @@ -163,11 +163,11 @@ | |
| 163 | /* |
| 164 | ** Return a pointer to a SkinDetail element. Return 0 if not found. |
| 165 | */ |
| 166 | static struct SkinDetail *skin_detail_find(const char *zName){ |
| 167 | int lwr = 0; |
| 168 | int upr = count(aSkinDetail); |
| 169 | while( upr>=lwr ){ |
| 170 | int mid = (upr+lwr)/2; |
| 171 | int c = fossil_strcmp(aSkinDetail[mid].zName, zName); |
| 172 | if( c==0 ) return &aSkinDetail[mid]; |
| 173 | if( c<0 ){ |
| @@ -283,11 +283,11 @@ | |
| 283 | ** Return true if there exists a skin name "zSkinName". |
| 284 | */ |
| 285 | static int skinExists(const char *zSkinName){ |
| 286 | int i; |
| 287 | if( zSkinName==0 ) return 0; |
| 288 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 289 | if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1; |
| 290 | } |
| 291 | return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName); |
| 292 | } |
| 293 | |
| @@ -304,11 +304,11 @@ | |
| 304 | char *zLabel; |
| 305 | static const char *azType[] = { "css", "header", "footer", "details" }; |
| 306 | int i; |
| 307 | Blob val; |
| 308 | blob_zero(&val); |
| 309 | for(i=0; i<count(azType); i++){ |
| 310 | if( zName ){ |
| 311 | zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]); |
| 312 | z = builtin_text(zLabel); |
| 313 | fossil_free(zLabel); |
| 314 | }else{ |
| @@ -427,11 +427,11 @@ | |
| 427 | login_needed(0); |
| 428 | return; |
| 429 | } |
| 430 | db_begin_transaction(); |
| 431 | zCurrent = getSkin(0); |
| 432 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 433 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 434 | } |
| 435 | |
| 436 | /* Process requests to delete a user-defined skin */ |
| 437 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| @@ -458,11 +458,11 @@ | |
| 458 | int seen = 0; |
| 459 | |
| 460 | /* Check to see if the current skin is already saved. If it is, there |
| 461 | ** is no need to create a backup */ |
| 462 | zCurrent = getSkin(0); |
| 463 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 464 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 465 | seen = 1; |
| 466 | break; |
| 467 | } |
| 468 | } |
| @@ -476,11 +476,11 @@ | |
| 476 | " %Q,now())", zCurrent |
| 477 | ); |
| 478 | } |
| 479 | } |
| 480 | seen = 0; |
| 481 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 482 | if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){ |
| 483 | seen = 1; |
| 484 | zCurrent = aBuiltinSkin[i].zSQL; |
| 485 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 486 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | @ is restarted without the override.</p> |
| 514 | @ |
| 515 | } |
| 516 | @ <h2>Available Skins:</h2> |
| 517 | @ <table border="0"> |
| 518 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 519 | z = aBuiltinSkin[i].zDesc; |
| 520 | @ <tr><td>%d(i+1).<td>%h(z)<td> <td> |
| 521 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 522 | @ (Currently In Use) |
| 523 | seenCurrent = 1; |
| @@ -597,20 +597,20 @@ | |
| 597 | if( !g.perm.Setup ){ |
| 598 | login_needed(0); |
| 599 | return; |
| 600 | } |
| 601 | ii = atoi(PD("w","0")); |
| 602 | if( ii<0 || ii>count(aSkinAttr) ) ii = 0; |
| 603 | zBasis = PD("basis","default"); |
| 604 | zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile); |
| 605 | db_begin_transaction(); |
| 606 | if( P("revert")!=0 ){ |
| 607 | db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile); |
| 608 | cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt)); |
| 609 | } |
| 610 | style_header("%s", aSkinAttr[ii].zTitle); |
| 611 | for(j=0; j<count(aSkinAttr); j++){ |
| 612 | if( j==ii ) continue; |
| 613 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 614 | "%R/setup_skinedit?w=%d&basis=%h",j,zBasis); |
| 615 | } |
| 616 | style_submenu_element("Skins", "%R/setup_skin"); |
| @@ -622,11 +622,11 @@ | |
| 622 | aSkinAttr[ii].zFile, builtin_text(zDflt), 0); |
| 623 | @ <br /> |
| 624 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 625 | @ <hr /> |
| 626 | @ Baseline: <select size='1' name='basis'> |
| 627 | for(j=0; j<count(aBuiltinSkin); j++){ |
| 628 | cgi_printf("<option value='%h'%s>%h</option>\n", |
| 629 | aBuiltinSkin[j].zLabel, |
| 630 | fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "", |
| 631 | aBuiltinSkin[j].zDesc |
| 632 | ); |
| 633 |
+3
-3
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -706,24 +706,24 @@ | ||
| 706 | 706 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| 707 | 707 | if( zView==0 ){ |
| 708 | 708 | zView = "byuser"; |
| 709 | 709 | cgi_replace_query_parameter("view","byuser"); |
| 710 | 710 | } |
| 711 | - for(i=0; i<ArraySize(aViewType); i++){ | |
| 711 | + for(i=0; i<count(aViewType); i++){ | |
| 712 | 712 | if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){ |
| 713 | 713 | eType = aViewType[i].eType; |
| 714 | 714 | break; |
| 715 | 715 | } |
| 716 | 716 | } |
| 717 | 717 | if( eType!=RPT_NONE ){ |
| 718 | 718 | int nView = 0; /* Slots used in azView[] */ |
| 719 | - for(i=0; i<ArraySize(aViewType); i++){ | |
| 719 | + for(i=0; i<count(aViewType); i++){ | |
| 720 | 720 | azView[nView++] = aViewType[i].zVal; |
| 721 | 721 | azView[nView++] = aViewType[i].zName; |
| 722 | 722 | } |
| 723 | 723 | if( eType!=RPT_BYFILE ){ |
| 724 | - style_submenu_multichoice("type", ArraySize(azType)/2, azType, 0); | |
| 724 | + style_submenu_multichoice("type", count(azType)/2, azType, 0); | |
| 725 | 725 | } |
| 726 | 726 | style_submenu_multichoice("view", nView/2, azView, 0); |
| 727 | 727 | if( eType!=RPT_BYUSER ){ |
| 728 | 728 | style_submenu_sql("user","User:", |
| 729 | 729 | "SELECT '', 'All Users' UNION ALL " |
| 730 | 730 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -706,24 +706,24 @@ | |
| 706 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| 707 | if( zView==0 ){ |
| 708 | zView = "byuser"; |
| 709 | cgi_replace_query_parameter("view","byuser"); |
| 710 | } |
| 711 | for(i=0; i<ArraySize(aViewType); i++){ |
| 712 | if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){ |
| 713 | eType = aViewType[i].eType; |
| 714 | break; |
| 715 | } |
| 716 | } |
| 717 | if( eType!=RPT_NONE ){ |
| 718 | int nView = 0; /* Slots used in azView[] */ |
| 719 | for(i=0; i<ArraySize(aViewType); i++){ |
| 720 | azView[nView++] = aViewType[i].zVal; |
| 721 | azView[nView++] = aViewType[i].zName; |
| 722 | } |
| 723 | if( eType!=RPT_BYFILE ){ |
| 724 | style_submenu_multichoice("type", ArraySize(azType)/2, azType, 0); |
| 725 | } |
| 726 | style_submenu_multichoice("view", nView/2, azView, 0); |
| 727 | if( eType!=RPT_BYUSER ){ |
| 728 | style_submenu_sql("user","User:", |
| 729 | "SELECT '', 'All Users' UNION ALL " |
| 730 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -706,24 +706,24 @@ | |
| 706 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| 707 | if( zView==0 ){ |
| 708 | zView = "byuser"; |
| 709 | cgi_replace_query_parameter("view","byuser"); |
| 710 | } |
| 711 | for(i=0; i<count(aViewType); i++){ |
| 712 | if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){ |
| 713 | eType = aViewType[i].eType; |
| 714 | break; |
| 715 | } |
| 716 | } |
| 717 | if( eType!=RPT_NONE ){ |
| 718 | int nView = 0; /* Slots used in azView[] */ |
| 719 | for(i=0; i<count(aViewType); i++){ |
| 720 | azView[nView++] = aViewType[i].zVal; |
| 721 | azView[nView++] = aViewType[i].zName; |
| 722 | } |
| 723 | if( eType!=RPT_BYFILE ){ |
| 724 | style_submenu_multichoice("type", count(azType)/2, azType, 0); |
| 725 | } |
| 726 | style_submenu_multichoice("view", nView/2, azView, 0); |
| 727 | if( eType!=RPT_BYUSER ){ |
| 728 | style_submenu_sql("user","User:", |
| 729 | "SELECT '', 'All Users' UNION ALL " |
| 730 |
+94
-78
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -30,11 +30,13 @@ | ||
| 30 | 30 | ** Populate these structure with calls to |
| 31 | 31 | ** |
| 32 | 32 | ** style_submenu_element() |
| 33 | 33 | ** style_submenu_entry() |
| 34 | 34 | ** style_submenu_checkbox() |
| 35 | +** style_submenu_binary() | |
| 35 | 36 | ** style_submenu_multichoice() |
| 37 | +** style_submenu_sql() | |
| 36 | 38 | ** |
| 37 | 39 | ** prior to calling style_footer(). The style_footer() routine |
| 38 | 40 | ** will generate the appropriate HTML text just below the main |
| 39 | 41 | ** menu. |
| 40 | 42 | */ |
| @@ -51,13 +53,14 @@ | ||
| 51 | 53 | short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */ |
| 52 | 54 | const char *const *azChoice;/* value/display pairs for FF_MULTI */ |
| 53 | 55 | const char *zFalse; /* FF_BINARY label when false */ |
| 54 | 56 | } aSubmenuCtrl[20]; |
| 55 | 57 | static int nSubmenuCtrl = 0; |
| 56 | -#define FF_ENTRY 1 | |
| 57 | -#define FF_MULTI 2 | |
| 58 | -#define FF_BINARY 3 | |
| 58 | +#define FF_ENTRY 1 | |
| 59 | +#define FF_MULTI 2 | |
| 60 | +#define FF_BINARY 3 | |
| 61 | +#define FF_CHECKBOX 4 | |
| 59 | 62 | |
| 60 | 63 | /* |
| 61 | 64 | ** Remember that the header has been generated. The footer is omitted |
| 62 | 65 | ** if an error occurs before the header. |
| 63 | 66 | */ |
| @@ -233,11 +236,11 @@ | ||
| 233 | 236 | const char *zLabel, |
| 234 | 237 | const char *zLink, |
| 235 | 238 | ... |
| 236 | 239 | ){ |
| 237 | 240 | va_list ap; |
| 238 | - assert( nSubmenu < sizeof(aSubmenu)/sizeof(aSubmenu[0]) ); | |
| 241 | + assert( nSubmenu < count(aSubmenu) ); | |
| 239 | 242 | aSubmenu[nSubmenu].zLabel = zLabel; |
| 240 | 243 | va_start(ap, zLink); |
| 241 | 244 | aSubmenu[nSubmenu].zLink = vmprintf(zLink, ap); |
| 242 | 245 | va_end(ap); |
| 243 | 246 | nSubmenu++; |
| @@ -246,25 +249,37 @@ | ||
| 246 | 249 | const char *zName, /* Query parameter name */ |
| 247 | 250 | const char *zLabel, /* Label before the entry box */ |
| 248 | 251 | int iSize, /* Size of the entry box */ |
| 249 | 252 | int isDisabled /* True if disabled */ |
| 250 | 253 | ){ |
| 251 | - assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); | |
| 254 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 252 | 255 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 253 | 256 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; |
| 254 | 257 | aSubmenuCtrl[nSubmenuCtrl].iSize = iSize; |
| 255 | 258 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 256 | 259 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY; |
| 257 | 260 | nSubmenuCtrl++; |
| 261 | +} | |
| 262 | +void style_submenu_checkbox( | |
| 263 | + const char *zName, /* Query parameter name */ | |
| 264 | + const char *zLabel, /* Label to display after the checkbox */ | |
| 265 | + int isDisabled /* True if disabled */ | |
| 266 | +){ | |
| 267 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 268 | + aSubmenuCtrl[nSubmenuCtrl].zName = zName; | |
| 269 | + aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; | |
| 270 | + aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; | |
| 271 | + aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX; | |
| 272 | + nSubmenuCtrl++; | |
| 258 | 273 | } |
| 259 | 274 | void style_submenu_binary( |
| 260 | 275 | const char *zName, /* Query parameter name */ |
| 261 | 276 | const char *zTrue, /* Label to show when parameter is true */ |
| 262 | 277 | const char *zFalse, /* Label to show when the parameter is false */ |
| 263 | 278 | int isDisabled /* True if this control is disabled */ |
| 264 | 279 | ){ |
| 265 | - assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); | |
| 280 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 266 | 281 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 267 | 282 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue; |
| 268 | 283 | aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse; |
| 269 | 284 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 270 | 285 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY; |
| @@ -274,11 +289,11 @@ | ||
| 274 | 289 | const char *zName, /* Query parameter name */ |
| 275 | 290 | int nChoice, /* Number of options */ |
| 276 | 291 | const char *const *azChoice,/* value/display pairs. 2*nChoice entries */ |
| 277 | 292 | int isDisabled /* True if this control is disabled */ |
| 278 | 293 | ){ |
| 279 | - assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); | |
| 294 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 280 | 295 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 281 | 296 | aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice; |
| 282 | 297 | aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice; |
| 283 | 298 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 284 | 299 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI; |
| @@ -521,81 +536,82 @@ | ||
| 521 | 536 | }else{ |
| 522 | 537 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 523 | 538 | } |
| 524 | 539 | } |
| 525 | 540 | } |
| 526 | - if( nSubmenuCtrl>0 ){ | |
| 527 | - for(i=0; i<nSubmenuCtrl; i++){ | |
| 528 | - const char *zQPN = aSubmenuCtrl[i].zName; | |
| 529 | - const char *zDisabled = " disabled"; | |
| 530 | - if( !aSubmenuCtrl[i].isDisabled ){ | |
| 531 | - zDisabled = ""; | |
| 532 | - cgi_tag_query_parameter(zQPN); | |
| 533 | - } | |
| 534 | - switch( aSubmenuCtrl[i].eType ){ | |
| 535 | - case FF_ENTRY: { | |
| 536 | - cgi_printf( | |
| 537 | - "<span class='submenuctrl'>" | |
| 538 | - " %h<input type='text' name='%s'", | |
| 539 | - aSubmenuCtrl[i].zLabel, zQPN | |
| 540 | - ); | |
| 541 | - if( aSubmenuCtrl[i].iSize<0 ){ | |
| 542 | - cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize); | |
| 543 | - }else if( aSubmenuCtrl[i].iSize>0 ){ | |
| 544 | - cgi_printf( | |
| 545 | - " size='%d' maxlength='%d'", | |
| 546 | - aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize | |
| 547 | - ); | |
| 548 | - } | |
| 549 | - cgi_printf( | |
| 550 | - " value='%h'%s></span>\n", | |
| 551 | - PD(zQPN,""), zDisabled | |
| 552 | - ); | |
| 553 | - break; | |
| 554 | - } | |
| 555 | - case FF_MULTI: { | |
| 556 | - int j; | |
| 557 | - const char *zVal = P(zQPN); | |
| 558 | - if( aSubmenuCtrl[i].zLabel ){ | |
| 559 | - cgi_printf(" %h", aSubmenuCtrl[i].zLabel); | |
| 560 | - } | |
| 561 | - cgi_printf( | |
| 562 | - "<select class='submenuctrl' size='1' name='%s'%s " | |
| 563 | - "onchange='gebi(\"f01\").submit();'>\n", | |
| 564 | - zQPN, zDisabled | |
| 565 | - ); | |
| 566 | - for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ | |
| 567 | - const char *zQPV = aSubmenuCtrl[i].azChoice[j]; | |
| 568 | - cgi_printf( | |
| 569 | - "<option value='%h'%s>%h</option>\n", | |
| 570 | - zQPV, | |
| 571 | - fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", | |
| 572 | - aSubmenuCtrl[i].azChoice[j+1] | |
| 573 | - ); | |
| 574 | - } | |
| 575 | - @ </select> | |
| 576 | - break; | |
| 577 | - } | |
| 578 | - case FF_BINARY: { | |
| 579 | - int isTrue = PB(zQPN); | |
| 580 | - cgi_printf( | |
| 581 | - "<select class='submenuctrl' size='1' name='%s'%s " | |
| 582 | - "onchange='gebi(\"f01\").submit();'>\n", | |
| 583 | - zQPN, zDisabled | |
| 584 | - ); | |
| 585 | - cgi_printf( | |
| 586 | - "<option value='1'%s>%h</option>\n", | |
| 587 | - isTrue ? " selected":"", aSubmenuCtrl[i].zLabel | |
| 588 | - ); | |
| 589 | - cgi_printf( | |
| 590 | - "<option value='0'%s>%h</option>\n", | |
| 591 | - (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse | |
| 592 | - ); | |
| 593 | - @ </select> | |
| 594 | - break; | |
| 595 | - } | |
| 596 | - } | |
| 541 | + for(i=0; i<nSubmenuCtrl; i++){ | |
| 542 | + const char *zQPN = aSubmenuCtrl[i].zName; | |
| 543 | + const char *zDisabled = " disabled"; | |
| 544 | + if( !aSubmenuCtrl[i].isDisabled ){ | |
| 545 | + zDisabled = ""; | |
| 546 | + cgi_tag_query_parameter(zQPN); | |
| 547 | + } | |
| 548 | + switch( aSubmenuCtrl[i].eType ){ | |
| 549 | + case FF_ENTRY: | |
| 550 | + cgi_printf( | |
| 551 | + "<span class='submenuctrl'>" | |
| 552 | + " %h<input type='text' name='%s' value='%h'%s", | |
| 553 | + aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled | |
| 554 | + ); | |
| 555 | + if( aSubmenuCtrl[i].iSize<0 ){ | |
| 556 | + cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize); | |
| 557 | + }else if( aSubmenuCtrl[i].iSize>0 ){ | |
| 558 | + cgi_printf( | |
| 559 | + " size='%d' maxlength='%d'", | |
| 560 | + aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize | |
| 561 | + ); | |
| 562 | + } | |
| 563 | + @ onchange='gebi("f01").submit();'></span> | |
| 564 | + break; | |
| 565 | + case FF_MULTI: { | |
| 566 | + int j; | |
| 567 | + const char *zVal = P(zQPN); | |
| 568 | + if( aSubmenuCtrl[i].zLabel ){ | |
| 569 | + cgi_printf(" %h", aSubmenuCtrl[i].zLabel); | |
| 570 | + } | |
| 571 | + cgi_printf( | |
| 572 | + "<select class='submenuctrl' size='1' name='%s'%s " | |
| 573 | + "onchange='gebi(\"f01\").submit();'>\n", | |
| 574 | + zQPN, zDisabled | |
| 575 | + ); | |
| 576 | + for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ | |
| 577 | + const char *zQPV = aSubmenuCtrl[i].azChoice[j]; | |
| 578 | + cgi_printf( | |
| 579 | + "<option value='%h'%s>%h</option>\n", | |
| 580 | + zQPV, | |
| 581 | + fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", | |
| 582 | + aSubmenuCtrl[i].azChoice[j+1] | |
| 583 | + ); | |
| 584 | + } | |
| 585 | + @ </select> | |
| 586 | + break; | |
| 587 | + } | |
| 588 | + case FF_BINARY: { | |
| 589 | + int isTrue = PB(zQPN); | |
| 590 | + cgi_printf( | |
| 591 | + "<select class='submenuctrl' size='1' name='%s'%s " | |
| 592 | + "onchange='gebi(\"f01\").submit();'>\n", | |
| 593 | + zQPN, zDisabled | |
| 594 | + ); | |
| 595 | + cgi_printf( | |
| 596 | + "<option value='1'%s>%h</option>\n", | |
| 597 | + isTrue ? " selected":"", aSubmenuCtrl[i].zLabel | |
| 598 | + ); | |
| 599 | + cgi_printf( | |
| 600 | + "<option value='0'%s>%h</option>\n", | |
| 601 | + (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse | |
| 602 | + ); | |
| 603 | + @ </select> | |
| 604 | + break; | |
| 605 | + } | |
| 606 | + case FF_CHECKBOX: | |
| 607 | + cgi_printf( | |
| 608 | + "<label class='submenuctrl'><input type='checkbox' name='%s' " | |
| 609 | + "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n", | |
| 610 | + zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel | |
| 611 | + ); | |
| 612 | + break; | |
| 597 | 613 | } |
| 598 | 614 | } |
| 599 | 615 | @ </div> |
| 600 | 616 | if( nSubmenuCtrl ){ |
| 601 | 617 | cgi_query_parameters_to_hidden(); |
| 602 | 618 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -30,11 +30,13 @@ | |
| 30 | ** Populate these structure with calls to |
| 31 | ** |
| 32 | ** style_submenu_element() |
| 33 | ** style_submenu_entry() |
| 34 | ** style_submenu_checkbox() |
| 35 | ** style_submenu_multichoice() |
| 36 | ** |
| 37 | ** prior to calling style_footer(). The style_footer() routine |
| 38 | ** will generate the appropriate HTML text just below the main |
| 39 | ** menu. |
| 40 | */ |
| @@ -51,13 +53,14 @@ | |
| 51 | short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */ |
| 52 | const char *const *azChoice;/* value/display pairs for FF_MULTI */ |
| 53 | const char *zFalse; /* FF_BINARY label when false */ |
| 54 | } aSubmenuCtrl[20]; |
| 55 | static int nSubmenuCtrl = 0; |
| 56 | #define FF_ENTRY 1 |
| 57 | #define FF_MULTI 2 |
| 58 | #define FF_BINARY 3 |
| 59 | |
| 60 | /* |
| 61 | ** Remember that the header has been generated. The footer is omitted |
| 62 | ** if an error occurs before the header. |
| 63 | */ |
| @@ -233,11 +236,11 @@ | |
| 233 | const char *zLabel, |
| 234 | const char *zLink, |
| 235 | ... |
| 236 | ){ |
| 237 | va_list ap; |
| 238 | assert( nSubmenu < sizeof(aSubmenu)/sizeof(aSubmenu[0]) ); |
| 239 | aSubmenu[nSubmenu].zLabel = zLabel; |
| 240 | va_start(ap, zLink); |
| 241 | aSubmenu[nSubmenu].zLink = vmprintf(zLink, ap); |
| 242 | va_end(ap); |
| 243 | nSubmenu++; |
| @@ -246,25 +249,37 @@ | |
| 246 | const char *zName, /* Query parameter name */ |
| 247 | const char *zLabel, /* Label before the entry box */ |
| 248 | int iSize, /* Size of the entry box */ |
| 249 | int isDisabled /* True if disabled */ |
| 250 | ){ |
| 251 | assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); |
| 252 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 253 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; |
| 254 | aSubmenuCtrl[nSubmenuCtrl].iSize = iSize; |
| 255 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 256 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY; |
| 257 | nSubmenuCtrl++; |
| 258 | } |
| 259 | void style_submenu_binary( |
| 260 | const char *zName, /* Query parameter name */ |
| 261 | const char *zTrue, /* Label to show when parameter is true */ |
| 262 | const char *zFalse, /* Label to show when the parameter is false */ |
| 263 | int isDisabled /* True if this control is disabled */ |
| 264 | ){ |
| 265 | assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); |
| 266 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 267 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue; |
| 268 | aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse; |
| 269 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 270 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY; |
| @@ -274,11 +289,11 @@ | |
| 274 | const char *zName, /* Query parameter name */ |
| 275 | int nChoice, /* Number of options */ |
| 276 | const char *const *azChoice,/* value/display pairs. 2*nChoice entries */ |
| 277 | int isDisabled /* True if this control is disabled */ |
| 278 | ){ |
| 279 | assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); |
| 280 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 281 | aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice; |
| 282 | aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice; |
| 283 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 284 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI; |
| @@ -521,81 +536,82 @@ | |
| 521 | }else{ |
| 522 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | if( nSubmenuCtrl>0 ){ |
| 527 | for(i=0; i<nSubmenuCtrl; i++){ |
| 528 | const char *zQPN = aSubmenuCtrl[i].zName; |
| 529 | const char *zDisabled = " disabled"; |
| 530 | if( !aSubmenuCtrl[i].isDisabled ){ |
| 531 | zDisabled = ""; |
| 532 | cgi_tag_query_parameter(zQPN); |
| 533 | } |
| 534 | switch( aSubmenuCtrl[i].eType ){ |
| 535 | case FF_ENTRY: { |
| 536 | cgi_printf( |
| 537 | "<span class='submenuctrl'>" |
| 538 | " %h<input type='text' name='%s'", |
| 539 | aSubmenuCtrl[i].zLabel, zQPN |
| 540 | ); |
| 541 | if( aSubmenuCtrl[i].iSize<0 ){ |
| 542 | cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize); |
| 543 | }else if( aSubmenuCtrl[i].iSize>0 ){ |
| 544 | cgi_printf( |
| 545 | " size='%d' maxlength='%d'", |
| 546 | aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize |
| 547 | ); |
| 548 | } |
| 549 | cgi_printf( |
| 550 | " value='%h'%s></span>\n", |
| 551 | PD(zQPN,""), zDisabled |
| 552 | ); |
| 553 | break; |
| 554 | } |
| 555 | case FF_MULTI: { |
| 556 | int j; |
| 557 | const char *zVal = P(zQPN); |
| 558 | if( aSubmenuCtrl[i].zLabel ){ |
| 559 | cgi_printf(" %h", aSubmenuCtrl[i].zLabel); |
| 560 | } |
| 561 | cgi_printf( |
| 562 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 563 | "onchange='gebi(\"f01\").submit();'>\n", |
| 564 | zQPN, zDisabled |
| 565 | ); |
| 566 | for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ |
| 567 | const char *zQPV = aSubmenuCtrl[i].azChoice[j]; |
| 568 | cgi_printf( |
| 569 | "<option value='%h'%s>%h</option>\n", |
| 570 | zQPV, |
| 571 | fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", |
| 572 | aSubmenuCtrl[i].azChoice[j+1] |
| 573 | ); |
| 574 | } |
| 575 | @ </select> |
| 576 | break; |
| 577 | } |
| 578 | case FF_BINARY: { |
| 579 | int isTrue = PB(zQPN); |
| 580 | cgi_printf( |
| 581 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 582 | "onchange='gebi(\"f01\").submit();'>\n", |
| 583 | zQPN, zDisabled |
| 584 | ); |
| 585 | cgi_printf( |
| 586 | "<option value='1'%s>%h</option>\n", |
| 587 | isTrue ? " selected":"", aSubmenuCtrl[i].zLabel |
| 588 | ); |
| 589 | cgi_printf( |
| 590 | "<option value='0'%s>%h</option>\n", |
| 591 | (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse |
| 592 | ); |
| 593 | @ </select> |
| 594 | break; |
| 595 | } |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | @ </div> |
| 600 | if( nSubmenuCtrl ){ |
| 601 | cgi_query_parameters_to_hidden(); |
| 602 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -30,11 +30,13 @@ | |
| 30 | ** Populate these structure with calls to |
| 31 | ** |
| 32 | ** style_submenu_element() |
| 33 | ** style_submenu_entry() |
| 34 | ** style_submenu_checkbox() |
| 35 | ** style_submenu_binary() |
| 36 | ** style_submenu_multichoice() |
| 37 | ** style_submenu_sql() |
| 38 | ** |
| 39 | ** prior to calling style_footer(). The style_footer() routine |
| 40 | ** will generate the appropriate HTML text just below the main |
| 41 | ** menu. |
| 42 | */ |
| @@ -51,13 +53,14 @@ | |
| 53 | short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */ |
| 54 | const char *const *azChoice;/* value/display pairs for FF_MULTI */ |
| 55 | const char *zFalse; /* FF_BINARY label when false */ |
| 56 | } aSubmenuCtrl[20]; |
| 57 | static int nSubmenuCtrl = 0; |
| 58 | #define FF_ENTRY 1 |
| 59 | #define FF_MULTI 2 |
| 60 | #define FF_BINARY 3 |
| 61 | #define FF_CHECKBOX 4 |
| 62 | |
| 63 | /* |
| 64 | ** Remember that the header has been generated. The footer is omitted |
| 65 | ** if an error occurs before the header. |
| 66 | */ |
| @@ -233,11 +236,11 @@ | |
| 236 | const char *zLabel, |
| 237 | const char *zLink, |
| 238 | ... |
| 239 | ){ |
| 240 | va_list ap; |
| 241 | assert( nSubmenu < count(aSubmenu) ); |
| 242 | aSubmenu[nSubmenu].zLabel = zLabel; |
| 243 | va_start(ap, zLink); |
| 244 | aSubmenu[nSubmenu].zLink = vmprintf(zLink, ap); |
| 245 | va_end(ap); |
| 246 | nSubmenu++; |
| @@ -246,25 +249,37 @@ | |
| 249 | const char *zName, /* Query parameter name */ |
| 250 | const char *zLabel, /* Label before the entry box */ |
| 251 | int iSize, /* Size of the entry box */ |
| 252 | int isDisabled /* True if disabled */ |
| 253 | ){ |
| 254 | assert( nSubmenuCtrl < count(aSubmenuCtrl) ); |
| 255 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 256 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; |
| 257 | aSubmenuCtrl[nSubmenuCtrl].iSize = iSize; |
| 258 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 259 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY; |
| 260 | nSubmenuCtrl++; |
| 261 | } |
| 262 | void style_submenu_checkbox( |
| 263 | const char *zName, /* Query parameter name */ |
| 264 | const char *zLabel, /* Label to display after the checkbox */ |
| 265 | int isDisabled /* True if disabled */ |
| 266 | ){ |
| 267 | assert( nSubmenuCtrl < count(aSubmenuCtrl) ); |
| 268 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 269 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; |
| 270 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 271 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX; |
| 272 | nSubmenuCtrl++; |
| 273 | } |
| 274 | void style_submenu_binary( |
| 275 | const char *zName, /* Query parameter name */ |
| 276 | const char *zTrue, /* Label to show when parameter is true */ |
| 277 | const char *zFalse, /* Label to show when the parameter is false */ |
| 278 | int isDisabled /* True if this control is disabled */ |
| 279 | ){ |
| 280 | assert( nSubmenuCtrl < count(aSubmenuCtrl) ); |
| 281 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 282 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue; |
| 283 | aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse; |
| 284 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 285 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY; |
| @@ -274,11 +289,11 @@ | |
| 289 | const char *zName, /* Query parameter name */ |
| 290 | int nChoice, /* Number of options */ |
| 291 | const char *const *azChoice,/* value/display pairs. 2*nChoice entries */ |
| 292 | int isDisabled /* True if this control is disabled */ |
| 293 | ){ |
| 294 | assert( nSubmenuCtrl < count(aSubmenuCtrl) ); |
| 295 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 296 | aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice; |
| 297 | aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice; |
| 298 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 299 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI; |
| @@ -521,81 +536,82 @@ | |
| 536 | }else{ |
| 537 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | for(i=0; i<nSubmenuCtrl; i++){ |
| 542 | const char *zQPN = aSubmenuCtrl[i].zName; |
| 543 | const char *zDisabled = " disabled"; |
| 544 | if( !aSubmenuCtrl[i].isDisabled ){ |
| 545 | zDisabled = ""; |
| 546 | cgi_tag_query_parameter(zQPN); |
| 547 | } |
| 548 | switch( aSubmenuCtrl[i].eType ){ |
| 549 | case FF_ENTRY: |
| 550 | cgi_printf( |
| 551 | "<span class='submenuctrl'>" |
| 552 | " %h<input type='text' name='%s' value='%h'%s", |
| 553 | aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled |
| 554 | ); |
| 555 | if( aSubmenuCtrl[i].iSize<0 ){ |
| 556 | cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize); |
| 557 | }else if( aSubmenuCtrl[i].iSize>0 ){ |
| 558 | cgi_printf( |
| 559 | " size='%d' maxlength='%d'", |
| 560 | aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize |
| 561 | ); |
| 562 | } |
| 563 | @ onchange='gebi("f01").submit();'></span> |
| 564 | break; |
| 565 | case FF_MULTI: { |
| 566 | int j; |
| 567 | const char *zVal = P(zQPN); |
| 568 | if( aSubmenuCtrl[i].zLabel ){ |
| 569 | cgi_printf(" %h", aSubmenuCtrl[i].zLabel); |
| 570 | } |
| 571 | cgi_printf( |
| 572 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 573 | "onchange='gebi(\"f01\").submit();'>\n", |
| 574 | zQPN, zDisabled |
| 575 | ); |
| 576 | for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ |
| 577 | const char *zQPV = aSubmenuCtrl[i].azChoice[j]; |
| 578 | cgi_printf( |
| 579 | "<option value='%h'%s>%h</option>\n", |
| 580 | zQPV, |
| 581 | fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", |
| 582 | aSubmenuCtrl[i].azChoice[j+1] |
| 583 | ); |
| 584 | } |
| 585 | @ </select> |
| 586 | break; |
| 587 | } |
| 588 | case FF_BINARY: { |
| 589 | int isTrue = PB(zQPN); |
| 590 | cgi_printf( |
| 591 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 592 | "onchange='gebi(\"f01\").submit();'>\n", |
| 593 | zQPN, zDisabled |
| 594 | ); |
| 595 | cgi_printf( |
| 596 | "<option value='1'%s>%h</option>\n", |
| 597 | isTrue ? " selected":"", aSubmenuCtrl[i].zLabel |
| 598 | ); |
| 599 | cgi_printf( |
| 600 | "<option value='0'%s>%h</option>\n", |
| 601 | (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse |
| 602 | ); |
| 603 | @ </select> |
| 604 | break; |
| 605 | } |
| 606 | case FF_CHECKBOX: |
| 607 | cgi_printf( |
| 608 | "<label class='submenuctrl'><input type='checkbox' name='%s' " |
| 609 | "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n", |
| 610 | zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel |
| 611 | ); |
| 612 | break; |
| 613 | } |
| 614 | } |
| 615 | @ </div> |
| 616 | if( nSubmenuCtrl ){ |
| 617 | cgi_query_parameters_to_hidden(); |
| 618 |
+1
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -2005,11 +2005,11 @@ | ||
| 2005 | 2005 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 2006 | 2006 | } |
| 2007 | 2007 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 2008 | 2008 | } |
| 2009 | 2009 | #endif |
| 2010 | - for(i=0; i<sizeof(aCommand)/sizeof(aCommand[0]); i++){ | |
| 2010 | + for(i=0; i<count(aCommand); i++){ | |
| 2011 | 2011 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 2012 | 2012 | Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, |
| 2013 | 2013 | aCommand[i].pContext, 0); |
| 2014 | 2014 | } |
| 2015 | 2015 | }else{ |
| 2016 | 2016 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 2006 | } |
| 2007 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 2008 | } |
| 2009 | #endif |
| 2010 | for(i=0; i<sizeof(aCommand)/sizeof(aCommand[0]); i++){ |
| 2011 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 2012 | Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, |
| 2013 | aCommand[i].pContext, 0); |
| 2014 | } |
| 2015 | }else{ |
| 2016 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 2006 | } |
| 2007 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 2008 | } |
| 2009 | #endif |
| 2010 | for(i=0; i<count(aCommand); i++){ |
| 2011 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 2012 | Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, |
| 2013 | aCommand[i].pContext, 0); |
| 2014 | } |
| 2015 | }else{ |
| 2016 |
+2
-2
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -833,11 +833,11 @@ | ||
| 833 | 833 | int i; |
| 834 | 834 | Th_Interp *th1Interp = (Th_Interp *)clientData; |
| 835 | 835 | |
| 836 | 836 | if( !th1Interp ) return; |
| 837 | 837 | /* Remove the Tcl integration commands. */ |
| 838 | - for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ | |
| 838 | + for(i=0; i<count(aCommand); i++){ | |
| 839 | 839 | Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0); |
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | /* |
| @@ -1261,11 +1261,11 @@ | ||
| 1261 | 1261 | void *pContext |
| 1262 | 1262 | ){ |
| 1263 | 1263 | int i; |
| 1264 | 1264 | |
| 1265 | 1265 | /* Add the Tcl integration commands to TH1. */ |
| 1266 | - for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ | |
| 1266 | + for(i=0; i<count(aCommand); i++){ | |
| 1267 | 1267 | void *ctx; |
| 1268 | 1268 | if( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1269 | 1269 | ctx = aCommand[i].pContext; |
| 1270 | 1270 | /* Use Tcl interpreter for context? */ |
| 1271 | 1271 | if( !ctx ) ctx = pContext; |
| 1272 | 1272 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | int i; |
| 834 | Th_Interp *th1Interp = (Th_Interp *)clientData; |
| 835 | |
| 836 | if( !th1Interp ) return; |
| 837 | /* Remove the Tcl integration commands. */ |
| 838 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 839 | Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0); |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | /* |
| @@ -1261,11 +1261,11 @@ | |
| 1261 | void *pContext |
| 1262 | ){ |
| 1263 | int i; |
| 1264 | |
| 1265 | /* Add the Tcl integration commands to TH1. */ |
| 1266 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 1267 | void *ctx; |
| 1268 | if( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1269 | ctx = aCommand[i].pContext; |
| 1270 | /* Use Tcl interpreter for context? */ |
| 1271 | if( !ctx ) ctx = pContext; |
| 1272 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | int i; |
| 834 | Th_Interp *th1Interp = (Th_Interp *)clientData; |
| 835 | |
| 836 | if( !th1Interp ) return; |
| 837 | /* Remove the Tcl integration commands. */ |
| 838 | for(i=0; i<count(aCommand); i++){ |
| 839 | Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0); |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | /* |
| @@ -1261,11 +1261,11 @@ | |
| 1261 | void *pContext |
| 1262 | ){ |
| 1263 | int i; |
| 1264 | |
| 1265 | /* Add the Tcl integration commands to TH1. */ |
| 1266 | for(i=0; i<count(aCommand); i++){ |
| 1267 | void *ctx; |
| 1268 | if( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1269 | ctx = aCommand[i].pContext; |
| 1270 | /* Use Tcl interpreter for context? */ |
| 1271 | if( !ctx ) ctx = pContext; |
| 1272 |
+8
-16
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | "SELECT pid FROM plink" |
| 391 | 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | 393 | ); |
| 394 | 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | - while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 395 | + while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ | |
| 396 | 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | 397 | } |
| 398 | 398 | db_reset(&qparent); |
| 399 | 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | ||
| 1186 | 1186 | } |
| 1187 | 1187 | if( g.perm.RdWiki ){ |
| 1188 | 1188 | az[i++] = "w"; |
| 1189 | 1189 | az[i++] = "Wiki"; |
| 1190 | 1190 | } |
| 1191 | - assert( i<=ArraySize(az) ); | |
| 1191 | + assert( i<=count(az) ); | |
| 1192 | 1192 | } |
| 1193 | 1193 | if( i>2 ){ |
| 1194 | 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | 1195 | } |
| 1196 | 1196 | } |
| @@ -1683,12 +1683,11 @@ | ||
| 1683 | 1683 | blob_append(&sql, ")", -1); |
| 1684 | 1684 | path_reset(); |
| 1685 | 1685 | addFileGlobExclusion(zChng, &sql); |
| 1686 | 1686 | tmFlags |= TIMELINE_DISJOINT; |
| 1687 | 1687 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1688 | - style_submenu_binary("v","With Files","Without Files", | |
| 1689 | - zType[0]!='a' && zType[0]!='c'); | |
| 1688 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1690 | 1689 | blob_appendf(&desc, "%d check-ins going from ", |
| 1691 | 1690 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1692 | 1691 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1693 | 1692 | blob_append(&desc, " to ", -1); |
| 1694 | 1693 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1734,14 +1733,13 @@ | ||
| 1734 | 1733 | if( p_rid ){ |
| 1735 | 1734 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1736 | 1735 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1737 | 1736 | } |
| 1738 | 1737 | } |
| 1738 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1739 | 1739 | style_submenu_entry("n","Max:",4,0); |
| 1740 | 1740 | timeline_y_submenu(1); |
| 1741 | - style_submenu_binary("v","With Files","Without Files", | |
| 1742 | - zType[0]!='a' && zType[0]!='c'); | |
| 1743 | 1741 | }else if( f_rid && g.perm.Read ){ |
| 1744 | 1742 | /* If f= is present, ignore all other parameters other than n= */ |
| 1745 | 1743 | char *zUuid; |
| 1746 | 1744 | db_multi_exec( |
| 1747 | 1745 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1755,15 +1753,12 @@ | ||
| 1755 | 1753 | if( useDividers ) selectedRid = f_rid; |
| 1756 | 1754 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1757 | 1755 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1758 | 1756 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1759 | 1757 | tmFlags |= TIMELINE_DISJOINT; |
| 1760 | - style_submenu_binary("v","With Files","Without Files", | |
| 1761 | - zType[0]!='a' && zType[0]!='c'); | |
| 1762 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1763 | - timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 1764 | - } | |
| 1758 | + style_submenu_checkbox("unhide", "Unhide", 0); | |
| 1759 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1765 | 1760 | }else{ |
| 1766 | 1761 | /* Otherwise, a timeline based on a span of time */ |
| 1767 | 1762 | int n; |
| 1768 | 1763 | const char *zEType = "timeline item"; |
| 1769 | 1764 | char *zDate; |
| @@ -2038,18 +2033,15 @@ | ||
| 2038 | 2033 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2039 | 2034 | } |
| 2040 | 2035 | free(zDate); |
| 2041 | 2036 | } |
| 2042 | 2037 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2043 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 2044 | - timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 2045 | - } | |
| 2038 | + style_submenu_checkbox("unhide", "Unhide", 0); | |
| 2046 | 2039 | } |
| 2040 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 2047 | 2041 | style_submenu_entry("n","Max:",4,0); |
| 2048 | 2042 | timeline_y_submenu(disableY); |
| 2049 | - style_submenu_binary("v","With Files","Without Files", | |
| 2050 | - zType[0]!='a' && zType[0]!='c'); | |
| 2051 | 2043 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2052 | 2044 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2053 | 2045 | } |
| 2054 | 2046 | blob_zero(&cond); |
| 2055 | 2047 | } |
| 2056 | 2048 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | "SELECT pid FROM plink" |
| 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | ); |
| 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ |
| 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | } |
| 398 | db_reset(&qparent); |
| 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | |
| 1186 | } |
| 1187 | if( g.perm.RdWiki ){ |
| 1188 | az[i++] = "w"; |
| 1189 | az[i++] = "Wiki"; |
| 1190 | } |
| 1191 | assert( i<=ArraySize(az) ); |
| 1192 | } |
| 1193 | if( i>2 ){ |
| 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | } |
| 1196 | } |
| @@ -1683,12 +1683,11 @@ | |
| 1683 | blob_append(&sql, ")", -1); |
| 1684 | path_reset(); |
| 1685 | addFileGlobExclusion(zChng, &sql); |
| 1686 | tmFlags |= TIMELINE_DISJOINT; |
| 1687 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1688 | style_submenu_binary("v","With Files","Without Files", |
| 1689 | zType[0]!='a' && zType[0]!='c'); |
| 1690 | blob_appendf(&desc, "%d check-ins going from ", |
| 1691 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1692 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1693 | blob_append(&desc, " to ", -1); |
| 1694 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1734,14 +1733,13 @@ | |
| 1734 | if( p_rid ){ |
| 1735 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1736 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1737 | } |
| 1738 | } |
| 1739 | style_submenu_entry("n","Max:",4,0); |
| 1740 | timeline_y_submenu(1); |
| 1741 | style_submenu_binary("v","With Files","Without Files", |
| 1742 | zType[0]!='a' && zType[0]!='c'); |
| 1743 | }else if( f_rid && g.perm.Read ){ |
| 1744 | /* If f= is present, ignore all other parameters other than n= */ |
| 1745 | char *zUuid; |
| 1746 | db_multi_exec( |
| 1747 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1755,15 +1753,12 @@ | |
| 1755 | if( useDividers ) selectedRid = f_rid; |
| 1756 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1757 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1758 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1759 | tmFlags |= TIMELINE_DISJOINT; |
| 1760 | style_submenu_binary("v","With Files","Without Files", |
| 1761 | zType[0]!='a' && zType[0]!='c'); |
| 1762 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1763 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1764 | } |
| 1765 | }else{ |
| 1766 | /* Otherwise, a timeline based on a span of time */ |
| 1767 | int n; |
| 1768 | const char *zEType = "timeline item"; |
| 1769 | char *zDate; |
| @@ -2038,18 +2033,15 @@ | |
| 2038 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2039 | } |
| 2040 | free(zDate); |
| 2041 | } |
| 2042 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2043 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 2044 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 2045 | } |
| 2046 | } |
| 2047 | style_submenu_entry("n","Max:",4,0); |
| 2048 | timeline_y_submenu(disableY); |
| 2049 | style_submenu_binary("v","With Files","Without Files", |
| 2050 | zType[0]!='a' && zType[0]!='c'); |
| 2051 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2052 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2053 | } |
| 2054 | blob_zero(&cond); |
| 2055 | } |
| 2056 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | "SELECT pid FROM plink" |
| 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | ); |
| 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | } |
| 398 | db_reset(&qparent); |
| 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | |
| 1186 | } |
| 1187 | if( g.perm.RdWiki ){ |
| 1188 | az[i++] = "w"; |
| 1189 | az[i++] = "Wiki"; |
| 1190 | } |
| 1191 | assert( i<=count(az) ); |
| 1192 | } |
| 1193 | if( i>2 ){ |
| 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | } |
| 1196 | } |
| @@ -1683,12 +1683,11 @@ | |
| 1683 | blob_append(&sql, ")", -1); |
| 1684 | path_reset(); |
| 1685 | addFileGlobExclusion(zChng, &sql); |
| 1686 | tmFlags |= TIMELINE_DISJOINT; |
| 1687 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1688 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1689 | blob_appendf(&desc, "%d check-ins going from ", |
| 1690 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1691 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1692 | blob_append(&desc, " to ", -1); |
| 1693 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1734,14 +1733,13 @@ | |
| 1733 | if( p_rid ){ |
| 1734 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1735 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1736 | } |
| 1737 | } |
| 1738 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1739 | style_submenu_entry("n","Max:",4,0); |
| 1740 | timeline_y_submenu(1); |
| 1741 | }else if( f_rid && g.perm.Read ){ |
| 1742 | /* If f= is present, ignore all other parameters other than n= */ |
| 1743 | char *zUuid; |
| 1744 | db_multi_exec( |
| 1745 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1755,15 +1753,12 @@ | |
| 1753 | if( useDividers ) selectedRid = f_rid; |
| 1754 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1755 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1756 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1757 | tmFlags |= TIMELINE_DISJOINT; |
| 1758 | style_submenu_checkbox("unhide", "Unhide", 0); |
| 1759 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1760 | }else{ |
| 1761 | /* Otherwise, a timeline based on a span of time */ |
| 1762 | int n; |
| 1763 | const char *zEType = "timeline item"; |
| 1764 | char *zDate; |
| @@ -2038,18 +2033,15 @@ | |
| 2033 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2034 | } |
| 2035 | free(zDate); |
| 2036 | } |
| 2037 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2038 | style_submenu_checkbox("unhide", "Unhide", 0); |
| 2039 | } |
| 2040 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 2041 | style_submenu_entry("n","Max:",4,0); |
| 2042 | timeline_y_submenu(disableY); |
| 2043 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2044 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2045 | } |
| 2046 | blob_zero(&cond); |
| 2047 | } |
| 2048 |
+8
-16
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | "SELECT pid FROM plink" |
| 391 | 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | 393 | ); |
| 394 | 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | - while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 395 | + while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ | |
| 396 | 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | 397 | } |
| 398 | 398 | db_reset(&qparent); |
| 399 | 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | ||
| 1186 | 1186 | } |
| 1187 | 1187 | if( g.perm.RdWiki ){ |
| 1188 | 1188 | az[i++] = "w"; |
| 1189 | 1189 | az[i++] = "Wiki"; |
| 1190 | 1190 | } |
| 1191 | - assert( i<=ArraySize(az) ); | |
| 1191 | + assert( i<=count(az) ); | |
| 1192 | 1192 | } |
| 1193 | 1193 | if( i>2 ){ |
| 1194 | 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | 1195 | } |
| 1196 | 1196 | } |
| @@ -1683,12 +1683,11 @@ | ||
| 1683 | 1683 | blob_append(&sql, ")", -1); |
| 1684 | 1684 | path_reset(); |
| 1685 | 1685 | addFileGlobExclusion(zChng, &sql); |
| 1686 | 1686 | tmFlags |= TIMELINE_DISJOINT; |
| 1687 | 1687 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1688 | - style_submenu_binary("v","With Files","Without Files", | |
| 1689 | - zType[0]!='a' && zType[0]!='c'); | |
| 1688 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1690 | 1689 | blob_appendf(&desc, "%d check-ins going from ", |
| 1691 | 1690 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1692 | 1691 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1693 | 1692 | blob_append(&desc, " to ", -1); |
| 1694 | 1693 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1734,14 +1733,13 @@ | ||
| 1734 | 1733 | if( p_rid ){ |
| 1735 | 1734 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1736 | 1735 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1737 | 1736 | } |
| 1738 | 1737 | } |
| 1738 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1739 | 1739 | style_submenu_entry("n","Max:",4,0); |
| 1740 | 1740 | timeline_y_submenu(1); |
| 1741 | - style_submenu_binary("v","With Files","Without Files", | |
| 1742 | - zType[0]!='a' && zType[0]!='c'); | |
| 1743 | 1741 | }else if( f_rid && g.perm.Read ){ |
| 1744 | 1742 | /* If f= is present, ignore all other parameters other than n= */ |
| 1745 | 1743 | char *zUuid; |
| 1746 | 1744 | db_multi_exec( |
| 1747 | 1745 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1755,15 +1753,12 @@ | ||
| 1755 | 1753 | if( useDividers ) selectedRid = f_rid; |
| 1756 | 1754 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1757 | 1755 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1758 | 1756 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1759 | 1757 | tmFlags |= TIMELINE_DISJOINT; |
| 1760 | - style_submenu_binary("v","With Files","Without Files", | |
| 1761 | - zType[0]!='a' && zType[0]!='c'); | |
| 1762 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1763 | - timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 1764 | - } | |
| 1758 | + style_submenu_checkbox("unhide", "Unhide", 0); | |
| 1759 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1765 | 1760 | }else{ |
| 1766 | 1761 | /* Otherwise, a timeline based on a span of time */ |
| 1767 | 1762 | int n; |
| 1768 | 1763 | const char *zEType = "timeline item"; |
| 1769 | 1764 | char *zDate; |
| @@ -2038,18 +2033,15 @@ | ||
| 2038 | 2033 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2039 | 2034 | } |
| 2040 | 2035 | free(zDate); |
| 2041 | 2036 | } |
| 2042 | 2037 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2043 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 2044 | - timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 2045 | - } | |
| 2038 | + style_submenu_checkbox("unhide", "Unhide", 0); | |
| 2046 | 2039 | } |
| 2040 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 2047 | 2041 | style_submenu_entry("n","Max:",4,0); |
| 2048 | 2042 | timeline_y_submenu(disableY); |
| 2049 | - style_submenu_binary("v","With Files","Without Files", | |
| 2050 | - zType[0]!='a' && zType[0]!='c'); | |
| 2051 | 2043 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2052 | 2044 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2053 | 2045 | } |
| 2054 | 2046 | blob_zero(&cond); |
| 2055 | 2047 | } |
| 2056 | 2048 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | "SELECT pid FROM plink" |
| 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | ); |
| 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ |
| 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | } |
| 398 | db_reset(&qparent); |
| 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | |
| 1186 | } |
| 1187 | if( g.perm.RdWiki ){ |
| 1188 | az[i++] = "w"; |
| 1189 | az[i++] = "Wiki"; |
| 1190 | } |
| 1191 | assert( i<=ArraySize(az) ); |
| 1192 | } |
| 1193 | if( i>2 ){ |
| 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | } |
| 1196 | } |
| @@ -1683,12 +1683,11 @@ | |
| 1683 | blob_append(&sql, ")", -1); |
| 1684 | path_reset(); |
| 1685 | addFileGlobExclusion(zChng, &sql); |
| 1686 | tmFlags |= TIMELINE_DISJOINT; |
| 1687 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1688 | style_submenu_binary("v","With Files","Without Files", |
| 1689 | zType[0]!='a' && zType[0]!='c'); |
| 1690 | blob_appendf(&desc, "%d check-ins going from ", |
| 1691 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1692 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1693 | blob_append(&desc, " to ", -1); |
| 1694 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1734,14 +1733,13 @@ | |
| 1734 | if( p_rid ){ |
| 1735 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1736 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1737 | } |
| 1738 | } |
| 1739 | style_submenu_entry("n","Max:",4,0); |
| 1740 | timeline_y_submenu(1); |
| 1741 | style_submenu_binary("v","With Files","Without Files", |
| 1742 | zType[0]!='a' && zType[0]!='c'); |
| 1743 | }else if( f_rid && g.perm.Read ){ |
| 1744 | /* If f= is present, ignore all other parameters other than n= */ |
| 1745 | char *zUuid; |
| 1746 | db_multi_exec( |
| 1747 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1755,15 +1753,12 @@ | |
| 1755 | if( useDividers ) selectedRid = f_rid; |
| 1756 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1757 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1758 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1759 | tmFlags |= TIMELINE_DISJOINT; |
| 1760 | style_submenu_binary("v","With Files","Without Files", |
| 1761 | zType[0]!='a' && zType[0]!='c'); |
| 1762 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1763 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1764 | } |
| 1765 | }else{ |
| 1766 | /* Otherwise, a timeline based on a span of time */ |
| 1767 | int n; |
| 1768 | const char *zEType = "timeline item"; |
| 1769 | char *zDate; |
| @@ -2038,18 +2033,15 @@ | |
| 2038 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2039 | } |
| 2040 | free(zDate); |
| 2041 | } |
| 2042 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2043 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 2044 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 2045 | } |
| 2046 | } |
| 2047 | style_submenu_entry("n","Max:",4,0); |
| 2048 | timeline_y_submenu(disableY); |
| 2049 | style_submenu_binary("v","With Files","Without Files", |
| 2050 | zType[0]!='a' && zType[0]!='c'); |
| 2051 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2052 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2053 | } |
| 2054 | blob_zero(&cond); |
| 2055 | } |
| 2056 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | "SELECT pid FROM plink" |
| 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | ); |
| 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | } |
| 398 | db_reset(&qparent); |
| 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | |
| 1186 | } |
| 1187 | if( g.perm.RdWiki ){ |
| 1188 | az[i++] = "w"; |
| 1189 | az[i++] = "Wiki"; |
| 1190 | } |
| 1191 | assert( i<=count(az) ); |
| 1192 | } |
| 1193 | if( i>2 ){ |
| 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | } |
| 1196 | } |
| @@ -1683,12 +1683,11 @@ | |
| 1683 | blob_append(&sql, ")", -1); |
| 1684 | path_reset(); |
| 1685 | addFileGlobExclusion(zChng, &sql); |
| 1686 | tmFlags |= TIMELINE_DISJOINT; |
| 1687 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1688 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1689 | blob_appendf(&desc, "%d check-ins going from ", |
| 1690 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1691 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1692 | blob_append(&desc, " to ", -1); |
| 1693 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1734,14 +1733,13 @@ | |
| 1733 | if( p_rid ){ |
| 1734 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1735 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1736 | } |
| 1737 | } |
| 1738 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1739 | style_submenu_entry("n","Max:",4,0); |
| 1740 | timeline_y_submenu(1); |
| 1741 | }else if( f_rid && g.perm.Read ){ |
| 1742 | /* If f= is present, ignore all other parameters other than n= */ |
| 1743 | char *zUuid; |
| 1744 | db_multi_exec( |
| 1745 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1755,15 +1753,12 @@ | |
| 1753 | if( useDividers ) selectedRid = f_rid; |
| 1754 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1755 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1756 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1757 | tmFlags |= TIMELINE_DISJOINT; |
| 1758 | style_submenu_checkbox("unhide", "Unhide", 0); |
| 1759 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1760 | }else{ |
| 1761 | /* Otherwise, a timeline based on a span of time */ |
| 1762 | int n; |
| 1763 | const char *zEType = "timeline item"; |
| 1764 | char *zDate; |
| @@ -2038,18 +2033,15 @@ | |
| 2033 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 2034 | } |
| 2035 | free(zDate); |
| 2036 | } |
| 2037 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 2038 | style_submenu_checkbox("unhide", "Unhide", 0); |
| 2039 | } |
| 2040 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 2041 | style_submenu_entry("n","Max:",4,0); |
| 2042 | timeline_y_submenu(disableY); |
| 2043 | style_submenu_entry("t", "Tag Filter:", -8, 0); |
| 2044 | style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0); |
| 2045 | } |
| 2046 | blob_zero(&cond); |
| 2047 | } |
| 2048 |
+3
-3
| --- src/unicode.c | ||
| +++ src/unicode.c | ||
| @@ -144,11 +144,11 @@ | ||
| 144 | 144 | if( (unsigned int)c<128 ){ |
| 145 | 145 | return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); |
| 146 | 146 | }else if( (unsigned int)c<(1<<22) ){ |
| 147 | 147 | unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; |
| 148 | 148 | int iRes = 0; |
| 149 | - int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; | |
| 149 | + int iHi = count(aEntry) - 1; | |
| 150 | 150 | int iLo = 0; |
| 151 | 151 | while( iHi>=iLo ){ |
| 152 | 152 | int iTest = (iHi + iLo) / 2; |
| 153 | 153 | if( key >= aEntry[iTest] ){ |
| 154 | 154 | iRes = iTest; |
| @@ -201,11 +201,11 @@ | ||
| 201 | 201 | 'e', 'i', 'o', 'u', 'y', |
| 202 | 202 | }; |
| 203 | 203 | |
| 204 | 204 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 205 | 205 | int iRes = 0; |
| 206 | - int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; | |
| 206 | + int iHi = count(aDia) - 1; | |
| 207 | 207 | int iLo = 0; |
| 208 | 208 | while( iHi>=iLo ){ |
| 209 | 209 | int iTest = (iHi + iLo) / 2; |
| 210 | 210 | if( key >= aDia[iTest] ){ |
| 211 | 211 | iRes = iTest; |
| @@ -348,11 +348,11 @@ | ||
| 348 | 348 | |
| 349 | 349 | if( c<128 ){ |
| 350 | 350 | if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
| 351 | 351 | }else if( c<65536 ){ |
| 352 | 352 | const struct TableEntry *p; |
| 353 | - int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; | |
| 353 | + int iHi = count(aEntry) - 1; | |
| 354 | 354 | int iLo = 0; |
| 355 | 355 | int iRes = -1; |
| 356 | 356 | |
| 357 | 357 | assert( c>aEntry[0].iCode ); |
| 358 | 358 | while( iHi>=iLo ){ |
| 359 | 359 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | if( (unsigned int)c<128 ){ |
| 145 | return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); |
| 146 | }else if( (unsigned int)c<(1<<22) ){ |
| 147 | unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; |
| 148 | int iRes = 0; |
| 149 | int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; |
| 150 | int iLo = 0; |
| 151 | while( iHi>=iLo ){ |
| 152 | int iTest = (iHi + iLo) / 2; |
| 153 | if( key >= aEntry[iTest] ){ |
| 154 | iRes = iTest; |
| @@ -201,11 +201,11 @@ | |
| 201 | 'e', 'i', 'o', 'u', 'y', |
| 202 | }; |
| 203 | |
| 204 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 205 | int iRes = 0; |
| 206 | int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; |
| 207 | int iLo = 0; |
| 208 | while( iHi>=iLo ){ |
| 209 | int iTest = (iHi + iLo) / 2; |
| 210 | if( key >= aDia[iTest] ){ |
| 211 | iRes = iTest; |
| @@ -348,11 +348,11 @@ | |
| 348 | |
| 349 | if( c<128 ){ |
| 350 | if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
| 351 | }else if( c<65536 ){ |
| 352 | const struct TableEntry *p; |
| 353 | int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; |
| 354 | int iLo = 0; |
| 355 | int iRes = -1; |
| 356 | |
| 357 | assert( c>aEntry[0].iCode ); |
| 358 | while( iHi>=iLo ){ |
| 359 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | if( (unsigned int)c<128 ){ |
| 145 | return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); |
| 146 | }else if( (unsigned int)c<(1<<22) ){ |
| 147 | unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; |
| 148 | int iRes = 0; |
| 149 | int iHi = count(aEntry) - 1; |
| 150 | int iLo = 0; |
| 151 | while( iHi>=iLo ){ |
| 152 | int iTest = (iHi + iLo) / 2; |
| 153 | if( key >= aEntry[iTest] ){ |
| 154 | iRes = iTest; |
| @@ -201,11 +201,11 @@ | |
| 201 | 'e', 'i', 'o', 'u', 'y', |
| 202 | }; |
| 203 | |
| 204 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 205 | int iRes = 0; |
| 206 | int iHi = count(aDia) - 1; |
| 207 | int iLo = 0; |
| 208 | while( iHi>=iLo ){ |
| 209 | int iTest = (iHi + iLo) / 2; |
| 210 | if( key >= aDia[iTest] ){ |
| 211 | iRes = iTest; |
| @@ -348,11 +348,11 @@ | |
| 348 | |
| 349 | if( c<128 ){ |
| 350 | if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
| 351 | }else if( c<65536 ){ |
| 352 | const struct TableEntry *p; |
| 353 | int iHi = count(aEntry) - 1; |
| 354 | int iLo = 0; |
| 355 | int iRes = -1; |
| 356 | |
| 357 | assert( c>aEntry[0].iCode ); |
| 358 | while( iHi>=iLo ){ |
| 359 |
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -435,11 +435,11 @@ | ||
| 435 | 435 | for(; zName[0]!=0; zName++){ |
| 436 | 436 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 437 | 437 | return 1; |
| 438 | 438 | } |
| 439 | 439 | if( zName[0]!='-' ) continue; |
| 440 | - for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ | |
| 440 | + for(i=0; i<count(azTemp); i++){ | |
| 441 | 441 | n = (int)strlen(azTemp[i]); |
| 442 | 442 | if( memcmp(azTemp[i], zName+1, n) ) continue; |
| 443 | 443 | if( zName[n+1]==0 ) return 1; |
| 444 | 444 | if( zName[n+1]=='-' ){ |
| 445 | 445 | for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){} |
| 446 | 446 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -435,11 +435,11 @@ | |
| 435 | for(; zName[0]!=0; zName++){ |
| 436 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 437 | return 1; |
| 438 | } |
| 439 | if( zName[0]!='-' ) continue; |
| 440 | for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ |
| 441 | n = (int)strlen(azTemp[i]); |
| 442 | if( memcmp(azTemp[i], zName+1, n) ) continue; |
| 443 | if( zName[n+1]==0 ) return 1; |
| 444 | if( zName[n+1]=='-' ){ |
| 445 | for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){} |
| 446 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -435,11 +435,11 @@ | |
| 435 | for(; zName[0]!=0; zName++){ |
| 436 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 437 | return 1; |
| 438 | } |
| 439 | if( zName[0]!='-' ) continue; |
| 440 | for(i=0; i<count(azTemp); i++){ |
| 441 | n = (int)strlen(azTemp[i]); |
| 442 | if( memcmp(azTemp[i], zName+1, n) ) continue; |
| 443 | if( zName[n+1]==0 ) return 1; |
| 444 | if( zName[n+1]=='-' ){ |
| 445 | for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){} |
| 446 |
+2
-2
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | ** All others become "text/x-fossil-wiki" |
| 139 | 139 | */ |
| 140 | 140 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 141 | 141 | if( zMimetype!=0 ){ |
| 142 | 142 | int i; |
| 143 | - for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ | |
| 143 | + for(i=0; i<count(azStyles); i+=3){ | |
| 144 | 144 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 145 | 145 | return azStyles[i]; |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| @@ -428,11 +428,11 @@ | ||
| 428 | 428 | ** wiki mimetype. |
| 429 | 429 | */ |
| 430 | 430 | void mimetype_option_menu(const char *zMimetype){ |
| 431 | 431 | unsigned i; |
| 432 | 432 | @ <select name="mimetype" size="1"> |
| 433 | - for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ | |
| 433 | + for(i=0; i<count(azStyles); i+=3){ | |
| 434 | 434 | if( fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 435 | 435 | @ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option> |
| 436 | 436 | }else{ |
| 437 | 437 | @ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option> |
| 438 | 438 | } |
| 439 | 439 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | ** All others become "text/x-fossil-wiki" |
| 139 | */ |
| 140 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 141 | if( zMimetype!=0 ){ |
| 142 | int i; |
| 143 | for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ |
| 144 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 145 | return azStyles[i]; |
| 146 | } |
| 147 | } |
| 148 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| @@ -428,11 +428,11 @@ | |
| 428 | ** wiki mimetype. |
| 429 | */ |
| 430 | void mimetype_option_menu(const char *zMimetype){ |
| 431 | unsigned i; |
| 432 | @ <select name="mimetype" size="1"> |
| 433 | for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ |
| 434 | if( fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 435 | @ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option> |
| 436 | }else{ |
| 437 | @ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option> |
| 438 | } |
| 439 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | ** All others become "text/x-fossil-wiki" |
| 139 | */ |
| 140 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 141 | if( zMimetype!=0 ){ |
| 142 | int i; |
| 143 | for(i=0; i<count(azStyles); i+=3){ |
| 144 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 145 | return azStyles[i]; |
| 146 | } |
| 147 | } |
| 148 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| @@ -428,11 +428,11 @@ | |
| 428 | ** wiki mimetype. |
| 429 | */ |
| 430 | void mimetype_option_menu(const char *zMimetype){ |
| 431 | unsigned i; |
| 432 | @ <select name="mimetype" size="1"> |
| 433 | for(i=0; i<count(azStyles); i+=3){ |
| 434 | if( fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 435 | @ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option> |
| 436 | }else{ |
| 437 | @ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option> |
| 438 | } |
| 439 |
+4
-4
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -145,11 +145,11 @@ | ||
| 145 | 145 | ** Use binary search to locate a tag in the aAttribute[] table. |
| 146 | 146 | */ |
| 147 | 147 | static int findAttr(const char *z){ |
| 148 | 148 | int i, c, first, last; |
| 149 | 149 | first = 1; |
| 150 | - last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1; | |
| 150 | + last = count(aAttribute) - 1; | |
| 151 | 151 | while( first<=last ){ |
| 152 | 152 | i = (first+last)/2; |
| 153 | 153 | c = fossil_strcmp(aAttribute[i].zName, z); |
| 154 | 154 | if( c==0 ){ |
| 155 | 155 | return i; |
| @@ -372,11 +372,11 @@ | ||
| 372 | 372 | AMSK_ID|AMSK_TYPE }, |
| 373 | 373 | }; |
| 374 | 374 | |
| 375 | 375 | void show_allowed_wiki_markup( void ){ |
| 376 | 376 | int i; /* loop over allowedAttr */ |
| 377 | - for( i=1 ; i<=sizeof(aMarkup)/sizeof(aMarkup[0]) - 1 ; i++ ){ | |
| 377 | + for( i=1 ; i<=count(aMarkup) - 1 ; i++ ){ | |
| 378 | 378 | @ <%s(aMarkup[i].zName)> |
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /* |
| @@ -383,11 +383,11 @@ | ||
| 383 | 383 | ** Use binary search to locate a tag in the aMarkup[] table. |
| 384 | 384 | */ |
| 385 | 385 | static int findTag(const char *z){ |
| 386 | 386 | int i, c, first, last; |
| 387 | 387 | first = 1; |
| 388 | - last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1; | |
| 388 | + last = count(aMarkup) - 1; | |
| 389 | 389 | while( first<=last ){ |
| 390 | 390 | i = (first+last)/2; |
| 391 | 391 | c = fossil_strcmp(aMarkup[i].zName, z); |
| 392 | 392 | if( c==0 ){ |
| 393 | 393 | assert( aMarkup[i].iCode==i ); |
| @@ -2187,11 +2187,11 @@ | ||
| 2187 | 2187 | { 4, '<', "<" }, |
| 2188 | 2188 | { 4, '>', ">" }, |
| 2189 | 2189 | { 6, ' ', " " }, |
| 2190 | 2190 | }; |
| 2191 | 2191 | int jj; |
| 2192 | - for(jj=0; jj<ArraySize(aEntity); jj++){ | |
| 2192 | + for(jj=0; jj<count(aEntity); jj++){ | |
| 2193 | 2193 | if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){ |
| 2194 | 2194 | c = aEntity[jj].c; |
| 2195 | 2195 | break; |
| 2196 | 2196 | } |
| 2197 | 2197 | } |
| 2198 | 2198 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -145,11 +145,11 @@ | |
| 145 | ** Use binary search to locate a tag in the aAttribute[] table. |
| 146 | */ |
| 147 | static int findAttr(const char *z){ |
| 148 | int i, c, first, last; |
| 149 | first = 1; |
| 150 | last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1; |
| 151 | while( first<=last ){ |
| 152 | i = (first+last)/2; |
| 153 | c = fossil_strcmp(aAttribute[i].zName, z); |
| 154 | if( c==0 ){ |
| 155 | return i; |
| @@ -372,11 +372,11 @@ | |
| 372 | AMSK_ID|AMSK_TYPE }, |
| 373 | }; |
| 374 | |
| 375 | void show_allowed_wiki_markup( void ){ |
| 376 | int i; /* loop over allowedAttr */ |
| 377 | for( i=1 ; i<=sizeof(aMarkup)/sizeof(aMarkup[0]) - 1 ; i++ ){ |
| 378 | @ <%s(aMarkup[i].zName)> |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /* |
| @@ -383,11 +383,11 @@ | |
| 383 | ** Use binary search to locate a tag in the aMarkup[] table. |
| 384 | */ |
| 385 | static int findTag(const char *z){ |
| 386 | int i, c, first, last; |
| 387 | first = 1; |
| 388 | last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1; |
| 389 | while( first<=last ){ |
| 390 | i = (first+last)/2; |
| 391 | c = fossil_strcmp(aMarkup[i].zName, z); |
| 392 | if( c==0 ){ |
| 393 | assert( aMarkup[i].iCode==i ); |
| @@ -2187,11 +2187,11 @@ | |
| 2187 | { 4, '<', "<" }, |
| 2188 | { 4, '>', ">" }, |
| 2189 | { 6, ' ', " " }, |
| 2190 | }; |
| 2191 | int jj; |
| 2192 | for(jj=0; jj<ArraySize(aEntity); jj++){ |
| 2193 | if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){ |
| 2194 | c = aEntity[jj].c; |
| 2195 | break; |
| 2196 | } |
| 2197 | } |
| 2198 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -145,11 +145,11 @@ | |
| 145 | ** Use binary search to locate a tag in the aAttribute[] table. |
| 146 | */ |
| 147 | static int findAttr(const char *z){ |
| 148 | int i, c, first, last; |
| 149 | first = 1; |
| 150 | last = count(aAttribute) - 1; |
| 151 | while( first<=last ){ |
| 152 | i = (first+last)/2; |
| 153 | c = fossil_strcmp(aAttribute[i].zName, z); |
| 154 | if( c==0 ){ |
| 155 | return i; |
| @@ -372,11 +372,11 @@ | |
| 372 | AMSK_ID|AMSK_TYPE }, |
| 373 | }; |
| 374 | |
| 375 | void show_allowed_wiki_markup( void ){ |
| 376 | int i; /* loop over allowedAttr */ |
| 377 | for( i=1 ; i<=count(aMarkup) - 1 ; i++ ){ |
| 378 | @ <%s(aMarkup[i].zName)> |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /* |
| @@ -383,11 +383,11 @@ | |
| 383 | ** Use binary search to locate a tag in the aMarkup[] table. |
| 384 | */ |
| 385 | static int findTag(const char *z){ |
| 386 | int i, c, first, last; |
| 387 | first = 1; |
| 388 | last = count(aMarkup) - 1; |
| 389 | while( first<=last ){ |
| 390 | i = (first+last)/2; |
| 391 | c = fossil_strcmp(aMarkup[i].zName, z); |
| 392 | if( c==0 ){ |
| 393 | assert( aMarkup[i].iCode==i ); |
| @@ -2187,11 +2187,11 @@ | |
| 2187 | { 4, '<', "<" }, |
| 2188 | { 4, '>', ">" }, |
| 2189 | { 6, ' ', " " }, |
| 2190 | }; |
| 2191 | int jj; |
| 2192 | for(jj=0; jj<count(aEntity); jj++){ |
| 2193 | if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){ |
| 2194 | c = aEntity[jj].c; |
| 2195 | break; |
| 2196 | } |
| 2197 | } |
| 2198 |