69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
** entries should be removed. 2012-02-04 */
".fos",
".fos-journal",
".fos-wal",
".fos-shm",
};
/* Names of auxiliary files generated by SQLite when the "manifest"
** property is enabled
*/
static const char *const azManifest[] = {
"manifest",
"manifest.uuid",
};
/*
** Names of repository files, if they exist in the checkout.
*/
static const char *azRepo[4] = { 0, 0, 0, 0 };
/* Cached setting "manifest" */
static int cachedManifest = -1;
if( cachedManifest == -1 ){
Blob repo;
cachedManifest = db_get_boolean("manifest",0);
blob_zero(&repo);
if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
const char *zRepo = blob_str(&repo);
azRepo[0] = zRepo;
azRepo[1] = mprintf("%s-journal", zRepo);
azRepo[2] = mprintf("%s-wal", zRepo);
azRepo[3] = mprintf("%s-shm", zRepo);
}
}
if( N<0 ) return 0;
if( N<count(azName) ) return azName[N];
N -= count(azName);
if( cachedManifest ){
if( N<count(azManifest) ) return azManifest[N];
N -= count(azManifest);
}
if( !omitRepo && N<count(azRepo) ) return azRepo[N];
return 0;
}
/*
** Return a list of all reserved filenames as an SQL list.
|
|
|
|
>
>
>
|
|
>
>
>
>
|
>
>
>
>
>
>
|
|
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
** entries should be removed. 2012-02-04 */
".fos",
".fos-journal",
".fos-wal",
".fos-shm",
};
/* Possible names of auxiliary files generated when the "manifest" property
** is used
*/
static const struct {
const char *fname;
int flg;
}aManifestflags[] = {
{ "manifest", MFESTFLG_RAW },
{ "manifest.uuid", MFESTFLG_UUID },
{ "manifest.tags", MFESTFLG_TAGS }
};
static const char *azManifests[3];
/*
** Names of repository files, if they exist in the checkout.
*/
static const char *azRepo[4] = { 0, 0, 0, 0 };
/* Cached setting "manifest" */
static int cachedManifest = -1;
static int numManifests;
if( cachedManifest == -1 ){
int i;
Blob repo;
cachedManifest = db_get_manifest_setting();
numManifests = 0;
for(i=0; i<count(aManifestflags); i++){
if( cachedManifest&aManifestflags[i].flg ) {
azManifests[numManifests++] = aManifestflags[i].fname;
}
}
blob_zero(&repo);
if( file_tree_name(g.zRepositoryName, &repo, 0, 0) ){
const char *zRepo = blob_str(&repo);
azRepo[0] = zRepo;
azRepo[1] = mprintf("%s-journal", zRepo);
azRepo[2] = mprintf("%s-wal", zRepo);
azRepo[3] = mprintf("%s-shm", zRepo);
}
}
if( N<0 ) return 0;
if( N<count(azName) ) return azName[N];
N -= count(azName);
if( cachedManifest ){
if( N<numManifests ) return azManifests[N];
N -= numManifests;
}
if( !omitRepo && N<count(azRepo) ) return azRepo[N];
return 0;
}
/*
** Return a list of all reserved filenames as an SQL list.
|