Fossil SCM
Merge updates from trunk.
Commit
591bc4434b4bf7068df57396e9b937a71a05deb6
Parent
4e3f915c00e06b6…
4 files changed
+1
-1
+2
+9
-9
+9
-9
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -30,14 +30,14 @@ | ||
| 30 | 30 | #if defined(_WIN32) |
| 31 | 31 | # include <windows.h> |
| 32 | 32 | #else |
| 33 | 33 | # include <errno.h> /* errno global */ |
| 34 | 34 | #endif |
| 35 | -#include "zlib.h" | |
| 36 | 35 | #ifdef FOSSIL_ENABLE_SSL |
| 37 | 36 | # include "openssl/crypto.h" |
| 38 | 37 | #endif |
| 38 | +#include "zlib.h" | |
| 39 | 39 | #if INTERFACE |
| 40 | 40 | #ifdef FOSSIL_ENABLE_TCL |
| 41 | 41 | # include "tcl.h" |
| 42 | 42 | #endif |
| 43 | 43 | #ifdef FOSSIL_ENABLE_JSON |
| 44 | 44 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -30,14 +30,14 @@ | |
| 30 | #if defined(_WIN32) |
| 31 | # include <windows.h> |
| 32 | #else |
| 33 | # include <errno.h> /* errno global */ |
| 34 | #endif |
| 35 | #include "zlib.h" |
| 36 | #ifdef FOSSIL_ENABLE_SSL |
| 37 | # include "openssl/crypto.h" |
| 38 | #endif |
| 39 | #if INTERFACE |
| 40 | #ifdef FOSSIL_ENABLE_TCL |
| 41 | # include "tcl.h" |
| 42 | #endif |
| 43 | #ifdef FOSSIL_ENABLE_JSON |
| 44 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -30,14 +30,14 @@ | |
| 30 | #if defined(_WIN32) |
| 31 | # include <windows.h> |
| 32 | #else |
| 33 | # include <errno.h> /* errno global */ |
| 34 | #endif |
| 35 | #ifdef FOSSIL_ENABLE_SSL |
| 36 | # include "openssl/crypto.h" |
| 37 | #endif |
| 38 | #include "zlib.h" |
| 39 | #if INTERFACE |
| 40 | #ifdef FOSSIL_ENABLE_TCL |
| 41 | # include "tcl.h" |
| 42 | #endif |
| 43 | #ifdef FOSSIL_ENABLE_JSON |
| 44 |
+2
| --- src/rss.c | ||
| +++ src/rss.c | ||
| @@ -204,10 +204,12 @@ | ||
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /* |
| 208 | 208 | ** COMMAND: rss |
| 209 | +** | |
| 210 | +** Usage: %fossil rss ?OPTIONS? | |
| 209 | 211 | ** |
| 210 | 212 | ** The CLI variant of the /timeline.rss page, this produces an RSS |
| 211 | 213 | ** feed of the timeline to stdout. Options: |
| 212 | 214 | ** |
| 213 | 215 | ** -type|y FLAG |
| 214 | 216 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -204,10 +204,12 @@ | |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | /* |
| 208 | ** COMMAND: rss |
| 209 | ** |
| 210 | ** The CLI variant of the /timeline.rss page, this produces an RSS |
| 211 | ** feed of the timeline to stdout. Options: |
| 212 | ** |
| 213 | ** -type|y FLAG |
| 214 |
| --- src/rss.c | |
| +++ src/rss.c | |
| @@ -204,10 +204,12 @@ | |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | /* |
| 208 | ** COMMAND: rss |
| 209 | ** |
| 210 | ** Usage: %fossil rss ?OPTIONS? |
| 211 | ** |
| 212 | ** The CLI variant of the /timeline.rss page, this produces an RSS |
| 213 | ** feed of the timeline to stdout. Options: |
| 214 | ** |
| 215 | ** -type|y FLAG |
| 216 |
+9
-9
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1972,11 +1972,11 @@ | ||
| 1972 | 1972 | |
| 1973 | 1973 | /* |
| 1974 | 1974 | ** Set by stats_report_init_view() to one of the y=XXXX values |
| 1975 | 1975 | ** accepted by /timeline?y=XXXX. |
| 1976 | 1976 | */ |
| 1977 | -static char const * statsReportTimelineYFlag = NULL; | |
| 1977 | +static const char * statsReportTimelineYFlag = NULL; | |
| 1978 | 1978 | |
| 1979 | 1979 | /* |
| 1980 | 1980 | ** Creates a TEMP VIEW named v_reports which is a wrapper around the |
| 1981 | 1981 | ** EVENT table filtered on event.type. It looks for the request |
| 1982 | 1982 | ** parameter 'type' (reminder: we "should" use 'y' for consistency |
| @@ -1993,12 +1993,12 @@ | ||
| 1993 | 1993 | ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of |
| 1994 | 1994 | ** filter it applies, or '*' if no filter is applied (i.e. if "all" is |
| 1995 | 1995 | ** used). |
| 1996 | 1996 | */ |
| 1997 | 1997 | static int stats_report_init_view(){ |
| 1998 | - char const * zType = PD("type","*"); /* analog to /timeline?y=... */ | |
| 1999 | - char const * zRealType = NULL; /* normalized form of zType */ | |
| 1998 | + const char * zType = PD("type","*"); /* analog to /timeline?y=... */ | |
| 1999 | + const char * zRealType = NULL; /* normalized form of zType */ | |
| 2000 | 2000 | int rc = 0; /* result code */ |
| 2001 | 2001 | assert( !statsReportType && "Must not be called more than once." ); |
| 2002 | 2002 | switch( (zType && *zType) ? *zType : 0 ){ |
| 2003 | 2003 | case 'c': |
| 2004 | 2004 | case 'C': |
| @@ -2047,11 +2047,11 @@ | ||
| 2047 | 2047 | ** Returns a string suitable (for a given value of suitable) for |
| 2048 | 2048 | ** use in a label with the header of the /reports pages, dependent |
| 2049 | 2049 | ** on the 'type' flag. See stats_report_init_view(). |
| 2050 | 2050 | ** The returned bytes are static. |
| 2051 | 2051 | */ |
| 2052 | -static char const * stats_report_label_for_type(){ | |
| 2052 | +static const char * stats_report_label_for_type(){ | |
| 2053 | 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | 2054 | switch( statsReportType ){ |
| 2055 | 2055 | case 'c': |
| 2056 | 2056 | return "checkins"; |
| 2057 | 2057 | case 'w': |
| @@ -2072,12 +2072,12 @@ | ||
| 2072 | 2072 | ** time this is called. e.g. if called from the 'byuser' view then |
| 2073 | 2073 | ** zCurrentViewName must be "byuser". Any URL parameters which need to |
| 2074 | 2074 | ** be added to the generated URLs should be passed in zParam. The |
| 2075 | 2075 | ** caller is expected to have already encoded any zParam in the %T or |
| 2076 | 2076 | ** %t encoding. */ |
| 2077 | -static void stats_report_event_types_menu(char const * zCurrentViewName, | |
| 2078 | - char const * zParam){ | |
| 2077 | +static void stats_report_event_types_menu(const char * zCurrentViewName, | |
| 2078 | + const char * zParam){ | |
| 2079 | 2079 | char * zTop; |
| 2080 | 2080 | if(zParam && !*zParam){ |
| 2081 | 2081 | zParam = NULL; |
| 2082 | 2082 | } |
| 2083 | 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| @@ -2297,11 +2297,11 @@ | ||
| 2297 | 2297 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2298 | 2298 | @</tr> |
| 2299 | 2299 | } |
| 2300 | 2300 | @ </tbody></table> |
| 2301 | 2301 | if(nEventTotal){ |
| 2302 | - char const * zAvgLabel = includeMonth ? "month" : "year"; | |
| 2302 | + const char * zAvgLabel = includeMonth ? "month" : "year"; | |
| 2303 | 2303 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2304 | 2304 | @ <br><div>Total events: %d(nEventTotal) |
| 2305 | 2305 | @ <br>Average per active %s(zAvgLabel): %d(nAvg) |
| 2306 | 2306 | @ </div> |
| 2307 | 2307 | } |
| @@ -2387,15 +2387,15 @@ | ||
| 2387 | 2387 | int rowClass = 0; /* counter for alternating |
| 2388 | 2388 | row colors */ |
| 2389 | 2389 | Blob sql = empty_blob; /* SQL */ |
| 2390 | 2390 | int nMaxEvents = 1; /* max number of events for |
| 2391 | 2391 | all rows. */ |
| 2392 | - static char const * daysOfWeek[] = { | |
| 2392 | + static const char * const daysOfWeek[] = { | |
| 2393 | 2393 | "Monday", "Tuesday", "Wednesday", "Thursday", |
| 2394 | 2394 | "Friday", "Saturday", "Sunday" |
| 2395 | 2395 | }; |
| 2396 | - | |
| 2396 | + | |
| 2397 | 2397 | stats_report_init_view(); |
| 2398 | 2398 | stats_report_event_types_menu("byweekday", NULL); |
| 2399 | 2399 | blob_append(&sql, |
| 2400 | 2400 | "SELECT cast(mtime %% 7 AS INTEGER) dow, " |
| 2401 | 2401 | "COUNT(*) AS eventCount " |
| 2402 | 2402 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1972,11 +1972,11 @@ | |
| 1972 | |
| 1973 | /* |
| 1974 | ** Set by stats_report_init_view() to one of the y=XXXX values |
| 1975 | ** accepted by /timeline?y=XXXX. |
| 1976 | */ |
| 1977 | static char const * statsReportTimelineYFlag = NULL; |
| 1978 | |
| 1979 | /* |
| 1980 | ** Creates a TEMP VIEW named v_reports which is a wrapper around the |
| 1981 | ** EVENT table filtered on event.type. It looks for the request |
| 1982 | ** parameter 'type' (reminder: we "should" use 'y' for consistency |
| @@ -1993,12 +1993,12 @@ | |
| 1993 | ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of |
| 1994 | ** filter it applies, or '*' if no filter is applied (i.e. if "all" is |
| 1995 | ** used). |
| 1996 | */ |
| 1997 | static int stats_report_init_view(){ |
| 1998 | char const * zType = PD("type","*"); /* analog to /timeline?y=... */ |
| 1999 | char const * zRealType = NULL; /* normalized form of zType */ |
| 2000 | int rc = 0; /* result code */ |
| 2001 | assert( !statsReportType && "Must not be called more than once." ); |
| 2002 | switch( (zType && *zType) ? *zType : 0 ){ |
| 2003 | case 'c': |
| 2004 | case 'C': |
| @@ -2047,11 +2047,11 @@ | |
| 2047 | ** Returns a string suitable (for a given value of suitable) for |
| 2048 | ** use in a label with the header of the /reports pages, dependent |
| 2049 | ** on the 'type' flag. See stats_report_init_view(). |
| 2050 | ** The returned bytes are static. |
| 2051 | */ |
| 2052 | static char const * stats_report_label_for_type(){ |
| 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | switch( statsReportType ){ |
| 2055 | case 'c': |
| 2056 | return "checkins"; |
| 2057 | case 'w': |
| @@ -2072,12 +2072,12 @@ | |
| 2072 | ** time this is called. e.g. if called from the 'byuser' view then |
| 2073 | ** zCurrentViewName must be "byuser". Any URL parameters which need to |
| 2074 | ** be added to the generated URLs should be passed in zParam. The |
| 2075 | ** caller is expected to have already encoded any zParam in the %T or |
| 2076 | ** %t encoding. */ |
| 2077 | static void stats_report_event_types_menu(char const * zCurrentViewName, |
| 2078 | char const * zParam){ |
| 2079 | char * zTop; |
| 2080 | if(zParam && !*zParam){ |
| 2081 | zParam = NULL; |
| 2082 | } |
| 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| @@ -2297,11 +2297,11 @@ | |
| 2297 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2298 | @</tr> |
| 2299 | } |
| 2300 | @ </tbody></table> |
| 2301 | if(nEventTotal){ |
| 2302 | char const * zAvgLabel = includeMonth ? "month" : "year"; |
| 2303 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2304 | @ <br><div>Total events: %d(nEventTotal) |
| 2305 | @ <br>Average per active %s(zAvgLabel): %d(nAvg) |
| 2306 | @ </div> |
| 2307 | } |
| @@ -2387,15 +2387,15 @@ | |
| 2387 | int rowClass = 0; /* counter for alternating |
| 2388 | row colors */ |
| 2389 | Blob sql = empty_blob; /* SQL */ |
| 2390 | int nMaxEvents = 1; /* max number of events for |
| 2391 | all rows. */ |
| 2392 | static char const * daysOfWeek[] = { |
| 2393 | "Monday", "Tuesday", "Wednesday", "Thursday", |
| 2394 | "Friday", "Saturday", "Sunday" |
| 2395 | }; |
| 2396 | |
| 2397 | stats_report_init_view(); |
| 2398 | stats_report_event_types_menu("byweekday", NULL); |
| 2399 | blob_append(&sql, |
| 2400 | "SELECT cast(mtime %% 7 AS INTEGER) dow, " |
| 2401 | "COUNT(*) AS eventCount " |
| 2402 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1972,11 +1972,11 @@ | |
| 1972 | |
| 1973 | /* |
| 1974 | ** Set by stats_report_init_view() to one of the y=XXXX values |
| 1975 | ** accepted by /timeline?y=XXXX. |
| 1976 | */ |
| 1977 | static const char * statsReportTimelineYFlag = NULL; |
| 1978 | |
| 1979 | /* |
| 1980 | ** Creates a TEMP VIEW named v_reports which is a wrapper around the |
| 1981 | ** EVENT table filtered on event.type. It looks for the request |
| 1982 | ** parameter 'type' (reminder: we "should" use 'y' for consistency |
| @@ -1993,12 +1993,12 @@ | |
| 1993 | ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of |
| 1994 | ** filter it applies, or '*' if no filter is applied (i.e. if "all" is |
| 1995 | ** used). |
| 1996 | */ |
| 1997 | static int stats_report_init_view(){ |
| 1998 | const char * zType = PD("type","*"); /* analog to /timeline?y=... */ |
| 1999 | const char * zRealType = NULL; /* normalized form of zType */ |
| 2000 | int rc = 0; /* result code */ |
| 2001 | assert( !statsReportType && "Must not be called more than once." ); |
| 2002 | switch( (zType && *zType) ? *zType : 0 ){ |
| 2003 | case 'c': |
| 2004 | case 'C': |
| @@ -2047,11 +2047,11 @@ | |
| 2047 | ** Returns a string suitable (for a given value of suitable) for |
| 2048 | ** use in a label with the header of the /reports pages, dependent |
| 2049 | ** on the 'type' flag. See stats_report_init_view(). |
| 2050 | ** The returned bytes are static. |
| 2051 | */ |
| 2052 | static const char * stats_report_label_for_type(){ |
| 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | switch( statsReportType ){ |
| 2055 | case 'c': |
| 2056 | return "checkins"; |
| 2057 | case 'w': |
| @@ -2072,12 +2072,12 @@ | |
| 2072 | ** time this is called. e.g. if called from the 'byuser' view then |
| 2073 | ** zCurrentViewName must be "byuser". Any URL parameters which need to |
| 2074 | ** be added to the generated URLs should be passed in zParam. The |
| 2075 | ** caller is expected to have already encoded any zParam in the %T or |
| 2076 | ** %t encoding. */ |
| 2077 | static void stats_report_event_types_menu(const char * zCurrentViewName, |
| 2078 | const char * zParam){ |
| 2079 | char * zTop; |
| 2080 | if(zParam && !*zParam){ |
| 2081 | zParam = NULL; |
| 2082 | } |
| 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| @@ -2297,11 +2297,11 @@ | |
| 2297 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2298 | @</tr> |
| 2299 | } |
| 2300 | @ </tbody></table> |
| 2301 | if(nEventTotal){ |
| 2302 | const char * zAvgLabel = includeMonth ? "month" : "year"; |
| 2303 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2304 | @ <br><div>Total events: %d(nEventTotal) |
| 2305 | @ <br>Average per active %s(zAvgLabel): %d(nAvg) |
| 2306 | @ </div> |
| 2307 | } |
| @@ -2387,15 +2387,15 @@ | |
| 2387 | int rowClass = 0; /* counter for alternating |
| 2388 | row colors */ |
| 2389 | Blob sql = empty_blob; /* SQL */ |
| 2390 | int nMaxEvents = 1; /* max number of events for |
| 2391 | all rows. */ |
| 2392 | static const char * const daysOfWeek[] = { |
| 2393 | "Monday", "Tuesday", "Wednesday", "Thursday", |
| 2394 | "Friday", "Saturday", "Sunday" |
| 2395 | }; |
| 2396 | |
| 2397 | stats_report_init_view(); |
| 2398 | stats_report_event_types_menu("byweekday", NULL); |
| 2399 | blob_append(&sql, |
| 2400 | "SELECT cast(mtime %% 7 AS INTEGER) dow, " |
| 2401 | "COUNT(*) AS eventCount " |
| 2402 |
+9
-9
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1972,11 +1972,11 @@ | ||
| 1972 | 1972 | |
| 1973 | 1973 | /* |
| 1974 | 1974 | ** Set by stats_report_init_view() to one of the y=XXXX values |
| 1975 | 1975 | ** accepted by /timeline?y=XXXX. |
| 1976 | 1976 | */ |
| 1977 | -static char const * statsReportTimelineYFlag = NULL; | |
| 1977 | +static const char * statsReportTimelineYFlag = NULL; | |
| 1978 | 1978 | |
| 1979 | 1979 | /* |
| 1980 | 1980 | ** Creates a TEMP VIEW named v_reports which is a wrapper around the |
| 1981 | 1981 | ** EVENT table filtered on event.type. It looks for the request |
| 1982 | 1982 | ** parameter 'type' (reminder: we "should" use 'y' for consistency |
| @@ -1993,12 +1993,12 @@ | ||
| 1993 | 1993 | ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of |
| 1994 | 1994 | ** filter it applies, or '*' if no filter is applied (i.e. if "all" is |
| 1995 | 1995 | ** used). |
| 1996 | 1996 | */ |
| 1997 | 1997 | static int stats_report_init_view(){ |
| 1998 | - char const * zType = PD("type","*"); /* analog to /timeline?y=... */ | |
| 1999 | - char const * zRealType = NULL; /* normalized form of zType */ | |
| 1998 | + const char * zType = PD("type","*"); /* analog to /timeline?y=... */ | |
| 1999 | + const char * zRealType = NULL; /* normalized form of zType */ | |
| 2000 | 2000 | int rc = 0; /* result code */ |
| 2001 | 2001 | assert( !statsReportType && "Must not be called more than once." ); |
| 2002 | 2002 | switch( (zType && *zType) ? *zType : 0 ){ |
| 2003 | 2003 | case 'c': |
| 2004 | 2004 | case 'C': |
| @@ -2047,11 +2047,11 @@ | ||
| 2047 | 2047 | ** Returns a string suitable (for a given value of suitable) for |
| 2048 | 2048 | ** use in a label with the header of the /reports pages, dependent |
| 2049 | 2049 | ** on the 'type' flag. See stats_report_init_view(). |
| 2050 | 2050 | ** The returned bytes are static. |
| 2051 | 2051 | */ |
| 2052 | -static char const * stats_report_label_for_type(){ | |
| 2052 | +static const char * stats_report_label_for_type(){ | |
| 2053 | 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | 2054 | switch( statsReportType ){ |
| 2055 | 2055 | case 'c': |
| 2056 | 2056 | return "checkins"; |
| 2057 | 2057 | case 'w': |
| @@ -2072,12 +2072,12 @@ | ||
| 2072 | 2072 | ** time this is called. e.g. if called from the 'byuser' view then |
| 2073 | 2073 | ** zCurrentViewName must be "byuser". Any URL parameters which need to |
| 2074 | 2074 | ** be added to the generated URLs should be passed in zParam. The |
| 2075 | 2075 | ** caller is expected to have already encoded any zParam in the %T or |
| 2076 | 2076 | ** %t encoding. */ |
| 2077 | -static void stats_report_event_types_menu(char const * zCurrentViewName, | |
| 2078 | - char const * zParam){ | |
| 2077 | +static void stats_report_event_types_menu(const char * zCurrentViewName, | |
| 2078 | + const char * zParam){ | |
| 2079 | 2079 | char * zTop; |
| 2080 | 2080 | if(zParam && !*zParam){ |
| 2081 | 2081 | zParam = NULL; |
| 2082 | 2082 | } |
| 2083 | 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| @@ -2297,11 +2297,11 @@ | ||
| 2297 | 2297 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2298 | 2298 | @</tr> |
| 2299 | 2299 | } |
| 2300 | 2300 | @ </tbody></table> |
| 2301 | 2301 | if(nEventTotal){ |
| 2302 | - char const * zAvgLabel = includeMonth ? "month" : "year"; | |
| 2302 | + const char * zAvgLabel = includeMonth ? "month" : "year"; | |
| 2303 | 2303 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2304 | 2304 | @ <br><div>Total events: %d(nEventTotal) |
| 2305 | 2305 | @ <br>Average per active %s(zAvgLabel): %d(nAvg) |
| 2306 | 2306 | @ </div> |
| 2307 | 2307 | } |
| @@ -2387,15 +2387,15 @@ | ||
| 2387 | 2387 | int rowClass = 0; /* counter for alternating |
| 2388 | 2388 | row colors */ |
| 2389 | 2389 | Blob sql = empty_blob; /* SQL */ |
| 2390 | 2390 | int nMaxEvents = 1; /* max number of events for |
| 2391 | 2391 | all rows. */ |
| 2392 | - static char const * daysOfWeek[] = { | |
| 2392 | + static const char * const daysOfWeek[] = { | |
| 2393 | 2393 | "Monday", "Tuesday", "Wednesday", "Thursday", |
| 2394 | 2394 | "Friday", "Saturday", "Sunday" |
| 2395 | 2395 | }; |
| 2396 | - | |
| 2396 | + | |
| 2397 | 2397 | stats_report_init_view(); |
| 2398 | 2398 | stats_report_event_types_menu("byweekday", NULL); |
| 2399 | 2399 | blob_append(&sql, |
| 2400 | 2400 | "SELECT cast(mtime %% 7 AS INTEGER) dow, " |
| 2401 | 2401 | "COUNT(*) AS eventCount " |
| 2402 | 2402 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1972,11 +1972,11 @@ | |
| 1972 | |
| 1973 | /* |
| 1974 | ** Set by stats_report_init_view() to one of the y=XXXX values |
| 1975 | ** accepted by /timeline?y=XXXX. |
| 1976 | */ |
| 1977 | static char const * statsReportTimelineYFlag = NULL; |
| 1978 | |
| 1979 | /* |
| 1980 | ** Creates a TEMP VIEW named v_reports which is a wrapper around the |
| 1981 | ** EVENT table filtered on event.type. It looks for the request |
| 1982 | ** parameter 'type' (reminder: we "should" use 'y' for consistency |
| @@ -1993,12 +1993,12 @@ | |
| 1993 | ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of |
| 1994 | ** filter it applies, or '*' if no filter is applied (i.e. if "all" is |
| 1995 | ** used). |
| 1996 | */ |
| 1997 | static int stats_report_init_view(){ |
| 1998 | char const * zType = PD("type","*"); /* analog to /timeline?y=... */ |
| 1999 | char const * zRealType = NULL; /* normalized form of zType */ |
| 2000 | int rc = 0; /* result code */ |
| 2001 | assert( !statsReportType && "Must not be called more than once." ); |
| 2002 | switch( (zType && *zType) ? *zType : 0 ){ |
| 2003 | case 'c': |
| 2004 | case 'C': |
| @@ -2047,11 +2047,11 @@ | |
| 2047 | ** Returns a string suitable (for a given value of suitable) for |
| 2048 | ** use in a label with the header of the /reports pages, dependent |
| 2049 | ** on the 'type' flag. See stats_report_init_view(). |
| 2050 | ** The returned bytes are static. |
| 2051 | */ |
| 2052 | static char const * stats_report_label_for_type(){ |
| 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | switch( statsReportType ){ |
| 2055 | case 'c': |
| 2056 | return "checkins"; |
| 2057 | case 'w': |
| @@ -2072,12 +2072,12 @@ | |
| 2072 | ** time this is called. e.g. if called from the 'byuser' view then |
| 2073 | ** zCurrentViewName must be "byuser". Any URL parameters which need to |
| 2074 | ** be added to the generated URLs should be passed in zParam. The |
| 2075 | ** caller is expected to have already encoded any zParam in the %T or |
| 2076 | ** %t encoding. */ |
| 2077 | static void stats_report_event_types_menu(char const * zCurrentViewName, |
| 2078 | char const * zParam){ |
| 2079 | char * zTop; |
| 2080 | if(zParam && !*zParam){ |
| 2081 | zParam = NULL; |
| 2082 | } |
| 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| @@ -2297,11 +2297,11 @@ | |
| 2297 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2298 | @</tr> |
| 2299 | } |
| 2300 | @ </tbody></table> |
| 2301 | if(nEventTotal){ |
| 2302 | char const * zAvgLabel = includeMonth ? "month" : "year"; |
| 2303 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2304 | @ <br><div>Total events: %d(nEventTotal) |
| 2305 | @ <br>Average per active %s(zAvgLabel): %d(nAvg) |
| 2306 | @ </div> |
| 2307 | } |
| @@ -2387,15 +2387,15 @@ | |
| 2387 | int rowClass = 0; /* counter for alternating |
| 2388 | row colors */ |
| 2389 | Blob sql = empty_blob; /* SQL */ |
| 2390 | int nMaxEvents = 1; /* max number of events for |
| 2391 | all rows. */ |
| 2392 | static char const * daysOfWeek[] = { |
| 2393 | "Monday", "Tuesday", "Wednesday", "Thursday", |
| 2394 | "Friday", "Saturday", "Sunday" |
| 2395 | }; |
| 2396 | |
| 2397 | stats_report_init_view(); |
| 2398 | stats_report_event_types_menu("byweekday", NULL); |
| 2399 | blob_append(&sql, |
| 2400 | "SELECT cast(mtime %% 7 AS INTEGER) dow, " |
| 2401 | "COUNT(*) AS eventCount " |
| 2402 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1972,11 +1972,11 @@ | |
| 1972 | |
| 1973 | /* |
| 1974 | ** Set by stats_report_init_view() to one of the y=XXXX values |
| 1975 | ** accepted by /timeline?y=XXXX. |
| 1976 | */ |
| 1977 | static const char * statsReportTimelineYFlag = NULL; |
| 1978 | |
| 1979 | /* |
| 1980 | ** Creates a TEMP VIEW named v_reports which is a wrapper around the |
| 1981 | ** EVENT table filtered on event.type. It looks for the request |
| 1982 | ** parameter 'type' (reminder: we "should" use 'y' for consistency |
| @@ -1993,12 +1993,12 @@ | |
| 1993 | ** Returns one of: 'c', 'w', 'g', 't', 'e', representing the type of |
| 1994 | ** filter it applies, or '*' if no filter is applied (i.e. if "all" is |
| 1995 | ** used). |
| 1996 | */ |
| 1997 | static int stats_report_init_view(){ |
| 1998 | const char * zType = PD("type","*"); /* analog to /timeline?y=... */ |
| 1999 | const char * zRealType = NULL; /* normalized form of zType */ |
| 2000 | int rc = 0; /* result code */ |
| 2001 | assert( !statsReportType && "Must not be called more than once." ); |
| 2002 | switch( (zType && *zType) ? *zType : 0 ){ |
| 2003 | case 'c': |
| 2004 | case 'C': |
| @@ -2047,11 +2047,11 @@ | |
| 2047 | ** Returns a string suitable (for a given value of suitable) for |
| 2048 | ** use in a label with the header of the /reports pages, dependent |
| 2049 | ** on the 'type' flag. See stats_report_init_view(). |
| 2050 | ** The returned bytes are static. |
| 2051 | */ |
| 2052 | static const char * stats_report_label_for_type(){ |
| 2053 | assert( statsReportType && "Must call stats_report_init_view() first." ); |
| 2054 | switch( statsReportType ){ |
| 2055 | case 'c': |
| 2056 | return "checkins"; |
| 2057 | case 'w': |
| @@ -2072,12 +2072,12 @@ | |
| 2072 | ** time this is called. e.g. if called from the 'byuser' view then |
| 2073 | ** zCurrentViewName must be "byuser". Any URL parameters which need to |
| 2074 | ** be added to the generated URLs should be passed in zParam. The |
| 2075 | ** caller is expected to have already encoded any zParam in the %T or |
| 2076 | ** %t encoding. */ |
| 2077 | static void stats_report_event_types_menu(const char * zCurrentViewName, |
| 2078 | const char * zParam){ |
| 2079 | char * zTop; |
| 2080 | if(zParam && !*zParam){ |
| 2081 | zParam = NULL; |
| 2082 | } |
| 2083 | zTop = mprintf("%s/reports?view=%s%s%s", g.zTop, zCurrentViewName, |
| @@ -2297,11 +2297,11 @@ | |
| 2297 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2298 | @</tr> |
| 2299 | } |
| 2300 | @ </tbody></table> |
| 2301 | if(nEventTotal){ |
| 2302 | const char * zAvgLabel = includeMonth ? "month" : "year"; |
| 2303 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2304 | @ <br><div>Total events: %d(nEventTotal) |
| 2305 | @ <br>Average per active %s(zAvgLabel): %d(nAvg) |
| 2306 | @ </div> |
| 2307 | } |
| @@ -2387,15 +2387,15 @@ | |
| 2387 | int rowClass = 0; /* counter for alternating |
| 2388 | row colors */ |
| 2389 | Blob sql = empty_blob; /* SQL */ |
| 2390 | int nMaxEvents = 1; /* max number of events for |
| 2391 | all rows. */ |
| 2392 | static const char * const daysOfWeek[] = { |
| 2393 | "Monday", "Tuesday", "Wednesday", "Thursday", |
| 2394 | "Friday", "Saturday", "Sunday" |
| 2395 | }; |
| 2396 | |
| 2397 | stats_report_init_view(); |
| 2398 | stats_report_event_types_menu("byweekday", NULL); |
| 2399 | blob_append(&sql, |
| 2400 | "SELECT cast(mtime %% 7 AS INTEGER) dow, " |
| 2401 | "COUNT(*) AS eventCount " |
| 2402 |