Fossil SCM

This branch contains a build of Fossil that uses the tmstmpvfs extension. The purpose of this branch is to test the tmstmpvfs extension. There is no intent to ever land this branch nor make it a permanent part of Fossil.

drh 2026-01-07 20:36 trunk
Commit e4685667af0cb56054021fd2a1dd0489b88ed526a17f1ca1fe96fab87fa7b8a5
--- a/extsrc/tmstmpvfs.c
+++ b/extsrc/tmstmpvfs.c
@@ -0,0 +1,565 @@
1
+/*
2
+** 2026-01-05
3
+**
4
+** The author disclaims copyright to this source code. In place of
5
+** a legal notice, here is a blessing:
6
+**
7
+** May you do good and not evil.
8
+** May you find forgiveness for yourself and forgive others.
9
+** May you share freely, never taking more than you give.
10
+**
11
+******************************************************************************
12
+**
13
+** This file implements a VFS shim that writes a timestamp and other tracing
14
+** information into 16 byts of reserved space at the end of each page of the
15
+** database file. The additional data is written as the page is added to
16
+** the WAL file for databases in WAL mode, or as the database file itself
17
+** is modified in rollback modes.
18
+**
19
+** The VFS also tries to generate log-files with names of the form:
20
+**
21
+** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
22
+**
23
+** Log files are only generated if directory $(DATABASE)-tmstmp exists.
24
+** The name of eaunix-epoch time in millisecond,
25
+** the process ID, and a random 32-bit value (to disambiguate multiple
26
+** connections from the spaces. The log file
27
+** contains one 16-byte record for various events, such as opening or close
28
+** of the database or WAL file, writes to the WAL file, checkpoints, and
29
+** similar. The logfile is only generated if the connection attempts to
30
+** modify the database. There is a separate log file for each open database
31
+** connection.
32
+**
33
+** COMPILING
34
+**
35
+** To build this extension as a separately loaded shared library or
36
+** DLL, use compiler command-lines similar to the following:
37
+**
38
+** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
39
+** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
40
+** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
41
+**
42
+** You may want to add additional compiler options, of course,
43
+** according to the ne/*
44
+** 2026-01-05
45
+**
46
+** The author disclaims copyright to this source code. In place of
47
+** a legal notice, here is a blessing:
48
+**
49
+** May you do good and not evil.
50
+** May you find forgiveness for yourself and forgive others.
51
+** May you share freely, never taking more than you give.
52
+**
53
+******************************************************************************
54
+**
55
+** This file implements a VFS shim that writes a timestamp and other tracing
56
+** information into 16 byts of reserved space at the end of each page of the
57
+** database file. The additional data is written as the page is added to
58
+** the WAL file for databases in WAL mode, or as the database file itself
59
+** is modified in rollback modes.
60
+**
61
+** The VFS also tries to generate log-files with names of the form:
62
+**
63
+** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
64
+**
65
+** Log files are only generated if directory $(DATABASE)-tmstmp exists.
66
+** The name of each log file is the current ISO8601 time iThe author disclaims copyright to this source code. In place of
67
+** a legal notice, here is a blessing:
68
+**
69
+** May you do good and not evil.
70
+** May you find forgiveness for yourself and forgive others.
71
+** May you share freely, never taking more than you give.
72
+**
73
+******************************************************************************
74
+**
75
+** This file implements a VFS shim that writes a timestamp and other tracing
76
+** information into 16 byts of reserved space at the end of each page of the
77
+** database file. The additional data is written as the page is added to
78
+** the WAL file for databases in WAL mode, or as the database file itself
79
+** is modified in rollback modes.
80
+**
81
+** The VFS also tries to generate log-files with names of the form:
82
+**
83
+** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
84
+**
85
+** Log files are only generated if directory $(DATABASE)-tmstmp exists.
86
+** The name of each log file is the current ISO8601 time in milliseconds,
87
+** the process ID, and a random 32-bit value (to disambiguate multiple
88
+** connections from the same process) separated by dashes. The log file
89
+** contains 16-bytes records for various events, such as opening or close
90
+** of the database or WAL file, writes to the WAL file, checkpoints/*
91
+** 202 file implements a VFS shim that writes a timestamp and other tracing
92
+** information into 16 byts of reserved space at the end of each page of the
93
+** database file.
94
+**
95
+** The VFS also tries to generate log-files with names of the form:
96
+**
97
+** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
98
+**
99
+** Log files are only generated if directory $(DATABASE)-tmstmp exists.
100
+** The name of each log file is the current ISO8601 time in milliseconds,
101
+** the process ID, and a random 32-bit value (to disambiguate multiple
102
+** connections from the same process) separated by dashes. The log file
103
+** contains 16-bytes records for various events, such as opening or close
104
+** of the database or WAL file, writes to the WAL file, checkpoints, and
105
+** similar. The logfile is only generated if the connection attempts to
106
+** modify the database. There is a separate log file for each open database
107
+** connection.
108
+**
109
+** COMPILING
110
+**
111
+** To build this extension as a separately loaded shared library or
112
+** DLL, use compiler command-lines similar to the following:
113
+**
114
+** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
115
+** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
116
+** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
117
+**
118
+** You may want to add additional compiler options, of course,
119
+** according to the needs of your project.
120
+**
121
+** Another option is to statically link both SQLite and this extension
122
+** into your application. If both this file and "sqlite3.c" are statically
123
+** linked, and if "sqlite3.c" is compiled with an option like:
124
+**
125
+** -DSQLITE_EXTRA_INIT=sqlitethe number ofeach page of the dat1970,mp VFS by default t
126
+**hroughout your. All values are expressed
127
+** ind this extension as a shared library, you first have to
128
+** bring up a dummy SQLite de --csv option to the command above, then the command generates
129
+** a Comma-Separated-Value (CSV) file as output, which contains a
130
+** decoding of the complete timestamp tag on each page of the database.
131
+** This CVS file can be easily imported into an1970-01-01. (6 bytes is sufficient for timestamps
132
+** for almost 9000 years.)
133
+** .import -
134
+**-csv '|showdb --tmstmp -csv orig.db pgidx' ts_table
135
+**
136
+** In the command above, the database containing the timestamps is
137
+** "orig.db" and the content is imported into a new table named "ts_table".
138
+** The "ts_table" is created automatically, using the column names found
139
+** in the first line of the CSV file. All columns of the automatically
140
+** created ts_table are of type TEXT. It might make more sense to
141
+** create the table yourself, using more sensible datatypes, like this:
142
+**
143
+** CREATE TABLE ts_table (
144
+** pgno INT, -- page number
145
+** tm REAL, -- seconds since 1970-01-01
146
+** frame INT, -- WAL frame number
147
+** flg INT, -- flag (tag byte 12)
148
+** salt INT, -- WAL salt (tag bytes 13-15)
149
+** parent INT, -- Parent page number
150
+** child INT, -- Index of this page in its parent
151
+** ovfl INT, -- Index of this page on the overflow chain
152
+** txt TEXT -- Description of this page
153
+** );
154
+**
155
+** Then import using:
156
+**
157
+** .import --csv --skip 1 '|showdb --tmstmp --csv orig.db pgidx' ts_table
158
+**
159
+** Note the addition of the "--skip 1" option on ".import" to bypass the
160
+** first line of the CSV file that contains the column names.
161
+**
162
+** Both programs "showdb" and "showtmlog" can be built by running
163
+** "make showtmlog showdb" from the top-level of a recent SQLite
164
+** source tree.
165
+*/
166
+#if defined(SQLITE_AMALGAMATION) && !defined(SQLITE_TMSTMPVFS_STATIC)
167
+# define SQLITE_TMSTMPVFS_STATIC
168
+#endif
169
+#ifdef SQLITE_TMSTMPVFS_STATIC
170
+# include "sqlite3.h"
171
+#else
172
+# include "sqlite3ext.h"
173
+ SQLITE_EXTENSION_INIT1
174
+#endif
175
+#include <string.h>
176
+#include <assert.h>
177
+#include <stdio.h>
178
+
179
+/*
180
+** Forward declaration of objects used by this utility
181
+*/
182
+typedef struct sqlite3_vfs TmstmpVfs;
183
+typedef struct TmstmpFile TmstmpFile;
184
+typedef struct TmstmpLog TmstmpLog;
185
+
186
+/*
187
+** Bytes of reserved space used by this extension
188
+*/
189
+#define TMSTMP_RESERVE 16
190
+
191
+/*
192
+** The magic number used to identify TmstmpFile objects
193
+*/
194
+#define TMSTMP_MAGIC 0x2a87b72d
195
+
196
+/*
197
+** Useful datatype abbreviations
198
+*/
199
+#if !defined(SQLITE_AMALGAMATION)
200
+ typedef unsigned char u8;
201
+ typedef unsigned int u32;
202
+#endif
203
+
204
+/*
205
+** Current process id
206
+*/
207
+#if defined(_WIN32)
208
+# include <windows.h>
209
+# define GETPID (u32)GetCurrentProcessId()
210
+#else
211
+# include <unistd.h>
212
+# define GETPID (u32)getpid()
213
+#endif
214
+
215
+/* Access to a lower-level VFS that (might) implement dynamic loading,
216
+** access to randomness, etc.
217
+*/
218
+#define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData))
219
+#define ORIGFILE(p) ((sqlite3_file*)(((TmstmpFile*)(p))+1))
220
+
221
+/* Information for the tmstmp log file. */
222
+struct TmstmpLog {
223
+ char *zLogname; /* Log filename */
224
+ FILE *log; /* Open log file */
225
+ int n; /* Bytes of a[] used */
226
+ unsigned char a[16*6]; /* Buffered header for the log */
227
+};
228
+
229
+/* An open WAL or DB file */
230
+struct TmstmpFile {
231
+ sqlite3_file base; /* IO methods */
232
+ u32 uMagic; /* Magic number for sanity checking */
233
+ u32 salt1; /* Last WAL salt-1 value */
234
+ u32 iFrame; /* Last WAL frame number */
235
+ u32 pgno; /* Current page number */
236
+ u32 pgsz; /* Size of each page, in bytes */
237
+ u8 isWal; /* True if this is a WAL file */
238
+ u8 isDb; /* True if this is a DB file */
239
+ u8 isCommit; /* Last WAL frame header was a transaction commit */
240
+ u8 hasCorrectReserve; /* File has the correct reserve size */
241
+ u8 inCkpt; /* True if in a checkpoint */
242
+ TmstmpLog *pLog; /* Log file */
243
+ TmstmpFile *pPartner; /* DB->WAL or WAL->DB mapping */
244
+ sqlite3_int64 iOfst; /* Offset of last WAL frame header */
245
+ sqlite3_vfs *pSubVfs; /* Underlying VFS */
246
+};
247
+
248
+/*
249
+** Event log opcodes
250
+*/
251
+#define ELOG_OPEN_DB 0x01
252
+#define ELOG_OPEN_WAL 0x02
253
+#define ELOG_WAL_PAGE 0x03
254
+#define ELOG_DB_PAGE 0x04
255
+#define ELOG_CKPT_START 0x05
256
+#define ELOG_CKPT_PAGE 0x06
257
+#define ELOG_CKPT_DONE 0x07
258
+#define ELOG_WAL_RESET 0x08
259
+#define ELOG_CLOSE_WAL 0x0e
260
+#define ELOG_CLOSE_DB 0x0f
261
+
262
+/*
263
+** Methods for TmstmpFile
264
+*/
265
+static int tmstmpClose(sqlite3_file*);
266
+static int tmstmpRead(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
267
+static int tmstmpWrite(sqlite3_file*,const void*,int iAmt, sqlite3_int64 iOfst);
268
+static int tmstmpTruncate(sqlite3_file*, sqlite3_int64 size);
269
+static int tmstmpSync(sqlite3_file*, int flags);
270
+static int tmstmpFileSize(sqlite3_file*, sqlite3_int64 *pSize);
271
+static int tmstmpLock(sqlite3_file*, int);
272
+static int tmstmpUnlock(sqlite3_file*, int);
273
+static int tmstmpCheckReservedLock(sqlite3_file*, int *pResOut);
274
+static int tmstmpFileControl(sqlite3_file*, int op, void *pArg);
275
+static int tmstmpSectorSize(sqlite3_file*);
276
+static int tmstmpDeviceCharacteristics(sqlite3_file*);
277
+static int tmstmpShmMap(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
278
+static int tmstmpShmLock(sqlite3_file*, int offset, int n, int flags);
279
+static void tmstmpShmBarrier(sqlite3_file*);
280
+static int tmstmpShmUnmap(sqlite3_file*, int deleteFlag);
281
+static int tmstmpFetch(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
282
+static int tmstmpUnfetch(sqlite3_file*, sqlite3_int64 iOfst, void *p);
283
+
284
+/*
285
+** Methods for TmstmpVfs
286
+*/
287
+static int tmstmpOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
288
+static int tmstmpDelete(sqlite3_vfs*, const char *zName, int syncDir);
289
+static int tmstmpAccess(sqlite3_vfs*, const char *zName, int flags, int *);
290
+static int tmstmpFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
291
+static void *tmstmpDlOpen(sqlite3_vfs*, const char *zFilename);
292
+static void tmstmpDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
293
+static void (*tmstmpDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
294
+static void tmstmpDlClose(sqlite3_vfs*, void*);
295
+static int tmstmpRandomness(sqlite3_vfs*, int nByte, char *zOut);
296
+static int tmstmpSleep(sqlite3_vfs*, int microseconds);
297
+static int tmstmpCurrentTime(sqlite3_vfs*, double*);
298
+static int tmstmpGetLastError(sqlite3_vfs*, int, char *);
299
+static int tmstmpCurrentTimeInt64(sqlite3_vfs*, sqlite3_int64*);
300
+static int tmstmpSetSystemCall(sqlite3_vfs*, const char*,sqlite3_syscall_ptr);
301
+static sqlite3_syscall_ptr tmstmpGetSystemCall(sqlite3_vfs*, const char *z);
302
+static const char *tmstmpNextSystemCall(sqlite3_vfs*, const char *zName);
303
+
304
+static sqlite3_vfs tmstmp_vfs = {
305
+ 3, /* iVersion (set when registered) */
306
+ 0, /* szOsFile (set when registered) */
307
+ 1024, /* mxPathname */
308
+ 0, /* pNext */
309
+ "tmstmpvfs", /* zName */
310
+ 0, /* pAppData (set when registered) */
311
+ tmstmpOpen, /* xOpen */
312
+ tmstmpDelete, /* xDelete */
313
+ tmstmpAccess, /* xAccess */
314
+ tmstmpFullPathname, /* xFullPathname */
315
+ tmstmpDlOpen, /* xDlOpen */
316
+ tmstmpDlError, /* xDlError */
317
+ tmstmpDlSym, /* xDlSym */
318
+ tmstmpDlClose, /* xDlClose */
319
+ tmstmpRandomness, /* xRandomness */
320
+ tmstmpSleep, /* xSleep */
321
+ tmstmpCurrentTime, /* xCurrentTime */
322
+ tmstmpGetLastError, /* xGetLastError */
323
+ tmstmpCurrentTimeInt64, /* xCurrentTimeInt64 */
324
+ tmstmpSetSystemCall, /* xSetSystemCall */
325
+ tmstmpGetSystemCall, /* xGetSystemCall */
326
+ tmstmpNextSystemCall /* xNextSystemCall */
327
+};
328
+
329
+static const sqlite3_io_methods tmstmp_io_methods = {
330
+ 3, /* iVersion */
331
+ tmstm /* xClose */
332
+ tmstmpRead, /* xRead */
333
+ tmstmpWrite, /* xWrite */
334
+ tmstmpTruncate, /* xTruncate */
335
+ tmstmpSync, /* xSync */
336
+ tmstmpFileSize, /* xFileSize */
337
+ tmstmpLock, /* xLock */
338
+ tmstmpUnlock, /* xUnlock */
339
+ tmstmpCheckReservedLock, /* xCheckReservedLock */
340
+ tmstmpFileConorSize, /* xSectorSize */
341
+ tmstmpDeviceCharacteristics, /* xDeviceCharacteristics */
342
+ tmstmpShmMap, /* xShmMap */
343
+ tmstmpShmLock, /* xShmLock */
344
+ tmstmpShmBarrier, /* xShmBarrier */
345
+ tmstmpShmUnmap, /* xShmUnmap */
346
+ tmstmpFetch, /* xFetch */
347
+ tmstmpUnfetch /* xUnfetch */
348
+};
349
+
350
+/*
351
+** Write a 6-byte millisecond timestamp into aOut[]
352
+*/
353
+static void tmstmpPutTS(TmstmpFile *p, unsigned char *aOut){
354
+ sqlite3_uint64 tm = 0;
355
+ p->pSubVfs->xCurrentTimeInt64(p->pSubVfs, (sqlite3_int64*)&tm);
356
+ tm -= 210866760000000LL;
357
+ aOut[0] = (tm>>40)&0xff;
358
+ aOut[1] = (tm>>32)&0xff /* xDlClose */
359
+ tmstmpRandomness, /* xRandomness */
360
+ tmstmpSleep, /* xSleep */
361
+ tmstmpCurrentTime, /* xCurrentTime */
362
+ tmstmpGetLastError, /* xGetLastError */
363
+ tmstmpCurrentTimeInt64, /* xCurrentTimeInt64 */
364
+ tmstmpSetSystemCall, /* xSetSystemCall */
365
+ tmstmpGetSystemCall, /* xGetSystemCall */
366
+ tmstmpNextSystemCall /* xNextSystemCall */
367
+};
368
+
369
+static const sqlite3_io_methods tmstmp_io_methods = {
370
+ 3, /* iVersion */
371
+ tmstm /* xClose */
372
+ tmstmpRead, /* xRead */
373
+ tmstmpWrite, /* xWrite */
374
+ tmstmpTruncate, /* xTruncate */
375
+ tmstmpSync, /* xSync */
376
+ tmstmpFileSize, /* xFileSize */
377
+ tmstmpLock, /* xLock */
378
+ tmstmpUnlock, /* xUnlock */
379
+ tmstmpCheckReservedLock, /* xCheckReservedLock */
380
+ tmstmpFileConorSize, /* xSectorSize */
381
+ tmstmpDeviceCharacteristics, /* xDeviceCharacteristics */
382
+ tmstmpShmMap, /* xShmMap */
383
+ tmstmpShmLock, /* xShmLock */
384
+ tmstmpShmBarrier, /* xShmBarrier */
385
+ tmstmpShmUnmap, /* xShmUnmap */
386
+ tmstmpFetch, /* xFetch */
387
+ tmstmpUnfetch /* xUnfetch */
388
+};
389
+
390
+/*
391
+** Write a 6-byte millisecond timestamp into aOut[]
392
+*/
393
+static void tmstmpPutTS(TmstmpFile *p, unsigned char *aOut){
394
+ sqlite3_uint64 tm = 0;
395
+ p->pSubVfs->xCurrentTimeInt64(p->pSubVfs, (sqlite3_int64*)&tm);
396
+ tm -= 210866760000000LL;
397
+ aOut[0] = (tm>>40)&0xff;
398
+ aOut[1] = (tm>>32)&0xff;
399
+ aOut[2] = (tm>>24)&0xff;
400
+ aOut[3] = (tm>>16)&0xff;
401
+ aOut[4] = (tm>>8)&0xff;
402
+ aOut[5] = tm&0xff;
403
+}
404
+
405
+/*
406
+16pGetU32(((const u8*)zBuf)+8);
407
+ memcpy(&x, ((con8*s tmstmpPutU32(p s[12] = p->isCommit ? 1 : 0PAGE, s[12]u32 2026-01-05
408
+**
409
+** The author disclaims copyright to this source code. In place of
410
+** a legal notice, here is a blessing:
411
+**
412
+** May you do good and not evil.
413
+** May you find forgiveness for yourself and forgive others.
414
+** May you share freely, never taking more than you give.
415
+**
416
+******************************************************************************
417
+**
418
+** This file implements a VFS shim that writes a timestamp and other tracing
419
+** information into 16 byts of reserved space at the end of each page of the
420
+** database file.
421
+**
422
+** The VFS also tries to generate log-files with names of the form:
423
+**
424
+** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
425
+**
426
+** Log files are only generated if directory $(DATABASE)-tmstmp exists.
427
+** The name of each log file is the current ISO8601 time in milliseconds,
428
+** the process ID, and a random 32-bit value (to disambiguate multiple
429
+** connections from the same process) separated by dashes. The log file
430
+** contains 16-bytes records for various events, such as opening or close
431
+** of the database or WAL file, writes to the WAL file, checkpoints, and
432
+** s - 8)/(p->pgsz + 48the connection attempts to
433
+** modify the database. There is a separate log file for each open database
434
+** connection.
435
+**
436
+** COMPILING
437
+**
438
+** To build this extension as a separately loaded shared library or
439
+** DLL, use compiler command-lines similar to the following:
440
+**
441
+** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
442
+** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
443
+** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
444
+**
445
+** You may want to add additional compiler opons, of course,
446
+** according
447
+** increased buting
448
+** informatioSo if a database file already
449
+** has a reserve-bytes value greater than 16, there is no way to
450
+** activate timestamping on that database, other than to dump
451
+** and restore the database file. Note also that other extensions
452
+** might also make use of the reserve-bytes. Timestamping will
453
+** be incompatible with those other extensionso disambiguate multiple
454
+** connections from the same process) separated by dashes. The log file
455
+** contains 16-bytes records for various events, such as opening or ciOfst/p->pgsztabase or WAL file, writes to the WAL file, checkpoints, and
456
+** similar. The logfile is only generated if the connection attempts to
457
+** modify the database. There is a separate log file for each open database
458
+** connection.
459
+**
460
+** COMPILING
461
+**
462
+** To build this extension as a separately loaded shared library or
463
+** DLL, use compiler command-lines similar to the following:
464
+**
465
+** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
466
+** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
467
+** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
468
+**
469
+** You may want to add additional compiler options, of course,
470
+** according to the needs of your project.
471
+**
472
+** Another option is to statically link both SQLite and this tmp --csv orig.db pgidx' ts_table
473
+**
474
+** Note the addition of the "--skip 1" option on ".import" to bypass the
475
+** first line of the CSV file that contains the column names.
476
+**
477
+** Both programs "showdb" and "showtmlog" can be built by running
478
+** "make showtmlog showdb" from the top-level of a recent SQLite
479
+** source tree.
480
+*/
481
+#if defined(SQLITE_AMALGAMATION) && !defined(SQLITE_TMSTMPVFS_STATIC)
482
+# define SQLITE_TMSTMPVFS_STATIC
483
+#endif
484
+#ifdef SQLITE_TMSTMPVFS_STATIC
485
+# include "sqlite3.h"
486
+#else
487
+# include "sqlite3ext.h"
488
+ SQLITE_EXTENSION_INIT1
489
+#endif
490
+#include <string.h>
491
+#include <assert.h>
492
+#include <stdio.h>
493
+
494
+/*
495
+** Forward declaration of objects used by this utility
496
+*/
497
+typedef struct sqlite3_vfs TmstmpVfs;
498
+typedef struct TmstmpFile TmstmpFile;
499
+typedef struct TmstmpLog TmstmpLog;
500
+
501
+/*
502
+** Bytes of reserved space used by this extension
503
+*/
504
+#define TMSTMP_RESERVE 16
505
+
506
+/*
507
+** The magic number used to identify TmstmpFile objects
508
+*/
509
+#define TMSTMP_MAGIC 0x2a87b72d
510
+
511
+/*
512
+** Useful datatype abbreviations
513
+*/
514
+#if !defined(SQLITE_AMALGAMATION)
515
+ typedef unsignedif( rc==SQLITEte3_int64 iOfst);
516
+statVFSNAME: {
517
+ ***************/*
518
+** 2026-01-05
519
+**
520
+** The author disclaims copyright to this source /*
521
+** ck(sqlite3_file*, }
522
+ te3_int64 iOfst);
523
+static inSTART: {
524
+ #define ELOG_CLOSE_DB 0qlite3_int64 size);
525
+static TmstmpFile
526
+*/
527
+static int tmstmpClo int tmstmpRead(sqlite3_file*, vo tmstmpReadvarious events, such as ope);
528
+static int tmstmpWri }
529
+ ck(sqlite3_file*, }
530
+ te3_int64 iOfs p->inCkpt = 0;
531
+ 3_file*, int flagisDb );
532
+ 3_file*, in int tmstmpRead(sqlite3_0;
533
+ ***************/*
534
+** 2026-01-05
535
+**
536
+** The DONE, 0, 0, 0);
537
+ }
538
+ ck(sqlite3_file*, }ile*, int);
539
+static int tmstmpCheckReservedLock(sqlite3_file*, int *pResOut);
540
+static int tmstmpFileControl(sqlite3_file*, int op, void *pArg);
541
+static int tmstmpSectorSize(sqlite3_file*);
542
+static int tmstmpDeviceCharacteristics(sqlite3_file*);
543
+static int tmstmpShmMap(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
544
+static int tmstmpShmLock(sqlite3_file*, int offset, int n, int flags);
545
+static void tmstmpShmBarrier(sqlite3_file*);
546
+static int tmstmpShmUnmap(sqlite3_file*, int deleteFlag);
547
+static int tmstmpFetch(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
548
+static int tmstmpUnfetch(sqlite3_file*, sqlite3_int64 iOfst, void *p);
549
+
550
+/*
551
+** Methods for TmstmpVfs
552
+*/
553
+static int tmstmpOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
554
+static int tmstmpDelete(sqlite3_vfs*, const char *zName, int syncDir);
555
+static int tmstmpAccess(sqlite3_vfs*, const char *zName, int flags, int *);
556
+static int tmstmpFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
557
+static void *tmstmpDlOpen(sqlite3_vfs*, const char *zFilename);
558
+static void tmstmpDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
559
+static void (*tmstmpDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
560
+static void tmstmpDlClose(sqlite3_vfs*, void*);
561
+static int tmstmpRandomness(sqlite3_vfs*, int nByte, char *zOut);
562
+static int tmstmpSleep(sqlite3_vfs*, int microseconds);
563
+static int tmstmpCurrentTime(sqlite3_vfs*, double*);
564
+static int tmstmpGetLastError(sqlite3_vfs*, int, char *);
565
+static int tmstmpCurrentTimeInt64(sqlite3_vfs*, sqlite3_int64* zName, r1, pid,
--- a/extsrc/tmstmpvfs.c
+++ b/extsrc/tmstmpvfs.c
@@ -0,0 +1,565 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/extsrc/tmstmpvfs.c
+++ b/extsrc/tmstmpvfs.c
@@ -0,0 +1,565 @@
1 /*
2 ** 2026-01-05
3 **
4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing:
6 **
7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give.
10 **
11 ******************************************************************************
12 **
13 ** This file implements a VFS shim that writes a timestamp and other tracing
14 ** information into 16 byts of reserved space at the end of each page of the
15 ** database file. The additional data is written as the page is added to
16 ** the WAL file for databases in WAL mode, or as the database file itself
17 ** is modified in rollback modes.
18 **
19 ** The VFS also tries to generate log-files with names of the form:
20 **
21 ** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
22 **
23 ** Log files are only generated if directory $(DATABASE)-tmstmp exists.
24 ** The name of eaunix-epoch time in millisecond,
25 ** the process ID, and a random 32-bit value (to disambiguate multiple
26 ** connections from the spaces. The log file
27 ** contains one 16-byte record for various events, such as opening or close
28 ** of the database or WAL file, writes to the WAL file, checkpoints, and
29 ** similar. The logfile is only generated if the connection attempts to
30 ** modify the database. There is a separate log file for each open database
31 ** connection.
32 **
33 ** COMPILING
34 **
35 ** To build this extension as a separately loaded shared library or
36 ** DLL, use compiler command-lines similar to the following:
37 **
38 ** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
39 ** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
40 ** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
41 **
42 ** You may want to add additional compiler options, of course,
43 ** according to the ne/*
44 ** 2026-01-05
45 **
46 ** The author disclaims copyright to this source code. In place of
47 ** a legal notice, here is a blessing:
48 **
49 ** May you do good and not evil.
50 ** May you find forgiveness for yourself and forgive others.
51 ** May you share freely, never taking more than you give.
52 **
53 ******************************************************************************
54 **
55 ** This file implements a VFS shim that writes a timestamp and other tracing
56 ** information into 16 byts of reserved space at the end of each page of the
57 ** database file. The additional data is written as the page is added to
58 ** the WAL file for databases in WAL mode, or as the database file itself
59 ** is modified in rollback modes.
60 **
61 ** The VFS also tries to generate log-files with names of the form:
62 **
63 ** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
64 **
65 ** Log files are only generated if directory $(DATABASE)-tmstmp exists.
66 ** The name of each log file is the current ISO8601 time iThe author disclaims copyright to this source code. In place of
67 ** a legal notice, here is a blessing:
68 **
69 ** May you do good and not evil.
70 ** May you find forgiveness for yourself and forgive others.
71 ** May you share freely, never taking more than you give.
72 **
73 ******************************************************************************
74 **
75 ** This file implements a VFS shim that writes a timestamp and other tracing
76 ** information into 16 byts of reserved space at the end of each page of the
77 ** database file. The additional data is written as the page is added to
78 ** the WAL file for databases in WAL mode, or as the database file itself
79 ** is modified in rollback modes.
80 **
81 ** The VFS also tries to generate log-files with names of the form:
82 **
83 ** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
84 **
85 ** Log files are only generated if directory $(DATABASE)-tmstmp exists.
86 ** The name of each log file is the current ISO8601 time in milliseconds,
87 ** the process ID, and a random 32-bit value (to disambiguate multiple
88 ** connections from the same process) separated by dashes. The log file
89 ** contains 16-bytes records for various events, such as opening or close
90 ** of the database or WAL file, writes to the WAL file, checkpoints/*
91 ** 202 file implements a VFS shim that writes a timestamp and other tracing
92 ** information into 16 byts of reserved space at the end of each page of the
93 ** database file.
94 **
95 ** The VFS also tries to generate log-files with names of the form:
96 **
97 ** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
98 **
99 ** Log files are only generated if directory $(DATABASE)-tmstmp exists.
100 ** The name of each log file is the current ISO8601 time in milliseconds,
101 ** the process ID, and a random 32-bit value (to disambiguate multiple
102 ** connections from the same process) separated by dashes. The log file
103 ** contains 16-bytes records for various events, such as opening or close
104 ** of the database or WAL file, writes to the WAL file, checkpoints, and
105 ** similar. The logfile is only generated if the connection attempts to
106 ** modify the database. There is a separate log file for each open database
107 ** connection.
108 **
109 ** COMPILING
110 **
111 ** To build this extension as a separately loaded shared library or
112 ** DLL, use compiler command-lines similar to the following:
113 **
114 ** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
115 ** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
116 ** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
117 **
118 ** You may want to add additional compiler options, of course,
119 ** according to the needs of your project.
120 **
121 ** Another option is to statically link both SQLite and this extension
122 ** into your application. If both this file and "sqlite3.c" are statically
123 ** linked, and if "sqlite3.c" is compiled with an option like:
124 **
125 ** -DSQLITE_EXTRA_INIT=sqlitethe number ofeach page of the dat1970,mp VFS by default t
126 **hroughout your. All values are expressed
127 ** ind this extension as a shared library, you first have to
128 ** bring up a dummy SQLite de --csv option to the command above, then the command generates
129 ** a Comma-Separated-Value (CSV) file as output, which contains a
130 ** decoding of the complete timestamp tag on each page of the database.
131 ** This CVS file can be easily imported into an1970-01-01. (6 bytes is sufficient for timestamps
132 ** for almost 9000 years.)
133 ** .import -
134 **-csv '|showdb --tmstmp -csv orig.db pgidx' ts_table
135 **
136 ** In the command above, the database containing the timestamps is
137 ** "orig.db" and the content is imported into a new table named "ts_table".
138 ** The "ts_table" is created automatically, using the column names found
139 ** in the first line of the CSV file. All columns of the automatically
140 ** created ts_table are of type TEXT. It might make more sense to
141 ** create the table yourself, using more sensible datatypes, like this:
142 **
143 ** CREATE TABLE ts_table (
144 ** pgno INT, -- page number
145 ** tm REAL, -- seconds since 1970-01-01
146 ** frame INT, -- WAL frame number
147 ** flg INT, -- flag (tag byte 12)
148 ** salt INT, -- WAL salt (tag bytes 13-15)
149 ** parent INT, -- Parent page number
150 ** child INT, -- Index of this page in its parent
151 ** ovfl INT, -- Index of this page on the overflow chain
152 ** txt TEXT -- Description of this page
153 ** );
154 **
155 ** Then import using:
156 **
157 ** .import --csv --skip 1 '|showdb --tmstmp --csv orig.db pgidx' ts_table
158 **
159 ** Note the addition of the "--skip 1" option on ".import" to bypass the
160 ** first line of the CSV file that contains the column names.
161 **
162 ** Both programs "showdb" and "showtmlog" can be built by running
163 ** "make showtmlog showdb" from the top-level of a recent SQLite
164 ** source tree.
165 */
166 #if defined(SQLITE_AMALGAMATION) && !defined(SQLITE_TMSTMPVFS_STATIC)
167 # define SQLITE_TMSTMPVFS_STATIC
168 #endif
169 #ifdef SQLITE_TMSTMPVFS_STATIC
170 # include "sqlite3.h"
171 #else
172 # include "sqlite3ext.h"
173 SQLITE_EXTENSION_INIT1
174 #endif
175 #include <string.h>
176 #include <assert.h>
177 #include <stdio.h>
178
179 /*
180 ** Forward declaration of objects used by this utility
181 */
182 typedef struct sqlite3_vfs TmstmpVfs;
183 typedef struct TmstmpFile TmstmpFile;
184 typedef struct TmstmpLog TmstmpLog;
185
186 /*
187 ** Bytes of reserved space used by this extension
188 */
189 #define TMSTMP_RESERVE 16
190
191 /*
192 ** The magic number used to identify TmstmpFile objects
193 */
194 #define TMSTMP_MAGIC 0x2a87b72d
195
196 /*
197 ** Useful datatype abbreviations
198 */
199 #if !defined(SQLITE_AMALGAMATION)
200 typedef unsigned char u8;
201 typedef unsigned int u32;
202 #endif
203
204 /*
205 ** Current process id
206 */
207 #if defined(_WIN32)
208 # include <windows.h>
209 # define GETPID (u32)GetCurrentProcessId()
210 #else
211 # include <unistd.h>
212 # define GETPID (u32)getpid()
213 #endif
214
215 /* Access to a lower-level VFS that (might) implement dynamic loading,
216 ** access to randomness, etc.
217 */
218 #define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData))
219 #define ORIGFILE(p) ((sqlite3_file*)(((TmstmpFile*)(p))+1))
220
221 /* Information for the tmstmp log file. */
222 struct TmstmpLog {
223 char *zLogname; /* Log filename */
224 FILE *log; /* Open log file */
225 int n; /* Bytes of a[] used */
226 unsigned char a[16*6]; /* Buffered header for the log */
227 };
228
229 /* An open WAL or DB file */
230 struct TmstmpFile {
231 sqlite3_file base; /* IO methods */
232 u32 uMagic; /* Magic number for sanity checking */
233 u32 salt1; /* Last WAL salt-1 value */
234 u32 iFrame; /* Last WAL frame number */
235 u32 pgno; /* Current page number */
236 u32 pgsz; /* Size of each page, in bytes */
237 u8 isWal; /* True if this is a WAL file */
238 u8 isDb; /* True if this is a DB file */
239 u8 isCommit; /* Last WAL frame header was a transaction commit */
240 u8 hasCorrectReserve; /* File has the correct reserve size */
241 u8 inCkpt; /* True if in a checkpoint */
242 TmstmpLog *pLog; /* Log file */
243 TmstmpFile *pPartner; /* DB->WAL or WAL->DB mapping */
244 sqlite3_int64 iOfst; /* Offset of last WAL frame header */
245 sqlite3_vfs *pSubVfs; /* Underlying VFS */
246 };
247
248 /*
249 ** Event log opcodes
250 */
251 #define ELOG_OPEN_DB 0x01
252 #define ELOG_OPEN_WAL 0x02
253 #define ELOG_WAL_PAGE 0x03
254 #define ELOG_DB_PAGE 0x04
255 #define ELOG_CKPT_START 0x05
256 #define ELOG_CKPT_PAGE 0x06
257 #define ELOG_CKPT_DONE 0x07
258 #define ELOG_WAL_RESET 0x08
259 #define ELOG_CLOSE_WAL 0x0e
260 #define ELOG_CLOSE_DB 0x0f
261
262 /*
263 ** Methods for TmstmpFile
264 */
265 static int tmstmpClose(sqlite3_file*);
266 static int tmstmpRead(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
267 static int tmstmpWrite(sqlite3_file*,const void*,int iAmt, sqlite3_int64 iOfst);
268 static int tmstmpTruncate(sqlite3_file*, sqlite3_int64 size);
269 static int tmstmpSync(sqlite3_file*, int flags);
270 static int tmstmpFileSize(sqlite3_file*, sqlite3_int64 *pSize);
271 static int tmstmpLock(sqlite3_file*, int);
272 static int tmstmpUnlock(sqlite3_file*, int);
273 static int tmstmpCheckReservedLock(sqlite3_file*, int *pResOut);
274 static int tmstmpFileControl(sqlite3_file*, int op, void *pArg);
275 static int tmstmpSectorSize(sqlite3_file*);
276 static int tmstmpDeviceCharacteristics(sqlite3_file*);
277 static int tmstmpShmMap(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
278 static int tmstmpShmLock(sqlite3_file*, int offset, int n, int flags);
279 static void tmstmpShmBarrier(sqlite3_file*);
280 static int tmstmpShmUnmap(sqlite3_file*, int deleteFlag);
281 static int tmstmpFetch(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
282 static int tmstmpUnfetch(sqlite3_file*, sqlite3_int64 iOfst, void *p);
283
284 /*
285 ** Methods for TmstmpVfs
286 */
287 static int tmstmpOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
288 static int tmstmpDelete(sqlite3_vfs*, const char *zName, int syncDir);
289 static int tmstmpAccess(sqlite3_vfs*, const char *zName, int flags, int *);
290 static int tmstmpFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
291 static void *tmstmpDlOpen(sqlite3_vfs*, const char *zFilename);
292 static void tmstmpDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
293 static void (*tmstmpDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
294 static void tmstmpDlClose(sqlite3_vfs*, void*);
295 static int tmstmpRandomness(sqlite3_vfs*, int nByte, char *zOut);
296 static int tmstmpSleep(sqlite3_vfs*, int microseconds);
297 static int tmstmpCurrentTime(sqlite3_vfs*, double*);
298 static int tmstmpGetLastError(sqlite3_vfs*, int, char *);
299 static int tmstmpCurrentTimeInt64(sqlite3_vfs*, sqlite3_int64*);
300 static int tmstmpSetSystemCall(sqlite3_vfs*, const char*,sqlite3_syscall_ptr);
301 static sqlite3_syscall_ptr tmstmpGetSystemCall(sqlite3_vfs*, const char *z);
302 static const char *tmstmpNextSystemCall(sqlite3_vfs*, const char *zName);
303
304 static sqlite3_vfs tmstmp_vfs = {
305 3, /* iVersion (set when registered) */
306 0, /* szOsFile (set when registered) */
307 1024, /* mxPathname */
308 0, /* pNext */
309 "tmstmpvfs", /* zName */
310 0, /* pAppData (set when registered) */
311 tmstmpOpen, /* xOpen */
312 tmstmpDelete, /* xDelete */
313 tmstmpAccess, /* xAccess */
314 tmstmpFullPathname, /* xFullPathname */
315 tmstmpDlOpen, /* xDlOpen */
316 tmstmpDlError, /* xDlError */
317 tmstmpDlSym, /* xDlSym */
318 tmstmpDlClose, /* xDlClose */
319 tmstmpRandomness, /* xRandomness */
320 tmstmpSleep, /* xSleep */
321 tmstmpCurrentTime, /* xCurrentTime */
322 tmstmpGetLastError, /* xGetLastError */
323 tmstmpCurrentTimeInt64, /* xCurrentTimeInt64 */
324 tmstmpSetSystemCall, /* xSetSystemCall */
325 tmstmpGetSystemCall, /* xGetSystemCall */
326 tmstmpNextSystemCall /* xNextSystemCall */
327 };
328
329 static const sqlite3_io_methods tmstmp_io_methods = {
330 3, /* iVersion */
331 tmstm /* xClose */
332 tmstmpRead, /* xRead */
333 tmstmpWrite, /* xWrite */
334 tmstmpTruncate, /* xTruncate */
335 tmstmpSync, /* xSync */
336 tmstmpFileSize, /* xFileSize */
337 tmstmpLock, /* xLock */
338 tmstmpUnlock, /* xUnlock */
339 tmstmpCheckReservedLock, /* xCheckReservedLock */
340 tmstmpFileConorSize, /* xSectorSize */
341 tmstmpDeviceCharacteristics, /* xDeviceCharacteristics */
342 tmstmpShmMap, /* xShmMap */
343 tmstmpShmLock, /* xShmLock */
344 tmstmpShmBarrier, /* xShmBarrier */
345 tmstmpShmUnmap, /* xShmUnmap */
346 tmstmpFetch, /* xFetch */
347 tmstmpUnfetch /* xUnfetch */
348 };
349
350 /*
351 ** Write a 6-byte millisecond timestamp into aOut[]
352 */
353 static void tmstmpPutTS(TmstmpFile *p, unsigned char *aOut){
354 sqlite3_uint64 tm = 0;
355 p->pSubVfs->xCurrentTimeInt64(p->pSubVfs, (sqlite3_int64*)&tm);
356 tm -= 210866760000000LL;
357 aOut[0] = (tm>>40)&0xff;
358 aOut[1] = (tm>>32)&0xff /* xDlClose */
359 tmstmpRandomness, /* xRandomness */
360 tmstmpSleep, /* xSleep */
361 tmstmpCurrentTime, /* xCurrentTime */
362 tmstmpGetLastError, /* xGetLastError */
363 tmstmpCurrentTimeInt64, /* xCurrentTimeInt64 */
364 tmstmpSetSystemCall, /* xSetSystemCall */
365 tmstmpGetSystemCall, /* xGetSystemCall */
366 tmstmpNextSystemCall /* xNextSystemCall */
367 };
368
369 static const sqlite3_io_methods tmstmp_io_methods = {
370 3, /* iVersion */
371 tmstm /* xClose */
372 tmstmpRead, /* xRead */
373 tmstmpWrite, /* xWrite */
374 tmstmpTruncate, /* xTruncate */
375 tmstmpSync, /* xSync */
376 tmstmpFileSize, /* xFileSize */
377 tmstmpLock, /* xLock */
378 tmstmpUnlock, /* xUnlock */
379 tmstmpCheckReservedLock, /* xCheckReservedLock */
380 tmstmpFileConorSize, /* xSectorSize */
381 tmstmpDeviceCharacteristics, /* xDeviceCharacteristics */
382 tmstmpShmMap, /* xShmMap */
383 tmstmpShmLock, /* xShmLock */
384 tmstmpShmBarrier, /* xShmBarrier */
385 tmstmpShmUnmap, /* xShmUnmap */
386 tmstmpFetch, /* xFetch */
387 tmstmpUnfetch /* xUnfetch */
388 };
389
390 /*
391 ** Write a 6-byte millisecond timestamp into aOut[]
392 */
393 static void tmstmpPutTS(TmstmpFile *p, unsigned char *aOut){
394 sqlite3_uint64 tm = 0;
395 p->pSubVfs->xCurrentTimeInt64(p->pSubVfs, (sqlite3_int64*)&tm);
396 tm -= 210866760000000LL;
397 aOut[0] = (tm>>40)&0xff;
398 aOut[1] = (tm>>32)&0xff;
399 aOut[2] = (tm>>24)&0xff;
400 aOut[3] = (tm>>16)&0xff;
401 aOut[4] = (tm>>8)&0xff;
402 aOut[5] = tm&0xff;
403 }
404
405 /*
406 16pGetU32(((const u8*)zBuf)+8);
407 memcpy(&x, ((con8*s tmstmpPutU32(p s[12] = p->isCommit ? 1 : 0PAGE, s[12]u32 2026-01-05
408 **
409 ** The author disclaims copyright to this source code. In place of
410 ** a legal notice, here is a blessing:
411 **
412 ** May you do good and not evil.
413 ** May you find forgiveness for yourself and forgive others.
414 ** May you share freely, never taking more than you give.
415 **
416 ******************************************************************************
417 **
418 ** This file implements a VFS shim that writes a timestamp and other tracing
419 ** information into 16 byts of reserved space at the end of each page of the
420 ** database file.
421 **
422 ** The VFS also tries to generate log-files with names of the form:
423 **
424 ** $(DATABASE)-tmstmp/$(TIME)-$(PID)-$(ID)
425 **
426 ** Log files are only generated if directory $(DATABASE)-tmstmp exists.
427 ** The name of each log file is the current ISO8601 time in milliseconds,
428 ** the process ID, and a random 32-bit value (to disambiguate multiple
429 ** connections from the same process) separated by dashes. The log file
430 ** contains 16-bytes records for various events, such as opening or close
431 ** of the database or WAL file, writes to the WAL file, checkpoints, and
432 ** s - 8)/(p->pgsz + 48the connection attempts to
433 ** modify the database. There is a separate log file for each open database
434 ** connection.
435 **
436 ** COMPILING
437 **
438 ** To build this extension as a separately loaded shared library or
439 ** DLL, use compiler command-lines similar to the following:
440 **
441 ** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
442 ** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
443 ** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
444 **
445 ** You may want to add additional compiler opons, of course,
446 ** according
447 ** increased buting
448 ** informatioSo if a database file already
449 ** has a reserve-bytes value greater than 16, there is no way to
450 ** activate timestamping on that database, other than to dump
451 ** and restore the database file. Note also that other extensions
452 ** might also make use of the reserve-bytes. Timestamping will
453 ** be incompatible with those other extensionso disambiguate multiple
454 ** connections from the same process) separated by dashes. The log file
455 ** contains 16-bytes records for various events, such as opening or ciOfst/p->pgsztabase or WAL file, writes to the WAL file, checkpoints, and
456 ** similar. The logfile is only generated if the connection attempts to
457 ** modify the database. There is a separate log file for each open database
458 ** connection.
459 **
460 ** COMPILING
461 **
462 ** To build this extension as a separately loaded shared library or
463 ** DLL, use compiler command-lines similar to the following:
464 **
465 ** (linux) gcc -fPIC -shared tmstmpvfs.c -o tmstmpvfs.so
466 ** (mac) clang -fPIC -dynamiclib tmstmpvfs.c -o tmstmpvfs.dylib
467 ** (windows) cl tmstmpvfs.c -link -dll -out:tmstmpvfs.dll
468 **
469 ** You may want to add additional compiler options, of course,
470 ** according to the needs of your project.
471 **
472 ** Another option is to statically link both SQLite and this tmp --csv orig.db pgidx' ts_table
473 **
474 ** Note the addition of the "--skip 1" option on ".import" to bypass the
475 ** first line of the CSV file that contains the column names.
476 **
477 ** Both programs "showdb" and "showtmlog" can be built by running
478 ** "make showtmlog showdb" from the top-level of a recent SQLite
479 ** source tree.
480 */
481 #if defined(SQLITE_AMALGAMATION) && !defined(SQLITE_TMSTMPVFS_STATIC)
482 # define SQLITE_TMSTMPVFS_STATIC
483 #endif
484 #ifdef SQLITE_TMSTMPVFS_STATIC
485 # include "sqlite3.h"
486 #else
487 # include "sqlite3ext.h"
488 SQLITE_EXTENSION_INIT1
489 #endif
490 #include <string.h>
491 #include <assert.h>
492 #include <stdio.h>
493
494 /*
495 ** Forward declaration of objects used by this utility
496 */
497 typedef struct sqlite3_vfs TmstmpVfs;
498 typedef struct TmstmpFile TmstmpFile;
499 typedef struct TmstmpLog TmstmpLog;
500
501 /*
502 ** Bytes of reserved space used by this extension
503 */
504 #define TMSTMP_RESERVE 16
505
506 /*
507 ** The magic number used to identify TmstmpFile objects
508 */
509 #define TMSTMP_MAGIC 0x2a87b72d
510
511 /*
512 ** Useful datatype abbreviations
513 */
514 #if !defined(SQLITE_AMALGAMATION)
515 typedef unsignedif( rc==SQLITEte3_int64 iOfst);
516 statVFSNAME: {
517 ***************/*
518 ** 2026-01-05
519 **
520 ** The author disclaims copyright to this source /*
521 ** ck(sqlite3_file*, }
522 te3_int64 iOfst);
523 static inSTART: {
524 #define ELOG_CLOSE_DB 0qlite3_int64 size);
525 static TmstmpFile
526 */
527 static int tmstmpClo int tmstmpRead(sqlite3_file*, vo tmstmpReadvarious events, such as ope);
528 static int tmstmpWri }
529 ck(sqlite3_file*, }
530 te3_int64 iOfs p->inCkpt = 0;
531 3_file*, int flagisDb );
532 3_file*, in int tmstmpRead(sqlite3_0;
533 ***************/*
534 ** 2026-01-05
535 **
536 ** The DONE, 0, 0, 0);
537 }
538 ck(sqlite3_file*, }ile*, int);
539 static int tmstmpCheckReservedLock(sqlite3_file*, int *pResOut);
540 static int tmstmpFileControl(sqlite3_file*, int op, void *pArg);
541 static int tmstmpSectorSize(sqlite3_file*);
542 static int tmstmpDeviceCharacteristics(sqlite3_file*);
543 static int tmstmpShmMap(sqlite3_file*, int iPg, int pgsz, int, void volatile**);
544 static int tmstmpShmLock(sqlite3_file*, int offset, int n, int flags);
545 static void tmstmpShmBarrier(sqlite3_file*);
546 static int tmstmpShmUnmap(sqlite3_file*, int deleteFlag);
547 static int tmstmpFetch(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp);
548 static int tmstmpUnfetch(sqlite3_file*, sqlite3_int64 iOfst, void *p);
549
550 /*
551 ** Methods for TmstmpVfs
552 */
553 static int tmstmpOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *);
554 static int tmstmpDelete(sqlite3_vfs*, const char *zName, int syncDir);
555 static int tmstmpAccess(sqlite3_vfs*, const char *zName, int flags, int *);
556 static int tmstmpFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut);
557 static void *tmstmpDlOpen(sqlite3_vfs*, const char *zFilename);
558 static void tmstmpDlError(sqlite3_vfs*, int nByte, char *zErrMsg);
559 static void (*tmstmpDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void);
560 static void tmstmpDlClose(sqlite3_vfs*, void*);
561 static int tmstmpRandomness(sqlite3_vfs*, int nByte, char *zOut);
562 static int tmstmpSleep(sqlite3_vfs*, int microseconds);
563 static int tmstmpCurrentTime(sqlite3_vfs*, double*);
564 static int tmstmpGetLastError(sqlite3_vfs*, int, char *);
565 static int tmstmpCurrentTimeInt64(sqlite3_vfs*, sqlite3_int64* zName, r1, pid,
+9 -1
--- src/main.mk
+++ src/main.mk
@@ -668,11 +668,12 @@
668668
-DSQLITE_ENABLE_SETLK_TIMEOUT \
669669
-DSQLITE_ENABLE_STMTVTAB \
670670
-DSQLITE_HAVE_ZLIB \
671671
-DSQLITE_ENABLE_DBPAGE_VTAB \
672672
-DSQLITE_TRUSTED_SCHEMA=0 \
673
- -DHAVE_USLEEP
673
+ -DHAVE_USLEEP \
674
+ -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs
674675
675676
# Setup the options used to compile the included SQLite shell.
676677
SHELL_OPTIONS = -DNDEBUG=1 \
677678
-DSQLITE_DQS=0 \
678679
-DSQLITE_THREADSAFE=0 \
@@ -697,19 +698,21 @@
697698
-DSQLITE_ENABLE_STMTVTAB \
698699
-DSQLITE_HAVE_ZLIB \
699700
-DSQLITE_ENABLE_DBPAGE_VTAB \
700701
-DSQLITE_TRUSTED_SCHEMA=0 \
701702
-DHAVE_USLEEP \
703
+ -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
702704
-Dmain=sqlite3_shell \
703705
-DSQLITE_SHELL_IS_UTF8=1 \
704706
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
705707
-DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
706708
-DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
707709
-DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc
708710
709711
# Setup the options used to compile the included Pikchr formatter.
710712
PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
713
+TMSTMPVFS_OPTIONS = -DSQLITE_TMSTMPVFS_STATIC=1
711714
712715
# The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
713716
# If it is set to 1, then there is no need to build or link
714717
# the sqlite3.o object. Instead, the system SQLite will be linked
715718
# using -lsqlite3.
@@ -754,10 +757,11 @@
754757
755758
EXTRAOBJ = \
756759
$(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) \
757760
$(LINENOISE_OBJ.$(USE_LINENOISE)) \
758761
$(OBJDIR)/pikchr.o \
762
+ $(OBJDIR)/tmstmpvfs.o \
759763
$(OBJDIR)/shell.o \
760764
$(OBJDIR)/th.o \
761765
$(OBJDIR)/th_lang.o \
762766
$(OBJDIR)/th_tcl.o \
763767
$(OBJDIR)/cson_amalgamation.o
@@ -933,10 +937,11 @@
933937
$(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h \
934938
$(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h \
935939
$(OBJDIR)/xsystem_.c:$(OBJDIR)/xsystem.h \
936940
$(OBJDIR)/zip_.c:$(OBJDIR)/zip.h \
937941
$(SRCDIR_extsrc)/pikchr.c:$(OBJDIR)/pikchr.h \
942
+ $(SRCDIR_extsrc)/tmstmpvfs.c:$(OBJDIR)/tmstmpvfs.h \
938943
$(SRCDIR_extsrc)/sqlite3.h \
939944
$(SRCDIR)/th.h \
940945
$(OBJDIR)/VERSION.h
941946
touch $(OBJDIR)/headers
942947
$(OBJDIR)/headers: Makefile
@@ -2167,10 +2172,13 @@
21672172
$(XTCC) -c $(SRCDIR)/th_tcl.c -o $@
21682173
21692174
21702175
$(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c $(OBJDIR)/mkversion
21712176
$(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
2177
+
2178
+$(OBJDIR)/tmstmpvfs.o: $(SRCDIR_extsrc)/tmstmpvfs.c $(OBJDIR)/mkversion
2179
+ $(XTCC) $(TMSTMPVFS_OPTIONS) -c $(SRCDIR_extsrc)/tmstmpvfs.c -o $@
21722180
21732181
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c $(OBJDIR)/mkversion
21742182
$(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
21752183
21762184
$(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
21772185
--- src/main.mk
+++ src/main.mk
@@ -668,11 +668,12 @@
668 -DSQLITE_ENABLE_SETLK_TIMEOUT \
669 -DSQLITE_ENABLE_STMTVTAB \
670 -DSQLITE_HAVE_ZLIB \
671 -DSQLITE_ENABLE_DBPAGE_VTAB \
672 -DSQLITE_TRUSTED_SCHEMA=0 \
673 -DHAVE_USLEEP
 
674
675 # Setup the options used to compile the included SQLite shell.
676 SHELL_OPTIONS = -DNDEBUG=1 \
677 -DSQLITE_DQS=0 \
678 -DSQLITE_THREADSAFE=0 \
@@ -697,19 +698,21 @@
697 -DSQLITE_ENABLE_STMTVTAB \
698 -DSQLITE_HAVE_ZLIB \
699 -DSQLITE_ENABLE_DBPAGE_VTAB \
700 -DSQLITE_TRUSTED_SCHEMA=0 \
701 -DHAVE_USLEEP \
 
702 -Dmain=sqlite3_shell \
703 -DSQLITE_SHELL_IS_UTF8=1 \
704 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
705 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
706 -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
707 -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc
708
709 # Setup the options used to compile the included Pikchr formatter.
710 PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
 
711
712 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
713 # If it is set to 1, then there is no need to build or link
714 # the sqlite3.o object. Instead, the system SQLite will be linked
715 # using -lsqlite3.
@@ -754,10 +757,11 @@
754
755 EXTRAOBJ = \
756 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) \
757 $(LINENOISE_OBJ.$(USE_LINENOISE)) \
758 $(OBJDIR)/pikchr.o \
 
759 $(OBJDIR)/shell.o \
760 $(OBJDIR)/th.o \
761 $(OBJDIR)/th_lang.o \
762 $(OBJDIR)/th_tcl.o \
763 $(OBJDIR)/cson_amalgamation.o
@@ -933,10 +937,11 @@
933 $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h \
934 $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h \
935 $(OBJDIR)/xsystem_.c:$(OBJDIR)/xsystem.h \
936 $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h \
937 $(SRCDIR_extsrc)/pikchr.c:$(OBJDIR)/pikchr.h \
 
938 $(SRCDIR_extsrc)/sqlite3.h \
939 $(SRCDIR)/th.h \
940 $(OBJDIR)/VERSION.h
941 touch $(OBJDIR)/headers
942 $(OBJDIR)/headers: Makefile
@@ -2167,10 +2172,13 @@
2167 $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@
2168
2169
2170 $(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c $(OBJDIR)/mkversion
2171 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
 
 
 
2172
2173 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c $(OBJDIR)/mkversion
2174 $(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
2175
2176 $(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
2177
--- src/main.mk
+++ src/main.mk
@@ -668,11 +668,12 @@
668 -DSQLITE_ENABLE_SETLK_TIMEOUT \
669 -DSQLITE_ENABLE_STMTVTAB \
670 -DSQLITE_HAVE_ZLIB \
671 -DSQLITE_ENABLE_DBPAGE_VTAB \
672 -DSQLITE_TRUSTED_SCHEMA=0 \
673 -DHAVE_USLEEP \
674 -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs
675
676 # Setup the options used to compile the included SQLite shell.
677 SHELL_OPTIONS = -DNDEBUG=1 \
678 -DSQLITE_DQS=0 \
679 -DSQLITE_THREADSAFE=0 \
@@ -697,19 +698,21 @@
698 -DSQLITE_ENABLE_STMTVTAB \
699 -DSQLITE_HAVE_ZLIB \
700 -DSQLITE_ENABLE_DBPAGE_VTAB \
701 -DSQLITE_TRUSTED_SCHEMA=0 \
702 -DHAVE_USLEEP \
703 -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
704 -Dmain=sqlite3_shell \
705 -DSQLITE_SHELL_IS_UTF8=1 \
706 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
707 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
708 -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
709 -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc
710
711 # Setup the options used to compile the included Pikchr formatter.
712 PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
713 TMSTMPVFS_OPTIONS = -DSQLITE_TMSTMPVFS_STATIC=1
714
715 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
716 # If it is set to 1, then there is no need to build or link
717 # the sqlite3.o object. Instead, the system SQLite will be linked
718 # using -lsqlite3.
@@ -754,10 +757,11 @@
757
758 EXTRAOBJ = \
759 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) \
760 $(LINENOISE_OBJ.$(USE_LINENOISE)) \
761 $(OBJDIR)/pikchr.o \
762 $(OBJDIR)/tmstmpvfs.o \
763 $(OBJDIR)/shell.o \
764 $(OBJDIR)/th.o \
765 $(OBJDIR)/th_lang.o \
766 $(OBJDIR)/th_tcl.o \
767 $(OBJDIR)/cson_amalgamation.o
@@ -933,10 +937,11 @@
937 $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h \
938 $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h \
939 $(OBJDIR)/xsystem_.c:$(OBJDIR)/xsystem.h \
940 $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h \
941 $(SRCDIR_extsrc)/pikchr.c:$(OBJDIR)/pikchr.h \
942 $(SRCDIR_extsrc)/tmstmpvfs.c:$(OBJDIR)/tmstmpvfs.h \
943 $(SRCDIR_extsrc)/sqlite3.h \
944 $(SRCDIR)/th.h \
945 $(OBJDIR)/VERSION.h
946 touch $(OBJDIR)/headers
947 $(OBJDIR)/headers: Makefile
@@ -2167,10 +2172,13 @@
2172 $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@
2173
2174
2175 $(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c $(OBJDIR)/mkversion
2176 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
2177
2178 $(OBJDIR)/tmstmpvfs.o: $(SRCDIR_extsrc)/tmstmpvfs.c $(OBJDIR)/mkversion
2179 $(XTCC) $(TMSTMPVFS_OPTIONS) -c $(SRCDIR_extsrc)/tmstmpvfs.c -o $@
2180
2181 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c $(OBJDIR)/mkversion
2182 $(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
2183
2184 $(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
2185
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -35,10 +35,11 @@
3535
# $srcDir is used to set the target source dir in several places. Not
3636
# all code-generation bits use $srcDir and instead hard-code, so
3737
# replacing it only here (should it ever changes) is not sufficient.
3838
#
3939
set srcDir ../src
40
+
4041
# Directory $srcDirExt houses single-file source code solutions which
4142
# are imported directly into the fossil source tree.
4243
set srcDirExt ../extsrc
4344
4445
# Basenames of all source files that get preprocessed using
@@ -205,10 +206,11 @@
205206
# Source files which live under $srcDirExt, but only those for which
206207
# we need to run makeheaders. External sources which have their own
207208
# header files must not be in this list.
208209
set src_ext {
209210
pikchr
211
+ tmstmpvfs
210212
}
211213
212214
# Additional resource files that get built into the executable.
213215
# These paths are all resolved from the src/ directory, so must
214216
# be relative to that.
@@ -254,10 +256,11 @@
254256
-DSQLITE_ENABLE_STMTVTAB
255257
-DSQLITE_HAVE_ZLIB
256258
-DSQLITE_ENABLE_DBPAGE_VTAB
257259
-DSQLITE_TRUSTED_SCHEMA=0
258260
-DHAVE_USLEEP
261
+ -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs
259262
}
260263
#lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
261264
#lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
262265
#lappend SQLITE_OPTIONS -DSQLITE_WIN32_NO_ANSI
263266
#lappend SQLITE_OPTIONS -DSQLITE_WINNT_MAX_PATH_CHARS=4096
@@ -265,10 +268,16 @@
265268
# Options used to compile the Pikchr library.
266269
#
267270
set PIKCHR_OPTIONS {
268271
-DPIKCHR_TOKEN_LIMIT=10000
269272
}
273
+
274
+# Options for the tmstmpvfs extension
275
+#
276
+set TMSTMPVFS_OPTIONS {
277
+ -DSQLITE_TMSTMPVFS_STATIC=1
278
+}
270279
271280
# Options used to compile the included SQLite shell.
272281
#
273282
set SHELL_OPTIONS [concat $SQLITE_OPTIONS {
274283
-Dmain=sqlite3_shell
@@ -371,10 +380,11 @@
371380
372381
writeln [string map [list \
373382
<<<SQLITE_OPTIONS>>> [join $SQLITE_OPTIONS " \\\n "] \
374383
<<<SHELL_OPTIONS>>> [join $SHELL_OPTIONS " \\\n "] \
375384
<<<PIKCHR_OPTIONS>>> [join $PIKCHR_OPTIONS " \\\n "] \
385
+ <<<TMSTMPVFS_OPTIONS>>> [join $TMSTMPVFS_OPTIONS " \\\n "] \
376386
<<<NEXT_LINE>>> \\] {
377387
all: $(APPNAME)
378388
379389
install: all
380390
mkdir -p $(INSTALLDIR)
@@ -437,10 +447,11 @@
437447
# Setup the options used to compile the included SQLite shell.
438448
SHELL_OPTIONS = <<<SHELL_OPTIONS>>>
439449
440450
# Setup the options used to compile the included Pikchr formatter.
441451
PIKCHR_OPTIONS = <<<PIKCHR_OPTIONS>>>
452
+TMSTMPVFS_OPTIONS = <<<TMSTMPVFS_OPTIONS>>>
442453
443454
# The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
444455
# If it is set to 1, then there is no need to build or link
445456
# the sqlite3.o object. Instead, the system SQLite will be linked
446457
# using -lsqlite3.
@@ -486,10 +497,11 @@
486497
writeln [string map [list <<<NEXT_LINE>>> \\] {
487498
EXTRAOBJ = <<<NEXT_LINE>>>
488499
$(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) <<<NEXT_LINE>>>
489500
$(LINENOISE_OBJ.$(USE_LINENOISE)) <<<NEXT_LINE>>>
490501
$(OBJDIR)/pikchr.o <<<NEXT_LINE>>>
502
+ $(OBJDIR)/tmstmpvfs.o <<<NEXT_LINE>>>
491503
$(OBJDIR)/shell.o <<<NEXT_LINE>>>
492504
$(OBJDIR)/th.o <<<NEXT_LINE>>>
493505
$(OBJDIR)/th_lang.o <<<NEXT_LINE>>>
494506
$(OBJDIR)/th_tcl.o <<<NEXT_LINE>>>
495507
$(OBJDIR)/cson_amalgamation.o
@@ -572,10 +584,13 @@
572584
writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$@\n"
573585
574586
writeln [string map [list <<<NEXT_LINE>>> \\] {
575587
$(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c $(OBJDIR)/mkversion
576588
$(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
589
+
590
+$(OBJDIR)/tmstmpvfs.o: $(SRCDIR_extsrc)/tmstmpvfs.c $(OBJDIR)/mkversion
591
+ $(XTCC) $(TMSTMPVFS_OPTIONS) -c $(SRCDIR_extsrc)/tmstmpvfs.c -o $@
577592
578593
$(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c $(OBJDIR)/mkversion
579594
$(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
580595
581596
$(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
@@ -1213,10 +1228,11 @@
12131228
12141229
writeln [string map [list <<<NEXT_LINE>>> \\] {
12151230
EXTRAOBJ = <<<NEXT_LINE>>>
12161231
$(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) <<<NEXT_LINE>>>
12171232
$(OBJDIR)/pikchr.o <<<NEXT_LINE>>>
1233
+ $(OBJDIR)/tmstmpvfs.o <<<NEXT_LINE>>>
12181234
$(OBJDIR)/shell.o <<<NEXT_LINE>>>
12191235
$(OBJDIR)/th.o <<<NEXT_LINE>>>
12201236
$(OBJDIR)/th_lang.o <<<NEXT_LINE>>>
12211237
$(OBJDIR)/th_tcl.o <<<NEXT_LINE>>>
12221238
$(OBJDIR)/cson_amalgamation.o
@@ -1325,15 +1341,17 @@
13251341
lappend MINGW_SQLITE_OPTIONS {$(MINGW_OPTIONS)}
13261342
lappend MINGW_SQLITE_OPTIONS -DSQLITE_USE_MALLOC_H
13271343
lappend MINGW_SQLITE_OPTIONS -DSQLITE_USE_MSIZE
13281344
13291345
set MINGW_PIKCHR_OPTIONS $PIKCHR_OPTIONS
1346
+set MINGW_TMSTMPVFS_OPTIONS $TMSTMPVFS_OPTIONS
13301347
13311348
set j " \\\n "
13321349
writeln "SQLITE_OPTIONS = [join $MINGW_SQLITE_OPTIONS $j]\n"
13331350
writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS $j]\n"
13341351
writeln "PIKCHR_OPTIONS = [join $MINGW_PIKCHR_OPTIONS $j]\n"
1352
+writeln "TMSTMPVFS_OPTIONS = [join $MINGW_TMSTMPVFS_OPTIONS $j]\n"
13351353
13361354
writeln "\$(SQLITE3_OBJ):\t\$(SQLITE3_SRC) \$(SRCDIR)/../win/Makefile.mingw"
13371355
writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) \$(SEE_FLAGS) \\"
13381356
writeln "\t\t-c \$(SQLITE3_SRC) -o \$@\n"
13391357
@@ -1354,10 +1372,13 @@
13541372
writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$@\n"
13551373
13561374
writeln "\$(OBJDIR)/pikchr.o:\t\$(SRCDIR_extsrc)/pikchr.c"
13571375
writeln "\t\$(XTCC) \$(PIKCHR_OPTIONS) -c \$(SRCDIR_extsrc)/pikchr.c -o \$@\n"
13581376
1377
+writeln "\$(OBJDIR)/tmstmpvfs.o:\t\$(SRCDIR_extsrc)/tmstmpvfs.c"
1378
+writeln "\t\$(XTCC) \$(TMSTMPVS_OPTIONS) -c \$(SRCDIR_extsrc)/tmstmpvfs.c -o \$@\n"
1379
+
13591380
close $output_file
13601381
#
13611382
# End of the win/Makefile.mingw output
13621383
##############################################################################
13631384
##############################################################################
@@ -1399,10 +1420,11 @@
13991420
LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
14001421
}
14011422
writeln "SQLITE_OPTIONS = [join $SQLITE_OPTIONS { }]\n"
14021423
writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS { }]\n"
14031424
writeln "PIKCHR_OPTIONS = [join $PIKCHR_OPTIONS { }]\n"
1425
+writeln "TMSTMPVFS_OPTIONS = [join $TMSTMPVFS_OPTIONS { }]\n"
14041426
writeln -nonewline "SRC ="
14051427
foreach s [lsort $src] {
14061428
writeln -nonewline " ${s}_.c"
14071429
}
14081430
writeln "\n"
@@ -1847,10 +1869,14 @@
18471869
18481870
regsub -all {[-]D} [join $PIKCHR_OPTIONS { }] {/D} MSC_PIKCHR_OPTIONS
18491871
set j " \\\n "
18501872
writeln "PIKCHR_OPTIONS = [join $MSC_PIKCHR_OPTIONS $j]\n"
18511873
1874
+regsub -all {[-]D} [join $TMSTMPVFS_OPTIONS { }] {/D} MSC_TMSTMPVFS_OPTIONS
1875
+set j " \\\n "
1876
+writeln "TMSTMPVFS_OPTIONS = [join $MSC_TMSTMPVFS_OPTIONS $j]\n"
1877
+
18521878
writeln -nonewline "SRC = "
18531879
set i 0
18541880
foreach s [lsort $src] {
18551881
if {$i > 0} {
18561882
writeln " \\"
@@ -1873,11 +1899,11 @@
18731899
}
18741900
set s [regsub -all / $s \\]
18751901
writeln -nonewline "\"\$(SRCDIR)\\${s}\""; incr i
18761902
}
18771903
writeln "\n"
1878
-set AdditionalObj [list shell sqlite3 th th_lang th_tcl cson_amalgamation pikchr]
1904
+set AdditionalObj [list shell sqlite3 th th_lang th_tcl cson_amalgamation pikchr tmstmpvfs]
18791905
writeln -nonewline "OBJ = "
18801906
set i 0
18811907
foreach s [lsort [concat $src $AdditionalObj]] {
18821908
if {$i > 0} {
18831909
writeln " \\"
@@ -2033,10 +2059,13 @@
20332059
"$(OX)\th_tcl$O" : "$(SRCDIR)\th_tcl.c"
20342060
$(TCC) /Fo$@ /Fd$(@D)\ -c $**
20352061
20362062
"$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
20372063
$(TCC) $(PIKCHR_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
2064
+
2065
+"$(OX)\tmstmpvfs$O" : "$(SRCDIR_extsrc)\tmstmpvfs.c"
2066
+ $(TCC) $(TMSTMPVFS_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
20382067
20392068
"$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
20402069
"$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
20412070
20422071
"$(B)\phony.h" :
20432072
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -35,10 +35,11 @@
35 # $srcDir is used to set the target source dir in several places. Not
36 # all code-generation bits use $srcDir and instead hard-code, so
37 # replacing it only here (should it ever changes) is not sufficient.
38 #
39 set srcDir ../src
 
40 # Directory $srcDirExt houses single-file source code solutions which
41 # are imported directly into the fossil source tree.
42 set srcDirExt ../extsrc
43
44 # Basenames of all source files that get preprocessed using
@@ -205,10 +206,11 @@
205 # Source files which live under $srcDirExt, but only those for which
206 # we need to run makeheaders. External sources which have their own
207 # header files must not be in this list.
208 set src_ext {
209 pikchr
 
210 }
211
212 # Additional resource files that get built into the executable.
213 # These paths are all resolved from the src/ directory, so must
214 # be relative to that.
@@ -254,10 +256,11 @@
254 -DSQLITE_ENABLE_STMTVTAB
255 -DSQLITE_HAVE_ZLIB
256 -DSQLITE_ENABLE_DBPAGE_VTAB
257 -DSQLITE_TRUSTED_SCHEMA=0
258 -DHAVE_USLEEP
 
259 }
260 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
261 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
262 #lappend SQLITE_OPTIONS -DSQLITE_WIN32_NO_ANSI
263 #lappend SQLITE_OPTIONS -DSQLITE_WINNT_MAX_PATH_CHARS=4096
@@ -265,10 +268,16 @@
265 # Options used to compile the Pikchr library.
266 #
267 set PIKCHR_OPTIONS {
268 -DPIKCHR_TOKEN_LIMIT=10000
269 }
 
 
 
 
 
 
270
271 # Options used to compile the included SQLite shell.
272 #
273 set SHELL_OPTIONS [concat $SQLITE_OPTIONS {
274 -Dmain=sqlite3_shell
@@ -371,10 +380,11 @@
371
372 writeln [string map [list \
373 <<<SQLITE_OPTIONS>>> [join $SQLITE_OPTIONS " \\\n "] \
374 <<<SHELL_OPTIONS>>> [join $SHELL_OPTIONS " \\\n "] \
375 <<<PIKCHR_OPTIONS>>> [join $PIKCHR_OPTIONS " \\\n "] \
 
376 <<<NEXT_LINE>>> \\] {
377 all: $(APPNAME)
378
379 install: all
380 mkdir -p $(INSTALLDIR)
@@ -437,10 +447,11 @@
437 # Setup the options used to compile the included SQLite shell.
438 SHELL_OPTIONS = <<<SHELL_OPTIONS>>>
439
440 # Setup the options used to compile the included Pikchr formatter.
441 PIKCHR_OPTIONS = <<<PIKCHR_OPTIONS>>>
 
442
443 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
444 # If it is set to 1, then there is no need to build or link
445 # the sqlite3.o object. Instead, the system SQLite will be linked
446 # using -lsqlite3.
@@ -486,10 +497,11 @@
486 writeln [string map [list <<<NEXT_LINE>>> \\] {
487 EXTRAOBJ = <<<NEXT_LINE>>>
488 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) <<<NEXT_LINE>>>
489 $(LINENOISE_OBJ.$(USE_LINENOISE)) <<<NEXT_LINE>>>
490 $(OBJDIR)/pikchr.o <<<NEXT_LINE>>>
 
491 $(OBJDIR)/shell.o <<<NEXT_LINE>>>
492 $(OBJDIR)/th.o <<<NEXT_LINE>>>
493 $(OBJDIR)/th_lang.o <<<NEXT_LINE>>>
494 $(OBJDIR)/th_tcl.o <<<NEXT_LINE>>>
495 $(OBJDIR)/cson_amalgamation.o
@@ -572,10 +584,13 @@
572 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$@\n"
573
574 writeln [string map [list <<<NEXT_LINE>>> \\] {
575 $(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c $(OBJDIR)/mkversion
576 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
 
 
 
577
578 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c $(OBJDIR)/mkversion
579 $(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
580
581 $(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
@@ -1213,10 +1228,11 @@
1213
1214 writeln [string map [list <<<NEXT_LINE>>> \\] {
1215 EXTRAOBJ = <<<NEXT_LINE>>>
1216 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) <<<NEXT_LINE>>>
1217 $(OBJDIR)/pikchr.o <<<NEXT_LINE>>>
 
1218 $(OBJDIR)/shell.o <<<NEXT_LINE>>>
1219 $(OBJDIR)/th.o <<<NEXT_LINE>>>
1220 $(OBJDIR)/th_lang.o <<<NEXT_LINE>>>
1221 $(OBJDIR)/th_tcl.o <<<NEXT_LINE>>>
1222 $(OBJDIR)/cson_amalgamation.o
@@ -1325,15 +1341,17 @@
1325 lappend MINGW_SQLITE_OPTIONS {$(MINGW_OPTIONS)}
1326 lappend MINGW_SQLITE_OPTIONS -DSQLITE_USE_MALLOC_H
1327 lappend MINGW_SQLITE_OPTIONS -DSQLITE_USE_MSIZE
1328
1329 set MINGW_PIKCHR_OPTIONS $PIKCHR_OPTIONS
 
1330
1331 set j " \\\n "
1332 writeln "SQLITE_OPTIONS = [join $MINGW_SQLITE_OPTIONS $j]\n"
1333 writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS $j]\n"
1334 writeln "PIKCHR_OPTIONS = [join $MINGW_PIKCHR_OPTIONS $j]\n"
 
1335
1336 writeln "\$(SQLITE3_OBJ):\t\$(SQLITE3_SRC) \$(SRCDIR)/../win/Makefile.mingw"
1337 writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) \$(SEE_FLAGS) \\"
1338 writeln "\t\t-c \$(SQLITE3_SRC) -o \$@\n"
1339
@@ -1354,10 +1372,13 @@
1354 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$@\n"
1355
1356 writeln "\$(OBJDIR)/pikchr.o:\t\$(SRCDIR_extsrc)/pikchr.c"
1357 writeln "\t\$(XTCC) \$(PIKCHR_OPTIONS) -c \$(SRCDIR_extsrc)/pikchr.c -o \$@\n"
1358
 
 
 
1359 close $output_file
1360 #
1361 # End of the win/Makefile.mingw output
1362 ##############################################################################
1363 ##############################################################################
@@ -1399,10 +1420,11 @@
1399 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
1400 }
1401 writeln "SQLITE_OPTIONS = [join $SQLITE_OPTIONS { }]\n"
1402 writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS { }]\n"
1403 writeln "PIKCHR_OPTIONS = [join $PIKCHR_OPTIONS { }]\n"
 
1404 writeln -nonewline "SRC ="
1405 foreach s [lsort $src] {
1406 writeln -nonewline " ${s}_.c"
1407 }
1408 writeln "\n"
@@ -1847,10 +1869,14 @@
1847
1848 regsub -all {[-]D} [join $PIKCHR_OPTIONS { }] {/D} MSC_PIKCHR_OPTIONS
1849 set j " \\\n "
1850 writeln "PIKCHR_OPTIONS = [join $MSC_PIKCHR_OPTIONS $j]\n"
1851
 
 
 
 
1852 writeln -nonewline "SRC = "
1853 set i 0
1854 foreach s [lsort $src] {
1855 if {$i > 0} {
1856 writeln " \\"
@@ -1873,11 +1899,11 @@
1873 }
1874 set s [regsub -all / $s \\]
1875 writeln -nonewline "\"\$(SRCDIR)\\${s}\""; incr i
1876 }
1877 writeln "\n"
1878 set AdditionalObj [list shell sqlite3 th th_lang th_tcl cson_amalgamation pikchr]
1879 writeln -nonewline "OBJ = "
1880 set i 0
1881 foreach s [lsort [concat $src $AdditionalObj]] {
1882 if {$i > 0} {
1883 writeln " \\"
@@ -2033,10 +2059,13 @@
2033 "$(OX)\th_tcl$O" : "$(SRCDIR)\th_tcl.c"
2034 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
2035
2036 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
2037 $(TCC) $(PIKCHR_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
 
 
 
2038
2039 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
2040 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
2041
2042 "$(B)\phony.h" :
2043
--- tools/makemake.tcl
+++ tools/makemake.tcl
@@ -35,10 +35,11 @@
35 # $srcDir is used to set the target source dir in several places. Not
36 # all code-generation bits use $srcDir and instead hard-code, so
37 # replacing it only here (should it ever changes) is not sufficient.
38 #
39 set srcDir ../src
40
41 # Directory $srcDirExt houses single-file source code solutions which
42 # are imported directly into the fossil source tree.
43 set srcDirExt ../extsrc
44
45 # Basenames of all source files that get preprocessed using
@@ -205,10 +206,11 @@
206 # Source files which live under $srcDirExt, but only those for which
207 # we need to run makeheaders. External sources which have their own
208 # header files must not be in this list.
209 set src_ext {
210 pikchr
211 tmstmpvfs
212 }
213
214 # Additional resource files that get built into the executable.
215 # These paths are all resolved from the src/ directory, so must
216 # be relative to that.
@@ -254,10 +256,11 @@
256 -DSQLITE_ENABLE_STMTVTAB
257 -DSQLITE_HAVE_ZLIB
258 -DSQLITE_ENABLE_DBPAGE_VTAB
259 -DSQLITE_TRUSTED_SCHEMA=0
260 -DHAVE_USLEEP
261 -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs
262 }
263 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_FTS3=1
264 #lappend SQLITE_OPTIONS -DSQLITE_ENABLE_STAT4
265 #lappend SQLITE_OPTIONS -DSQLITE_WIN32_NO_ANSI
266 #lappend SQLITE_OPTIONS -DSQLITE_WINNT_MAX_PATH_CHARS=4096
@@ -265,10 +268,16 @@
268 # Options used to compile the Pikchr library.
269 #
270 set PIKCHR_OPTIONS {
271 -DPIKCHR_TOKEN_LIMIT=10000
272 }
273
274 # Options for the tmstmpvfs extension
275 #
276 set TMSTMPVFS_OPTIONS {
277 -DSQLITE_TMSTMPVFS_STATIC=1
278 }
279
280 # Options used to compile the included SQLite shell.
281 #
282 set SHELL_OPTIONS [concat $SQLITE_OPTIONS {
283 -Dmain=sqlite3_shell
@@ -371,10 +380,11 @@
380
381 writeln [string map [list \
382 <<<SQLITE_OPTIONS>>> [join $SQLITE_OPTIONS " \\\n "] \
383 <<<SHELL_OPTIONS>>> [join $SHELL_OPTIONS " \\\n "] \
384 <<<PIKCHR_OPTIONS>>> [join $PIKCHR_OPTIONS " \\\n "] \
385 <<<TMSTMPVFS_OPTIONS>>> [join $TMSTMPVFS_OPTIONS " \\\n "] \
386 <<<NEXT_LINE>>> \\] {
387 all: $(APPNAME)
388
389 install: all
390 mkdir -p $(INSTALLDIR)
@@ -437,10 +447,11 @@
447 # Setup the options used to compile the included SQLite shell.
448 SHELL_OPTIONS = <<<SHELL_OPTIONS>>>
449
450 # Setup the options used to compile the included Pikchr formatter.
451 PIKCHR_OPTIONS = <<<PIKCHR_OPTIONS>>>
452 TMSTMPVFS_OPTIONS = <<<TMSTMPVFS_OPTIONS>>>
453
454 # The USE_SYSTEM_SQLITE variable may be undefined, set to 0 or 1.
455 # If it is set to 1, then there is no need to build or link
456 # the sqlite3.o object. Instead, the system SQLite will be linked
457 # using -lsqlite3.
@@ -486,10 +497,11 @@
497 writeln [string map [list <<<NEXT_LINE>>> \\] {
498 EXTRAOBJ = <<<NEXT_LINE>>>
499 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) <<<NEXT_LINE>>>
500 $(LINENOISE_OBJ.$(USE_LINENOISE)) <<<NEXT_LINE>>>
501 $(OBJDIR)/pikchr.o <<<NEXT_LINE>>>
502 $(OBJDIR)/tmstmpvfs.o <<<NEXT_LINE>>>
503 $(OBJDIR)/shell.o <<<NEXT_LINE>>>
504 $(OBJDIR)/th.o <<<NEXT_LINE>>>
505 $(OBJDIR)/th_lang.o <<<NEXT_LINE>>>
506 $(OBJDIR)/th_tcl.o <<<NEXT_LINE>>>
507 $(OBJDIR)/cson_amalgamation.o
@@ -572,10 +584,13 @@
584 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$@\n"
585
586 writeln [string map [list <<<NEXT_LINE>>> \\] {
587 $(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c $(OBJDIR)/mkversion
588 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
589
590 $(OBJDIR)/tmstmpvfs.o: $(SRCDIR_extsrc)/tmstmpvfs.c $(OBJDIR)/mkversion
591 $(XTCC) $(TMSTMPVFS_OPTIONS) -c $(SRCDIR_extsrc)/tmstmpvfs.c -o $@
592
593 $(OBJDIR)/cson_amalgamation.o: $(SRCDIR_extsrc)/cson_amalgamation.c $(OBJDIR)/mkversion
594 $(XTCC) -c $(SRCDIR_extsrc)/cson_amalgamation.c -o $@
595
596 $(SRCDIR_extsrc)/pikchr.js: $(SRCDIR_extsrc)/pikchr.c $(MAKEFILE_LIST)
@@ -1213,10 +1228,11 @@
1228
1229 writeln [string map [list <<<NEXT_LINE>>> \\] {
1230 EXTRAOBJ = <<<NEXT_LINE>>>
1231 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) <<<NEXT_LINE>>>
1232 $(OBJDIR)/pikchr.o <<<NEXT_LINE>>>
1233 $(OBJDIR)/tmstmpvfs.o <<<NEXT_LINE>>>
1234 $(OBJDIR)/shell.o <<<NEXT_LINE>>>
1235 $(OBJDIR)/th.o <<<NEXT_LINE>>>
1236 $(OBJDIR)/th_lang.o <<<NEXT_LINE>>>
1237 $(OBJDIR)/th_tcl.o <<<NEXT_LINE>>>
1238 $(OBJDIR)/cson_amalgamation.o
@@ -1325,15 +1341,17 @@
1341 lappend MINGW_SQLITE_OPTIONS {$(MINGW_OPTIONS)}
1342 lappend MINGW_SQLITE_OPTIONS -DSQLITE_USE_MALLOC_H
1343 lappend MINGW_SQLITE_OPTIONS -DSQLITE_USE_MSIZE
1344
1345 set MINGW_PIKCHR_OPTIONS $PIKCHR_OPTIONS
1346 set MINGW_TMSTMPVFS_OPTIONS $TMSTMPVFS_OPTIONS
1347
1348 set j " \\\n "
1349 writeln "SQLITE_OPTIONS = [join $MINGW_SQLITE_OPTIONS $j]\n"
1350 writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS $j]\n"
1351 writeln "PIKCHR_OPTIONS = [join $MINGW_PIKCHR_OPTIONS $j]\n"
1352 writeln "TMSTMPVFS_OPTIONS = [join $MINGW_TMSTMPVFS_OPTIONS $j]\n"
1353
1354 writeln "\$(SQLITE3_OBJ):\t\$(SQLITE3_SRC) \$(SRCDIR)/../win/Makefile.mingw"
1355 writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) \$(SEE_FLAGS) \\"
1356 writeln "\t\t-c \$(SQLITE3_SRC) -o \$@\n"
1357
@@ -1354,10 +1372,13 @@
1372 writeln "\t\$(XTCC) -c \$(SRCDIR)/th_tcl.c -o \$@\n"
1373
1374 writeln "\$(OBJDIR)/pikchr.o:\t\$(SRCDIR_extsrc)/pikchr.c"
1375 writeln "\t\$(XTCC) \$(PIKCHR_OPTIONS) -c \$(SRCDIR_extsrc)/pikchr.c -o \$@\n"
1376
1377 writeln "\$(OBJDIR)/tmstmpvfs.o:\t\$(SRCDIR_extsrc)/tmstmpvfs.c"
1378 writeln "\t\$(XTCC) \$(TMSTMPVS_OPTIONS) -c \$(SRCDIR_extsrc)/tmstmpvfs.c -o \$@\n"
1379
1380 close $output_file
1381 #
1382 # End of the win/Makefile.mingw output
1383 ##############################################################################
1384 ##############################################################################
@@ -1399,10 +1420,11 @@
1420 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
1421 }
1422 writeln "SQLITE_OPTIONS = [join $SQLITE_OPTIONS { }]\n"
1423 writeln "SHELL_OPTIONS = [join $SHELL_WIN32_OPTIONS { }]\n"
1424 writeln "PIKCHR_OPTIONS = [join $PIKCHR_OPTIONS { }]\n"
1425 writeln "TMSTMPVFS_OPTIONS = [join $TMSTMPVFS_OPTIONS { }]\n"
1426 writeln -nonewline "SRC ="
1427 foreach s [lsort $src] {
1428 writeln -nonewline " ${s}_.c"
1429 }
1430 writeln "\n"
@@ -1847,10 +1869,14 @@
1869
1870 regsub -all {[-]D} [join $PIKCHR_OPTIONS { }] {/D} MSC_PIKCHR_OPTIONS
1871 set j " \\\n "
1872 writeln "PIKCHR_OPTIONS = [join $MSC_PIKCHR_OPTIONS $j]\n"
1873
1874 regsub -all {[-]D} [join $TMSTMPVFS_OPTIONS { }] {/D} MSC_TMSTMPVFS_OPTIONS
1875 set j " \\\n "
1876 writeln "TMSTMPVFS_OPTIONS = [join $MSC_TMSTMPVFS_OPTIONS $j]\n"
1877
1878 writeln -nonewline "SRC = "
1879 set i 0
1880 foreach s [lsort $src] {
1881 if {$i > 0} {
1882 writeln " \\"
@@ -1873,11 +1899,11 @@
1899 }
1900 set s [regsub -all / $s \\]
1901 writeln -nonewline "\"\$(SRCDIR)\\${s}\""; incr i
1902 }
1903 writeln "\n"
1904 set AdditionalObj [list shell sqlite3 th th_lang th_tcl cson_amalgamation pikchr tmstmpvfs]
1905 writeln -nonewline "OBJ = "
1906 set i 0
1907 foreach s [lsort [concat $src $AdditionalObj]] {
1908 if {$i > 0} {
1909 writeln " \\"
@@ -2033,10 +2059,13 @@
2059 "$(OX)\th_tcl$O" : "$(SRCDIR)\th_tcl.c"
2060 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
2061
2062 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
2063 $(TCC) $(PIKCHR_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
2064
2065 "$(OX)\tmstmpvfs$O" : "$(SRCDIR_extsrc)\tmstmpvfs.c"
2066 $(TCC) $(TMSTMPVFS_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
2067
2068 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
2069 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
2070
2071 "$(B)\phony.h" :
2072
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -26,15 +26,17 @@
2626
CFLAGS = -o
2727
BCC = $(DMDIR)\bin\dmc $(CFLAGS)
2828
TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
2929
LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
3030
31
-SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP
31
+SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs
3232
33
-SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
33
+SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
3434
3535
PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
36
+
37
+TMSTMPVFS_OPTIONS = -DSQLITE_TMSTMPVFS_STATIC=1
3638
3739
SRC = add_.c ajax_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c chat_.c checkin_.c checkout_.c clearsign_.c clone_.c color_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c hook_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c interwiki_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c match_.c md5_.c merge_.c merge3_.c moderate_.c name_.c patch_.c path_.c piechart_.c pikchrshow_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c robot_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c xfer_.c xfersetup_.c xsystem_.c zip_.c
3840
3941
OBJ = $(OBJDIR)\add$O $(OBJDIR)\ajax$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\chat$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\color$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\hook$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\interwiki$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\match$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\patch$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pikchrshow$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\robot$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\xsystem$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
4042
@@ -1027,7 +1029,7 @@
10271029
10281030
zip_.c : $(SRCDIR)\zip.c
10291031
+translate$E $** > $@
10301032
10311033
headers: makeheaders$E page_index.h builtin_data.h VERSION.h
1032
- +makeheaders$E add_.c:add.h ajax_.c:ajax.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h chat_.c:chat.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h color_.c:color.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h hook_.c:hook.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h interwiki_.c:interwiki.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h match_.c:match.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h patch_.c:patch.h path_.c:path.h piechart_.c:piechart.h pikchrshow_.c:pikchrshow.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h robot_.c:robot.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h xsystem_.c:xsystem.h zip_.c:zip.h $(SRCDIR_extsrc)\pikchr.c:pikchr.h $(SRCDIR_extsrc)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR_extsrc)\cson_amalgamation.h
1034
+ +makeheaders$E add_.c:add.h ajax_.c:ajax.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h chat_.c:chat.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h color_.c:color.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h hook_.c:hook.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h interwiki_.c:interwiki.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h match_.c:match.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h patch_.c:patch.h path_.c:path.h piechart_.c:piechart.h pikchrshow_.c:pikchrshow.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h robot_.c:robot.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h xsystem_.c:xsystem.h zip_.c:zip.h $(SRCDIR_extsrc)\pikchr.c:pikchr.h $(SRCDIR_extsrc)\tmstmpvfs.c:tmstmpvfs.h $(SRCDIR_extsrc)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR_extsrc)\cson_amalgamation.h
10331035
@copy /Y nul: headers
10341036
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -26,15 +26,17 @@
26 CFLAGS = -o
27 BCC = $(DMDIR)\bin\dmc $(CFLAGS)
28 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
29 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
30
31 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP
32
33 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
34
35 PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
 
 
36
37 SRC = add_.c ajax_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c chat_.c checkin_.c checkout_.c clearsign_.c clone_.c color_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c hook_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c interwiki_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c match_.c md5_.c merge_.c merge3_.c moderate_.c name_.c patch_.c path_.c piechart_.c pikchrshow_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c robot_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c xfer_.c xfersetup_.c xsystem_.c zip_.c
38
39 OBJ = $(OBJDIR)\add$O $(OBJDIR)\ajax$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\chat$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\color$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\hook$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\interwiki$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\match$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\patch$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pikchrshow$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\robot$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\xsystem$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
40
@@ -1027,7 +1029,7 @@
1027
1028 zip_.c : $(SRCDIR)\zip.c
1029 +translate$E $** > $@
1030
1031 headers: makeheaders$E page_index.h builtin_data.h VERSION.h
1032 +makeheaders$E add_.c:add.h ajax_.c:ajax.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h chat_.c:chat.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h color_.c:color.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h hook_.c:hook.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h interwiki_.c:interwiki.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h match_.c:match.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h patch_.c:patch.h path_.c:path.h piechart_.c:piechart.h pikchrshow_.c:pikchrshow.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h robot_.c:robot.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h xsystem_.c:xsystem.h zip_.c:zip.h $(SRCDIR_extsrc)\pikchr.c:pikchr.h $(SRCDIR_extsrc)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR_extsrc)\cson_amalgamation.h
1033 @copy /Y nul: headers
1034
--- win/Makefile.dmc
+++ win/Makefile.dmc
@@ -26,15 +26,17 @@
26 CFLAGS = -o
27 BCC = $(DMDIR)\bin\dmc $(CFLAGS)
28 TCC = $(DMDIR)\bin\dmc $(CFLAGS) $(DMCDEF) $(SSL) $(INCL)
29 LIBS = $(DMDIR)\extra\lib\ zlib wsock32 advapi32 dnsapi
30
31 SQLITE_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs
32
33 SHELL_OPTIONS = -DNDEBUG=1 -DSQLITE_DQS=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PERCENTILE -DSQLITE_ENABLE_SETLK_TIMEOUT -DSQLITE_ENABLE_STMTVTAB -DSQLITE_HAVE_ZLIB -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_TRUSTED_SCHEMA=0 -DHAVE_USLEEP -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs -Dmain=sqlite3_shell -DSQLITE_SHELL_IS_UTF8=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname -DSQLITE_SHELL_INIT_PROC=sqlcmd_init_proc -Daccess=file_access -Dsystem=fossil_system -Dgetenv=fossil_getenv -Dfopen=fossil_fopen
34
35 PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
36
37 TMSTMPVFS_OPTIONS = -DSQLITE_TMSTMPVFS_STATIC=1
38
39 SRC = add_.c ajax_.c alerts_.c allrepo_.c attach_.c backlink_.c backoffice_.c bag_.c bisect_.c blob_.c branch_.c browse_.c builtin_.c bundle_.c cache_.c capabilities_.c captcha_.c cgi_.c chat_.c checkin_.c checkout_.c clearsign_.c clone_.c color_.c comformat_.c configure_.c content_.c cookies_.c db_.c delta_.c deltacmd_.c deltafunc_.c descendants_.c diff_.c diffcmd_.c dispatch_.c doc_.c encode_.c etag_.c event_.c export_.c extcgi_.c file_.c fileedit_.c finfo_.c foci_.c forum_.c fshell_.c fusefs_.c fuzz_.c glob_.c graph_.c gzip_.c hname_.c hook_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c interwiki_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c match_.c md5_.c merge_.c merge3_.c moderate_.c name_.c patch_.c path_.c piechart_.c pikchrshow_.c pivot_.c popen_.c pqueue_.c printf_.c publish_.c purge_.c rebuild_.c regexp_.c repolist_.c report_.c robot_.c rss_.c schema_.c search_.c security_audit_.c setup_.c setupuser_.c sha1_.c sha1hard_.c sha3_.c shun_.c sitemap_.c skins_.c smtp_.c sqlcmd_.c stash_.c stat_.c statrep_.c style_.c sync_.c tag_.c tar_.c terminal_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c unversioned_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c xfer_.c xfersetup_.c xsystem_.c zip_.c
40
41 OBJ = $(OBJDIR)\add$O $(OBJDIR)\ajax$O $(OBJDIR)\alerts$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\backlink$O $(OBJDIR)\backoffice$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\builtin$O $(OBJDIR)\bundle$O $(OBJDIR)\cache$O $(OBJDIR)\capabilities$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\chat$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\color$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\cookies$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\deltafunc$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\dispatch$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\etag$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\extcgi$O $(OBJDIR)\file$O $(OBJDIR)\fileedit$O $(OBJDIR)\finfo$O $(OBJDIR)\foci$O $(OBJDIR)\forum$O $(OBJDIR)\fshell$O $(OBJDIR)\fusefs$O $(OBJDIR)\fuzz$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\hname$O $(OBJDIR)\hook$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\interwiki$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\match$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\patch$O $(OBJDIR)\path$O $(OBJDIR)\piechart$O $(OBJDIR)\pikchrshow$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\publish$O $(OBJDIR)\purge$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\repolist$O $(OBJDIR)\report$O $(OBJDIR)\robot$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\security_audit$O $(OBJDIR)\setup$O $(OBJDIR)\setupuser$O $(OBJDIR)\sha1$O $(OBJDIR)\sha1hard$O $(OBJDIR)\sha3$O $(OBJDIR)\shun$O $(OBJDIR)\sitemap$O $(OBJDIR)\skins$O $(OBJDIR)\smtp$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\statrep$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\terminal$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\unversioned$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\xsystem$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O
42
@@ -1027,7 +1029,7 @@
1029
1030 zip_.c : $(SRCDIR)\zip.c
1031 +translate$E $** > $@
1032
1033 headers: makeheaders$E page_index.h builtin_data.h VERSION.h
1034 +makeheaders$E add_.c:add.h ajax_.c:ajax.h alerts_.c:alerts.h allrepo_.c:allrepo.h attach_.c:attach.h backlink_.c:backlink.h backoffice_.c:backoffice.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h builtin_.c:builtin.h bundle_.c:bundle.h cache_.c:cache.h capabilities_.c:capabilities.h captcha_.c:captcha.h cgi_.c:cgi.h chat_.c:chat.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h color_.c:color.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h cookies_.c:cookies.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h deltafunc_.c:deltafunc.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h dispatch_.c:dispatch.h doc_.c:doc.h encode_.c:encode.h etag_.c:etag.h event_.c:event.h export_.c:export.h extcgi_.c:extcgi.h file_.c:file.h fileedit_.c:fileedit.h finfo_.c:finfo.h foci_.c:foci.h forum_.c:forum.h fshell_.c:fshell.h fusefs_.c:fusefs.h fuzz_.c:fuzz.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h hname_.c:hname.h hook_.c:hook.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h interwiki_.c:interwiki.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h match_.c:match.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h patch_.c:patch.h path_.c:path.h piechart_.c:piechart.h pikchrshow_.c:pikchrshow.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h publish_.c:publish.h purge_.c:purge.h rebuild_.c:rebuild.h regexp_.c:regexp.h repolist_.c:repolist.h report_.c:report.h robot_.c:robot.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h security_audit_.c:security_audit.h setup_.c:setup.h setupuser_.c:setupuser.h sha1_.c:sha1.h sha1hard_.c:sha1hard.h sha3_.c:sha3.h shun_.c:shun.h sitemap_.c:sitemap.h skins_.c:skins.h smtp_.c:smtp.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h statrep_.c:statrep.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h terminal_.c:terminal.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h unversioned_.c:unversioned.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h xsystem_.c:xsystem.h zip_.c:zip.h $(SRCDIR_extsrc)\pikchr.c:pikchr.h $(SRCDIR_extsrc)\tmstmpvfs.c:tmstmpvfs.h $(SRCDIR_extsrc)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR_extsrc)\cson_amalgamation.h
1035 @copy /Y nul: headers
1036
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1109,10 +1109,11 @@
11091109
11101110
11111111
EXTRAOBJ = \
11121112
$(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) \
11131113
$(OBJDIR)/pikchr.o \
1114
+ $(OBJDIR)/tmstmpvfs.o \
11141115
$(OBJDIR)/shell.o \
11151116
$(OBJDIR)/th.o \
11161117
$(OBJDIR)/th_lang.o \
11171118
$(OBJDIR)/th_tcl.o \
11181119
$(OBJDIR)/cson_amalgamation.o
@@ -1328,10 +1329,11 @@
13281329
$(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h \
13291330
$(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h \
13301331
$(OBJDIR)/xsystem_.c:$(OBJDIR)/xsystem.h \
13311332
$(OBJDIR)/zip_.c:$(OBJDIR)/zip.h \
13321333
$(SRCDIR_extsrc)/pikchr.c:$(OBJDIR)/pikchr.h \
1334
+ $(SRCDIR_extsrc)/tmstmpvfs.c:$(OBJDIR)/tmstmpvfs.h \
13331335
$(SRCDIR_extsrc)/sqlite3.h \
13341336
$(SRCDIR)/th.h \
13351337
$(OBJDIR)/VERSION.h
13361338
echo Done >$(OBJDIR)/headers
13371339
@@ -2565,10 +2567,11 @@
25652567
-DSQLITE_ENABLE_STMTVTAB \
25662568
-DSQLITE_HAVE_ZLIB \
25672569
-DSQLITE_ENABLE_DBPAGE_VTAB \
25682570
-DSQLITE_TRUSTED_SCHEMA=0 \
25692571
-DHAVE_USLEEP \
2572
+ -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
25702573
-DSQLITE_WIN32_NO_ANSI \
25712574
$(MINGW_OPTIONS) \
25722575
-DSQLITE_USE_MALLOC_H \
25732576
-DSQLITE_USE_MSIZE
25742577
@@ -2596,10 +2599,11 @@
25962599
-DSQLITE_ENABLE_STMTVTAB \
25972600
-DSQLITE_HAVE_ZLIB \
25982601
-DSQLITE_ENABLE_DBPAGE_VTAB \
25992602
-DSQLITE_TRUSTED_SCHEMA=0 \
26002603
-DHAVE_USLEEP \
2604
+ -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
26012605
-Dmain=sqlite3_shell \
26022606
-DSQLITE_SHELL_IS_UTF8=1 \
26032607
-DSQLITE_OMIT_LOAD_EXTENSION=1 \
26042608
-DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
26052609
-DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
@@ -2608,10 +2612,12 @@
26082612
-Dsystem=fossil_system \
26092613
-Dgetenv=fossil_getenv \
26102614
-Dfopen=fossil_fopen
26112615
26122616
PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
2617
+
2618
+TMSTMPVFS_OPTIONS = -DSQLITE_TMSTMPVFS_STATIC=1
26132619
26142620
$(SQLITE3_OBJ): $(SQLITE3_SRC) $(SRCDIR)/../win/Makefile.mingw
26152621
$(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) $(SEE_FLAGS) \
26162622
-c $(SQLITE3_SRC) -o $@
26172623
@@ -2633,5 +2639,8 @@
26332639
$(XTCC) -c $(SRCDIR)/th_tcl.c -o $@
26342640
26352641
$(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c
26362642
$(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
26372643
2644
+$(OBJDIR)/tmstmpvfs.o: $(SRCDIR_extsrc)/tmstmpvfs.c
2645
+ $(XTCC) $(TMSTMPVS_OPTIONS) -c $(SRCDIR_extsrc)/tmstmpvfs.c -o $@
2646
+
26382647
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1109,10 +1109,11 @@
1109
1110
1111 EXTRAOBJ = \
1112 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) \
1113 $(OBJDIR)/pikchr.o \
 
1114 $(OBJDIR)/shell.o \
1115 $(OBJDIR)/th.o \
1116 $(OBJDIR)/th_lang.o \
1117 $(OBJDIR)/th_tcl.o \
1118 $(OBJDIR)/cson_amalgamation.o
@@ -1328,10 +1329,11 @@
1328 $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h \
1329 $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h \
1330 $(OBJDIR)/xsystem_.c:$(OBJDIR)/xsystem.h \
1331 $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h \
1332 $(SRCDIR_extsrc)/pikchr.c:$(OBJDIR)/pikchr.h \
 
1333 $(SRCDIR_extsrc)/sqlite3.h \
1334 $(SRCDIR)/th.h \
1335 $(OBJDIR)/VERSION.h
1336 echo Done >$(OBJDIR)/headers
1337
@@ -2565,10 +2567,11 @@
2565 -DSQLITE_ENABLE_STMTVTAB \
2566 -DSQLITE_HAVE_ZLIB \
2567 -DSQLITE_ENABLE_DBPAGE_VTAB \
2568 -DSQLITE_TRUSTED_SCHEMA=0 \
2569 -DHAVE_USLEEP \
 
2570 -DSQLITE_WIN32_NO_ANSI \
2571 $(MINGW_OPTIONS) \
2572 -DSQLITE_USE_MALLOC_H \
2573 -DSQLITE_USE_MSIZE
2574
@@ -2596,10 +2599,11 @@
2596 -DSQLITE_ENABLE_STMTVTAB \
2597 -DSQLITE_HAVE_ZLIB \
2598 -DSQLITE_ENABLE_DBPAGE_VTAB \
2599 -DSQLITE_TRUSTED_SCHEMA=0 \
2600 -DHAVE_USLEEP \
 
2601 -Dmain=sqlite3_shell \
2602 -DSQLITE_SHELL_IS_UTF8=1 \
2603 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2604 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
2605 -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
@@ -2608,10 +2612,12 @@
2608 -Dsystem=fossil_system \
2609 -Dgetenv=fossil_getenv \
2610 -Dfopen=fossil_fopen
2611
2612 PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
 
 
2613
2614 $(SQLITE3_OBJ): $(SQLITE3_SRC) $(SRCDIR)/../win/Makefile.mingw
2615 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) $(SEE_FLAGS) \
2616 -c $(SQLITE3_SRC) -o $@
2617
@@ -2633,5 +2639,8 @@
2633 $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@
2634
2635 $(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c
2636 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
2637
 
 
 
2638
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -1109,10 +1109,11 @@
1109
1110
1111 EXTRAOBJ = \
1112 $(SQLITE3_OBJ.$(SQLITE3_ORIGIN)) \
1113 $(OBJDIR)/pikchr.o \
1114 $(OBJDIR)/tmstmpvfs.o \
1115 $(OBJDIR)/shell.o \
1116 $(OBJDIR)/th.o \
1117 $(OBJDIR)/th_lang.o \
1118 $(OBJDIR)/th_tcl.o \
1119 $(OBJDIR)/cson_amalgamation.o
@@ -1328,10 +1329,11 @@
1329 $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h \
1330 $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h \
1331 $(OBJDIR)/xsystem_.c:$(OBJDIR)/xsystem.h \
1332 $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h \
1333 $(SRCDIR_extsrc)/pikchr.c:$(OBJDIR)/pikchr.h \
1334 $(SRCDIR_extsrc)/tmstmpvfs.c:$(OBJDIR)/tmstmpvfs.h \
1335 $(SRCDIR_extsrc)/sqlite3.h \
1336 $(SRCDIR)/th.h \
1337 $(OBJDIR)/VERSION.h
1338 echo Done >$(OBJDIR)/headers
1339
@@ -2565,10 +2567,11 @@
2567 -DSQLITE_ENABLE_STMTVTAB \
2568 -DSQLITE_HAVE_ZLIB \
2569 -DSQLITE_ENABLE_DBPAGE_VTAB \
2570 -DSQLITE_TRUSTED_SCHEMA=0 \
2571 -DHAVE_USLEEP \
2572 -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
2573 -DSQLITE_WIN32_NO_ANSI \
2574 $(MINGW_OPTIONS) \
2575 -DSQLITE_USE_MALLOC_H \
2576 -DSQLITE_USE_MSIZE
2577
@@ -2596,10 +2599,11 @@
2599 -DSQLITE_ENABLE_STMTVTAB \
2600 -DSQLITE_HAVE_ZLIB \
2601 -DSQLITE_ENABLE_DBPAGE_VTAB \
2602 -DSQLITE_TRUSTED_SCHEMA=0 \
2603 -DHAVE_USLEEP \
2604 -DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
2605 -Dmain=sqlite3_shell \
2606 -DSQLITE_SHELL_IS_UTF8=1 \
2607 -DSQLITE_OMIT_LOAD_EXTENSION=1 \
2608 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
2609 -DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
@@ -2608,10 +2612,12 @@
2612 -Dsystem=fossil_system \
2613 -Dgetenv=fossil_getenv \
2614 -Dfopen=fossil_fopen
2615
2616 PIKCHR_OPTIONS = -DPIKCHR_TOKEN_LIMIT=10000
2617
2618 TMSTMPVFS_OPTIONS = -DSQLITE_TMSTMPVFS_STATIC=1
2619
2620 $(SQLITE3_OBJ): $(SQLITE3_SRC) $(SRCDIR)/../win/Makefile.mingw
2621 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) $(SEE_FLAGS) \
2622 -c $(SQLITE3_SRC) -o $@
2623
@@ -2633,5 +2639,8 @@
2639 $(XTCC) -c $(SRCDIR)/th_tcl.c -o $@
2640
2641 $(OBJDIR)/pikchr.o: $(SRCDIR_extsrc)/pikchr.c
2642 $(XTCC) $(PIKCHR_OPTIONS) -c $(SRCDIR_extsrc)/pikchr.c -o $@
2643
2644 $(OBJDIR)/tmstmpvfs.o: $(SRCDIR_extsrc)/tmstmpvfs.c
2645 $(XTCC) $(TMSTMPVS_OPTIONS) -c $(SRCDIR_extsrc)/tmstmpvfs.c -o $@
2646
2647
+12 -1
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -323,10 +323,11 @@
323323
/DSQLITE_ENABLE_STMTVTAB \
324324
/DSQLITE_HAVE_ZLIB \
325325
/DSQLITE_ENABLE_DBPAGE_VTAB \
326326
/DSQLITE_TRUSTED_SCHEMA=0 \
327327
/DHAVE_USLEEP \
328
+ /DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
328329
/DSQLITE_WIN32_NO_ANSI
329330
330331
SHELL_OPTIONS = /DNDEBUG=1 \
331332
/DSQLITE_DQS=0 \
332333
/DSQLITE_THREADSAFE=0 \
@@ -351,10 +352,11 @@
351352
/DSQLITE_ENABLE_STMTVTAB \
352353
/DSQLITE_HAVE_ZLIB \
353354
/DSQLITE_ENABLE_DBPAGE_VTAB \
354355
/DSQLITE_TRUSTED_SCHEMA=0 \
355356
/DHAVE_USLEEP \
357
+ /DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
356358
/Dmain=sqlite3_shell \
357359
/DSQLITE_SHELL_IS_UTF8=1 \
358360
/DSQLITE_OMIT_LOAD_EXTENSION=1 \
359361
/DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
360362
/DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
@@ -363,10 +365,12 @@
363365
/Dsystem=fossil_system \
364366
/Dgetenv=fossil_getenv \
365367
/Dfopen=fossil_fopen
366368
367369
PIKCHR_OPTIONS = /DPIKCHR_TOKEN_LIMIT=10000
370
+
371
+TMSTMPVFS_OPTIONS = /DSQLITE_TMSTMPVFS_STATIC=1
368372
369373
SRC = "$(OX)\add_.c" \
370374
"$(OX)\ajax_.c" \
371375
"$(OX)\alerts_.c" \
372376
"$(OX)\allrepo_.c" \
@@ -514,11 +518,12 @@
514518
"$(OX)\winhttp_.c" \
515519
"$(OX)\xfer_.c" \
516520
"$(OX)\xfersetup_.c" \
517521
"$(OX)\xsystem_.c" \
518522
"$(OX)\zip_.c" \
519
- "$(SRCDIR_extsrc)\pikchr.c"
523
+ "$(SRCDIR_extsrc)\pikchr.c" \
524
+ "$(SRCDIR_extsrc)\tmstmpvfs.c"
520525
521526
EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
522527
"$(SRCDIR)\..\extsrc\pikchr.js" \
523528
"$(SRCDIR)\..\extsrc\pikchr.wasm" \
524529
"$(SRCDIR)\..\skins\ardoise\css.txt" \
@@ -771,10 +776,11 @@
771776
"$(OX)\th_main$O" \
772777
"$(OX)\th_tcl$O" \
773778
"$(OX)\timeline$O" \
774779
"$(OX)\tkt$O" \
775780
"$(OX)\tktsetup$O" \
781
+ "$(OX)\tmstmpvfs$O" \
776782
"$(OX)\undo$O" \
777783
"$(OX)\unicode$O" \
778784
"$(OX)\unversioned$O" \
779785
"$(OX)\update$O" \
780786
"$(OX)\url$O" \
@@ -1023,10 +1029,11 @@
10231029
echo "$(OX)\th_main.obj" >> $@
10241030
echo "$(OX)\th_tcl.obj" >> $@
10251031
echo "$(OX)\timeline.obj" >> $@
10261032
echo "$(OX)\tkt.obj" >> $@
10271033
echo "$(OX)\tktsetup.obj" >> $@
1034
+ echo "$(OX)\tmstmpvfs.obj" >> $@
10281035
echo "$(OX)\undo.obj" >> $@
10291036
echo "$(OX)\unicode.obj" >> $@
10301037
echo "$(OX)\unversioned.obj" >> $@
10311038
echo "$(OX)\update.obj" >> $@
10321039
echo "$(OX)\url.obj" >> $@
@@ -1088,10 +1095,13 @@
10881095
"$(OX)\th_tcl$O" : "$(SRCDIR)\th_tcl.c"
10891096
$(TCC) /Fo$@ /Fd$(@D)\ -c $**
10901097
10911098
"$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
10921099
$(TCC) $(PIKCHR_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
1100
+
1101
+"$(OX)\tmstmpvfs$O" : "$(SRCDIR_extsrc)\tmstmpvfs.c"
1102
+ $(TCC) $(TMSTMPVFS_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
10931103
10941104
"$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
10951105
"$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
10961106
10971107
"$(B)\phony.h" :
@@ -2325,10 +2335,11 @@
23252335
"$(OX)\xfer_.c":"$(OX)\xfer.h" \
23262336
"$(OX)\xfersetup_.c":"$(OX)\xfersetup.h" \
23272337
"$(OX)\xsystem_.c":"$(OX)\xsystem.h" \
23282338
"$(OX)\zip_.c":"$(OX)\zip.h" \
23292339
"$(SRCDIR_extsrc)\pikchr.c":"$(OX)\pikchr.h" \
2340
+ "$(SRCDIR_extsrc)\tmstmpvfs.c":"$(OX)\tmstmpvfs.h" \
23302341
"$(SRCDIR_extsrc)\sqlite3.h" \
23312342
"$(SRCDIR)\th.h" \
23322343
"$(OX)\VERSION.h" \
23332344
"$(SRCDIR_extsrc)\cson_amalgamation.h"
23342345
@copy /Y nul: $@
23352346
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -323,10 +323,11 @@
323 /DSQLITE_ENABLE_STMTVTAB \
324 /DSQLITE_HAVE_ZLIB \
325 /DSQLITE_ENABLE_DBPAGE_VTAB \
326 /DSQLITE_TRUSTED_SCHEMA=0 \
327 /DHAVE_USLEEP \
 
328 /DSQLITE_WIN32_NO_ANSI
329
330 SHELL_OPTIONS = /DNDEBUG=1 \
331 /DSQLITE_DQS=0 \
332 /DSQLITE_THREADSAFE=0 \
@@ -351,10 +352,11 @@
351 /DSQLITE_ENABLE_STMTVTAB \
352 /DSQLITE_HAVE_ZLIB \
353 /DSQLITE_ENABLE_DBPAGE_VTAB \
354 /DSQLITE_TRUSTED_SCHEMA=0 \
355 /DHAVE_USLEEP \
 
356 /Dmain=sqlite3_shell \
357 /DSQLITE_SHELL_IS_UTF8=1 \
358 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
359 /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
360 /DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
@@ -363,10 +365,12 @@
363 /Dsystem=fossil_system \
364 /Dgetenv=fossil_getenv \
365 /Dfopen=fossil_fopen
366
367 PIKCHR_OPTIONS = /DPIKCHR_TOKEN_LIMIT=10000
 
 
368
369 SRC = "$(OX)\add_.c" \
370 "$(OX)\ajax_.c" \
371 "$(OX)\alerts_.c" \
372 "$(OX)\allrepo_.c" \
@@ -514,11 +518,12 @@
514 "$(OX)\winhttp_.c" \
515 "$(OX)\xfer_.c" \
516 "$(OX)\xfersetup_.c" \
517 "$(OX)\xsystem_.c" \
518 "$(OX)\zip_.c" \
519 "$(SRCDIR_extsrc)\pikchr.c"
 
520
521 EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
522 "$(SRCDIR)\..\extsrc\pikchr.js" \
523 "$(SRCDIR)\..\extsrc\pikchr.wasm" \
524 "$(SRCDIR)\..\skins\ardoise\css.txt" \
@@ -771,10 +776,11 @@
771 "$(OX)\th_main$O" \
772 "$(OX)\th_tcl$O" \
773 "$(OX)\timeline$O" \
774 "$(OX)\tkt$O" \
775 "$(OX)\tktsetup$O" \
 
776 "$(OX)\undo$O" \
777 "$(OX)\unicode$O" \
778 "$(OX)\unversioned$O" \
779 "$(OX)\update$O" \
780 "$(OX)\url$O" \
@@ -1023,10 +1029,11 @@
1023 echo "$(OX)\th_main.obj" >> $@
1024 echo "$(OX)\th_tcl.obj" >> $@
1025 echo "$(OX)\timeline.obj" >> $@
1026 echo "$(OX)\tkt.obj" >> $@
1027 echo "$(OX)\tktsetup.obj" >> $@
 
1028 echo "$(OX)\undo.obj" >> $@
1029 echo "$(OX)\unicode.obj" >> $@
1030 echo "$(OX)\unversioned.obj" >> $@
1031 echo "$(OX)\update.obj" >> $@
1032 echo "$(OX)\url.obj" >> $@
@@ -1088,10 +1095,13 @@
1088 "$(OX)\th_tcl$O" : "$(SRCDIR)\th_tcl.c"
1089 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1090
1091 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
1092 $(TCC) $(PIKCHR_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
 
 
 
1093
1094 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
1095 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
1096
1097 "$(B)\phony.h" :
@@ -2325,10 +2335,11 @@
2325 "$(OX)\xfer_.c":"$(OX)\xfer.h" \
2326 "$(OX)\xfersetup_.c":"$(OX)\xfersetup.h" \
2327 "$(OX)\xsystem_.c":"$(OX)\xsystem.h" \
2328 "$(OX)\zip_.c":"$(OX)\zip.h" \
2329 "$(SRCDIR_extsrc)\pikchr.c":"$(OX)\pikchr.h" \
 
2330 "$(SRCDIR_extsrc)\sqlite3.h" \
2331 "$(SRCDIR)\th.h" \
2332 "$(OX)\VERSION.h" \
2333 "$(SRCDIR_extsrc)\cson_amalgamation.h"
2334 @copy /Y nul: $@
2335
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -323,10 +323,11 @@
323 /DSQLITE_ENABLE_STMTVTAB \
324 /DSQLITE_HAVE_ZLIB \
325 /DSQLITE_ENABLE_DBPAGE_VTAB \
326 /DSQLITE_TRUSTED_SCHEMA=0 \
327 /DHAVE_USLEEP \
328 /DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
329 /DSQLITE_WIN32_NO_ANSI
330
331 SHELL_OPTIONS = /DNDEBUG=1 \
332 /DSQLITE_DQS=0 \
333 /DSQLITE_THREADSAFE=0 \
@@ -351,10 +352,11 @@
352 /DSQLITE_ENABLE_STMTVTAB \
353 /DSQLITE_HAVE_ZLIB \
354 /DSQLITE_ENABLE_DBPAGE_VTAB \
355 /DSQLITE_TRUSTED_SCHEMA=0 \
356 /DHAVE_USLEEP \
357 /DSQLITE_EXTRA_INIT=sqlite3_register_tmstmpvfs \
358 /Dmain=sqlite3_shell \
359 /DSQLITE_SHELL_IS_UTF8=1 \
360 /DSQLITE_OMIT_LOAD_EXTENSION=1 \
361 /DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) \
362 /DSQLITE_SHELL_DBNAME_PROC=sqlcmd_get_dbname \
@@ -363,10 +365,12 @@
365 /Dsystem=fossil_system \
366 /Dgetenv=fossil_getenv \
367 /Dfopen=fossil_fopen
368
369 PIKCHR_OPTIONS = /DPIKCHR_TOKEN_LIMIT=10000
370
371 TMSTMPVFS_OPTIONS = /DSQLITE_TMSTMPVFS_STATIC=1
372
373 SRC = "$(OX)\add_.c" \
374 "$(OX)\ajax_.c" \
375 "$(OX)\alerts_.c" \
376 "$(OX)\allrepo_.c" \
@@ -514,11 +518,12 @@
518 "$(OX)\winhttp_.c" \
519 "$(OX)\xfer_.c" \
520 "$(OX)\xfersetup_.c" \
521 "$(OX)\xsystem_.c" \
522 "$(OX)\zip_.c" \
523 "$(SRCDIR_extsrc)\pikchr.c" \
524 "$(SRCDIR_extsrc)\tmstmpvfs.c"
525
526 EXTRA_FILES = "$(SRCDIR)\..\extsrc\pikchr-worker.js" \
527 "$(SRCDIR)\..\extsrc\pikchr.js" \
528 "$(SRCDIR)\..\extsrc\pikchr.wasm" \
529 "$(SRCDIR)\..\skins\ardoise\css.txt" \
@@ -771,10 +776,11 @@
776 "$(OX)\th_main$O" \
777 "$(OX)\th_tcl$O" \
778 "$(OX)\timeline$O" \
779 "$(OX)\tkt$O" \
780 "$(OX)\tktsetup$O" \
781 "$(OX)\tmstmpvfs$O" \
782 "$(OX)\undo$O" \
783 "$(OX)\unicode$O" \
784 "$(OX)\unversioned$O" \
785 "$(OX)\update$O" \
786 "$(OX)\url$O" \
@@ -1023,10 +1029,11 @@
1029 echo "$(OX)\th_main.obj" >> $@
1030 echo "$(OX)\th_tcl.obj" >> $@
1031 echo "$(OX)\timeline.obj" >> $@
1032 echo "$(OX)\tkt.obj" >> $@
1033 echo "$(OX)\tktsetup.obj" >> $@
1034 echo "$(OX)\tmstmpvfs.obj" >> $@
1035 echo "$(OX)\undo.obj" >> $@
1036 echo "$(OX)\unicode.obj" >> $@
1037 echo "$(OX)\unversioned.obj" >> $@
1038 echo "$(OX)\update.obj" >> $@
1039 echo "$(OX)\url.obj" >> $@
@@ -1088,10 +1095,13 @@
1095 "$(OX)\th_tcl$O" : "$(SRCDIR)\th_tcl.c"
1096 $(TCC) /Fo$@ /Fd$(@D)\ -c $**
1097
1098 "$(OX)\pikchr$O" : "$(SRCDIR_extsrc)\pikchr.c"
1099 $(TCC) $(PIKCHR_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
1100
1101 "$(OX)\tmstmpvfs$O" : "$(SRCDIR_extsrc)\tmstmpvfs.c"
1102 $(TCC) $(TMSTMPVFS_OPTIONS) /Fo$@ /Fd$(@D)\ -c $**
1103
1104 "$(OX)\VERSION.h" : "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" "$(B)\phony.h"
1105 "$(OBJDIR)\mkversion$E" "$(B)\manifest.uuid" "$(B)\manifest" "$(B)\VERSION" > $@
1106
1107 "$(B)\phony.h" :
@@ -2325,10 +2335,11 @@
2335 "$(OX)\xfer_.c":"$(OX)\xfer.h" \
2336 "$(OX)\xfersetup_.c":"$(OX)\xfersetup.h" \
2337 "$(OX)\xsystem_.c":"$(OX)\xsystem.h" \
2338 "$(OX)\zip_.c":"$(OX)\zip.h" \
2339 "$(SRCDIR_extsrc)\pikchr.c":"$(OX)\pikchr.h" \
2340 "$(SRCDIR_extsrc)\tmstmpvfs.c":"$(OX)\tmstmpvfs.h" \
2341 "$(SRCDIR_extsrc)\sqlite3.h" \
2342 "$(SRCDIR)\th.h" \
2343 "$(OX)\VERSION.h" \
2344 "$(SRCDIR_extsrc)\cson_amalgamation.h"
2345 @copy /Y nul: $@
2346

Keyboard Shortcuts

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