Check-in [f01f82c2d8]
Overview
Comment:Win32 and generic fix-ups
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f01f82c2d8b35baf067e1b170cca860f1d552e35792b553d354e1ee3e710e29b
User & Date: rkeene on 2020-04-01 21:18:23
Other Links: manifest | tags
Context
2020-04-03
19:03
Renamed options struct, to not be confused get getopt long options check-in: 160dcdcda4 user: rkeene tags: trunk
2020-04-01
21:18
Win32 and generic fix-ups check-in: f01f82c2d8 user: rkeene tags: trunk
2020-03-25
01:01
Allow setting a specific mode when building check-in: 807cab65f7 user: rkeene tags: trunk
Changes

Modified lib/xvfs/xvfs.c.rvt from [307533bbcd] to [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);

Modified xvfs-core.c from [9230846233] to [92265e645e].

1
2
3
4
5
6
7
8
9
10
11
#include <xvfs-core.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <tcl.h>

#ifdef XVFS_DEBUG
#include <stdio.h> /* Needed for XVFS_DEBUG_PRINTF */
static int xvfs_debug_depth = 0;



<







1
2
3

4
5
6
7
8
9
10
#include <xvfs-core.h>
#include <string.h>
#include <sys/stat.h>

#include <errno.h>
#include <fcntl.h>
#include <tcl.h>

#ifdef XVFS_DEBUG
#include <stdio.h> /* Needed for XVFS_DEBUG_PRINTF */
static int xvfs_debug_depth = 0;
31
32
33
34
35
36
37








38
39
40
41
42
43
44
#endif /* XVFS_MODE_FLEXIBLE || XVFS_MODE_SERVER */

#if defined(XVFS_MODE_SERVER) || defined(XVFS_MODE_STANDALONE) || defined(XVFS_MODE_FLEXIBLE)
#ifndef XVFS_ROOT_MOUNTPOINT
#  define XVFS_ROOT_MOUNTPOINT "//xvfs:/"
#endif









struct xvfs_tclfs_instance_info {
	struct Xvfs_FSInfo *fsInfo;
	Tcl_Obj            *mountpoint;
};

/*
 * Internal Core Utilities







>
>
>
>
>
>
>
>







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#endif /* XVFS_MODE_FLEXIBLE || XVFS_MODE_SERVER */

#if defined(XVFS_MODE_SERVER) || defined(XVFS_MODE_STANDALONE) || defined(XVFS_MODE_FLEXIBLE)
#ifndef XVFS_ROOT_MOUNTPOINT
#  define XVFS_ROOT_MOUNTPOINT "//xvfs:/"
#endif

/*
 * Windows lacks X_OK and W_OK
 */
#ifdef _MSC_BUILD
#  define W_OK 02
#  define X_OK 0 /* Mask it with nothing to get false */
#endif

struct xvfs_tclfs_instance_info {
	struct Xvfs_FSInfo *fsInfo;
	Tcl_Obj            *mountpoint;
};

/*
 * Internal Core Utilities