summaryrefslogtreecommitdiffstats
path: root/times/sgi.t
blob: 7963610150b7eed3ca4b4ab4022cc586cf602706 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SGI Challenge R4400 200mhz IRIX 5.3 - gcc (2.6.3)
SSLeay 0.6.1 02-Jul-1996
built on Tue Jul  2 16:25:30 EST 1996
options:bn(64,32) md2(char) rc4(idx,char) des(idx,long) idea(int)
C flags:gcc -O2 -mips2 -DTERMIOS -DB_ENDIAN
The 'numbers' are in 1000s of bytes per second processed.
type           8 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md2             96.53k      266.70k      360.09k      393.70k      405.07k
md5            971.15k     4382.56k     7406.90k     8979.99k     9559.18k
sha            596.86k     2832.26k     4997.30k     6277.75k     6712.89k
sha1           578.34k     2630.16k     4632.05k     5684.34k     6083.37k
rc4           5641.12k     6821.76k     6996.13k     7052.61k     6913.32k
des cfb       1354.86k     1422.11k     1434.58k     1433.24k     1432.89k
des cbc       1467.13k     1618.92k     1630.08k     1637.00k     1629.62k
des ede3       566.13k      591.91k      596.86k      596.18k      592.54k
idea cfb      1190.60k     1264.49k     1270.38k     1267.84k     1272.37k
idea cbc      1271.45k     1410.37k     1422.49k     1426.46k     1421.73k
rc2 cfb       1285.73k     1371.40k     1380.92k     1383.13k     1379.23k
rc2 cbc       1386.61k     1542.10k     1562.49k     1572.45k     1567.93k
rsa  512 bits   0.018s
rsa 1024 bits   0.106s
rsa 2048 bits   0.738s
rsa 4096 bits   5.535s

version:SSLeay 0.5.2c 15-May-1996
rsa  512 bits   0.035s
rsa 1024 bits   0.204s
rsa 2048 bits   1.423s
rsa 4096 bits  10.800s
d='n497' href='#n497'>497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
/* notmuch - Not much of an email program, (just index and search)
 *
 * Copyright © 2009 Carl Worth
 * Copyright © 2009 Keith Packard
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see https://www.gnu.org/licenses/ .
 *
 * Authors: Carl Worth <cworth@cworth.org>
 *	    Keith Packard <keithp@keithp.com>
 */

#include "notmuch-client.h"

/*
 * Notmuch subcommand hook.
 *
 * The return value will be used as notmuch exit status code,
 * preferably EXIT_SUCCESS or EXIT_FAILURE.
 *
 * Each subcommand should be passed either a config object, or an open
 * database
 */
typedef int (*command_function_t) (notmuch_database_t *notmuch, int argc, char *argv[]);

typedef struct command {
    const char *name;
    command_function_t function;
    notmuch_command_mode_t mode;
    const char *summary;
} command_t;

static int
notmuch_help_command (notmuch_database_t *notmuch, int argc, char *argv[]);

static int
notmuch_command (notmuch_database_t *notmuch, int argc, char *argv[]);

static int
_help_for (const char *topic);

static void
notmuch_exit_if_unmatched_db_uuid (notmuch_database_t *notmuch);

static bool print_version = false, print_help = false;
static const char *notmuch_requested_db_uuid = NULL;
static int query_syntax = NOTMUCH_QUERY_SYNTAX_XAPIAN;

const notmuch_opt_desc_t notmuch_shared_options [] = {
    { .opt_bool = &print_version, .name = "version" },
    { .opt_bool = &print_help, .name = "help" },
    { .opt_string = &notmuch_requested_db_uuid, .name = "uuid" },
    { .opt_keyword = &query_syntax, .name = "query", .keywords =
	  (notmuch_keyword_t []){ { "infix", NOTMUCH_QUERY_SYNTAX_XAPIAN },
				  { "sexp", NOTMUCH_QUERY_SYNTAX_SEXP },
				  { 0, 0 } } },

    { }
};

notmuch_query_syntax_t
shared_option_query_syntax ()
{
    return query_syntax;
}

/* any subcommand wanting to support these options should call
 * inherit notmuch_shared_options and call
 * notmuch_process_shared_options (notmuch, subcommand_name);
 * with notmuch = an open database, or NULL.
 */
void
notmuch_process_shared_options (notmuch_database_t *notmuch, const char *subcommand_name)
{
    if (print_version) {
	printf ("notmuch " STRINGIFY (NOTMUCH_VERSION) "\n");
	exit (EXIT_SUCCESS);
    }

    if (print_help) {
	int ret = _help_for (subcommand_name);
	exit (ret);
    }

    if (notmuch) {
	notmuch_exit_if_unmatched_db_uuid (notmuch);
    } else {
	if (notmuch_requested_db_uuid)
	    fprintf (stderr, "Warning: ignoring --uuid=%s\n",
		     notmuch_requested_db_uuid);
    }
}

/* This is suitable for subcommands that do not actually open the
 * database.
 */
int
notmuch_minimal_options (const char *subcommand_name,
			 int argc, char **argv)
{
    int opt_index;

    notmuch_opt_desc_t options[] = {
	{ .opt_inherit = notmuch_shared_options },
	{ }
    };

    opt_index = parse_arguments (argc, argv, options, 1);

    if (opt_index < 0)
	return -1;

    /* We can't use argv here as it is sometimes NULL */
    notmuch_process_shared_options (NULL, subcommand_name);
    return opt_index;
}


struct _notmuch_client_indexing_cli_choices indexing_cli_choices = { };
const notmuch_opt_desc_t notmuch_shared_indexing_options [] = {
    { .opt_keyword = &indexing_cli_choices.decrypt_policy,
      .present = &indexing_cli_choices.decrypt_policy_set, .keywords =
	  (notmuch_keyword_t []){ { "false", NOTMUCH_DECRYPT_FALSE },
				  { "true", NOTMUCH_DECRYPT_TRUE },
				  { "auto", NOTMUCH_DECRYPT_AUTO },
				  { "nostash", NOTMUCH_DECRYPT_NOSTASH },
				  { 0, 0 } },
      .name = "decrypt" },
    { }
};


notmuch_status_t
notmuch_process_shared_indexing_options (notmuch_indexopts_t *opts)
{
    if (opts == NULL)
	return NOTMUCH_STATUS_NULL_POINTER;

    if (indexing_cli_choices.decrypt_policy_set) {
	notmuch_status_t status;
	status = notmuch_indexopts_set_decrypt_policy (opts,
						       indexing_cli_choices.decrypt_policy);
	if (status != NOTMUCH_STATUS_SUCCESS) {
	    fprintf (stderr, "Error: Failed to set index decryption policy to %d. (%s)\n",
		     indexing_cli_choices.decrypt_policy, notmuch_status_to_string (status));
	    return status;
	}
    }
    return NOTMUCH_STATUS_SUCCESS;
}


static const command_t commands[] = {
    { NULL, notmuch_command, NOTMUCH_COMMAND_CONFIG_CREATE | NOTMUCH_COMMAND_CONFIG_LOAD,
      "Notmuch main command." },
    { "setup", notmuch_setup_command, NOTMUCH_COMMAND_CONFIG_CREATE | NOTMUCH_COMMAND_CONFIG_LOAD,
      "Interactively set up notmuch for first use." },
    { "new", notmuch_new_command,
      NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE |
      NOTMUCH_COMMAND_DATABASE_CREATE,
      "Find and import new messages to the notmuch database." },
    { "insert", notmuch_insert_command, NOTMUCH_COMMAND_DATABASE_EARLY |
      NOTMUCH_COMMAND_DATABASE_WRITE,
      "Add a new message into the maildir and notmuch database." },
    { "search", notmuch_search_command, NOTMUCH_COMMAND_DATABASE_EARLY,
      "Search for messages matching the given search terms." },
    { "address", notmuch_address_command, NOTMUCH_COMMAND_DATABASE_EARLY,
      "Get addresses from messages matching the given search terms." },
    { "show", notmuch_show_command, NOTMUCH_COMMAND_DATABASE_EARLY,
      "Show all messages matching the search terms." },
    { "count", notmuch_count_command, NOTMUCH_COMMAND_DATABASE_EARLY,
      "Count messages matching the search terms." },
    { "reply", notmuch_reply_command, NOTMUCH_COMMAND_DATABASE_EARLY,
      "Construct a reply template for a set of messages." },
    { "tag", notmuch_tag_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
      "Add/remove tags for all messages matching the search terms." },
    { "dump", notmuch_dump_command, NOTMUCH_COMMAND_DATABASE_EARLY | NOTMUCH_COMMAND_DATABASE_WRITE,
      "Create a plain-text dump of the tags for each message." },
    { "restore", notmuch_restore_command, NOTMUCH_COMMAND_DATABASE_EARLY |
      NOTMUCH_COMMAND_DATABASE_WRITE,
      "Restore the tags from the given dump file (see 'dump')." },
    { "compact", notmuch_compact_command, NOTMUCH_COMMAND_DATABASE_EARLY |
      NOTMUCH_COMMAND_DATABASE_WRITE,
      "Compact the notmuch database." },
    { "reindex", notmuch_reindex_command, NOTMUCH_COMMAND_DATABASE_EARLY |
      NOTMUCH_COMMAND_DATABASE_WRITE,
      "Re-index all messages matching the search terms." },
    { "config", notmuch_config_command, NOTMUCH_COMMAND_CONFIG_LOAD,
      "Get or set settings in the notmuch configuration file." },
#if WITH_EMACS
    { "emacs-mua", NULL, 0,
      "send mail with notmuch and emacs." },
#endif
    { "help", notmuch_help_command, NOTMUCH_COMMAND_CONFIG_CREATE, /* create but don't save config */
      "This message, or more detailed help for the named command." }
};

typedef struct help_topic {
    const char *name;
    const char *summary;
} help_topic_t;

static const help_topic_t help_topics[] = {
    { "search-terms",
      "Common search term syntax." },
    { "hooks",
      "Hooks that will be run before or after certain commands." },
    { "properties",
      "Message property conventions and documentation." },