dbda8d6ce9 2007-07-21 drh: /* dbda8d6ce9 2007-07-21 drh: ** Copyright (c) 2006 D. Richard Hipp dbda8d6ce9 2007-07-21 drh: ** dbda8d6ce9 2007-07-21 drh: ** This program is free software; you can redistribute it and/or dbda8d6ce9 2007-07-21 drh: ** modify it under the terms of the GNU General Public dbda8d6ce9 2007-07-21 drh: ** License version 2 as published by the Free Software Foundation. dbda8d6ce9 2007-07-21 drh: ** dbda8d6ce9 2007-07-21 drh: ** This program is distributed in the hope that it will be useful, dbda8d6ce9 2007-07-21 drh: ** but WITHOUT ANY WARRANTY; without even the implied warranty of dbda8d6ce9 2007-07-21 drh: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dbda8d6ce9 2007-07-21 drh: ** General Public License for more details. dbda8d6ce9 2007-07-21 drh: ** dbda8d6ce9 2007-07-21 drh: ** You should have received a copy of the GNU General Public dbda8d6ce9 2007-07-21 drh: ** License along with this library; if not, write to the dbda8d6ce9 2007-07-21 drh: ** Free Software Foundation, Inc., 59 Temple Place - Suite 330, dbda8d6ce9 2007-07-21 drh: ** Boston, MA 02111-1307, USA. dbda8d6ce9 2007-07-21 drh: ** dbda8d6ce9 2007-07-21 drh: ** Author contact information: dbda8d6ce9 2007-07-21 drh: ** drh@hwaci.com dbda8d6ce9 2007-07-21 drh: ** http://www.hwaci.com/drh/ dbda8d6ce9 2007-07-21 drh: ** dbda8d6ce9 2007-07-21 drh: ******************************************************************************* dbda8d6ce9 2007-07-21 drh: ** dbda8d6ce9 2007-07-21 drh: ** A common header file used by all modules. dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* dbda8d6ce9 2007-07-21 drh: ** System header files used by all modules dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #include <unistd.h> dbda8d6ce9 2007-07-21 drh: #include <stdio.h> dbda8d6ce9 2007-07-21 drh: #include <stdlib.h> dbda8d6ce9 2007-07-21 drh: #include <ctype.h> dbda8d6ce9 2007-07-21 drh: #include <string.h> dbda8d6ce9 2007-07-21 drh: #include <stdarg.h> dbda8d6ce9 2007-07-21 drh: #include <assert.h> dbda8d6ce9 2007-07-21 drh: #include "sqlite3.h" dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* dbda8d6ce9 2007-07-21 drh: ** Typedef for a 64-bit integer dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: typedef sqlite_int64 i64; dbda8d6ce9 2007-07-21 drh: typedef sqlite_uint64 u64; dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* dbda8d6ce9 2007-07-21 drh: ** Unsigned character type dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: typedef unsigned char u8; dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* dbda8d6ce9 2007-07-21 drh: ** Standard colors. These colors can also be changed using a stylesheet. dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* A blue border and background. Used for the title bar and for dates dbda8d6ce9 2007-07-21 drh: ** in a timeline. dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #define BORDER1 "#a0b5f4" /* Stylesheet class: border1 */ dbda8d6ce9 2007-07-21 drh: #define BG1 "#d0d9f4" /* Stylesheet class: bkgnd1 */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* A red border and background. Use for releases in the timeline. dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #define BORDER2 "#ec9898" /* Stylesheet class: border2 */ dbda8d6ce9 2007-07-21 drh: #define BG2 "#f7c0c0" /* Stylesheet class: bkgnd2 */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* A gray background. Used for column headers in the Wiki Table of Contents dbda8d6ce9 2007-07-21 drh: ** and to highlight ticket properties. dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #define BG3 "#d0d0d0" /* Stylesheet class: bkgnd3 */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* A light-gray background. Used for title bar, menus, and rlog alternation dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #define BG4 "#f0f0f0" /* Stylesheet class: bkgnd4 */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* A deeper gray background. Used for branches dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #define BG5 "#dddddd" /* Stylesheet class: bkgnd5 */ dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* Default HTML page header */ dbda8d6ce9 2007-07-21 drh: #define HEADER "<html>\n" \ dbda8d6ce9 2007-07-21 drh: "<head>\n" \ dbda8d6ce9 2007-07-21 drh: "<link rel=\"alternate\" type=\"application/rss+xml\"\n" \ dbda8d6ce9 2007-07-21 drh: " title=\"%N Timeline Feed\" href=\"%B/timeline.rss\">\n" \ dbda8d6ce9 2007-07-21 drh: "<title>%N: %T</title>\n</head>\n" \ dbda8d6ce9 2007-07-21 drh: "<body bgcolor=\"white\">" dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* Default HTML page footer */ dbda8d6ce9 2007-07-21 drh: #define FOOTER "<div id=\"footer\"><small><small>\n" \ dbda8d6ce9 2007-07-21 drh: "<a href=\"about\">Fossil version %V</a>\n" \ dbda8d6ce9 2007-07-21 drh: "</small></small></div>\n" \ dbda8d6ce9 2007-07-21 drh: "</body></html>\n" dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* In the timeline, check-in messages are truncated at the first space dbda8d6ce9 2007-07-21 drh: ** that is more than MX_CKIN_MSG from the beginning, or at the first dbda8d6ce9 2007-07-21 drh: ** paragraph break that is more than MN_CKIN_MSG from the beginning. dbda8d6ce9 2007-07-21 drh: */ dbda8d6ce9 2007-07-21 drh: #define MN_CKIN_MSG 100 dbda8d6ce9 2007-07-21 drh: #define MX_CKIN_MSG 300 dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: /* Unset the following to disable internationalization code. */ dbda8d6ce9 2007-07-21 drh: #ifndef FOSSIL_I18N dbda8d6ce9 2007-07-21 drh: # define FOSSIL_I18N 1 dbda8d6ce9 2007-07-21 drh: #endif dbda8d6ce9 2007-07-21 drh: dbda8d6ce9 2007-07-21 drh: #if FOSSIL_I18N dbda8d6ce9 2007-07-21 drh: # include <locale.h> dbda8d6ce9 2007-07-21 drh: # include <langinfo.h> dbda8d6ce9 2007-07-21 drh: #endif dbda8d6ce9 2007-07-21 drh: #ifndef CODESET dbda8d6ce9 2007-07-21 drh: # undef FOSSIL_I18N dbda8d6ce9 2007-07-21 drh: # define FOSSIL_I18N 0 dbda8d6ce9 2007-07-21 drh: #endif