Fossil SCM
Merge fork
Commit
3cb9ba4de68923d05c850c714c093c8406e1d10d
Parent
476fe9e932f0113…
46 files changed
+2
-2
+2
-2
+2
-2
+2
-2
+4
-2
+4
-2
+4
-2
+4
-2
+4
-2
+2
-2
+2
-2
+4
-4
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+10
-10
+2
-2
+1
-1
+6
-2
+1
-1
+1
-1
+1
-1
+93
-85
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+2
-2
+1
-1
+2
-2
+9
-9
+3
-7
+12
-12
+3
-3
+96
-72
+1
-1
+2
-2
+8
-16
+3
-3
+1
-1
+2
-2
+4
-4
~
skins/black_and_white/css.txt
~
skins/blitz/css.txt
~
skins/blitz_no_logo/css.txt
~
skins/default/css.txt
~
skins/eagle/css.txt
~
skins/enhanced1/css.txt
~
skins/khaki/css.txt
~
skins/original/css.txt
~
skins/plain_gray/css.txt
~
skins/rounded1/css.txt
~
skins/xekri/css.txt
~
src/bisect.c
~
src/branch.c
~
src/builtin.c
~
src/cgi.c
~
src/db.c
~
src/diff.c
~
src/dispatch.c
~
src/doc.c
~
src/file.c
~
src/finfo.c
~
src/fshell.c
~
src/import.c
~
src/info.c
~
src/main.c
~
src/makeheaders.html
~
src/markdown.c
~
src/merge3.c
~
src/moderate.c
~
src/name.c
~
src/printf.c
~
src/printf.c
~
src/regexp.c
~
src/report.c
~
src/search.c
~
src/setup.c
~
src/skins.c
~
src/statrep.c
~
src/style.c
~
src/th_main.c
~
src/th_tcl.c
~
src/timeline.c
~
src/unicode.c
~
src/vfile.c
~
src/wiki.c
~
src/wikiformat.c
+2
-2
| --- skins/black_and_white/css.txt | ||
| +++ skins/black_and_white/css.txt | ||
| @@ -106,16 +106,16 @@ | ||
| 106 | 106 | border-width:1px 0px; |
| 107 | 107 | background-color: #eee; |
| 108 | 108 | color: #333; |
| 109 | 109 | } |
| 110 | 110 | div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, |
| 111 | -div.sectionmenu>a.button:visited { | |
| 111 | +div.sectionmenu>a.button:visited, div.submenu label { | |
| 112 | 112 | padding: 3px 10px 3px 10px; |
| 113 | 113 | color: #333; |
| 114 | 114 | text-decoration: none; |
| 115 | 115 | } |
| 116 | -div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 116 | +div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { | |
| 117 | 117 | color: #eee; |
| 118 | 118 | background-color: #333; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /* All page content from the bottom of the menu or submenu down to |
| 122 | 122 |
| --- skins/black_and_white/css.txt | |
| +++ skins/black_and_white/css.txt | |
| @@ -106,16 +106,16 @@ | |
| 106 | border-width:1px 0px; |
| 107 | background-color: #eee; |
| 108 | color: #333; |
| 109 | } |
| 110 | div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, |
| 111 | div.sectionmenu>a.button:visited { |
| 112 | padding: 3px 10px 3px 10px; |
| 113 | color: #333; |
| 114 | text-decoration: none; |
| 115 | } |
| 116 | div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 117 | color: #eee; |
| 118 | background-color: #333; |
| 119 | } |
| 120 | |
| 121 | /* All page content from the bottom of the menu or submenu down to |
| 122 |
| --- skins/black_and_white/css.txt | |
| +++ skins/black_and_white/css.txt | |
| @@ -106,16 +106,16 @@ | |
| 106 | border-width:1px 0px; |
| 107 | background-color: #eee; |
| 108 | color: #333; |
| 109 | } |
| 110 | div.submenu a, div.submenu a:visited, div.sectionmenu>a.button:link, |
| 111 | div.sectionmenu>a.button:visited, div.submenu label { |
| 112 | padding: 3px 10px 3px 10px; |
| 113 | color: #333; |
| 114 | text-decoration: none; |
| 115 | } |
| 116 | div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { |
| 117 | color: #eee; |
| 118 | background-color: #333; |
| 119 | } |
| 120 | |
| 121 | /* All page content from the bottom of the menu or submenu down to |
| 122 |
+2
-2
| --- skins/blitz/css.txt | ||
| +++ skins/blitz/css.txt | ||
| @@ -894,19 +894,19 @@ | ||
| 894 | 894 | |
| 895 | 895 | .submenu input, .submenu select { |
| 896 | 896 | margin: 0 0 0 5px; |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | -.submenu a { | |
| 899 | +.submenu a, .submenu label { | |
| 900 | 900 | color: #3b5c6b; |
| 901 | 901 | padding: 5px 15px; |
| 902 | 902 | text-decoration: none; |
| 903 | 903 | border: 1px solid transparent; |
| 904 | 904 | border-radius: 5px; |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | -.submenu a:hover { | |
| 907 | +.submenu a:hover, .submenu label:hover { | |
| 908 | 908 | border: 1px solid #ccc; |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | |
| 912 | 912 | /* Section |
| 913 | 913 |
| --- skins/blitz/css.txt | |
| +++ skins/blitz/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
| --- skins/blitz/css.txt | |
| +++ skins/blitz/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a, .submenu label { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover, .submenu label:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
+2
-2
| --- skins/blitz_no_logo/css.txt | ||
| +++ skins/blitz_no_logo/css.txt | ||
| @@ -894,19 +894,19 @@ | ||
| 894 | 894 | |
| 895 | 895 | .submenu input, .submenu select { |
| 896 | 896 | margin: 0 0 0 5px; |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | -.submenu a { | |
| 899 | +.submenu a, .submenu label { | |
| 900 | 900 | color: #3b5c6b; |
| 901 | 901 | padding: 5px 15px; |
| 902 | 902 | text-decoration: none; |
| 903 | 903 | border: 1px solid transparent; |
| 904 | 904 | border-radius: 5px; |
| 905 | 905 | } |
| 906 | 906 | |
| 907 | -.submenu a:hover { | |
| 907 | +.submenu a:hover, .submenu label:hover { | |
| 908 | 908 | border: 1px solid #ccc; |
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | |
| 912 | 912 | /* Section |
| 913 | 913 |
| --- skins/blitz_no_logo/css.txt | |
| +++ skins/blitz_no_logo/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
| --- skins/blitz_no_logo/css.txt | |
| +++ skins/blitz_no_logo/css.txt | |
| @@ -894,19 +894,19 @@ | |
| 894 | |
| 895 | .submenu input, .submenu select { |
| 896 | margin: 0 0 0 5px; |
| 897 | } |
| 898 | |
| 899 | .submenu a, .submenu label { |
| 900 | color: #3b5c6b; |
| 901 | padding: 5px 15px; |
| 902 | text-decoration: none; |
| 903 | border: 1px solid transparent; |
| 904 | border-radius: 5px; |
| 905 | } |
| 906 | |
| 907 | .submenu a:hover, .submenu label:hover { |
| 908 | border: 1px solid #ccc; |
| 909 | } |
| 910 | |
| 911 | |
| 912 | /* Section |
| 913 |
+2
-2
| --- skins/default/css.txt | ||
| +++ skins/default/css.txt | ||
| @@ -104,17 +104,17 @@ | ||
| 104 | 104 | margin-top: 10px; |
| 105 | 105 | padding: 10px; |
| 106 | 106 | border-bottom: 1px solid #ccc; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -.submenu a { | |
| 109 | +.submenu a, .submenu label { | |
| 110 | 110 | padding: 10px 11px; |
| 111 | 111 | text-decoration:none; |
| 112 | 112 | color: #777; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | -.submenu a:hover { | |
| 115 | +.submenu a:hover, .submenu label:hover { | |
| 116 | 116 | padding: 6px 10px; |
| 117 | 117 | border: 1px solid #ccc; |
| 118 | 118 | border-radius: 5px; |
| 119 | 119 | color: #000; |
| 120 | 120 | } |
| 121 | 121 |
| --- skins/default/css.txt | |
| +++ skins/default/css.txt | |
| @@ -104,17 +104,17 @@ | |
| 104 | margin-top: 10px; |
| 105 | padding: 10px; |
| 106 | border-bottom: 1px solid #ccc; |
| 107 | } |
| 108 | |
| 109 | .submenu a { |
| 110 | padding: 10px 11px; |
| 111 | text-decoration:none; |
| 112 | color: #777; |
| 113 | } |
| 114 | |
| 115 | .submenu a:hover { |
| 116 | padding: 6px 10px; |
| 117 | border: 1px solid #ccc; |
| 118 | border-radius: 5px; |
| 119 | color: #000; |
| 120 | } |
| 121 |
| --- skins/default/css.txt | |
| +++ skins/default/css.txt | |
| @@ -104,17 +104,17 @@ | |
| 104 | margin-top: 10px; |
| 105 | padding: 10px; |
| 106 | border-bottom: 1px solid #ccc; |
| 107 | } |
| 108 | |
| 109 | .submenu a, .submenu label { |
| 110 | padding: 10px 11px; |
| 111 | text-decoration:none; |
| 112 | color: #777; |
| 113 | } |
| 114 | |
| 115 | .submenu a:hover, .submenu label:hover { |
| 116 | padding: 6px 10px; |
| 117 | border: 1px solid #ccc; |
| 118 | border-radius: 5px; |
| 119 | color: #000; |
| 120 | } |
| 121 |
+4
-2
| --- skins/eagle/css.txt | ||
| +++ skins/eagle/css.txt | ||
| @@ -73,16 +73,18 @@ | ||
| 73 | 73 | text-align: center; |
| 74 | 74 | background-color: #485D7B; |
| 75 | 75 | color: white; |
| 76 | 76 | } |
| 77 | 77 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 78 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 78 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 79 | +div.submenu label { | |
| 79 | 80 | padding: 3px 10px 3px 10px; |
| 80 | 81 | color: white; |
| 81 | 82 | text-decoration: none; |
| 82 | 83 | } |
| 83 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 84 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 85 | +div.submenu label:hover { | |
| 84 | 86 | text-decoration: underline; |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | /* All page content from the bottom of the menu or submenu down to |
| 88 | 90 | ** the footer */ |
| 89 | 91 |
| --- skins/eagle/css.txt | |
| +++ skins/eagle/css.txt | |
| @@ -73,16 +73,18 @@ | |
| 73 | text-align: center; |
| 74 | background-color: #485D7B; |
| 75 | color: white; |
| 76 | } |
| 77 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 78 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 79 | padding: 3px 10px 3px 10px; |
| 80 | color: white; |
| 81 | text-decoration: none; |
| 82 | } |
| 83 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 84 | text-decoration: underline; |
| 85 | } |
| 86 | |
| 87 | /* All page content from the bottom of the menu or submenu down to |
| 88 | ** the footer */ |
| 89 |
| --- skins/eagle/css.txt | |
| +++ skins/eagle/css.txt | |
| @@ -73,16 +73,18 @@ | |
| 73 | text-align: center; |
| 74 | background-color: #485D7B; |
| 75 | color: white; |
| 76 | } |
| 77 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 78 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 79 | div.submenu label { |
| 80 | padding: 3px 10px 3px 10px; |
| 81 | color: white; |
| 82 | text-decoration: none; |
| 83 | } |
| 84 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 85 | div.submenu label:hover { |
| 86 | text-decoration: underline; |
| 87 | } |
| 88 | |
| 89 | /* All page content from the bottom of the menu or submenu down to |
| 90 | ** the footer */ |
| 91 |
+4
-2
| --- skins/enhanced1/css.txt | ||
| +++ skins/enhanced1/css.txt | ||
| @@ -71,16 +71,18 @@ | ||
| 71 | 71 | text-align: center; |
| 72 | 72 | background-color: #456878; |
| 73 | 73 | color: white; |
| 74 | 74 | } |
| 75 | 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 76 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 77 | +div.submenu label { | |
| 77 | 78 | padding: 3px 10px 3px 10px; |
| 78 | 79 | color: white; |
| 79 | 80 | text-decoration: none; |
| 80 | 81 | } |
| 81 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 82 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 83 | +div.submenu label:hover { | |
| 82 | 84 | color: #558195; |
| 83 | 85 | background-color: white; |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /* All page content from the bottom of the menu or submenu down to |
| 87 | 89 |
| --- skins/enhanced1/css.txt | |
| +++ skins/enhanced1/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 77 | padding: 3px 10px 3px 10px; |
| 78 | color: white; |
| 79 | text-decoration: none; |
| 80 | } |
| 81 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 82 | color: #558195; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
| --- skins/enhanced1/css.txt | |
| +++ skins/enhanced1/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 77 | div.submenu label { |
| 78 | padding: 3px 10px 3px 10px; |
| 79 | color: white; |
| 80 | text-decoration: none; |
| 81 | } |
| 82 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 83 | div.submenu label:hover { |
| 84 | color: #558195; |
| 85 | background-color: white; |
| 86 | } |
| 87 | |
| 88 | /* All page content from the bottom of the menu or submenu down to |
| 89 |
+4
-2
| --- skins/khaki/css.txt | ||
| +++ skins/khaki/css.txt | ||
| @@ -69,16 +69,18 @@ | ||
| 69 | 69 | text-align: center; |
| 70 | 70 | background-color: #c0af58; |
| 71 | 71 | color: white; |
| 72 | 72 | } |
| 73 | 73 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 74 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 74 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 75 | +div.submenu label { | |
| 75 | 76 | padding: 3px 10px 3px 10px; |
| 76 | 77 | color: white; |
| 77 | 78 | text-decoration: none; |
| 78 | 79 | } |
| 79 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 80 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover | |
| 81 | +div.submenu label:hover { | |
| 80 | 82 | color: #a09048; |
| 81 | 83 | background-color: white; |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | /* All page content from the bottom of the menu or submenu down to |
| 85 | 87 |
| --- skins/khaki/css.txt | |
| +++ skins/khaki/css.txt | |
| @@ -69,16 +69,18 @@ | |
| 69 | text-align: center; |
| 70 | background-color: #c0af58; |
| 71 | color: white; |
| 72 | } |
| 73 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 74 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 75 | padding: 3px 10px 3px 10px; |
| 76 | color: white; |
| 77 | text-decoration: none; |
| 78 | } |
| 79 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 80 | color: #a09048; |
| 81 | background-color: white; |
| 82 | } |
| 83 | |
| 84 | /* All page content from the bottom of the menu or submenu down to |
| 85 |
| --- skins/khaki/css.txt | |
| +++ skins/khaki/css.txt | |
| @@ -69,16 +69,18 @@ | |
| 69 | text-align: center; |
| 70 | background-color: #c0af58; |
| 71 | color: white; |
| 72 | } |
| 73 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 74 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 75 | div.submenu label { |
| 76 | padding: 3px 10px 3px 10px; |
| 77 | color: white; |
| 78 | text-decoration: none; |
| 79 | } |
| 80 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover |
| 81 | div.submenu label:hover { |
| 82 | color: #a09048; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
+4
-2
| --- skins/original/css.txt | ||
| +++ skins/original/css.txt | ||
| @@ -71,16 +71,18 @@ | ||
| 71 | 71 | text-align: center; |
| 72 | 72 | background-color: #456878; |
| 73 | 73 | color: white; |
| 74 | 74 | } |
| 75 | 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 76 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 77 | +div.submenu label { | |
| 77 | 78 | padding: 3px 10px 3px 10px; |
| 78 | 79 | color: white; |
| 79 | 80 | text-decoration: none; |
| 80 | 81 | } |
| 81 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 82 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 83 | +div.submenu label:hover { | |
| 82 | 84 | color: #558195; |
| 83 | 85 | background-color: white; |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /* All page content from the bottom of the menu or submenu down to |
| 87 | 89 |
| --- skins/original/css.txt | |
| +++ skins/original/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 77 | padding: 3px 10px 3px 10px; |
| 78 | color: white; |
| 79 | text-decoration: none; |
| 80 | } |
| 81 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 82 | color: #558195; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
| --- skins/original/css.txt | |
| +++ skins/original/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #456878; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 77 | div.submenu label { |
| 78 | padding: 3px 10px 3px 10px; |
| 79 | color: white; |
| 80 | text-decoration: none; |
| 81 | } |
| 82 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 83 | div.submenu label:hover { |
| 84 | color: #558195; |
| 85 | background-color: white; |
| 86 | } |
| 87 | |
| 88 | /* All page content from the bottom of the menu or submenu down to |
| 89 |
+4
-2
| --- skins/plain_gray/css.txt | ||
| +++ skins/plain_gray/css.txt | ||
| @@ -71,16 +71,18 @@ | ||
| 71 | 71 | text-align: center; |
| 72 | 72 | background-color: #606060; |
| 73 | 73 | color: white; |
| 74 | 74 | } |
| 75 | 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | -div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { | |
| 76 | +div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, | |
| 77 | +div.submenu label { | |
| 77 | 78 | padding: 3px 10px 3px 10px; |
| 78 | 79 | color: white; |
| 79 | 80 | text-decoration: none; |
| 80 | 81 | } |
| 81 | -div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 82 | +div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, | |
| 83 | +div.submenu label:hover { | |
| 82 | 84 | color: #404040; |
| 83 | 85 | background-color: white; |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /* All page content from the bottom of the menu or submenu down to |
| 87 | 89 |
| --- skins/plain_gray/css.txt | |
| +++ skins/plain_gray/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #606060; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 77 | padding: 3px 10px 3px 10px; |
| 78 | color: white; |
| 79 | text-decoration: none; |
| 80 | } |
| 81 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 82 | color: #404040; |
| 83 | background-color: white; |
| 84 | } |
| 85 | |
| 86 | /* All page content from the bottom of the menu or submenu down to |
| 87 |
| --- skins/plain_gray/css.txt | |
| +++ skins/plain_gray/css.txt | |
| @@ -71,16 +71,18 @@ | |
| 71 | text-align: center; |
| 72 | background-color: #606060; |
| 73 | color: white; |
| 74 | } |
| 75 | div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, |
| 76 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited, |
| 77 | div.submenu label { |
| 78 | padding: 3px 10px 3px 10px; |
| 79 | color: white; |
| 80 | text-decoration: none; |
| 81 | } |
| 82 | div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover, |
| 83 | div.submenu label:hover { |
| 84 | color: #404040; |
| 85 | background-color: white; |
| 86 | } |
| 87 | |
| 88 | /* All page content from the bottom of the menu or submenu down to |
| 89 |
+2
-2
| --- skins/rounded1/css.txt | ||
| +++ skins/rounded1/css.txt | ||
| @@ -84,11 +84,11 @@ | ||
| 84 | 84 | div.mainmenu a, div.mainmenu a:visited { |
| 85 | 85 | padding: 3px 10px 3px 10px; |
| 86 | 86 | color: white; |
| 87 | 87 | text-decoration: none; |
| 88 | 88 | } |
| 89 | -div.submenu a, div.submenu a:visited, a.button, | |
| 89 | +div.submenu a, div.submenu a:visited, a.button, div.submenu label | |
| 90 | 90 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 91 | 91 | padding: 2px 8px; |
| 92 | 92 | color: #000; |
| 93 | 93 | font-family: Arial; |
| 94 | 94 | text-decoration: none; |
| @@ -102,11 +102,11 @@ | ||
| 102 | 102 | div.mainmenu a:hover { |
| 103 | 103 | color: #000; |
| 104 | 104 | background-color: white; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | -div.submenu a:hover, div.sectionmenu>a.button:hover { | |
| 107 | +div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { | |
| 108 | 108 | background-color: #c0c0c0; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /* All page content from the bottom of the menu or submenu down to |
| 112 | 112 | ** the footer */ |
| 113 | 113 |
| --- skins/rounded1/css.txt | |
| +++ skins/rounded1/css.txt | |
| @@ -84,11 +84,11 @@ | |
| 84 | div.mainmenu a, div.mainmenu a:visited { |
| 85 | padding: 3px 10px 3px 10px; |
| 86 | color: white; |
| 87 | text-decoration: none; |
| 88 | } |
| 89 | div.submenu a, div.submenu a:visited, a.button, |
| 90 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 91 | padding: 2px 8px; |
| 92 | color: #000; |
| 93 | font-family: Arial; |
| 94 | text-decoration: none; |
| @@ -102,11 +102,11 @@ | |
| 102 | div.mainmenu a:hover { |
| 103 | color: #000; |
| 104 | background-color: white; |
| 105 | } |
| 106 | |
| 107 | div.submenu a:hover, div.sectionmenu>a.button:hover { |
| 108 | background-color: #c0c0c0; |
| 109 | } |
| 110 | |
| 111 | /* All page content from the bottom of the menu or submenu down to |
| 112 | ** the footer */ |
| 113 |
| --- skins/rounded1/css.txt | |
| +++ skins/rounded1/css.txt | |
| @@ -84,11 +84,11 @@ | |
| 84 | div.mainmenu a, div.mainmenu a:visited { |
| 85 | padding: 3px 10px 3px 10px; |
| 86 | color: white; |
| 87 | text-decoration: none; |
| 88 | } |
| 89 | div.submenu a, div.submenu a:visited, a.button, div.submenu label |
| 90 | div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { |
| 91 | padding: 2px 8px; |
| 92 | color: #000; |
| 93 | font-family: Arial; |
| 94 | text-decoration: none; |
| @@ -102,11 +102,11 @@ | |
| 102 | div.mainmenu a:hover { |
| 103 | color: #000; |
| 104 | background-color: white; |
| 105 | } |
| 106 | |
| 107 | div.submenu a:hover, div.sectionmenu>a.button:hover, div.submenu label:hover { |
| 108 | background-color: #c0c0c0; |
| 109 | } |
| 110 | |
| 111 | /* All page content from the bottom of the menu or submenu down to |
| 112 | ** the footer */ |
| 113 |
+2
-2
| --- skins/xekri/css.txt | ||
| +++ skins/xekri/css.txt | ||
| @@ -158,17 +158,17 @@ | ||
| 158 | 158 | border-top: 1px solid #0a0; |
| 159 | 159 | border-radius: 0; |
| 160 | 160 | display: block; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | -div.mainmenu a, div.submenu a { | |
| 163 | +div.mainmenu a, div.submenu a, div.submenu label { | |
| 164 | 164 | color: #000; |
| 165 | 165 | padding: 0 0.75rem; |
| 166 | 166 | text-decoration: none; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | -div.mainmenu a:hover, div.submenu a:hover { | |
| 169 | +div.mainmenu a:hover, div.submenu a:hover, div.submenu label:hover { | |
| 170 | 170 | color: #fff; |
| 171 | 171 | text-shadow: 0px 0px 6px #0f0; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | div.submenu * { |
| 175 | 175 |
| --- skins/xekri/css.txt | |
| +++ skins/xekri/css.txt | |
| @@ -158,17 +158,17 @@ | |
| 158 | border-top: 1px solid #0a0; |
| 159 | border-radius: 0; |
| 160 | display: block; |
| 161 | } |
| 162 | |
| 163 | div.mainmenu a, div.submenu a { |
| 164 | color: #000; |
| 165 | padding: 0 0.75rem; |
| 166 | text-decoration: none; |
| 167 | } |
| 168 | |
| 169 | div.mainmenu a:hover, div.submenu a:hover { |
| 170 | color: #fff; |
| 171 | text-shadow: 0px 0px 6px #0f0; |
| 172 | } |
| 173 | |
| 174 | div.submenu * { |
| 175 |
| --- skins/xekri/css.txt | |
| +++ skins/xekri/css.txt | |
| @@ -158,17 +158,17 @@ | |
| 158 | border-top: 1px solid #0a0; |
| 159 | border-radius: 0; |
| 160 | display: block; |
| 161 | } |
| 162 | |
| 163 | div.mainmenu a, div.submenu a, div.submenu label { |
| 164 | color: #000; |
| 165 | padding: 0 0.75rem; |
| 166 | text-decoration: none; |
| 167 | } |
| 168 | |
| 169 | div.mainmenu a:hover, div.submenu a:hover, div.submenu label:hover { |
| 170 | color: #fff; |
| 171 | text-shadow: 0px 0px 6px #0f0; |
| 172 | } |
| 173 | |
| 174 | div.submenu * { |
| 175 |
+4
-4
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -75,11 +75,11 @@ | ||
| 75 | 75 | ** Return the value of a boolean bisect option. |
| 76 | 76 | */ |
| 77 | 77 | int bisect_option(const char *zName){ |
| 78 | 78 | unsigned int i; |
| 79 | 79 | int r = -1; |
| 80 | - for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ | |
| 80 | + for(i=0; i<count(aBisectOption); i++){ | |
| 81 | 81 | if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){ |
| 82 | 82 | char *zLabel = mprintf("bisect-%s", zName); |
| 83 | 83 | char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault); |
| 84 | 84 | if( is_truth(z) ) r = 1; |
| 85 | 85 | if( is_false(z) ) r = 0; |
| @@ -406,21 +406,21 @@ | ||
| 406 | 406 | }else if( strncmp(zCmd, "chart", n)==0 ){ |
| 407 | 407 | bisect_chart(1); |
| 408 | 408 | }else if( strncmp(zCmd, "options", n)==0 ){ |
| 409 | 409 | if( g.argc==3 ){ |
| 410 | 410 | unsigned int i; |
| 411 | - for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ | |
| 411 | + for(i=0; i<count(aBisectOption); i++){ | |
| 412 | 412 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 413 | 413 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 414 | 414 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 415 | 415 | fossil_free(z); |
| 416 | 416 | comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags); |
| 417 | 417 | } |
| 418 | 418 | }else if( g.argc==4 || g.argc==5 ){ |
| 419 | 419 | unsigned int i; |
| 420 | 420 | n = strlen(g.argv[3]); |
| 421 | - for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ | |
| 421 | + for(i=0; i<count(aBisectOption); i++){ | |
| 422 | 422 | if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){ |
| 423 | 423 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 424 | 424 | if( g.argc==5 ){ |
| 425 | 425 | db_lset(z, g.argv[4]); |
| 426 | 426 | } |
| @@ -427,11 +427,11 @@ | ||
| 427 | 427 | fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 428 | 428 | fossil_free(z); |
| 429 | 429 | break; |
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | - if( i>=sizeof(aBisectOption)/sizeof(aBisectOption[0]) ){ | |
| 432 | + if( i>=count(aBisectOption) ){ | |
| 433 | 433 | fossil_fatal("no such bisect option: %s", g.argv[3]); |
| 434 | 434 | } |
| 435 | 435 | }else{ |
| 436 | 436 | usage("options ?NAME? ?VALUE?"); |
| 437 | 437 | } |
| 438 | 438 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -75,11 +75,11 @@ | |
| 75 | ** Return the value of a boolean bisect option. |
| 76 | */ |
| 77 | int bisect_option(const char *zName){ |
| 78 | unsigned int i; |
| 79 | int r = -1; |
| 80 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 81 | if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){ |
| 82 | char *zLabel = mprintf("bisect-%s", zName); |
| 83 | char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault); |
| 84 | if( is_truth(z) ) r = 1; |
| 85 | if( is_false(z) ) r = 0; |
| @@ -406,21 +406,21 @@ | |
| 406 | }else if( strncmp(zCmd, "chart", n)==0 ){ |
| 407 | bisect_chart(1); |
| 408 | }else if( strncmp(zCmd, "options", n)==0 ){ |
| 409 | if( g.argc==3 ){ |
| 410 | unsigned int i; |
| 411 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 412 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 413 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 414 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 415 | fossil_free(z); |
| 416 | comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags); |
| 417 | } |
| 418 | }else if( g.argc==4 || g.argc==5 ){ |
| 419 | unsigned int i; |
| 420 | n = strlen(g.argv[3]); |
| 421 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 422 | if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){ |
| 423 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 424 | if( g.argc==5 ){ |
| 425 | db_lset(z, g.argv[4]); |
| 426 | } |
| @@ -427,11 +427,11 @@ | |
| 427 | fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 428 | fossil_free(z); |
| 429 | break; |
| 430 | } |
| 431 | } |
| 432 | if( i>=sizeof(aBisectOption)/sizeof(aBisectOption[0]) ){ |
| 433 | fossil_fatal("no such bisect option: %s", g.argv[3]); |
| 434 | } |
| 435 | }else{ |
| 436 | usage("options ?NAME? ?VALUE?"); |
| 437 | } |
| 438 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -75,11 +75,11 @@ | |
| 75 | ** Return the value of a boolean bisect option. |
| 76 | */ |
| 77 | int bisect_option(const char *zName){ |
| 78 | unsigned int i; |
| 79 | int r = -1; |
| 80 | for(i=0; i<count(aBisectOption); i++){ |
| 81 | if( fossil_strcmp(zName, aBisectOption[i].zName)==0 ){ |
| 82 | char *zLabel = mprintf("bisect-%s", zName); |
| 83 | char *z = db_lget(zLabel, (char*)aBisectOption[i].zDefault); |
| 84 | if( is_truth(z) ) r = 1; |
| 85 | if( is_false(z) ) r = 0; |
| @@ -406,21 +406,21 @@ | |
| 406 | }else if( strncmp(zCmd, "chart", n)==0 ){ |
| 407 | bisect_chart(1); |
| 408 | }else if( strncmp(zCmd, "options", n)==0 ){ |
| 409 | if( g.argc==3 ){ |
| 410 | unsigned int i; |
| 411 | for(i=0; i<count(aBisectOption); i++){ |
| 412 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 413 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 414 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 415 | fossil_free(z); |
| 416 | comment_print(aBisectOption[i].zDesc, 0, 27, -1, g.comFmtFlags); |
| 417 | } |
| 418 | }else if( g.argc==4 || g.argc==5 ){ |
| 419 | unsigned int i; |
| 420 | n = strlen(g.argv[3]); |
| 421 | for(i=0; i<count(aBisectOption); i++){ |
| 422 | if( strncmp(g.argv[3], aBisectOption[i].zName, n)==0 ){ |
| 423 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 424 | if( g.argc==5 ){ |
| 425 | db_lset(z, g.argv[4]); |
| 426 | } |
| @@ -427,11 +427,11 @@ | |
| 427 | fossil_print("%s\n", db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 428 | fossil_free(z); |
| 429 | break; |
| 430 | } |
| 431 | } |
| 432 | if( i>=count(aBisectOption) ){ |
| 433 | fossil_fatal("no such bisect option: %s", g.argv[3]); |
| 434 | } |
| 435 | }else{ |
| 436 | usage("options ?NAME? ?VALUE?"); |
| 437 | } |
| 438 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -350,11 +350,11 @@ | ||
| 350 | 350 | int show_colors = PB("colors"); |
| 351 | 351 | login_check_credentials(); |
| 352 | 352 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 353 | 353 | style_header("Branches"); |
| 354 | 354 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 355 | - style_submenu_binary("colors", "Color", "B/W", 0); | |
| 355 | + style_submenu_checkbox("colors", "Use Branch Colors", 0); | |
| 356 | 356 | login_anonymous_available(); |
| 357 | 357 | |
| 358 | 358 | db_prepare(&q, brlistQuery/*works-like:""*/); |
| 359 | 359 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 360 | 360 | @ <div class="brlist"><table id="branchlisttable"> |
| 361 | 361 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -350,11 +350,11 @@ | |
| 350 | int show_colors = PB("colors"); |
| 351 | login_check_credentials(); |
| 352 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 353 | style_header("Branches"); |
| 354 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 355 | style_submenu_binary("colors", "Color", "B/W", 0); |
| 356 | login_anonymous_available(); |
| 357 | |
| 358 | db_prepare(&q, brlistQuery/*works-like:""*/); |
| 359 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 360 | @ <div class="brlist"><table id="branchlisttable"> |
| 361 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -350,11 +350,11 @@ | |
| 350 | int show_colors = PB("colors"); |
| 351 | login_check_credentials(); |
| 352 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 353 | style_header("Branches"); |
| 354 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 355 | style_submenu_checkbox("colors", "Use Branch Colors", 0); |
| 356 | login_anonymous_available(); |
| 357 | |
| 358 | db_prepare(&q, brlistQuery/*works-like:""*/); |
| 359 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 360 | @ <div class="brlist"><table id="branchlisttable"> |
| 361 |
+2
-2
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -33,11 +33,11 @@ | ||
| 33 | 33 | ** Return a pointer to built-in content |
| 34 | 34 | */ |
| 35 | 35 | const unsigned char *builtin_file(const char *zFilename, int *piSize){ |
| 36 | 36 | int lwr, upr, i, c; |
| 37 | 37 | lwr = 0; |
| 38 | - upr = sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]) - 1; | |
| 38 | + upr = count(aBuiltinFiles) - 1; | |
| 39 | 39 | while( upr>=lwr ){ |
| 40 | 40 | i = (upr+lwr)/2; |
| 41 | 41 | c = strcmp(aBuiltinFiles[i].zName,zFilename); |
| 42 | 42 | if( c<0 ){ |
| 43 | 43 | lwr = i+1; |
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | ** |
| 61 | 61 | ** List the names and sizes of all built-in resources. |
| 62 | 62 | */ |
| 63 | 63 | void test_builtin_list(void){ |
| 64 | 64 | int i; |
| 65 | - for(i=0; i<sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]); i++){ | |
| 65 | + for(i=0; i<count(aBuiltinFiles); i++){ | |
| 66 | 66 | fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /* |
| 71 | 71 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -33,11 +33,11 @@ | |
| 33 | ** Return a pointer to built-in content |
| 34 | */ |
| 35 | const unsigned char *builtin_file(const char *zFilename, int *piSize){ |
| 36 | int lwr, upr, i, c; |
| 37 | lwr = 0; |
| 38 | upr = sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]) - 1; |
| 39 | while( upr>=lwr ){ |
| 40 | i = (upr+lwr)/2; |
| 41 | c = strcmp(aBuiltinFiles[i].zName,zFilename); |
| 42 | if( c<0 ){ |
| 43 | lwr = i+1; |
| @@ -60,11 +60,11 @@ | |
| 60 | ** |
| 61 | ** List the names and sizes of all built-in resources. |
| 62 | */ |
| 63 | void test_builtin_list(void){ |
| 64 | int i; |
| 65 | for(i=0; i<sizeof(aBuiltinFiles)/sizeof(aBuiltinFiles[0]); i++){ |
| 66 | fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -33,11 +33,11 @@ | |
| 33 | ** Return a pointer to built-in content |
| 34 | */ |
| 35 | const unsigned char *builtin_file(const char *zFilename, int *piSize){ |
| 36 | int lwr, upr, i, c; |
| 37 | lwr = 0; |
| 38 | upr = count(aBuiltinFiles) - 1; |
| 39 | while( upr>=lwr ){ |
| 40 | i = (upr+lwr)/2; |
| 41 | c = strcmp(aBuiltinFiles[i].zName,zFilename); |
| 42 | if( c<0 ){ |
| 43 | lwr = i+1; |
| @@ -60,11 +60,11 @@ | |
| 60 | ** |
| 61 | ** List the names and sizes of all built-in resources. |
| 62 | */ |
| 63 | void test_builtin_list(void){ |
| 64 | int i; |
| 65 | for(i=0; i<count(aBuiltinFiles); i++){ |
| 66 | fossil_print("%-30s %6d\n", aBuiltinFiles[i].zName,aBuiltinFiles[i].nByte); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 |
+1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -719,11 +719,11 @@ | ||
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | 721 | zName = 0; |
| 722 | 722 | showBytes = 0; |
| 723 | 723 | }else{ |
| 724 | - nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); | |
| 724 | + nArg = tokenize_line(zLine, count(azArg), azArg); | |
| 725 | 725 | for(i=0; i<nArg; i++){ |
| 726 | 726 | int c = fossil_tolower(azArg[i][0]); |
| 727 | 727 | int n = strlen(azArg[i]); |
| 728 | 728 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 729 | 729 | i++; |
| 730 | 730 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -719,11 +719,11 @@ | |
| 719 | } |
| 720 | } |
| 721 | zName = 0; |
| 722 | showBytes = 0; |
| 723 | }else{ |
| 724 | nArg = tokenize_line(zLine, sizeof(azArg)/sizeof(azArg[0]), azArg); |
| 725 | for(i=0; i<nArg; i++){ |
| 726 | int c = fossil_tolower(azArg[i][0]); |
| 727 | int n = strlen(azArg[i]); |
| 728 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 729 | i++; |
| 730 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -719,11 +719,11 @@ | |
| 719 | } |
| 720 | } |
| 721 | zName = 0; |
| 722 | showBytes = 0; |
| 723 | }else{ |
| 724 | nArg = tokenize_line(zLine, count(azArg), azArg); |
| 725 | for(i=0; i<nArg; i++){ |
| 726 | int c = fossil_tolower(azArg[i][0]); |
| 727 | int n = strlen(azArg[i]); |
| 728 | if( c=='c' && sqlite3_strnicmp(azArg[i],"content-disposition:",n)==0 ){ |
| 729 | i++; |
| 730 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2799,11 +2799,11 @@ | ||
| 2799 | 2799 | */ |
| 2800 | 2800 | const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2801 | 2801 | int lwr, mid, upr, c; |
| 2802 | 2802 | int n = (int)strlen(zName) + !allowPrefix; |
| 2803 | 2803 | lwr = 0; |
| 2804 | - upr = ArraySize(aSetting)-2; | |
| 2804 | + upr = count(aSetting)-2; | |
| 2805 | 2805 | while( upr>=lwr ){ |
| 2806 | 2806 | mid = (upr+lwr)/2; |
| 2807 | 2807 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2808 | 2808 | if( c<0 ){ |
| 2809 | 2809 | upr = mid - 1; |
| 2810 | 2810 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2799,11 +2799,11 @@ | |
| 2799 | */ |
| 2800 | const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2801 | int lwr, mid, upr, c; |
| 2802 | int n = (int)strlen(zName) + !allowPrefix; |
| 2803 | lwr = 0; |
| 2804 | upr = ArraySize(aSetting)-2; |
| 2805 | while( upr>=lwr ){ |
| 2806 | mid = (upr+lwr)/2; |
| 2807 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2808 | if( c<0 ){ |
| 2809 | upr = mid - 1; |
| 2810 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2799,11 +2799,11 @@ | |
| 2799 | */ |
| 2800 | const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2801 | int lwr, mid, upr, c; |
| 2802 | int n = (int)strlen(zName) + !allowPrefix; |
| 2803 | lwr = 0; |
| 2804 | upr = count(aSetting)-2; |
| 2805 | while( upr>=lwr ){ |
| 2806 | mid = (upr+lwr)/2; |
| 2807 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2808 | if( c<0 ){ |
| 2809 | upr = mid - 1; |
| 2810 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -1068,11 +1068,11 @@ | ||
| 1068 | 1068 | if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen); |
| 1069 | 1069 | if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen); |
| 1070 | 1070 | return aM; |
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | - if( nRight < (sizeof(aBuf)/sizeof(aBuf[0]))-1 ){ | |
| 1073 | + if( nRight < count(aBuf)-1 ){ | |
| 1074 | 1074 | pToFree = 0; |
| 1075 | 1075 | a = aBuf; |
| 1076 | 1076 | }else{ |
| 1077 | 1077 | a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) ); |
| 1078 | 1078 | } |
| 1079 | 1079 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1068,11 +1068,11 @@ | |
| 1068 | if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen); |
| 1069 | if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen); |
| 1070 | return aM; |
| 1071 | } |
| 1072 | |
| 1073 | if( nRight < (sizeof(aBuf)/sizeof(aBuf[0]))-1 ){ |
| 1074 | pToFree = 0; |
| 1075 | a = aBuf; |
| 1076 | }else{ |
| 1077 | a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) ); |
| 1078 | } |
| 1079 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -1068,11 +1068,11 @@ | |
| 1068 | if( nLeft>mnLen ) memset(aM+mnLen, 1, nLeft-mnLen); |
| 1069 | if( nRight>mnLen ) memset(aM+mnLen, 2, nRight-mnLen); |
| 1070 | return aM; |
| 1071 | } |
| 1072 | |
| 1073 | if( nRight < count(aBuf)-1 ){ |
| 1074 | pToFree = 0; |
| 1075 | a = aBuf; |
| 1076 | }else{ |
| 1077 | a = pToFree = fossil_malloc( sizeof(a[0])*(nRight+1) ); |
| 1078 | } |
| 1079 |
+1
-1
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -69,11 +69,11 @@ | ||
| 69 | 69 | ** The page_index.h file is generated by the mkindex program which scans all |
| 70 | 70 | ** source code files looking for header comments on the functions that |
| 71 | 71 | ** implement command and webpages. |
| 72 | 72 | */ |
| 73 | 73 | #include "page_index.h" |
| 74 | -#define MX_COMMAND (sizeof(aCommand)/sizeof(aCommand[0])) | |
| 74 | +#define MX_COMMAND count(aCommand) | |
| 75 | 75 | |
| 76 | 76 | /* |
| 77 | 77 | ** Given a command or webpage name in zName, find the corresponding CmdOrPage |
| 78 | 78 | ** object and return a pointer to that object in *ppCmd. |
| 79 | 79 | ** |
| 80 | 80 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | ** The page_index.h file is generated by the mkindex program which scans all |
| 70 | ** source code files looking for header comments on the functions that |
| 71 | ** implement command and webpages. |
| 72 | */ |
| 73 | #include "page_index.h" |
| 74 | #define MX_COMMAND (sizeof(aCommand)/sizeof(aCommand[0])) |
| 75 | |
| 76 | /* |
| 77 | ** Given a command or webpage name in zName, find the corresponding CmdOrPage |
| 78 | ** object and return a pointer to that object in *ppCmd. |
| 79 | ** |
| 80 |
| --- src/dispatch.c | |
| +++ src/dispatch.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | ** The page_index.h file is generated by the mkindex program which scans all |
| 70 | ** source code files looking for header comments on the functions that |
| 71 | ** implement command and webpages. |
| 72 | */ |
| 73 | #include "page_index.h" |
| 74 | #define MX_COMMAND count(aCommand) |
| 75 | |
| 76 | /* |
| 77 | ** Given a command or webpage name in zName, find the corresponding CmdOrPage |
| 78 | ** object and return a pointer to that object in *ppCmd. |
| 79 | ** |
| 80 |
+10
-10
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -54,11 +54,11 @@ | ||
| 54 | 54 | if( !looks_like_binary(pBlob) ) { |
| 55 | 55 | return 0; /* Plain text */ |
| 56 | 56 | } |
| 57 | 57 | x = (const unsigned char*)blob_buffer(pBlob); |
| 58 | 58 | n = blob_size(pBlob); |
| 59 | - for(i=0; i<ArraySize(aMime); i++){ | |
| 59 | + for(i=0; i<count(aMime); i++){ | |
| 60 | 60 | if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){ |
| 61 | 61 | return aMime[i].zMimetype; |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | return "unknown/unknown"; |
| @@ -293,11 +293,11 @@ | ||
| 293 | 293 | ** Verify that all entries in the aMime[] table are in sorted order. |
| 294 | 294 | ** Abort with a fatal error if any is out-of-order. |
| 295 | 295 | */ |
| 296 | 296 | static void mimetype_verify(void){ |
| 297 | 297 | int i; |
| 298 | - for(i=1; i<ArraySize(aMime); i++){ | |
| 298 | + for(i=1; i<count(aMime); i++){ | |
| 299 | 299 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 300 | 300 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 301 | 301 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 302 | 302 | } |
| 303 | 303 | } |
| @@ -331,11 +331,11 @@ | ||
| 331 | 331 | len = strlen(z); |
| 332 | 332 | if( len<sizeof(zSuffix)-1 ){ |
| 333 | 333 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 334 | 334 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 335 | 335 | first = 0; |
| 336 | - last = ArraySize(aMime) - 1; | |
| 336 | + last = count(aMime) - 1; | |
| 337 | 337 | while( first<=last ){ |
| 338 | 338 | int c; |
| 339 | 339 | i = (first+last)/2; |
| 340 | 340 | c = fossil_strcmp(zSuffix, aMime[i].zSuffix); |
| 341 | 341 | if( c==0 ) return aMime[i].zMimetype; |
| @@ -384,11 +384,11 @@ | ||
| 384 | 384 | @ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'> |
| 385 | 385 | @ <thead> |
| 386 | 386 | @ <tr><th>Suffix<th>Mimetype |
| 387 | 387 | @ </thead> |
| 388 | 388 | @ <tbody> |
| 389 | - for(i=0; i<ArraySize(aMime); i++){ | |
| 389 | + for(i=0; i<count(aMime); i++){ | |
| 390 | 390 | @ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 391 | 391 | } |
| 392 | 392 | @ </tbody></table> |
| 393 | 393 | output_table_sorting_javascript("mimeTable","tt",1); |
| 394 | 394 | style_footer(); |
| @@ -593,11 +593,11 @@ | ||
| 593 | 593 | login_check_credentials(); |
| 594 | 594 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 595 | 595 | blob_init(&title, 0, 0); |
| 596 | 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | 597 | db_begin_transaction(); |
| 598 | - while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ | |
| 598 | + while( rid==0 && (++nMiss)<=count(azSuffix) ){ | |
| 599 | 599 | zName = P("name"); |
| 600 | 600 | if( isUV ){ |
| 601 | 601 | if( zName==0 ) zName = "index.wiki"; |
| 602 | 602 | i = 0; |
| 603 | 603 | }else{ |
| @@ -606,14 +606,14 @@ | ||
| 606 | 606 | zCheckin = mprintf("%.*s", i, zName); |
| 607 | 607 | if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){ |
| 608 | 608 | zCheckin = "tip"; |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | - if( nMiss==ArraySize(azSuffix) ){ | |
| 611 | + if( nMiss==count(azSuffix) ){ | |
| 612 | 612 | zName = "404.md"; |
| 613 | 613 | }else if( zName[i]==0 ){ |
| 614 | - assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); | |
| 614 | + assert( nMiss>=0 && nMiss<count(azSuffix) ); | |
| 615 | 615 | zName = azSuffix[nMiss]; |
| 616 | 616 | }else if( !isUV ){ |
| 617 | 617 | zName += i; |
| 618 | 618 | } |
| 619 | 619 | while( zName[0]=='/' ){ zName++; } |
| @@ -623,11 +623,11 @@ | ||
| 623 | 623 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 624 | 624 | } |
| 625 | 625 | if( nMiss==0 ) zOrigName = zName; |
| 626 | 626 | if( !file_is_simple_pathname(zName, 1) ){ |
| 627 | 627 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 628 | - assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); | |
| 628 | + assert( nMiss>=0 && nMiss<count(azSuffix) ); | |
| 629 | 629 | zName = mprintf("%s%s", zName, azSuffix[nMiss]); |
| 630 | 630 | if( !file_is_simple_pathname(zName, 1) ){ |
| 631 | 631 | goto doc_not_found; |
| 632 | 632 | } |
| 633 | 633 | }else{ |
| @@ -686,11 +686,11 @@ | ||
| 686 | 686 | Blob tail = BLOB_INITIALIZER; |
| 687 | 687 | markdown_to_html(&filebody, &title, &tail); |
| 688 | 688 | if( blob_size(&title)>0 ){ |
| 689 | 689 | style_header("%s", blob_str(&title)); |
| 690 | 690 | }else{ |
| 691 | - style_header("%s", nMiss>=ArraySize(azSuffix)? | |
| 691 | + style_header("%s", nMiss>=count(azSuffix)? | |
| 692 | 692 | "Not Found" : zDfltTitle); |
| 693 | 693 | } |
| 694 | 694 | convert_href_and_output(&tail); |
| 695 | 695 | style_footer(); |
| 696 | 696 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| @@ -719,11 +719,11 @@ | ||
| 719 | 719 | #endif |
| 720 | 720 | }else{ |
| 721 | 721 | cgi_set_content_type(zMime); |
| 722 | 722 | cgi_set_content(&filebody); |
| 723 | 723 | } |
| 724 | - if( nMiss>=ArraySize(azSuffix) ) cgi_set_status(404, "Not Found"); | |
| 724 | + if( nMiss>=count(azSuffix) ) cgi_set_status(404, "Not Found"); | |
| 725 | 725 | db_end_transaction(0); |
| 726 | 726 | return; |
| 727 | 727 | |
| 728 | 728 | /* Jump here when unable to locate the document */ |
| 729 | 729 | doc_not_found: |
| 730 | 730 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | if( !looks_like_binary(pBlob) ) { |
| 55 | return 0; /* Plain text */ |
| 56 | } |
| 57 | x = (const unsigned char*)blob_buffer(pBlob); |
| 58 | n = blob_size(pBlob); |
| 59 | for(i=0; i<ArraySize(aMime); i++){ |
| 60 | if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){ |
| 61 | return aMime[i].zMimetype; |
| 62 | } |
| 63 | } |
| 64 | return "unknown/unknown"; |
| @@ -293,11 +293,11 @@ | |
| 293 | ** Verify that all entries in the aMime[] table are in sorted order. |
| 294 | ** Abort with a fatal error if any is out-of-order. |
| 295 | */ |
| 296 | static void mimetype_verify(void){ |
| 297 | int i; |
| 298 | for(i=1; i<ArraySize(aMime); i++){ |
| 299 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 300 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 301 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 302 | } |
| 303 | } |
| @@ -331,11 +331,11 @@ | |
| 331 | len = strlen(z); |
| 332 | if( len<sizeof(zSuffix)-1 ){ |
| 333 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 334 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 335 | first = 0; |
| 336 | last = ArraySize(aMime) - 1; |
| 337 | while( first<=last ){ |
| 338 | int c; |
| 339 | i = (first+last)/2; |
| 340 | c = fossil_strcmp(zSuffix, aMime[i].zSuffix); |
| 341 | if( c==0 ) return aMime[i].zMimetype; |
| @@ -384,11 +384,11 @@ | |
| 384 | @ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'> |
| 385 | @ <thead> |
| 386 | @ <tr><th>Suffix<th>Mimetype |
| 387 | @ </thead> |
| 388 | @ <tbody> |
| 389 | for(i=0; i<ArraySize(aMime); i++){ |
| 390 | @ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 391 | } |
| 392 | @ </tbody></table> |
| 393 | output_table_sorting_javascript("mimeTable","tt",1); |
| 394 | style_footer(); |
| @@ -593,11 +593,11 @@ | |
| 593 | login_check_credentials(); |
| 594 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 595 | blob_init(&title, 0, 0); |
| 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | db_begin_transaction(); |
| 598 | while( rid==0 && (++nMiss)<=ArraySize(azSuffix) ){ |
| 599 | zName = P("name"); |
| 600 | if( isUV ){ |
| 601 | if( zName==0 ) zName = "index.wiki"; |
| 602 | i = 0; |
| 603 | }else{ |
| @@ -606,14 +606,14 @@ | |
| 606 | zCheckin = mprintf("%.*s", i, zName); |
| 607 | if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){ |
| 608 | zCheckin = "tip"; |
| 609 | } |
| 610 | } |
| 611 | if( nMiss==ArraySize(azSuffix) ){ |
| 612 | zName = "404.md"; |
| 613 | }else if( zName[i]==0 ){ |
| 614 | assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); |
| 615 | zName = azSuffix[nMiss]; |
| 616 | }else if( !isUV ){ |
| 617 | zName += i; |
| 618 | } |
| 619 | while( zName[0]=='/' ){ zName++; } |
| @@ -623,11 +623,11 @@ | |
| 623 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 624 | } |
| 625 | if( nMiss==0 ) zOrigName = zName; |
| 626 | if( !file_is_simple_pathname(zName, 1) ){ |
| 627 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 628 | assert( nMiss>=0 && nMiss<ArraySize(azSuffix) ); |
| 629 | zName = mprintf("%s%s", zName, azSuffix[nMiss]); |
| 630 | if( !file_is_simple_pathname(zName, 1) ){ |
| 631 | goto doc_not_found; |
| 632 | } |
| 633 | }else{ |
| @@ -686,11 +686,11 @@ | |
| 686 | Blob tail = BLOB_INITIALIZER; |
| 687 | markdown_to_html(&filebody, &title, &tail); |
| 688 | if( blob_size(&title)>0 ){ |
| 689 | style_header("%s", blob_str(&title)); |
| 690 | }else{ |
| 691 | style_header("%s", nMiss>=ArraySize(azSuffix)? |
| 692 | "Not Found" : zDfltTitle); |
| 693 | } |
| 694 | convert_href_and_output(&tail); |
| 695 | style_footer(); |
| 696 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| @@ -719,11 +719,11 @@ | |
| 719 | #endif |
| 720 | }else{ |
| 721 | cgi_set_content_type(zMime); |
| 722 | cgi_set_content(&filebody); |
| 723 | } |
| 724 | if( nMiss>=ArraySize(azSuffix) ) cgi_set_status(404, "Not Found"); |
| 725 | db_end_transaction(0); |
| 726 | return; |
| 727 | |
| 728 | /* Jump here when unable to locate the document */ |
| 729 | doc_not_found: |
| 730 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -54,11 +54,11 @@ | |
| 54 | if( !looks_like_binary(pBlob) ) { |
| 55 | return 0; /* Plain text */ |
| 56 | } |
| 57 | x = (const unsigned char*)blob_buffer(pBlob); |
| 58 | n = blob_size(pBlob); |
| 59 | for(i=0; i<count(aMime); i++){ |
| 60 | if( n>=aMime[i].size && memcmp(x, aMime[i].zPrefix, aMime[i].size)==0 ){ |
| 61 | return aMime[i].zMimetype; |
| 62 | } |
| 63 | } |
| 64 | return "unknown/unknown"; |
| @@ -293,11 +293,11 @@ | |
| 293 | ** Verify that all entries in the aMime[] table are in sorted order. |
| 294 | ** Abort with a fatal error if any is out-of-order. |
| 295 | */ |
| 296 | static void mimetype_verify(void){ |
| 297 | int i; |
| 298 | for(i=1; i<count(aMime); i++){ |
| 299 | if( fossil_strcmp(aMime[i-1].zSuffix,aMime[i].zSuffix)>=0 ){ |
| 300 | fossil_fatal("mimetypes out of sequence: %s before %s", |
| 301 | aMime[i-1].zSuffix, aMime[i].zSuffix); |
| 302 | } |
| 303 | } |
| @@ -331,11 +331,11 @@ | |
| 331 | len = strlen(z); |
| 332 | if( len<sizeof(zSuffix)-1 ){ |
| 333 | sqlite3_snprintf(sizeof(zSuffix), zSuffix, "%s", z); |
| 334 | for(i=0; zSuffix[i]; i++) zSuffix[i] = fossil_tolower(zSuffix[i]); |
| 335 | first = 0; |
| 336 | last = count(aMime) - 1; |
| 337 | while( first<=last ){ |
| 338 | int c; |
| 339 | i = (first+last)/2; |
| 340 | c = fossil_strcmp(zSuffix, aMime[i].zSuffix); |
| 341 | if( c==0 ) return aMime[i].zMimetype; |
| @@ -384,11 +384,11 @@ | |
| 384 | @ <table id='mimeTable' border=1 cellpadding=0 class='mimetypetable'> |
| 385 | @ <thead> |
| 386 | @ <tr><th>Suffix<th>Mimetype |
| 387 | @ </thead> |
| 388 | @ <tbody> |
| 389 | for(i=0; i<count(aMime); i++){ |
| 390 | @ <tr><td>%h(aMime[i].zSuffix)<td>%h(aMime[i].zMimetype)</tr> |
| 391 | } |
| 392 | @ </tbody></table> |
| 393 | output_table_sorting_javascript("mimeTable","tt",1); |
| 394 | style_footer(); |
| @@ -593,11 +593,11 @@ | |
| 593 | login_check_credentials(); |
| 594 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 595 | blob_init(&title, 0, 0); |
| 596 | zDfltTitle = isUV ? "" : "Documentation"; |
| 597 | db_begin_transaction(); |
| 598 | while( rid==0 && (++nMiss)<=count(azSuffix) ){ |
| 599 | zName = P("name"); |
| 600 | if( isUV ){ |
| 601 | if( zName==0 ) zName = "index.wiki"; |
| 602 | i = 0; |
| 603 | }else{ |
| @@ -606,14 +606,14 @@ | |
| 606 | zCheckin = mprintf("%.*s", i, zName); |
| 607 | if( fossil_strcmp(zCheckin,"ckout")==0 && g.localOpen==0 ){ |
| 608 | zCheckin = "tip"; |
| 609 | } |
| 610 | } |
| 611 | if( nMiss==count(azSuffix) ){ |
| 612 | zName = "404.md"; |
| 613 | }else if( zName[i]==0 ){ |
| 614 | assert( nMiss>=0 && nMiss<count(azSuffix) ); |
| 615 | zName = azSuffix[nMiss]; |
| 616 | }else if( !isUV ){ |
| 617 | zName += i; |
| 618 | } |
| 619 | while( zName[0]=='/' ){ zName++; } |
| @@ -623,11 +623,11 @@ | |
| 623 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 624 | } |
| 625 | if( nMiss==0 ) zOrigName = zName; |
| 626 | if( !file_is_simple_pathname(zName, 1) ){ |
| 627 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 628 | assert( nMiss>=0 && nMiss<count(azSuffix) ); |
| 629 | zName = mprintf("%s%s", zName, azSuffix[nMiss]); |
| 630 | if( !file_is_simple_pathname(zName, 1) ){ |
| 631 | goto doc_not_found; |
| 632 | } |
| 633 | }else{ |
| @@ -686,11 +686,11 @@ | |
| 686 | Blob tail = BLOB_INITIALIZER; |
| 687 | markdown_to_html(&filebody, &title, &tail); |
| 688 | if( blob_size(&title)>0 ){ |
| 689 | style_header("%s", blob_str(&title)); |
| 690 | }else{ |
| 691 | style_header("%s", nMiss>=count(azSuffix)? |
| 692 | "Not Found" : zDfltTitle); |
| 693 | } |
| 694 | convert_href_and_output(&tail); |
| 695 | style_footer(); |
| 696 | }else if( fossil_strcmp(zMime, "text/plain")==0 ){ |
| @@ -719,11 +719,11 @@ | |
| 719 | #endif |
| 720 | }else{ |
| 721 | cgi_set_content_type(zMime); |
| 722 | cgi_set_content(&filebody); |
| 723 | } |
| 724 | if( nMiss>=count(azSuffix) ) cgi_set_status(404, "Not Found"); |
| 725 | db_end_transaction(0); |
| 726 | return; |
| 727 | |
| 728 | /* Jump here when unable to locate the document */ |
| 729 | doc_not_found: |
| 730 |
+2
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1290,11 +1290,11 @@ | ||
| 1290 | 1290 | azDirs[1] = fossil_getenv("TEMP"); |
| 1291 | 1291 | azDirs[2] = fossil_getenv("TMP"); |
| 1292 | 1292 | #endif |
| 1293 | 1293 | |
| 1294 | 1294 | |
| 1295 | - for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){ | |
| 1295 | + for(i=0; i<count(azDirs); i++){ | |
| 1296 | 1296 | if( azDirs[i]==0 ) continue; |
| 1297 | 1297 | if( !file_isdir(azDirs[i]) ) continue; |
| 1298 | 1298 | zDir = azDirs[i]; |
| 1299 | 1299 | break; |
| 1300 | 1300 | } |
| @@ -1407,11 +1407,11 @@ | ||
| 1407 | 1407 | const char *file_is_win_reserved(const char *zPath){ |
| 1408 | 1408 | static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 1409 | 1409 | static char zReturn[5]; |
| 1410 | 1410 | int i; |
| 1411 | 1411 | while( zPath[0] ){ |
| 1412 | - for(i=0; i<ArraySize(azRes); i++){ | |
| 1412 | + for(i=0; i<count(azRes); i++){ | |
| 1413 | 1413 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 1414 | 1414 | && ((i>=4 && fossil_isdigit(zPath[3]) |
| 1415 | 1415 | && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0)) |
| 1416 | 1416 | || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0))) |
| 1417 | 1417 | ){ |
| 1418 | 1418 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1290,11 +1290,11 @@ | |
| 1290 | azDirs[1] = fossil_getenv("TEMP"); |
| 1291 | azDirs[2] = fossil_getenv("TMP"); |
| 1292 | #endif |
| 1293 | |
| 1294 | |
| 1295 | for(i=0; i<sizeof(azDirs)/sizeof(azDirs[0]); i++){ |
| 1296 | if( azDirs[i]==0 ) continue; |
| 1297 | if( !file_isdir(azDirs[i]) ) continue; |
| 1298 | zDir = azDirs[i]; |
| 1299 | break; |
| 1300 | } |
| @@ -1407,11 +1407,11 @@ | |
| 1407 | const char *file_is_win_reserved(const char *zPath){ |
| 1408 | static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 1409 | static char zReturn[5]; |
| 1410 | int i; |
| 1411 | while( zPath[0] ){ |
| 1412 | for(i=0; i<ArraySize(azRes); i++){ |
| 1413 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 1414 | && ((i>=4 && fossil_isdigit(zPath[3]) |
| 1415 | && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0)) |
| 1416 | || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0))) |
| 1417 | ){ |
| 1418 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1290,11 +1290,11 @@ | |
| 1290 | azDirs[1] = fossil_getenv("TEMP"); |
| 1291 | azDirs[2] = fossil_getenv("TMP"); |
| 1292 | #endif |
| 1293 | |
| 1294 | |
| 1295 | for(i=0; i<count(azDirs); i++){ |
| 1296 | if( azDirs[i]==0 ) continue; |
| 1297 | if( !file_isdir(azDirs[i]) ) continue; |
| 1298 | zDir = azDirs[i]; |
| 1299 | break; |
| 1300 | } |
| @@ -1407,11 +1407,11 @@ | |
| 1407 | const char *file_is_win_reserved(const char *zPath){ |
| 1408 | static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" }; |
| 1409 | static char zReturn[5]; |
| 1410 | int i; |
| 1411 | while( zPath[0] ){ |
| 1412 | for(i=0; i<count(azRes); i++){ |
| 1413 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| 1414 | && ((i>=4 && fossil_isdigit(zPath[3]) |
| 1415 | && (zPath[4]=='/' || zPath[4]=='.' || zPath[4]==0)) |
| 1416 | || (i<4 && (zPath[3]=='/' || zPath[3]=='.' || zPath[3]==0))) |
| 1417 | ){ |
| 1418 |
+1
-1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -454,11 +454,11 @@ | ||
| 454 | 454 | int aParent[GR_MAX_RAIL]; |
| 455 | 455 | |
| 456 | 456 | db_bind_int(&qparent, ":fid", frid); |
| 457 | 457 | db_bind_int(&qparent, ":mid", fmid); |
| 458 | 458 | db_bind_int(&qparent, ":fnid", fnid); |
| 459 | - while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 459 | + while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ | |
| 460 | 460 | aParent[nParent] = db_column_int(&qparent, 0); |
| 461 | 461 | nParent++; |
| 462 | 462 | } |
| 463 | 463 | db_reset(&qparent); |
| 464 | 464 | if( zBr==0 ) zBr = "trunk"; |
| 465 | 465 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -454,11 +454,11 @@ | |
| 454 | int aParent[GR_MAX_RAIL]; |
| 455 | |
| 456 | db_bind_int(&qparent, ":fid", frid); |
| 457 | db_bind_int(&qparent, ":mid", fmid); |
| 458 | db_bind_int(&qparent, ":fnid", fnid); |
| 459 | while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ |
| 460 | aParent[nParent] = db_column_int(&qparent, 0); |
| 461 | nParent++; |
| 462 | } |
| 463 | db_reset(&qparent); |
| 464 | if( zBr==0 ) zBr = "trunk"; |
| 465 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -454,11 +454,11 @@ | |
| 454 | int aParent[GR_MAX_RAIL]; |
| 455 | |
| 456 | db_bind_int(&qparent, ":fid", frid); |
| 457 | db_bind_int(&qparent, ":mid", fmid); |
| 458 | db_bind_int(&qparent, ":fnid", fnid); |
| 459 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 460 | aParent[nParent] = db_column_int(&qparent, 0); |
| 461 | nParent++; |
| 462 | } |
| 463 | db_reset(&qparent); |
| 464 | if( zBr==0 ) zBr = "trunk"; |
| 465 |
+6
-2
| --- src/fshell.c | ||
| +++ src/fshell.c | ||
| @@ -25,10 +25,11 @@ | ||
| 25 | 25 | ** It allows multiple commands to be issued without having to reenter the |
| 26 | 26 | ** crypto phasephrase for each command. |
| 27 | 27 | */ |
| 28 | 28 | #include "config.h" |
| 29 | 29 | #include "fshell.h" |
| 30 | +#include "linenoise.h" | |
| 30 | 31 | #include <ctype.h> |
| 31 | 32 | |
| 32 | 33 | #ifndef _WIN32 |
| 33 | 34 | #include <sys/types.h> |
| 34 | 35 | #include <sys/wait.h> |
| @@ -55,16 +56,19 @@ | ||
| 55 | 56 | int mxArg = 0; |
| 56 | 57 | int n, i; |
| 57 | 58 | char **azArg = 0; |
| 58 | 59 | int fDebug; |
| 59 | 60 | pid_t childPid; |
| 60 | - char zLine[10000]; | |
| 61 | + char *zLine = 0; | |
| 61 | 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 62 | 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 63 | 64 | db_close(0); |
| 64 | 65 | sqlite3_shutdown(); |
| 65 | - while( printf("fossil> "),fflush(stdout),fgets(zLine, sizeof(zLine), stdin) ){ | |
| 66 | + while( (free(zLine), zLine = linenoise("fossil> ")) ){ | |
| 67 | + /* Remember shell history within the current session */ | |
| 68 | + linenoiseHistoryAdd(zLine); | |
| 69 | + | |
| 66 | 70 | /* Parse the line of input */ |
| 67 | 71 | n = (int)strlen(zLine); |
| 68 | 72 | for(i=0, nArg=1; i<n; i++){ |
| 69 | 73 | while( fossil_isspace(zLine[i]) ){ i++; } |
| 70 | 74 | if( i>=n ) break; |
| 71 | 75 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -25,10 +25,11 @@ | |
| 25 | ** It allows multiple commands to be issued without having to reenter the |
| 26 | ** crypto phasephrase for each command. |
| 27 | */ |
| 28 | #include "config.h" |
| 29 | #include "fshell.h" |
| 30 | #include <ctype.h> |
| 31 | |
| 32 | #ifndef _WIN32 |
| 33 | #include <sys/types.h> |
| 34 | #include <sys/wait.h> |
| @@ -55,16 +56,19 @@ | |
| 55 | int mxArg = 0; |
| 56 | int n, i; |
| 57 | char **azArg = 0; |
| 58 | int fDebug; |
| 59 | pid_t childPid; |
| 60 | char zLine[10000]; |
| 61 | fDebug = find_option("debug", 0, 0)!=0; |
| 62 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 63 | db_close(0); |
| 64 | sqlite3_shutdown(); |
| 65 | while( printf("fossil> "),fflush(stdout),fgets(zLine, sizeof(zLine), stdin) ){ |
| 66 | /* Parse the line of input */ |
| 67 | n = (int)strlen(zLine); |
| 68 | for(i=0, nArg=1; i<n; i++){ |
| 69 | while( fossil_isspace(zLine[i]) ){ i++; } |
| 70 | if( i>=n ) break; |
| 71 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -25,10 +25,11 @@ | |
| 25 | ** It allows multiple commands to be issued without having to reenter the |
| 26 | ** crypto phasephrase for each command. |
| 27 | */ |
| 28 | #include "config.h" |
| 29 | #include "fshell.h" |
| 30 | #include "linenoise.h" |
| 31 | #include <ctype.h> |
| 32 | |
| 33 | #ifndef _WIN32 |
| 34 | #include <sys/types.h> |
| 35 | #include <sys/wait.h> |
| @@ -55,16 +56,19 @@ | |
| 56 | int mxArg = 0; |
| 57 | int n, i; |
| 58 | char **azArg = 0; |
| 59 | int fDebug; |
| 60 | pid_t childPid; |
| 61 | char *zLine = 0; |
| 62 | fDebug = find_option("debug", 0, 0)!=0; |
| 63 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 64 | db_close(0); |
| 65 | sqlite3_shutdown(); |
| 66 | while( (free(zLine), zLine = linenoise("fossil> ")) ){ |
| 67 | /* Remember shell history within the current session */ |
| 68 | linenoiseHistoryAdd(zLine); |
| 69 | |
| 70 | /* Parse the line of input */ |
| 71 | n = (int)strlen(zLine); |
| 72 | for(i=0, nArg=1; i<n; i++){ |
| 73 | while( fossil_isspace(zLine[i]) ){ i++; } |
| 74 | if( i>=n ) break; |
| 75 |
+1
-1
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1612,11 +1612,11 @@ | ||
| 1612 | 1612 | {"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3}, |
| 1613 | 1613 | {"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3}, |
| 1614 | 1614 | {"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2}, |
| 1615 | 1615 | }, *renOpt = renOpts; |
| 1616 | 1616 | int i; |
| 1617 | - for( i = 0; i < sizeof(renOpts) / sizeof(*renOpts); ++i, ++renOpt ){ | |
| 1617 | + for( i = 0; i < count(renOpts); ++i, ++renOpt ){ | |
| 1618 | 1618 | if( 1 << svnFlag & renOpt->format ){ |
| 1619 | 1619 | const char *zArgument = find_option(renOpt->zOpt, 0, 1); |
| 1620 | 1620 | if( zArgument ){ |
| 1621 | 1621 | const char *sep = strchr(zArgument, '%'); |
| 1622 | 1622 | if( !sep ){ |
| 1623 | 1623 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1612,11 +1612,11 @@ | |
| 1612 | {"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3}, |
| 1613 | {"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3}, |
| 1614 | {"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2}, |
| 1615 | }, *renOpt = renOpts; |
| 1616 | int i; |
| 1617 | for( i = 0; i < sizeof(renOpts) / sizeof(*renOpts); ++i, ++renOpt ){ |
| 1618 | if( 1 << svnFlag & renOpt->format ){ |
| 1619 | const char *zArgument = find_option(renOpt->zOpt, 0, 1); |
| 1620 | if( zArgument ){ |
| 1621 | const char *sep = strchr(zArgument, '%'); |
| 1622 | if( !sep ){ |
| 1623 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1612,11 +1612,11 @@ | |
| 1612 | {"rename-branch", &gimport.zBranchPre, "", &gimport.zBranchSuf, "", 3}, |
| 1613 | {"rename-tag" , &gimport.zTagPre , "", &gimport.zTagSuf , "", 3}, |
| 1614 | {"rename-rev" , &gsvn.zRevPre, "svn-rev-", &gsvn.zRevSuf , "", 2}, |
| 1615 | }, *renOpt = renOpts; |
| 1616 | int i; |
| 1617 | for( i = 0; i < count(renOpts); ++i, ++renOpt ){ |
| 1618 | if( 1 << svnFlag & renOpt->format ){ |
| 1619 | const char *zArgument = find_option(renOpt->zOpt, 0, 1); |
| 1620 | if( zArgument ){ |
| 1621 | const char *sep = strchr(zArgument, '%'); |
| 1622 | if( !sep ){ |
| 1623 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2248,11 +2248,11 @@ | ||
| 2248 | 2248 | { "#91d680", 0 }, |
| 2249 | 2249 | |
| 2250 | 2250 | |
| 2251 | 2251 | { "custom", "##" }, |
| 2252 | 2252 | }; |
| 2253 | - int nColor = sizeof(aColor)/sizeof(aColor[0])-1; | |
| 2253 | + int nColor = count(aColor)-1; | |
| 2254 | 2254 | int stdClrFound = 0; |
| 2255 | 2255 | int i; |
| 2256 | 2256 | |
| 2257 | 2257 | if( zIdPropagate ){ |
| 2258 | 2258 | @ <div><label> |
| 2259 | 2259 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2248,11 +2248,11 @@ | |
| 2248 | { "#91d680", 0 }, |
| 2249 | |
| 2250 | |
| 2251 | { "custom", "##" }, |
| 2252 | }; |
| 2253 | int nColor = sizeof(aColor)/sizeof(aColor[0])-1; |
| 2254 | int stdClrFound = 0; |
| 2255 | int i; |
| 2256 | |
| 2257 | if( zIdPropagate ){ |
| 2258 | @ <div><label> |
| 2259 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2248,11 +2248,11 @@ | |
| 2248 | { "#91d680", 0 }, |
| 2249 | |
| 2250 | |
| 2251 | { "custom", "##" }, |
| 2252 | }; |
| 2253 | int nColor = count(aColor)-1; |
| 2254 | int stdClrFound = 0; |
| 2255 | int i; |
| 2256 | |
| 2257 | if( zIdPropagate ){ |
| 2258 | @ <div><label> |
| 2259 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2350,11 +2350,11 @@ | ||
| 2350 | 2350 | if( zBrowser==0 ){ |
| 2351 | 2351 | static const char *const azBrowserProg[] = |
| 2352 | 2352 | { "xdg-open", "gnome-open", "firefox", "google-chrome" }; |
| 2353 | 2353 | int i; |
| 2354 | 2354 | zBrowser = "echo"; |
| 2355 | - for(i=0; i<sizeof(azBrowserProg)/sizeof(azBrowserProg[0]); i++){ | |
| 2355 | + for(i=0; i<count(azBrowserProg); i++){ | |
| 2356 | 2356 | if( binaryOnPath(azBrowserProg[i]) ){ |
| 2357 | 2357 | zBrowser = azBrowserProg[i]; |
| 2358 | 2358 | break; |
| 2359 | 2359 | } |
| 2360 | 2360 | } |
| 2361 | 2361 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2350,11 +2350,11 @@ | |
| 2350 | if( zBrowser==0 ){ |
| 2351 | static const char *const azBrowserProg[] = |
| 2352 | { "xdg-open", "gnome-open", "firefox", "google-chrome" }; |
| 2353 | int i; |
| 2354 | zBrowser = "echo"; |
| 2355 | for(i=0; i<sizeof(azBrowserProg)/sizeof(azBrowserProg[0]); i++){ |
| 2356 | if( binaryOnPath(azBrowserProg[i]) ){ |
| 2357 | zBrowser = azBrowserProg[i]; |
| 2358 | break; |
| 2359 | } |
| 2360 | } |
| 2361 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2350,11 +2350,11 @@ | |
| 2350 | if( zBrowser==0 ){ |
| 2351 | static const char *const azBrowserProg[] = |
| 2352 | { "xdg-open", "gnome-open", "firefox", "google-chrome" }; |
| 2353 | int i; |
| 2354 | zBrowser = "echo"; |
| 2355 | for(i=0; i<count(azBrowserProg); i++){ |
| 2356 | if( binaryOnPath(azBrowserProg[i]) ){ |
| 2357 | zBrowser = azBrowserProg[i]; |
| 2358 | break; |
| 2359 | } |
| 2360 | } |
| 2361 |
+93
-85
| --- src/makeheaders.html | ||
| +++ src/makeheaders.html | ||
| @@ -4,11 +4,11 @@ | ||
| 4 | 4 | <h1 align=center>The Makeheaders Program</h1> |
| 5 | 5 | |
| 6 | 6 | |
| 7 | 7 | <p> |
| 8 | 8 | This document describes <em>makeheaders</em>, |
| 9 | -a tool that automatically generates ``<code>.h</code>'' | |
| 9 | +a tool that automatically generates “<code>.h</code>” | |
| 10 | 10 | files for a C or C++ programming project. |
| 11 | 11 | </p> |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | <h2>Table Of Contents</h2> |
| @@ -67,11 +67,11 @@ | ||
| 67 | 67 | <ul> |
| 68 | 68 | <li> Typedefs. |
| 69 | 69 | <li> Structure, union and enumeration declarations. |
| 70 | 70 | <li> Function and procedure prototypes. |
| 71 | 71 | <li> Preprocessor macros and #defines. |
| 72 | -<li> ``extern'' variable declarations. | |
| 72 | +<li> “<code>extern</code>” variable declarations. | |
| 73 | 73 | </ul> |
| 74 | 74 | </p> |
| 75 | 75 | |
| 76 | 76 | <p> |
| 77 | 77 | Definitions in C, on the other hand, include these kinds of things: |
| @@ -89,13 +89,13 @@ | ||
| 89 | 89 | is the <em>interface</em> and the definition is the <em>implementation</em>. |
| 90 | 90 | </p> |
| 91 | 91 | |
| 92 | 92 | <p> |
| 93 | 93 | In C programs, it has always been the tradition that declarations are |
| 94 | -put in files with the ``<code>.h</code>'' suffix and definitions are | |
| 95 | -placed in ``<code>.c</code>'' files. | |
| 96 | -The .c files contain ``<code>#include</code>'' preprocessor statements | |
| 94 | +put in files with the “<code>.h</code>” suffix and definitions are | |
| 95 | +placed in “<code>.c</code>” files. | |
| 96 | +The .c files contain “<code>#include</code>” preprocessor statements | |
| 97 | 97 | that cause the contents of .h files to be included as part of the |
| 98 | 98 | source code when the .c file is compiled. |
| 99 | 99 | In this way, the .h files define the interface to a subsystem and |
| 100 | 100 | the .c files define how the subsystem is implemented. |
| 101 | 101 | </p> |
| @@ -262,11 +262,11 @@ | ||
| 262 | 262 | |
| 263 | 263 | <p> |
| 264 | 264 | A similar option is -H. Like the lower-case -h option, big -H |
| 265 | 265 | generates a single include file on standard output. But unlike |
| 266 | 266 | small -h, the big -H only emits prototypes and declarations that |
| 267 | -have been designated as ``exportable''. | |
| 267 | +have been designated as “exportable”. | |
| 268 | 268 | The idea is that -H will generate an include file that defines |
| 269 | 269 | the interface to a library. |
| 270 | 270 | More will be said about this in section 3.4. |
| 271 | 271 | </p> |
| 272 | 272 | |
| @@ -293,13 +293,13 @@ | ||
| 293 | 293 | then you can supply an empty header filename, like this: |
| 294 | 294 | <pre> |
| 295 | 295 | makeheaders alpha.c beta.c gamma.c: |
| 296 | 296 | </pre> |
| 297 | 297 | In this example, makeheaders will scan the three files named |
| 298 | -``alpha.c'', | |
| 299 | -``beta.c'' and | |
| 300 | -``gamma.c'' | |
| 298 | +“<code>alpha.c</code>”, | |
| 299 | +“<code>beta.c</code>” and | |
| 300 | +“<code>gamma.c</code>” | |
| 301 | 301 | but because of the colon on the end of third filename |
| 302 | 302 | it will only generate headers for the first two files. |
| 303 | 303 | Unfortunately, |
| 304 | 304 | it is not possible to get makeheaders to process any file whose |
| 305 | 305 | name contains a colon. |
| @@ -309,14 +309,14 @@ | ||
| 309 | 309 | In a large project, the length of the command line for makeheaders |
| 310 | 310 | can become very long. |
| 311 | 311 | If the operating system doesn't support long command lines |
| 312 | 312 | (example: DOS and Win32) you may not be able to list all of the |
| 313 | 313 | input files in the space available. |
| 314 | -In that case, you can use the ``-f'' option followed | |
| 314 | +In that case, you can use the “<code>-f</code>” option followed | |
| 315 | 315 | by the name of a file to cause makeheaders to read command line |
| 316 | 316 | options and filename from the file instead of from the command line. |
| 317 | -For example, you might prepare a file named ``mkhdr.dat'' | |
| 317 | +For example, you might prepare a file named “<code>mkhdr.dat</code>” | |
| 318 | 318 | that contains text like this: |
| 319 | 319 | <pre> |
| 320 | 320 | src/alpha.c:hdr/alpha.h |
| 321 | 321 | src/beta.c:hdr/beta.h |
| 322 | 322 | src/gamma.c:hdr/gamma.h |
| @@ -327,18 +327,18 @@ | ||
| 327 | 327 | makeheaders -f mkhdr.dat |
| 328 | 328 | </pre> |
| 329 | 329 | </p> |
| 330 | 330 | |
| 331 | 331 | <p> |
| 332 | -The ``-local'' option causes makeheaders to | |
| 333 | -generate of prototypes for ``static'' functions and | |
| 332 | +The “<code>-local</code>” option causes makeheaders to | |
| 333 | +generate of prototypes for “<code>static</code>” functions and | |
| 334 | 334 | procedures. |
| 335 | 335 | Such prototypes are normally omitted. |
| 336 | 336 | </p> |
| 337 | 337 | |
| 338 | 338 | <p> |
| 339 | -Finally, makeheaders also includes a ``-doc'' option. | |
| 339 | +Finally, makeheaders also includes a “<code>-doc</code>” option. | |
| 340 | 340 | This command line option prevents makeheaders from generating any |
| 341 | 341 | headers at all. |
| 342 | 342 | Instead, makeheaders will write to standard output |
| 343 | 343 | information about every definition and declaration that it encounters |
| 344 | 344 | in its scan of source files. |
| @@ -352,19 +352,21 @@ | ||
| 352 | 352 | </p> |
| 353 | 353 | |
| 354 | 354 | <p> |
| 355 | 355 | If you forget what command line options are available, or forget |
| 356 | 356 | their exact name, you can invoke makeheaders using an unknown |
| 357 | -command line option (like ``--help'' or ``-?'') | |
| 357 | +command line option (like “<code>--help</code>” or | |
| 358 | +“<code>-?</code>”) | |
| 358 | 359 | and it will print a summary of the available options on standard |
| 359 | 360 | error. |
| 360 | -If you need to process a file whose name begins with ``-'', | |
| 361 | -you can prepend a ``./'' to its name in order to get it | |
| 361 | +If you need to process a file whose name begins with | |
| 362 | +“<code>-</code>”, | |
| 363 | +you can prepend a “<code>./</code>” to its name in order to get it | |
| 362 | 364 | accepted by the command line parser. |
| 363 | -Or, you can insert the special option ``--'' on the command | |
| 364 | -line to cause all subsequent command line arguments to be treated as | |
| 365 | -filenames even if their names beginn with ``-''. | |
| 365 | +Or, you can insert the special option “<code>--</code>” on the | |
| 366 | +command line to cause all subsequent command line arguments to be treated as | |
| 367 | +filenames even if their names begin with “<code>-</code>”. | |
| 366 | 368 | </p> |
| 367 | 369 | |
| 368 | 370 | <a name="H0006"></a> |
| 369 | 371 | <h2>3.0 Preparing Source Files For Use With Makeheaders</h2> |
| 370 | 372 | |
| @@ -379,30 +381,31 @@ | ||
| 379 | 381 | |
| 380 | 382 | <a name="H0007"></a> |
| 381 | 383 | <h3>3.1 The Basic Setup</h3> |
| 382 | 384 | |
| 383 | 385 | <p> |
| 384 | -The simpliest way to use makeheaders is to put all definitions in | |
| 386 | +The simplest way to use makeheaders is to put all definitions in | |
| 385 | 387 | one or more .c files and all structure and type declarations in |
| 386 | 388 | separate .h files. |
| 387 | 389 | The only restriction is that you should take care to chose basenames |
| 388 | -for your .h files that are different from the basenames for you | |
| 390 | +for your .h files that are different from the basenames for your | |
| 389 | 391 | .c files. |
| 390 | -Recall that if your .c file is named (for example) ``alpha.c'' | |
| 392 | +Recall that if your .c file is named (for example) | |
| 393 | +“<code>alpha.c</code>” | |
| 391 | 394 | makeheaders will attempt to generate a corresponding header file |
| 392 | -named ``alpha.h''. | |
| 395 | +named “<code>alpha.h</code>”. | |
| 393 | 396 | For that reason, you don't want to use that name for |
| 394 | 397 | any of the .h files you write since that will prevent makeheaders |
| 395 | 398 | from generating the .h file automatically. |
| 396 | 399 | </p> |
| 397 | 400 | |
| 398 | 401 | <p> |
| 399 | 402 | The structure of a .c file intented for use with makeheaders is very |
| 400 | 403 | simple. |
| 401 | -All you have to do is add a single ``#include'' to the top | |
| 402 | -of the file that sources the header file that makeheaders will generate. | |
| 403 | -Hence, the beginning of a source file named ``alpha.c'' | |
| 404 | +All you have to do is add a single “<code>#include</code>” to the | |
| 405 | +top of the file that sources the header file that makeheaders will generate. | |
| 406 | +Hence, the beginning of a source file named “<code>alpha.c</code>” | |
| 404 | 407 | might look something like this: |
| 405 | 408 | </p> |
| 406 | 409 | |
| 407 | 410 | <pre> |
| 408 | 411 | /* |
| @@ -415,14 +418,14 @@ | ||
| 415 | 418 | |
| 416 | 419 | <p> |
| 417 | 420 | Your manually generated header files require no special attention at all. |
| 418 | 421 | Code them as you normally would. |
| 419 | 422 | However, makeheaders will work better if you omit the |
| 420 | -``#if'' statements people often put around the outside of | |
| 423 | +“<code>#if</code>” statements people often put around the outside of | |
| 421 | 424 | header files that prevent the files from being included more than once. |
| 422 | -For example, to create a header file named ``beta.h'', many | |
| 423 | -people will habitually write the following: | |
| 425 | +For example, to create a header file named “<code>beta.h</code>”, | |
| 426 | +many people will habitually write the following: | |
| 424 | 427 | |
| 425 | 428 | <pre> |
| 426 | 429 | #ifndef BETA_H |
| 427 | 430 | #define BETA_H |
| 428 | 431 | |
| @@ -435,11 +438,11 @@ | ||
| 435 | 438 | Remember that the header files you write will never really be |
| 436 | 439 | included by any C code. |
| 437 | 440 | Instead, makeheaders will scan your header files to extract only |
| 438 | 441 | those declarations that are needed by individual .c files and then |
| 439 | 442 | copy those declarations to the .h files corresponding to the .c files. |
| 440 | -Hence, the ``#if'' wrapper serves no useful purpose. | |
| 443 | +Hence, the “<code>#if</code>” wrapper serves no useful purpose. | |
| 441 | 444 | But it does make makeheaders work harder, forcing it to put |
| 442 | 445 | the statements |
| 443 | 446 | |
| 444 | 447 | <pre> |
| 445 | 448 | #if !defined(BETA_H) |
| @@ -465,11 +468,11 @@ | ||
| 465 | 468 | </p> |
| 466 | 469 | |
| 467 | 470 | <p> |
| 468 | 471 | Note that |
| 469 | 472 | the wildcard expression used in the above example, |
| 470 | -``<code>*.[ch]</code>'', | |
| 473 | +“<code>*.[ch]</code>”, | |
| 471 | 474 | will expand to include all .h files in the current directory, both |
| 472 | 475 | those entered manually be the programmer and others generated automatically |
| 473 | 476 | by a prior run of makeheaders. |
| 474 | 477 | But that is not a problem. |
| 475 | 478 | The makeheaders program will recognize and ignore any files it |
| @@ -489,14 +492,14 @@ | ||
| 489 | 492 | <p><li> |
| 490 | 493 | When a function is defined in any .c file, a prototype of that function |
| 491 | 494 | is placed in the generated .h file of every .c file that |
| 492 | 495 | calls the function.</p> |
| 493 | 496 | |
| 494 | -<P>If the ``static'' keyword of C appears at the beginning | |
| 495 | -of the function definition, the prototype is suppressed. | |
| 496 | -If you use the ``LOCAL'' keyword where you would normally | |
| 497 | -say ``static'', then a prototype is generated, but it | |
| 497 | +<P>If the “<code>static</code>” keyword of C appears at the | |
| 498 | +beginning of the function definition, the prototype is suppressed. | |
| 499 | +If you use the “<code>LOCAL</code>” keyword where you would normally | |
| 500 | +say “<code>static</code>”, then a prototype is generated, but it | |
| 498 | 501 | will only appear in the single header file that corresponds to the |
| 499 | 502 | source file containing the function. For example, if the file |
| 500 | 503 | <code>alpha.c</code> contains the following: |
| 501 | 504 | <pre> |
| 502 | 505 | LOCAL int testFunc(void){ |
| @@ -509,24 +512,26 @@ | ||
| 509 | 512 | LOCAL int testFunc(void); |
| 510 | 513 | </pre> |
| 511 | 514 | However, no other generated header files will contain a prototype for |
| 512 | 515 | <code>testFunc()</code> since the function has only file scope.</p> |
| 513 | 516 | |
| 514 | -<p>When the ``LOCAL'' keyword is used, makeheaders will also | |
| 515 | -generate a #define for LOCAL, like this: | |
| 517 | +<p>When the “<code>LOCAL</code>” keyword is used, makeheaders will | |
| 518 | +also generate a #define for LOCAL, like this: | |
| 516 | 519 | <pre> |
| 517 | 520 | #define LOCAL static |
| 518 | 521 | </pre> |
| 519 | 522 | so that the C compiler will know what it means.</p> |
| 520 | 523 | |
| 521 | -<p>If you invoke makeheaders with a ``-local'' command-line | |
| 522 | -option, then it treats the ``static'' keyword like | |
| 523 | -``LOCAL'' and generates prototypes in the header file | |
| 524 | -that corresponds to the source file containing the function defintiion.</p> | |
| 524 | +<p>If you invoke makeheaders with a “<code>-local</code>” | |
| 525 | +command-line option, then it treats the “<code>static</code>” | |
| 526 | +keyword like “<code>LOCAL</code>” and generates prototypes in the | |
| 527 | +header file that corresponds to the source file containing the function | |
| 528 | +definition.</p> | |
| 525 | 529 | |
| 526 | 530 | <p><li> |
| 527 | -When a global variable is defined in a .c file, an ``extern'' | |
| 531 | +When a global variable is defined in a .c file, an | |
| 532 | +“<code>extern</code>” | |
| 528 | 533 | declaration of that variable is placed in the header of every |
| 529 | 534 | .c file that uses the variable. |
| 530 | 535 | </p> |
| 531 | 536 | |
| 532 | 537 | <p><li> |
| @@ -550,12 +555,12 @@ | ||
| 550 | 555 | |
| 551 | 556 | <p><li> |
| 552 | 557 | When a structure, union or enumeration declaration appears in a .h |
| 553 | 558 | file, makeheaders will automatically |
| 554 | 559 | generate a typedef that allows the declaration to be referenced without |
| 555 | -the ``struct'', ``union'' or ``enum'' | |
| 556 | -qualifier. | |
| 560 | +the “<code>struct</code>”, “<code>union</code>” or | |
| 561 | +“<code>enum</code>” qualifier. | |
| 557 | 562 | In other words, if makeheaders sees the code: |
| 558 | 563 | <pre> |
| 559 | 564 | struct Examp { /* ... */ }; |
| 560 | 565 | </pre> |
| 561 | 566 | it will automatically generate a corresponding typedef like this: |
| @@ -572,13 +577,13 @@ | ||
| 572 | 577 | </ul> |
| 573 | 578 | |
| 574 | 579 | <p> |
| 575 | 580 | As a final note, we observe that automatically generated declarations |
| 576 | 581 | are ordered as required by the ANSI-C programming language. |
| 577 | -If the declaration of some structure ``X'' requires a prior | |
| 578 | -declaration of another structure ``Y'', then Y will appear | |
| 579 | -first in the generated headers. | |
| 582 | +If the declaration of some structure “<code>X</code>” requires a | |
| 583 | +prior declaration of another structure “<code>Y</code>”, then Y will | |
| 584 | +appear first in the generated headers. | |
| 580 | 585 | </p> |
| 581 | 586 | |
| 582 | 587 | <a name="H0009"></a> |
| 583 | 588 | <h3>3.3 How To Avoid Having To Write Any Header Files</h3> |
| 584 | 589 | |
| @@ -611,18 +616,18 @@ | ||
| 611 | 616 | <pre> |
| 612 | 617 | #if INTERFACE |
| 613 | 618 | #endif |
| 614 | 619 | </pre> |
| 615 | 620 | Thus any structure definitions that appear after the |
| 616 | -``#if INTERFACE'' but before the corresponding | |
| 617 | -``#endif'' are eligable to be copied into the | |
| 621 | +“<code>#if INTERFACE</code>” but before the corresponding | |
| 622 | +“<code>#endif</code>” are eligable to be copied into the | |
| 618 | 623 | automatically generated |
| 619 | 624 | .h files of other .c files. |
| 620 | 625 | </p> |
| 621 | 626 | |
| 622 | 627 | <p> |
| 623 | -If you use the ``#if INTERFACE'' mechanism in a .c file, | |
| 628 | +If you use the “<code>#if INTERFACE</code>” mechanism in a .c file, | |
| 624 | 629 | then the generated header for that .c file will contain a line |
| 625 | 630 | like this: |
| 626 | 631 | <pre> |
| 627 | 632 | #define INTERFACE 0 |
| 628 | 633 | </pre> |
| @@ -637,15 +642,15 @@ | ||
| 637 | 642 | </p> |
| 638 | 643 | |
| 639 | 644 | <p> |
| 640 | 645 | Note that you don't have to use this approach exclusively. |
| 641 | 646 | You can put some declarations in .h files and others within the |
| 642 | -``#if INTERFACE'' regions of .c files. | |
| 647 | +“<code>#if INTERFACE</code>” regions of .c files. | |
| 643 | 648 | Makeheaders treats all declarations alike, no matter where they |
| 644 | 649 | come from. |
| 645 | 650 | You should also note that a single .c file can contain as many |
| 646 | -``#if INTERFACE'' regions as desired. | |
| 651 | +“<code>#if INTERFACE</code>” regions as desired. | |
| 647 | 652 | </p> |
| 648 | 653 | |
| 649 | 654 | <a name="H0010"></a> |
| 650 | 655 | <h3>3.4 Designating Declarations For Export</h3> |
| 651 | 656 | |
| @@ -664,11 +669,11 @@ | ||
| 664 | 669 | like this, but makeheaders does. |
| 665 | 670 | </p> |
| 666 | 671 | |
| 667 | 672 | <p> |
| 668 | 673 | Using makeheaders, it is possible to designate routines and data |
| 669 | -structures as being for ``export''. | |
| 674 | +structures as being for “<code>export</code>”. | |
| 670 | 675 | Exported objects are visible not only to other files within the |
| 671 | 676 | same library or subassembly but also to other |
| 672 | 677 | libraries and subassemblies in the larger program. |
| 673 | 678 | By default, makeheaders only makes objects visible to other members |
| 674 | 679 | of the same library. |
| @@ -690,14 +695,14 @@ | ||
| 690 | 695 | |
| 691 | 696 | <p> |
| 692 | 697 | But trouble quickly arises when we attempt to devise a mechanism for |
| 693 | 698 | telling makeheaders which prototypes it should export and which it should |
| 694 | 699 | keep local. |
| 695 | -The built-in ``static'' keyword of C works well for prohibiting | |
| 696 | -prototypes from leaving a single source file, but because C doesn't | |
| 700 | +The built-in “<code>static</code>” keyword of C works well for | |
| 701 | +prohibiting prototypes from leaving a single source file, but because C doesn't | |
| 697 | 702 | support a linkage hierarchy, there is nothing in the C language to help us. |
| 698 | -We'll have to invite our own keyword: ``EXPORT'' | |
| 703 | +We'll have to invite our own keyword: “<code>EXPORT</code>” | |
| 699 | 704 | </p> |
| 700 | 705 | |
| 701 | 706 | <p> |
| 702 | 707 | Makeheaders allows the EXPORT keyword to precede any function or |
| 703 | 708 | procedure definition. |
| @@ -726,15 +731,15 @@ | ||
| 726 | 731 | <pre> |
| 727 | 732 | #if EXPORT_INTERFACE |
| 728 | 733 | #endif |
| 729 | 734 | </pre> |
| 730 | 735 | will become part of the exported interface. |
| 731 | -The ``#if EXPORT_INTERFACE'' mechanism can be used in either | |
| 732 | -.c or .h files. | |
| 733 | -(The ``#if INTERFACE'' can also be used in both .h and .c files, | |
| 734 | -but since it's use in a .h file would be redundant, we haven't mentioned | |
| 735 | -it before.) | |
| 736 | +The “<code>#if EXPORT_INTERFACE</code>” mechanism can be used in | |
| 737 | +either .c or .h files. | |
| 738 | +(The “<code>#if INTERFACE</code>” can also be used in both .h and | |
| 739 | +.c files, but since it's use in a .h file would be redundant, we haven't | |
| 740 | +mentioned it before.) | |
| 736 | 741 | </p> |
| 737 | 742 | |
| 738 | 743 | <a name="H0011"></a> |
| 739 | 744 | <h3>3.5 Local declarations processed by makeheaders</h3> |
| 740 | 745 | |
| @@ -742,11 +747,11 @@ | ||
| 742 | 747 | Structure declarations and typedefs that appear in .c files are normally |
| 743 | 748 | ignored by makeheaders. |
| 744 | 749 | Such declarations are only intended for use by the source file in which |
| 745 | 750 | they appear and so makeheaders doesn't need to copy them into any |
| 746 | 751 | generated header files. |
| 747 | -We call such declarations ``private''. | |
| 752 | +We call such declarations “<code>private</code>”. | |
| 748 | 753 | </p> |
| 749 | 754 | |
| 750 | 755 | <p> |
| 751 | 756 | Sometimes it is convenient to have makeheaders sort a sequence |
| 752 | 757 | of private declarations into the correct order for us automatically. |
| @@ -764,12 +769,13 @@ | ||
| 764 | 769 | within |
| 765 | 770 | <pre> |
| 766 | 771 | #if LOCAL_INTERFACE |
| 767 | 772 | #endif |
| 768 | 773 | </pre> |
| 769 | -A ``LOCAL_INTERFACE'' block works very much like the | |
| 770 | -``INTERFACE'' and ``EXPORT_INTERFACE'' | |
| 774 | +A “<code>LOCAL_INTERFACE</code>” block works very much like the | |
| 775 | +“<code>INTERFACE</code>” and | |
| 776 | +“<code>EXPORT_INTERFACE</code>” | |
| 771 | 777 | blocks described above, except that makeheaders insures that the |
| 772 | 778 | objects declared in a LOCAL_INTERFACE are only visible to the |
| 773 | 779 | file containing the LOCAL_INTERFACE. |
| 774 | 780 | </p> |
| 775 | 781 | |
| @@ -777,11 +783,12 @@ | ||
| 777 | 783 | <h3>3.6 Using Makeheaders With C++ Code</h3> |
| 778 | 784 | |
| 779 | 785 | <p> |
| 780 | 786 | You can use makeheaders to generate header files for C++ code, in |
| 781 | 787 | addition to C. |
| 782 | -Makeheaders will recognize and copy both ``class'' declarations | |
| 788 | +Makeheaders will recognize and copy both “<code>class</code>” | |
| 789 | +declarations | |
| 783 | 790 | and inline function definitions, and it knows not to try to generate |
| 784 | 791 | prototypes for methods. |
| 785 | 792 | </p> |
| 786 | 793 | |
| 787 | 794 | <p> |
| @@ -805,20 +812,20 @@ | ||
| 805 | 812 | C++ input. Makeheaders will recognize that its source code is C++ |
| 806 | 813 | by the suffix on the source code filename. Simple ".c" or ".h" suffixes |
| 807 | 814 | are assumed to be ANSI-C. Anything else, including ".cc", ".C" and |
| 808 | 815 | ".cpp" is assumed to be C++. |
| 809 | 816 | The name of the header file generated by makeheaders is derived from |
| 810 | -by the name of the source file by converting every "c" to "h" and | |
| 817 | +the name of the source file by converting every "c" to "h" and | |
| 811 | 818 | every "C" to "H" in the suffix of the filename. |
| 812 | 819 | Thus the C++ source |
| 813 | -file ``alpha.cpp'' will induce makeheaders to | |
| 814 | -generate a header file named ``alpha.hpp''. | |
| 820 | +file “<code>alpha.cpp</code>” will induce makeheaders to | |
| 821 | +generate a header file named “<code>alpha.hpp</code>”. | |
| 815 | 822 | </p> |
| 816 | 823 | |
| 817 | 824 | <p> |
| 818 | 825 | Makeheaders augments class definitions by inserting prototypes to |
| 819 | -methods were appropriate. If a method definition begins with one | |
| 826 | +methods where appropriate. If a method definition begins with one | |
| 820 | 827 | of the special keywords <b>PUBLIC</b>, <b>PROTECTED</b>, or |
| 821 | 828 | <b>PRIVATE</b> (in upper-case to distinguish them from the regular |
| 822 | 829 | C++ keywords with the same meaning) then a prototype for that |
| 823 | 830 | method will be inserted into the class definition. If none of |
| 824 | 831 | these keywords appear, then the prototype is not inserted. For |
| @@ -867,11 +874,11 @@ | ||
| 867 | 874 | <h4>3.6.1 C++ Limitations</h4> |
| 868 | 875 | |
| 869 | 876 | <p> |
| 870 | 877 | Makeheaders does not understand more recent |
| 871 | 878 | C++ syntax such as templates and namespaces. |
| 872 | -Perhaps these issued will be addressed in future revisions. | |
| 879 | +Perhaps these issues will be addressed in future revisions. | |
| 873 | 880 | </p> |
| 874 | 881 | |
| 875 | 882 | <a name="H0013"></a> |
| 876 | 883 | <h3>3.7 Conditional Compilation</h3> |
| 877 | 884 | |
| @@ -879,13 +886,13 @@ | ||
| 879 | 886 | The makeheaders program understands and tracks the conditional |
| 880 | 887 | compilation constructs in the source code files it scans. |
| 881 | 888 | Hence, if the following code appears in a source file |
| 882 | 889 | <pre> |
| 883 | 890 | #ifdef UNIX |
| 884 | - # define WORKS_WELL 1 | |
| 891 | + # define WORKS_WELL 1 | |
| 885 | 892 | #else |
| 886 | - # define WORKS_WELL 0 | |
| 893 | + # define WORKS_WELL 0 | |
| 887 | 894 | #endif |
| 888 | 895 | </pre> |
| 889 | 896 | then the next patch of code will appear in the generated header for |
| 890 | 897 | every .c file that uses the WORKS_WELL constant: |
| 891 | 898 | <pre> |
| @@ -918,12 +925,12 @@ | ||
| 918 | 925 | <p> |
| 919 | 926 | Makeheaders does not understand the old K&R style of function |
| 920 | 927 | and procedure definitions. |
| 921 | 928 | It only understands the modern ANSI-C style, and will probably |
| 922 | 929 | become very confused if it encounters an old K&R function. |
| 923 | -You should take care to avoid putting K&R function defintions | |
| 924 | -in your code, therefore. | |
| 930 | +Therefore you should take care to avoid putting K&R function definitions | |
| 931 | +in your code. | |
| 925 | 932 | </p> |
| 926 | 933 | |
| 927 | 934 | <p> |
| 928 | 935 | Makeheaders does not understand when you define more than one |
| 929 | 936 | global variable with the same type separated by a comma. |
| @@ -993,35 +1000,35 @@ | ||
| 993 | 1000 | in the code, it is not necessary to make a corresponding change |
| 994 | 1001 | in a separate document. Just rerun the documentation generator. |
| 995 | 1002 | </ul> |
| 996 | 1003 | The makeheaders program does not generate program documentation itself. |
| 997 | 1004 | But you can use makeheaders to parse the program source code, extract |
| 998 | -the information that is relavant to the documentation and to pass this | |
| 1005 | +the information that is relevant to the documentation and to pass this | |
| 999 | 1006 | information to another tool to do the actual documentation preparation. |
| 1000 | 1007 | </p> |
| 1001 | 1008 | |
| 1002 | 1009 | <p> |
| 1003 | -When makeheaders is run with the ``-doc'' option, it emits | |
| 1004 | -no header files at all. | |
| 1010 | +When makeheaders is run with the “<code>-doc</code>” option, it | |
| 1011 | +emits no header files at all. | |
| 1005 | 1012 | Instead, it does a complete dump of its internal tables to standard |
| 1006 | -outputs in a form that is easily parsed. | |
| 1013 | +output in a form that is easily parsed. | |
| 1007 | 1014 | This output can then be used by another program (the implementation |
| 1008 | 1015 | of which is left as an exercise to the reader) that will use the |
| 1009 | 1016 | information to prepare suitable documentation. |
| 1010 | 1017 | </p> |
| 1011 | 1018 | |
| 1012 | 1019 | <p> |
| 1013 | -The ``-doc'' option causes makeheaders to print information | |
| 1014 | -to standard output about all of the following objects: | |
| 1020 | +The “<code>-doc</code>” option causes makeheaders to print | |
| 1021 | +information to standard output about all of the following objects: | |
| 1015 | 1022 | <ul> |
| 1016 | -<li> C++ Class declarations | |
| 1023 | +<li> C++ class declarations | |
| 1017 | 1024 | <li> Structure and union declarations |
| 1018 | 1025 | <li> Enumerations |
| 1019 | 1026 | <li> Typedefs |
| 1020 | 1027 | <li> Procedure and function definitions |
| 1021 | 1028 | <li> Global variables |
| 1022 | -<li> Preprocessor macros (ex: ``#define'') | |
| 1029 | +<li> Preprocessor macros (ex: “<code>#define</code>”) | |
| 1023 | 1030 | </ul> |
| 1024 | 1031 | For each of these objects, the following information is output: |
| 1025 | 1032 | <ul> |
| 1026 | 1033 | <li> The name of the object. |
| 1027 | 1034 | <li> The type of the object. (Structure, typedef, macro, etc.) |
| @@ -1029,11 +1036,12 @@ | ||
| 1029 | 1036 | an EXPORT_INTERFACE block) or local (contained with LOCAL_INTERFACE). |
| 1030 | 1037 | <li> A flag to indicate if the object is declared in a C++ file. |
| 1031 | 1038 | <li> The name of the file in which the object was declared. |
| 1032 | 1039 | <li> The complete text of any block comment that preceeds the declarations. |
| 1033 | 1040 | <li> If the declaration occurred inside a preprocessor conditional |
| 1034 | - (``#if'') then the text of that conditional is provided. | |
| 1041 | + (“<code>#if</code>”) then the text of that conditional is | |
| 1042 | + provided. | |
| 1035 | 1043 | <li> The complete text of a declaration for the object. |
| 1036 | 1044 | </ul> |
| 1037 | 1045 | The exact output format will not be described here. |
| 1038 | 1046 | It is simple to understand and parse and should be obvious to |
| 1039 | 1047 | anyone who inspects some sample output. |
| @@ -1042,11 +1050,11 @@ | ||
| 1042 | 1050 | <a name="H0016"></a> |
| 1043 | 1051 | <h2>5.0 Compiling The Makeheaders Program</h2> |
| 1044 | 1052 | |
| 1045 | 1053 | <p> |
| 1046 | 1054 | The source code for makeheaders is a single file of ANSI-C code, |
| 1047 | -less than 3000 lines in length. | |
| 1055 | +approximately 3000 lines in length. | |
| 1048 | 1056 | The program makes only modest demands of the system and C library |
| 1049 | 1057 | and should compile without alteration on most ANSI C compilers |
| 1050 | 1058 | and on most operating systems. |
| 1051 | 1059 | It is known to compile using several variations of GCC for Unix |
| 1052 | 1060 | as well as Cygwin32 and MSVC 5.0 for Win32. |
| 1053 | 1061 |
| --- src/makeheaders.html | |
| +++ src/makeheaders.html | |
| @@ -4,11 +4,11 @@ | |
| 4 | <h1 align=center>The Makeheaders Program</h1> |
| 5 | |
| 6 | |
| 7 | <p> |
| 8 | This document describes <em>makeheaders</em>, |
| 9 | a tool that automatically generates ``<code>.h</code>'' |
| 10 | files for a C or C++ programming project. |
| 11 | </p> |
| 12 | |
| 13 | |
| 14 | <h2>Table Of Contents</h2> |
| @@ -67,11 +67,11 @@ | |
| 67 | <ul> |
| 68 | <li> Typedefs. |
| 69 | <li> Structure, union and enumeration declarations. |
| 70 | <li> Function and procedure prototypes. |
| 71 | <li> Preprocessor macros and #defines. |
| 72 | <li> ``extern'' variable declarations. |
| 73 | </ul> |
| 74 | </p> |
| 75 | |
| 76 | <p> |
| 77 | Definitions in C, on the other hand, include these kinds of things: |
| @@ -89,13 +89,13 @@ | |
| 89 | is the <em>interface</em> and the definition is the <em>implementation</em>. |
| 90 | </p> |
| 91 | |
| 92 | <p> |
| 93 | In C programs, it has always been the tradition that declarations are |
| 94 | put in files with the ``<code>.h</code>'' suffix and definitions are |
| 95 | placed in ``<code>.c</code>'' files. |
| 96 | The .c files contain ``<code>#include</code>'' preprocessor statements |
| 97 | that cause the contents of .h files to be included as part of the |
| 98 | source code when the .c file is compiled. |
| 99 | In this way, the .h files define the interface to a subsystem and |
| 100 | the .c files define how the subsystem is implemented. |
| 101 | </p> |
| @@ -262,11 +262,11 @@ | |
| 262 | |
| 263 | <p> |
| 264 | A similar option is -H. Like the lower-case -h option, big -H |
| 265 | generates a single include file on standard output. But unlike |
| 266 | small -h, the big -H only emits prototypes and declarations that |
| 267 | have been designated as ``exportable''. |
| 268 | The idea is that -H will generate an include file that defines |
| 269 | the interface to a library. |
| 270 | More will be said about this in section 3.4. |
| 271 | </p> |
| 272 | |
| @@ -293,13 +293,13 @@ | |
| 293 | then you can supply an empty header filename, like this: |
| 294 | <pre> |
| 295 | makeheaders alpha.c beta.c gamma.c: |
| 296 | </pre> |
| 297 | In this example, makeheaders will scan the three files named |
| 298 | ``alpha.c'', |
| 299 | ``beta.c'' and |
| 300 | ``gamma.c'' |
| 301 | but because of the colon on the end of third filename |
| 302 | it will only generate headers for the first two files. |
| 303 | Unfortunately, |
| 304 | it is not possible to get makeheaders to process any file whose |
| 305 | name contains a colon. |
| @@ -309,14 +309,14 @@ | |
| 309 | In a large project, the length of the command line for makeheaders |
| 310 | can become very long. |
| 311 | If the operating system doesn't support long command lines |
| 312 | (example: DOS and Win32) you may not be able to list all of the |
| 313 | input files in the space available. |
| 314 | In that case, you can use the ``-f'' option followed |
| 315 | by the name of a file to cause makeheaders to read command line |
| 316 | options and filename from the file instead of from the command line. |
| 317 | For example, you might prepare a file named ``mkhdr.dat'' |
| 318 | that contains text like this: |
| 319 | <pre> |
| 320 | src/alpha.c:hdr/alpha.h |
| 321 | src/beta.c:hdr/beta.h |
| 322 | src/gamma.c:hdr/gamma.h |
| @@ -327,18 +327,18 @@ | |
| 327 | makeheaders -f mkhdr.dat |
| 328 | </pre> |
| 329 | </p> |
| 330 | |
| 331 | <p> |
| 332 | The ``-local'' option causes makeheaders to |
| 333 | generate of prototypes for ``static'' functions and |
| 334 | procedures. |
| 335 | Such prototypes are normally omitted. |
| 336 | </p> |
| 337 | |
| 338 | <p> |
| 339 | Finally, makeheaders also includes a ``-doc'' option. |
| 340 | This command line option prevents makeheaders from generating any |
| 341 | headers at all. |
| 342 | Instead, makeheaders will write to standard output |
| 343 | information about every definition and declaration that it encounters |
| 344 | in its scan of source files. |
| @@ -352,19 +352,21 @@ | |
| 352 | </p> |
| 353 | |
| 354 | <p> |
| 355 | If you forget what command line options are available, or forget |
| 356 | their exact name, you can invoke makeheaders using an unknown |
| 357 | command line option (like ``--help'' or ``-?'') |
| 358 | and it will print a summary of the available options on standard |
| 359 | error. |
| 360 | If you need to process a file whose name begins with ``-'', |
| 361 | you can prepend a ``./'' to its name in order to get it |
| 362 | accepted by the command line parser. |
| 363 | Or, you can insert the special option ``--'' on the command |
| 364 | line to cause all subsequent command line arguments to be treated as |
| 365 | filenames even if their names beginn with ``-''. |
| 366 | </p> |
| 367 | |
| 368 | <a name="H0006"></a> |
| 369 | <h2>3.0 Preparing Source Files For Use With Makeheaders</h2> |
| 370 | |
| @@ -379,30 +381,31 @@ | |
| 379 | |
| 380 | <a name="H0007"></a> |
| 381 | <h3>3.1 The Basic Setup</h3> |
| 382 | |
| 383 | <p> |
| 384 | The simpliest way to use makeheaders is to put all definitions in |
| 385 | one or more .c files and all structure and type declarations in |
| 386 | separate .h files. |
| 387 | The only restriction is that you should take care to chose basenames |
| 388 | for your .h files that are different from the basenames for you |
| 389 | .c files. |
| 390 | Recall that if your .c file is named (for example) ``alpha.c'' |
| 391 | makeheaders will attempt to generate a corresponding header file |
| 392 | named ``alpha.h''. |
| 393 | For that reason, you don't want to use that name for |
| 394 | any of the .h files you write since that will prevent makeheaders |
| 395 | from generating the .h file automatically. |
| 396 | </p> |
| 397 | |
| 398 | <p> |
| 399 | The structure of a .c file intented for use with makeheaders is very |
| 400 | simple. |
| 401 | All you have to do is add a single ``#include'' to the top |
| 402 | of the file that sources the header file that makeheaders will generate. |
| 403 | Hence, the beginning of a source file named ``alpha.c'' |
| 404 | might look something like this: |
| 405 | </p> |
| 406 | |
| 407 | <pre> |
| 408 | /* |
| @@ -415,14 +418,14 @@ | |
| 415 | |
| 416 | <p> |
| 417 | Your manually generated header files require no special attention at all. |
| 418 | Code them as you normally would. |
| 419 | However, makeheaders will work better if you omit the |
| 420 | ``#if'' statements people often put around the outside of |
| 421 | header files that prevent the files from being included more than once. |
| 422 | For example, to create a header file named ``beta.h'', many |
| 423 | people will habitually write the following: |
| 424 | |
| 425 | <pre> |
| 426 | #ifndef BETA_H |
| 427 | #define BETA_H |
| 428 | |
| @@ -435,11 +438,11 @@ | |
| 435 | Remember that the header files you write will never really be |
| 436 | included by any C code. |
| 437 | Instead, makeheaders will scan your header files to extract only |
| 438 | those declarations that are needed by individual .c files and then |
| 439 | copy those declarations to the .h files corresponding to the .c files. |
| 440 | Hence, the ``#if'' wrapper serves no useful purpose. |
| 441 | But it does make makeheaders work harder, forcing it to put |
| 442 | the statements |
| 443 | |
| 444 | <pre> |
| 445 | #if !defined(BETA_H) |
| @@ -465,11 +468,11 @@ | |
| 465 | </p> |
| 466 | |
| 467 | <p> |
| 468 | Note that |
| 469 | the wildcard expression used in the above example, |
| 470 | ``<code>*.[ch]</code>'', |
| 471 | will expand to include all .h files in the current directory, both |
| 472 | those entered manually be the programmer and others generated automatically |
| 473 | by a prior run of makeheaders. |
| 474 | But that is not a problem. |
| 475 | The makeheaders program will recognize and ignore any files it |
| @@ -489,14 +492,14 @@ | |
| 489 | <p><li> |
| 490 | When a function is defined in any .c file, a prototype of that function |
| 491 | is placed in the generated .h file of every .c file that |
| 492 | calls the function.</p> |
| 493 | |
| 494 | <P>If the ``static'' keyword of C appears at the beginning |
| 495 | of the function definition, the prototype is suppressed. |
| 496 | If you use the ``LOCAL'' keyword where you would normally |
| 497 | say ``static'', then a prototype is generated, but it |
| 498 | will only appear in the single header file that corresponds to the |
| 499 | source file containing the function. For example, if the file |
| 500 | <code>alpha.c</code> contains the following: |
| 501 | <pre> |
| 502 | LOCAL int testFunc(void){ |
| @@ -509,24 +512,26 @@ | |
| 509 | LOCAL int testFunc(void); |
| 510 | </pre> |
| 511 | However, no other generated header files will contain a prototype for |
| 512 | <code>testFunc()</code> since the function has only file scope.</p> |
| 513 | |
| 514 | <p>When the ``LOCAL'' keyword is used, makeheaders will also |
| 515 | generate a #define for LOCAL, like this: |
| 516 | <pre> |
| 517 | #define LOCAL static |
| 518 | </pre> |
| 519 | so that the C compiler will know what it means.</p> |
| 520 | |
| 521 | <p>If you invoke makeheaders with a ``-local'' command-line |
| 522 | option, then it treats the ``static'' keyword like |
| 523 | ``LOCAL'' and generates prototypes in the header file |
| 524 | that corresponds to the source file containing the function defintiion.</p> |
| 525 | |
| 526 | <p><li> |
| 527 | When a global variable is defined in a .c file, an ``extern'' |
| 528 | declaration of that variable is placed in the header of every |
| 529 | .c file that uses the variable. |
| 530 | </p> |
| 531 | |
| 532 | <p><li> |
| @@ -550,12 +555,12 @@ | |
| 550 | |
| 551 | <p><li> |
| 552 | When a structure, union or enumeration declaration appears in a .h |
| 553 | file, makeheaders will automatically |
| 554 | generate a typedef that allows the declaration to be referenced without |
| 555 | the ``struct'', ``union'' or ``enum'' |
| 556 | qualifier. |
| 557 | In other words, if makeheaders sees the code: |
| 558 | <pre> |
| 559 | struct Examp { /* ... */ }; |
| 560 | </pre> |
| 561 | it will automatically generate a corresponding typedef like this: |
| @@ -572,13 +577,13 @@ | |
| 572 | </ul> |
| 573 | |
| 574 | <p> |
| 575 | As a final note, we observe that automatically generated declarations |
| 576 | are ordered as required by the ANSI-C programming language. |
| 577 | If the declaration of some structure ``X'' requires a prior |
| 578 | declaration of another structure ``Y'', then Y will appear |
| 579 | first in the generated headers. |
| 580 | </p> |
| 581 | |
| 582 | <a name="H0009"></a> |
| 583 | <h3>3.3 How To Avoid Having To Write Any Header Files</h3> |
| 584 | |
| @@ -611,18 +616,18 @@ | |
| 611 | <pre> |
| 612 | #if INTERFACE |
| 613 | #endif |
| 614 | </pre> |
| 615 | Thus any structure definitions that appear after the |
| 616 | ``#if INTERFACE'' but before the corresponding |
| 617 | ``#endif'' are eligable to be copied into the |
| 618 | automatically generated |
| 619 | .h files of other .c files. |
| 620 | </p> |
| 621 | |
| 622 | <p> |
| 623 | If you use the ``#if INTERFACE'' mechanism in a .c file, |
| 624 | then the generated header for that .c file will contain a line |
| 625 | like this: |
| 626 | <pre> |
| 627 | #define INTERFACE 0 |
| 628 | </pre> |
| @@ -637,15 +642,15 @@ | |
| 637 | </p> |
| 638 | |
| 639 | <p> |
| 640 | Note that you don't have to use this approach exclusively. |
| 641 | You can put some declarations in .h files and others within the |
| 642 | ``#if INTERFACE'' regions of .c files. |
| 643 | Makeheaders treats all declarations alike, no matter where they |
| 644 | come from. |
| 645 | You should also note that a single .c file can contain as many |
| 646 | ``#if INTERFACE'' regions as desired. |
| 647 | </p> |
| 648 | |
| 649 | <a name="H0010"></a> |
| 650 | <h3>3.4 Designating Declarations For Export</h3> |
| 651 | |
| @@ -664,11 +669,11 @@ | |
| 664 | like this, but makeheaders does. |
| 665 | </p> |
| 666 | |
| 667 | <p> |
| 668 | Using makeheaders, it is possible to designate routines and data |
| 669 | structures as being for ``export''. |
| 670 | Exported objects are visible not only to other files within the |
| 671 | same library or subassembly but also to other |
| 672 | libraries and subassemblies in the larger program. |
| 673 | By default, makeheaders only makes objects visible to other members |
| 674 | of the same library. |
| @@ -690,14 +695,14 @@ | |
| 690 | |
| 691 | <p> |
| 692 | But trouble quickly arises when we attempt to devise a mechanism for |
| 693 | telling makeheaders which prototypes it should export and which it should |
| 694 | keep local. |
| 695 | The built-in ``static'' keyword of C works well for prohibiting |
| 696 | prototypes from leaving a single source file, but because C doesn't |
| 697 | support a linkage hierarchy, there is nothing in the C language to help us. |
| 698 | We'll have to invite our own keyword: ``EXPORT'' |
| 699 | </p> |
| 700 | |
| 701 | <p> |
| 702 | Makeheaders allows the EXPORT keyword to precede any function or |
| 703 | procedure definition. |
| @@ -726,15 +731,15 @@ | |
| 726 | <pre> |
| 727 | #if EXPORT_INTERFACE |
| 728 | #endif |
| 729 | </pre> |
| 730 | will become part of the exported interface. |
| 731 | The ``#if EXPORT_INTERFACE'' mechanism can be used in either |
| 732 | .c or .h files. |
| 733 | (The ``#if INTERFACE'' can also be used in both .h and .c files, |
| 734 | but since it's use in a .h file would be redundant, we haven't mentioned |
| 735 | it before.) |
| 736 | </p> |
| 737 | |
| 738 | <a name="H0011"></a> |
| 739 | <h3>3.5 Local declarations processed by makeheaders</h3> |
| 740 | |
| @@ -742,11 +747,11 @@ | |
| 742 | Structure declarations and typedefs that appear in .c files are normally |
| 743 | ignored by makeheaders. |
| 744 | Such declarations are only intended for use by the source file in which |
| 745 | they appear and so makeheaders doesn't need to copy them into any |
| 746 | generated header files. |
| 747 | We call such declarations ``private''. |
| 748 | </p> |
| 749 | |
| 750 | <p> |
| 751 | Sometimes it is convenient to have makeheaders sort a sequence |
| 752 | of private declarations into the correct order for us automatically. |
| @@ -764,12 +769,13 @@ | |
| 764 | within |
| 765 | <pre> |
| 766 | #if LOCAL_INTERFACE |
| 767 | #endif |
| 768 | </pre> |
| 769 | A ``LOCAL_INTERFACE'' block works very much like the |
| 770 | ``INTERFACE'' and ``EXPORT_INTERFACE'' |
| 771 | blocks described above, except that makeheaders insures that the |
| 772 | objects declared in a LOCAL_INTERFACE are only visible to the |
| 773 | file containing the LOCAL_INTERFACE. |
| 774 | </p> |
| 775 | |
| @@ -777,11 +783,12 @@ | |
| 777 | <h3>3.6 Using Makeheaders With C++ Code</h3> |
| 778 | |
| 779 | <p> |
| 780 | You can use makeheaders to generate header files for C++ code, in |
| 781 | addition to C. |
| 782 | Makeheaders will recognize and copy both ``class'' declarations |
| 783 | and inline function definitions, and it knows not to try to generate |
| 784 | prototypes for methods. |
| 785 | </p> |
| 786 | |
| 787 | <p> |
| @@ -805,20 +812,20 @@ | |
| 805 | C++ input. Makeheaders will recognize that its source code is C++ |
| 806 | by the suffix on the source code filename. Simple ".c" or ".h" suffixes |
| 807 | are assumed to be ANSI-C. Anything else, including ".cc", ".C" and |
| 808 | ".cpp" is assumed to be C++. |
| 809 | The name of the header file generated by makeheaders is derived from |
| 810 | by the name of the source file by converting every "c" to "h" and |
| 811 | every "C" to "H" in the suffix of the filename. |
| 812 | Thus the C++ source |
| 813 | file ``alpha.cpp'' will induce makeheaders to |
| 814 | generate a header file named ``alpha.hpp''. |
| 815 | </p> |
| 816 | |
| 817 | <p> |
| 818 | Makeheaders augments class definitions by inserting prototypes to |
| 819 | methods were appropriate. If a method definition begins with one |
| 820 | of the special keywords <b>PUBLIC</b>, <b>PROTECTED</b>, or |
| 821 | <b>PRIVATE</b> (in upper-case to distinguish them from the regular |
| 822 | C++ keywords with the same meaning) then a prototype for that |
| 823 | method will be inserted into the class definition. If none of |
| 824 | these keywords appear, then the prototype is not inserted. For |
| @@ -867,11 +874,11 @@ | |
| 867 | <h4>3.6.1 C++ Limitations</h4> |
| 868 | |
| 869 | <p> |
| 870 | Makeheaders does not understand more recent |
| 871 | C++ syntax such as templates and namespaces. |
| 872 | Perhaps these issued will be addressed in future revisions. |
| 873 | </p> |
| 874 | |
| 875 | <a name="H0013"></a> |
| 876 | <h3>3.7 Conditional Compilation</h3> |
| 877 | |
| @@ -879,13 +886,13 @@ | |
| 879 | The makeheaders program understands and tracks the conditional |
| 880 | compilation constructs in the source code files it scans. |
| 881 | Hence, if the following code appears in a source file |
| 882 | <pre> |
| 883 | #ifdef UNIX |
| 884 | # define WORKS_WELL 1 |
| 885 | #else |
| 886 | # define WORKS_WELL 0 |
| 887 | #endif |
| 888 | </pre> |
| 889 | then the next patch of code will appear in the generated header for |
| 890 | every .c file that uses the WORKS_WELL constant: |
| 891 | <pre> |
| @@ -918,12 +925,12 @@ | |
| 918 | <p> |
| 919 | Makeheaders does not understand the old K&R style of function |
| 920 | and procedure definitions. |
| 921 | It only understands the modern ANSI-C style, and will probably |
| 922 | become very confused if it encounters an old K&R function. |
| 923 | You should take care to avoid putting K&R function defintions |
| 924 | in your code, therefore. |
| 925 | </p> |
| 926 | |
| 927 | <p> |
| 928 | Makeheaders does not understand when you define more than one |
| 929 | global variable with the same type separated by a comma. |
| @@ -993,35 +1000,35 @@ | |
| 993 | in the code, it is not necessary to make a corresponding change |
| 994 | in a separate document. Just rerun the documentation generator. |
| 995 | </ul> |
| 996 | The makeheaders program does not generate program documentation itself. |
| 997 | But you can use makeheaders to parse the program source code, extract |
| 998 | the information that is relavant to the documentation and to pass this |
| 999 | information to another tool to do the actual documentation preparation. |
| 1000 | </p> |
| 1001 | |
| 1002 | <p> |
| 1003 | When makeheaders is run with the ``-doc'' option, it emits |
| 1004 | no header files at all. |
| 1005 | Instead, it does a complete dump of its internal tables to standard |
| 1006 | outputs in a form that is easily parsed. |
| 1007 | This output can then be used by another program (the implementation |
| 1008 | of which is left as an exercise to the reader) that will use the |
| 1009 | information to prepare suitable documentation. |
| 1010 | </p> |
| 1011 | |
| 1012 | <p> |
| 1013 | The ``-doc'' option causes makeheaders to print information |
| 1014 | to standard output about all of the following objects: |
| 1015 | <ul> |
| 1016 | <li> C++ Class declarations |
| 1017 | <li> Structure and union declarations |
| 1018 | <li> Enumerations |
| 1019 | <li> Typedefs |
| 1020 | <li> Procedure and function definitions |
| 1021 | <li> Global variables |
| 1022 | <li> Preprocessor macros (ex: ``#define'') |
| 1023 | </ul> |
| 1024 | For each of these objects, the following information is output: |
| 1025 | <ul> |
| 1026 | <li> The name of the object. |
| 1027 | <li> The type of the object. (Structure, typedef, macro, etc.) |
| @@ -1029,11 +1036,12 @@ | |
| 1029 | an EXPORT_INTERFACE block) or local (contained with LOCAL_INTERFACE). |
| 1030 | <li> A flag to indicate if the object is declared in a C++ file. |
| 1031 | <li> The name of the file in which the object was declared. |
| 1032 | <li> The complete text of any block comment that preceeds the declarations. |
| 1033 | <li> If the declaration occurred inside a preprocessor conditional |
| 1034 | (``#if'') then the text of that conditional is provided. |
| 1035 | <li> The complete text of a declaration for the object. |
| 1036 | </ul> |
| 1037 | The exact output format will not be described here. |
| 1038 | It is simple to understand and parse and should be obvious to |
| 1039 | anyone who inspects some sample output. |
| @@ -1042,11 +1050,11 @@ | |
| 1042 | <a name="H0016"></a> |
| 1043 | <h2>5.0 Compiling The Makeheaders Program</h2> |
| 1044 | |
| 1045 | <p> |
| 1046 | The source code for makeheaders is a single file of ANSI-C code, |
| 1047 | less than 3000 lines in length. |
| 1048 | The program makes only modest demands of the system and C library |
| 1049 | and should compile without alteration on most ANSI C compilers |
| 1050 | and on most operating systems. |
| 1051 | It is known to compile using several variations of GCC for Unix |
| 1052 | as well as Cygwin32 and MSVC 5.0 for Win32. |
| 1053 |
| --- src/makeheaders.html | |
| +++ src/makeheaders.html | |
| @@ -4,11 +4,11 @@ | |
| 4 | <h1 align=center>The Makeheaders Program</h1> |
| 5 | |
| 6 | |
| 7 | <p> |
| 8 | This document describes <em>makeheaders</em>, |
| 9 | a tool that automatically generates “<code>.h</code>” |
| 10 | files for a C or C++ programming project. |
| 11 | </p> |
| 12 | |
| 13 | |
| 14 | <h2>Table Of Contents</h2> |
| @@ -67,11 +67,11 @@ | |
| 67 | <ul> |
| 68 | <li> Typedefs. |
| 69 | <li> Structure, union and enumeration declarations. |
| 70 | <li> Function and procedure prototypes. |
| 71 | <li> Preprocessor macros and #defines. |
| 72 | <li> “<code>extern</code>” variable declarations. |
| 73 | </ul> |
| 74 | </p> |
| 75 | |
| 76 | <p> |
| 77 | Definitions in C, on the other hand, include these kinds of things: |
| @@ -89,13 +89,13 @@ | |
| 89 | is the <em>interface</em> and the definition is the <em>implementation</em>. |
| 90 | </p> |
| 91 | |
| 92 | <p> |
| 93 | In C programs, it has always been the tradition that declarations are |
| 94 | put in files with the “<code>.h</code>” suffix and definitions are |
| 95 | placed in “<code>.c</code>” files. |
| 96 | The .c files contain “<code>#include</code>” preprocessor statements |
| 97 | that cause the contents of .h files to be included as part of the |
| 98 | source code when the .c file is compiled. |
| 99 | In this way, the .h files define the interface to a subsystem and |
| 100 | the .c files define how the subsystem is implemented. |
| 101 | </p> |
| @@ -262,11 +262,11 @@ | |
| 262 | |
| 263 | <p> |
| 264 | A similar option is -H. Like the lower-case -h option, big -H |
| 265 | generates a single include file on standard output. But unlike |
| 266 | small -h, the big -H only emits prototypes and declarations that |
| 267 | have been designated as “exportable”. |
| 268 | The idea is that -H will generate an include file that defines |
| 269 | the interface to a library. |
| 270 | More will be said about this in section 3.4. |
| 271 | </p> |
| 272 | |
| @@ -293,13 +293,13 @@ | |
| 293 | then you can supply an empty header filename, like this: |
| 294 | <pre> |
| 295 | makeheaders alpha.c beta.c gamma.c: |
| 296 | </pre> |
| 297 | In this example, makeheaders will scan the three files named |
| 298 | “<code>alpha.c</code>”, |
| 299 | “<code>beta.c</code>” and |
| 300 | “<code>gamma.c</code>” |
| 301 | but because of the colon on the end of third filename |
| 302 | it will only generate headers for the first two files. |
| 303 | Unfortunately, |
| 304 | it is not possible to get makeheaders to process any file whose |
| 305 | name contains a colon. |
| @@ -309,14 +309,14 @@ | |
| 309 | In a large project, the length of the command line for makeheaders |
| 310 | can become very long. |
| 311 | If the operating system doesn't support long command lines |
| 312 | (example: DOS and Win32) you may not be able to list all of the |
| 313 | input files in the space available. |
| 314 | In that case, you can use the “<code>-f</code>” option followed |
| 315 | by the name of a file to cause makeheaders to read command line |
| 316 | options and filename from the file instead of from the command line. |
| 317 | For example, you might prepare a file named “<code>mkhdr.dat</code>” |
| 318 | that contains text like this: |
| 319 | <pre> |
| 320 | src/alpha.c:hdr/alpha.h |
| 321 | src/beta.c:hdr/beta.h |
| 322 | src/gamma.c:hdr/gamma.h |
| @@ -327,18 +327,18 @@ | |
| 327 | makeheaders -f mkhdr.dat |
| 328 | </pre> |
| 329 | </p> |
| 330 | |
| 331 | <p> |
| 332 | The “<code>-local</code>” option causes makeheaders to |
| 333 | generate of prototypes for “<code>static</code>” functions and |
| 334 | procedures. |
| 335 | Such prototypes are normally omitted. |
| 336 | </p> |
| 337 | |
| 338 | <p> |
| 339 | Finally, makeheaders also includes a “<code>-doc</code>” option. |
| 340 | This command line option prevents makeheaders from generating any |
| 341 | headers at all. |
| 342 | Instead, makeheaders will write to standard output |
| 343 | information about every definition and declaration that it encounters |
| 344 | in its scan of source files. |
| @@ -352,19 +352,21 @@ | |
| 352 | </p> |
| 353 | |
| 354 | <p> |
| 355 | If you forget what command line options are available, or forget |
| 356 | their exact name, you can invoke makeheaders using an unknown |
| 357 | command line option (like “<code>--help</code>” or |
| 358 | “<code>-?</code>”) |
| 359 | and it will print a summary of the available options on standard |
| 360 | error. |
| 361 | If you need to process a file whose name begins with |
| 362 | “<code>-</code>”, |
| 363 | you can prepend a “<code>./</code>” to its name in order to get it |
| 364 | accepted by the command line parser. |
| 365 | Or, you can insert the special option “<code>--</code>” on the |
| 366 | command line to cause all subsequent command line arguments to be treated as |
| 367 | filenames even if their names begin with “<code>-</code>”. |
| 368 | </p> |
| 369 | |
| 370 | <a name="H0006"></a> |
| 371 | <h2>3.0 Preparing Source Files For Use With Makeheaders</h2> |
| 372 | |
| @@ -379,30 +381,31 @@ | |
| 381 | |
| 382 | <a name="H0007"></a> |
| 383 | <h3>3.1 The Basic Setup</h3> |
| 384 | |
| 385 | <p> |
| 386 | The simplest way to use makeheaders is to put all definitions in |
| 387 | one or more .c files and all structure and type declarations in |
| 388 | separate .h files. |
| 389 | The only restriction is that you should take care to chose basenames |
| 390 | for your .h files that are different from the basenames for your |
| 391 | .c files. |
| 392 | Recall that if your .c file is named (for example) |
| 393 | “<code>alpha.c</code>” |
| 394 | makeheaders will attempt to generate a corresponding header file |
| 395 | named “<code>alpha.h</code>”. |
| 396 | For that reason, you don't want to use that name for |
| 397 | any of the .h files you write since that will prevent makeheaders |
| 398 | from generating the .h file automatically. |
| 399 | </p> |
| 400 | |
| 401 | <p> |
| 402 | The structure of a .c file intented for use with makeheaders is very |
| 403 | simple. |
| 404 | All you have to do is add a single “<code>#include</code>” to the |
| 405 | top of the file that sources the header file that makeheaders will generate. |
| 406 | Hence, the beginning of a source file named “<code>alpha.c</code>” |
| 407 | might look something like this: |
| 408 | </p> |
| 409 | |
| 410 | <pre> |
| 411 | /* |
| @@ -415,14 +418,14 @@ | |
| 418 | |
| 419 | <p> |
| 420 | Your manually generated header files require no special attention at all. |
| 421 | Code them as you normally would. |
| 422 | However, makeheaders will work better if you omit the |
| 423 | “<code>#if</code>” statements people often put around the outside of |
| 424 | header files that prevent the files from being included more than once. |
| 425 | For example, to create a header file named “<code>beta.h</code>”, |
| 426 | many people will habitually write the following: |
| 427 | |
| 428 | <pre> |
| 429 | #ifndef BETA_H |
| 430 | #define BETA_H |
| 431 | |
| @@ -435,11 +438,11 @@ | |
| 438 | Remember that the header files you write will never really be |
| 439 | included by any C code. |
| 440 | Instead, makeheaders will scan your header files to extract only |
| 441 | those declarations that are needed by individual .c files and then |
| 442 | copy those declarations to the .h files corresponding to the .c files. |
| 443 | Hence, the “<code>#if</code>” wrapper serves no useful purpose. |
| 444 | But it does make makeheaders work harder, forcing it to put |
| 445 | the statements |
| 446 | |
| 447 | <pre> |
| 448 | #if !defined(BETA_H) |
| @@ -465,11 +468,11 @@ | |
| 468 | </p> |
| 469 | |
| 470 | <p> |
| 471 | Note that |
| 472 | the wildcard expression used in the above example, |
| 473 | “<code>*.[ch]</code>”, |
| 474 | will expand to include all .h files in the current directory, both |
| 475 | those entered manually be the programmer and others generated automatically |
| 476 | by a prior run of makeheaders. |
| 477 | But that is not a problem. |
| 478 | The makeheaders program will recognize and ignore any files it |
| @@ -489,14 +492,14 @@ | |
| 492 | <p><li> |
| 493 | When a function is defined in any .c file, a prototype of that function |
| 494 | is placed in the generated .h file of every .c file that |
| 495 | calls the function.</p> |
| 496 | |
| 497 | <P>If the “<code>static</code>” keyword of C appears at the |
| 498 | beginning of the function definition, the prototype is suppressed. |
| 499 | If you use the “<code>LOCAL</code>” keyword where you would normally |
| 500 | say “<code>static</code>”, then a prototype is generated, but it |
| 501 | will only appear in the single header file that corresponds to the |
| 502 | source file containing the function. For example, if the file |
| 503 | <code>alpha.c</code> contains the following: |
| 504 | <pre> |
| 505 | LOCAL int testFunc(void){ |
| @@ -509,24 +512,26 @@ | |
| 512 | LOCAL int testFunc(void); |
| 513 | </pre> |
| 514 | However, no other generated header files will contain a prototype for |
| 515 | <code>testFunc()</code> since the function has only file scope.</p> |
| 516 | |
| 517 | <p>When the “<code>LOCAL</code>” keyword is used, makeheaders will |
| 518 | also generate a #define for LOCAL, like this: |
| 519 | <pre> |
| 520 | #define LOCAL static |
| 521 | </pre> |
| 522 | so that the C compiler will know what it means.</p> |
| 523 | |
| 524 | <p>If you invoke makeheaders with a “<code>-local</code>” |
| 525 | command-line option, then it treats the “<code>static</code>” |
| 526 | keyword like “<code>LOCAL</code>” and generates prototypes in the |
| 527 | header file that corresponds to the source file containing the function |
| 528 | definition.</p> |
| 529 | |
| 530 | <p><li> |
| 531 | When a global variable is defined in a .c file, an |
| 532 | “<code>extern</code>” |
| 533 | declaration of that variable is placed in the header of every |
| 534 | .c file that uses the variable. |
| 535 | </p> |
| 536 | |
| 537 | <p><li> |
| @@ -550,12 +555,12 @@ | |
| 555 | |
| 556 | <p><li> |
| 557 | When a structure, union or enumeration declaration appears in a .h |
| 558 | file, makeheaders will automatically |
| 559 | generate a typedef that allows the declaration to be referenced without |
| 560 | the “<code>struct</code>”, “<code>union</code>” or |
| 561 | “<code>enum</code>” qualifier. |
| 562 | In other words, if makeheaders sees the code: |
| 563 | <pre> |
| 564 | struct Examp { /* ... */ }; |
| 565 | </pre> |
| 566 | it will automatically generate a corresponding typedef like this: |
| @@ -572,13 +577,13 @@ | |
| 577 | </ul> |
| 578 | |
| 579 | <p> |
| 580 | As a final note, we observe that automatically generated declarations |
| 581 | are ordered as required by the ANSI-C programming language. |
| 582 | If the declaration of some structure “<code>X</code>” requires a |
| 583 | prior declaration of another structure “<code>Y</code>”, then Y will |
| 584 | appear first in the generated headers. |
| 585 | </p> |
| 586 | |
| 587 | <a name="H0009"></a> |
| 588 | <h3>3.3 How To Avoid Having To Write Any Header Files</h3> |
| 589 | |
| @@ -611,18 +616,18 @@ | |
| 616 | <pre> |
| 617 | #if INTERFACE |
| 618 | #endif |
| 619 | </pre> |
| 620 | Thus any structure definitions that appear after the |
| 621 | “<code>#if INTERFACE</code>” but before the corresponding |
| 622 | “<code>#endif</code>” are eligable to be copied into the |
| 623 | automatically generated |
| 624 | .h files of other .c files. |
| 625 | </p> |
| 626 | |
| 627 | <p> |
| 628 | If you use the “<code>#if INTERFACE</code>” mechanism in a .c file, |
| 629 | then the generated header for that .c file will contain a line |
| 630 | like this: |
| 631 | <pre> |
| 632 | #define INTERFACE 0 |
| 633 | </pre> |
| @@ -637,15 +642,15 @@ | |
| 642 | </p> |
| 643 | |
| 644 | <p> |
| 645 | Note that you don't have to use this approach exclusively. |
| 646 | You can put some declarations in .h files and others within the |
| 647 | “<code>#if INTERFACE</code>” regions of .c files. |
| 648 | Makeheaders treats all declarations alike, no matter where they |
| 649 | come from. |
| 650 | You should also note that a single .c file can contain as many |
| 651 | “<code>#if INTERFACE</code>” regions as desired. |
| 652 | </p> |
| 653 | |
| 654 | <a name="H0010"></a> |
| 655 | <h3>3.4 Designating Declarations For Export</h3> |
| 656 | |
| @@ -664,11 +669,11 @@ | |
| 669 | like this, but makeheaders does. |
| 670 | </p> |
| 671 | |
| 672 | <p> |
| 673 | Using makeheaders, it is possible to designate routines and data |
| 674 | structures as being for “<code>export</code>”. |
| 675 | Exported objects are visible not only to other files within the |
| 676 | same library or subassembly but also to other |
| 677 | libraries and subassemblies in the larger program. |
| 678 | By default, makeheaders only makes objects visible to other members |
| 679 | of the same library. |
| @@ -690,14 +695,14 @@ | |
| 695 | |
| 696 | <p> |
| 697 | But trouble quickly arises when we attempt to devise a mechanism for |
| 698 | telling makeheaders which prototypes it should export and which it should |
| 699 | keep local. |
| 700 | The built-in “<code>static</code>” keyword of C works well for |
| 701 | prohibiting prototypes from leaving a single source file, but because C doesn't |
| 702 | support a linkage hierarchy, there is nothing in the C language to help us. |
| 703 | We'll have to invite our own keyword: “<code>EXPORT</code>” |
| 704 | </p> |
| 705 | |
| 706 | <p> |
| 707 | Makeheaders allows the EXPORT keyword to precede any function or |
| 708 | procedure definition. |
| @@ -726,15 +731,15 @@ | |
| 731 | <pre> |
| 732 | #if EXPORT_INTERFACE |
| 733 | #endif |
| 734 | </pre> |
| 735 | will become part of the exported interface. |
| 736 | The “<code>#if EXPORT_INTERFACE</code>” mechanism can be used in |
| 737 | either .c or .h files. |
| 738 | (The “<code>#if INTERFACE</code>” can also be used in both .h and |
| 739 | .c files, but since it's use in a .h file would be redundant, we haven't |
| 740 | mentioned it before.) |
| 741 | </p> |
| 742 | |
| 743 | <a name="H0011"></a> |
| 744 | <h3>3.5 Local declarations processed by makeheaders</h3> |
| 745 | |
| @@ -742,11 +747,11 @@ | |
| 747 | Structure declarations and typedefs that appear in .c files are normally |
| 748 | ignored by makeheaders. |
| 749 | Such declarations are only intended for use by the source file in which |
| 750 | they appear and so makeheaders doesn't need to copy them into any |
| 751 | generated header files. |
| 752 | We call such declarations “<code>private</code>”. |
| 753 | </p> |
| 754 | |
| 755 | <p> |
| 756 | Sometimes it is convenient to have makeheaders sort a sequence |
| 757 | of private declarations into the correct order for us automatically. |
| @@ -764,12 +769,13 @@ | |
| 769 | within |
| 770 | <pre> |
| 771 | #if LOCAL_INTERFACE |
| 772 | #endif |
| 773 | </pre> |
| 774 | A “<code>LOCAL_INTERFACE</code>” block works very much like the |
| 775 | “<code>INTERFACE</code>” and |
| 776 | “<code>EXPORT_INTERFACE</code>” |
| 777 | blocks described above, except that makeheaders insures that the |
| 778 | objects declared in a LOCAL_INTERFACE are only visible to the |
| 779 | file containing the LOCAL_INTERFACE. |
| 780 | </p> |
| 781 | |
| @@ -777,11 +783,12 @@ | |
| 783 | <h3>3.6 Using Makeheaders With C++ Code</h3> |
| 784 | |
| 785 | <p> |
| 786 | You can use makeheaders to generate header files for C++ code, in |
| 787 | addition to C. |
| 788 | Makeheaders will recognize and copy both “<code>class</code>” |
| 789 | declarations |
| 790 | and inline function definitions, and it knows not to try to generate |
| 791 | prototypes for methods. |
| 792 | </p> |
| 793 | |
| 794 | <p> |
| @@ -805,20 +812,20 @@ | |
| 812 | C++ input. Makeheaders will recognize that its source code is C++ |
| 813 | by the suffix on the source code filename. Simple ".c" or ".h" suffixes |
| 814 | are assumed to be ANSI-C. Anything else, including ".cc", ".C" and |
| 815 | ".cpp" is assumed to be C++. |
| 816 | The name of the header file generated by makeheaders is derived from |
| 817 | the name of the source file by converting every "c" to "h" and |
| 818 | every "C" to "H" in the suffix of the filename. |
| 819 | Thus the C++ source |
| 820 | file “<code>alpha.cpp</code>” will induce makeheaders to |
| 821 | generate a header file named “<code>alpha.hpp</code>”. |
| 822 | </p> |
| 823 | |
| 824 | <p> |
| 825 | Makeheaders augments class definitions by inserting prototypes to |
| 826 | methods where appropriate. If a method definition begins with one |
| 827 | of the special keywords <b>PUBLIC</b>, <b>PROTECTED</b>, or |
| 828 | <b>PRIVATE</b> (in upper-case to distinguish them from the regular |
| 829 | C++ keywords with the same meaning) then a prototype for that |
| 830 | method will be inserted into the class definition. If none of |
| 831 | these keywords appear, then the prototype is not inserted. For |
| @@ -867,11 +874,11 @@ | |
| 874 | <h4>3.6.1 C++ Limitations</h4> |
| 875 | |
| 876 | <p> |
| 877 | Makeheaders does not understand more recent |
| 878 | C++ syntax such as templates and namespaces. |
| 879 | Perhaps these issues will be addressed in future revisions. |
| 880 | </p> |
| 881 | |
| 882 | <a name="H0013"></a> |
| 883 | <h3>3.7 Conditional Compilation</h3> |
| 884 | |
| @@ -879,13 +886,13 @@ | |
| 886 | The makeheaders program understands and tracks the conditional |
| 887 | compilation constructs in the source code files it scans. |
| 888 | Hence, if the following code appears in a source file |
| 889 | <pre> |
| 890 | #ifdef UNIX |
| 891 | # define WORKS_WELL 1 |
| 892 | #else |
| 893 | # define WORKS_WELL 0 |
| 894 | #endif |
| 895 | </pre> |
| 896 | then the next patch of code will appear in the generated header for |
| 897 | every .c file that uses the WORKS_WELL constant: |
| 898 | <pre> |
| @@ -918,12 +925,12 @@ | |
| 925 | <p> |
| 926 | Makeheaders does not understand the old K&R style of function |
| 927 | and procedure definitions. |
| 928 | It only understands the modern ANSI-C style, and will probably |
| 929 | become very confused if it encounters an old K&R function. |
| 930 | Therefore you should take care to avoid putting K&R function definitions |
| 931 | in your code. |
| 932 | </p> |
| 933 | |
| 934 | <p> |
| 935 | Makeheaders does not understand when you define more than one |
| 936 | global variable with the same type separated by a comma. |
| @@ -993,35 +1000,35 @@ | |
| 1000 | in the code, it is not necessary to make a corresponding change |
| 1001 | in a separate document. Just rerun the documentation generator. |
| 1002 | </ul> |
| 1003 | The makeheaders program does not generate program documentation itself. |
| 1004 | But you can use makeheaders to parse the program source code, extract |
| 1005 | the information that is relevant to the documentation and to pass this |
| 1006 | information to another tool to do the actual documentation preparation. |
| 1007 | </p> |
| 1008 | |
| 1009 | <p> |
| 1010 | When makeheaders is run with the “<code>-doc</code>” option, it |
| 1011 | emits no header files at all. |
| 1012 | Instead, it does a complete dump of its internal tables to standard |
| 1013 | output in a form that is easily parsed. |
| 1014 | This output can then be used by another program (the implementation |
| 1015 | of which is left as an exercise to the reader) that will use the |
| 1016 | information to prepare suitable documentation. |
| 1017 | </p> |
| 1018 | |
| 1019 | <p> |
| 1020 | The “<code>-doc</code>” option causes makeheaders to print |
| 1021 | information to standard output about all of the following objects: |
| 1022 | <ul> |
| 1023 | <li> C++ class declarations |
| 1024 | <li> Structure and union declarations |
| 1025 | <li> Enumerations |
| 1026 | <li> Typedefs |
| 1027 | <li> Procedure and function definitions |
| 1028 | <li> Global variables |
| 1029 | <li> Preprocessor macros (ex: “<code>#define</code>”) |
| 1030 | </ul> |
| 1031 | For each of these objects, the following information is output: |
| 1032 | <ul> |
| 1033 | <li> The name of the object. |
| 1034 | <li> The type of the object. (Structure, typedef, macro, etc.) |
| @@ -1029,11 +1036,12 @@ | |
| 1036 | an EXPORT_INTERFACE block) or local (contained with LOCAL_INTERFACE). |
| 1037 | <li> A flag to indicate if the object is declared in a C++ file. |
| 1038 | <li> The name of the file in which the object was declared. |
| 1039 | <li> The complete text of any block comment that preceeds the declarations. |
| 1040 | <li> If the declaration occurred inside a preprocessor conditional |
| 1041 | (“<code>#if</code>”) then the text of that conditional is |
| 1042 | provided. |
| 1043 | <li> The complete text of a declaration for the object. |
| 1044 | </ul> |
| 1045 | The exact output format will not be described here. |
| 1046 | It is simple to understand and parse and should be obvious to |
| 1047 | anyone who inspects some sample output. |
| @@ -1042,11 +1050,11 @@ | |
| 1050 | <a name="H0016"></a> |
| 1051 | <h2>5.0 Compiling The Makeheaders Program</h2> |
| 1052 | |
| 1053 | <p> |
| 1054 | The source code for makeheaders is a single file of ANSI-C code, |
| 1055 | approximately 3000 lines in length. |
| 1056 | The program makes only modest demands of the system and C library |
| 1057 | and should compile without alteration on most ANSI C compilers |
| 1058 | and on most operating systems. |
| 1059 | It is known to compile using several variations of GCC for Unix |
| 1060 | as well as Cygwin32 and MSVC 5.0 for Win32. |
| 1061 |
+1
-1
| --- src/markdown.c | ||
| +++ src/markdown.c | ||
| @@ -295,11 +295,11 @@ | ||
| 295 | 295 | /* binary search of the tag */ |
| 296 | 296 | key.text = data; |
| 297 | 297 | key.size = i; |
| 298 | 298 | return bsearch(&key, |
| 299 | 299 | block_tags, |
| 300 | - (sizeof block_tags)/(sizeof block_tags[0]), | |
| 300 | + count(block_tags), | |
| 301 | 301 | sizeof block_tags[0], |
| 302 | 302 | cmp_html_tag); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| 306 | 306 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -295,11 +295,11 @@ | |
| 295 | /* binary search of the tag */ |
| 296 | key.text = data; |
| 297 | key.size = i; |
| 298 | return bsearch(&key, |
| 299 | block_tags, |
| 300 | (sizeof block_tags)/(sizeof block_tags[0]), |
| 301 | sizeof block_tags[0], |
| 302 | cmp_html_tag); |
| 303 | } |
| 304 | |
| 305 | |
| 306 |
| --- src/markdown.c | |
| +++ src/markdown.c | |
| @@ -295,11 +295,11 @@ | |
| 295 | /* binary search of the tag */ |
| 296 | key.text = data; |
| 297 | key.size = i; |
| 298 | return bsearch(&key, |
| 299 | block_tags, |
| 300 | count(block_tags), |
| 301 | sizeof block_tags[0], |
| 302 | cmp_html_tag); |
| 303 | } |
| 304 | |
| 305 | |
| 306 |
+1
-1
| --- src/merge3.c | ||
| +++ src/merge3.c | ||
| @@ -316,11 +316,11 @@ | ||
| 316 | 316 | const char *z = blob_buffer(p); |
| 317 | 317 | int n = blob_size(p) - len + 1; |
| 318 | 318 | assert( len==(int)strlen(mergeMarker[1]) ); |
| 319 | 319 | assert( len==(int)strlen(mergeMarker[2]) ); |
| 320 | 320 | assert( len==(int)strlen(mergeMarker[3]) ); |
| 321 | - assert( sizeof(mergeMarker)/sizeof(mergeMarker[0])==4 ); | |
| 321 | + assert( count(mergeMarker)==4 ); | |
| 322 | 322 | for(i=0; i<n; ){ |
| 323 | 323 | for(j=0; j<4; j++){ |
| 324 | 324 | if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1; |
| 325 | 325 | } |
| 326 | 326 | while( i<n && z[i]!='\n' ){ i++; } |
| 327 | 327 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -316,11 +316,11 @@ | |
| 316 | const char *z = blob_buffer(p); |
| 317 | int n = blob_size(p) - len + 1; |
| 318 | assert( len==(int)strlen(mergeMarker[1]) ); |
| 319 | assert( len==(int)strlen(mergeMarker[2]) ); |
| 320 | assert( len==(int)strlen(mergeMarker[3]) ); |
| 321 | assert( sizeof(mergeMarker)/sizeof(mergeMarker[0])==4 ); |
| 322 | for(i=0; i<n; ){ |
| 323 | for(j=0; j<4; j++){ |
| 324 | if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1; |
| 325 | } |
| 326 | while( i<n && z[i]!='\n' ){ i++; } |
| 327 |
| --- src/merge3.c | |
| +++ src/merge3.c | |
| @@ -316,11 +316,11 @@ | |
| 316 | const char *z = blob_buffer(p); |
| 317 | int n = blob_size(p) - len + 1; |
| 318 | assert( len==(int)strlen(mergeMarker[1]) ); |
| 319 | assert( len==(int)strlen(mergeMarker[2]) ); |
| 320 | assert( len==(int)strlen(mergeMarker[3]) ); |
| 321 | assert( count(mergeMarker)==4 ); |
| 322 | for(i=0; i<n; ){ |
| 323 | for(j=0; j<4; j++){ |
| 324 | if( memcmp(&z[i], mergeMarker[j], len)==0 ) return 1; |
| 325 | } |
| 326 | while( i<n && z[i]!='\n' ){ i++; } |
| 327 |
+1
-1
| --- src/moderate.c | ||
| +++ src/moderate.c | ||
| @@ -67,11 +67,11 @@ | ||
| 67 | 67 | "mlink", "fid", |
| 68 | 68 | "tagxref", "srcid", |
| 69 | 69 | "tagxref", "rid", |
| 70 | 70 | }; |
| 71 | 71 | int i; |
| 72 | - for(i=0; i<sizeof(aTabField)/sizeof(aTabField[0]); i+=2){ | |
| 72 | + for(i=0; i<count(aTabField); i+=2){ | |
| 73 | 73 | if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d", |
| 74 | 74 | aTabField[i], aTabField[i+1], rid) ) return 1; |
| 75 | 75 | } |
| 76 | 76 | return 0; |
| 77 | 77 | } |
| 78 | 78 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -67,11 +67,11 @@ | |
| 67 | "mlink", "fid", |
| 68 | "tagxref", "srcid", |
| 69 | "tagxref", "rid", |
| 70 | }; |
| 71 | int i; |
| 72 | for(i=0; i<sizeof(aTabField)/sizeof(aTabField[0]); i+=2){ |
| 73 | if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d", |
| 74 | aTabField[i], aTabField[i+1], rid) ) return 1; |
| 75 | } |
| 76 | return 0; |
| 77 | } |
| 78 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -67,11 +67,11 @@ | |
| 67 | "mlink", "fid", |
| 68 | "tagxref", "srcid", |
| 69 | "tagxref", "rid", |
| 70 | }; |
| 71 | int i; |
| 72 | for(i=0; i<count(aTabField); i+=2){ |
| 73 | if( db_exists("SELECT 1 FROM \"%w\" WHERE \"%w\"=%d", |
| 74 | aTabField[i], aTabField[i+1], rid) ) return 1; |
| 75 | } |
| 76 | return 0; |
| 77 | } |
| 78 |
+1
-1
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -1204,11 +1204,11 @@ | ||
| 1204 | 1204 | char *zId = aCollide[i].azHit[j]; |
| 1205 | 1205 | if( zId==0 ) continue; |
| 1206 | 1206 | @ %z(href("%R/whatis/%s",zId))%h(zId)</a> |
| 1207 | 1207 | } |
| 1208 | 1208 | } |
| 1209 | - for(i=4; i<ArraySize(aCollide); i++){ | |
| 1209 | + for(i=4; i<count(aCollide); i++){ | |
| 1210 | 1210 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1211 | 1211 | fossil_free(aCollide[i].azHit[j]); |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1204,11 +1204,11 @@ | |
| 1204 | char *zId = aCollide[i].azHit[j]; |
| 1205 | if( zId==0 ) continue; |
| 1206 | @ %z(href("%R/whatis/%s",zId))%h(zId)</a> |
| 1207 | } |
| 1208 | } |
| 1209 | for(i=4; i<ArraySize(aCollide); i++){ |
| 1210 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1211 | fossil_free(aCollide[i].azHit[j]); |
| 1212 | } |
| 1213 | } |
| 1214 | } |
| 1215 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1204,11 +1204,11 @@ | |
| 1204 | char *zId = aCollide[i].azHit[j]; |
| 1205 | if( zId==0 ) continue; |
| 1206 | @ %z(href("%R/whatis/%s",zId))%h(zId)</a> |
| 1207 | } |
| 1208 | } |
| 1209 | for(i=4; i<count(aCollide); i++){ |
| 1210 | for(j=0; j<aCollide[i].cnt && j<MAX_COLLIDE; j++){ |
| 1211 | fossil_free(aCollide[i].azHit[j]); |
| 1212 | } |
| 1213 | } |
| 1214 | } |
| 1215 |
+2
-2
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | { 'n', 0, 0, etSIZE, 0, 0 }, |
| 159 | 159 | { '%', 0, 0, etPERCENT, 0, 0 }, |
| 160 | 160 | { 'p', 16, 0, etPOINTER, 0, 1 }, |
| 161 | 161 | { '/', 0, 0, etPATH, 0, 0 }, |
| 162 | 162 | }; |
| 163 | -#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) | |
| 163 | +#define etNINFO count(fmtinfo) | |
| 164 | 164 | |
| 165 | 165 | /* |
| 166 | 166 | ** "*val" is a double such that 0.1 <= *val < 10.0 |
| 167 | 167 | ** Return the ascii code for the leading digit of *val, then |
| 168 | 168 | ** multiply "*val" by 10.0 to renormalize. |
| @@ -979,11 +979,11 @@ | ||
| 979 | 979 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 980 | 980 | va_start(ap, zFormat); |
| 981 | 981 | vfprintf(out, zFormat, ap); |
| 982 | 982 | fprintf(out, "\n"); |
| 983 | 983 | va_end(ap); |
| 984 | - for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){ | |
| 984 | + for(i=0; i<count(azEnv); i++){ | |
| 985 | 985 | char *p; |
| 986 | 986 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 987 | 987 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 988 | 988 | fossil_path_free(p); |
| 989 | 989 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 990 | 990 |
| --- 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. |
| @@ -979,11 +979,11 @@ | |
| 979 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 980 | va_start(ap, zFormat); |
| 981 | vfprintf(out, zFormat, ap); |
| 982 | fprintf(out, "\n"); |
| 983 | va_end(ap); |
| 984 | for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){ |
| 985 | char *p; |
| 986 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 987 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 988 | fossil_path_free(p); |
| 989 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 990 |
| --- 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. |
| @@ -979,11 +979,11 @@ | |
| 979 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 980 | va_start(ap, zFormat); |
| 981 | vfprintf(out, zFormat, ap); |
| 982 | fprintf(out, "\n"); |
| 983 | va_end(ap); |
| 984 | for(i=0; i<count(azEnv); i++){ |
| 985 | char *p; |
| 986 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 987 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 988 | fossil_path_free(p); |
| 989 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 990 |
+2
-2
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | { 'n', 0, 0, etSIZE, 0, 0 }, |
| 159 | 159 | { '%', 0, 0, etPERCENT, 0, 0 }, |
| 160 | 160 | { 'p', 16, 0, etPOINTER, 0, 1 }, |
| 161 | 161 | { '/', 0, 0, etPATH, 0, 0 }, |
| 162 | 162 | }; |
| 163 | -#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) | |
| 163 | +#define etNINFO count(fmtinfo) | |
| 164 | 164 | |
| 165 | 165 | /* |
| 166 | 166 | ** "*val" is a double such that 0.1 <= *val < 10.0 |
| 167 | 167 | ** Return the ascii code for the leading digit of *val, then |
| 168 | 168 | ** multiply "*val" by 10.0 to renormalize. |
| @@ -979,11 +979,11 @@ | ||
| 979 | 979 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 980 | 980 | va_start(ap, zFormat); |
| 981 | 981 | vfprintf(out, zFormat, ap); |
| 982 | 982 | fprintf(out, "\n"); |
| 983 | 983 | va_end(ap); |
| 984 | - for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){ | |
| 984 | + for(i=0; i<count(azEnv); i++){ | |
| 985 | 985 | char *p; |
| 986 | 986 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 987 | 987 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 988 | 988 | fossil_path_free(p); |
| 989 | 989 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 990 | 990 |
| --- 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. |
| @@ -979,11 +979,11 @@ | |
| 979 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 980 | va_start(ap, zFormat); |
| 981 | vfprintf(out, zFormat, ap); |
| 982 | fprintf(out, "\n"); |
| 983 | va_end(ap); |
| 984 | for(i=0; i<sizeof(azEnv)/sizeof(azEnv[0]); i++){ |
| 985 | char *p; |
| 986 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 987 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 988 | fossil_path_free(p); |
| 989 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 990 |
| --- 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. |
| @@ -979,11 +979,11 @@ | |
| 979 | pNow->tm_hour, pNow->tm_min, pNow->tm_sec); |
| 980 | va_start(ap, zFormat); |
| 981 | vfprintf(out, zFormat, ap); |
| 982 | fprintf(out, "\n"); |
| 983 | va_end(ap); |
| 984 | for(i=0; i<count(azEnv); i++){ |
| 985 | char *p; |
| 986 | if( (p = fossil_getenv(azEnv[i]))!=0 ){ |
| 987 | fprintf(out, "%s=%s\n", azEnv[i], p); |
| 988 | fossil_path_free(p); |
| 989 | }else if( (z = P(azEnv[i]))!=0 ){ |
| 990 |
+1
-1
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -205,11 +205,11 @@ | ||
| 205 | 205 | in.i++; |
| 206 | 206 | } |
| 207 | 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ | |
| 210 | + if( pRe->nState<=count(aSpace)*2 ){ | |
| 211 | 211 | pToFree = 0; |
| 212 | 212 | aStateSet[0].aState = aSpace; |
| 213 | 213 | }else{ |
| 214 | 214 | pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState ); |
| 215 | 215 | if( pToFree==0 ) return -1; |
| 216 | 216 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -205,11 +205,11 @@ | |
| 205 | in.i++; |
| 206 | } |
| 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 208 | } |
| 209 | |
| 210 | if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ |
| 211 | pToFree = 0; |
| 212 | aStateSet[0].aState = aSpace; |
| 213 | }else{ |
| 214 | pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState ); |
| 215 | if( pToFree==0 ) return -1; |
| 216 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -205,11 +205,11 @@ | |
| 205 | in.i++; |
| 206 | } |
| 207 | if( in.i+pRe->nInit>in.mx ) return 0; |
| 208 | } |
| 209 | |
| 210 | if( pRe->nState<=count(aSpace)*2 ){ |
| 211 | pToFree = 0; |
| 212 | aStateSet[0].aState = aSpace; |
| 213 | }else{ |
| 214 | pToFree = fossil_malloc( sizeof(ReStateNumber)*2*pRe->nState ); |
| 215 | if( pToFree==0 ) return -1; |
| 216 |
+2
-2
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -198,14 +198,14 @@ | ||
| 198 | 198 | }; |
| 199 | 199 | int i; |
| 200 | 200 | if( fossil_strncmp(zArg1, "fx_", 3)==0 ){ |
| 201 | 201 | break; |
| 202 | 202 | } |
| 203 | - for(i=0; i<sizeof(azAllowed)/sizeof(azAllowed[0]); i++){ | |
| 203 | + for(i=0; i<count(azAllowed); i++){ | |
| 204 | 204 | if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break; |
| 205 | 205 | } |
| 206 | - if( i>=sizeof(azAllowed)/sizeof(azAllowed[0]) ){ | |
| 206 | + if( i>=count(azAllowed) ){ | |
| 207 | 207 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 208 | 208 | rc = SQLITE_DENY; |
| 209 | 209 | }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){ |
| 210 | 210 | rc = SQLITE_IGNORE; |
| 211 | 211 | } |
| 212 | 212 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -198,14 +198,14 @@ | |
| 198 | }; |
| 199 | int i; |
| 200 | if( fossil_strncmp(zArg1, "fx_", 3)==0 ){ |
| 201 | break; |
| 202 | } |
| 203 | for(i=0; i<sizeof(azAllowed)/sizeof(azAllowed[0]); i++){ |
| 204 | if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break; |
| 205 | } |
| 206 | if( i>=sizeof(azAllowed)/sizeof(azAllowed[0]) ){ |
| 207 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 208 | rc = SQLITE_DENY; |
| 209 | }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){ |
| 210 | rc = SQLITE_IGNORE; |
| 211 | } |
| 212 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -198,14 +198,14 @@ | |
| 198 | }; |
| 199 | int i; |
| 200 | if( fossil_strncmp(zArg1, "fx_", 3)==0 ){ |
| 201 | break; |
| 202 | } |
| 203 | for(i=0; i<count(azAllowed); i++){ |
| 204 | if( fossil_stricmp(zArg1, azAllowed[i])==0 ) break; |
| 205 | } |
| 206 | if( i>=count(azAllowed) ){ |
| 207 | *(char**)pError = mprintf("access to table \"%s\" is restricted",zArg1); |
| 208 | rc = SQLITE_DENY; |
| 209 | }else if( !g.perm.RdAddr && strncmp(zArg2, "private_", 8)==0 ){ |
| 210 | rc = SQLITE_IGNORE; |
| 211 | } |
| 212 |
+9
-9
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -418,11 +418,11 @@ | ||
| 418 | 418 | sqlite3_value **argv |
| 419 | 419 | ){ |
| 420 | 420 | const char *azDoc[5]; |
| 421 | 421 | int nDoc; |
| 422 | 422 | int rc; |
| 423 | - for(nDoc=0; nDoc<ArraySize(azDoc) && nDoc<argc; nDoc++){ | |
| 423 | + for(nDoc=0; nDoc<count(azDoc) && nDoc<argc; nDoc++){ | |
| 424 | 424 | azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]); |
| 425 | 425 | if( azDoc[nDoc]==0 ) azDoc[nDoc] = ""; |
| 426 | 426 | } |
| 427 | 427 | rc = search_match(&gSearch, nDoc, azDoc); |
| 428 | 428 | sqlite3_result_int(context, rc); |
| @@ -657,11 +657,11 @@ | ||
| 657 | 657 | }; |
| 658 | 658 | int i; |
| 659 | 659 | if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC); |
| 660 | 660 | if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT); |
| 661 | 661 | if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI); |
| 662 | - for(i=0; i<ArraySize(aSetng); i++){ | |
| 662 | + for(i=0; i<count(aSetng); i++){ | |
| 663 | 663 | unsigned int m = aSetng[i].m; |
| 664 | 664 | if( (srchFlags & m)==0 ) continue; |
| 665 | 665 | if( ((knownGood|knownBad) & m)!=0 ) continue; |
| 666 | 666 | if( db_get_boolean(aSetng[i].zKey,0) ){ |
| 667 | 667 | knownGood |= m; |
| @@ -892,11 +892,11 @@ | ||
| 892 | 892 | { SRCH_DOC, 'd' }, |
| 893 | 893 | { SRCH_TKT, 't' }, |
| 894 | 894 | { SRCH_WIKI, 'w' }, |
| 895 | 895 | }; |
| 896 | 896 | int i; |
| 897 | - for(i=0; i<ArraySize(aMask); i++){ | |
| 897 | + for(i=0; i<count(aMask); i++){ | |
| 898 | 898 | if( srchFlags & aMask[i].m ){ |
| 899 | 899 | blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c); |
| 900 | 900 | zSep = " OR "; |
| 901 | 901 | } |
| 902 | 902 | } |
| @@ -1070,11 +1070,11 @@ | ||
| 1070 | 1070 | }; |
| 1071 | 1071 | const char *zY = PD("y","all"); |
| 1072 | 1072 | unsigned newFlags = srchFlags; |
| 1073 | 1073 | int i; |
| 1074 | 1074 | @ <select size='1' name='y'> |
| 1075 | - for(i=0; i<ArraySize(aY); i++){ | |
| 1075 | + for(i=0; i<count(aY); i++){ | |
| 1076 | 1076 | if( (aY[i].m & srchFlags)==0 ) continue; |
| 1077 | 1077 | cgi_printf("<option value='%s'", aY[i].z); |
| 1078 | 1078 | if( fossil_strcmp(zY,aY[i].z)==0 ){ |
| 1079 | 1079 | newFlags &= aY[i].m; |
| 1080 | 1080 | cgi_printf(" selected"); |
| @@ -1727,17 +1727,17 @@ | ||
| 1727 | 1727 | int iAction = 0; |
| 1728 | 1728 | db_find_and_open_repository(0, 0); |
| 1729 | 1729 | if( g.argc>2 ){ |
| 1730 | 1730 | zSubCmd = g.argv[2]; |
| 1731 | 1731 | n = (int)strlen(zSubCmd); |
| 1732 | - for(i=0; i<ArraySize(aCmd); i++){ | |
| 1732 | + for(i=0; i<count(aCmd); i++){ | |
| 1733 | 1733 | if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break; |
| 1734 | 1734 | } |
| 1735 | - if( i>=ArraySize(aCmd) ){ | |
| 1735 | + if( i>=count(aCmd) ){ | |
| 1736 | 1736 | Blob all; |
| 1737 | 1737 | blob_init(&all,0,0); |
| 1738 | - for(i=0; i<ArraySize(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); | |
| 1738 | + for(i=0; i<count(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); | |
| 1739 | 1739 | fossil_fatal("unknown \"%s\" - should be on of:%s", |
| 1740 | 1740 | zSubCmd, blob_str(&all)); |
| 1741 | 1741 | return; |
| 1742 | 1742 | } |
| 1743 | 1743 | iCmd = aCmd[i].iCmd; |
| @@ -1757,11 +1757,11 @@ | ||
| 1757 | 1757 | /* Adjust search settings */ |
| 1758 | 1758 | if( iCmd==3 || iCmd==4 ){ |
| 1759 | 1759 | const char *zCtrl; |
| 1760 | 1760 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1761 | 1761 | zCtrl = g.argv[3]; |
| 1762 | - for(j=0; j<ArraySize(aSetng); j++){ | |
| 1762 | + for(j=0; j<count(aSetng); j++){ | |
| 1763 | 1763 | if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){ |
| 1764 | 1764 | db_set_int(aSetng[j].zSetting, iCmd-3, 0); |
| 1765 | 1765 | } |
| 1766 | 1766 | } |
| 1767 | 1767 | } |
| @@ -1778,11 +1778,11 @@ | ||
| 1778 | 1778 | if( iAction>=2 ){ |
| 1779 | 1779 | search_rebuild_index(); |
| 1780 | 1780 | } |
| 1781 | 1781 | |
| 1782 | 1782 | /* Always show the status before ending */ |
| 1783 | - for(i=0; i<ArraySize(aSetng); i++){ | |
| 1783 | + for(i=0; i<count(aSetng); i++){ | |
| 1784 | 1784 | fossil_print("%-16s %s\n", aSetng[i].zName, |
| 1785 | 1785 | db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off"); |
| 1786 | 1786 | } |
| 1787 | 1787 | fossil_print("%-16s %s\n", "Porter stemmer:", |
| 1788 | 1788 | db_get_boolean("search-stemmer",0) ? "on" : "off"); |
| 1789 | 1789 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -418,11 +418,11 @@ | |
| 418 | sqlite3_value **argv |
| 419 | ){ |
| 420 | const char *azDoc[5]; |
| 421 | int nDoc; |
| 422 | int rc; |
| 423 | for(nDoc=0; nDoc<ArraySize(azDoc) && nDoc<argc; nDoc++){ |
| 424 | azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]); |
| 425 | if( azDoc[nDoc]==0 ) azDoc[nDoc] = ""; |
| 426 | } |
| 427 | rc = search_match(&gSearch, nDoc, azDoc); |
| 428 | sqlite3_result_int(context, rc); |
| @@ -657,11 +657,11 @@ | |
| 657 | }; |
| 658 | int i; |
| 659 | if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC); |
| 660 | if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT); |
| 661 | if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI); |
| 662 | for(i=0; i<ArraySize(aSetng); i++){ |
| 663 | unsigned int m = aSetng[i].m; |
| 664 | if( (srchFlags & m)==0 ) continue; |
| 665 | if( ((knownGood|knownBad) & m)!=0 ) continue; |
| 666 | if( db_get_boolean(aSetng[i].zKey,0) ){ |
| 667 | knownGood |= m; |
| @@ -892,11 +892,11 @@ | |
| 892 | { SRCH_DOC, 'd' }, |
| 893 | { SRCH_TKT, 't' }, |
| 894 | { SRCH_WIKI, 'w' }, |
| 895 | }; |
| 896 | int i; |
| 897 | for(i=0; i<ArraySize(aMask); i++){ |
| 898 | if( srchFlags & aMask[i].m ){ |
| 899 | blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c); |
| 900 | zSep = " OR "; |
| 901 | } |
| 902 | } |
| @@ -1070,11 +1070,11 @@ | |
| 1070 | }; |
| 1071 | const char *zY = PD("y","all"); |
| 1072 | unsigned newFlags = srchFlags; |
| 1073 | int i; |
| 1074 | @ <select size='1' name='y'> |
| 1075 | for(i=0; i<ArraySize(aY); i++){ |
| 1076 | if( (aY[i].m & srchFlags)==0 ) continue; |
| 1077 | cgi_printf("<option value='%s'", aY[i].z); |
| 1078 | if( fossil_strcmp(zY,aY[i].z)==0 ){ |
| 1079 | newFlags &= aY[i].m; |
| 1080 | cgi_printf(" selected"); |
| @@ -1727,17 +1727,17 @@ | |
| 1727 | int iAction = 0; |
| 1728 | db_find_and_open_repository(0, 0); |
| 1729 | if( g.argc>2 ){ |
| 1730 | zSubCmd = g.argv[2]; |
| 1731 | n = (int)strlen(zSubCmd); |
| 1732 | for(i=0; i<ArraySize(aCmd); i++){ |
| 1733 | if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break; |
| 1734 | } |
| 1735 | if( i>=ArraySize(aCmd) ){ |
| 1736 | Blob all; |
| 1737 | blob_init(&all,0,0); |
| 1738 | for(i=0; i<ArraySize(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); |
| 1739 | fossil_fatal("unknown \"%s\" - should be on of:%s", |
| 1740 | zSubCmd, blob_str(&all)); |
| 1741 | return; |
| 1742 | } |
| 1743 | iCmd = aCmd[i].iCmd; |
| @@ -1757,11 +1757,11 @@ | |
| 1757 | /* Adjust search settings */ |
| 1758 | if( iCmd==3 || iCmd==4 ){ |
| 1759 | const char *zCtrl; |
| 1760 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1761 | zCtrl = g.argv[3]; |
| 1762 | for(j=0; j<ArraySize(aSetng); j++){ |
| 1763 | if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){ |
| 1764 | db_set_int(aSetng[j].zSetting, iCmd-3, 0); |
| 1765 | } |
| 1766 | } |
| 1767 | } |
| @@ -1778,11 +1778,11 @@ | |
| 1778 | if( iAction>=2 ){ |
| 1779 | search_rebuild_index(); |
| 1780 | } |
| 1781 | |
| 1782 | /* Always show the status before ending */ |
| 1783 | for(i=0; i<ArraySize(aSetng); i++){ |
| 1784 | fossil_print("%-16s %s\n", aSetng[i].zName, |
| 1785 | db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off"); |
| 1786 | } |
| 1787 | fossil_print("%-16s %s\n", "Porter stemmer:", |
| 1788 | db_get_boolean("search-stemmer",0) ? "on" : "off"); |
| 1789 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -418,11 +418,11 @@ | |
| 418 | sqlite3_value **argv |
| 419 | ){ |
| 420 | const char *azDoc[5]; |
| 421 | int nDoc; |
| 422 | int rc; |
| 423 | for(nDoc=0; nDoc<count(azDoc) && nDoc<argc; nDoc++){ |
| 424 | azDoc[nDoc] = (const char*)sqlite3_value_text(argv[nDoc]); |
| 425 | if( azDoc[nDoc]==0 ) azDoc[nDoc] = ""; |
| 426 | } |
| 427 | rc = search_match(&gSearch, nDoc, azDoc); |
| 428 | sqlite3_result_int(context, rc); |
| @@ -657,11 +657,11 @@ | |
| 657 | }; |
| 658 | int i; |
| 659 | if( g.perm.Read==0 ) srchFlags &= ~(SRCH_CKIN|SRCH_DOC); |
| 660 | if( g.perm.RdTkt==0 ) srchFlags &= ~(SRCH_TKT); |
| 661 | if( g.perm.RdWiki==0 ) srchFlags &= ~(SRCH_WIKI); |
| 662 | for(i=0; i<count(aSetng); i++){ |
| 663 | unsigned int m = aSetng[i].m; |
| 664 | if( (srchFlags & m)==0 ) continue; |
| 665 | if( ((knownGood|knownBad) & m)!=0 ) continue; |
| 666 | if( db_get_boolean(aSetng[i].zKey,0) ){ |
| 667 | knownGood |= m; |
| @@ -892,11 +892,11 @@ | |
| 892 | { SRCH_DOC, 'd' }, |
| 893 | { SRCH_TKT, 't' }, |
| 894 | { SRCH_WIKI, 'w' }, |
| 895 | }; |
| 896 | int i; |
| 897 | for(i=0; i<count(aMask); i++){ |
| 898 | if( srchFlags & aMask[i].m ){ |
| 899 | blob_appendf(&sql, "%sftsdocs.type='%c'", zSep, aMask[i].c); |
| 900 | zSep = " OR "; |
| 901 | } |
| 902 | } |
| @@ -1070,11 +1070,11 @@ | |
| 1070 | }; |
| 1071 | const char *zY = PD("y","all"); |
| 1072 | unsigned newFlags = srchFlags; |
| 1073 | int i; |
| 1074 | @ <select size='1' name='y'> |
| 1075 | for(i=0; i<count(aY); i++){ |
| 1076 | if( (aY[i].m & srchFlags)==0 ) continue; |
| 1077 | cgi_printf("<option value='%s'", aY[i].z); |
| 1078 | if( fossil_strcmp(zY,aY[i].z)==0 ){ |
| 1079 | newFlags &= aY[i].m; |
| 1080 | cgi_printf(" selected"); |
| @@ -1727,17 +1727,17 @@ | |
| 1727 | int iAction = 0; |
| 1728 | db_find_and_open_repository(0, 0); |
| 1729 | if( g.argc>2 ){ |
| 1730 | zSubCmd = g.argv[2]; |
| 1731 | n = (int)strlen(zSubCmd); |
| 1732 | for(i=0; i<count(aCmd); i++){ |
| 1733 | if( fossil_strncmp(aCmd[i].z, zSubCmd, n)==0 ) break; |
| 1734 | } |
| 1735 | if( i>=count(aCmd) ){ |
| 1736 | Blob all; |
| 1737 | blob_init(&all,0,0); |
| 1738 | for(i=0; i<count(aCmd); i++) blob_appendf(&all, " %s", aCmd[i].z); |
| 1739 | fossil_fatal("unknown \"%s\" - should be on of:%s", |
| 1740 | zSubCmd, blob_str(&all)); |
| 1741 | return; |
| 1742 | } |
| 1743 | iCmd = aCmd[i].iCmd; |
| @@ -1757,11 +1757,11 @@ | |
| 1757 | /* Adjust search settings */ |
| 1758 | if( iCmd==3 || iCmd==4 ){ |
| 1759 | const char *zCtrl; |
| 1760 | if( g.argc<4 ) usage(mprintf("%s STRING",zSubCmd)); |
| 1761 | zCtrl = g.argv[3]; |
| 1762 | for(j=0; j<count(aSetng); j++){ |
| 1763 | if( strchr(zCtrl, aSetng[j].zSw[0])!=0 ){ |
| 1764 | db_set_int(aSetng[j].zSetting, iCmd-3, 0); |
| 1765 | } |
| 1766 | } |
| 1767 | } |
| @@ -1778,11 +1778,11 @@ | |
| 1778 | if( iAction>=2 ){ |
| 1779 | search_rebuild_index(); |
| 1780 | } |
| 1781 | |
| 1782 | /* Always show the status before ending */ |
| 1783 | for(i=0; i<count(aSetng); i++){ |
| 1784 | fossil_print("%-16s %s\n", aSetng[i].zName, |
| 1785 | db_get_boolean(aSetng[i].zSetting,0) ? "on" : "off"); |
| 1786 | } |
| 1787 | fossil_print("%-16s %s\n", "Porter stemmer:", |
| 1788 | db_get_boolean("search-stemmer",0) ? "on" : "off"); |
| 1789 |
+3
-7
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -19,14 +19,10 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include <assert.h> |
| 22 | 22 | #include "setup.h" |
| 23 | 23 | |
| 24 | -#if INTERFACE | |
| 25 | -#define ArraySize(x) (sizeof(x)/sizeof(x[0])) | |
| 26 | -#endif | |
| 27 | - | |
| 28 | 24 | /* |
| 29 | 25 | ** Output a single entry for a menu generated using an HTML table. |
| 30 | 26 | ** If zLink is not NULL or an empty string, then it is the page that |
| 31 | 27 | ** the menu entry will hyperlink to. If zLink is NULL or "", then |
| 32 | 28 | ** the menu entry has no hyperlink - it is disabled. |
| @@ -944,18 +940,18 @@ | ||
| 944 | 940 | admin_log("Set option [%q] to [%q].", |
| 945 | 941 | zVar, iQ ? "on" : "off"); |
| 946 | 942 | iVal = iQ; |
| 947 | 943 | } |
| 948 | 944 | } |
| 949 | - @ <input type="checkbox" name="%s(zQParm)" | |
| 945 | + @ <label><input type="checkbox" name="%s(zQParm)" | |
| 950 | 946 | if( iVal ){ |
| 951 | 947 | @ checked="checked" |
| 952 | 948 | } |
| 953 | 949 | if( disabled ){ |
| 954 | 950 | @ disabled="disabled" |
| 955 | 951 | } |
| 956 | - @ /> <b>%s(zLabel)</b> | |
| 952 | + @ /> <b>%s(zLabel)</b></label> | |
| 957 | 953 | } |
| 958 | 954 | |
| 959 | 955 | /* |
| 960 | 956 | ** Generate an entry box for an attribute. |
| 961 | 957 | */ |
| @@ -1431,11 +1427,11 @@ | ||
| 1431 | 1427 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1432 | 1428 | } |
| 1433 | 1429 | |
| 1434 | 1430 | @ <hr /> |
| 1435 | 1431 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1436 | - "tdf", "0", ArraySize(azTimeFormats)/2, azTimeFormats); | |
| 1432 | + "tdf", "0", count(azTimeFormats)/2, azTimeFormats); | |
| 1437 | 1433 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1438 | 1434 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1439 | 1435 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1440 | 1436 | @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> |
| 1441 | 1437 | |
| 1442 | 1438 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -19,14 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "setup.h" |
| 23 | |
| 24 | #if INTERFACE |
| 25 | #define ArraySize(x) (sizeof(x)/sizeof(x[0])) |
| 26 | #endif |
| 27 | |
| 28 | /* |
| 29 | ** Output a single entry for a menu generated using an HTML table. |
| 30 | ** If zLink is not NULL or an empty string, then it is the page that |
| 31 | ** the menu entry will hyperlink to. If zLink is NULL or "", then |
| 32 | ** the menu entry has no hyperlink - it is disabled. |
| @@ -944,18 +940,18 @@ | |
| 944 | admin_log("Set option [%q] to [%q].", |
| 945 | zVar, iQ ? "on" : "off"); |
| 946 | iVal = iQ; |
| 947 | } |
| 948 | } |
| 949 | @ <input type="checkbox" name="%s(zQParm)" |
| 950 | if( iVal ){ |
| 951 | @ checked="checked" |
| 952 | } |
| 953 | if( disabled ){ |
| 954 | @ disabled="disabled" |
| 955 | } |
| 956 | @ /> <b>%s(zLabel)</b> |
| 957 | } |
| 958 | |
| 959 | /* |
| 960 | ** Generate an entry box for an attribute. |
| 961 | */ |
| @@ -1431,11 +1427,11 @@ | |
| 1431 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1432 | } |
| 1433 | |
| 1434 | @ <hr /> |
| 1435 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1436 | "tdf", "0", ArraySize(azTimeFormats)/2, azTimeFormats); |
| 1437 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1438 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1439 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1440 | @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> |
| 1441 | |
| 1442 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -19,14 +19,10 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "setup.h" |
| 23 | |
| 24 | /* |
| 25 | ** Output a single entry for a menu generated using an HTML table. |
| 26 | ** If zLink is not NULL or an empty string, then it is the page that |
| 27 | ** the menu entry will hyperlink to. If zLink is NULL or "", then |
| 28 | ** the menu entry has no hyperlink - it is disabled. |
| @@ -944,18 +940,18 @@ | |
| 940 | admin_log("Set option [%q] to [%q].", |
| 941 | zVar, iQ ? "on" : "off"); |
| 942 | iVal = iQ; |
| 943 | } |
| 944 | } |
| 945 | @ <label><input type="checkbox" name="%s(zQParm)" |
| 946 | if( iVal ){ |
| 947 | @ checked="checked" |
| 948 | } |
| 949 | if( disabled ){ |
| 950 | @ disabled="disabled" |
| 951 | } |
| 952 | @ /> <b>%s(zLabel)</b></label> |
| 953 | } |
| 954 | |
| 955 | /* |
| 956 | ** Generate an entry box for an attribute. |
| 957 | */ |
| @@ -1431,11 +1427,11 @@ | |
| 1427 | @ %s(zTmDiff) hours ahead of UTC.</p> |
| 1428 | } |
| 1429 | |
| 1430 | @ <hr /> |
| 1431 | multiple_choice_attribute("Per-Item Time Format", "timeline-date-format", |
| 1432 | "tdf", "0", count(azTimeFormats)/2, azTimeFormats); |
| 1433 | @ <p>If the "HH:MM" or "HH:MM:SS" format is selected, then the date is shown |
| 1434 | @ in a separate box (using CSS class "timelineDate") whenever the date changes. |
| 1435 | @ With the "YYYY-MM-DD HH:MM" and "YYMMDD ..." formats, the complete date |
| 1436 | @ and time is shown on every timeline entry (using the CSS class "timelineTime").</p> |
| 1437 | |
| 1438 |
+12
-12
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -100,18 +100,18 @@ | ||
| 100 | 100 | Blob err = BLOB_INITIALIZER; |
| 101 | 101 | if( strchr(zName, '/')!=0 ){ |
| 102 | 102 | zAltSkinDir = fossil_strdup(zName); |
| 103 | 103 | return 0; |
| 104 | 104 | } |
| 105 | - for(i=0; i<ArraySize(aBuiltinSkin); i++){ | |
| 105 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 106 | 106 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){ |
| 107 | 107 | pAltSkin = &aBuiltinSkin[i]; |
| 108 | 108 | return 0; |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | blob_appendf(&err, "available skins: %s", aBuiltinSkin[0].zLabel); |
| 112 | - for(i=1; i<ArraySize(aBuiltinSkin); i++){ | |
| 112 | + for(i=1; i<count(aBuiltinSkin); i++){ | |
| 113 | 113 | blob_append(&err, " ", 1); |
| 114 | 114 | blob_append(&err, aBuiltinSkin[i].zLabel, -1); |
| 115 | 115 | } |
| 116 | 116 | return blob_str(&err); |
| 117 | 117 | } |
| @@ -163,11 +163,11 @@ | ||
| 163 | 163 | /* |
| 164 | 164 | ** Return a pointer to a SkinDetail element. Return 0 if not found. |
| 165 | 165 | */ |
| 166 | 166 | static struct SkinDetail *skin_detail_find(const char *zName){ |
| 167 | 167 | int lwr = 0; |
| 168 | - int upr = ArraySize(aSkinDetail); | |
| 168 | + int upr = count(aSkinDetail); | |
| 169 | 169 | while( upr>=lwr ){ |
| 170 | 170 | int mid = (upr+lwr)/2; |
| 171 | 171 | int c = fossil_strcmp(aSkinDetail[mid].zName, zName); |
| 172 | 172 | if( c==0 ) return &aSkinDetail[mid]; |
| 173 | 173 | if( c<0 ){ |
| @@ -283,11 +283,11 @@ | ||
| 283 | 283 | ** Return true if there exists a skin name "zSkinName". |
| 284 | 284 | */ |
| 285 | 285 | static int skinExists(const char *zSkinName){ |
| 286 | 286 | int i; |
| 287 | 287 | if( zSkinName==0 ) return 0; |
| 288 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 288 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 289 | 289 | if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1; |
| 290 | 290 | } |
| 291 | 291 | return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName); |
| 292 | 292 | } |
| 293 | 293 | |
| @@ -304,11 +304,11 @@ | ||
| 304 | 304 | char *zLabel; |
| 305 | 305 | static const char *azType[] = { "css", "header", "footer", "details" }; |
| 306 | 306 | int i; |
| 307 | 307 | Blob val; |
| 308 | 308 | blob_zero(&val); |
| 309 | - for(i=0; i<sizeof(azType)/sizeof(azType[0]); i++){ | |
| 309 | + for(i=0; i<count(azType); i++){ | |
| 310 | 310 | if( zName ){ |
| 311 | 311 | zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]); |
| 312 | 312 | z = builtin_text(zLabel); |
| 313 | 313 | fossil_free(zLabel); |
| 314 | 314 | }else{ |
| @@ -427,11 +427,11 @@ | ||
| 427 | 427 | login_needed(0); |
| 428 | 428 | return; |
| 429 | 429 | } |
| 430 | 430 | db_begin_transaction(); |
| 431 | 431 | zCurrent = getSkin(0); |
| 432 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 432 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 433 | 433 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | /* Process requests to delete a user-defined skin */ |
| 437 | 437 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| @@ -458,11 +458,11 @@ | ||
| 458 | 458 | int seen = 0; |
| 459 | 459 | |
| 460 | 460 | /* Check to see if the current skin is already saved. If it is, there |
| 461 | 461 | ** is no need to create a backup */ |
| 462 | 462 | zCurrent = getSkin(0); |
| 463 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 463 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 464 | 464 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 465 | 465 | seen = 1; |
| 466 | 466 | break; |
| 467 | 467 | } |
| 468 | 468 | } |
| @@ -476,11 +476,11 @@ | ||
| 476 | 476 | " %Q,now())", zCurrent |
| 477 | 477 | ); |
| 478 | 478 | } |
| 479 | 479 | } |
| 480 | 480 | seen = 0; |
| 481 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 481 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 482 | 482 | if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){ |
| 483 | 483 | seen = 1; |
| 484 | 484 | zCurrent = aBuiltinSkin[i].zSQL; |
| 485 | 485 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 486 | 486 | break; |
| @@ -513,11 +513,11 @@ | ||
| 513 | 513 | @ is restarted without the override.</p> |
| 514 | 514 | @ |
| 515 | 515 | } |
| 516 | 516 | @ <h2>Available Skins:</h2> |
| 517 | 517 | @ <table border="0"> |
| 518 | - for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ | |
| 518 | + for(i=0; i<count(aBuiltinSkin); i++){ | |
| 519 | 519 | z = aBuiltinSkin[i].zDesc; |
| 520 | 520 | @ <tr><td>%d(i+1).<td>%h(z)<td> <td> |
| 521 | 521 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 522 | 522 | @ (Currently In Use) |
| 523 | 523 | seenCurrent = 1; |
| @@ -597,20 +597,20 @@ | ||
| 597 | 597 | if( !g.perm.Setup ){ |
| 598 | 598 | login_needed(0); |
| 599 | 599 | return; |
| 600 | 600 | } |
| 601 | 601 | ii = atoi(PD("w","0")); |
| 602 | - if( ii<0 || ii>ArraySize(aSkinAttr) ) ii = 0; | |
| 602 | + if( ii<0 || ii>count(aSkinAttr) ) ii = 0; | |
| 603 | 603 | zBasis = PD("basis","default"); |
| 604 | 604 | zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile); |
| 605 | 605 | db_begin_transaction(); |
| 606 | 606 | if( P("revert")!=0 ){ |
| 607 | 607 | db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile); |
| 608 | 608 | cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt)); |
| 609 | 609 | } |
| 610 | 610 | style_header("%s", aSkinAttr[ii].zTitle); |
| 611 | - for(j=0; j<ArraySize(aSkinAttr); j++){ | |
| 611 | + for(j=0; j<count(aSkinAttr); j++){ | |
| 612 | 612 | if( j==ii ) continue; |
| 613 | 613 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 614 | 614 | "%R/setup_skinedit?w=%d&basis=%h",j,zBasis); |
| 615 | 615 | } |
| 616 | 616 | style_submenu_element("Skins", "%R/setup_skin"); |
| @@ -622,11 +622,11 @@ | ||
| 622 | 622 | aSkinAttr[ii].zFile, builtin_text(zDflt), 0); |
| 623 | 623 | @ <br /> |
| 624 | 624 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 625 | 625 | @ <hr /> |
| 626 | 626 | @ Baseline: <select size='1' name='basis'> |
| 627 | - for(j=0; j<ArraySize(aBuiltinSkin); j++){ | |
| 627 | + for(j=0; j<count(aBuiltinSkin); j++){ | |
| 628 | 628 | cgi_printf("<option value='%h'%s>%h</option>\n", |
| 629 | 629 | aBuiltinSkin[j].zLabel, |
| 630 | 630 | fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "", |
| 631 | 631 | aBuiltinSkin[j].zDesc |
| 632 | 632 | ); |
| 633 | 633 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -100,18 +100,18 @@ | |
| 100 | Blob err = BLOB_INITIALIZER; |
| 101 | if( strchr(zName, '/')!=0 ){ |
| 102 | zAltSkinDir = fossil_strdup(zName); |
| 103 | return 0; |
| 104 | } |
| 105 | for(i=0; i<ArraySize(aBuiltinSkin); i++){ |
| 106 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){ |
| 107 | pAltSkin = &aBuiltinSkin[i]; |
| 108 | return 0; |
| 109 | } |
| 110 | } |
| 111 | blob_appendf(&err, "available skins: %s", aBuiltinSkin[0].zLabel); |
| 112 | for(i=1; i<ArraySize(aBuiltinSkin); i++){ |
| 113 | blob_append(&err, " ", 1); |
| 114 | blob_append(&err, aBuiltinSkin[i].zLabel, -1); |
| 115 | } |
| 116 | return blob_str(&err); |
| 117 | } |
| @@ -163,11 +163,11 @@ | |
| 163 | /* |
| 164 | ** Return a pointer to a SkinDetail element. Return 0 if not found. |
| 165 | */ |
| 166 | static struct SkinDetail *skin_detail_find(const char *zName){ |
| 167 | int lwr = 0; |
| 168 | int upr = ArraySize(aSkinDetail); |
| 169 | while( upr>=lwr ){ |
| 170 | int mid = (upr+lwr)/2; |
| 171 | int c = fossil_strcmp(aSkinDetail[mid].zName, zName); |
| 172 | if( c==0 ) return &aSkinDetail[mid]; |
| 173 | if( c<0 ){ |
| @@ -283,11 +283,11 @@ | |
| 283 | ** Return true if there exists a skin name "zSkinName". |
| 284 | */ |
| 285 | static int skinExists(const char *zSkinName){ |
| 286 | int i; |
| 287 | if( zSkinName==0 ) return 0; |
| 288 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 289 | if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1; |
| 290 | } |
| 291 | return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName); |
| 292 | } |
| 293 | |
| @@ -304,11 +304,11 @@ | |
| 304 | char *zLabel; |
| 305 | static const char *azType[] = { "css", "header", "footer", "details" }; |
| 306 | int i; |
| 307 | Blob val; |
| 308 | blob_zero(&val); |
| 309 | for(i=0; i<sizeof(azType)/sizeof(azType[0]); i++){ |
| 310 | if( zName ){ |
| 311 | zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]); |
| 312 | z = builtin_text(zLabel); |
| 313 | fossil_free(zLabel); |
| 314 | }else{ |
| @@ -427,11 +427,11 @@ | |
| 427 | login_needed(0); |
| 428 | return; |
| 429 | } |
| 430 | db_begin_transaction(); |
| 431 | zCurrent = getSkin(0); |
| 432 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 433 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 434 | } |
| 435 | |
| 436 | /* Process requests to delete a user-defined skin */ |
| 437 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| @@ -458,11 +458,11 @@ | |
| 458 | int seen = 0; |
| 459 | |
| 460 | /* Check to see if the current skin is already saved. If it is, there |
| 461 | ** is no need to create a backup */ |
| 462 | zCurrent = getSkin(0); |
| 463 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 464 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 465 | seen = 1; |
| 466 | break; |
| 467 | } |
| 468 | } |
| @@ -476,11 +476,11 @@ | |
| 476 | " %Q,now())", zCurrent |
| 477 | ); |
| 478 | } |
| 479 | } |
| 480 | seen = 0; |
| 481 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 482 | if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){ |
| 483 | seen = 1; |
| 484 | zCurrent = aBuiltinSkin[i].zSQL; |
| 485 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 486 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | @ is restarted without the override.</p> |
| 514 | @ |
| 515 | } |
| 516 | @ <h2>Available Skins:</h2> |
| 517 | @ <table border="0"> |
| 518 | for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){ |
| 519 | z = aBuiltinSkin[i].zDesc; |
| 520 | @ <tr><td>%d(i+1).<td>%h(z)<td> <td> |
| 521 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 522 | @ (Currently In Use) |
| 523 | seenCurrent = 1; |
| @@ -597,20 +597,20 @@ | |
| 597 | if( !g.perm.Setup ){ |
| 598 | login_needed(0); |
| 599 | return; |
| 600 | } |
| 601 | ii = atoi(PD("w","0")); |
| 602 | if( ii<0 || ii>ArraySize(aSkinAttr) ) ii = 0; |
| 603 | zBasis = PD("basis","default"); |
| 604 | zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile); |
| 605 | db_begin_transaction(); |
| 606 | if( P("revert")!=0 ){ |
| 607 | db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile); |
| 608 | cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt)); |
| 609 | } |
| 610 | style_header("%s", aSkinAttr[ii].zTitle); |
| 611 | for(j=0; j<ArraySize(aSkinAttr); j++){ |
| 612 | if( j==ii ) continue; |
| 613 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 614 | "%R/setup_skinedit?w=%d&basis=%h",j,zBasis); |
| 615 | } |
| 616 | style_submenu_element("Skins", "%R/setup_skin"); |
| @@ -622,11 +622,11 @@ | |
| 622 | aSkinAttr[ii].zFile, builtin_text(zDflt), 0); |
| 623 | @ <br /> |
| 624 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 625 | @ <hr /> |
| 626 | @ Baseline: <select size='1' name='basis'> |
| 627 | for(j=0; j<ArraySize(aBuiltinSkin); j++){ |
| 628 | cgi_printf("<option value='%h'%s>%h</option>\n", |
| 629 | aBuiltinSkin[j].zLabel, |
| 630 | fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "", |
| 631 | aBuiltinSkin[j].zDesc |
| 632 | ); |
| 633 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -100,18 +100,18 @@ | |
| 100 | Blob err = BLOB_INITIALIZER; |
| 101 | if( strchr(zName, '/')!=0 ){ |
| 102 | zAltSkinDir = fossil_strdup(zName); |
| 103 | return 0; |
| 104 | } |
| 105 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 106 | if( fossil_strcmp(aBuiltinSkin[i].zLabel, zName)==0 ){ |
| 107 | pAltSkin = &aBuiltinSkin[i]; |
| 108 | return 0; |
| 109 | } |
| 110 | } |
| 111 | blob_appendf(&err, "available skins: %s", aBuiltinSkin[0].zLabel); |
| 112 | for(i=1; i<count(aBuiltinSkin); i++){ |
| 113 | blob_append(&err, " ", 1); |
| 114 | blob_append(&err, aBuiltinSkin[i].zLabel, -1); |
| 115 | } |
| 116 | return blob_str(&err); |
| 117 | } |
| @@ -163,11 +163,11 @@ | |
| 163 | /* |
| 164 | ** Return a pointer to a SkinDetail element. Return 0 if not found. |
| 165 | */ |
| 166 | static struct SkinDetail *skin_detail_find(const char *zName){ |
| 167 | int lwr = 0; |
| 168 | int upr = count(aSkinDetail); |
| 169 | while( upr>=lwr ){ |
| 170 | int mid = (upr+lwr)/2; |
| 171 | int c = fossil_strcmp(aSkinDetail[mid].zName, zName); |
| 172 | if( c==0 ) return &aSkinDetail[mid]; |
| 173 | if( c<0 ){ |
| @@ -283,11 +283,11 @@ | |
| 283 | ** Return true if there exists a skin name "zSkinName". |
| 284 | */ |
| 285 | static int skinExists(const char *zSkinName){ |
| 286 | int i; |
| 287 | if( zSkinName==0 ) return 0; |
| 288 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 289 | if( fossil_strcmp(zSkinName, aBuiltinSkin[i].zDesc)==0 ) return 1; |
| 290 | } |
| 291 | return db_exists("SELECT 1 FROM config WHERE name='skin:%q'", zSkinName); |
| 292 | } |
| 293 | |
| @@ -304,11 +304,11 @@ | |
| 304 | char *zLabel; |
| 305 | static const char *azType[] = { "css", "header", "footer", "details" }; |
| 306 | int i; |
| 307 | Blob val; |
| 308 | blob_zero(&val); |
| 309 | for(i=0; i<count(azType); i++){ |
| 310 | if( zName ){ |
| 311 | zLabel = mprintf("skins/%s/%s.txt", zName, azType[i]); |
| 312 | z = builtin_text(zLabel); |
| 313 | fossil_free(zLabel); |
| 314 | }else{ |
| @@ -427,11 +427,11 @@ | |
| 427 | login_needed(0); |
| 428 | return; |
| 429 | } |
| 430 | db_begin_transaction(); |
| 431 | zCurrent = getSkin(0); |
| 432 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 433 | aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); |
| 434 | } |
| 435 | |
| 436 | /* Process requests to delete a user-defined skin */ |
| 437 | if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){ |
| @@ -458,11 +458,11 @@ | |
| 458 | int seen = 0; |
| 459 | |
| 460 | /* Check to see if the current skin is already saved. If it is, there |
| 461 | ** is no need to create a backup */ |
| 462 | zCurrent = getSkin(0); |
| 463 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 464 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 465 | seen = 1; |
| 466 | break; |
| 467 | } |
| 468 | } |
| @@ -476,11 +476,11 @@ | |
| 476 | " %Q,now())", zCurrent |
| 477 | ); |
| 478 | } |
| 479 | } |
| 480 | seen = 0; |
| 481 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 482 | if( fossil_strcmp(aBuiltinSkin[i].zDesc, z)==0 ){ |
| 483 | seen = 1; |
| 484 | zCurrent = aBuiltinSkin[i].zSQL; |
| 485 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 486 | break; |
| @@ -513,11 +513,11 @@ | |
| 513 | @ is restarted without the override.</p> |
| 514 | @ |
| 515 | } |
| 516 | @ <h2>Available Skins:</h2> |
| 517 | @ <table border="0"> |
| 518 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 519 | z = aBuiltinSkin[i].zDesc; |
| 520 | @ <tr><td>%d(i+1).<td>%h(z)<td> <td> |
| 521 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| 522 | @ (Currently In Use) |
| 523 | seenCurrent = 1; |
| @@ -597,20 +597,20 @@ | |
| 597 | if( !g.perm.Setup ){ |
| 598 | login_needed(0); |
| 599 | return; |
| 600 | } |
| 601 | ii = atoi(PD("w","0")); |
| 602 | if( ii<0 || ii>count(aSkinAttr) ) ii = 0; |
| 603 | zBasis = PD("basis","default"); |
| 604 | zDflt = mprintf("skins/%s/%s.txt", zBasis, aSkinAttr[ii].zFile); |
| 605 | db_begin_transaction(); |
| 606 | if( P("revert")!=0 ){ |
| 607 | db_multi_exec("DELETE FROM config WHERE name=%Q", aSkinAttr[ii].zFile); |
| 608 | cgi_replace_parameter(aSkinAttr[ii].zFile, builtin_text(zDflt)); |
| 609 | } |
| 610 | style_header("%s", aSkinAttr[ii].zTitle); |
| 611 | for(j=0; j<count(aSkinAttr); j++){ |
| 612 | if( j==ii ) continue; |
| 613 | style_submenu_element(aSkinAttr[j].zSubmenu, |
| 614 | "%R/setup_skinedit?w=%d&basis=%h",j,zBasis); |
| 615 | } |
| 616 | style_submenu_element("Skins", "%R/setup_skin"); |
| @@ -622,11 +622,11 @@ | |
| 622 | aSkinAttr[ii].zFile, builtin_text(zDflt), 0); |
| 623 | @ <br /> |
| 624 | @ <input type="submit" name="submit" value="Apply Changes" /> |
| 625 | @ <hr /> |
| 626 | @ Baseline: <select size='1' name='basis'> |
| 627 | for(j=0; j<count(aBuiltinSkin); j++){ |
| 628 | cgi_printf("<option value='%h'%s>%h</option>\n", |
| 629 | aBuiltinSkin[j].zLabel, |
| 630 | fossil_strcmp(zBasis,aBuiltinSkin[j].zLabel)==0 ? " selected" : "", |
| 631 | aBuiltinSkin[j].zDesc |
| 632 | ); |
| 633 |
+3
-3
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -706,24 +706,24 @@ | ||
| 706 | 706 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| 707 | 707 | if( zView==0 ){ |
| 708 | 708 | zView = "byuser"; |
| 709 | 709 | cgi_replace_query_parameter("view","byuser"); |
| 710 | 710 | } |
| 711 | - for(i=0; i<ArraySize(aViewType); i++){ | |
| 711 | + for(i=0; i<count(aViewType); i++){ | |
| 712 | 712 | if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){ |
| 713 | 713 | eType = aViewType[i].eType; |
| 714 | 714 | break; |
| 715 | 715 | } |
| 716 | 716 | } |
| 717 | 717 | if( eType!=RPT_NONE ){ |
| 718 | 718 | int nView = 0; /* Slots used in azView[] */ |
| 719 | - for(i=0; i<ArraySize(aViewType); i++){ | |
| 719 | + for(i=0; i<count(aViewType); i++){ | |
| 720 | 720 | azView[nView++] = aViewType[i].zVal; |
| 721 | 721 | azView[nView++] = aViewType[i].zName; |
| 722 | 722 | } |
| 723 | 723 | if( eType!=RPT_BYFILE ){ |
| 724 | - style_submenu_multichoice("type", ArraySize(azType)/2, azType, 0); | |
| 724 | + style_submenu_multichoice("type", count(azType)/2, azType, 0); | |
| 725 | 725 | } |
| 726 | 726 | style_submenu_multichoice("view", nView/2, azView, 0); |
| 727 | 727 | if( eType!=RPT_BYUSER ){ |
| 728 | 728 | style_submenu_sql("user","User:", |
| 729 | 729 | "SELECT '', 'All Users' UNION ALL " |
| 730 | 730 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -706,24 +706,24 @@ | |
| 706 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| 707 | if( zView==0 ){ |
| 708 | zView = "byuser"; |
| 709 | cgi_replace_query_parameter("view","byuser"); |
| 710 | } |
| 711 | for(i=0; i<ArraySize(aViewType); i++){ |
| 712 | if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){ |
| 713 | eType = aViewType[i].eType; |
| 714 | break; |
| 715 | } |
| 716 | } |
| 717 | if( eType!=RPT_NONE ){ |
| 718 | int nView = 0; /* Slots used in azView[] */ |
| 719 | for(i=0; i<ArraySize(aViewType); i++){ |
| 720 | azView[nView++] = aViewType[i].zVal; |
| 721 | azView[nView++] = aViewType[i].zName; |
| 722 | } |
| 723 | if( eType!=RPT_BYFILE ){ |
| 724 | style_submenu_multichoice("type", ArraySize(azType)/2, azType, 0); |
| 725 | } |
| 726 | style_submenu_multichoice("view", nView/2, azView, 0); |
| 727 | if( eType!=RPT_BYUSER ){ |
| 728 | style_submenu_sql("user","User:", |
| 729 | "SELECT '', 'All Users' UNION ALL " |
| 730 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -706,24 +706,24 @@ | |
| 706 | if( zUserName && zUserName[0]==0 ) zUserName = 0; |
| 707 | if( zView==0 ){ |
| 708 | zView = "byuser"; |
| 709 | cgi_replace_query_parameter("view","byuser"); |
| 710 | } |
| 711 | for(i=0; i<count(aViewType); i++){ |
| 712 | if( fossil_strcmp(zView, aViewType[i].zVal)==0 ){ |
| 713 | eType = aViewType[i].eType; |
| 714 | break; |
| 715 | } |
| 716 | } |
| 717 | if( eType!=RPT_NONE ){ |
| 718 | int nView = 0; /* Slots used in azView[] */ |
| 719 | for(i=0; i<count(aViewType); i++){ |
| 720 | azView[nView++] = aViewType[i].zVal; |
| 721 | azView[nView++] = aViewType[i].zName; |
| 722 | } |
| 723 | if( eType!=RPT_BYFILE ){ |
| 724 | style_submenu_multichoice("type", count(azType)/2, azType, 0); |
| 725 | } |
| 726 | style_submenu_multichoice("view", nView/2, azView, 0); |
| 727 | if( eType!=RPT_BYUSER ){ |
| 728 | style_submenu_sql("user","User:", |
| 729 | "SELECT '', 'All Users' UNION ALL " |
| 730 |
+96
-72
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -30,11 +30,13 @@ | ||
| 30 | 30 | ** Populate these structure with calls to |
| 31 | 31 | ** |
| 32 | 32 | ** style_submenu_element() |
| 33 | 33 | ** style_submenu_entry() |
| 34 | 34 | ** style_submenu_checkbox() |
| 35 | +** style_submenu_binary() | |
| 35 | 36 | ** style_submenu_multichoice() |
| 37 | +** style_submenu_sql() | |
| 36 | 38 | ** |
| 37 | 39 | ** prior to calling style_footer(). The style_footer() routine |
| 38 | 40 | ** will generate the appropriate HTML text just below the main |
| 39 | 41 | ** menu. |
| 40 | 42 | */ |
| @@ -51,13 +53,14 @@ | ||
| 51 | 53 | short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */ |
| 52 | 54 | const char *const *azChoice;/* value/display pairs for FF_MULTI */ |
| 53 | 55 | const char *zFalse; /* FF_BINARY label when false */ |
| 54 | 56 | } aSubmenuCtrl[20]; |
| 55 | 57 | static int nSubmenuCtrl = 0; |
| 56 | -#define FF_ENTRY 1 | |
| 57 | -#define FF_MULTI 2 | |
| 58 | -#define FF_BINARY 3 | |
| 58 | +#define FF_ENTRY 1 | |
| 59 | +#define FF_MULTI 2 | |
| 60 | +#define FF_BINARY 3 | |
| 61 | +#define FF_CHECKBOX 4 | |
| 59 | 62 | |
| 60 | 63 | /* |
| 61 | 64 | ** Remember that the header has been generated. The footer is omitted |
| 62 | 65 | ** if an error occurs before the header. |
| 63 | 66 | */ |
| @@ -233,11 +236,11 @@ | ||
| 233 | 236 | const char *zLabel, |
| 234 | 237 | const char *zLink, |
| 235 | 238 | ... |
| 236 | 239 | ){ |
| 237 | 240 | va_list ap; |
| 238 | - assert( nSubmenu < sizeof(aSubmenu)/sizeof(aSubmenu[0]) ); | |
| 241 | + assert( nSubmenu < count(aSubmenu) ); | |
| 239 | 242 | aSubmenu[nSubmenu].zLabel = zLabel; |
| 240 | 243 | va_start(ap, zLink); |
| 241 | 244 | aSubmenu[nSubmenu].zLink = vmprintf(zLink, ap); |
| 242 | 245 | va_end(ap); |
| 243 | 246 | nSubmenu++; |
| @@ -246,25 +249,37 @@ | ||
| 246 | 249 | const char *zName, /* Query parameter name */ |
| 247 | 250 | const char *zLabel, /* Label before the entry box */ |
| 248 | 251 | int iSize, /* Size of the entry box */ |
| 249 | 252 | int isDisabled /* True if disabled */ |
| 250 | 253 | ){ |
| 251 | - assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); | |
| 254 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 252 | 255 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 253 | 256 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; |
| 254 | 257 | aSubmenuCtrl[nSubmenuCtrl].iSize = iSize; |
| 255 | 258 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 256 | 259 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_ENTRY; |
| 257 | 260 | nSubmenuCtrl++; |
| 261 | +} | |
| 262 | +void style_submenu_checkbox( | |
| 263 | + const char *zName, /* Query parameter name */ | |
| 264 | + const char *zLabel, /* Label to display after the checkbox */ | |
| 265 | + int isDisabled /* True if disabled */ | |
| 266 | +){ | |
| 267 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 268 | + aSubmenuCtrl[nSubmenuCtrl].zName = zName; | |
| 269 | + aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel; | |
| 270 | + aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; | |
| 271 | + aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX; | |
| 272 | + nSubmenuCtrl++; | |
| 258 | 273 | } |
| 259 | 274 | void style_submenu_binary( |
| 260 | 275 | const char *zName, /* Query parameter name */ |
| 261 | 276 | const char *zTrue, /* Label to show when parameter is true */ |
| 262 | 277 | const char *zFalse, /* Label to show when the parameter is false */ |
| 263 | 278 | int isDisabled /* True if this control is disabled */ |
| 264 | 279 | ){ |
| 265 | - assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); | |
| 280 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 266 | 281 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 267 | 282 | aSubmenuCtrl[nSubmenuCtrl].zLabel = zTrue; |
| 268 | 283 | aSubmenuCtrl[nSubmenuCtrl].zFalse = zFalse; |
| 269 | 284 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 270 | 285 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_BINARY; |
| @@ -274,11 +289,11 @@ | ||
| 274 | 289 | const char *zName, /* Query parameter name */ |
| 275 | 290 | int nChoice, /* Number of options */ |
| 276 | 291 | const char *const *azChoice,/* value/display pairs. 2*nChoice entries */ |
| 277 | 292 | int isDisabled /* True if this control is disabled */ |
| 278 | 293 | ){ |
| 279 | - assert( nSubmenuCtrl < ArraySize(aSubmenuCtrl) ); | |
| 294 | + assert( nSubmenuCtrl < count(aSubmenuCtrl) ); | |
| 280 | 295 | aSubmenuCtrl[nSubmenuCtrl].zName = zName; |
| 281 | 296 | aSubmenuCtrl[nSubmenuCtrl].iSize = nChoice; |
| 282 | 297 | aSubmenuCtrl[nSubmenuCtrl].azChoice = azChoice; |
| 283 | 298 | aSubmenuCtrl[nSubmenuCtrl].isDisabled = isDisabled; |
| 284 | 299 | aSubmenuCtrl[nSubmenuCtrl].eType = FF_MULTI; |
| @@ -521,74 +536,82 @@ | ||
| 521 | 536 | }else{ |
| 522 | 537 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 523 | 538 | } |
| 524 | 539 | } |
| 525 | 540 | } |
| 526 | - if( nSubmenuCtrl>0 ){ | |
| 527 | - for(i=0; i<nSubmenuCtrl; i++){ | |
| 528 | - const char *zQPN = aSubmenuCtrl[i].zName; | |
| 529 | - const char *zDisabled = " disabled"; | |
| 530 | - if( !aSubmenuCtrl[i].isDisabled ){ | |
| 531 | - zDisabled = ""; | |
| 532 | - cgi_tag_query_parameter(zQPN); | |
| 533 | - } | |
| 534 | - switch( aSubmenuCtrl[i].eType ){ | |
| 535 | - case FF_ENTRY: { | |
| 536 | - cgi_printf( | |
| 537 | - "<span class='submenuctrl'>" | |
| 538 | - " %h<input type='text' name='%s' size='%d' maxlength='%d'" | |
| 539 | - " value='%h'%s></span>\n", | |
| 540 | - aSubmenuCtrl[i].zLabel, | |
| 541 | - zQPN, | |
| 542 | - aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize, | |
| 543 | - PD(zQPN,""), | |
| 544 | - zDisabled | |
| 545 | - ); | |
| 546 | - break; | |
| 547 | - } | |
| 548 | - case FF_MULTI: { | |
| 549 | - int j; | |
| 550 | - const char *zVal = P(zQPN); | |
| 551 | - if( aSubmenuCtrl[i].zLabel ){ | |
| 552 | - cgi_printf(" %h", aSubmenuCtrl[i].zLabel); | |
| 553 | - } | |
| 554 | - cgi_printf( | |
| 555 | - "<select class='submenuctrl' size='1' name='%s'%s " | |
| 556 | - "onchange='gebi(\"f01\").submit();'>\n", | |
| 557 | - zQPN, zDisabled | |
| 558 | - ); | |
| 559 | - for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ | |
| 560 | - const char *zQPV = aSubmenuCtrl[i].azChoice[j]; | |
| 561 | - cgi_printf( | |
| 562 | - "<option value='%h'%s>%h</option>\n", | |
| 563 | - zQPV, | |
| 564 | - fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", | |
| 565 | - aSubmenuCtrl[i].azChoice[j+1] | |
| 566 | - ); | |
| 567 | - } | |
| 568 | - @ </select> | |
| 569 | - break; | |
| 570 | - } | |
| 571 | - case FF_BINARY: { | |
| 572 | - int isTrue = PB(zQPN); | |
| 573 | - cgi_printf( | |
| 574 | - "<select class='submenuctrl' size='1' name='%s'%s " | |
| 575 | - "onchange='gebi(\"f01\").submit();'>\n", | |
| 576 | - zQPN, zDisabled | |
| 577 | - ); | |
| 578 | - cgi_printf( | |
| 579 | - "<option value='1'%s>%h</option>\n", | |
| 580 | - isTrue ? " selected":"", aSubmenuCtrl[i].zLabel | |
| 581 | - ); | |
| 582 | - cgi_printf( | |
| 583 | - "<option value='0'%s>%h</option>\n", | |
| 584 | - (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse | |
| 585 | - ); | |
| 586 | - @ </select> | |
| 587 | - break; | |
| 588 | - } | |
| 589 | - } | |
| 541 | + for(i=0; i<nSubmenuCtrl; i++){ | |
| 542 | + const char *zQPN = aSubmenuCtrl[i].zName; | |
| 543 | + const char *zDisabled = " disabled"; | |
| 544 | + if( !aSubmenuCtrl[i].isDisabled ){ | |
| 545 | + zDisabled = ""; | |
| 546 | + cgi_tag_query_parameter(zQPN); | |
| 547 | + } | |
| 548 | + switch( aSubmenuCtrl[i].eType ){ | |
| 549 | + case FF_ENTRY: | |
| 550 | + cgi_printf( | |
| 551 | + "<span class='submenuctrl'>" | |
| 552 | + " %h<input type='text' name='%s' value='%h'%s", | |
| 553 | + aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled | |
| 554 | + ); | |
| 555 | + if( aSubmenuCtrl[i].iSize<0 ){ | |
| 556 | + cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize); | |
| 557 | + }else if( aSubmenuCtrl[i].iSize>0 ){ | |
| 558 | + cgi_printf( | |
| 559 | + " size='%d' maxlength='%d'", | |
| 560 | + aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize | |
| 561 | + ); | |
| 562 | + } | |
| 563 | + @ onchange='gebi("f01").submit();'></span> | |
| 564 | + break; | |
| 565 | + case FF_MULTI: { | |
| 566 | + int j; | |
| 567 | + const char *zVal = P(zQPN); | |
| 568 | + if( aSubmenuCtrl[i].zLabel ){ | |
| 569 | + cgi_printf(" %h", aSubmenuCtrl[i].zLabel); | |
| 570 | + } | |
| 571 | + cgi_printf( | |
| 572 | + "<select class='submenuctrl' size='1' name='%s'%s " | |
| 573 | + "onchange='gebi(\"f01\").submit();'>\n", | |
| 574 | + zQPN, zDisabled | |
| 575 | + ); | |
| 576 | + for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ | |
| 577 | + const char *zQPV = aSubmenuCtrl[i].azChoice[j]; | |
| 578 | + cgi_printf( | |
| 579 | + "<option value='%h'%s>%h</option>\n", | |
| 580 | + zQPV, | |
| 581 | + fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", | |
| 582 | + aSubmenuCtrl[i].azChoice[j+1] | |
| 583 | + ); | |
| 584 | + } | |
| 585 | + @ </select> | |
| 586 | + break; | |
| 587 | + } | |
| 588 | + case FF_BINARY: { | |
| 589 | + int isTrue = PB(zQPN); | |
| 590 | + cgi_printf( | |
| 591 | + "<select class='submenuctrl' size='1' name='%s'%s " | |
| 592 | + "onchange='gebi(\"f01\").submit();'>\n", | |
| 593 | + zQPN, zDisabled | |
| 594 | + ); | |
| 595 | + cgi_printf( | |
| 596 | + "<option value='1'%s>%h</option>\n", | |
| 597 | + isTrue ? " selected":"", aSubmenuCtrl[i].zLabel | |
| 598 | + ); | |
| 599 | + cgi_printf( | |
| 600 | + "<option value='0'%s>%h</option>\n", | |
| 601 | + (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse | |
| 602 | + ); | |
| 603 | + @ </select> | |
| 604 | + break; | |
| 605 | + } | |
| 606 | + case FF_CHECKBOX: | |
| 607 | + cgi_printf( | |
| 608 | + "<label class='submenuctrl'><input type='checkbox' name='%s' " | |
| 609 | + "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n", | |
| 610 | + zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel | |
| 611 | + ); | |
| 612 | + break; | |
| 590 | 613 | } |
| 591 | 614 | } |
| 592 | 615 | @ </div> |
| 593 | 616 | if( nSubmenuCtrl ){ |
| 594 | 617 | cgi_query_parameters_to_hidden(); |
| @@ -701,14 +724,15 @@ | ||
| 701 | 724 | { "td.timelineTableCell", |
| 702 | 725 | "the format for the timeline data cells", |
| 703 | 726 | @ vertical-align: top; |
| 704 | 727 | @ text-align: left; |
| 705 | 728 | }, |
| 706 | - { "tr.timelineCurrent td.timelineTableCell", | |
| 729 | + { "tr.timelineCurrent", | |
| 707 | 730 | "the format for the timeline data cell of the current checkout", |
| 708 | 731 | @ padding: .1em .2em; |
| 709 | 732 | @ border: 1px dashed #446979; |
| 733 | + @ box-shadow: 1px 1px 4px #888; | |
| 710 | 734 | }, |
| 711 | 735 | { "tr.timelineSelected", |
| 712 | 736 | "The row in the timeline table that contains the entry of interest", |
| 713 | 737 | @ padding: .1em .2em; |
| 714 | 738 | @ border: 2px solid lightgray; |
| 715 | 739 |
| --- 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,74 +536,82 @@ | |
| 521 | }else{ |
| 522 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | if( nSubmenuCtrl>0 ){ |
| 527 | for(i=0; i<nSubmenuCtrl; i++){ |
| 528 | const char *zQPN = aSubmenuCtrl[i].zName; |
| 529 | const char *zDisabled = " disabled"; |
| 530 | if( !aSubmenuCtrl[i].isDisabled ){ |
| 531 | zDisabled = ""; |
| 532 | cgi_tag_query_parameter(zQPN); |
| 533 | } |
| 534 | switch( aSubmenuCtrl[i].eType ){ |
| 535 | case FF_ENTRY: { |
| 536 | cgi_printf( |
| 537 | "<span class='submenuctrl'>" |
| 538 | " %h<input type='text' name='%s' size='%d' maxlength='%d'" |
| 539 | " value='%h'%s></span>\n", |
| 540 | aSubmenuCtrl[i].zLabel, |
| 541 | zQPN, |
| 542 | aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize, |
| 543 | PD(zQPN,""), |
| 544 | zDisabled |
| 545 | ); |
| 546 | break; |
| 547 | } |
| 548 | case FF_MULTI: { |
| 549 | int j; |
| 550 | const char *zVal = P(zQPN); |
| 551 | if( aSubmenuCtrl[i].zLabel ){ |
| 552 | cgi_printf(" %h", aSubmenuCtrl[i].zLabel); |
| 553 | } |
| 554 | cgi_printf( |
| 555 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 556 | "onchange='gebi(\"f01\").submit();'>\n", |
| 557 | zQPN, zDisabled |
| 558 | ); |
| 559 | for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ |
| 560 | const char *zQPV = aSubmenuCtrl[i].azChoice[j]; |
| 561 | cgi_printf( |
| 562 | "<option value='%h'%s>%h</option>\n", |
| 563 | zQPV, |
| 564 | fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", |
| 565 | aSubmenuCtrl[i].azChoice[j+1] |
| 566 | ); |
| 567 | } |
| 568 | @ </select> |
| 569 | break; |
| 570 | } |
| 571 | case FF_BINARY: { |
| 572 | int isTrue = PB(zQPN); |
| 573 | cgi_printf( |
| 574 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 575 | "onchange='gebi(\"f01\").submit();'>\n", |
| 576 | zQPN, zDisabled |
| 577 | ); |
| 578 | cgi_printf( |
| 579 | "<option value='1'%s>%h</option>\n", |
| 580 | isTrue ? " selected":"", aSubmenuCtrl[i].zLabel |
| 581 | ); |
| 582 | cgi_printf( |
| 583 | "<option value='0'%s>%h</option>\n", |
| 584 | (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse |
| 585 | ); |
| 586 | @ </select> |
| 587 | break; |
| 588 | } |
| 589 | } |
| 590 | } |
| 591 | } |
| 592 | @ </div> |
| 593 | if( nSubmenuCtrl ){ |
| 594 | cgi_query_parameters_to_hidden(); |
| @@ -701,14 +724,15 @@ | |
| 701 | { "td.timelineTableCell", |
| 702 | "the format for the timeline data cells", |
| 703 | @ vertical-align: top; |
| 704 | @ text-align: left; |
| 705 | }, |
| 706 | { "tr.timelineCurrent td.timelineTableCell", |
| 707 | "the format for the timeline data cell of the current checkout", |
| 708 | @ padding: .1em .2em; |
| 709 | @ border: 1px dashed #446979; |
| 710 | }, |
| 711 | { "tr.timelineSelected", |
| 712 | "The row in the timeline table that contains the entry of interest", |
| 713 | @ padding: .1em .2em; |
| 714 | @ border: 2px solid lightgray; |
| 715 |
| --- 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,74 +536,82 @@ | |
| 536 | }else{ |
| 537 | @ <a class="label" href="%h(p->zLink)">%h(p->zLabel)</a> |
| 538 | } |
| 539 | } |
| 540 | } |
| 541 | for(i=0; i<nSubmenuCtrl; i++){ |
| 542 | const char *zQPN = aSubmenuCtrl[i].zName; |
| 543 | const char *zDisabled = " disabled"; |
| 544 | if( !aSubmenuCtrl[i].isDisabled ){ |
| 545 | zDisabled = ""; |
| 546 | cgi_tag_query_parameter(zQPN); |
| 547 | } |
| 548 | switch( aSubmenuCtrl[i].eType ){ |
| 549 | case FF_ENTRY: |
| 550 | cgi_printf( |
| 551 | "<span class='submenuctrl'>" |
| 552 | " %h<input type='text' name='%s' value='%h'%s", |
| 553 | aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled |
| 554 | ); |
| 555 | if( aSubmenuCtrl[i].iSize<0 ){ |
| 556 | cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize); |
| 557 | }else if( aSubmenuCtrl[i].iSize>0 ){ |
| 558 | cgi_printf( |
| 559 | " size='%d' maxlength='%d'", |
| 560 | aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize |
| 561 | ); |
| 562 | } |
| 563 | @ onchange='gebi("f01").submit();'></span> |
| 564 | break; |
| 565 | case FF_MULTI: { |
| 566 | int j; |
| 567 | const char *zVal = P(zQPN); |
| 568 | if( aSubmenuCtrl[i].zLabel ){ |
| 569 | cgi_printf(" %h", aSubmenuCtrl[i].zLabel); |
| 570 | } |
| 571 | cgi_printf( |
| 572 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 573 | "onchange='gebi(\"f01\").submit();'>\n", |
| 574 | zQPN, zDisabled |
| 575 | ); |
| 576 | for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){ |
| 577 | const char *zQPV = aSubmenuCtrl[i].azChoice[j]; |
| 578 | cgi_printf( |
| 579 | "<option value='%h'%s>%h</option>\n", |
| 580 | zQPV, |
| 581 | fossil_strcmp(zVal,zQPV)==0 ? " selected" : "", |
| 582 | aSubmenuCtrl[i].azChoice[j+1] |
| 583 | ); |
| 584 | } |
| 585 | @ </select> |
| 586 | break; |
| 587 | } |
| 588 | case FF_BINARY: { |
| 589 | int isTrue = PB(zQPN); |
| 590 | cgi_printf( |
| 591 | "<select class='submenuctrl' size='1' name='%s'%s " |
| 592 | "onchange='gebi(\"f01\").submit();'>\n", |
| 593 | zQPN, zDisabled |
| 594 | ); |
| 595 | cgi_printf( |
| 596 | "<option value='1'%s>%h</option>\n", |
| 597 | isTrue ? " selected":"", aSubmenuCtrl[i].zLabel |
| 598 | ); |
| 599 | cgi_printf( |
| 600 | "<option value='0'%s>%h</option>\n", |
| 601 | (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse |
| 602 | ); |
| 603 | @ </select> |
| 604 | break; |
| 605 | } |
| 606 | case FF_CHECKBOX: |
| 607 | cgi_printf( |
| 608 | "<label class='submenuctrl'><input type='checkbox' name='%s' " |
| 609 | "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n", |
| 610 | zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel |
| 611 | ); |
| 612 | break; |
| 613 | } |
| 614 | } |
| 615 | @ </div> |
| 616 | if( nSubmenuCtrl ){ |
| 617 | cgi_query_parameters_to_hidden(); |
| @@ -701,14 +724,15 @@ | |
| 724 | { "td.timelineTableCell", |
| 725 | "the format for the timeline data cells", |
| 726 | @ vertical-align: top; |
| 727 | @ text-align: left; |
| 728 | }, |
| 729 | { "tr.timelineCurrent", |
| 730 | "the format for the timeline data cell of the current checkout", |
| 731 | @ padding: .1em .2em; |
| 732 | @ border: 1px dashed #446979; |
| 733 | @ box-shadow: 1px 1px 4px #888; |
| 734 | }, |
| 735 | { "tr.timelineSelected", |
| 736 | "The row in the timeline table that contains the entry of interest", |
| 737 | @ padding: .1em .2em; |
| 738 | @ border: 2px solid lightgray; |
| 739 |
+1
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -2005,11 +2005,11 @@ | ||
| 2005 | 2005 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 2006 | 2006 | } |
| 2007 | 2007 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 2008 | 2008 | } |
| 2009 | 2009 | #endif |
| 2010 | - for(i=0; i<sizeof(aCommand)/sizeof(aCommand[0]); i++){ | |
| 2010 | + for(i=0; i<count(aCommand); i++){ | |
| 2011 | 2011 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 2012 | 2012 | Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, |
| 2013 | 2013 | aCommand[i].pContext, 0); |
| 2014 | 2014 | } |
| 2015 | 2015 | }else{ |
| 2016 | 2016 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 2006 | } |
| 2007 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 2008 | } |
| 2009 | #endif |
| 2010 | for(i=0; i<sizeof(aCommand)/sizeof(aCommand[0]); i++){ |
| 2011 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 2012 | Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, |
| 2013 | aCommand[i].pContext, 0); |
| 2014 | } |
| 2015 | }else{ |
| 2016 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -2005,11 +2005,11 @@ | |
| 2005 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 2006 | } |
| 2007 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 2008 | } |
| 2009 | #endif |
| 2010 | for(i=0; i<count(aCommand); i++){ |
| 2011 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 2012 | Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, |
| 2013 | aCommand[i].pContext, 0); |
| 2014 | } |
| 2015 | }else{ |
| 2016 |
+2
-2
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -833,11 +833,11 @@ | ||
| 833 | 833 | int i; |
| 834 | 834 | Th_Interp *th1Interp = (Th_Interp *)clientData; |
| 835 | 835 | |
| 836 | 836 | if( !th1Interp ) return; |
| 837 | 837 | /* Remove the Tcl integration commands. */ |
| 838 | - for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ | |
| 838 | + for(i=0; i<count(aCommand); i++){ | |
| 839 | 839 | Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0); |
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | /* |
| @@ -1261,11 +1261,11 @@ | ||
| 1261 | 1261 | void *pContext |
| 1262 | 1262 | ){ |
| 1263 | 1263 | int i; |
| 1264 | 1264 | |
| 1265 | 1265 | /* Add the Tcl integration commands to TH1. */ |
| 1266 | - for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ | |
| 1266 | + for(i=0; i<count(aCommand); i++){ | |
| 1267 | 1267 | void *ctx; |
| 1268 | 1268 | if( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1269 | 1269 | ctx = aCommand[i].pContext; |
| 1270 | 1270 | /* Use Tcl interpreter for context? */ |
| 1271 | 1271 | if( !ctx ) ctx = pContext; |
| 1272 | 1272 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | int i; |
| 834 | Th_Interp *th1Interp = (Th_Interp *)clientData; |
| 835 | |
| 836 | if( !th1Interp ) return; |
| 837 | /* Remove the Tcl integration commands. */ |
| 838 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 839 | Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0); |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | /* |
| @@ -1261,11 +1261,11 @@ | |
| 1261 | void *pContext |
| 1262 | ){ |
| 1263 | int i; |
| 1264 | |
| 1265 | /* Add the Tcl integration commands to TH1. */ |
| 1266 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 1267 | void *ctx; |
| 1268 | if( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1269 | ctx = aCommand[i].pContext; |
| 1270 | /* Use Tcl interpreter for context? */ |
| 1271 | if( !ctx ) ctx = pContext; |
| 1272 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | int i; |
| 834 | Th_Interp *th1Interp = (Th_Interp *)clientData; |
| 835 | |
| 836 | if( !th1Interp ) return; |
| 837 | /* Remove the Tcl integration commands. */ |
| 838 | for(i=0; i<count(aCommand); i++){ |
| 839 | Th_RenameCommand(th1Interp, aCommand[i].zName, -1, NULL, 0); |
| 840 | } |
| 841 | } |
| 842 | |
| 843 | /* |
| @@ -1261,11 +1261,11 @@ | |
| 1261 | void *pContext |
| 1262 | ){ |
| 1263 | int i; |
| 1264 | |
| 1265 | /* Add the Tcl integration commands to TH1. */ |
| 1266 | for(i=0; i<count(aCommand); i++){ |
| 1267 | void *ctx; |
| 1268 | if( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1269 | ctx = aCommand[i].pContext; |
| 1270 | /* Use Tcl interpreter for context? */ |
| 1271 | if( !ctx ) ctx = pContext; |
| 1272 |
+8
-16
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | "SELECT pid FROM plink" |
| 391 | 391 | " WHERE cid=:rid AND pid NOT IN phantom" |
| 392 | 392 | " ORDER BY isprim DESC /*sort*/" |
| 393 | 393 | ); |
| 394 | 394 | db_bind_int(&qparent, ":rid", rid); |
| 395 | - while( db_step(&qparent)==SQLITE_ROW && nParent<ArraySize(aParent) ){ | |
| 395 | + while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ | |
| 396 | 396 | aParent[nParent++] = db_column_int(&qparent, 0); |
| 397 | 397 | } |
| 398 | 398 | db_reset(&qparent); |
| 399 | 399 | gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr, |
| 400 | 400 | zUuid, isLeaf); |
| @@ -1186,11 +1186,11 @@ | ||
| 1186 | 1186 | } |
| 1187 | 1187 | if( g.perm.RdWiki ){ |
| 1188 | 1188 | az[i++] = "w"; |
| 1189 | 1189 | az[i++] = "Wiki"; |
| 1190 | 1190 | } |
| 1191 | - assert( i<=ArraySize(az) ); | |
| 1191 | + assert( i<=count(az) ); | |
| 1192 | 1192 | } |
| 1193 | 1193 | if( i>2 ){ |
| 1194 | 1194 | style_submenu_multichoice("y", i/2, az, isDisabled); |
| 1195 | 1195 | } |
| 1196 | 1196 | } |
| @@ -1476,12 +1476,11 @@ | ||
| 1476 | 1476 | blob_append(&sql, ")", -1); |
| 1477 | 1477 | path_reset(); |
| 1478 | 1478 | addFileGlobExclusion(zChng, &sql); |
| 1479 | 1479 | tmFlags |= TIMELINE_DISJOINT; |
| 1480 | 1480 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1481 | - style_submenu_binary("v","With Files","Without Files", | |
| 1482 | - zType[0]!='a' && zType[0]!='c'); | |
| 1481 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1483 | 1482 | blob_appendf(&desc, "%d check-ins going from ", |
| 1484 | 1483 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1485 | 1484 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1486 | 1485 | blob_append(&desc, " to ", -1); |
| 1487 | 1486 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1527,14 +1526,13 @@ | ||
| 1527 | 1526 | if( p_rid ){ |
| 1528 | 1527 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1529 | 1528 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1530 | 1529 | } |
| 1531 | 1530 | } |
| 1531 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1532 | 1532 | style_submenu_entry("n","Max:",4,0); |
| 1533 | 1533 | timeline_y_submenu(1); |
| 1534 | - style_submenu_binary("v","With Files","Without Files", | |
| 1535 | - zType[0]!='a' && zType[0]!='c'); | |
| 1536 | 1534 | }else if( f_rid && g.perm.Read ){ |
| 1537 | 1535 | /* If f= is present, ignore all other parameters other than n= */ |
| 1538 | 1536 | char *zUuid; |
| 1539 | 1537 | db_multi_exec( |
| 1540 | 1538 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1548,15 +1546,12 @@ | ||
| 1548 | 1546 | if( useDividers ) selectedRid = f_rid; |
| 1549 | 1547 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1550 | 1548 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1551 | 1549 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1552 | 1550 | tmFlags |= TIMELINE_DISJOINT; |
| 1553 | - style_submenu_binary("v","With Files","Without Files", | |
| 1554 | - zType[0]!='a' && zType[0]!='c'); | |
| 1555 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1556 | - timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 1557 | - } | |
| 1551 | + style_submenu_checkbox("unhide", "Unhide", 0); | |
| 1552 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1558 | 1553 | }else{ |
| 1559 | 1554 | /* Otherwise, a timeline based on a span of time */ |
| 1560 | 1555 | int n; |
| 1561 | 1556 | const char *zEType = "timeline item"; |
| 1562 | 1557 | char *zDate; |
| @@ -1821,18 +1816,15 @@ | ||
| 1821 | 1816 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 1822 | 1817 | } |
| 1823 | 1818 | free(zDate); |
| 1824 | 1819 | } |
| 1825 | 1820 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1826 | - if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1827 | - timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 1828 | - } | |
| 1821 | + style_submenu_checkbox("unhide", "Unhide", 0); | |
| 1829 | 1822 | } |
| 1823 | + style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); | |
| 1830 | 1824 | style_submenu_entry("n","Max:",4,0); |
| 1831 | 1825 | timeline_y_submenu(disableY); |
| 1832 | - style_submenu_binary("v","With Files","Without Files", | |
| 1833 | - zType[0]!='a' && zType[0]!='c'); | |
| 1834 | 1826 | } |
| 1835 | 1827 | blob_zero(&cond); |
| 1836 | 1828 | } |
| 1837 | 1829 | if( PB("showsql") ){ |
| 1838 | 1830 | @ <pre>%h(blob_sql_text(&sql))</pre> |
| 1839 | 1831 |
| --- 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 | } |
| @@ -1476,12 +1476,11 @@ | |
| 1476 | blob_append(&sql, ")", -1); |
| 1477 | path_reset(); |
| 1478 | addFileGlobExclusion(zChng, &sql); |
| 1479 | tmFlags |= TIMELINE_DISJOINT; |
| 1480 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1481 | style_submenu_binary("v","With Files","Without Files", |
| 1482 | zType[0]!='a' && zType[0]!='c'); |
| 1483 | blob_appendf(&desc, "%d check-ins going from ", |
| 1484 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1485 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1486 | blob_append(&desc, " to ", -1); |
| 1487 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1527,14 +1526,13 @@ | |
| 1527 | if( p_rid ){ |
| 1528 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1529 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1530 | } |
| 1531 | } |
| 1532 | style_submenu_entry("n","Max:",4,0); |
| 1533 | timeline_y_submenu(1); |
| 1534 | style_submenu_binary("v","With Files","Without Files", |
| 1535 | zType[0]!='a' && zType[0]!='c'); |
| 1536 | }else if( f_rid && g.perm.Read ){ |
| 1537 | /* If f= is present, ignore all other parameters other than n= */ |
| 1538 | char *zUuid; |
| 1539 | db_multi_exec( |
| 1540 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1548,15 +1546,12 @@ | |
| 1548 | if( useDividers ) selectedRid = f_rid; |
| 1549 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1550 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1551 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1552 | tmFlags |= TIMELINE_DISJOINT; |
| 1553 | style_submenu_binary("v","With Files","Without Files", |
| 1554 | zType[0]!='a' && zType[0]!='c'); |
| 1555 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1556 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1557 | } |
| 1558 | }else{ |
| 1559 | /* Otherwise, a timeline based on a span of time */ |
| 1560 | int n; |
| 1561 | const char *zEType = "timeline item"; |
| 1562 | char *zDate; |
| @@ -1821,18 +1816,15 @@ | |
| 1821 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 1822 | } |
| 1823 | free(zDate); |
| 1824 | } |
| 1825 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1826 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1827 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1828 | } |
| 1829 | } |
| 1830 | style_submenu_entry("n","Max:",4,0); |
| 1831 | timeline_y_submenu(disableY); |
| 1832 | style_submenu_binary("v","With Files","Without Files", |
| 1833 | zType[0]!='a' && zType[0]!='c'); |
| 1834 | } |
| 1835 | blob_zero(&cond); |
| 1836 | } |
| 1837 | if( PB("showsql") ){ |
| 1838 | @ <pre>%h(blob_sql_text(&sql))</pre> |
| 1839 |
| --- 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 | } |
| @@ -1476,12 +1476,11 @@ | |
| 1476 | blob_append(&sql, ")", -1); |
| 1477 | path_reset(); |
| 1478 | addFileGlobExclusion(zChng, &sql); |
| 1479 | tmFlags |= TIMELINE_DISJOINT; |
| 1480 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1481 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1482 | blob_appendf(&desc, "%d check-ins going from ", |
| 1483 | db_int(0, "SELECT count(*) FROM timeline")); |
| 1484 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom); |
| 1485 | blob_append(&desc, " to ", -1); |
| 1486 | blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo); |
| @@ -1527,14 +1526,13 @@ | |
| 1526 | if( p_rid ){ |
| 1527 | /* If both p= and d= are set, we don't have the uuid of d yet. */ |
| 1528 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid); |
| 1529 | } |
| 1530 | } |
| 1531 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1532 | style_submenu_entry("n","Max:",4,0); |
| 1533 | timeline_y_submenu(1); |
| 1534 | }else if( f_rid && g.perm.Read ){ |
| 1535 | /* If f= is present, ignore all other parameters other than n= */ |
| 1536 | char *zUuid; |
| 1537 | db_multi_exec( |
| 1538 | "CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);" |
| @@ -1548,15 +1546,12 @@ | |
| 1546 | if( useDividers ) selectedRid = f_rid; |
| 1547 | blob_appendf(&desc, "Parents and children of check-in "); |
| 1548 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid); |
| 1549 | blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid); |
| 1550 | tmFlags |= TIMELINE_DISJOINT; |
| 1551 | style_submenu_checkbox("unhide", "Unhide", 0); |
| 1552 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1553 | }else{ |
| 1554 | /* Otherwise, a timeline based on a span of time */ |
| 1555 | int n; |
| 1556 | const char *zEType = "timeline item"; |
| 1557 | char *zDate; |
| @@ -1821,18 +1816,15 @@ | |
| 1816 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| 1817 | } |
| 1818 | free(zDate); |
| 1819 | } |
| 1820 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1821 | style_submenu_checkbox("unhide", "Unhide", 0); |
| 1822 | } |
| 1823 | style_submenu_checkbox("v", "Files", zType[0]!='a' && zType[0]!='c'); |
| 1824 | style_submenu_entry("n","Max:",4,0); |
| 1825 | timeline_y_submenu(disableY); |
| 1826 | } |
| 1827 | blob_zero(&cond); |
| 1828 | } |
| 1829 | if( PB("showsql") ){ |
| 1830 | @ <pre>%h(blob_sql_text(&sql))</pre> |
| 1831 |
+3
-3
| --- src/unicode.c | ||
| +++ src/unicode.c | ||
| @@ -144,11 +144,11 @@ | ||
| 144 | 144 | if( (unsigned int)c<128 ){ |
| 145 | 145 | return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); |
| 146 | 146 | }else if( (unsigned int)c<(1<<22) ){ |
| 147 | 147 | unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; |
| 148 | 148 | int iRes = 0; |
| 149 | - int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; | |
| 149 | + int iHi = count(aEntry) - 1; | |
| 150 | 150 | int iLo = 0; |
| 151 | 151 | while( iHi>=iLo ){ |
| 152 | 152 | int iTest = (iHi + iLo) / 2; |
| 153 | 153 | if( key >= aEntry[iTest] ){ |
| 154 | 154 | iRes = iTest; |
| @@ -201,11 +201,11 @@ | ||
| 201 | 201 | 'e', 'i', 'o', 'u', 'y', |
| 202 | 202 | }; |
| 203 | 203 | |
| 204 | 204 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 205 | 205 | int iRes = 0; |
| 206 | - int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; | |
| 206 | + int iHi = count(aDia) - 1; | |
| 207 | 207 | int iLo = 0; |
| 208 | 208 | while( iHi>=iLo ){ |
| 209 | 209 | int iTest = (iHi + iLo) / 2; |
| 210 | 210 | if( key >= aDia[iTest] ){ |
| 211 | 211 | iRes = iTest; |
| @@ -348,11 +348,11 @@ | ||
| 348 | 348 | |
| 349 | 349 | if( c<128 ){ |
| 350 | 350 | if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
| 351 | 351 | }else if( c<65536 ){ |
| 352 | 352 | const struct TableEntry *p; |
| 353 | - int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; | |
| 353 | + int iHi = count(aEntry) - 1; | |
| 354 | 354 | int iLo = 0; |
| 355 | 355 | int iRes = -1; |
| 356 | 356 | |
| 357 | 357 | assert( c>aEntry[0].iCode ); |
| 358 | 358 | while( iHi>=iLo ){ |
| 359 | 359 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | if( (unsigned int)c<128 ){ |
| 145 | return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); |
| 146 | }else if( (unsigned int)c<(1<<22) ){ |
| 147 | unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; |
| 148 | int iRes = 0; |
| 149 | int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; |
| 150 | int iLo = 0; |
| 151 | while( iHi>=iLo ){ |
| 152 | int iTest = (iHi + iLo) / 2; |
| 153 | if( key >= aEntry[iTest] ){ |
| 154 | iRes = iTest; |
| @@ -201,11 +201,11 @@ | |
| 201 | 'e', 'i', 'o', 'u', 'y', |
| 202 | }; |
| 203 | |
| 204 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 205 | int iRes = 0; |
| 206 | int iHi = sizeof(aDia)/sizeof(aDia[0]) - 1; |
| 207 | int iLo = 0; |
| 208 | while( iHi>=iLo ){ |
| 209 | int iTest = (iHi + iLo) / 2; |
| 210 | if( key >= aDia[iTest] ){ |
| 211 | iRes = iTest; |
| @@ -348,11 +348,11 @@ | |
| 348 | |
| 349 | if( c<128 ){ |
| 350 | if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
| 351 | }else if( c<65536 ){ |
| 352 | const struct TableEntry *p; |
| 353 | int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1; |
| 354 | int iLo = 0; |
| 355 | int iRes = -1; |
| 356 | |
| 357 | assert( c>aEntry[0].iCode ); |
| 358 | while( iHi>=iLo ){ |
| 359 |
| --- src/unicode.c | |
| +++ src/unicode.c | |
| @@ -144,11 +144,11 @@ | |
| 144 | if( (unsigned int)c<128 ){ |
| 145 | return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 ); |
| 146 | }else if( (unsigned int)c<(1<<22) ){ |
| 147 | unsigned int key = (((unsigned int)c)<<10) | 0x000003FF; |
| 148 | int iRes = 0; |
| 149 | int iHi = count(aEntry) - 1; |
| 150 | int iLo = 0; |
| 151 | while( iHi>=iLo ){ |
| 152 | int iTest = (iHi + iLo) / 2; |
| 153 | if( key >= aEntry[iTest] ){ |
| 154 | iRes = iTest; |
| @@ -201,11 +201,11 @@ | |
| 201 | 'e', 'i', 'o', 'u', 'y', |
| 202 | }; |
| 203 | |
| 204 | unsigned int key = (((unsigned int)c)<<3) | 0x00000007; |
| 205 | int iRes = 0; |
| 206 | int iHi = count(aDia) - 1; |
| 207 | int iLo = 0; |
| 208 | while( iHi>=iLo ){ |
| 209 | int iTest = (iHi + iLo) / 2; |
| 210 | if( key >= aDia[iTest] ){ |
| 211 | iRes = iTest; |
| @@ -348,11 +348,11 @@ | |
| 348 | |
| 349 | if( c<128 ){ |
| 350 | if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
| 351 | }else if( c<65536 ){ |
| 352 | const struct TableEntry *p; |
| 353 | int iHi = count(aEntry) - 1; |
| 354 | int iLo = 0; |
| 355 | int iRes = -1; |
| 356 | |
| 357 | assert( c>aEntry[0].iCode ); |
| 358 | while( iHi>=iLo ){ |
| 359 |
+1
-1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -435,11 +435,11 @@ | ||
| 435 | 435 | for(; zName[0]!=0; zName++){ |
| 436 | 436 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 437 | 437 | return 1; |
| 438 | 438 | } |
| 439 | 439 | if( zName[0]!='-' ) continue; |
| 440 | - for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ | |
| 440 | + for(i=0; i<count(azTemp); i++){ | |
| 441 | 441 | n = (int)strlen(azTemp[i]); |
| 442 | 442 | if( memcmp(azTemp[i], zName+1, n) ) continue; |
| 443 | 443 | if( zName[n+1]==0 ) return 1; |
| 444 | 444 | if( zName[n+1]=='-' ){ |
| 445 | 445 | for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){} |
| 446 | 446 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -435,11 +435,11 @@ | |
| 435 | for(; zName[0]!=0; zName++){ |
| 436 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 437 | return 1; |
| 438 | } |
| 439 | if( zName[0]!='-' ) continue; |
| 440 | for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ |
| 441 | n = (int)strlen(azTemp[i]); |
| 442 | if( memcmp(azTemp[i], zName+1, n) ) continue; |
| 443 | if( zName[n+1]==0 ) return 1; |
| 444 | if( zName[n+1]=='-' ){ |
| 445 | for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){} |
| 446 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -435,11 +435,11 @@ | |
| 435 | for(; zName[0]!=0; zName++){ |
| 436 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 437 | return 1; |
| 438 | } |
| 439 | if( zName[0]!='-' ) continue; |
| 440 | for(i=0; i<count(azTemp); i++){ |
| 441 | n = (int)strlen(azTemp[i]); |
| 442 | if( memcmp(azTemp[i], zName+1, n) ) continue; |
| 443 | if( zName[n+1]==0 ) return 1; |
| 444 | if( zName[n+1]=='-' ){ |
| 445 | for(j=n+2; zName[j] && fossil_isdigit(zName[j]); j++){} |
| 446 |
+2
-2
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -138,11 +138,11 @@ | ||
| 138 | 138 | ** All others become "text/x-fossil-wiki" |
| 139 | 139 | */ |
| 140 | 140 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 141 | 141 | if( zMimetype!=0 ){ |
| 142 | 142 | int i; |
| 143 | - for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ | |
| 143 | + for(i=0; i<count(azStyles); i+=3){ | |
| 144 | 144 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 145 | 145 | return azStyles[i]; |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| @@ -428,11 +428,11 @@ | ||
| 428 | 428 | ** wiki mimetype. |
| 429 | 429 | */ |
| 430 | 430 | void mimetype_option_menu(const char *zMimetype){ |
| 431 | 431 | unsigned i; |
| 432 | 432 | @ <select name="mimetype" size="1"> |
| 433 | - for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ | |
| 433 | + for(i=0; i<count(azStyles); i+=3){ | |
| 434 | 434 | if( fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 435 | 435 | @ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option> |
| 436 | 436 | }else{ |
| 437 | 437 | @ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option> |
| 438 | 438 | } |
| 439 | 439 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | ** All others become "text/x-fossil-wiki" |
| 139 | */ |
| 140 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 141 | if( zMimetype!=0 ){ |
| 142 | int i; |
| 143 | for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ |
| 144 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 145 | return azStyles[i]; |
| 146 | } |
| 147 | } |
| 148 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| @@ -428,11 +428,11 @@ | |
| 428 | ** wiki mimetype. |
| 429 | */ |
| 430 | void mimetype_option_menu(const char *zMimetype){ |
| 431 | unsigned i; |
| 432 | @ <select name="mimetype" size="1"> |
| 433 | for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){ |
| 434 | if( fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 435 | @ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option> |
| 436 | }else{ |
| 437 | @ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option> |
| 438 | } |
| 439 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -138,11 +138,11 @@ | |
| 138 | ** All others become "text/x-fossil-wiki" |
| 139 | */ |
| 140 | const char *wiki_filter_mimetypes(const char *zMimetype){ |
| 141 | if( zMimetype!=0 ){ |
| 142 | int i; |
| 143 | for(i=0; i<count(azStyles); i+=3){ |
| 144 | if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){ |
| 145 | return azStyles[i]; |
| 146 | } |
| 147 | } |
| 148 | if( fossil_strcmp(zMimetype, "text/x-markdown")==0 |
| @@ -428,11 +428,11 @@ | |
| 428 | ** wiki mimetype. |
| 429 | */ |
| 430 | void mimetype_option_menu(const char *zMimetype){ |
| 431 | unsigned i; |
| 432 | @ <select name="mimetype" size="1"> |
| 433 | for(i=0; i<count(azStyles); i+=3){ |
| 434 | if( fossil_strcmp(zMimetype,azStyles[i])==0 ){ |
| 435 | @ <option value="%s(azStyles[i])" selected>%s(azStyles[i+1])</option> |
| 436 | }else{ |
| 437 | @ <option value="%s(azStyles[i])">%s(azStyles[i+1])</option> |
| 438 | } |
| 439 |
+4
-4
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -145,11 +145,11 @@ | ||
| 145 | 145 | ** Use binary search to locate a tag in the aAttribute[] table. |
| 146 | 146 | */ |
| 147 | 147 | static int findAttr(const char *z){ |
| 148 | 148 | int i, c, first, last; |
| 149 | 149 | first = 1; |
| 150 | - last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1; | |
| 150 | + last = count(aAttribute) - 1; | |
| 151 | 151 | while( first<=last ){ |
| 152 | 152 | i = (first+last)/2; |
| 153 | 153 | c = fossil_strcmp(aAttribute[i].zName, z); |
| 154 | 154 | if( c==0 ){ |
| 155 | 155 | return i; |
| @@ -372,11 +372,11 @@ | ||
| 372 | 372 | AMSK_ID|AMSK_TYPE }, |
| 373 | 373 | }; |
| 374 | 374 | |
| 375 | 375 | void show_allowed_wiki_markup( void ){ |
| 376 | 376 | int i; /* loop over allowedAttr */ |
| 377 | - for( i=1 ; i<=sizeof(aMarkup)/sizeof(aMarkup[0]) - 1 ; i++ ){ | |
| 377 | + for( i=1 ; i<=count(aMarkup) - 1 ; i++ ){ | |
| 378 | 378 | @ <%s(aMarkup[i].zName)> |
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | /* |
| @@ -383,11 +383,11 @@ | ||
| 383 | 383 | ** Use binary search to locate a tag in the aMarkup[] table. |
| 384 | 384 | */ |
| 385 | 385 | static int findTag(const char *z){ |
| 386 | 386 | int i, c, first, last; |
| 387 | 387 | first = 1; |
| 388 | - last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1; | |
| 388 | + last = count(aMarkup) - 1; | |
| 389 | 389 | while( first<=last ){ |
| 390 | 390 | i = (first+last)/2; |
| 391 | 391 | c = fossil_strcmp(aMarkup[i].zName, z); |
| 392 | 392 | if( c==0 ){ |
| 393 | 393 | assert( aMarkup[i].iCode==i ); |
| @@ -2187,11 +2187,11 @@ | ||
| 2187 | 2187 | { 4, '<', "<" }, |
| 2188 | 2188 | { 4, '>', ">" }, |
| 2189 | 2189 | { 6, ' ', " " }, |
| 2190 | 2190 | }; |
| 2191 | 2191 | int jj; |
| 2192 | - for(jj=0; jj<ArraySize(aEntity); jj++){ | |
| 2192 | + for(jj=0; jj<count(aEntity); jj++){ | |
| 2193 | 2193 | if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){ |
| 2194 | 2194 | c = aEntity[jj].c; |
| 2195 | 2195 | break; |
| 2196 | 2196 | } |
| 2197 | 2197 | } |
| 2198 | 2198 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -145,11 +145,11 @@ | |
| 145 | ** Use binary search to locate a tag in the aAttribute[] table. |
| 146 | */ |
| 147 | static int findAttr(const char *z){ |
| 148 | int i, c, first, last; |
| 149 | first = 1; |
| 150 | last = sizeof(aAttribute)/sizeof(aAttribute[0]) - 1; |
| 151 | while( first<=last ){ |
| 152 | i = (first+last)/2; |
| 153 | c = fossil_strcmp(aAttribute[i].zName, z); |
| 154 | if( c==0 ){ |
| 155 | return i; |
| @@ -372,11 +372,11 @@ | |
| 372 | AMSK_ID|AMSK_TYPE }, |
| 373 | }; |
| 374 | |
| 375 | void show_allowed_wiki_markup( void ){ |
| 376 | int i; /* loop over allowedAttr */ |
| 377 | for( i=1 ; i<=sizeof(aMarkup)/sizeof(aMarkup[0]) - 1 ; i++ ){ |
| 378 | @ <%s(aMarkup[i].zName)> |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /* |
| @@ -383,11 +383,11 @@ | |
| 383 | ** Use binary search to locate a tag in the aMarkup[] table. |
| 384 | */ |
| 385 | static int findTag(const char *z){ |
| 386 | int i, c, first, last; |
| 387 | first = 1; |
| 388 | last = sizeof(aMarkup)/sizeof(aMarkup[0]) - 1; |
| 389 | while( first<=last ){ |
| 390 | i = (first+last)/2; |
| 391 | c = fossil_strcmp(aMarkup[i].zName, z); |
| 392 | if( c==0 ){ |
| 393 | assert( aMarkup[i].iCode==i ); |
| @@ -2187,11 +2187,11 @@ | |
| 2187 | { 4, '<', "<" }, |
| 2188 | { 4, '>', ">" }, |
| 2189 | { 6, ' ', " " }, |
| 2190 | }; |
| 2191 | int jj; |
| 2192 | for(jj=0; jj<ArraySize(aEntity); jj++){ |
| 2193 | if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){ |
| 2194 | c = aEntity[jj].c; |
| 2195 | break; |
| 2196 | } |
| 2197 | } |
| 2198 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -145,11 +145,11 @@ | |
| 145 | ** Use binary search to locate a tag in the aAttribute[] table. |
| 146 | */ |
| 147 | static int findAttr(const char *z){ |
| 148 | int i, c, first, last; |
| 149 | first = 1; |
| 150 | last = count(aAttribute) - 1; |
| 151 | while( first<=last ){ |
| 152 | i = (first+last)/2; |
| 153 | c = fossil_strcmp(aAttribute[i].zName, z); |
| 154 | if( c==0 ){ |
| 155 | return i; |
| @@ -372,11 +372,11 @@ | |
| 372 | AMSK_ID|AMSK_TYPE }, |
| 373 | }; |
| 374 | |
| 375 | void show_allowed_wiki_markup( void ){ |
| 376 | int i; /* loop over allowedAttr */ |
| 377 | for( i=1 ; i<=count(aMarkup) - 1 ; i++ ){ |
| 378 | @ <%s(aMarkup[i].zName)> |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /* |
| @@ -383,11 +383,11 @@ | |
| 383 | ** Use binary search to locate a tag in the aMarkup[] table. |
| 384 | */ |
| 385 | static int findTag(const char *z){ |
| 386 | int i, c, first, last; |
| 387 | first = 1; |
| 388 | last = count(aMarkup) - 1; |
| 389 | while( first<=last ){ |
| 390 | i = (first+last)/2; |
| 391 | c = fossil_strcmp(aMarkup[i].zName, z); |
| 392 | if( c==0 ){ |
| 393 | assert( aMarkup[i].iCode==i ); |
| @@ -2187,11 +2187,11 @@ | |
| 2187 | { 4, '<', "<" }, |
| 2188 | { 4, '>', ">" }, |
| 2189 | { 6, ' ', " " }, |
| 2190 | }; |
| 2191 | int jj; |
| 2192 | for(jj=0; jj<count(aEntity); jj++){ |
| 2193 | if( aEntity[jj].n==n && strncmp(aEntity[jj].z,zIn,n)==0 ){ |
| 2194 | c = aEntity[jj].c; |
| 2195 | break; |
| 2196 | } |
| 2197 | } |
| 2198 |