Diff

Differences From Artifact [307533bbcd]:

To Artifact [e6f5c7aae7]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?
	# Care must be taken when editing this file as
	# it may be processed by either "xvfs-create"
	# which uses a full Tcl and Rivet parser
	# or by "xvfs-create-c" which uses a much
	# simpler one that only knows about printable
	# sections and ignores all Tcl sections

	if {[info exists ::xvfs::xvfsCoreH]} {
		::minirivet::_emitOutput $::xvfs::xvfsCoreH
	} else {
?>#include <xvfs-core.h><? } ?>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <tcl.h>

#define XVFS_NAME_LOOKUP_ERROR (-1)
#define XVFS_FILE_BLOCKSIZE 1024

/*













<







1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
<?
	# Care must be taken when editing this file as
	# it may be processed by either "xvfs-create"
	# which uses a full Tcl and Rivet parser
	# or by "xvfs-create-c" which uses a much
	# simpler one that only knows about printable
	# sections and ignores all Tcl sections

	if {[info exists ::xvfs::xvfsCoreH]} {
		::minirivet::_emitOutput $::xvfs::xvfsCoreH
	} else {
?>#include <xvfs-core.h><? } ?>
#include <sys/stat.h>

#include <string.h>
#include <tcl.h>

#define XVFS_NAME_LOOKUP_ERROR (-1)
#define XVFS_FILE_BLOCKSIZE 1024

/*
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
?><?= $::xvfs::fileInfoStruct ?>
static long xvfs_<?= $::xvfs::fsName ?>_nameToIndex(const char *path) {
<?
	set hashTable [::xvfs::generateHashTable pathIndex path pathLen XVFS_NAME_LOOKUP_ERROR $::xvfs::outputFiles prefix "\t" hashTableSize 30 validate "strcmp(path, xvfs_${::xvfs::fsName}_data\[pathIndex\].name) == 0" onValidated "return(pathIndex);"]
	set hashTableHeader [dict get $hashTable header]
?><?= $hashTableHeader ?>
	long pathIndex;
	ssize_t pathLen;

	if (path == NULL) {
		return(XVFS_NAME_LOOKUP_ERROR);
	}

	pathLen = strlen(path);








|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
?><?= $::xvfs::fileInfoStruct ?>
static long xvfs_<?= $::xvfs::fsName ?>_nameToIndex(const char *path) {
<?
	set hashTable [::xvfs::generateHashTable pathIndex path pathLen XVFS_NAME_LOOKUP_ERROR $::xvfs::outputFiles prefix "\t" hashTableSize 30 validate "strcmp(path, xvfs_${::xvfs::fsName}_data\[pathIndex\].name) == 0" onValidated "return(pathIndex);"]
	set hashTableHeader [dict get $hashTable header]
?><?= $hashTableHeader ?>
	long pathIndex;
	size_t pathLen;

	if (path == NULL) {
		return(XVFS_NAME_LOOKUP_ERROR);
	}

	pathLen = strlen(path);