Пример #1
0
void z_zexy_setup(void)
{
	setup_0x260x260x7e(); /* 0x260x260x7e */
	setup_0x2e(); /* 0x2e */
	setup_0x3c0x7e(); /* 0x3c0x7e */
	setup_0x3d0x3d0x7e(); /* 0x3d0x3d0x7e */
	setup_0x3e0x7e(); /* 0x3e0x7e */
	setup_0x7c0x7c0x7e(); /* 0x7c0x7c0x7e */
	a2l_setup(); /* a2l */
	absgn_tilde_setup(); /* absgn~ */
	abs_tilde_setup(); /* abs~ */
	atof_setup(); /* atof */
	atoi_setup(); /* atoi */
	avg_tilde_setup(); /* avg~ */
	blockmirror_tilde_setup(); /* blockmirror~ */
	blockshuffle_tilde_setup(); /* blockshuffle~ */
	blockswap_tilde_setup(); /* blockswap~ */
	date_setup(); /* date */
	demultiplex_setup(); /* demultiplex */
	demultiplex_tilde_setup(); /* demultiplex~ */
	dfreq_tilde_setup(); /* dfreq~ */
	dirac_tilde_setup(); /* dirac~ */
	drip_setup(); /* drip */
	envrms_tilde_setup(); /* envrms~ */
	fifop_setup(); /* fifop */
	freadln_setup(); /* freadln */
	fwriteln_setup(); /* fwriteln */
	glue_setup(); /* glue */
	index_setup(); /* index */
	length_setup(); /* length */
	lifop_setup(); /* lifop */
	limiter_tilde_setup(); /* limiter~ */
	list2int_setup(); /* list2int */
	list2lists_setup(); /* list2lists */
	list2symbol_setup(); /* list2symbol */
	lister_setup(); /* lister */
	listfind_setup(); /* listfind */
	liststorage_setup(); /* liststorage */
	lpt_setup(); /* lpt */
	makesymbol_setup(); /* makesymbol */
	matchbox_setup(); /* matchbox */
	mavg_setup(); /* mavg */
	minmax_setup(); /* minmax */
	msgfile_setup(); /* msgfile */
	multiline_tilde_setup(); /* multiline~ */
	multiplex_setup(); /* multiplex */
	multiplex_tilde_setup(); /* multiplex~ */
	multireceive_setup(); /* multireceive */
	niagara_setup(); /* niagara */
	noish_tilde_setup(); /* noish~ */
	noisi_tilde_setup(); /* noisi~ */
	operating_system_setup(); /* operating_system */
	pack_setup(); /* pack */
	packel_setup(); /* packel */
	pack_tilde_setup(); /* pack~ */
	pdf_tilde_setup(); /* pdf~ */
	prime_setup(); /* prime */
	quantize_tilde_setup(); /* quantize~ */
	rawprint_setup(); /* rawprint */
	regex_setup(); /* regex */
	relay_setup(); /* relay */
	repack_setup(); /* repack */
	repeat_setup(); /* repeat */
	route_tilde_setup(); /* route~ */
	sfplay_setup(); /* sfplay */
	sfrecord_setup(); /* sfrecord */
	sgn_tilde_setup(); /* sgn~ */
	sigzero_tilde_setup(); /* sigzero~ */
	sleepgrain_setup(); /* sleepgrain */
	sort_setup(); /* sort */
	step_tilde_setup(); /* step~ */
	strcmp_setup(); /* strcmp */
	sum_setup(); /* sum */
	swap_tilde_setup(); /* swap~ */
	symbol2list_setup(); /* symbol2list */
	tabdump_setup(); /* tabdump */
	tabminmax_setup(); /* tabminmax */
	tabread4_tilde_tilde_setup(); /* tabread4~~ */
	tabset_setup(); /* tabset */
	tavg_tilde_setup(); /* tavg~ */
	time_setup(); /* time */
	unpack_setup(); /* unpack */
	unpack_tilde_setup(); /* unpack~ */
	urn_setup(); /* urn */
	wrap_setup(); /* wrap */
	z_tilde_setup(); /* z~ */
}
Пример #2
0
int
ls (int argc, char **argv)
{
    int c;
    int err = 0;

    is_rls = strcmp (cvs_cmd_name, "rls") == 0;

    if (argc == -1)
	usage (ls_usage);

    entries_format = false;
    long_format = false;
    show_tag = NULL;
    show_date = NULL;
    tag_validated = false;
    recurse = false;
    ls_prune_dirs = false;
    show_dead_revs = false;

    getoptreset ();

    while ((c = getopt (argc, argv,
#ifdef SERVER_SUPPORT
           server_active ? "qdelr:D:PR" :
#endif /* SERVER_SUPPORT */
           "delr:D:RP"
           )) != -1)
    {
	switch (c)
	{
#ifdef SERVER_SUPPORT
	    case 'q':
		if (server_active)
		{
		    error (0, 0,
"`%s ls -q' is deprecated.  Please use the global `-q' option instead.",
                           program_name);
		    quiet = true;
		}
		else
		    usage (ls_usage);
		break;
#endif /* SERVER_SUPPORT */
	    case 'd':
		show_dead_revs = true;
		break;
	    case 'e':
		entries_format = true;
		break;
	    case 'l':
		long_format = true;
		break;
	    case 'r':
		parse_tagdate (&show_tag, &show_date, optarg);
		break;
	    case 'D':
		if (show_date) free (show_date);
		show_date = Make_Date (optarg);
		break;
	    case 'P':
		ls_prune_dirs = true;
		break;
	    case 'R':
		recurse = true;
		break;
	    case '?':
	    default:
		usage (ls_usage);
		break;
	}
    }
    argc -= optind;
    argv += optind;

    if (entries_format && long_format)
    {
        error (0, 0, "`-e' & `-l' are mutually exclusive.");
        usage (ls_usage);
    }

    wrap_setup ();

#ifdef CLIENT_SUPPORT
    if (current_parsed_root->isremote)
    {
	/* We're the local client.  Fire up the remote server.	*/
	start_server ();

	ign_setup ();

	if (is_rls ? !(supported_request ("rlist") || supported_request ("ls"))
                   : !supported_request ("list"))
	    error (1, 0, "server does not support %s", cvs_cmd_name);

	if (quiet && !supported_request ("global-list-quiet"))
	    send_arg ("-q");
	if (entries_format)
	    send_arg ("-e");
	if (long_format)
	    send_arg ("-l");
	if (ls_prune_dirs)
	    send_arg ("-P");
	if (recurse)
	    send_arg ("-R");
	if (show_dead_revs)
	    send_arg ("-d");
	if (show_tag)
	    option_with_arg ("-r", show_tag);
	if (show_date)
	    client_senddate (show_date);

	send_arg ("--");

	if (is_rls)
	{
	    int i;
	    for (i = 0; i < argc; i++)
		send_arg (argv[i]);
            if (supported_request ("rlist"))
		send_to_server ("rlist\012", 0);
	    else
		/* For backwards compatibility with CVSNT...  */
		send_to_server ("ls\012", 0);
	}
	else
	{
	    /* Setting this means, I think, that any empty directories created
	     * by the server will be deleted by the client.  Since any dirs
	     * created at all by ls should remain empty, this should cause any
	     * dirs created by the server for the ls command to be deleted.
	     */
	    client_prune_dirs = 1;

	    /* I explicitly decide not to send contents here.  We *could* let
	     * the user pull status information with this command, but why
	     * don't they just use update or status?
	     */
	    send_files (argc, argv, !recurse, 0, SEND_NO_CONTENTS);
	    send_file_names (argc, argv, SEND_EXPAND_WILD);
	    send_to_server ("list\012", 0);
	}

	err = get_responses_and_close ();
	return err;
    }
#endif

    if (is_rls)
    {
	DBM *db;
	int i;
	db = open_module ();
	if (argc)
	{
	    for (i = 0; i < argc; i++)
	    {
		char *mod = xstrdup (argv[i]);
		char *p;

		for (p=strchr (mod,'\\'); p; p=strchr (p,'\\'))
		    *p='/';

		p = strrchr (mod,'/');
		if (p && (strchr (p,'?') || strchr (p,'*')))
		{
		    *p='\0';
		    regexp_match = p+1;
		}
		else
		    regexp_match = NULL;

		/* Frontends like to do 'ls -q /', so we support it explicitly.
                 */
		if (!strcmp (mod,"/"))
		{
		    *mod='\0';
		}

		err += do_module (db, mod, MISC, "Listing",
				  ls_proc, NULL, 0, 0, 0, 0, NULL);

		free (mod);
	    }
	}
	else
	{
	    /* should be ".", but do_recursion() 
	       fails this: assert ( strstr ( repository, "/./" ) == NULL ); */
	    char *topmod = xstrdup ("");
	    err += do_module (db, topmod, MISC, "Listing",
			      ls_proc, NULL, 0, 0, 0, 0, NULL);
	    free (topmod);
	}
	close_module (db);
    }
    else
	ls_proc (argc + 1, argv - 1, NULL, NULL, NULL, 0, 0, NULL, NULL);

    return err;
}