Check-in [745e0c0839]
Overview
Comment:Made the entire data for file contents read-only
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 745e0c0839dee7f16f678d44e2b232a1895d3731ae7de13ab469cf7d058ea14b
User & Date: rkeene on 2019-09-17 23:23:56
Other Links: manifest | tags
Context
2019-09-17
23:41
Added benchmark code check-in: b0e3b6588f user: rkeene tags: trunk
23:23
Made the entire data for file contents read-only check-in: 745e0c0839 user: rkeene tags: trunk
21:39
Cause a negative threshold to be really high check-in: 3c48891a32 user: rkeene tags: trunk
Changes

Modified lib/xvfs/xvfs.tcl from [4eccde71d3] to [04050e6830].

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
	if {$subDirectory eq ""} {
		set isTopLevel true
	} else {
		set isTopLevel false
	}

	if {$isTopLevel} {
		puts "static struct xvfs_file_data xvfs_${fsName}_data\[\] = \{"
	}

	# XXX:TODO: Include hidden files ?
	set children [list]
	foreach file [glob -nocomplain -tails -directory $workingDirectory *] {
		if {$file in {. ..}} {
			continue







|







133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
	if {$subDirectory eq ""} {
		set isTopLevel true
	} else {
		set isTopLevel false
	}

	if {$isTopLevel} {
		puts "static const struct xvfs_file_data xvfs_${fsName}_data\[\] = \{"
	}

	# XXX:TODO: Include hidden files ?
	set children [list]
	foreach file [glob -nocomplain -tails -directory $workingDirectory *] {
		if {$file in {. ..}} {
			continue

Modified xvfs.c.rvt from [4d040bcf2b] to [e3fb9a1248].

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
?>			break;
<?	} ?>	}
	
	return(XVFS_NAME_LOOKUP_ERROR);
}

static const char **xvfs_<?= $::xvfs::fsName ?>_getChildren(const char *path, Tcl_WideInt *count) {
	struct xvfs_file_data *fileInfo;
	long inode;

	/*
	 * Validate input parameters
	 */
	if (count == NULL) {
		return(NULL);







|







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
?>			break;
<?	} ?>	}
	
	return(XVFS_NAME_LOOKUP_ERROR);
}

static const char **xvfs_<?= $::xvfs::fsName ?>_getChildren(const char *path, Tcl_WideInt *count) {
	const struct xvfs_file_data *fileInfo;
	long inode;

	/*
	 * Validate input parameters
	 */
	if (count == NULL) {
		return(NULL);
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
	}
	
	*count = fileInfo->size;
	return(fileInfo->data.dirChildren);
}

static const unsigned char *xvfs_<?= $::xvfs::fsName ?>_getData(const char *path, Tcl_WideInt start, Tcl_WideInt *length) {
	struct xvfs_file_data *fileInfo;
	Tcl_WideInt resultLength;
	long inode;

	/*
	 * Validate input parameters
	 */
	if (length == NULL) {







|







146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
	}
	
	*count = fileInfo->size;
	return(fileInfo->data.dirChildren);
}

static const unsigned char *xvfs_<?= $::xvfs::fsName ?>_getData(const char *path, Tcl_WideInt start, Tcl_WideInt *length) {
	const struct xvfs_file_data *fileInfo;
	Tcl_WideInt resultLength;
	long inode;

	/*
	 * Validate input parameters
	 */
	if (length == NULL) {
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
	/*
	 * Return the data
	 */
	return(fileInfo->data.fileContents + start);
}

static int xvfs_<?= $::xvfs::fsName ?>_getStat(const char *path, Tcl_StatBuf *statBuf) {
	struct xvfs_file_data *fileInfo;
	long inode;

	/*
	 * Validate input parameters
	 */
	if (!statBuf) {
		return(XVFS_RV_ERR_EINVAL);







|







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
	/*
	 * Return the data
	 */
	return(fileInfo->data.fileContents + start);
}

static int xvfs_<?= $::xvfs::fsName ?>_getStat(const char *path, Tcl_StatBuf *statBuf) {
	const struct xvfs_file_data *fileInfo;
	long inode;

	/*
	 * Validate input parameters
	 */
	if (!statBuf) {
		return(XVFS_RV_ERR_EINVAL);