Check-in [160dcdcda4]
Overview
Comment:Renamed options struct, to not be confused get getopt long options
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 160dcdcda41769332603eb4226d69c946df1de176a543c2c1fc1c2c310e87ab9
User & Date: rkeene on 2020-04-03 19:03:07
Other Links: manifest | tags
Context
2020-04-13
15:47
Added an "--static-init" option to creation to make the Xvfs_fsName_Init function static, if needed to be included into a .c file check-in: 717062426a user: rkeene tags: trunk
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
Changes

Modified xvfs-create-c.c from [8abf7d803b] to [56b4842ff2].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>

struct options {
	char *name;
	char *directory;
};

struct xvfs_state {
	char **children;
	unsigned long child_count;








|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>

struct xvfs_options {
	char *name;
	char *directory;
};

struct xvfs_state {
	char **children;
	unsigned long child_count;
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
	fprintf(outfp, "\t\tif (strcmp(path, xvfs_example_data[pathIndex].name) == 0) {\n");
	fprintf(outfp, "\t\t\treturn(pathIndex);\n");
	fprintf(outfp, "\t\t}\n");
	fprintf(outfp, "\t}\n");
	return;
}

static void parse_xvfs_minirivet_handle_tcl_print(FILE *outfp, const struct options * const options, struct xvfs_state *xvfs_state, char *command) {
	char *buffer_p, *buffer_e;

	buffer_p = command;
	while (*buffer_p && isspace(*buffer_p)) {
		buffer_p++;
	}








|







289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
	fprintf(outfp, "\t\tif (strcmp(path, xvfs_example_data[pathIndex].name) == 0) {\n");
	fprintf(outfp, "\t\t\treturn(pathIndex);\n");
	fprintf(outfp, "\t\t}\n");
	fprintf(outfp, "\t}\n");
	return;
}

static void parse_xvfs_minirivet_handle_tcl_print(FILE *outfp, const struct xvfs_options * const options, struct xvfs_state *xvfs_state, char *command) {
	char *buffer_p, *buffer_e;

	buffer_p = command;
	while (*buffer_p && isspace(*buffer_p)) {
		buffer_p++;
	}

324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
	} else {
		fprintf(outfp, "@INVALID@%s@INVALID@", buffer_p);
	}

	return;
}

static int parse_xvfs_minirivet(FILE *outfp, const char * const template, const struct options * const options) {
	struct xvfs_state xvfs_state;
	int ch, ch_buf;
	int template_idx = 0;
	char tcl_buffer[8192], *tcl_buffer_p;
	enum xvfs_minirivet_mode mode;

	xvfs_state.child_count = 0;







|







324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
	} else {
		fprintf(outfp, "@INVALID@%s@INVALID@", buffer_p);
	}

	return;
}

static int parse_xvfs_minirivet(FILE *outfp, const char * const template, const struct xvfs_options * const options) {
	struct xvfs_state xvfs_state;
	int ch, ch_buf;
	int template_idx = 0;
	char tcl_buffer[8192], *tcl_buffer_p;
	enum xvfs_minirivet_mode mode;

	xvfs_state.child_count = 0;
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
	}

#undef parse_xvfs_minirivet_getbyte

	return(1);
}

static int xvfs_create(FILE *outfp, const struct options * const options) {
	const int template_len = 65536;
	const char * const template_file = "lib/xvfs/xvfs.c.rvt";
	FILE *fp;
	char *template, *template_p;
	int template_remain;
	size_t fread_ret;
	int retval;







|







408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
	}

#undef parse_xvfs_minirivet_getbyte

	return(1);
}

static int xvfs_create(FILE *outfp, const struct xvfs_options * const options) {
	const int template_len = 65536;
	const char * const template_file = "lib/xvfs/xvfs.c.rvt";
	FILE *fp;
	char *template, *template_p;
	int template_remain;
	size_t fread_ret;
	int retval;
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470

	return(retval);
}

/*
 * Parse command line options
 */
static int parse_options(int argc, char **argv, struct options *options) {
	char *arg;
	char **option;
	int idx;
	int retval;

	for (idx = 0; idx < argc; idx++) {
		arg = argv[idx];







|







456
457
458
459
460
461
462
463
464
465
466
467
468
469
470

	return(retval);
}

/*
 * Parse command line options
 */
static int parse_options(int argc, char **argv, struct xvfs_options *options) {
	char *arg;
	char **option;
	int idx;
	int retval;

	for (idx = 0; idx < argc; idx++) {
		arg = argv[idx];
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
		retval = 0;
	}

	return(retval);
}

int main(int argc, char **argv) {
	struct options options = {0};
	int parse_options_ret, xvfs_create_ret;

	argc--;
	argv++;

	parse_options_ret = parse_options(argc, argv, &options);
	if (!parse_options_ret) {







|







495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
		retval = 0;
	}

	return(retval);
}

int main(int argc, char **argv) {
	struct xvfs_options options = {0};
	int parse_options_ret, xvfs_create_ret;

	argc--;
	argv++;

	parse_options_ret = parse_options(argc, argv, &options);
	if (!parse_options_ret) {