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:".

andygoth 2016-11-05 03:34 andygoth-timeline-ms merge
Commit 74fe9587f86ea2cb32cbffd87f8d6a2b21d3734c
--- skins/black_and_white/css.txt
+++ skins/black_and_white/css.txt
@@ -106,16 +106,16 @@
106106
border-width:1px 0px;
107107
background-color: #eee;
108108
color: #333;
109109
}
110110
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 {
112112
padding: 3px 10px 3px 10px;
113113
color: #333;
114114
text-decoration: none;
115115
}
116
-div.submenu a:hover, div.sectionmenu>a.button:hover {
116
+div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover {
117117
color: #eee;
118118
background-color: #333;
119119
}
120120
121121
/* All page content from the bottom of the menu or submenu down to
122122
--- 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
--- skins/blitz/css.txt
+++ skins/blitz/css.txt
@@ -894,19 +894,19 @@
894894
895895
.submenu input, .submenu select {
896896
margin: 0 0 0 5px;
897897
}
898898
899
-.submenu a {
899
+.submenu a, .submenu label {
900900
color: #3b5c6b;
901901
padding: 5px 15px;
902902
text-decoration: none;
903903
border: 1px solid transparent;
904904
border-radius: 5px;
905905
}
906906
907
-.submenu a:hover {
907
+.submenu a:hover, .submenu label:hover {
908908
border: 1px solid #ccc;
909909
}
910910
911911
912912
/* Section
913913
--- 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
--- skins/blitz_no_logo/css.txt
+++ skins/blitz_no_logo/css.txt
@@ -894,19 +894,19 @@
894894
895895
.submenu input, .submenu select {
896896
margin: 0 0 0 5px;
897897
}
898898
899
-.submenu a {
899
+.submenu a, .submenu label {
900900
color: #3b5c6b;
901901
padding: 5px 15px;
902902
text-decoration: none;
903903
border: 1px solid transparent;
904904
border-radius: 5px;
905905
}
906906
907
-.submenu a:hover {
907
+.submenu a:hover, .submenu label:hover {
908908
border: 1px solid #ccc;
909909
}
910910
911911
912912
/* Section
913913
--- 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
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -104,17 +104,17 @@
104104
margin-top: 10px;
105105
padding: 10px;
106106
border-bottom: 1px solid #ccc;
107107
}
108108
109
-.submenu a {
109
+.submenu a, .submenu label {
110110
padding: 10px 11px;
111111
text-decoration:none;
112112
color: #777;
113113
}
114114
115
-.submenu a:hover {
115
+.submenu a:hover, .submenu label:hover {
116116
padding: 6px 10px;
117117
border: 1px solid #ccc;
118118
border-radius: 5px;
119119
color: #000;
120120
}
121121
--- 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
--- skins/eagle/css.txt
+++ skins/eagle/css.txt
@@ -73,16 +73,18 @@
7373
text-align: center;
7474
background-color: #485D7B;
7575
color: white;
7676
}
7777
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 {
7980
padding: 3px 10px 3px 10px;
8081
color: white;
8182
text-decoration: none;
8283
}
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 {
8486
text-decoration: underline;
8587
}
8688
8789
/* All page content from the bottom of the menu or submenu down to
8890
** the footer */
8991
--- 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
--- skins/enhanced1/css.txt
+++ skins/enhanced1/css.txt
@@ -71,16 +71,18 @@
7171
text-align: center;
7272
background-color: #456878;
7373
color: white;
7474
}
7575
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 {
7778
padding: 3px 10px 3px 10px;
7879
color: white;
7980
text-decoration: none;
8081
}
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 {
8284
color: #558195;
8385
background-color: white;
8486
}
8587
8688
/* All page content from the bottom of the menu or submenu down to
8789
--- 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
--- skins/khaki/css.txt
+++ skins/khaki/css.txt
@@ -69,16 +69,18 @@
6969
text-align: center;
7070
background-color: #c0af58;
7171
color: white;
7272
}
7373
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 {
7576
padding: 3px 10px 3px 10px;
7677
color: white;
7778
text-decoration: none;
7879
}
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 {
8082
color: #a09048;
8183
background-color: white;
8284
}
8385
8486
/* All page content from the bottom of the menu or submenu down to
8587
--- 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
--- skins/original/css.txt
+++ skins/original/css.txt
@@ -71,16 +71,18 @@
7171
text-align: center;
7272
background-color: #456878;
7373
color: white;
7474
}
7575
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 {
7778
padding: 3px 10px 3px 10px;
7879
color: white;
7980
text-decoration: none;
8081
}
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 {
8284
color: #558195;
8385
background-color: white;
8486
}
8587
8688
/* All page content from the bottom of the menu or submenu down to
8789
--- 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
--- skins/plain_gray/css.txt
+++ skins/plain_gray/css.txt
@@ -71,16 +71,18 @@
7171
text-align: center;
7272
background-color: #606060;
7373
color: white;
7474
}
7575
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 {
7778
padding: 3px 10px 3px 10px;
7879
color: white;
7980
text-decoration: none;
8081
}
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 {
8284
color: #404040;
8385
background-color: white;
8486
}
8587
8688
/* All page content from the bottom of the menu or submenu down to
8789
--- 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
--- skins/rounded1/css.txt
+++ skins/rounded1/css.txt
@@ -84,11 +84,11 @@
8484
div.mainmenu a, div.mainmenu a:visited {
8585
padding: 3px 10px 3px 10px;
8686
color: white;
8787
text-decoration: none;
8888
}
89
-div.submenu a, div.submenu a:visited, a.button,
89
+div.submenu a, div.submenu a:visited, a.button, div.submenu label
9090
div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited {
9191
padding: 2px 8px;
9292
color: #000;
9393
font-family: Arial;
9494
text-decoration: none;
@@ -102,11 +102,11 @@
102102
div.mainmenu a:hover {
103103
color: #000;
104104
background-color: white;
105105
}
106106
107
-div.submenu a:hover, div.sectionmenu>a.button:hover {
107
+div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover {
108108
background-color: #c0c0c0;
109109
}
110110
111111
/* All page content from the bottom of the menu or submenu down to
112112
** the footer */
113113
--- 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
--- skins/xekri/css.txt
+++ skins/xekri/css.txt
@@ -158,17 +158,17 @@
158158
border-top: 1px solid #0a0;
159159
border-radius: 0;
160160
display: block;
161161
}
162162
163
-div.mainmenu a, div.submenu a {
163
+div.mainmenu a, div.submenu a, div.submenu label {
164164
color: #000;
165165
padding: 0 0.75rem;
166166
text-decoration: none;
167167
}
168168
169
-div.mainmenu a:hover, div.submenu a:hover {
169
+div.mainmenu a:hover, div.submenu a:hover, div.submenu label:hover {
170170
color: #fff;
171171
text-shadow: 0px 0px 6px #0f0;
172172
}
173173
174174
div.submenu * {
175175
--- 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 @@
7575
** Return the value of a boolean bisect option.
7676
*/
7777
int bisect_option(const char *zName){
7878
unsigned int i;
7979
int r = -1;
80
- for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
80
+ for(i=0; i<count(aBisectOption); i++){
8181
if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){
8282
char *zLabel = mprintf("bisect-%s", zName);
8383
char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault);
8484
if( is_truth(z) ) r = 1;
8585
if( is_false(z) ) r = 0;
@@ -406,21 +406,21 @@
406406
}else if( strncmp(zCmd, "chart", n)==0 ){
407407
bisect_chart(1);
408408
}else if( strncmp(zCmd, "options", n)==0 ){
409409
if( g.argc==3 ){
410410
unsigned int i;
411
- for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
411
+ for(i=0; i<count(aBisectOption); i++){
412412
char *z = mprintf("bisect-%s", aBisectOption[i].zName);
413413
fossil_print(" %-15s %-6s ", aBisectOption[i].zName,
414414
db_lget(z, (char*)aBisectOption[i].zDefault));
415415
fossil_free(z);
416416
comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags);
417417
}
418418
}else if( g.argc==4 || g.argc==5 ){
419419
unsigned int i;
420420
n = strlen(g.argv[3]);
421
- for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){
421
+ for(i=0; i<count(aBisectOption); i++){
422422
if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){
423423
char *z = mprintf("bisect-%s", aBisectOption[i].zName);
424424
if( g.argc==5 ){
425425
db_lset(z, g.argv[4]);
426426
}
@@ -427,11 +427,11 @@
427427
fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault));
428428
fossil_free(z);
429429
break;
430430
}
431431
}
432
- if( i>=sizeof(aBisectOption)/sizeof(aBisectOption[0]) ){
432
+ if( i>=count(aBisectOption) ){
433433
fossil_fatal("no such bisect option: %s", g.argv[3]);
434434
}
435435
}else{
436436
usage("options ?NAME? ?VALUE?");
437437
}
438438
--- 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 @@
350350
int show_colors = PB("colors");
351351
login_check_credentials();
352352
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
353353
style_header("Branches");
354354
style_adunit_config(ADUNIT_RIGHT_OK);
355
- style_submenu_binary("colors", "Color", "B/W", 0);
355
+ style_submenu_checkbox("colors", "Use Branch Colors", 0);
356356
login_anonymous_available();
357357
358358
db_prepare(&q, brlistQuery/*works-like:""*/);
359359
rNow = db_double(0.0, "SELECT julianday('now')");
360360
@ <div class="brlist"><table id="branchlisttable">
361361
--- 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 @@
3333
** Return a pointer to built-in content
3434
*/
3535
const unsigned char *builtin_file(const char *zFilename, int *piSize){
3636
int lwr, upr, i, c;
3737
lwr = 0;
38
- upr = sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]) - 1;
38
+ upr = count(aBuiltinFiles) - 1;
3939
while( upr>=lwr ){
4040
i = (upr+lwr)/2;
4141
c = strcmp(aBuiltinFiles[i].zName,zFilename);
4242
if( c<0 ){
4343
lwr = i+1;
@@ -60,11 +60,11 @@
6060
**
6161
** List the names and sizes of all built-in resources.
6262
*/
6363
void test_builtin_list(void){
6464
int i;
65
- for(i=0; i<sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]); i++){
65
+ for(i=0; i<count(aBuiltinFiles); i++){
6666
fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte);
6767
}
6868
}
6969
7070
/*
7171
--- 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 @@
719719
}
720720
}
721721
zName = 0;
722722
showBytes = 0;
723723
}else{
724
- nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg);
724
+ nArg = tokenize_line(zLine, count(azArg), azArg);
725725
for(i=0; i<nArg; i++){
726726
int c = fossil_tolower(azArg[i][0]);
727727
int n = strlen(azArg[i]);
728728
if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){
729729
i++;
730730
--- 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
+1 -1
--- src/db.c
+++ src/db.c
@@ -2799,11 +2799,11 @@
27992799
*/
28002800
const Setting *db_find_setting(const char *zName, int allowPrefix){
28012801
int lwr, mid, upr, c;
28022802
int n = (int)strlen(zName) + !allowPrefix;
28032803
lwr = 0;
2804
- upr = ArraySize(aSetting)-2;
2804
+ upr = count(aSetting)-2;
28052805
while( upr>=lwr ){
28062806
mid = (upr+lwr)/2;
28072807
c = fossil_strncmp(zName, aSetting[mid].name, n);
28082808
if( c<0 ){
28092809
upr = mid - 1;
28102810
--- 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 @@
10681068
if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen);
10691069
if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen);
10701070
return aM;
10711071
}
10721072
1073
- if( nRight < (sizeof(aBuf)/sizeof(aBuf[0]))-1 ){
1073
+ if( nRight < count(aBuf)-1 ){
10741074
pToFree = 0;
10751075
a = aBuf;
10761076
}else{
10771077
a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) );
10781078
}
10791079
--- 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 @@
6969
** The page_index.h file is generated by the mkindex program which scans all
7070
** source code files looking for header comments on the functions that
7171
** implement command and webpages.
7272
*/
7373
#include "page_index.h"
74
-#define MX_COMMAND (sizeof(aCommand)/sizeof(aCommand[0]))
74
+#define MX_COMMAND count(aCommand)
7575
7676
/*
7777
** Given a command or webpage name in zName, find the corresponding CmdOrPage
7878
** object and return a pointer to that object in *ppCmd.
7979
**
8080
--- 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 @@
5454
if( !looks_like_binary(pBlob) ) {
5555
return 0; /* Plain text */
5656
}
5757
x = (const unsigned char*)blob_buffer(pBlob);
5858
n = blob_size(pBlob);
59
- for(i=0; i<ArraySize(aMime); i++){
59
+ for(i=0; i<count(aMime); i++){
6060
if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){
6161
return aMime[i].zMimetype;
6262
}
6363
}
6464
return "unknown/unknown";
@@ -293,11 +293,11 @@
293293
** Verify that all entries in the aMime[] table are in sorted order.
294294
** Abort with a fatal error if any is out-of-order.
295295
*/
296296
static void mimetype_verify(void){
297297
int i;
298
- for(i=1; i<ArraySize(aMime); i++){
298
+ for(i=1; i<count(aMime); i++){
299299
if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){
300300
fossil_fatal("mimetypes out of sequence: %s before %s",
301301
aMime[i-1].zSuffix, aMime[i].zSuffix);
302302
}
303303
}
@@ -331,11 +331,11 @@
331331
len = strlen(z);
332332
if( len<sizeof(zSuffix)-1 ){
333333
sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z);
334334
for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]);
335335
first = 0;
336
- last = ArraySize(aMime) - 1;
336
+ last = count(aMime) - 1;
337337
while( first<=last ){
338338
int c;
339339
i = (first+last)/2;
340340
c = fossil_strcmp(zSuffix, aMime[i].zSuffix);
341341
if( c==0 ) return aMime[i].zMimetype;
@@ -384,11 +384,11 @@
384384
@ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'>
385385
@ <thead>
386386
@ <tr><th>Suffix<th>Mimetype
387387
@ </thead>
388388
@ <tbody>
389
- for(i=0; i<ArraySize(aMime); i++){
389
+ for(i=0; i<count(aMime); i++){
390390
@ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr>
391391
}
392392
@ </tbody></table>
393393
output_table_sorting_javascript("mimeTable","tt",1);
394394
style_footer();
@@ -593,11 +593,11 @@
593593
login_check_credentials();
594594
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
595595
blob_init(&title, 0, 0);
596596
zDfltTitle = isUV ? "" : "Documentation";
597597
db_begin_transaction();
598
- while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){
598
+ while( rid==0 && (++nMiss)<=count(azSuffix) ){
599599
zName = P("name");
600600
if( isUV ){
601601
if( zName==0 ) zName = "index.wiki";
602602
i = 0;
603603
}else{
@@ -606,14 +606,14 @@
606606
zCheckin = mprintf("%.*s", i, zName);
607607
if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){
608608
zCheckin = "tip";
609609
}
610610
}
611
- if( nMiss==ArraySize(azSuffix) ){
611
+ if( nMiss==count(azSuffix) ){
612612
zName = "404.md";
613613
}else if( zName[i]==0 ){
614
- assert( nMiss>=0 && nMiss<ArraySize(azSuffix) );
614
+ assert( nMiss>=0 && nMiss<count(azSuffix) );
615615
zName = azSuffix[nMiss];
616616
}else if( !isUV ){
617617
zName += i;
618618
}
619619
while( zName[0]=='/' ){ zName++; }
@@ -623,11 +623,11 @@
623623
g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName);
624624
}
625625
if( nMiss==0 ) zOrigName = zName;
626626
if( !file_is_simple_pathname(zName, 1) ){
627627
if( sqlite3_strglob("*/", zName)==0 ){
628
- assert( nMiss>=0 && nMiss<ArraySize(azSuffix) );
628
+ assert( nMiss>=0 && nMiss<count(azSuffix) );
629629
zName = mprintf("%s%s", zName, azSuffix[nMiss]);
630630
if( !file_is_simple_pathname(zName, 1) ){
631631
goto doc_not_found;
632632
}
633633
}else{
@@ -686,11 +686,11 @@
686686
Blob tail = BLOB_INITIALIZER;
687687
markdown_to_html(&filebody, &title, &tail);
688688
if( blob_size(&title)>0 ){
689689
style_header("%s", blob_str(&title));
690690
}else{
691
- style_header("%s", nMiss>=ArraySize(azSuffix)?
691
+ style_header("%s", nMiss>=count(azSuffix)?
692692
"Not Found" : zDfltTitle);
693693
}
694694
convert_href_and_output(&tail);
695695
style_footer();
696696
}else if( fossil_strcmp(zMime, "text/plain")==0 ){
@@ -719,11 +719,11 @@
719719
#endif
720720
}else{
721721
cgi_set_content_type(zMime);
722722
cgi_set_content(&filebody);
723723
}
724
- if( nMiss>=ArraySize(azSuffix) ) cgi_set_status(404, "Not Found");
724
+ if( nMiss>=count(azSuffix) ) cgi_set_status(404, "Not Found");
725725
db_end_transaction(0);
726726
return;
727727
728728
/* Jump here when unable to locate the document */
729729
doc_not_found:
730730
--- 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 @@
12901290
azDirs[1] = fossil_getenv("TEMP");
12911291
azDirs[2] = fossil_getenv("TMP");
12921292
#endif
12931293
12941294
1295
- for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){
1295
+ for(i=0; i<count(azDirs); i++){
12961296
if( azDirs[i]==0 ) continue;
12971297
if( !file_isdir(azDirs[i]) ) continue;
12981298
zDir = azDirs[i];
12991299
break;
13001300
}
@@ -1407,11 +1407,11 @@
14071407
const char *file_is_win_reserved(const char *zPath){
14081408
static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
14091409
static char zReturn[5];
14101410
int i;
14111411
while( zPath[0] ){
1412
- for(i=0; i<ArraySize(azRes); i++){
1412
+ for(i=0; i<count(azRes); i++){
14131413
if( sqlite3_strnicmp(zPath, azRes[i], 3)==0
14141414
&& ((i>=4 && fossil_isdigit(zPath[3])
14151415
&& (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0))
14161416
|| (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0)))
14171417
){
14181418
--- 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 @@
454454
int aParent[GR_MAX_RAIL];
455455
456456
db_bind_int(&qparent, ":fid", frid);
457457
db_bind_int(&qparent, ":mid", fmid);
458458
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) ){
460460
aParent[nParent] = db_column_int(&qparent, 0);
461461
nParent++;
462462
}
463463
db_reset(&qparent);
464464
if( zBr==0 ) zBr = "trunk";
465465
--- 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 @@
2525
** It allows multiple commands to be issued without having to reenter the
2626
** crypto phasephrase for each command.
2727
*/
2828
#include "config.h"
2929
#include "fshell.h"
30
+#include "linenoise.h"
3031
#include <ctype.h>
3132
3233
#ifndef _WIN32
3334
#include <sys/types.h>
3435
#include <sys/wait.h>
@@ -55,16 +56,19 @@
5556
int mxArg = 0;
5657
int n, i;
5758
char **azArg = 0;
5859
int fDebug;
5960
pid_t childPid;
60
- char zLine[10000];
61
+ char *zLine = 0;
6162
fDebug = find_option("debug", 0, 0)!=0;
6263
db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0);
6364
db_close(0);
6465
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
+
6670
/* Parse the line of input */
6771
n = (int)strlen(zLine);
6872
for(i=0, nArg=1; i<n; i++){
6973
while( fossil_isspace(zLine[i]) ){ i++; }
7074
if( i>=n ) break;
7175
--- 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 @@
16121612
{"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3},
16131613
{"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3},
16141614
{"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2},
16151615
}, *renOpt = renOpts;
16161616
int i;
1617
- for( i = 0; i < sizeof(renOpts) / sizeof(*renOpts); ++i, ++renOpt ){
1617
+ for( i = 0; i < count(renOpts); ++i, ++renOpt ){
16181618
if( 1 << svnFlag & renOpt->format ){
16191619
const char *zArgument = find_option(renOpt->zOpt, 0, 1);
16201620
if( zArgument ){
16211621
const char *sep = strchr(zArgument, '%');
16221622
if( !sep ){
16231623
--- 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 @@
22482248
{ "#91d680", 0 },
22492249
22502250
22512251
{ "custom", "##" },
22522252
};
2253
- int nColor = sizeof(aColor)/sizeof(aColor[0])-1;
2253
+ int nColor = count(aColor)-1;
22542254
int stdClrFound = 0;
22552255
int i;
22562256
22572257
if( zIdPropagate ){
22582258
@ <div><label>
22592259
--- 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 @@
23502350
if( zBrowser==0 ){
23512351
static const char *const azBrowserProg[] =
23522352
{ "xdg-open", "gnome-open", "firefox", "google-chrome" };
23532353
int i;
23542354
zBrowser = "echo";
2355
- for(i=0; i<sizeof(azBrowserProg)/sizeof(azBrowserProg[0]); i++){
2355
+ for(i=0; i<count(azBrowserProg); i++){
23562356
if( binaryOnPath(azBrowserProg[i]) ){
23572357
zBrowser = azBrowserProg[i];
23582358
break;
23592359
}
23602360
}
23612361
--- 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 @@
295295
/* binary search of the tag */
296296
key.text = data;
297297
key.size = i;
298298
return bsearch(&key,
299299
block_tags,
300
- (sizeof block_tags)/(sizeof block_tags[0]),
300
+ count(block_tags),
301301
sizeof block_tags[0],
302302
cmp_html_tag);
303303
}
304304
305305
306306
--- 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 @@
316316
const char *z = blob_buffer(p);
317317
int n = blob_size(p) - len + 1;
318318
assert( len==(int)strlen(mergeMarker[1]) );
319319
assert( len==(int)strlen(mergeMarker[2]) );
320320
assert( len==(int)strlen(mergeMarker[3]) );
321
- assert( sizeof(mergeMarker)/sizeof(mergeMarker[0])==4 );
321
+ assert( count(mergeMarker)==4 );
322322
for(i=0; i<n; ){
323323
for(j=0; j<4; j++){
324324
if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1;
325325
}
326326
while( i<n && z[i]!='\n' ){ i++; }
327327
--- 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 @@
6767
"mlink", "fid",
6868
"tagxref", "srcid",
6969
"tagxref", "rid",
7070
};
7171
int i;
72
- for(i=0; i<sizeof(aTabField)/sizeof(aTabField[0]); i+=2){
72
+ for(i=0; i<count(aTabField); i+=2){
7373
if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d",
7474
aTabField[i], aTabField[i+1], rid) ) return 1;
7575
}
7676
return 0;
7777
}
7878
--- 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 @@
12041204
char *zId = aCollide[i].azHit[j];
12051205
if( zId==0 ) continue;
12061206
@ %z(href("%R/whatis/%s",zId))%h(zId)</a>
12071207
}
12081208
}
1209
- for(i=4; i<ArraySize(aCollide); i++){
1209
+ for(i=4; i<count(aCollide); i++){
12101210
for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){
12111211
fossil_free(aCollide[i].azHit[j]);
12121212
}
12131213
}
12141214
}
12151215
--- 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 @@
158158
{ 'n', 0, 0, etSIZE, 0, 0 },
159159
{ '%', 0, 0, etPERCENT, 0, 0 },
160160
{ 'p', 16, 0, etPOINTER, 0, 1 },
161161
{ '/', 0, 0, etPATH, 0, 0 },
162162
};
163
-#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0]))
163
+#define etNINFO count(fmtinfo)
164164
165165
/*
166166
** "*val" is a double such that 0.1 <= *val < 10.0
167167
** Return the ascii code for the leading digit of *val, then
168168
** multiply "*val" by 10.0 to renormalize.
@@ -970,11 +970,11 @@
970970
pNow->tm_hour, pNow->tm_min, pNow->tm_sec);
971971
va_start(ap, zFormat);
972972
vfprintf(out, zFormat, ap);
973973
fprintf(out, "\n");
974974
va_end(ap);
975
- for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){
975
+ for(i=0; i<count(azEnv); i++){
976976
char *p;
977977
if( (p = fossil_getenv(azEnv[i]))!=0 ){
978978
fprintf(out, "%s=%s\n", azEnv[i], p);
979979
fossil_path_free(p);
980980
}else if( (z = P(azEnv[i]))!=0 ){
981981
--- 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 @@
205205
in.i++;
206206
}
207207
if( in.i+pRe->nInit>in.mx ) return 0;
208208
}
209209
210
- if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){
210
+ if( pRe->nState<=count(aSpace)*2 ){
211211
pToFree = 0;
212212
aStateSet[0].aState = aSpace;
213213
}else{
214214
pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState );
215215
if( pToFree==0 ) return -1;
216216
--- 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 @@
198198
};
199199
int i;
200200
if( fossil_strncmp(zArg1, "fx_", 3)==0 ){
201201
break;
202202
}
203
- for(i=0; i<sizeof(azAllowed)/sizeof(azAllowed[0]); i++){
203
+ for(i=0; i<count(azAllowed); i++){
204204
if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break;
205205
}
206
- if( i>=sizeof(azAllowed)/sizeof(azAllowed[0]) ){
206
+ if( i>=count(azAllowed) ){
207207
*(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1);
208208
rc = SQLITE_DENY;
209209
}else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){
210210
rc = SQLITE_IGNORE;
211211
}
212212
--- 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 @@
418418
sqlite3_value **argv
419419
){
420420
const char *azDoc[5];
421421
int nDoc;
422422
int rc;
423
- for(nDoc=0; nDoc<ArraySize(azDoc) && nDoc<argc; nDoc++){
423
+ for(nDoc=0; nDoc<count(azDoc) && nDoc<argc; nDoc++){
424424
azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]);
425425
if( azDoc[nDoc]==0 ) azDoc[nDoc] = "";
426426
}
427427
rc = search_match(&gSearch, nDoc, azDoc);
428428
sqlite3_result_int(context, rc);
@@ -657,11 +657,11 @@
657657
};
658658
int i;
659659
if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC);
660660
if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT);
661661
if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI);
662
- for(i=0; i<ArraySize(aSetng); i++){
662
+ for(i=0; i<count(aSetng); i++){
663663
unsigned int m = aSetng[i].m;
664664
if( (srchFlags & m)==0 ) continue;
665665
if( ((knownGood|knownBad) & m)!=0 ) continue;
666666
if( db_get_boolean(aSetng[i].zKey,0) ){
667667
knownGood |= m;
@@ -892,11 +892,11 @@
892892
{ SRCH_DOC, 'd' },
893893
{ SRCH_TKT, 't' },
894894
{ SRCH_WIKI, 'w' },
895895
};
896896
int i;
897
- for(i=0; i<ArraySize(aMask); i++){
897
+ for(i=0; i<count(aMask); i++){
898898
if( srchFlags & aMask[i].m ){
899899
blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c);
900900
zSep = " OR ";
901901
}
902902
}
@@ -1070,11 +1070,11 @@
10701070
};
10711071
const char *zY = PD("y","all");
10721072
unsigned newFlags = srchFlags;
10731073
int i;
10741074
@ <select size='1' name='y'>
1075
- for(i=0; i<ArraySize(aY); i++){
1075
+ for(i=0; i<count(aY); i++){
10761076
if( (aY[i].m & srchFlags)==0 ) continue;
10771077
cgi_printf("<option value='%s'", aY[i].z);
10781078
if( fossil_strcmp(zY,aY[i].z)==0 ){
10791079
newFlags &= aY[i].m;
10801080
cgi_printf(" selected");
@@ -1727,17 +1727,17 @@
17271727
int iAction = 0;
17281728
db_find_and_open_repository(0, 0);
17291729
if( g.argc>2 ){
17301730
zSubCmd = g.argv[2];
17311731
n = (int)strlen(zSubCmd);
1732
- for(i=0; i<ArraySize(aCmd); i++){
1732
+ for(i=0; i<count(aCmd); i++){
17331733
if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break;
17341734
}
1735
- if( i>=ArraySize(aCmd) ){
1735
+ if( i>=count(aCmd) ){
17361736
Blob all;
17371737
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);
17391739
fossil_fatal("unknown \"%s\" - should be on of:%s",
17401740
zSubCmd, blob_str(&all));
17411741
return;
17421742
}
17431743
iCmd = aCmd[i].iCmd;
@@ -1757,11 +1757,11 @@
17571757
/* Adjust search settings */
17581758
if( iCmd==3 || iCmd==4 ){
17591759
const char *zCtrl;
17601760
if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd));
17611761
zCtrl = g.argv[3];
1762
- for(j=0; j<ArraySize(aSetng); j++){
1762
+ for(j=0; j<count(aSetng); j++){
17631763
if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){
17641764
db_set_int(aSetng[j].zSetting, iCmd-3, 0);
17651765
}
17661766
}
17671767
}
@@ -1778,11 +1778,11 @@
17781778
if( iAction>=2 ){
17791779
search_rebuild_index();
17801780
}
17811781
17821782
/* Always show the status before ending */
1783
- for(i=0; i<ArraySize(aSetng); i++){
1783
+ for(i=0; i<count(aSetng); i++){
17841784
fossil_print("%-16s %s\n", aSetng[i].zName,
17851785
db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off");
17861786
}
17871787
fossil_print("%-16s %s\n", "Porter stemmer:",
17881788
db_get_boolean("search-stemmer",0) ? "on" : "off");
17891789
--- 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 @@
1919
*/
2020
#include "config.h"
2121
#include <assert.h>
2222
#include "setup.h"
2323
24
-#if INTERFACE
25
-#define ArraySize(x) (sizeof(x)/sizeof(x[0]))
26
-#endif
27
-
2824
/*
2925
** Output a single entry for a menu generated using an HTML table.
3026
** If zLink is not NULL or an empty string, then it is the page that
3127
** the menu entry will hyperlink to. If zLink is NULL or "", then
3228
** the menu entry has no hyperlink - it is disabled.
@@ -944,18 +940,18 @@
944940
admin_log("Set option [%q] to [%q].",
945941
zVar, iQ ? "on" : "off");
946942
iVal = iQ;
947943
}
948944
}
949
- @ <input type="checkbox" name="%s(zQParm)"
945
+ @ <label><input type="checkbox" name="%s(zQParm)"
950946
if( iVal ){
951947
@ checked="checked"
952948
}
953949
if( disabled ){
954950
@ disabled="disabled"
955951
}
956
- @ /> <b>%s(zLabel)</b>
952
+ @ /> <b>%s(zLabel)</b></label>
957953
}
958954
959955
/*
960956
** Generate an entry box for an attribute.
961957
*/
@@ -1431,11 +1427,11 @@
14311427
@ %s(zTmDiff) hours ahead of UTC.</p>
14321428
}
14331429
14341430
@ <hr />
14351431
multiple_choice_attribute("Per-Item Time Format", "timeline-date-format",
1436
- "tdf", "0", ArraySize(azTimeFormats)/2, azTimeFormats);
1432
+ "tdf", "0", count(azTimeFormats)/2, azTimeFormats);
14371433
@ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown
14381434
@ in a separate box (using CSS class "timelineDate") whenever the date changes.
14391435
@ With the "YYYY-MM-DD&nbsp;HH:MM" and "YYMMDD ..." formats, the complete date
14401436
@ and time is shown on every timeline entry (using the CSS class "timelineTime").</p>
14411437
14421438
--- 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&nbsp;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&nbsp;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 @@
100100
Blob err = BLOB_INITIALIZER;
101101
if( strchr(zName, '/')!=0 ){
102102
zAltSkinDir = fossil_strdup(zName);
103103
return 0;
104104
}
105
- for(i=0; i<ArraySize(aBuiltinSkin); i++){
105
+ for(i=0; i<count(aBuiltinSkin); i++){
106106
if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){
107107
pAltSkin = &aBuiltinSkin[i];
108108
return 0;
109109
}
110110
}
111111
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++){
113113
blob_append(&err, " ", 1);
114114
blob_append(&err, aBuiltinSkin[i].zLabel, -1);
115115
}
116116
return blob_str(&err);
117117
}
@@ -163,11 +163,11 @@
163163
/*
164164
** Return a pointer to a SkinDetail element. Return 0 if not found.
165165
*/
166166
static struct SkinDetail *skin_detail_find(const char *zName){
167167
int lwr = 0;
168
- int upr = ArraySize(aSkinDetail);
168
+ int upr = count(aSkinDetail);
169169
while( upr>=lwr ){
170170
int mid = (upr+lwr)/2;
171171
int c = fossil_strcmp(aSkinDetail[mid].zName, zName);
172172
if( c==0 ) return &aSkinDetail[mid];
173173
if( c<0 ){
@@ -283,11 +283,11 @@
283283
** Return true if there exists a skin name "zSkinName".
284284
*/
285285
static int skinExists(const char *zSkinName){
286286
int i;
287287
if( zSkinName==0 ) return 0;
288
- for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
288
+ for(i=0; i<count(aBuiltinSkin); i++){
289289
if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1;
290290
}
291291
return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName);
292292
}
293293
@@ -304,11 +304,11 @@
304304
char *zLabel;
305305
static const char *azType[] = { "css", "header", "footer", "details" };
306306
int i;
307307
Blob val;
308308
blob_zero(&val);
309
- for(i=0; i<sizeof(azType)/sizeof(azType[0]); i++){
309
+ for(i=0; i<count(azType); i++){
310310
if( zName ){
311311
zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]);
312312
z = builtin_text(zLabel);
313313
fossil_free(zLabel);
314314
}else{
@@ -427,11 +427,11 @@
427427
login_needed(0);
428428
return;
429429
}
430430
db_begin_transaction();
431431
zCurrent = getSkin(0);
432
- for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
432
+ for(i=0; i<count(aBuiltinSkin); i++){
433433
aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel);
434434
}
435435
436436
/* Process requests to delete a user-defined skin */
437437
if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){
@@ -458,11 +458,11 @@
458458
int seen = 0;
459459
460460
/* Check to see if the current skin is already saved. If it is, there
461461
** is no need to create a backup */
462462
zCurrent = getSkin(0);
463
- for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
463
+ for(i=0; i<count(aBuiltinSkin); i++){
464464
if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){
465465
seen = 1;
466466
break;
467467
}
468468
}
@@ -476,11 +476,11 @@
476476
" %Q,now())", zCurrent
477477
);
478478
}
479479
}
480480
seen = 0;
481
- for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
481
+ for(i=0; i<count(aBuiltinSkin); i++){
482482
if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){
483483
seen = 1;
484484
zCurrent = aBuiltinSkin[i].zSQL;
485485
db_multi_exec("%s", zCurrent/*safe-for-%s*/);
486486
break;
@@ -513,11 +513,11 @@
513513
@ is restarted without the override.</p>
514514
@
515515
}
516516
@ <h2>Available Skins:</h2>
517517
@ <table border="0">
518
- for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
518
+ for(i=0; i<count(aBuiltinSkin); i++){
519519
z = aBuiltinSkin[i].zDesc;
520520
@ <tr><td>%d(i+1).<td>%h(z)<td>&nbsp;&nbsp;<td>
521521
if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){
522522
@ (Currently In Use)
523523
seenCurrent = 1;
@@ -597,20 +597,20 @@
597597
if( !g.perm.Setup ){
598598
login_needed(0);
599599
return;
600600
}
601601
ii = atoi(PD("w","0"));
602
- if( ii<0 || ii>ArraySize(aSkinAttr) ) ii = 0;
602
+ if( ii<0 || ii>count(aSkinAttr) ) ii = 0;
603603
zBasis = PD("basis","default");
604604
zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile);
605605
db_begin_transaction();
606606
if( P("revert")!=0 ){
607607
db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile);
608608
cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt));
609609
}
610610
style_header("%s", aSkinAttr[ii].zTitle);
611
- for(j=0; j<ArraySize(aSkinAttr); j++){
611
+ for(j=0; j<count(aSkinAttr); j++){
612612
if( j==ii ) continue;
613613
style_submenu_element(aSkinAttr[j].zSubmenu,
614614
"%R/setup_skinedit?w=%d&basis=%h",j,zBasis);
615615
}
616616
style_submenu_element("Skins", "%R/setup_skin");
@@ -622,11 +622,11 @@
622622
aSkinAttr[ii].zFile, builtin_text(zDflt), 0);
623623
@ <br />
624624
@ <input type="submit" name="submit" value="Apply Changes" />
625625
@ <hr />
626626
@ Baseline: <select size='1' name='basis'>
627
- for(j=0; j<ArraySize(aBuiltinSkin); j++){
627
+ for(j=0; j<count(aBuiltinSkin); j++){
628628
cgi_printf("<option value='%h'%s>%h</option>\n",
629629
aBuiltinSkin[j].zLabel,
630630
fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "",
631631
aBuiltinSkin[j].zDesc
632632
);
633633
--- 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>&nbsp;&nbsp;<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>&nbsp;&nbsp;<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 @@
706706
if( zUserName && zUserName[0]==0 ) zUserName = 0;
707707
if( zView==0 ){
708708
zView = "byuser";
709709
cgi_replace_query_parameter("view","byuser");
710710
}
711
- for(i=0; i<ArraySize(aViewType); i++){
711
+ for(i=0; i<count(aViewType); i++){
712712
if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){
713713
eType = aViewType[i].eType;
714714
break;
715715
}
716716
}
717717
if( eType!=RPT_NONE ){
718718
int nView = 0; /* Slots used in azView[] */
719
- for(i=0; i<ArraySize(aViewType); i++){
719
+ for(i=0; i<count(aViewType); i++){
720720
azView[nView++] = aViewType[i].zVal;
721721
azView[nView++] = aViewType[i].zName;
722722
}
723723
if( eType!=RPT_BYFILE ){
724
- style_submenu_multichoice("type", ArraySize(azType)/2, azType, 0);
724
+ style_submenu_multichoice("type", count(azType)/2, azType, 0);
725725
}
726726
style_submenu_multichoice("view", nView/2, azView, 0);
727727
if( eType!=RPT_BYUSER ){
728728
style_submenu_sql("user","User:",
729729
"SELECT '', 'All Users' UNION ALL "
730730
--- 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 @@
3030
** Populate these structure with calls to
3131
**
3232
** style_submenu_element()
3333
** style_submenu_entry()
3434
** style_submenu_checkbox()
35
+** style_submenu_binary()
3536
** style_submenu_multichoice()
37
+** style_submenu_sql()
3638
**
3739
** prior to calling style_footer(). The style_footer() routine
3840
** will generate the appropriate HTML text just below the main
3941
** menu.
4042
*/
@@ -51,13 +53,14 @@
5153
short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
5254
const char *const *azChoice;/* value/display pairs for FF_MULTI */
5355
const char *zFalse; /* FF_BINARY label when false */
5456
} aSubmenuCtrl[20];
5557
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
5962
6063
/*
6164
** Remember that the header has been generated. The footer is omitted
6265
** if an error occurs before the header.
6366
*/
@@ -233,11 +236,11 @@
233236
const char *zLabel,
234237
const char *zLink,
235238
...
236239
){
237240
va_list ap;
238
- assert( nSubmenu < sizeof(aSubmenu)/sizeof(aSubmenu[0]) );
241
+ assert( nSubmenu < count(aSubmenu) );
239242
aSubmenu[nSubmenu].zLabel = zLabel;
240243
va_start(ap, zLink);
241244
aSubmenu[nSubmenu].zLink = vmprintf(zLink, ap);
242245
va_end(ap);
243246
nSubmenu++;
@@ -246,25 +249,37 @@
246249
const char *zName, /* Query parameter name */
247250
const char *zLabel, /* Label before the entry box */
248251
int iSize, /* Size of the entry box */
249252
int isDisabled /* True if disabled */
250253
){
251
- assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) );
254
+ assert( nSubmenuCtrl < count(aSubmenuCtrl) );
252255
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
253256
aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
254257
aSubmenuCtrl[nSubmenuCtrl].iSize = iSize;
255258
aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
256259
aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY;
257260
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++;
258273
}
259274
void style_submenu_binary(
260275
const char *zName, /* Query parameter name */
261276
const char *zTrue, /* Label to show when parameter is true */
262277
const char *zFalse, /* Label to show when the parameter is false */
263278
int isDisabled /* True if this control is disabled */
264279
){
265
- assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) );
280
+ assert( nSubmenuCtrl < count(aSubmenuCtrl) );
266281
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
267282
aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue;
268283
aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse;
269284
aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
270285
aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY;
@@ -274,11 +289,11 @@
274289
const char *zName, /* Query parameter name */
275290
int nChoice, /* Number of options */
276291
const char *const *azChoice,/* value/display pairs. 2*nChoice entries */
277292
int isDisabled /* True if this control is disabled */
278293
){
279
- assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) );
294
+ assert( nSubmenuCtrl < count(aSubmenuCtrl) );
280295
aSubmenuCtrl[nSubmenuCtrl].zName = zName;
281296
aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice;
282297
aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice;
283298
aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled;
284299
aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI;
@@ -521,81 +536,82 @@
521536
}else{
522537
@ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a>
523538
}
524539
}
525540
}
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
- "&nbsp;%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("&nbsp;%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
+ "&nbsp;%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("&nbsp;%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;
597613
}
598614
}
599615
@ </div>
600616
if( nSubmenuCtrl ){
601617
cgi_query_parameters_to_hidden();
602618
--- 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 "&nbsp;%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("&nbsp;%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 "&nbsp;%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("&nbsp;%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 @@
20052005
g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */
20062006
}
20072007
th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */
20082008
}
20092009
#endif
2010
- for(i=0; i<sizeof(aCommand)/sizeof(aCommand[0]); i++){
2010
+ for(i=0; i<count(aCommand); i++){
20112011
if ( !aCommand[i].zName || !aCommand[i].xProc ) continue;
20122012
Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc,
20132013
aCommand[i].pContext, 0);
20142014
}
20152015
}else{
20162016
--- 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 @@
833833
int i;
834834
Th_Interp *th1Interp = (Th_Interp *)clientData;
835835
836836
if( !th1Interp ) return;
837837
/* Remove the Tcl integration commands. */
838
- for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){
838
+ for(i=0; i<count(aCommand); i++){
839839
Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0);
840840
}
841841
}
842842
843843
/*
@@ -1261,11 +1261,11 @@
12611261
void *pContext
12621262
){
12631263
int i;
12641264
12651265
/* 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++){
12671267
void *ctx;
12681268
if( !aCommand[i].zName || !aCommand[i].xProc ) continue;
12691269
ctx = aCommand[i].pContext;
12701270
/* Use Tcl interpreter for context? */
12711271
if( !ctx ) ctx = pContext;
12721272
--- 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 @@
390390
"SELECT pid FROM plink"
391391
" WHERE cid=:rid AND pid NOT IN phantom"
392392
" ORDER BY isprim DESC /*sort*/"
393393
);
394394
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) ){
396396
aParent[nParent++] = db_column_int(&qparent, 0);
397397
}
398398
db_reset(&qparent);
399399
gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
400400
zUuid, isLeaf);
@@ -1186,11 +1186,11 @@
11861186
}
11871187
if( g.perm.RdWiki ){
11881188
az[i++] = "w";
11891189
az[i++] = "Wiki";
11901190
}
1191
- assert( i<=ArraySize(az) );
1191
+ assert( i<=count(az) );
11921192
}
11931193
if( i>2 ){
11941194
style_submenu_multichoice("y", i/2, az, isDisabled);
11951195
}
11961196
}
@@ -1683,12 +1683,11 @@
16831683
blob_append(&sql, ")", -1);
16841684
path_reset();
16851685
addFileGlobExclusion(zChng, &sql);
16861686
tmFlags |= TIMELINE_DISJOINT;
16871687
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');
16901689
blob_appendf(&desc, "%d check-ins going from ",
16911690
db_int(0, "SELECT count(*) FROM timeline"));
16921691
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
16931692
blob_append(&desc, " to ", -1);
16941693
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
@@ -1734,14 +1733,13 @@
17341733
if( p_rid ){
17351734
/* If both p= and d= are set, we don't have the uuid of d yet. */
17361735
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
17371736
}
17381737
}
1738
+ style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c');
17391739
style_submenu_entry("n","Max:",4,0);
17401740
timeline_y_submenu(1);
1741
- style_submenu_binary("v","With Files","Without Files",
1742
- zType[0]!='a' && zType[0]!='c');
17431741
}else if( f_rid && g.perm.Read ){
17441742
/* If f= is present, ignore all other parameters other than n= */
17451743
char *zUuid;
17461744
db_multi_exec(
17471745
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
@@ -1755,15 +1753,12 @@
17551753
if( useDividers ) selectedRid = f_rid;
17561754
blob_appendf(&desc, "Parents and children of check-in ");
17571755
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
17581756
blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
17591757
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');
17651760
}else{
17661761
/* Otherwise, a timeline based on a span of time */
17671762
int n;
17681763
const char *zEType = "timeline item";
17691764
char *zDate;
@@ -2038,18 +2033,15 @@
20382033
timeline_submenu(&url, "Newer", "a", zDate, "b");
20392034
}
20402035
free(zDate);
20412036
}
20422037
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);
20462039
}
2040
+ style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c');
20472041
style_submenu_entry("n","Max:",4,0);
20482042
timeline_y_submenu(disableY);
2049
- style_submenu_binary("v","With Files","Without Files",
2050
- zType[0]!='a' && zType[0]!='c');
20512043
style_submenu_entry("t", "Tag Filter:", -8, 0);
20522044
style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0);
20532045
}
20542046
blob_zero(&cond);
20552047
}
20562048
--- 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 @@
390390
"SELECT pid FROM plink"
391391
" WHERE cid=:rid AND pid NOT IN phantom"
392392
" ORDER BY isprim DESC /*sort*/"
393393
);
394394
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) ){
396396
aParent[nParent++] = db_column_int(&qparent, 0);
397397
}
398398
db_reset(&qparent);
399399
gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
400400
zUuid, isLeaf);
@@ -1186,11 +1186,11 @@
11861186
}
11871187
if( g.perm.RdWiki ){
11881188
az[i++] = "w";
11891189
az[i++] = "Wiki";
11901190
}
1191
- assert( i<=ArraySize(az) );
1191
+ assert( i<=count(az) );
11921192
}
11931193
if( i>2 ){
11941194
style_submenu_multichoice("y", i/2, az, isDisabled);
11951195
}
11961196
}
@@ -1683,12 +1683,11 @@
16831683
blob_append(&sql, ")", -1);
16841684
path_reset();
16851685
addFileGlobExclusion(zChng, &sql);
16861686
tmFlags |= TIMELINE_DISJOINT;
16871687
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');
16901689
blob_appendf(&desc, "%d check-ins going from ",
16911690
db_int(0, "SELECT count(*) FROM timeline"));
16921691
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
16931692
blob_append(&desc, " to ", -1);
16941693
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
@@ -1734,14 +1733,13 @@
17341733
if( p_rid ){
17351734
/* If both p= and d= are set, we don't have the uuid of d yet. */
17361735
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
17371736
}
17381737
}
1738
+ style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c');
17391739
style_submenu_entry("n","Max:",4,0);
17401740
timeline_y_submenu(1);
1741
- style_submenu_binary("v","With Files","Without Files",
1742
- zType[0]!='a' && zType[0]!='c');
17431741
}else if( f_rid && g.perm.Read ){
17441742
/* If f= is present, ignore all other parameters other than n= */
17451743
char *zUuid;
17461744
db_multi_exec(
17471745
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);"
@@ -1755,15 +1753,12 @@
17551753
if( useDividers ) selectedRid = f_rid;
17561754
blob_appendf(&desc, "Parents and children of check-in ");
17571755
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
17581756
blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
17591757
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');
17651760
}else{
17661761
/* Otherwise, a timeline based on a span of time */
17671762
int n;
17681763
const char *zEType = "timeline item";
17691764
char *zDate;
@@ -2038,18 +2033,15 @@
20382033
timeline_submenu(&url, "Newer", "a", zDate, "b");
20392034
}
20402035
free(zDate);
20412036
}
20422037
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);
20462039
}
2040
+ style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c');
20472041
style_submenu_entry("n","Max:",4,0);
20482042
timeline_y_submenu(disableY);
2049
- style_submenu_binary("v","With Files","Without Files",
2050
- zType[0]!='a' && zType[0]!='c');
20512043
style_submenu_entry("t", "Tag Filter:", -8, 0);
20522044
style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, 0);
20532045
}
20542046
blob_zero(&cond);
20552047
}
20562048
--- 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 @@
144144
if( (unsigned int)c<128 ){
145145
return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
146146
}else if( (unsigned int)c<(1<<22) ){
147147
unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
148148
int iRes = 0;
149
- int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
149
+ int iHi = count(aEntry) - 1;
150150
int iLo = 0;
151151
while( iHi>=iLo ){
152152
int iTest = (iHi + iLo) / 2;
153153
if( key >= aEntry[iTest] ){
154154
iRes = iTest;
@@ -201,11 +201,11 @@
201201
'e', 'i', 'o', 'u', 'y',
202202
};
203203
204204
unsigned int key = (((unsigned int)c)<<3) | 0x00000007;
205205
int iRes = 0;
206
- int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1;
206
+ int iHi = count(aDia) - 1;
207207
int iLo = 0;
208208
while( iHi>=iLo ){
209209
int iTest = (iHi + iLo) / 2;
210210
if( key >= aDia[iTest] ){
211211
iRes = iTest;
@@ -348,11 +348,11 @@
348348
349349
if( c<128 ){
350350
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A');
351351
}else if( c<65536 ){
352352
const struct TableEntry *p;
353
- int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
353
+ int iHi = count(aEntry) - 1;
354354
int iLo = 0;
355355
int iRes = -1;
356356
357357
assert( c>aEntry[0].iCode );
358358
while( iHi>=iLo ){
359359
--- 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 @@
435435
for(; zName[0]!=0; zName++){
436436
if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){
437437
return 1;
438438
}
439439
if( zName[0]!='-' ) continue;
440
- for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){
440
+ for(i=0; i<count(azTemp); i++){
441441
n = (int)strlen(azTemp[i]);
442442
if( memcmp(azTemp[i], zName+1, n) ) continue;
443443
if( zName[n+1]==0 ) return 1;
444444
if( zName[n+1]=='-' ){
445445
for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){}
446446
--- 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 @@
138138
** All others become "text/x-fossil-wiki"
139139
*/
140140
const char *wiki_filter_mimetypes(const char *zMimetype){
141141
if( zMimetype!=0 ){
142142
int i;
143
- for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
143
+ for(i=0; i<count(azStyles); i+=3){
144144
if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){
145145
return azStyles[i];
146146
}
147147
}
148148
if( fossil_strcmp(zMimetype, "text/x-markdown")==0
@@ -428,11 +428,11 @@
428428
** wiki mimetype.
429429
*/
430430
void mimetype_option_menu(const char *zMimetype){
431431
unsigned i;
432432
@ <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){
434434
if( fossil_strcmp(zMimetype,azStyles[i])==0 ){
435435
@ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option>
436436
}else{
437437
@ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option>
438438
}
439439
--- 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
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -145,11 +145,11 @@
145145
** Use binary search to locate a tag in the aAttribute[] table.
146146
*/
147147
static int findAttr(const char *z){
148148
int i, c, first, last;
149149
first = 1;
150
- last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1;
150
+ last = count(aAttribute) - 1;
151151
while( first<=last ){
152152
i = (first+last)/2;
153153
c = fossil_strcmp(aAttribute[i].zName, z);
154154
if( c==0 ){
155155
return i;
@@ -372,11 +372,11 @@
372372
AMSK_ID|AMSK_TYPE },
373373
};
374374
375375
void show_allowed_wiki_markup( void ){
376376
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++ ){
378378
@ &lt;%s(aMarkup[i].zName)&gt;
379379
}
380380
}
381381
382382
/*
@@ -383,11 +383,11 @@
383383
** Use binary search to locate a tag in the aMarkup[] table.
384384
*/
385385
static int findTag(const char *z){
386386
int i, c, first, last;
387387
first = 1;
388
- last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1;
388
+ last = count(aMarkup) - 1;
389389
while( first<=last ){
390390
i = (first+last)/2;
391391
c = fossil_strcmp(aMarkup[i].zName, z);
392392
if( c==0 ){
393393
assert( aMarkup[i].iCode==i );
@@ -2187,11 +2187,11 @@
21872187
{ 4, '<', "&lt;" },
21882188
{ 4, '>', "&gt;" },
21892189
{ 6, ' ', "&nbsp;" },
21902190
};
21912191
int jj;
2192
- for(jj=0; jj<ArraySize(aEntity); jj++){
2192
+ for(jj=0; jj<count(aEntity); jj++){
21932193
if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){
21942194
c = aEntity[jj].c;
21952195
break;
21962196
}
21972197
}
21982198
--- 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 @ &lt;%s(aMarkup[i].zName)&gt;
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, '<', "&lt;" },
2188 { 4, '>', "&gt;" },
2189 { 6, ' ', "&nbsp;" },
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 @ &lt;%s(aMarkup[i].zName)&gt;
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, '<', "&lt;" },
2188 { 4, '>', "&gt;" },
2189 { 6, ' ', "&nbsp;" },
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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button