⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main_tbuild.c

📁 harvest是一个下载html网页得机器人
💻 C
字号:
/* Copyright (c) 1994 Burra Gopal, Udi Manber.  All Rights Reserved. *//* * main_tbuild.c: calls tbuild.c/compute_dictionary() after reading options. */#include "defs.h"#if	ISO_CHAR_SET#include <locale.h>#endifextern int compute_dictionary();extern char **environ;#include "dummysyscalls.c"usage(progname)char	*progname;{	fprintf(stderr, "usage: %s [-H directory] [-t threshold] [-l stop-list-size]\n", progname);	fprintf(stderr, "defaults: %d %d %d ~\n", DEF_SPECIAL_WORDS, DEF_THRESHOLD, DEF_BLOCKSIZE);	exit(1);}intmain(argc, argv)	int	argc;	unsigned char	*argv[];{	char	comp_dir[MAX_LINE_LEN];	int	threshold, specialwords;	int	i = 1;	char	*home;#if	ISO_CHAR_SET	setlocale(LC_ALL, "");#endif	/* fill in default options */	comp_dir[0] = '\0';	threshold = DEF_THRESHOLD;	specialwords = DEF_SPECIAL_WORDS;	while(i < argc) {		if (argv[i][0] != '-') return usage(argv[0]);		else if (argv[i][1] == 'H') strcpy(comp_dir, argv[++i]);		else if (argv[i][1] == 't') threshold = atoi(argv[++i]);		else if (argv[i][1] == 'l') specialwords = atoi(argv[++i]);		else if (argv[i][1] == 'V') {			printf("\nThis is tbuild version %s. Copyright (c) %s, University of Arizona.\n\n", CAST_VERSION, CAST_DATE);		}		else return usage(argv[0]);		i++;	}        if (comp_dir[0] == '\0') {                if ((home = (char *)getenv("HOME")) == NULL) {                        getcwd(comp_dir, MAX_LINE_LEN-1);                        fprintf(stderr, "using working-directory '%s' to locate index\n", comp_dir);                }                else strncpy(comp_dir, home, MAX_LINE_LEN);        }	compute_dictionary(threshold, DISKBLOCKSIZE, specialwords, comp_dir);        return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -