Commit a32d09f2 authored by Richard Curnow's avatar Richard Curnow

Corresponds to CVS V0.14

Original rev  : rc@rc0.org.uk--historical/mairix--history--0--patch-24
parent dc887908
#########################################################################
#
# $Header: /cvs/src/mairix/Makefile.in,v 1.6 2003/12/12 23:17:11 richard Exp $
# $Header: /cvs/src/mairix/Makefile.in,v 1.7 2004/01/11 23:46:54 richard Exp $
#
# =======================================================================
#
# mairix - message index builder and finder for maildir folders.
#
# Copyright (C) Richard P. Curnow 2002, 2003
# Copyright (C) Richard P. Curnow 2002-2004
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
......
NEW IN VERSION 0.14
===================
* Fix error in path (p:) searching for messages in mboxes.
* Improve usage() function
NEW IN VERSION 0.13
===================
......
......@@ -21,7 +21,7 @@ The program is a very useful complement to mail programs like mutt
See also the mairix.txt file.
*********************************************************************
Copyright (C) Richard P. Curnow 2002
Copyright (C) Richard P. Curnow 2002-2004
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
......
#!/bin/sh
#########################################################################
#
# $Id: configure,v 1.5 2003/12/04 23:06:35 richard Exp $
# $Id: configure,v 1.6 2004/01/11 23:46:54 richard Exp $
#
# =======================================================================
#
# mairix - message index builder and finder for maildir folders.
#
# Copyright (C) Richard P. Curnow 2003
# Copyright (C) Richard P. Curnow 2003-2004
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
......@@ -223,7 +223,7 @@ fi
#{{{ Determine version number of the program.
# (CVS tags are of the form V1_0 for version 1.0)
Name="ZZZ"
revision="$Name: V0_12 $";
revision="$Name: V0_14 $";
if [ "$revision" = "ZZZ\$" ]; then revision="dev"; fi
revision=`echo $revision | sed 's/_/./g;' | sed 's/ZZZ: V//;' | sed 's/ \$$//;'`
......
/*
$Header: /cvs/src/mairix/dates.c,v 1.3 2003/03/04 00:07:45 richard Exp $
$Header: /cvs/src/mairix/dates.c,v 1.4 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/db.c,v 1.15 2003/12/01 23:14:32 richard Exp $
$Header: /cvs/src/mairix/db.c,v 1.16 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/dirscan.c,v 1.12 2003/12/03 23:56:08 richard Exp $
$Header: /cvs/src/mairix/dirscan.c,v 1.13 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/glob.c,v 1.4 2003/12/01 22:30:23 richard Exp $
$Header: /cvs/src/mairix/glob.c,v 1.5 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2003
* Copyright (C) Richard P. Curnow 2003-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/mairix.c,v 1.19 2004/01/06 22:00:49 richard Exp $
$Header: /cvs/src/mairix/mairix.c,v 1.21 2004/01/11 23:50:41 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......@@ -289,7 +289,7 @@ volatile void out_of_mem(char *file, int line, size_t size)/*{{{*/
static char *get_version(void)/*{{{*/
{
static char buffer[256];
static char cvs_version[] = "$Name: V0_13 $";
static char cvs_version[] = "$Name: V0_14 $";
char *p, *q;
for (p=cvs_version; *p; p++) {
if (*p == ':') {
......@@ -316,7 +316,7 @@ static char *get_version(void)/*{{{*/
static void print_copyright(void)/*{{{*/
{
fprintf(stderr,
"mairix %s, Copyright (C) 2002, 2003 Richard P. Curnow\n"
"mairix %s, Copyright (C) 2002-2004 Richard P. Curnow\n"
"mairix comes with ABSOLUTELY NO WARRANTY.\n"
"This is free software, and you are welcome to redistribute it\n"
"under certain conditions; see the GNU General Public License for details.\n\n",
......@@ -345,6 +345,10 @@ static void usage(void)/*{{{*/
" a:word : match word in To:, Cc: or From: headers (address)\n"
" s:word : match word in Subject: header\n"
" b:word : match word in message body\n"
" m:word : match word in Message-ID: header\n"
" p:substring : match substring of path\n"
" d:start-end : match date range\n"
" z:low-high : match messages in size range\n"
" bs:word : match word in Subject: header or body (or any other group of prefixes)\n"
" s:word1+word2 : match both words in Subject:\n"
" s:word1,word2 : match either word or both words in Subject:\n"
......
/*
$Header: /cvs/src/mairix/mairix.h,v 1.19 2004/01/06 22:00:49 richard Exp $
$Header: /cvs/src/mairix/mairix.h,v 1.20 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
......@@ -22,7 +22,7 @@
@author Richard P. Curnow
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 2002, 2003 Richard P. Curnow
Copyright @copyright{} 2002-2004 Richard P. Curnow
@end titlepage
@contents
......
/*
$Header: /cvs/src/mairix/mbox.c,v 1.18 2003/12/12 23:11:59 richard Exp $
$Header: /cvs/src/mairix/mbox.c,v 1.19 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2003
* Copyright (C) Richard P. Curnow 2003-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/memmac.h,v 1.3 2003/11/27 22:07:12 richard Exp $
$Header: /cvs/src/mairix/memmac.h,v 1.4 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/reader.c,v 1.8 2003/11/27 23:18:37 richard Exp $
$Header: /cvs/src/mairix/reader.c,v 1.9 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/reader.h,v 1.5 2003/11/27 23:18:37 richard Exp $
$Header: /cvs/src/mairix/reader.h,v 1.7 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......@@ -137,7 +137,7 @@ struct read_db {/*{{{*/
/* Pathname information */
int n_msgs;
unsigned char *msg_type;
unsigned int *path_offsets; /* or mbox index */
unsigned int *path_offsets; /* or (mbox index, msg index) */
unsigned int *mtime_table; /* or offset into mbox */
unsigned int *size_table; /* either file size or span inside mbox */
unsigned int *date_table;
......
/*
$Header: /cvs/src/mairix/rfc822.c,v 1.17 2003/11/27 23:18:37 richard Exp $
$Header: /cvs/src/mairix/rfc822.c,v 1.18 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
* rfc2047 decode Copyright (C) Mikael Ylikoski 2002
*
* This program is free software; you can redistribute it and/or modify
......
/*
$Header: /cvs/src/mairix/search.c,v 1.27 2004/01/06 22:15:51 richard Exp $
$Header: /cvs/src/mairix/search.c,v 1.29 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......@@ -334,32 +334,46 @@ static void match_substring_in_paths(struct read_db *db, char *substring, int ma
nr = new_array(unsigned long, 1 + max_errors);
}
for (i=0; i<db->n_msgs; i++) {
if (db->path_offsets[i]) {
token = db->data + db->path_offsets[i];
switch (max_errors) {
/* Optimise common cases for few errors to allow optimizer to keep bitmaps
* in registers */
case 0:
hits[i] = substring_match_0(a, hit, token);
break;
case 1:
hits[i] = substring_match_1(a, hit, token);
break;
case 2:
hits[i] = substring_match_2(a, hit, token);
break;
case 3:
hits[i] = substring_match_3(a, hit, token);
break;
default:
hits[i] = substring_match_general(a, hit, token, max_errors, r, nr);
break;
}
} else {
/* Never match deleted paths */
hits[i] = 0;
char *token;
int mbix, msgix;
switch (db->msg_type[i]) {
case DB_MSG_FILE:
token = db->data + db->path_offsets[i];
break;
case DB_MSG_MBOX:
decode_mbox_indices(db->path_offsets[i], &mbix, &msgix);
token = db->data + db->mbox_paths_table[mbix];
break;
case DB_MSG_DEAD:
hits[i] = 0; /* never match on dead paths */
goto next_message;
}
assert(token);
switch (max_errors) {
/* Optimise common cases for few errors to allow optimizer to keep bitmaps
* in registers */
case 0:
hits[i] = substring_match_0(a, hit, token);
break;
case 1:
hits[i] = substring_match_1(a, hit, token);
break;
case 2:
hits[i] = substring_match_2(a, hit, token);
break;
case 3:
hits[i] = substring_match_3(a, hit, token);
break;
default:
hits[i] = substring_match_general(a, hit, token, max_errors, r, nr);
break;
}
next_message:
(void) 0;
}
if (r) free(r);
if (nr) free(nr);
}
......@@ -694,7 +708,6 @@ static void get_validated_mbox_msg(struct read_db *db, int msg_index,/*{{{*/
*msg_data = NULL;
*msg_len = 0;
*mbox_index = db->path_offsets[msg_index];
decode_mbox_indices(db->path_offsets[msg_index], &mbi, &msgi);
*mbox_index = mbi;
......
/*
$Header: /cvs/src/mairix/tok.c,v 1.4 2003/11/27 23:18:37 richard Exp $
$Header: /cvs/src/mairix/tok.c,v 1.5 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
/*
$Header: /cvs/src/mairix/writer.c,v 1.15 2003/12/01 23:14:32 richard Exp $
$Header: /cvs/src/mairix/writer.c,v 1.16 2004/01/11 23:46:54 richard Exp $
mairix - message index builder and finder for maildir folders.
**********************************************************************
* Copyright (C) Richard P. Curnow 2002, 2003
* Copyright (C) Richard P. Curnow 2002-2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment