]> git.deb.at Git - pkg/abook.git/commitdiff
Apply branch 'experimental' to master
authorGerfried Fuchs <rhonda@debian.org>
Tue, 17 Apr 2012 12:19:00 +0000 (14:19 +0200)
committerGerfried Fuchs <rhonda@debian.org>
Wed, 18 Apr 2012 08:56:48 +0000 (10:56 +0200)
85 files changed:
ANNOUNCE
AUTHORS
BUGS
ChangeLog
Makefile.am
Makefile.in
README
RELEASE_NOTES [new file with mode: 0644]
THANKS
TODO
abook.1
abook.c
abook.h
abook.spec
abookrc.5
config.guess
config.sub
configure
configure.in
contrib/CVS/Entries [new file with mode: 0644]
contrib/CVS/Repository [new file with mode: 0644]
contrib/CVS/Root [new file with mode: 0644]
database.c
database.h
debian/changelog
debian/config
debian/control
debian/copyright
debian/patches/01_search_ctrl-d_segfault_fix [deleted file]
debian/patches/02_fix-manpage
debian/patches/03_datafile-f-switch
debian/patches/series
debian/po/ca.po
debian/po/cs.po
debian/po/da.po [new file with mode: 0644]
debian/po/de.po
debian/po/es.po
debian/po/fr.po
debian/po/hu.po
debian/po/it.po [new file with mode: 0644]
debian/po/ja.po
debian/po/nl.po
debian/po/pl.po [new file with mode: 0644]
debian/po/pt.po
debian/po/pt_BR.po
debian/po/ro.po
debian/po/ru.po
debian/po/sv.po
debian/po/templates.pot
debian/po/vi.po
debian/po/zh_TW.po
debian/postinst
debian/postrm
debian/rules
edit.c
edit.h
filter.c
help.h
intl/Makefile.in
list.c
list.h
misc.c
misc.h
options.c
options.h
po/LINGUAS
po/Makefile.in.in
po/Makevars
po/POTFILES.in
po/abook.pot
po/de.gmo
po/de.po
po/fr.gmo
po/fr.po
po/it.gmo [new file with mode: 0644]
po/it.po [new file with mode: 0644]
po/ja.gmo
po/ja.po
po/sv.gmo
po/sv.po
sample.abookrc
ui.c
ui.h
views.c [new file with mode: 0644]
views.h [new file with mode: 0644]

index abff6e66c646a40f35ab31194eff15269b5f2ace..26f691f7da1205e5d5eaadb9ad25492d3bf6f519 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,4 +1,4 @@
-abook v 0.5
+abook
 
 Abook is small and powerful addressbook program designed to use with mutt mail
 client. Abook runs on Linux / FreeBSD and probably with small changes on other
diff --git a/AUTHORS b/AUTHORS
index 1d2df309f2d60dca7fd5012eb8363e5d31ea83c3..9570e77277cbad070d749ff5eeff5e80d16553a3 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -4,6 +4,7 @@ abook AUTHORS
 Jaakko Heinonen                <jheinonen@users.sourceforge.net>
 
 Cedric Duval           <cedricduval@free.fr>
+ - views
  - i18n
  - etc.
 
@@ -24,3 +25,4 @@ Koenraad Heijlen      <vipie@ulyssis.org>
  - csv import filter
  - palmcsv export filter
  - fixes
+
diff --git a/BUGS b/BUGS
index b1164c62e4d1753f8a333b824e799fbf525de006..5e2fcbe3489da11a4842f4e6bc8b4278f812f5ad 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -10,13 +10,18 @@ known bugs in abook
     ftp://ftp.gnu.org/gnu/readline/readline-4.3-patches/readline43-001
 
 * cursor disappears in some cases with abook_readline() on Solaris. If
-  you have problems it is recommended to use the ncurses library
+  you have problems it is recommended to use the GNU ncurses library
 
 * terminal state is not restored correctly on exit with certain ncurses and
   readline combination (more information is needed on this)
 
 * file format is not tolerant for character set changes
 
+* datafile is always removed and rewritten from scratch (symlinks don't work,
+  timestamp is always updated, comments are removed)
+
+* comma (,) is not allowed in lists and is converted to _
+
 --
 [25]
 name=Lastname, Firstname
@@ -39,4 +44,4 @@ Filters:
 
 * fseek in ldif import filter should be eliminated
 
-$Id: BUGS,v 1.16.2.1 2006/02/23 13:39:13 jheinonen Exp $
+$Id: BUGS,v 1.18 2006/08/24 09:46:08 jheinonen Exp $
index 2f96df3f663f539009dece79c27894f06f6f5d8b..967f96aa40dbbfcb10d7574bdd43ebd8ab5dedd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,24 @@
+0.6.0
+ - configurable views (Cedric Duval)
+ - new field types, lists and improved custom field support (Cedric Duval)
+ - index_format option (Cedric Duval)
+ - Italian translation (Claudio Stazzone)
+ - BSD calendar export filter (Guillem Jover)
+ - translation updates
+ - bugfixes
+
 0.5.6
  - translation fixes
  - fixed gcrd export format (\r\n line endings according to RFC, Marc Tardif)
  - fix localized keybindings with --disable-nls
 
 0.5.5
+ - fixed gcrd export format (Marc Tardif)
  - i18n support (Cedric Duval)
  - French translation (Cedric Duval)
  - Swedish translation (Susanna Björverud)
  - Japanese translation (Takahashi Tamotsu)
+ - German translation (Johannes Weißl)
  - palmcsv import filter (Marc Tardif)
  - use better common code for csv filters (Marc Tardif)
  - translation HOWTO (Cedric Duval)
index 304d60840ae736d2c0b9f45c98e7fa7329ee3182..1b3d27ef24a9e2e59a63c7efaf6c7a504afbccf4 100644 (file)
@@ -1,20 +1,22 @@
 
 bin_PROGRAMS = abook
 
-abook_SOURCES = abook.c database.c filter.c list.c misc.c \
-               options.c edit.c ldif.c ui.c getname.c \
-               getopt.c getopt1.c gettext.c abook_rl.c mbswidth.c \
-               xmalloc.c \
-               abook.h database.h filter.h list.h misc.h help.h \
-               options.h edit.h ldif.h abook_curses.h ui.h getname.h \
-               getopt.h gettext.h abook_rl.h mbswidth.h \
-               xmalloc.h
+abook_SOURCES = abook.c abook_rl.c database.c edit.c \
+               filter.c getname.c getopt.c getopt1.c gettext.c \
+               ldif.c list.c mbswidth.c misc.c options.c \
+               ui.c views.c xmalloc.c \
+               \
+               abook.h abook_curses.h abook_rl.h database.h edit.h \
+               filter.h getname.h getopt.h gettext.h \
+               help.h list.h ldif.h mbswidth.h misc.h options.h \
+               ui.h views.h xmalloc.h
 
 EXTRA_DIST = config.rpath  ANNOUNCE BUGS FAQ abook.1 abookrc.5 sample.abookrc \
-               abook.spec contrib doc/HOWTO.translating_abook
+               abook.spec contrib doc/HOWTO.translating_abook RELEASE_NOTES
 
 abook_LDADD = @LIBINTL@
 
+
 install-data-local:
        $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5
        $(INSTALL_DATA) $(srcdir)/abook.1 $(DESTDIR)$(mandir)/man1/
index 83d73ed0ee977e4f5289b07218fb0f68153702bf..1f1d6dbef54c276b3f1d0505e9599e04b610d3cc 100644 (file)
@@ -73,11 +73,12 @@ CONFIG_CLEAN_FILES = abook.spec intl/Makefile
 am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_abook_OBJECTS = abook.$(OBJEXT) database.$(OBJEXT) filter.$(OBJEXT) \
-       list.$(OBJEXT) misc.$(OBJEXT) options.$(OBJEXT) edit.$(OBJEXT) \
-       ldif.$(OBJEXT) ui.$(OBJEXT) getname.$(OBJEXT) getopt.$(OBJEXT) \
-       getopt1.$(OBJEXT) gettext.$(OBJEXT) abook_rl.$(OBJEXT) \
-       mbswidth.$(OBJEXT) xmalloc.$(OBJEXT)
+am_abook_OBJECTS = abook.$(OBJEXT) abook_rl.$(OBJEXT) \
+       database.$(OBJEXT) edit.$(OBJEXT) filter.$(OBJEXT) \
+       getname.$(OBJEXT) getopt.$(OBJEXT) getopt1.$(OBJEXT) \
+       gettext.$(OBJEXT) ldif.$(OBJEXT) list.$(OBJEXT) \
+       mbswidth.$(OBJEXT) misc.$(OBJEXT) options.$(OBJEXT) \
+       ui.$(OBJEXT) views.$(OBJEXT) xmalloc.$(OBJEXT)
 abook_OBJECTS = $(am_abook_OBJECTS)
 abook_DEPENDENCIES =
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
@@ -223,17 +224,18 @@ sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-abook_SOURCES = abook.c database.c filter.c list.c misc.c \
-               options.c edit.c ldif.c ui.c getname.c \
-               getopt.c getopt1.c gettext.c abook_rl.c mbswidth.c \
-               xmalloc.c \
-               abook.h database.h filter.h list.h misc.h help.h \
-               options.h edit.h ldif.h abook_curses.h ui.h getname.h \
-               getopt.h gettext.h abook_rl.h mbswidth.h \
-               xmalloc.h
+abook_SOURCES = abook.c abook_rl.c database.c edit.c \
+               filter.c getname.c getopt.c getopt1.c gettext.c \
+               ldif.c list.c mbswidth.c misc.c options.c \
+               ui.c views.c xmalloc.c \
+               \
+               abook.h abook_curses.h abook_rl.h database.h edit.h \
+               filter.h getname.h getopt.h gettext.h \
+               help.h list.h ldif.h mbswidth.h misc.h options.h \
+               ui.h views.h xmalloc.h
 
 EXTRA_DIST = config.rpath  ANNOUNCE BUGS FAQ abook.1 abookrc.5 sample.abookrc \
-               abook.spec contrib doc/HOWTO.translating_abook
+               abook.spec contrib doc/HOWTO.translating_abook RELEASE_NOTES
 
 abook_LDADD = @LIBINTL@
 SUBDIRS = intl po
@@ -346,6 +348,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/views.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@
 
 .c.o:
diff --git a/README b/README
index 83bc73d2dfe000ed308824f1ced2282694923b91..ad56f59750bb07bf26652e3eb98861bd51492714 100644 (file)
--- a/README
+++ b/README
@@ -6,7 +6,7 @@ Abook is an addressbook program with mutt mail client support.
 
 COMPILATION
 
-To compile abook you must have ncurses developement libraries installed.
+To compile abook you must have ncurses development libraries installed.
 Starting from version 0.4.10 abook is known to compile with the native curses
 library of SUN Solaris and OpenBSD. Since version 0.5.0 GNU readline is
 required. Please note that other readline implementations don't work.
@@ -16,8 +16,8 @@ to somewhere. (for example abook 2> debug or abook 2> /dev/null) Abook has
 been compiled and tested successfully on following platforms:
 (NOTE: All versions of abook haven't been tested on all platforms.)
 
-Linux (Debian GNU/Linux, RedHat Linux, all other distributions with GNU ncurses
-       and GNU readline should work)
+Linux (distributions with moderately new GNU ncurses and GNU readline libraries
+       should work)
 Darwin
 Solaris
 FreeBSD
@@ -43,9 +43,13 @@ After this you can make queries from mutt using the query command ('Q')
 and add sender e-mail addresses to the addressbook from pager using 'A'
 command. (Of course you can choose another keybinding if you like.)
 
-It's also recommeded to set pipe_decode variable in mutt configuration.
+It's also recommended to set pipe_decode variable in mutt configuration.
 See the mutt manual for details.
 
+UPGRADING FROM VERSION 0.5
+
+See RELEASE_NOTES .
+
 UPGRADING FROM VERSION 0.4
 
 You must import your abook 0.4 addressbook file because it is stored
@@ -70,8 +74,8 @@ LICENSE
 All files in this distribution are released under GNU GENERAL PUBLIC LICENSE.
 See COPYING for details.
 
-CONTACT AUTHOR
+CONTACT AUTHORS
 
-Send bugreports, fixes, wishes etc. to Jaakko Heinonen
-<jheinonen@users.sourceforge.net> or use the mailing list.
+Send bugreports, fixes, wishes etc. to abook mailing list:
+https://lists.sourceforge.net/lists/listinfo/abook-devel
 
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
new file mode 100644 (file)
index 0000000..92fcca6
--- /dev/null
@@ -0,0 +1,32 @@
+This file lists major changes affecting abook's behavior.
+Please read this file carefully when upgrading abook.
+A more comprehensive list of changes can be found in the ChangeLog file.
+
+--
+
+0.6.0pre2:
+  * The four following configuration options have been deprecated and will
+    no longer be accepted by abook:
+      * emailpos
+      * extra_column
+      * extra_alternative
+      * extrapos
+
+    They have been replaced with a single more flexible option:
+    index_format.
+
+    This option is a string defining the format of a line in the main list.
+    It allows displaying of as many fields as desired, with optional
+    width limit, as well as an arbitrary number of alternative fields.
+
+0.6.0pre1 (2006-08-30):
+  * The 'customfield' command has been obsoleted by a more flexible set
+    of commands: 'field' and 'view'.
+
+    Those two commands make it possible to define fields and organize
+    them within tabs as you see fit.
+
+    Not using these commands, the look and feel of previous releases
+    will mostly be kept the same. Also see the related 'preserve_fields'
+    configuration variable.
+
diff --git a/THANKS b/THANKS
index 490f4e6934a43c012ad31ba45ce8757ec32aa52a..ba96d2681a94e16f2e28a75a3afeae0ffb3b8b88 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -19,5 +19,8 @@ Jeff Covey
 Giuseppe Corbelli
 Mariusz Balewski
 Marc Tardif
+Gerfried Fuchs
+Josef Schugt
+Guillem Jover
 
 See also AUTHORS
diff --git a/TODO b/TODO
index deda7c392ea6da03eefe1415c6bb246eae880455..488a5a335bb3bb767c7829b9a568922d99f4e684 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,7 @@
+0.6
+ - allcsv should export all fields
+
+generic:
  - grouping
  - new file format (xml?)
  - custom views, keybindings
diff --git a/abook.1 b/abook.1
index 452f0a6c68eb9b43166f2764c4f9567b2cdf75fd..bb7ed4e831e4e93b158a9d8c2b12823be58d58aa 100644 (file)
--- a/abook.1
+++ b/abook.1
@@ -1,4 +1,4 @@
-.TH ABOOK 1 "June 6, 2003"
+.TH ABOOK 1 2006-09-06
 .nh
 .SH NAME
 abook \- text-based address book program
@@ -79,6 +79,8 @@ The following \fIoutputformats\fR are supported:
 - \fBspruce\fP Spruce address book
 .br
 - \fBwl\fP Wanderlust address book
+.br
+- \fBbsdcal\fP BSD calendar
 .TP
 \fB\-\-add-email\fP
 Read an e-mail message from stdin and add the sender to the addressbook.
diff --git a/abook.c b/abook.c
index 1b8c0da4cf8c4f8b836791c8d0f1b0672d4eef2a..f20c45d1c6f9b0eb2f18b1e4f242b6b438b43a7b 100644 (file)
--- a/abook.c
+++ b/abook.c
@@ -1,5 +1,5 @@
 /*
- * $Id: abook.c,v 1.57 2005/10/05 11:03:36 jheinonen Exp $
+ * $Id: abook.c,v 1.60 2006/09/04 18:29:24 cduval Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
@@ -33,6 +33,7 @@
 #include "options.h"
 #include "getname.h"
 #include "getopt.h"
+#include "views.h"
 #include "xmalloc.h"
 
 static void             init_abook();
@@ -52,6 +53,7 @@ static char *rcfile = NULL;
 bool alternative_datafile = FALSE;
 bool alternative_rcfile = FALSE;
 
+
 static int
 datafile_writeable()
 {
@@ -126,9 +128,12 @@ init_abook()
                printf(_("Press enter to continue...\n"));
                fgetc(stdin);
        }
+       init_default_views();
 
        signal(SIGTERM, quit_abook_sig);
 
+       init_index();
+
        if(init_ui())
                exit(EXIT_FAILURE);
 
@@ -190,6 +195,8 @@ main(int argc, char **argv)
 
        xmalloc_set_error_handler(xmalloc_error_handler);
 
+       prepare_database_internals();
+
        parse_command_line(argc, argv);
 
        init_abook();
@@ -375,7 +382,7 @@ parse_command_line(int argc, char **argv)
                }
        }
 
-       if (optind < argc) {
+       if(optind < argc) {
                fprintf(stderr, _("%s: unrecognized arguments on command line\n"),
                                argv[0]);
                exit(EXIT_FAILURE);
@@ -427,7 +434,6 @@ show_usage()
  * end of CLI
  */
 
-extern list_item *database;
 
 static void
 quit_mutt_query(int status)
@@ -441,19 +447,20 @@ quit_mutt_query(int status)
 static void
 muttq_print_item(FILE *file, int item)
 {
-       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
-       int i;
-
-       split_emailstr(item, emails);
-
-       for(i = 0; i < (opt_get_bool(BOOL_MUTT_RETURN_ALL_EMAILS) ?
-                       MAX_EMAILS : 1) ; i++)
-               if( *emails[i] )
-                       fprintf(file, "%s\t%s\t%s\n", emails[i],
-                               database[item][NAME],
-                               database[item][NOTES] == NULL ? " " :
-                                       database[item][NOTES]
+       abook_list *emails, *e;
+       char *tmp = db_email_get(item);
+
+       emails = csv_to_abook_list(tmp);
+       free(tmp);
+
+       for(e = emails; e; e = e->next) {
+               fprintf(file, "%s\t%s\t%s\n", e->data, db_name_get(item),
+                               !db_fget(item, NOTES) ?" " :db_fget(item, NOTES)
                                );
+               if(!opt_get_bool(BOOL_MUTT_RETURN_ALL_EMAILS))
+                       break;
+       }
+       abook_list_free(&emails);
 }
 
 static void
@@ -503,11 +510,11 @@ make_mailstr(int item)
 {
        char email[MAX_EMAIL_LEN];
        char *ret;
-       char *name = strdup_printf("\"%s\"", database[item][NAME]);
+       char *name = strdup_printf("\"%s\"", db_name_get(item));
 
        get_first_email(email, item);
 
-       ret = *database[item][EMAIL] ?
+       ret = *email ?
                strdup_printf("%s <%s>", name, email) :
                xstrdup(name);
 
@@ -577,10 +584,10 @@ launch_wwwbrowser(int item)
        if( !is_valid_item(item) )
                return;
 
-       if( database[item][URL] )
+       if(db_fget(item, URL))
                cmd = strdup_printf("%s '%s'",
                                opt_get_str(STR_WWW_COMMAND),
-                               safe_str(database[item][URL]));
+                               safe_str(db_fget(item, URL)));
        else
                return;
 
@@ -632,6 +639,7 @@ convert(char *srcformat, char *srcfile, char *dstformat, char *dstfile)
        set_filenames();
        init_opts();
        load_opts(rcfile);
+       init_standard_fields();
 
        switch(import_file(srcformat, srcfile)) {
                case -1:
@@ -752,10 +760,11 @@ add_email_add_item(int quiet, char *name, char *email)
                fclose(in);
        }
 
-       memset(item, 0, sizeof(item));
-       item[NAME] = xstrdup(name);
-       item[EMAIL] = xstrdup(email);
+       item = item_create();
+       item_fput(item, NAME, xstrdup(name));
+       item_fput(item, EMAIL, xstrdup(email));
        add_item2database(item);
+       item_free(&item);
 
        return 1;
 }
diff --git a/abook.h b/abook.h
index 564caf39b946725839cab05b5e7fa0600b3f906a..fc6c1bbc0486d6e54f5e62a01fbdc5248c25f45a 100644 (file)
--- a/abook.h
+++ b/abook.h
@@ -49,6 +49,8 @@ int           strncasecmp (const char *, const char *, size_t);
 
 #define ISSPACE(c)     isspace((unsigned char)c)
 
+#define SKIPWS(c)      while(*(c) && ISSPACE(*(c))) c++
+
 #ifndef DEBUG
 #      define NDEBUG   1
 #else
index 48ce4b487d842793815512df9b29a8a534f59033..2b8023b5daf0a0d9153800bd6da9970d3ea8a7cc 100644 (file)
@@ -1,6 +1,6 @@
 Summary:       Text-based addressbook program
 Name:          abook
-Version:       0.5.6
+Version:       0.6.0pre2
 Release:       1
 License:       GPL
 Group:         Utilities
index 0602c98eaf8b8e47991c4d8c4591c1f349f3da35..638b36fc752bafe54f4656cc6098db6788c12f12 100644 (file)
--- a/abookrc.5
+++ b/abookrc.5
@@ -1,4 +1,4 @@
-.TH ABOOKRC 5 "Jun 4, 2003"
+.TH ABOOKRC 5 "Oct 25, 2005"
 .nh
 .SH NAME
 \fB$HOME/.abook/abookrc\fP \- configuration file for abook address book program
@@ -27,53 +27,92 @@ Comments in
 .B abookrc
 are on lines beginning with '#'.
 
-.SH VARIABLES
-
-.TP
-\fBautosave\fP=[true|false]
-Defines whether the addressbook is automatically saved on exit. Default is true.
+.SH COMMANDS
 
 .TP
-\fBshow_all_emails\fP=[true|false]
-Defines whether all email addresses for a contact are shown in the main list view. Default is true
+\fBset\fP \fIoption\fP = \fIvalue\fP
 
 .TP
-\fBemailpos\fP=column
-Defines the screen column on the main list where the email address is to begin. Default is 25.
+\fBfield\fP \fIidentifier\fP = \fIhuman_readable_name\fP [ , \fItype\fP ]
+Defines a new custom field. \fItype\fP can be one of 'string' (default)
+, 'emails', 'list', or 'date'.
 
 .TP
-\fBextra_column\fP=field
-Defines the field to display in the extra (third) column on the main list. Default is "phone" (Home Phone).
-.br
-\fIfield\fP can be any of the following:
-.br
--1                     disabled
-.br
-phone          Home Phone
-.br
-workphone              Work Phone
+\fBview\fP \fIview name\fP = \fIfield1\fP [ , \fIfield2\fP, ... ]
+Defines a view/tab, with \fIfieldN\fP being the identifier of a field
+declared with the \fBfield\fP command, or the identifier of a standard field.
+.IP
+Standard fields:
 .br
-fax                    Fax
+       name, email,
 .br
-mobile         Mobile Phone
+       address, address2, city, state, zip, country,
 .br
-nick                   Nickname/Alias
+       phone, workphone, fax, mobile,
 .br
-url                    URL
-.br
-notes          Notes
+       nick, url, notes, anniversary
+.IP
+Note: if you don't define any view, abook will use a default display based
+on the above standard fields.
+
+
+.SH VARIABLES
 
 .TP
-\fBextra_alternative\fP=field
-This is an optional setting that allows you to specify an alternative field to be displayed in the extra (third) column if there is no data for the field specified in extra_column for a particular item. The strings for the fields are the same as above. Please note that the data shown where the alternative field has been used will NOT be marked differently in any way from the rest of the extra column. There is no default.
+\fBautosave\fP=[true|false]
+Defines whether the addressbook is automatically saved on exit. Default is true.
 
 .TP
-\fBextrapos\fP=column
-Defines the screen column on the main list where the extra field is to begin. Default is 65.
+\fBpreserve_fields\fP=[all|standard|none]
+Specifies how fields not declared with the \fBfield\fP command nor in a view
+should be preserved while loading an abook database.
+.RS
+.TP
+.B all
+preserve any completely unknown field.
+.TP
+.B standard
+only preserve the standard fields (see a list in the
+  description of the \fBview\fP command) and the legacy
+  'custom[1-5]' fields.
+.TP
+.B none
+discards any unknown field.
+.RE
+.IP
+Default is \fIstandard\fP.
 
 .TP
-\fBmutt_command\fP=command
-Defines the command to start mutt. Default is "mutt".
+\fBindex_format\fP=format_string
+Defines the way entries are displayed in the main list. This is a string containing field names enclosed between braces, with an optional width limit specified by a number (right alignment if negative) after the field name and a colon, and an arbitrary number of alternative fields (first with non empty content is to be displayed) separated by vertical bars. For instance:
+.RS
+.TP
+\fI{name:22}\fP
+displays the \fIname\fP field with a maximal width of 22 characters.
+.TP
+\fI{phone:-13|workphone|mobile}\fP
+displays (right aligned within a width of 13 characters), either the \fIphone\fP, \fIworkphone\fP or \fImobile\fP field, whichever being the first to be non-empty.
+.RE
+.IP
+Default is \fI" {name:22} {email:40} {phone:12|workphone|mobile}"\fP
+
+.TP
+\fBshow_all_emails\fP=[true|false]
+Defines whether all email addresses for a contact are shown in the main list view. Default is true.
+
+.TP
+.PD 0
+\fBemailpos\fP
+.TP
+.PD 0
+\fBextra_column\fP
+.TP
+.PD 0
+\fBextra_alternative\fP
+.TP
+.PD
+\fBextrapos\fP
+Obsoleted by \fBindex_format\fP.
 
 .TP
 \fBmutt_return_all_emails\fP=[true|false]
@@ -113,31 +152,29 @@ Defines if the cursor is visible in main display. Default is false.
 # sample abook configuration file
 #
 
-# Automatically save database on exit
-set autosave=true
+# Declare a few custom fields
+field pager = Pager
+field address_lines = Address, list
+field birthday = Birthday, date
 
-# Show all email addresses in list
-set show_all_emails=true
+# Define how fields should be displayed in tabs
+view CONTACT = name, email
+view ADDRESS = address_lines, city, state, zip, country
+view PHONE = phone, workphone, pager, mobile, fax
+view OTHER = url, birthday
 
-# Screen column for email field to start
-set emailpos=25
 
-# Field to be used in the extra column
-set extra_column=phone
-# frequently used values:
-#      -1          disabled
-#      phone       Home Phone
-#      workphone   Work Phone
-#      fax         Fax
-#      mobile      Mobile Phone
-#      nick        Nickname/Alias
-#      url         URL
+# Preserve any unknown field while loading an abook database
+set preserve_fields=all
 
-#
-set extra_alternative=-1
+# Automatically save database on exit
+set autosave=true
+
+# Format of entries lines in list
+set index_format=" {name:22} {email:40} {phone:12|workphone|mobile}"
 
-# Screen column for the extra field to start
-set extrapos=65
+# Show all email addresses in list
+set show_all_emails=true
 
 # Command used to start mutt
 set mutt_command=mutt
@@ -151,19 +188,19 @@ set print_command=lpr
 # Command used to start the web browser
 set www_command=lynx
 
-# address style [eu|us|uk]
+# Address style [eu|us|uk]
 set address_style=eu
 
-# use ASCII characters only
+# Use ASCII characters only
 set use_ascii_only=false
 
 # Prevent double entry
 set add_email_prevent_duplicates=false
 
-# field to be used with "sort by field" command
+# Field to be used with "sort by field" command
 set sort_field=nick
 
-# show cursor in main display
+# Show cursor in main display
 set show_cursor=false
 
 .fi
@@ -171,8 +208,9 @@ set show_cursor=false
 .SH SEE ALSO
 .BR abook (1).
 .br
-.SH AUTHOR
-This manual page was written by Alan Ford <alan@whirlnet.co.uk>.
+.SH AUTHORS
+This manual page was written by Alan Ford <alan@whirlnet.co.uk> and
+expanded by Cedric Duval <cedricduval@free.fr>.
 
 .br
 .B abook
index ba661651615d361468d6b54633a37f57662f8bbe..c38553dc74bb4f06a43f734903d1e1c0f1ed6fdb 100644 (file)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2001-04-20'
+timestamp='2006-02-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,15 +17,18 @@ timestamp='2001-04-20'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Written by Per Bothner <bothner@cygnus.com>.
-# Please send patches to <config-patches@gnu.org>.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
@@ -52,7 +55,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -65,11 +68,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -87,33 +90,45 @@ if test $# != 0; then
   exit 1
 fi
 
+trap 'exit 1' 1 2 15
 
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
 
-# CC_FOR_BUILD -- compiler used by this script.
 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 # use `HOST_CC' if defined, but it is deprecated.
 
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
 case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int dummy(){}" > $dummy.c
-       for c in cc gcc c89 ; do
-         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
-         if test $? = 0 ; then
-            CC_FOR_BUILD="$c"; break
-         fi
-       done
-       rm -f $dummy.c $dummy.o $dummy.rel
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
        if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found
+         CC_FOR_BUILD=no_compiler_found ;
        fi
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
@@ -127,29 +142,31 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
-       # Netbsd (nbsd) targets should (where applicable) match one or
+       # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
        # compatibility and a consistent mechanism for selecting the
        # object file format.
-       # Determine the machine/vendor (is the vendor relevant).
-       case "${UNAME_MACHINE}" in
-           amiga) machine=m68k-unknown ;;
-           arm32) machine=arm-unknown ;;
-           atari*) machine=m68k-atari ;;
-           sun3*) machine=m68k-sun ;;
-           mac68k) machine=m68k-apple ;;
-           macppc) machine=powerpc-apple ;;
-           hp3[0-9][05]) machine=m68k-hp ;;
-           ibmrt|romp-ibm) machine=romp-ibm ;;
-           *) machine=${UNAME_MACHINE}-unknown ;;
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently, or will in the future.
-       case "${UNAME_MACHINE}" in
-           i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+       case "${UNAME_MACHINE_ARCH}" in
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval $set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep __ELF__ >/dev/null
                then
@@ -165,116 +182,128 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # The OS release
-       release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+               ;;
+       esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
-       exit 0 ;;
+       exit ;;
+    *:OpenBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
+    *:ekkoBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       exit ;;
+    *:SolidBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
+    *:MirBSD:*:*)
+       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       exit ;;
     alpha:OSF1:*:*)
-       if test $UNAME_RELEASE = "V4.0"; then
+       case $UNAME_RELEASE in
+       *4.0)
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-       fi
+               ;;
+       *5.*)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               ;;
+       esac
+       # According to Compaq, /usr/sbin/psrinfo has been available on
+       # OSF/1 and Tru64 systems produced since 1995.  I hope that
+       # covers most systems running today.  This code pipes the CPU
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE="alpha" ;;
+           "EV5 (21164)")
+               UNAME_MACHINE="alphaev5" ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE="alphaev56" ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE="alphapca56" ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE="alphapca57" ;;
+           "EV6 (21264)")
+               UNAME_MACHINE="alphaev6" ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE="alphaev67" ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE="alphaev69" ;;
+           "EV7 (21364)")
+               UNAME_MACHINE="alphaev7" ;;
+           "EV7.9 (21364A)")
+               UNAME_MACHINE="alphaev79" ;;
+       esac
+       # A Pn.n version is a patched version.
        # A Vn.n version is a released version.
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       cat <<EOF >$dummy.s
-       .data
-\$Lformat:
-       .byte 37,100,45,37,120,10,0     # "%d-%x\n"
-
-       .text
-       .globl main
-       .align 4
-       .ent main
-main:
-       .frame \$30,16,\$26,0
-       ldgp \$29,0(\$27)
-       .prologue 1
-       .long 0x47e03d80 # implver \$0
-       lda \$2,-1
-       .long 0x47e20c21 # amask \$2,\$1
-       lda \$16,\$Lformat
-       mov \$0,\$17
-       not \$1,\$18
-       jsr \$26,printf
-       ldgp \$29,0(\$26)
-       mov 0,\$16
-       jsr \$26,exit
-       .end main
-EOF
-       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               case `./$dummy` in
-                       0-0)
-                               UNAME_MACHINE="alpha"
-                               ;;
-                       1-0)
-                               UNAME_MACHINE="alphaev5"
-                               ;;
-                       1-1)
-                               UNAME_MACHINE="alphaev56"
-                               ;;
-                       1-101)
-                               UNAME_MACHINE="alphapca56"
-                               ;;
-                       2-303)
-                               UNAME_MACHINE="alphaev6"
-                               ;;
-                       2-307)
-                               UNAME_MACHINE="alphaev67"
-                               ;;
-               esac
-       fi
-       rm -f $dummy.s $dummy
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       exit ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
        # of the specific Alpha model?
        echo alpha-pc-interix
-       exit ;;
+       exit ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
-       exit ;;
+       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
-       exit 0;;
-    amiga:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
-       exit 0 ;;
-    arc64:OpenBSD:*:*)
-       echo mips64el-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    arc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    hkmips:OpenBSD:*:*)
-       echo mips-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pmax:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sgi:OpenBSD:*:*)
-       echo mips-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
+       exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
-       exit 0 ;;
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+       exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
-       exit 0;;
+       exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
-       exit 0;;
+       exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -282,25 +311,32 @@ EOF
        else
                echo pyramid-pyramid-bsd
        fi
-       exit ;;
+       exit ;;
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
-       exit 0 ;;
+       exit ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7; exit ;;
+       esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     i86pc:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
            Series*|S4*)
@@ -309,12 +345,12 @@ EOF
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
+       exit ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
@@ -324,13 +360,10 @@ EOF
                echo sparc-sun-sunos${UNAME_RELEASE}
                ;;
        esac
-       exit ;;
+       exit ;;
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit 0 ;;
-    atari*:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -341,50 +374,42 @@ EOF
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit 0 ;;
-    sun3*:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mac68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+        exit ;;
+    m68k:machten:*:*)
+       echo m68k-apple-machten${UNAME_RELEASE}
+       exit ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
-       exit ;;
+       exit ;;
     RISC*:ULTRIX:*:*)
        echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
@@ -406,27 +431,33 @@ EOF
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy \
-         && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
        echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
-       exit 0 ;;
+       exit ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
-       exit ;;
+       exit ;;
     m88k:CX/UX:7*:*)
        echo m88k-harris-cxux7
-       exit ;;
+       exit ;;
     m88k:*:4*:R4*)
        echo m88k-motorola-sysv4
-       exit ;;
+       exit ;;
     m88k:*:3*:R3*)
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -442,29 +473,29 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
-       exit ;;
+       exit ;;
     M88*:*:R3*:*)
        # Delta 88k system running SVR3
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
        echo m88k-tektronix-sysv3
-       exit ;;
+       exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
        echo m68k-tektronix-bsd
-       exit ;;
+       exit ;;
     *:IRIX*:*:*)
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
+       exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
-       exit ;;
+       exit ;;
     ia64:AIX:*:*)
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
@@ -472,9 +503,10 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
                sed 's/^                //' << EOF >$dummy.c
                #include <sys/systemcfg.h>
 
@@ -486,17 +518,20 @@ EOF
                        exit(0);
                        }
 EOF
-               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-               rm -f $dummy.c $dummy
-               echo rs6000-ibm-aix3.2.5
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
        else
                echo rs6000-ibm-aix3.2
        fi
-       exit ;;
+       exit ;;
     *:AIX:*:[45])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
@@ -508,38 +543,36 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
-       exit ;;
+       exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
-       exit ;;
+       exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit 0 ;;                           # report: romp-ibm BSD 4.3
+       exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
-       exit ;;
+       exit ;;
     DPX/2?00:B.O.S.:*:*)
        echo m68k-bull-sysv3
-       exit ;;
+       exit ;;
     9000/[34]??:4.3bsd:1.*:*)
        echo m68k-hp-bsd
-       exit ;;
+       exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
        echo m68k-hp-bsd4.4
-       exit ;;
+       exit ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        case "${UNAME_MACHINE}" in
            9000/31? )            HP_ARCH=m68000 ;;
            9000/[34]?? )         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
-              case "${HPUX_REV}" in
-                11.[0-9][0-9])
-                  if [ -x /usr/bin/getconf ]; then
-                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+               if [ -x /usr/bin/getconf ]; then
+                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
                     case "${sc_cpu_version}" in
                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
@@ -548,12 +581,13 @@ EOF
                         case "${sc_kernel_bits}" in
                           32) HP_ARCH="hppa2.0n" ;;
                           64) HP_ARCH="hppa2.0w" ;;
+                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
                         esac ;;
                     esac
-                  fi ;;
-              esac
-              if [ "${HP_ARCH}" = "" ]; then
-              sed 's/^              //' << EOF >$dummy.c
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^              //' << EOF >$dummy.c
 
               #define _HPUX_SOURCE
               #include <stdlib.h>
@@ -586,18 +620,39 @@ EOF
                   exit (0);
               }
 EOF
-       (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
-       if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
-       rm -f $dummy.c $dummy
-       fi ;;
+                   (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   test -z "$HP_ARCH" && HP_ARCH=hppa
+               fi ;;
        esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           eval $set_cc_for_build
+
+           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep __LP64__ >/dev/null
+           then
+               HP_ARCH="hppa2.0w"
+           else
+               HP_ARCH="hppa64"
+           fi
+       fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     ia64:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     3050*:HI-UX:*:*)
+       eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
        #include <unistd.h>
        int
@@ -623,239 +678,246 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
-       exit ;;
+       exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
        echo hppa1.1-hp-bsd
-       exit ;;
+       exit ;;
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
-       exit ;;
-    *9??*:MPE/iX:*:*)
+       exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
-       exit ;;
+       exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
-       exit ;;
+       exit ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
-       exit ;;
+       exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
            echo ${UNAME_MACHINE}-unknown-osf1mk
        else
            echo ${UNAME_MACHINE}-unknown-osf1
        fi
-       exit ;;
+       exit ;;
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
-       exit 0 ;;
-    hppa*:OpenBSD:*:*)
-       echo hppa-unknown-openbsd
-       exit 0 ;;
+       exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit 0 ;;
-    CRAY*X-MP:*:*:*)
-       echo xmp-cray-unicos
-        exit 0 ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE}
-       exit ;;
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
-       exit 0 ;;
+             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+             -e 's/\.[^.]*$/.X/'
+       exit ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
-    CRAY*T3D:*:*:*)
-       echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit 0 ;;
+       exit ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
-    CRAY-2:*:*:*)
-       echo cray2-cray-unicos
-        exit 0 ;;
+       exit ;;
+    *:UNICOS/mp:*:*)
+       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit 0 ;;
-    hp300:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit 0 ;;
-    *:OpenBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-       exit 0 ;;
+       case ${UNAME_MACHINE} in
+           pc98)
+               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+           *)
+               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       esac
+       exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
+       exit ;;
     i*:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
-       exit 0 ;;
+       exit ;;
+    i*:MSYS_NT-*:*:*)
+       echo ${UNAME_MACHINE}-pc-mingw32
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
-       exit 0 ;;
+       exit ;;
+    x86:Interix*:[345]*)
+       echo i586-pc-interix${UNAME_RELEASE}
+       exit ;;
+    EM64T:Interix*:[345]*)
+       echo x86_64-unknown-interix${UNAME_RELEASE}
+       exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+       echo i${UNAME_MACHINE}-pc-mks
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
        # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i386-pc-interix
-       exit ;;
+       echo i586-pc-interix
+       exit ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
-       exit 0 ;;
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
-       exit ;;
+       exit ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     *:GNU:*:*)
+       # the GNU system
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit 0 ;;
+       exit ;;
+    *:GNU/*:*:*)
+       # other systems with GNU libc and userland
+       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+       exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
+       exit ;;
     arm*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       exit ;;
+    cris:Linux:*:*)
+       echo cris-axis-linux-gnu
+       exit ;;
+    crisv32:Linux:*:*)
+       echo crisv32-axis-linux-gnu
+       exit ;;
+    frv:Linux:*:*)
+       echo frv-unknown-linux-gnu
+       exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux
-       exit 0 ;;
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     mips:Linux:*:*)
-       cat >$dummy.c <<EOF
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-int main (int argc, char *argv[]) {
-#else
-int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __MIPSEB__
-  printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
-  printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
-  return 0;
-}
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips
+       #undef mipsel
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mipsel
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips
+       #else
+       CPU=
+       #endif
+       #endif
 EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
-    ppc:Linux:*:*)
-       # Determine Lib Version
-       cat >$dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
-#if defined(__GLIBC__)
-  printf("%s %s\n", __libc_version, __libc_release);
-#else
-  printf("unknown\n");
-#endif
-  return 0;
-}
+    mips64:Linux:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #undef CPU
+       #undef mips64
+       #undef mips64el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mips64el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=mips64
+       #else
+       CPU=
+       #endif
+       #endif
 EOF
-       LIBC=""
-       $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               ./$dummy | grep 1\.99 > /dev/null
-               if test "$?" = 0 ; then LIBC="libc1" ; fi
-       fi
-       rm -f $dummy.c $dummy
-       echo powerpc-unknown-linux-gnu${LIBC}
-       exit 0 ;;
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^CPU/{
+               s: ::g
+               p
+           }'`"
+       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+       ;;
+    or32:Linux:*:*)
+       echo or32-unknown-linux-gnu
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-gnu
+       exit ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-gnu
+       exit ;;
     alpha:Linux:*:*)
-       cat <<EOF >$dummy.s
-         .data
-         \$Lformat:
-               .byte 37,100,45,37,120,10,0     # "%d-%x\n"
-          .text
-               .globl main
-               .align 4
-               .ent main
-           main:
-               .frame \$30,16,\$26,0
-               ldgp \$29,0(\$27)
-               .prologue 1
-               .long 0x47e03d80 # implver \$0
-               lda \$2,-1
-               .long 0x47e20c21 # amask \$2,\$1
-               lda \$16,\$Lformat
-               mov \$0,\$17
-               not \$1,\$18
-               jsr \$26,printf
-               ldgp \$29,0(\$26)
-               mov 0,\$16
-               jsr \$26,exit
-               .end main
-EOF
-       LIBC=""
-       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
-       if test "$?" = 0 ; then
-               case `./$dummy` in
-               0-0)    UNAME_MACHINE="alpha" ;;
-               1-0)    UNAME_MACHINE="alphaev5" ;;
-               1-1)    UNAME_MACHINE="alphaev56" ;;
-               1-101)  UNAME_MACHINE="alphapca56" ;;
-               2-303)  UNAME_MACHINE="alphaev6" ;;
-               2-307)  UNAME_MACHINE="alphaev67" ;;
-               esac
-               objdump --private-headers $dummy | \
-                 grep ld.so.1 > /dev/null
-               if test "$?" = 0 ; then
-                       LIBC="libc1"
-               fi
-       fi
-       rm -f $dummy.s $dummy
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-       exit ;;
+       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -863,93 +925,97 @@ EOF
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
          *)    echo hppa-unknown-linux-gnu ;;
        esac
-       exit ;;
+       exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
        echo hppa64-unknown-linux-gnu
-       exit ;;
+       exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
-       exit 0 ;;
+       exit ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit ;;
+       exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
-       exit 0 ;;
+       exit ;;
+    vax:Linux:*:*)
+       echo ${UNAME_MACHINE}-dec-linux-gnu
+       exit ;;
     x86_64:Linux:*:*)
        echo x86_64-unknown-linux-gnu
-       exit ;;
+       exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
        # problems with other programs or directories called `ld' in the path.
-       ld_supported_emulations=`cd /; ld --help 2>&1 \
-                        | sed -ne '/supported emulations:/!d
+       # Set LC_ALL=C to ensure ld outputs messages in English.
+       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+                        | sed -ne '/supported targets:/!d
                                    s/[         ][      ]*/ /g
-                                   s/.*supported emulations: *//
+                                   s/.*supported targets: *//
                                    s/ .*//
                                    p'`
-        case "$ld_supported_emulations" in
-         i*86linux)
-               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit 0
-               ;;
-         elf_i*86)
+        case "$ld_supported_targets" in
+         elf32-i386)
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
                ;;
-         i*86coff)
+         a.out-i386-linux)
+               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+               exit ;;
+         coff-i386)
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-               exit 0
-               ;;
-       esac
-       # Either a pre-BFD a.out linker (linux-gnuoldld)
-       # or one that does not give us useful --help.
-       # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
-       # If ld does not provide *any* "supported emulations:"
-       # that means it is gnuoldld.
-       test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-       case "${UNAME_MACHINE}" in
-       i*86)
-         VENDOR=pc;
-         ;;
-       *)
-         VENDOR=unknown;
-         ;;
+               exit ;;
+         "")
+               # Either a pre-BFD a.out linker (linux-gnuoldld) or
+               # one that does not give us useful --help.
+               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+               exit ;;
        esac
        # Determine whether the default compiler is a.out or elf
-       cat >$dummy.c <<EOF
-#include <features.h>
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-       int main (int argc, char *argv[]) {
-#else
-       int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-#  if __GLIBC__ >= 2
-    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-#  else
-    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-#  endif
-# else
-   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
-  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
-  return 0;
-}
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #ifdef __ELF__
+       # ifdef __GLIBC__
+       #  if __GLIBC__ >= 2
+       LIBC=gnu
+       #  else
+       LIBC=gnulibc1
+       #  endif
+       # else
+       LIBC=gnulibc1
+       # endif
+       #else
+       #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun)
+       LIBC=gnu
+       #else
+       LIBC=gnuaout
+       #endif
+       #endif
+       #ifdef __dietlibc__
+       LIBC=dietlibc
+       #endif
 EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
-       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+       eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+           /^LIBC/{
+               s: ::g
+               p
+           }'`"
+       test x"${LIBC}" != x && {
+               echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+               exit
+       }
+       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
        ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
-# are messed up and put the nodename in both sysname and nodename.
     i*86:DYNIX/ptx:4*:*)
+       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+       # earlier versions are messed up and put the nodename in both
+       # sysname and nodename.
        echo i386-sequent-sysv4
-       exit ;;
+       exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -957,7 +1023,27 @@ EOF
        # I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit 0 ;;
+       exit ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       exit ;;
+    i*86:syllable:*:*)
+       echo ${UNAME_MACHINE}-pc-syllable
+       exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+       echo i386-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -965,100 +1051,100 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
-       exit ;;
-    i*86:*:5:7*)
-        # Fixed at (any) Pentium or better
-        UNAME_MACHINE=i586
-        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
-           echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
-       else
-           echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
-       fi
-       exit ;;
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       case `/bin/uname -X | grep "^Machine"` in
+           *486*)           UNAME_MACHINE=i486 ;;
+           *Pentium)        UNAME_MACHINE=i586 ;;
+           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+       esac
+       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-               (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
-               (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
                        && UNAME_MACHINE=i686
-               (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
-       exit 0 ;;
-    i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit 0 ;;
+       exit ;;
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
        echo i386-pc-msdosdjgpp
-        exit ;;
+        exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
-       exit ;;
+       exit ;;
     paragon:*:*:*)
        echo i860-intel-osf1
-       exit ;;
+       exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
-       exit ;;
+       exit ;;
     mini*:CTIX:SYS*5:*)
        # "miniframe"
        echo m68010-convergent-sysv
-       exit 0 ;;
-    M68*:*:R3V[567]*:*)
-       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+       exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       exit ;;
+    M68*:*:R3V[5678]*:*)
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
-       exit 0 ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1066,78 +1152,98 @@ EOF
        else
                echo ns32k-sni-sysv
        fi
-       exit ;;
-    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                           # says <Richard.M.Bartel@ccMail.Census.GOV>
+       exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
        echo hppa1.1-stratus-sysv4
-       exit ;;
+       exit ;;
     *:*:*:FTX*)
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
-       exit 0 ;;
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
+    *:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo hppa1.1-stratus-vos
+       exit ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
-       exit ;;
+       exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
                echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
-       exit ;;
+       exit ;;
     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
        echo powerpc-apple-beos
-       exit ;;
+       exit ;;
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
-       exit ;;
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Rhapsody:*:*)
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Darwin:*:*)
-       echo `uname -p`-apple-darwin${UNAME_RELEASE}
-       exit 0 ;;
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       case $UNAME_PROCESSOR in
+           unknown) UNAME_PROCESSOR=powerpc ;;
+       esac
+       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       if test "${UNAME_MACHINE}" = "x86pc"; then
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo `uname -p`-${UNAME_MACHINE}-nto-qnx
-       exit ;;
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
-       exit 0 ;;
-    NSR-[KW]:NONSTOP_KERNEL:*:*)
+       exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
-       exit ;;
+       exit ;;
     BS2000:POSIX*:*:*)
        echo bs2000-siemens-sysv
-       exit ;;
+       exit ;;
     DS/*:UNIX_System_V:*:*)
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
@@ -1148,35 +1254,53 @@ EOF
            UNAME_MACHINE="$cputype"
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
-       exit 0 ;;
-    i*86:OS/2:*:*)
-       # If we were able to find `uname', then EMX Unix compatibility
-       # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
-       exit 0 ;;
+       exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
-       exit ;;
+       exit ;;
     *:TENEX:*:*)
        echo pdp10-unknown-tenex
-       exit ;;
+       exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
-       exit ;;
+       exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
        echo pdp10-xkl-tops20
-       exit ;;
+       exit ;;
     *:TOPS-20:*:*)
        echo pdp10-unknown-tops20
-       exit ;;
+       exit ;;
     *:ITS:*:*)
        echo pdp10-unknown-its
-       exit 0 ;;
+       exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+       exit ;;
+    *:DragonFly:*:*)
+       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       exit ;;
+    *:*VMS:*:*)
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       case "${UNAME_MACHINE}" in
+           A*) echo alpha-dec-vms ; exit ;;
+           I*) echo ia64-dec-vms ; exit ;;
+           V*) echo vax-dec-vms ; exit ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+       exit ;;
+    i*86:rdos:*:*)
+       echo ${UNAME_MACHINE}-pc-rdos
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
+eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
@@ -1202,7 +1326,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1291,12 +1415,12 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+       { echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1305,22 +1429,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
        echo c1-convex-bsd
-       exit ;;
+       exit ;;
     c2*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-       exit ;;
+       exit ;;
     c34*)
        echo c34-convex-bsd
-       exit ;;
+       exit ;;
     c38*)
        echo c38-convex-bsd
-       exit ;;
+       exit ;;
     c4*)
        echo c4-convex-bsd
-       exit ;;
+       exit ;;
     esac
 fi
 
@@ -1331,7 +1455,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index a06a480adafdfbe81925988759b3e29088d6d2e0..ad9f39571183b5c22b2d269bb52eb9ad50227430 100644 (file)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2001-04-20'
+timestamp='2006-02-23'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,15 +21,17 @@ timestamp='2001-04-20'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Please send patches to <config-patches@gnu.org>.
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -69,7 +71,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -82,11 +84,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -98,7 +100,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -117,7 +119,9 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
+  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -143,7 +147,7 @@ case $os in
        -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis)
+       -apple | -axis | -knuth | -cray)
                os=
                basic_machine=$1
                ;;
@@ -157,9 +161,21 @@ case $os in
                os=-vxworks
                basic_machine=$1
                ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -sco5)
                os=-sco3.2v5
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -176,6 +192,10 @@ case $os in
                # Don't forget version if it is 3.2v4 or newer.
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -sco*)
                os=-sco3.2v2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -215,26 +235,58 @@ esac
 case $basic_machine in
        # Recognize the basic CPU types without company name.
        # Some are omitted here because they have special meanings below.
-       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
-               | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
-               | pyramid | mn10200 | mn10300 | tron | a29k \
-               | 580 | i960 | h8300 \
-               | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
-               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-               | hppa64 \
-               | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
-               | alphaev6[78] \
-               | we32k | ns16k | clipper | i370 | sh | sh[34] \
-               | powerpc | powerpcle \
-               | 1750a | dsp16xx | pdp10 | pdp11 \
-               | mips16 | mips64 | mipsel | mips64el \
-               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
-               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-               | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
-               | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
-               | v850 | c4x \
-               | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
-               | pj | pjl | h8500)
+       1750a | 580 \
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | am33_2.0 \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | bfin \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64vr | mips64vrel \
+       | mips64orion | mips64orionel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | mt \
+       | msp430 \
+       | nios | nios2 \
+       | ns16k | ns32k \
+       | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b \
+       | strongarm \
+       | tahoe | thumb | tic4x | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | z8k)
+               basic_machine=$basic_machine-unknown
+               ;;
+       m32c)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -242,7 +294,10 @@ case $basic_machine in
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
                ;;
 
        # We use `pc' rather than `unknown'
@@ -257,31 +312,68 @@ case $basic_machine in
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
-       # FIXME: clean up the formatting here.
-       vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
-             | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
-             | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
-             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
-             | xmp-* | ymp-* \
-             | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
-             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
-             | hppa2.0n-* | hppa64-* \
-             | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
-             | alphaev6[78]-* \
-             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
-             | clipper-* | orion-* \
-             | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-             | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
-             | mips16-* | mips64-* | mipsel-* \
-             | mips64el-* | mips64orion-* | mips64orionel-* \
-             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
-             | mipstx39-* | mipstx39el-* | mcore-* \
-             | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
-             | [cjt]90-* \
-             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
-             | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
-             | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
+       580-* \
+       | a29k-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nios-* | nios2-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa-* \
+       | ymp-* \
+       | z8k-*)
+               ;;
+       m32c-*)
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -299,6 +391,9 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
        adobe68k)
                basic_machine=m68010-adobe
                os=-scout
@@ -313,6 +408,12 @@ case $basic_machine in
                basic_machine=a29k-none
                os=-bsd
                ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        amdahl)
                basic_machine=580-amdahl
                os=-sysv
@@ -344,6 +445,10 @@ case $basic_machine in
                basic_machine=ns32k-sequent
                os=-dynix
                ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -364,30 +469,45 @@ case $basic_machine in
                basic_machine=c38-convex
                os=-bsd
                ;;
-       cray | ymp)
-               basic_machine=ymp-cray
+       cray | j90)
+               basic_machine=j90-cray
                os=-unicos
                ;;
-       cray2)
-               basic_machine=cray2-cray
-               os=-unicos
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
                ;;
-       [cjt]90)
-               basic_machine=${basic_machine}-cray
-               os=-unicos
+       cr16c)
+               basic_machine=cr16c-unknown
+               os=-elf
                ;;
        crds | unos)
                basic_machine=m68k-crds
                ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
        cris | cris-* | etrax*)
                basic_machine=cris-axis
                ;;
+       crx)
+               basic_machine=crx-unknown
+               os=-elf
+               ;;
        da30 | da30-*)
                basic_machine=m68k-da30
                ;;
        decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
                basic_machine=mips-dec
                ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
                basic_machine=m68k-motorola
@@ -396,6 +516,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
        dpx20 | dpx20-*)
                basic_machine=rs6000-bull
                os=-bosx
@@ -568,32 +692,27 @@ case $basic_machine in
                basic_machine=m68k-atari
                os=-mint
                ;;
-       mipsel*-linux*)
-               basic_machine=mipsel-unknown
-               os=-linux-gnu
-               ;;
-       mips*-linux*)
-               basic_machine=mips-unknown
-               os=-linux-gnu
-               ;;
        mips3*-*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
                ;;
        mips3*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
                ;;
-       mmix*)
-               basic_machine=mmix-knuth
-               os=-mmixware
-               ;;
        monitor)
                basic_machine=m68k-rom68k
                os=-coff
                ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
        msdos)
                basic_machine=i386-pc
                os=-msdos
                ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
@@ -669,6 +788,13 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
+       openrisc | openrisc-*)
+               basic_machine=or32-unknown
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
+               ;;
        OSE68000 | ose68000)
                basic_machine=m68000-ericsson
                os=-ose
@@ -691,42 +817,64 @@ case $basic_machine in
        pbb)
                basic_machine=m68k-tti
                ;;
-        pc532 | pc532-*)
+       pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pentium | p5 | k5 | k6 | nexgen)
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
-       pentiumpro | p6 | 6x86 | athlon)
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
                basic_machine=i686-pc
                ;;
-       pentiumii | pentium2)
+       pentiumii | pentium2 | pentiumiii | pentium3)
                basic_machine=i686-pc
                ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
                basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        pentiumpro-* | p6-* | 6x86-* | athlon-*)
                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
-       pentiumii-* | pentium2-*)
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        pn)
                basic_machine=pn-gould
                ;;
        power)  basic_machine=power-ibm
                ;;
        ppc)    basic_machine=powerpc-unknown
-               ;;
+               ;;
        ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
-               ;;
+               ;;
        ppcle-* | powerpclittle-*)
                basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        ps2)
                basic_machine=i386-ibm
                ;;
@@ -734,6 +882,10 @@ case $basic_machine in
                basic_machine=i586-unknown
                os=-pw32
                ;;
+       rdos)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
        rom68k)
                basic_machine=m68k-rom68k
                os=-coff
@@ -744,10 +896,26 @@ case $basic_machine in
        rtpc | rtpc-*)
                basic_machine=romp-ibm
                ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
        sa29200)
                basic_machine=a29k-amd
                os=-udi
                ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
        sequent)
                basic_machine=i386-sequent
                ;;
@@ -755,7 +923,10 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
-       sparclite-wrs)
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
                basic_machine=sparclite-wrs
                os=-vxworks
                ;;
@@ -822,22 +993,42 @@ case $basic_machine in
                os=-dynix
                ;;
        t3e)
-               basic_machine=t3e-cray
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
                os=-unicos
                ;;
        tic54x | c54x*)
                basic_machine=tic54x-unknown
                os=-coff
                ;;
+       tic55x | c55x*)
+               basic_machine=tic55x-unknown
+               os=-coff
+               ;;
+       tic6x | c6x*)
+               basic_machine=tic6x-unknown
+               os=-coff
+               ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
        tx39el)
                basic_machine=mipstx39el-unknown
                ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
        tower | tower-32)
                basic_machine=m68k-ncr
                ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
        udi29k)
                basic_machine=a29k-amd
                os=-udi
@@ -859,8 +1050,8 @@ case $basic_machine in
                os=-vms
                ;;
        vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
-               ;;
+               basic_machine=f301-fujitsu
+               ;;
        vxworks960)
                basic_machine=i960-wrs
                os=-vxworks
@@ -881,13 +1072,17 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
-       xmp)
-               basic_machine=xmp-cray
-               os=-unicos
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
                ;;
-        xps | xps100)
+       xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
        z8k-*-coff)
                basic_machine=z8k-unknown
                os=-sim
@@ -908,16 +1103,12 @@ case $basic_machine in
        op60c)
                basic_machine=hppa1.1-oki
                ;;
-       mips)
-               if [ x$os = x-linux-gnu ]; then
-                       basic_machine=mips-unknown
-               else
-                       basic_machine=mips-mips
-               fi
-               ;;
        romp)
                basic_machine=romp-ibm
                ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
        rs6000)
                basic_machine=rs6000-ibm
                ;;
@@ -934,13 +1125,13 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4)
+       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sparc | sparcv9 | sparcv9b)
+       sparc | sparcv8 | sparcv9 | sparcv9b)
                basic_machine=sparc-sun
                ;;
-        cydra)
+       cydra)
                basic_machine=cydra-cydrome
                ;;
        orion)
@@ -955,10 +1146,6 @@ case $basic_machine in
        pmac | pmac-mpw)
                basic_machine=powerpc-apple
                ;;
-       c4x*)
-               basic_machine=c4x-none
-               os=-coff
-               ;;
        *-unknown)
                # Make sure to match an already-canonicalized machine name.
                ;;
@@ -1014,15 +1201,23 @@ case $os in
              | -aos* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -openbsd* | -solidbsd* \
+             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
-             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1034,16 +1229,21 @@ case $os in
                        ;;
                esac
                ;;
+       -nto-qnx*)
+               ;;
        -nto*)
-               os=-nto-qnx
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
                ;;
        -mac*)
                os=`echo $os | sed -e 's|mac|macos|'`
                ;;
+       -linux-dietlibc)
+               os=-linux-dietlibc
+               ;;
        -linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
@@ -1056,6 +1256,9 @@ case $os in
        -opened*)
                os=-openedition
                ;;
+        -os400*)
+               os=-os400
+               ;;
        -wince*)
                os=-wince
                ;;
@@ -1074,14 +1277,23 @@ case $os in
        -acis*)
                os=-aos
                ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
        -386bsd)
                os=-bsd
                ;;
        -ctix* | -uts*)
                os=-sysv
                ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
        -ns2 )
-               os=-nextstep2
+               os=-nextstep2
                ;;
        -nsk*)
                os=-nsk
@@ -1093,6 +1305,9 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
+        -tpf*)
+               os=-tpf
+               ;;
        -triton*)
                os=-sysv3
                ;;
@@ -1120,8 +1335,17 @@ case $os in
        -xenix)
                os=-xenix
                ;;
-        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -kaos*)
+               os=-kaos
+               ;;
+       -zvmoe)
+               os=-zvmoe
                ;;
        -none)
                ;;
@@ -1154,10 +1378,14 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
+    c4x-* | tic4x-*)
+        os=-coff
+        ;;
+       # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
                ;;
-        pdp11-*)
+       pdp11-*)
                os=-none
                ;;
        *-dec | vax-*)
@@ -1184,6 +1412,9 @@ case $basic_machine in
        mips*-*)
                os=-elf
                ;;
+       or32-*)
+               os=-coff
+               ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
                os=-sysv3
                ;;
@@ -1193,9 +1424,15 @@ case $basic_machine in
        *-be)
                os=-beos
                ;;
+       *-haiku)
+               os=-haiku
+               ;;
        *-ibm)
                os=-aix
                ;;
+       *-knuth)
+               os=-mmixware
+               ;;
        *-wec)
                os=-proelf
                ;;
@@ -1247,19 +1484,19 @@ case $basic_machine in
        *-next)
                os=-nextstep3
                ;;
-        *-gould)
+       *-gould)
                os=-sysv
                ;;
-        *-highlevel)
+       *-highlevel)
                os=-bsd
                ;;
        *-encore)
                os=-bsd
                ;;
-        *-sgi)
+       *-sgi)
                os=-irix
                ;;
-        *-siemens)
+       *-siemens)
                os=-sysv4
                ;;
        *-masscomp)
@@ -1328,10 +1565,16 @@ case $basic_machine in
                        -mvs* | -opened*)
                                vendor=ibm
                                ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
                        -ptx*)
                                vendor=sequent
                                ;;
-                       -vxsim* | -vxworks*)
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
                                vendor=wrs
                                ;;
                        -aux*)
@@ -1346,13 +1589,16 @@ case $basic_machine in
                        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
                                vendor=atari
                                ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
                esac
                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
index 0dc41240654dbd13e04a39896b0f6bf0c3f300ba..fdbd0d5e0e14839735b22c9ea6347f6e38418b7b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1622,7 +1622,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=abook
- VERSION=0.5.6
+ VERSION=0.6.0pre2
 
 
 cat >>confdefs.h <<_ACEOF
@@ -10193,8 +10193,10 @@ _ACEOF
 
 
        abook_localedir="$datadir/locale"
-       abook_localedir=`(      test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-               eval echo \""$abook_localedir"\"        )`
+                       abook_localedir=`(      test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+               eval tmp_abook_prefix=\""$abook_localedir"\"
+               eval echo $tmp_abook_prefix
+               )`
 
 localedir="\$(datadir)/locale"
 
index e6cc9222da95b92454c7341988e3651a477715e4..105cf5542bc33797f834ba5c071606996a134fd1 100644 (file)
@@ -1,7 +1,7 @@
 dnl abook configure.in
 
 AC_INIT(abook.c)
-AM_INIT_AUTOMAKE(abook, 0.5.6)
+AM_INIT_AUTOMAKE(abook, 0.6.0pre2)
 AM_CONFIG_HEADER(config.h)
 
 dnl ---------------
@@ -13,8 +13,12 @@ AM_GNU_GETTEXT_VERSION(0.14.1)
 
 AC_DEFUN([ABOOK_EXPAND_PREFIX], [
        $1=$2
+       dnl expanding twice, since from autoconf 2.60 on, $datadir refers to
+       dnl $datarootdir which in turn refers to $prefix
        $1=`(   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
-               eval echo \""[$]$1"\"   )`
+               eval tmp_abook_prefix=\""[$]$1"\"
+               eval echo $tmp_abook_prefix
+               )`
 ])
 
 ABOOK_EXPAND_PREFIX(abook_localedir, "$datadir/locale")
diff --git a/contrib/CVS/Entries b/contrib/CVS/Entries
new file mode 100644 (file)
index 0000000..1784810
--- /dev/null
@@ -0,0 +1 @@
+D
diff --git a/contrib/CVS/Repository b/contrib/CVS/Repository
new file mode 100644 (file)
index 0000000..cb97fad
--- /dev/null
@@ -0,0 +1 @@
+abook/contrib
diff --git a/contrib/CVS/Root b/contrib/CVS/Root
new file mode 100644 (file)
index 0000000..2f2a68d
--- /dev/null
@@ -0,0 +1 @@
+:ext:jheinonen@abook.cvs.sourceforge.net:/cvsroot/abook
index cabd3305f2c0079a4e2387d74c44ab59b885b9e6..7c47ab6d85a60fd5afbbbd69eb20b1565983856e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: database.c,v 1.29.2.1 2005/10/26 19:45:23 jheinonen Exp $
+ * $Id: database.c,v 1.39 2006/09/04 18:29:25 cduval Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
-#include "abook.h"
 #include <assert.h>
+#ifdef HAVE_CONFIG_H
+#      include "config.h"
+#endif
+#include "abook.h"
 #include "database.h"
 #include "gettext.h"
 #include "list.h"
 #include "misc.h"
-#include "options.h"
-#include "filter.h"
 #include "xmalloc.h"
-#ifdef HAVE_CONFIG_H
-#      include "config.h"
-#endif
+
+abook_field_list *fields_list = NULL;
+int fields_count = 0;
 
 list_item *database = NULL;
+static int items = 0;
 
-int items = 0;
+#define ITEM_SIZE (fields_count * sizeof(char *))
+#define LAST_ITEM (items - 1)
 
 #define INITIAL_LIST_CAPACITY  30
-
 static int list_capacity = 0;
 
+int standard_fields_indexed[ITEM_FIELDS];
+
+/*
+ * notes about adding predefined "standard" fields:
+ *     - leave alone "name" and "email"
+ *     - reorganize the field numbers in database.h
+ */
+abook_field standard_fields[] = {
+       {"name",        N_("Name"),             FIELD_STRING}, /* NAME */
+       {"email",       N_("E-mail addresses"), FIELD_EMAILS}, /* EMAIL */
+       {"address",     N_("Address"),          FIELD_STRING}, /* ADDRESS */
+       {"address2",    N_("Address2"),         FIELD_STRING}, /* ADDRESS2 */
+       {"city",        N_("City"),             FIELD_STRING}, /* CITY */
+       {"state",       N_("State/Province"),   FIELD_STRING}, /* STATE */
+       {"zip",         N_("ZIP/Postal Code"),  FIELD_STRING}, /* ZIP */
+       {"country",     N_("Country"),          FIELD_STRING}, /* COUNTRY */
+       {"phone",       N_("Home Phone"),       FIELD_STRING}, /* PHONE */
+       {"workphone",   N_("Work Phone"),       FIELD_STRING}, /* WORKPHONE */
+       {"fax",         N_("Fax"),              FIELD_STRING}, /* FAX */
+       {"mobile",      N_("Mobile"),           FIELD_STRING}, /* MOBILEPHONE */
+       {"nick",        N_("Nickname/Alias"),   FIELD_STRING}, /* NICK */
+       {"url",         N_("URL"),              FIELD_STRING}, /* URL */
+       {"notes",       N_("Notes"),            FIELD_STRING}, /* NOTES */
+       {"anniversary", N_("Anniversary day"),  FIELD_DATE},   /* ANNIVERSARY */
+       {0} /* ITEM_FIELDS */
+};
+
+
 extern int first_list_item;
 extern int curitem;
 extern char *selected;
-
 extern char *datafile;
 
+
+
+static abook_field *
+declare_standard_field(int i)
+{
+       abook_field *f = xmalloc(sizeof(abook_field));
+
+       f = memcpy(f, &standard_fields[i], sizeof(abook_field));
+       f->name = xstrdup(gettext(f->name));
+
+       add_field(&fields_list, f);
+
+       assert(standard_fields_indexed[i] == -1);
+       standard_fields_indexed[i] = fields_count++;
+
+       return f;
+}
+
+abook_field *
+find_standard_field(char *key, int do_declare)
+{
+       int i;
+
+       for(i = 0; standard_fields[i].key; i++)
+               if(0 == strcmp(standard_fields[i].key, key))
+                       goto found;
+
+       return NULL;
+
+found:
+       return do_declare ? declare_standard_field(i) : &standard_fields[i];
+}
+
+/* Search for a field. Use the list of declared fields if no list specified. */
+abook_field *
+real_find_field(char *key, abook_field_list *list, int *number)
+{
+       abook_field_list *cur;
+       int i;
+
+       for(cur = (list ? list : fields_list), i = 0; cur; cur = cur->next, i++)
+               if(0 == strcmp(cur->field->key, key)) {
+                       if(number)
+                               *number = i;
+                       return cur->field;
+               }
+
+       if(number)
+               *number = -1;
+
+       return NULL;
+}
+
+void
+get_field_info(int i, char **key, char **name, int *type)
+{
+       abook_field_list *cur = fields_list;
+       int j;
+
+       assert(i < fields_count);
+
+       for(j = 0; i >= 0 && j < i; j++, cur = cur->next)
+               ;
+
+       if(key)
+               *key = (i < 0) ? NULL : cur->field->key;
+       if(name)
+               *name = (i < 0) ? NULL : cur->field->name;
+       if(type)
+               *type = (i < 0) ? -1 : cur->field->type;
+}
+
+void
+add_field(abook_field_list **list, abook_field *f)
+{
+       abook_field_list *tmp;
+
+       for(tmp = *list; tmp && tmp->next; tmp = tmp->next)
+               ;
+
+       if(tmp) {
+               tmp->next = xmalloc(sizeof(abook_field_list));
+               tmp = tmp->next;
+       } else
+               *list = tmp = xmalloc(sizeof(abook_field_list));
+
+       tmp->field = f;
+       tmp->next = NULL;
+}
+
+char *
+declare_new_field(char *key, char *name, char *type, int accept_standard)
+{
+       abook_field *f;
+
+       if(find_declared_field(key))
+               return _("field already defined");
+
+       if(find_standard_field(key, accept_standard))
+               return accept_standard ? NULL /* ok, added */ :
+                       _("standard field does not need to be declared");
+
+       f = xmalloc(sizeof(abook_field));
+       f->key = xstrdup(key);
+       f->name = xstrdup(name);
+
+       if(!*type || (0 == strcasecmp("string", type)))
+               f->type = FIELD_STRING;
+       else if(0 == strcasecmp("emails", type))
+               f->type = FIELD_EMAILS;
+       else if(0 == strcasecmp("list", type))
+               f->type = FIELD_LIST;
+       else if(0 == strcasecmp("date", type))
+               f->type = FIELD_DATE;
+       else
+               return _("unknown type");
+
+       add_field(&fields_list, f);
+       fields_count++;
+
+       return NULL;
+}
+
 /*
- * field definitions
+ * Declare a new field while database is already loaded
+ * making it grow accordingly
  */
+static void
+declare_unknown_field(char *key)
+{
+       int i;
+
+       declare_new_field(key, key, "string",
+                       1 /* accept to declare "standard" fields */);
 
-#include "edit.h"
+       if(!database)
+               return;
+
+       for(i = 0; i < items; i++)
+               if(database[i]) {
+                       database[i] = xrealloc(database[i], ITEM_SIZE);
+                       database[i][fields_count - 1] = NULL;
+               }
+}
 
 /*
- * notes about adding fields:
- *     - do not change any fields in TAB_CONTACT
- *     - do not add fields to contact tab
- *     - 6 fields per tab is maximum
- *     - reorganize the field numbers in database.h
+ * Declare "standard" fields, thus preserving them while parsing a database,
+ * even if they won't be displayed.
  */
+void
+init_standard_fields()
+{
+       int i;
 
-struct abook_field abook_fields[ITEM_FIELDS] = {
-       {N_("Name"),    "name",         TAB_CONTACT},/* NAME */
-       {N_("E-mails"), "email",        TAB_CONTACT},/* EMAIL */
-       {N_("Address"), "address",      TAB_ADDRESS},/* ADDRESS */
-       {N_("Address2"),        "address2",     TAB_ADDRESS},/* ADDRESS2 */
-       {N_("City"),    "city",         TAB_ADDRESS},/* CITY */
-       {N_("State/Province"),"state",  TAB_ADDRESS},/* STATE */
-       {N_("ZIP/Postal Code"),"zip",   TAB_ADDRESS},/* ZIP */
-       {N_("Country"), "country",      TAB_ADDRESS},/* COUNTRY */
-       {N_("Home Phone"),      "phone",        TAB_PHONE},/* PHONE */
-       {N_("Work Phone"),      "workphone",    TAB_PHONE},/* WORKPHONE */
-       {N_("Fax"),             "fax",          TAB_PHONE},/* FAX */
-       {N_("Mobile"),  "mobile",       TAB_PHONE},/* MOBILEPHONE */
-       {N_("Nickname/Alias"), "nick",      TAB_OTHER},/* NICK */
-       {N_("URL"),             "url",          TAB_OTHER},/* URL */
-       {N_("Notes"),   "notes",        TAB_OTHER},/* NOTES */
-       {N_("Custom1"), "custom1",      TAB_CUSTOM},/* CUSTOM1 */
-       {N_("Custom2"), "custom2",      TAB_CUSTOM},/* CUSTOM2 */
-       {N_("Custom3"), "custom3",      TAB_CUSTOM},/* CUSTOM3 */
-       {N_("Custom4"), "custom4",      TAB_CUSTOM},/* CUSTOM4 */
-       {N_("Custom5"), "custom5",      TAB_CUSTOM},/* CUSTOM5 */
-};
-
+       for(i = 0; standard_fields[i].key; i++)
+               if(standard_fields_indexed[i] == -1)
+                       declare_standard_field(i);
+}
 
-int
-find_field(const char *field)
+/* Some initializations - Must be called _before_ load_opts() */
+void
+prepare_database_internals()
 {
        int i;
 
        for(i = 0; i < ITEM_FIELDS; i++)
-               if( !strcmp(abook_fields[i].key, field) )
-                       return i;
+               standard_fields_indexed[i] = -1;
 
-       return -1;
+       /* the only two mandatory fields */
+       declare_standard_field(NAME);
+       declare_standard_field(EMAIL);
 }
 
 int
@@ -94,50 +245,57 @@ parse_database(FILE *in)
 {
         char *line = NULL;
        char *tmp;
-       int sec=0, i;
-       list_item item;
+       int sec=0, field;
+       list_item item;
 
-       memset(&item, 0, sizeof(item));
+       item = item_create();
 
        for(;;) {
                line = getaline(in);
                if(feof(in)) {
-                       if(item[NAME] && sec)
+                       if(item[field_id(NAME)] && sec) {
                                add_item2database(item);
-                       else
-                               free_list_item(item);
+                       } else {
+                               item_empty(item);
+                       }
                        break;
                }
 
                if(!*line || *line == '\n' || *line == '#') {
                        goto next;
                } else if(*line == '[') {
-                       if( item[NAME] && sec )
+                       if(item[field_id(NAME)] && sec ) {
                                add_item2database(item);
-                       else
-                               free_list_item(item);
-                       memset(&item, 0, sizeof(item));
+                       } else {
+                               item_empty(item);
+                       }
                        sec = 1;
+                       memset(item, 0, ITEM_SIZE);
                        if(!(tmp = strchr(line, ']')))
                                sec = 0; /*incorrect section lines are skipped*/
                } else if((tmp = strchr(line, '=') ) && sec) {
                        *tmp++ = '\0';
-                       for(i = 0; i < ITEM_FIELDS; i++)
-                               if(!strcmp(abook_fields[i].key, line)) {
-                                       item[i] = xstrdup(tmp);
-                                       goto next;
-                               }
+                       find_field_number(line, &field);
+                       if(field != -1) {
+                               item[field] = xstrdup(tmp);
+                               goto next;
+                       } else if(!strcasecmp(opt_get_str(STR_PRESERVE_FIELDS),
+                                               "all")){
+                               declare_unknown_field(line);
+                               item = xrealloc(item, ITEM_SIZE);
+                               item[fields_count - 1] = xstrdup(tmp);
+                               goto next;
+                       }
                }
 next:
                xfree(line);
        }
 
        xfree(line);
+       item_free(&item);
        return 0;
 }
 
-
-
 int
 load_database(char *filename)
 {
@@ -159,6 +317,7 @@ write_database(FILE *out, struct db_enumerator e)
 {
        int j;
        int i = 0;
+       abook_field_list *cur;
 
        fprintf(out,
                "# abook addressbook file\n\n"
@@ -170,14 +329,16 @@ write_database(FILE *out, struct db_enumerator e)
 
        db_enumerate_items(e) {
                fprintf(out, "[%d]\n", i);
-               for(j = 0; j < ITEM_FIELDS; j++) {
+
+               for(cur = fields_list, j = 0; cur; cur = cur->next, j++) {
                        if( database[e.item][j] != NULL &&
                                        *database[e.item][j] )
                                fprintf(out, "%s=%s\n",
-                                       abook_fields[j].key,
+                                       cur->field->key,
                                        database[e.item][j]
                                        );
                }
+
                fputc('\n', out);
                i++;
        }
@@ -199,18 +360,13 @@ save_database()
                goto out;
        }
 
-       if(list_is_empty()) {
-               fclose(out);
-               unlink(datafile);
-               ret = 1;
-               goto out;
-       }
+       if(!list_is_empty())
+               /*
+                * Possibly should check if write_database failed.
+                * Currently it returns always zero.
+                */
+               write_database(out, e);
 
-       /*
-        * Possibly should check if write_database failed.
-        * Currently it returns always zero.
-        */
-       write_database(out, e);
        fclose(out);
 
        if(access(datafile, F_OK) == 0 &&
@@ -227,18 +383,9 @@ out:
 }
 
 static void
-free_item(int item)
+db_free_item(int item)
 {
-       free_list_item(database[item]);
-}
-
-void
-free_list_item(list_item item)
-{
-       int i;
-
-       for(i=0; i<ITEM_FIELDS; i++)
-               xfree(item[i]);
+       item_empty(database[item]);
 }
 
 void
@@ -246,10 +393,10 @@ close_database()
 {
        int i;
 
-       for(i=0; i < items; i++)
-               free_item(i);
+       for(i=0; i <= LAST_ITEM; i++)
+               db_free_item(i);
 
-       free(database);
+       xfree(database);
        free(selected);
 
        database = NULL;
@@ -260,27 +407,46 @@ close_database()
        list_capacity = 0;
 }
 
-#define _MAX_FIELD_LEN(X)      (X == EMAIL ? MAX_EMAILSTR_LEN:MAX_FIELD_LEN)
 
 static void
 validate_item(list_item item)
 {
-       int i;
+       abook_field_list *f;
+       int i, max_field_len;
        char *tmp;
 
-       if(item[EMAIL] == NULL)
-               item[EMAIL] = xstrdup("");
+       for(f = fields_list, i = 0; f; f = f->next, i++) {
+               max_field_len = 0;
+
+               switch(f->field->type) {
+                       case FIELD_EMAILS:
+                               max_field_len = MAX_EMAILSTR_LEN;
+                               if(item[i] == NULL)
+                                       item[i] = xstrdup("");
+                               break;
+                       case FIELD_LIST:
+                               /* TODO quote string if it contains commas */
+                               break;
+                       case FIELD_STRING:
+                               max_field_len = MAX_FIELD_LEN;
+                               break;
+                       case FIELD_DATE:
+                               break;
+                       default:
+                               assert(0);
+               }
 
-       for(i=0; i<ITEM_FIELDS; i++)
-               if( item[i] && ((int)strlen(item[i]) > _MAX_FIELD_LEN(i) ) ) {
+               if(max_field_len && item[i] &&
+                               ((int)strlen(item[i]) > max_field_len)) {
+                       /* truncate field */
                        tmp = item[i];
-                       item[i][_MAX_FIELD_LEN(i)-1] = 0;
+                       item[i][max_field_len - 1] = 0;
                        item[i] = xstrdup(item[i]);
                        free(tmp);
                }
+       }
 }
 
-
 static void
 adjust_list_capacity()
 {
@@ -293,15 +459,20 @@ adjust_list_capacity()
        else
                return;
 
-       database = xrealloc(database, sizeof(list_item) * list_capacity);
+       if(database)
+               database = xrealloc(database,sizeof(list_item) * list_capacity);
+       else /* allocate memory _and_ initialize pointers to NULL */
+               database = xmalloc0(sizeof(list_item) * list_capacity);
+
        selected = xrealloc(selected, list_capacity);
 }
 
 int
 add_item2database(list_item item)
 {
-       if(item[NAME] == NULL || ! *item[NAME]) {
-               free_list_item(item);
+       /* 'name' field is mandatory */
+       if((item[field_id(NAME)] == NULL) || ! *item[field_id(NAME)]) {
+               item_empty(item);
                return 1;
        }
 
@@ -311,10 +482,13 @@ add_item2database(list_item item)
        validate_item(item);
 
        selected[LAST_ITEM] = 0;
-       itemcpy(database[LAST_ITEM], item);
+
+       database[LAST_ITEM] = item_create();
+        item_copy(database[LAST_ITEM], item);
 
        return 0;
 }
+       
 
 void
 remove_selected_items()
@@ -329,11 +503,12 @@ remove_selected_items()
 
        for(j = LAST_ITEM; j >= 0; j--) {
                if(selected[j]) {
-                       free_item(j); /* added for .4 data_s_ */
+                       db_free_item(j); /* added for .4 data_s_ */
                        for(i = j; i < LAST_ITEM; i++) {
-                               itemcpy(database[i], database[i + 1]);
+                               item_copy(database[i], database[i + 1]);
                                selected[i] = selected[i + 1];
                        }
+                       item_free(&database[LAST_ITEM]);
                        items--;
                }
        }
@@ -362,18 +537,17 @@ get_surname(char *s)
 static int
 surnamecmp(const void *i1, const void *i2)
 {
-       int ret;
-       list_item a,b;
-       char *s1, *s2;
-
-       itemcpy(a, i1);
-       itemcpy(b, i2);
+       int ret, idx = field_id(NAME);
+       char *n1, *n2, *s1, *s2;
 
-       s1 = get_surname(a[NAME]);
-       s2 = get_surname(b[NAME]);
+       n1 = (*(list_item *)i1)[idx];
+       n2 = (*(list_item *)i2)[idx];
+       
+       s1 = get_surname(n1);
+       s2 = get_surname(n2);
 
        if( !(ret = safe_strcoll(s1, s2)) )
-               ret = safe_strcoll(a[NAME], b[NAME]);
+               ret = safe_strcoll(n1, n2);
 
        free(s1);
        free(s2);
@@ -386,45 +560,34 @@ static int sort_field = -1;
 static int
 namecmp(const void *i1, const void *i2)
 {
-       list_item a, b;
+       char *n1, *n2;
 
-       assert(sort_field >= 0 && sort_field <= LAST_FIELD);
+       assert(sort_field >= 0 && sort_field < fields_count);
 
-       itemcpy(a, i1);
-       itemcpy(b, i2);
+       n1 = (*(list_item *)i1)[sort_field];
+       n2 = (*(list_item *)i2)[sort_field];
 
-       return safe_strcoll(a[sort_field], b[sort_field]);
-}
-
-static int
-name2field(char *name)
-{
-       int i, ret = -1;
-
-       for(i = 0; i < ITEM_FIELDS; i++) {
-               if(!strcasecmp(name, abook_fields[i].key)) {
-                       ret = i;
-                       break;
-               }
-       }
-
-       return ret;
+       return safe_strcoll(n1, n2);
 }
 
 void
-sort_by_field(int field)
+sort_by_field(char *name)
 {
+       int field;
+
        select_none();
 
-       assert(field <= LAST_FIELD);
+       name = (name == NULL) ? opt_get_str(STR_SORT_FIELD) : name;
+       find_field_number(name, &field);
 
        if(field < 0) {
-               field = name2field(opt_get_str(STR_SORT_FIELD));
-               if(field < 0) {
+               if(name == opt_get_str(STR_SORT_FIELD))
                        statusline_msg(_("Invalid field value defined "
                                "in configuration"));
-                       return;
-               }
+               else
+                       statusline_msg(_("Invalid field value for sorting"));
+
+               return;
        }
 
        sort_field = field;
@@ -444,10 +607,11 @@ sort_surname()
        refresh_screen();
 }
 
+/* TODO implement a search based on more sophisticated patterns */
 int
 find_item(char *str, int start, int search_fields[])
 {
-       int i;
+       int i, id;
        char *findstr = NULL;
        char *tmp = NULL;
        int ret = -1; /* not found */
@@ -462,9 +626,11 @@ find_item(char *str, int start, int search_fields[])
        e.item = start - 1; /* must be "real start" - 1 */
        db_enumerate_items(e) {
                for(i = 0; search_fields[i] >= 0; i++) {
-                       if(database[e.item][search_fields[i]] == NULL)
+                       if((id = field_id(search_fields[i])) == -1)
                                continue;
-                       tmp = xstrdup(database[e.item][search_fields[i]]);
+                       if(database[e.item][id] == NULL)
+                               continue;
+                       tmp = xstrdup(database[e.item][id]);
                        if( tmp && strstr(strlower(tmp), findstr) ) {
                                ret = e.item;
                                goto out;
@@ -479,7 +645,6 @@ out:
        return ret;
 }
 
-
 int
 is_selected(int item)
 {
@@ -492,6 +657,18 @@ is_valid_item(int item)
        return item <= LAST_ITEM && item >= 0;
 }
 
+int
+last_item()
+{
+       return LAST_ITEM;
+}
+
+int
+db_n_items()
+{
+       return items;
+}
+
 int
 real_db_enumerate_items(struct db_enumerator e)
 {
@@ -504,7 +681,7 @@ real_db_enumerate_items(struct db_enumerator e)
                        break;
 #endif
                case ENUM_SELECTED:
-                       for(i = item; i < items; i++) {
+                       for(i = item; i <= LAST_ITEM; i++) {
                                if(is_selected(i)) {
                                        item = i;
                                        goto out;
@@ -534,46 +711,142 @@ init_db_enumerator(int mode)
        return e;
 }
 
-static int
-assign_fieldname(const char *name, int i)
+
+list_item
+item_create()
 {
-       char *s;
+       return xmalloc0(ITEM_SIZE);
+}
 
-       assert(name);
-       assert(i >= 0 && i < ITEM_FIELDS);
+void
+item_free(list_item *item)
+{
+       assert(item);
 
-       if(strcasecmp(abook_fields[i].name, name)) { /* name differs */
-               /*
-                * check if we are overwriting statically allocated default
-                */
-               if(strcasecmp(abook_fields[i].name, abook_fields[i].key))
-                       xfree(abook_fields[i].name);
+       xfree(*item);
+}
+
+void
+item_empty(list_item item)
+{      int i;
+
+       assert(item);
+
+       for(i = 0; i < fields_count; i++)
+               if(item[i])
+                       xfree(item[i]);
+
+}
 
-               s = xmalloc_inc(MAX_FIELDNAME_LEN, 1);
-               snprintf(s, MAX_FIELDNAME_LEN, "%s", name);
-               abook_fields[i].name = s;
+void
+item_copy(list_item dest, list_item src)
+{
+       memmove(dest, src, ITEM_SIZE);
+}
+
+void
+item_duplicate(list_item dest, list_item src)
+{
+       int i;
+
+       for(i = 0; i < fields_count; i++)
+               dest[i] = src[i] ? xstrdup(src[i]) : NULL;
+}
+
+/* 
+ * Things like item[field_id(NICK)] should never be used, since besides NAME
+ * and EMAIL, none of the standard fields can be assumed to be existing.
+ *
+ * Prefer the functions item_fput(), item_fget(), db_fput() and db_fget()
+ * to access fields in items and database.
+ */
+
+/* quick lookup by "standard" field number */
+inline int
+field_id(int i)
+{
+       assert((i >= 0) && (i < ITEM_FIELDS));
+       return standard_fields_indexed[i];
+}
+
+int
+item_fput(list_item item, int i, char *val)
+{
+       int id = field_id(i);
+
+       if(id != -1) {
+               item[id] = val;
+               return 1;
        }
 
        return 0;
 }
 
+char *
+item_fget(list_item item, int i)
+{
+       int id = field_id(i);
+
+       if(id != -1)
+               return item[id];
+       else
+               return NULL;
+}
+
 int
-change_custom_field_name(const char *name, int n)
+real_db_field_put(int item, int i, int std, char *val)
 {
-       int i;
-       char keyname[21];
+       int id;
 
-       assert(name);
+       assert(database[item]);
 
-       snprintf(keyname, sizeof(keyname), "custom%d", n);
+       id = std ? field_id(i) : i;
 
-       for(i = CUSTOM_MIN; i <= CUSTOM_MAX; i++) {
-               if(!strcasecmp(abook_fields[i].key, keyname)) {
-                       assign_fieldname(name, i);
-                       return i;
-               }
+       if(id != -1) {
+               database[item][id] = val;
+               return 1;
        }
 
-       return -1;
+       return 0;
+}
+
+char *
+real_db_field_get(int item, int i, int std)
+{
+       int id;
+
+       assert(database[item]);
+
+       id = std ? field_id(i) : i;
+
+       if(id != -1)
+               return database[item][id];
+       else
+               return NULL;
+}
+
+list_item
+db_item_get(int i)
+{
+       return database[i];
+}
+
+/* Fetch addresses from all fields of FIELD_EMAILS type */
+/* Memory has to be freed by the caller */
+char *
+db_email_get(int item)
+{
+       int i;
+       char *res;
+       abook_field_list *cur;
+       abook_list *emails = NULL;
+
+       for(cur = fields_list, i = 0; cur; cur = cur->next, i++)
+               if(cur->field->type == FIELD_EMAILS && *database[item][i])
+                       abook_list_append(&emails, database[item][i]);
+
+       res = abook_list_to_csv(emails);
+       abook_list_free(&emails);
+       return res ? res : xstrdup("");
 }
 
index 87228851df824051ad20fe6ea8bc1e37f67e2324..a81bd6e4e751de9780aa3addd2b971342d1dd071 100644 (file)
@@ -1,14 +1,13 @@
 #ifndef _DATABASE_H
 #define _DATABASE_H
 
-
-#define MAX_EMAILS             4
+#define MAX_LIST_ITEMS         9
 #define MAX_EMAIL_LEN          80
-#define MAX_EMAILSTR_LEN       (MAX_EMAILS*MAX_EMAIL_LEN + MAX_EMAILS + 1)
+#define MAX_EMAILSTR_LEN       (MAX_LIST_ITEMS * (MAX_EMAIL_LEN + 1) + 1)
 #define MAX_FIELD_LEN          81
 
 enum {
-       NAME,
+       NAME = 0, /* important */
        EMAIL,
        ADDRESS,
         ADDRESS2,
@@ -23,27 +22,28 @@ enum {
        NICK,
        URL,
        NOTES,
-       CUSTOM1,
-       CUSTOM2,
-       CUSTOM3,
-       CUSTOM4,
-       CUSTOM5,
+       ANNIVERSARY,
        ITEM_FIELDS /* this is the last */
 };
 
-#define LAST_FIELD             (ITEM_FIELDS - 1)
-
-#define CUSTOM_MIN             CUSTOM1
-#define CUSTOM_MAX             CUSTOM5
+typedef struct {
+       char *key;
+       char *name;
+       int type;
+} abook_field;
 
-typedef char *list_item[ITEM_FIELDS];
+typedef struct abook_field_list_t {
+       abook_field *field;
+       struct abook_field_list_t *next;
+} abook_field_list;
 
-#define        MAX_FIELDNAME_LEN       21
+typedef char **list_item;
 
-struct abook_field {
-       char *name;
-       char *key;
-       int tab;
+enum {
+       FIELD_STRING = 1,
+       FIELD_EMAILS,
+       FIELD_LIST,
+       FIELD_DATE,
 };
 
 enum {
@@ -56,48 +56,81 @@ struct db_enumerator {
        int mode; /* warning: read only */
 };
 
-int            find_field(const char *field);
-int            parse_database(FILE *in);
-int            write_database(FILE *out, struct db_enumerator e);
-int            load_database(char *filename);
-int            save_database();
-void           close_database();
-int            add_item2database(list_item item);
-void           free_list_item(list_item item);
-void           remove_selected_items();
-void           sort_surname();
-void           sort_by_field(int field);
-char           *get_surname(char *s);
-int            find_item(char *str, int start, int search_fields[]);
-int            is_selected(int item);
-int            is_valid_item(int item);
-
-int            real_db_enumerate_items(struct db_enumerator e);
-struct db_enumerator   init_db_enumerator(int mode);
-int            change_custom_field_name(const char *name, int n);
-
-#define LAST_ITEM      (items - 1)
-
-#define itemcpy(dest, src)     memmove(dest, src, sizeof(list_item))
-
-#define split_emailstr(item, emails) do {\
-       int _i,_j,_k,len; \
-       memset(&emails, 0, sizeof(emails) ); \
-       len = strlen(database[item][EMAIL]); \
-       for( _i=0,_j=0, _k=0; _i < len && _j < MAX_EMAILS; _i++ ) { \
-               if( database[item][EMAIL][_i] ==',' ) { \
-                       _j++; \
-                       _k = 0; \
-               } else \
-                       if( _k < MAX_EMAIL_LEN -1 ) \
-                               emails[_j][_k++] = database[item][EMAIL][_i]; \
-       } \
-} while(0)
-
-#define have_multiple_emails(item) \
-       strchr(database[item][EMAIL], ',')
 
+/*
+ * Field operations
+ */
+inline int field_id(int i);
+abook_field *find_standard_field(char *key, int do_declare);
+abook_field *real_find_field(char *key, abook_field_list *list, int *nb);
+#define find_field(key, list)          real_find_field(key, list, NULL)
+#define find_field_number(key, pt_nb)  real_find_field(key, NULL, pt_nb)
+#define find_declared_field(key)       find_field(key,NULL)
+void get_field_info(int i, char **key, char **name, int *type);
+void add_field(abook_field_list **list, abook_field *f);
+char *declare_new_field(char *key, char *name, char *type, int accept_standard);
+void init_standard_fields();
+
+/*
+ * Various database operations
+ */
+void prepare_database_internals();
+int parse_database(FILE *in);
+int load_database(char *filename);
+int write_database(FILE *out, struct db_enumerator e);
+int save_database();
+void remove_selected_items();
+void sort_surname();
+void sort_by_field(char *field);
+void close_database();
+int add_item2database(list_item item);
+char *get_surname(char *s);
+int find_item(char *str, int start, int search_fields[]);
+int is_selected(int item);
+int is_valid_item(int item);
+int last_item();
+int db_n_items();
+
+int real_db_enumerate_items(struct db_enumerator e);
+struct db_enumerator init_db_enumerator(int mode);
 #define db_enumerate_items(e) \
        while( -1 != (e.item = real_db_enumerate_items(e)))
 
-#endif
+/*
+ * item manipulation
+ */
+list_item item_create();
+void item_empty(list_item item);
+void item_free(list_item *item);
+void item_copy(list_item dest, list_item src);
+void item_duplicate(list_item dest, list_item src);
+
+int item_fput(list_item item, int i, char *val);
+char *item_fget(list_item item, int i);
+
+/*
+ * database field read
+ */
+char *real_db_field_get(int item, int i, int std);
+#define db_fget(item, i)               real_db_field_get(item, i, 1)
+#define db_fget_byid(item, i)          real_db_field_get(item, i, 0)
+#define db_name_get(item)              db_fget(item, NAME)
+char *db_email_get(int item); /* memory has to be freed by the caller */
+
+/*
+ * database field write
+ */
+int real_db_field_put(int item, int i, int std, char *val);
+#define db_fput(item, i, val) \
+                       real_db_field_put(item, i, 1, val)
+#define db_fput_byid(item, i, val) \
+                       real_db_field_put(item, i, 0, val)
+
+/*
+ * database item read
+ */
+list_item db_item_get(int i);
+
+
+#endif /* _DATABASE_H */
+
index da7ea2026cf5bb3645018a91b79fe056eeebd864..f6c608dc8b5250a356abf215e4de91fe656dd17d 100644 (file)
@@ -1,70 +1,83 @@
-abook (0.5.6-7) unstable; urgency=low
-
-  * Build-Depend on autotools-dev, copy config.{guess,sub} before configure
-    run and remove them in clean target (closes: #535739)
-  * Updated to Standards-Version 3.8.2: Switched from findstring to filter and
-    add support parallel.
-    suggestion from policy.
-  * Switched the packaging licensing to BSD style.
-  * New patch:
-    - datafile-f-switch: Let --datafile also work through -f short option,
-      suggested by Joey Schulze
-  * New debconf translation:
-    - Traditional Chinese by Kanru Chen (closes: #508023)
-
- -- Gerfried Fuchs <rhonda@debian.at>  Tue, 09 Dec 2008 10:40:05 +0100
-
-abook (0.5.6-6) unstable; urgency=low
-
-  * Made copyright file more clear.
-  * Updated watch file to use special uscan hack for sourceforge.
-  * Updated Standards-Version to 3.8.0, added README.source file.
+abook (0.6.0~pre2-2) unstable; urgency=low
+
+  * Finally uploading to unstable.  Making sure the changes are carried over,
+    especially:
+    - from 0.5.6-2:
+      - Swedish debconf translation, already mentioned in changelog but without
+        closes: #387518
+      - Fixed quoting in mutt config snippet noticed by Georg Neis, thanks
+        (closes: #394532)
+    - from 0.5.6-3:
+      - Japanese debconf translation by Noritada Kobayashi (closes: #412998)
+    - from 0.5.6-4:
+      - Dutch debconf translation by Bart Cornelis (closes: #415513)
+      - Updated menu file to go with new menu policy.
+      - debian/rules: slightly cleanup.
+    - from 0.5.6-5:
+      - Add Homepage to source control stanca.
+      - Bump Standards-Version to 3.7.3, menu file was already updated.
+      - Russian debconf translation by Yuri Kozlov (closes: #451813)
+      - search_ctrl-d_segfault_fix included in the release already
+        (closes: #462145)
+    - from 0.5.6-6:
+      - Made copyright file more clear.
+      - Updated watch file to use special uscan hack for sourceforge.
+      - Updated Standards-Version to 3.8.0, added README.source file.
+      - New debconf translations:
+        - Spanish debconf translation by Carlos Eduardo Sotelo Pinto
+          (closes: #484848)
+        - Portuguese debconf translation, already mentioned in changelog but
+          without (closes: #489036). Actually the one mentioned was a newer
+          one than the one in the unstable branch.
+      - Fixed Catalan po file encoding.
+      - Use versioned Build-Depends on quilt for quilt.make usage.
+      - Also strip sections .comment and .note
+      - Add patch fix-manpage to escape hyphens where they should be minus
+        signs (adjusted it for the 0.6.0~pre2 release)
+    - from 0.5.6-7:
+      - Build-Depend on autotools-dev, copy config.{guess,sub} before configure
+        run and remove them in clean target (closes: #535739)
+      - Updated to Standards-Version 3.8.2: Switched from findstring to filter
+        and add support parallel.
+        suggestion from policy.
+      - Switched the packaging licensing to BSD style.
+      - New patch datafile-f-switch: Let --datafile also work through -f short
+        option, suggested by Joey Schulze
+      - Traditional Chinese debconf translation by Kanru Chen (closes: #508023)
+  * Relicense packaging under WTFPLv2.
+  * Bump Standards-Version to 3.9.3.
   * New debconf translations:
-    - Spanish by Carlos Eduardo Sotelo Pinto (closes: #484848)
-    - Portuguese by Miguel Figueiredo (closes: #489036)
-  * Fixed Catalan po file encoding.
-  * Put proper headers into the templates.pot file.
-  * Use versioned Build-Depends on quilt for quilt.make usage.
-  * Also strip sections .comment and .note
-  * Add patch fix-manpage to escape hyphens where they should be minus signs.
+    - Danish by Joe Hansen (closes: #626630)
+    - Polish by Michał Kułach (closes: #658602)
+    - Italian by Francesca Ciceri (closes: #658744)
+  * Add Vcs-* fields to debian/control.
 
- -- Gerfried Fuchs <rhonda@debian.at>  Thu, 24 Jul 2008 15:17:28 +0200
+ -- 
 
-abook (0.5.6-5) unstable; urgency=low
+abook (0.6.0~pre2-1) experimental; urgency=low
 
-  * Add Homepage to source control stanca.
-  * Bump Standards-Version to 3.7.3, menu file was already updated.
-  * New debconf translation: Russian by Yuri Kozlov (closes: #451813)
-  * Pull search_ctrl-d_segfault_fix patch from upstream (closes: #462145)
-
- -- Gerfried Fuchs <rhonda@debian.at>  Thu, 24 Jan 2008 20:01:26 +0100
-
-abook (0.5.6-4) unstable; urgency=low
-
-  * New debconf translation: Dutch by Bart Cornelis (closes: #415513)
-  * Updated menu file to go with new menu policy.
-  * debian/rules: slightly cleanup.
+  * New upstream release
 
- -- Gerfried Fuchs <rhonda@debian.at>  Thu, 31 May 2007 14:10:34 +0200
+ -- Gerfried Fuchs <alfie@debian.org>  Thu,  7 Sep 2006 10:29:20 -0500
 
-abook (0.5.6-3) unstable; urgency=low
+abook (0.6.0~pre1-1) experimental; urgency=low
 
-  * Late l10n translation: Japanese by Noritada Kobayashi (closes: #412998)
+  * Upstream pre version of 0.6.0 release.
+  * new debconf translations: French by Pierre Machard (closes: #384681)
 
- -- Gerfried Fuchs <alfie@debian.org>  Sat,  3 Mar 2007 11:40:05 +0100
+ -- Gerfried Fuchs <alfie@debian.org>  Thu, 31 Aug 2006 07:26:11 -0500
 
-abook (0.5.6-2) unstable; urgency=low
+abook (0.5.6+cvs1-1) experimental; urgency=low
 
-  * The "l10n R us" release.
-  * New debconf translations: Swedish by Daniel Nylander (closes: #387518),
-    Catalan by Jordà Polo (closes: #381362), French by Pierre Machard
-    (closes: #384681)
-  * Fixed typo in templates file and unfuzzied all translations that were
-    uptodate before (closes: #383473)
-  * Fixed quoting in mutt config snippet noticed by Georg Neis, thanks
-    (closes: #394532)
+  * CVS snapshot with flexible view, which resolves:
+    - small number of email addresses (closes: #333450)
+  * new debconf translations: Portuguese by Miguel Figueiredo, Català by
+    Jordà Polo (closes: #381362), Swedish by Daniel Nylander
+  * Fixed typo in template, noticed by Pierre Machard (closes: #383473)
+  * contrib files got deleted from upstream, so they are removed from the
+    Debian package, too.
 
- -- Gerfried Fuchs <alfie@debian.org>  Mon, 22 Jan 2007 22:02:22 +0100
+ -- Gerfried Fuchs <alfie@debian.org>  Mon, 21 Aug 2006 07:41:58 -0500
 
 abook (0.5.6-1) unstable; urgency=low
 
index 5a2484f98d58ab080e908a1f01f0c20e9f510038..57fd21d0a7bd9c1f6b98256f2fd797216423390a 100644 (file)
@@ -1,5 +1,7 @@
 #!/bin/sh -e
 # config script for abook
+# copyright 2012 by Gerfried Fuchs <rhonda@debian.org>
+# Licenced under WTFPLv2
 
 action=$1
 version=$2
index 639cca7bece1c9f49e84a3d7a2a6921c85ac0566..b9314dce130df44a74da4c075ce427717a3fd9cc 100644 (file)
@@ -1,11 +1,13 @@
 Source: abook
 Section: mail
 Priority: optional
-Maintainer: Gerfried Fuchs <rhonda@debian.at>
-Standards-Version: 3.8.0
+Maintainer: Gerfried Fuchs <rhonda@debian.org>
+Standards-Version: 3.9.3
 Build-Depends: libncursesw5-dev, libreadline5-dev | libreadline-dev,
   po-debconf, quilt (>= 0.40), autotools-dev
 Homepage: http://abook.sourceforge.net/
+Vcs-Browser: http://git.deb.at/w/pkg/abook.git
+Vcs-Git: git://git.deb.at/g/pkg/abook.git
 
 Package: abook
 Architecture: any
index 997d714dadb0c14a3600235ab67d3b24c21ed03c..deb86de79596217c1c2e4fe415ee2f63b12fb097 100644 (file)
@@ -1,6 +1,6 @@
 This package was first debianized by Alan Ford <alan@whirlnet.co.uk> 
 on Sat, 18 Mar 2000 12:38:34 +0000.
-It is now maintained by Gerfried Fuchs <rhonda@debian.at>.
+It is now maintained by Gerfried Fuchs <rhonda@debian.org>.
 
 It was downloaded from
 http://abook.sourceforge.net/
@@ -25,10 +25,22 @@ Copyright:
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
     MA 02110-1301 USA.
 
-The debianization of the package is licensed under BSD style and
-Copyright (c) 2003-2008 by Gerfried Fuchs <rhonda@debian.at>.
-See /usr/share/common-licenses/BSD for the complete text.
-
 On Debian GNU/Linux systems, the complete text of the GNU General
 Public License version 2 can be found in `/usr/share/common-licenses/GPL-2',
 later versions can be found in the same directory.
+
+The debianization of the package is licensed under the WTFPLv2:
+
+               DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                       Version 2, December 2004
+   
+    Copyright (C) 2003-2012 Gerfried Fuchs
+
+    Everyone is permitted to copy and distribute verbatim or modified
+    copies of this license document, and changing it is allowed as long
+    as the name is changed.
+   
+               DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+      TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+   
+     0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/debian/patches/01_search_ctrl-d_segfault_fix b/debian/patches/01_search_ctrl-d_segfault_fix
deleted file mode 100644 (file)
index 0c18f2c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Author: Cedric Duval <cedricduval@free.fr>     vim:ft=diff:
-Description: Don't let ctrl-d in search segfault abook (closes: #462145)
-
-Index: abook-0.5.6/ui.c
-===================================================================
---- abook-0.5.6.orig/ui.c
-+++ abook-0.5.6/ui.c
-@@ -569,9 +569,13 @@ ui_find(int next)
-       } else {
-               char *s;
-               s = ui_readline("/", findstr, MAX_FIELD_LEN - 1, 0);
--              strncpy(findstr, s, MAX_FIELD_LEN);
--              free(s);
-               refresh_screen();
-+              if(s == NULL) {
-+                      return; /* user cancelled (ctrl-G) */
-+              } else {
-+                      strncpy(findstr, s, MAX_FIELD_LEN);
-+                      free(s);
-+              }
-       }
-       if( (item = find_item(findstr, curitem + !!next, search_fields)) < 0 &&
index 45b434576b73104c295f03723ff7fec2cc3308c6..e89ce8c940c47acda50f66884f14270943caffda 100644 (file)
@@ -1,13 +1,13 @@
-Author: Gerfried Fuchs <rhonda@debian.at>      vim:ft=diff:
+Author: Gerfried Fuchs <rhonda@debian.org>     vim:ft=diff:
 Description: Escape hyphens in manpage where they mean the minus sign
 
-Index: abook-0.5.6/abook.1
+Index: b/abook.1
 ===================================================================
---- abook-0.5.6.orig/abook.1
-+++ abook-0.5.6/abook.1
-@@ -80,11 +80,11 @@ The following \fIoutputformats\fR are su
+--- a/abook.1
++++ b/abook.1
+@@ -82,11 +82,11 @@ The following \fIoutputformats\fR are su
  .br
- - \fBwl\fP Wanderlust address book
+ - \fBbsdcal\fP BSD calendar
  .TP
 -\fB\-\-add-email\fP
 +\fB\-\-add\-email\fP
@@ -20,34 +20,16 @@ Index: abook-0.5.6/abook.1
  .TP
  \fB\-\-formats\fP
  List available formats.
-Index: abook-0.5.6/abookrc.5
+Index: b/abookrc.5
 ===================================================================
---- abook-0.5.6.orig/abookrc.5
-+++ abook-0.5.6/abookrc.5
-@@ -47,7 +47,7 @@ Defines the field to display in the extr
- .br
- \fIfield\fP can be any of the following:
- .br
---1                    disabled
-+\-1                   disabled
- .br
- phone         Home Phone
- .br
-@@ -125,7 +125,7 @@ set emailpos=25
- # Field to be used in the extra column
- set extra_column=phone
- # frequently used values:
--#     -1          disabled
-+#     \-1          disabled
- #     phone       Home Phone
- #     workphone   Work Phone
- #     fax         Fax
-@@ -134,7 +134,7 @@ set extra_column=phone
- #     url         URL
- #
--set extra_alternative=-1
-+set extra_alternative=\-1
- # Screen column for the extra field to start
- set extrapos=65
+--- a/abookrc.5
++++ b/abookrc.5
+@@ -90,7 +90,7 @@ Defines the way entries are displayed in
+ \fI{name:22}\fP
+ displays the \fIname\fP field with a maximal width of 22 characters.
+ .TP
+-\fI{phone:-13|workphone|mobile}\fP
++\fI{phone:\-13|workphone|mobile}\fP
+ displays (right aligned within a width of 13 characters), either the \fIphone\fP, \fIworkphone\fP or \fImobile\fP field, whichever being the first to be non-empty.
+ .RE
+ .IP
index 845788bd102aae8e6fbca28de702ac7b9f624a5d..eb2c5b1cb6a3c1a1c9806af633ce44ef496f34fa 100644 (file)
@@ -1,11 +1,11 @@
-Author: Gerfried Fuchs <rhonda@debian.at>      vim:ft=diff:
+Author: Gerfried Fuchs <rhonda@debian.org>     vim:ft=diff:
 Description: Let --datafile also work through -f short option
 
-Index: abook-0.5.6/abook.c
+Index: b/abook.c
 ===================================================================
---- abook-0.5.6.orig/abook.c
-+++ abook-0.5.6/abook.c
-@@ -324,7 +324,7 @@ parse_command_line(int argc, char **argv
+--- a/abook.c
++++ b/abook.c
+@@ -331,7 +331,7 @@ parse_command_line(int argc, char **argv
                        { 0, 0, 0, 0 }
                };
  
index 31fd7b9835203fd2767ba3e1bd12e24d40aed5ca..c89c5aea5686724458af0f872b94c50cf20b1daf 100644 (file)
@@ -1,3 +1,2 @@
-01_search_ctrl-d_segfault_fix
 02_fix-manpage
 03_datafile-f-switch
index 24cc768a93b348c93c94736bcb5afbe21731abbe..f474ce395c46f11e09682782d76599bfb3967d12 100644 (file)
@@ -9,10 +9,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 2.1.1\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2008-07-07 21:47+0200\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: Jordà Polo <jorda@ettin.org>\n"
 "Language-Team: Català <debian-l10n-catalan@lists.debian.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index 2c03099777d75dc8208c1935e1d90a77b7fa2940..05d1c238e7fbfb4c06b36db520585916e591a517 100644 (file)
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:00+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
 "Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
+"Language: cs\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
diff --git a/debian/po/da.po b/debian/po/da.po
new file mode 100644 (file)
index 0000000..388cc28
--- /dev/null
@@ -0,0 +1,38 @@
+# Danish translation abook.
+# Copyright (C) 2011 Gerfried Fuchs <rhonda@debian.at> & nedenstående oversættere.
+# This file is distributed under the same license as the abook package.
+# Joe Hansen (joedalton2@yahoo.dk), 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: abook\n"
+"Report-Msgid-Bugs-To: abook@packages.debian.org\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2011-05-13 18:30+01:00\n"
+"Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
+"Language-Team: Danish <debian-l10n-danish@lists.debian.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Do you want to enable abook system wide for mutt?"
+msgstr "Ønsker du at aktivere abook på hele systemet for mutt?"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"abook offers the possibility to be used as query backend from within mutt.  "
+"If you acknowledge this question the package will create an /etc/Muttrc.d/"
+"abook.rc file that enables querying the abook database and adding mail "
+"addresses to abook with pressing \"A\" from pager mode."
+msgstr ""
+"abook tilbyder muligheden for at blive brugt som forespørgelsesmotor inden "
+"fra mutt. Hvis du accepterer dette spørgsmål, vil pakken oprette en /etc/"
+"Muttrc.d/abook-rc-fil, som aktiverer forespørgsler til abooks database og "
+"tilføjelse af postadresser til abook med et tryk på »A« fra "
+"tekstvisertilstanden."
index a0b64434d5aabefcb7bb131e6e341474597f668a..a69f6f9ce0ef6c642e7a0732914121e52e9d2181 100644 (file)
@@ -16,9 +16,10 @@ msgstr ""
 "Project-Id-Version: abook 0.5.0\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
 "POT-Creation-Date: 2006-08-18 10:38-0500\n"
-"PO-Revision-Date: 2008-07-07 22:03+0200\n"
-"Last-Translator: Gerfried Fuchs <rhonda@debian.at>\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
+"Last-Translator: Gerfried Fuchs <rhonda@debian.org>\n"
 "Language-Team: German <debian-l10n-german@lists.debian.org>\n"
+"Language: de\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=ISO-8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
index ff73c5ab5f8da1d5e47664dc03f10cdce6e46553..57b455009172641e461c35bcb5ec6f0817ca25c2 100644 (file)
@@ -9,7 +9,7 @@
 # Traductores, si no estan familiarizados con el formato PO, merece la 
 # pena leer la documentación de gettext, especialmente las secciones 
 # dedicadas a este formato, por ejemplo ejecutando
-# 
+#
 #   info -n '(gettext)PO Files'
 #   info -n '(gettext)Header Entry'
 #
@@ -17,7 +17,7 @@
 #   http://www.debian.org/intl/spanish/
 # especialmente las notas y normas de traducción en
 #   http://www.debian.org/intl/spanish/notas
-# 
+#
 # - La guía de traducción de po's de debconof
 #   /usr/share/doc/po-debconf/README-trans
 # o
@@ -32,10 +32,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook 0.5.6-5\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
 "PO-Revision-Date: 2008-06-02 15:27-0500\n"
 "Last-Translator: Carlos Eduardo Sotelo Pinto <csotelop@gmail.com>\n"
 "Language-Team: Spanish <debian-l10n-spanish@list.debian.org>\n"
+"Language: es\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -54,8 +55,8 @@ msgid ""
 "If you acknowledge this question the package will create an /etc/Muttrc.d/"
 "abook.rc file that enables querying the abook database and adding mail "
 "addresses to abook with pressing \"A\" from pager mode."
-msgstr "abook brinda la posibilidad de utilizarse como origen de consultas "
-"desde mutt. "
-"Si acepta esta pregunta el paquete creará un fichero «/etc/Muttrc.d/abook.rc» "
-"que habilita las consultas a la base de datos de abook y agrega "
-"la dirección de correo a abook presionando \"A\" desde el modo paginador"
+msgstr ""
+"abook brinda la posibilidad de utilizarse como origen de consultas desde "
+"mutt. Si acepta esta pregunta el paquete creará un fichero «/etc/Muttrc.d/"
+"abook.rc» que habilita las consultas a la base de datos de abook y agrega la "
+"dirección de correo a abook presionando \"A\" desde el modo paginador"
index 29f83aecf6ef57ab932270dd0736191e58a6fcd0..d7163f851871d6b16af9d38fbc068025e005d25f 100644 (file)
@@ -6,10 +6,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:00+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-31 07:24-0500\n"
 "Last-Translator: Pierre Machard <pmachard@debian.org>\n"
 "Language-Team: Debian l10n French <debian-l10n-french@lists.debian.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=ISO-8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
index 2893d1af8a6be4a2718d897a86a1f684e468f752..87cc5ce2c9f3c21f198c3c1b60086b6d52b3d439 100644 (file)
@@ -2,10 +2,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: SZERVÑC Attila <sas@321.hu>\n"
 "Language-Team: Hungarian <debian-l10n-hungarian@lists.debian.org>\n"
+"Language: hu\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
diff --git a/debian/po/it.po b/debian/po/it.po
new file mode 100644 (file)
index 0000000..9473558
--- /dev/null
@@ -0,0 +1,37 @@
+# po-debconf translation for abook.
+# Copyright (C) 2006 Gerfried Fuchs <rhonda@debian.at>
+# This file is distributed under the same license as the abook package.
+# Francesca Ciceri <madamezou@zouish.org>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: abook\n"
+"Report-Msgid-Bugs-To: abook@packages.debian.org\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2012-02-05 19:08+0100\n"
+"Last-Translator: Francesca Ciceri <madamezou@zouish.org>\n"
+"Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Do you want to enable abook system wide for mutt?"
+msgstr "Si desidera abilitare abook per mutt globalmente?"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"abook offers the possibility to be used as query backend from within mutt.  "
+"If you acknowledge this question the package will create an /etc/Muttrc.d/"
+"abook.rc file that enables querying the abook database and adding mail "
+"addresses to abook with pressing \"A\" from pager mode."
+msgstr ""
+"abook offre la possibilità di essere usato come backend per le query in "
+"mutt. Se si acconsente, il pacchetto creerà un file /etc/Muttrc.d/abook.rc "
+"che abiliti l'interrogazione del database di abook e l'aggiunta di indirizzi "
+"email ad abook premendo il tasto \"A\" dal paginatore."
index f8580c41b13a321fe61beb62b9114dc40a5f3341..a11b03e64d02fa0d37a60dee87845a05894c7e22 100644 (file)
@@ -6,10 +6,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook (debconf) 0.5.6-2\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
 "PO-Revision-Date: 2007-03-01 16:03+0900\n"
 "Last-Translator: Noritada Kobayashi <nori1@dolphin.c.u-tokyo.ac.jp>\n"
 "Language-Team: Japanese <debian-japanese@lists.debian.org>\n"
+"Language: ja\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index baa5a42687a35aeab7d9e52592d47313a7104442..c7d39ddbbcf4cd30d0ba25fc6067d1caf58c680f 100644 (file)
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
 "PO-Revision-Date: 2007-03-09 18:35+0100\n"
 "Last-Translator: Bart Cornelis <cobaco@skolelinux.no>\n"
 "Language-Team: debian-l10n-dutch <debian-l10n-dutch@lists.debian.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -25,6 +26,14 @@ msgstr "Wilt u abook voor mutt systeemwijd activeren?"
 #. Type: boolean
 #. Description
 #: ../templates:1001
-msgid "abook offers the possibility to be used as query backend from within mutt.  If you acknowledge this question the package will create an /etc/Muttrc.d/abook.rc file that enables querying the abook database and adding mail addresses to abook with pressing \"A\" from pager mode."
-msgstr "Mutt kan abook als een 'bevraag-backend' gebruiken. Als u wilt dat dit pakket een '/etc/Muttrc.d/abook.rc '-bestand aanmaakt dient u hier positief te antwoorden. Het aanmaken van dit bestand activeert het bevragen van de abook-database, en het toevoegen van e-mailadressen aan de abook-databse (door 'A' te drukken in 'pager'-modus)."
-
+msgid ""
+"abook offers the possibility to be used as query backend from within mutt.  "
+"If you acknowledge this question the package will create an /etc/Muttrc.d/"
+"abook.rc file that enables querying the abook database and adding mail "
+"addresses to abook with pressing \"A\" from pager mode."
+msgstr ""
+"Mutt kan abook als een 'bevraag-backend' gebruiken. Als u wilt dat dit "
+"pakket een '/etc/Muttrc.d/abook.rc '-bestand aanmaakt dient u hier positief "
+"te antwoorden. Het aanmaken van dit bestand activeert het bevragen van de "
+"abook-database, en het toevoegen van e-mailadressen aan de abook-databse "
+"(door 'A' te drukken in 'pager'-modus)."
diff --git a/debian/po/pl.po b/debian/po/pl.po
new file mode 100644 (file)
index 0000000..a03bd65
--- /dev/null
@@ -0,0 +1,40 @@
+# po-debconf translation for abook.
+# Copyright (C) 2006 Gerfried Fuchs <rhonda@debian.at>
+# This file is distributed under the same license as the abook package.
+#
+# Michał Kułach <michal.kulach@gmail.com>, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: abook VERSION\n"
+"Report-Msgid-Bugs-To: abook@packages.debian.org\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2012-02-04 11:30+0100\n"
+"Last-Translator: Michał Kułach <michal.kulach@gmail.com>\n"
+"Language-Team: Polish <debian-l10n-polish@lists.debian.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.2\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2);\n"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid "Do you want to enable abook system wide for mutt?"
+msgstr "Czy pozwolić na współpracę abook z mutt na poziomie systemu?"
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"abook offers the possibility to be used as query backend from within mutt.  "
+"If you acknowledge this question the package will create an /etc/Muttrc.d/"
+"abook.rc file that enables querying the abook database and adding mail "
+"addresses to abook with pressing \"A\" from pager mode."
+msgstr ""
+"Program abook może być używany jako backend z poziomu mutta. Jeśli zostanie "
+"wybrana odpowiedź \"tak\", pakiet utworzy plik /etc/Muttrc.d/abook.rc, który "
+"umożliwi odpytywanie bazy danych abook i dodawanie adresów poczty "
+"elektronicznej do abook przez wciśnięcie \"A\" z trybu pagera."
index 23c0fc165181f84bc85358d55c53bf2d33837ad8..f4dd6c7b79f21eef284958b28a39164d3a622cb0 100644 (file)
@@ -6,10 +6,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
 "PO-Revision-Date: 2008-07-02 23:05+0100\n"
 "Last-Translator: Miguel Figueiredo <elmig@debianpt.org>\n"
 "Language-Team: Portuguese <traduz@debianpt.org>\n"
+"Language: pt\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index a4c73b29575a2c0ce08d9e081cfdba3df6510e47..6ffba0019798812039714fd9257037401020391a 100644 (file)
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: Felipe Augusto van de Wiel (faw) <faw@cathedrallabs.org>\n"
 "Language-Team: l10n portuguese <debian-l10n-portuguese@lists.debian.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index 017ee3567f0f4622282a23497dd82f68e66019d7..502dac2384517738872718cd3da3e864b47f757f 100644 (file)
@@ -6,10 +6,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: Eddy Petrişor <eddy.petrisor@gmail.com>\n"
 "Language-Team: Romanian <debian-l10n-romanian@lists.debian.org>\n"
+"Language: ro\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index 182d0fafaca6e60297213862a9ce2e1d1136fc93..79d52894627532a6c5bb77834fba8f4af5e60399 100644 (file)
@@ -7,15 +7,17 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 0.5.6-4\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
 "PO-Revision-Date: 2007-11-18 21:39+0300\n"
 "Last-Translator: Yuri Kozlov <kozlov.y@gmail.com>\n"
 "Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n"
+"Language: ru\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "X-Generator: KBabel 1.11.4\n"
-"Plural-Forms:  nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms:  nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 
 #. Type: boolean
 #. Description
@@ -32,9 +34,8 @@ msgid ""
 "abook.rc file that enables querying the abook database and adding mail "
 "addresses to abook with pressing \"A\" from pager mode."
 msgstr ""
-"abook можно использовать как сервер запросов из mutt. "
-"Если вы ответите утвердительно, то будет создан файл "
-"/etc/Muttrc.d/abook.rc, настройки которого активируют возможность "
-"запросов к базе данных abook и настраивают добавление почтовых адресов "
-"в abook по нажатию клавиши \"A\" из режима просмотра письма."
-
+"abook можно использовать как сервер запросов из mutt. Если вы ответите "
+"утвердительно, то будет создан файл /etc/Muttrc.d/abook.rc, настройки "
+"которого активируют возможность запросов к базе данных abook и настраивают "
+"добавление почтовых адресов в abook по нажатию клавиши \"A\" из режима "
+"просмотра письма."
index 6bcd07042c2f51b4cf24778e97a522a7b051f833..47b15c6d4ea34b19737ba7e3678884428cbbc796 100644 (file)
@@ -1,16 +1,17 @@
-# SOME DESCRIPTIVE TITLE.
+# Swedish translation for abook (debconf).
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the abook package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+# Daniel Nylander <po@danielnylander.se>, 2006.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: abook 0.5.6-1\n"
+"Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"Language: sv\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -30,7 +31,7 @@ msgid ""
 "abook.rc file that enables querying the abook database and adding mail "
 "addresses to abook with pressing \"A\" from pager mode."
 msgstr ""
-"Abook erbjuder möjligheten att användas som en frågebakände innefrån mutt.  "
-"Om du bekräftar denna fråga kommer paketet att skapa en fil kallad /etc/"
-"Muttrc.d/abook.rc som tillåter frågor mot abook-databasen och att lägga till "
-"e-postadresser till abook genom att trycka på \"A\" från visningsläget."
+"abook erbjuder möjligheten att användas som bakända för frågor i mutt. Om du "
+"bekräftar denna fråga kommer paketet att skapa en fil kallad /etc/Muttrc.d/"
+"abook.rc som aktiverar frågor mot abooks databas och lägger till e-"
+"postadresser till abook när du trycker \"A\" från visningsläget."
index 50391d13e99fc0555ef97070a97c9b8bb1089433..e6d95f3aa9fa8e23ca9a824aa75c7311e90906dd 100644 (file)
@@ -1,5 +1,5 @@
 # po-debconf translation for abook.
-# Copyright (C) 2006 Gerfried Fuchs <rhonda@debian.at>
+# Copyright (C) 2006 Gerfried Fuchs <rhonda@debian.org>
 # This file is distributed under the same license as the abook package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
index f88d8e5913e8388c970bfd208b1623d58b2adb57..09aa9c8387d87c060d6042dd3ebca5d7955be833 100644 (file)
@@ -6,10 +6,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
 "Report-Msgid-Bugs-To: abook@packages.debian.org\n"
-"POT-Creation-Date: 2007-01-22 23:01+0100\n"
-"PO-Revision-Date: 2007-01-22 23:01+0100\n"
+"POT-Creation-Date: 2006-08-18 10:38-0500\n"
+"PO-Revision-Date: 2006-08-18 10:42-0500\n"
 "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
 "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
+"Language: vi\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index 11247f69321dd31cfba902295b7e77861b831ed1..1ba4775dd2fefc10b7301c50f9e6e4b604f8196a 100644 (file)
@@ -1,5 +1,5 @@
 # po-debconf translation for abook.\r
-# Copyright (C) 2006 Gerfried Fuchs <alfie@debian.org>\r
+# Copyright (C) 2006 Gerfried Fuchs <rhonda@debian.org>\r
 # This file is distributed under the same license as the abook package.\r
 # Kanru Chen <koster@debian.org.tw>, 2008.\r
 # \r
@@ -12,6 +12,7 @@ msgstr ""
 "Last-Translator: Kanru Chen <koster@debian.org.tw>\n"
 "Language-Team: Debian-user in Chinese [Big5] <debian-chinese-big5@lists."
 "debian.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
index c22ed21e0424e645d4c7d5e05ada9d5176983508..f856309cd029c8f0014e34c05f1b347e5f613bae 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 # postinst for abook
-# copyright 2003-2009 by Gerfried Fuchs <rhonda@debian.at>
-# Licenced under BSD style
+# copyright 2003-2012 by Gerfried Fuchs <rhonda@debian.org>
+# Licenced under WTFPLv2
 
 # Source debconf library.
 if [ -e /usr/share/debconf/confmodule ]; then
index 87fe8a921c9a6cc47e4c164cf1a507f50b5d9d15..fc7524368a7d7b83078bc34e26ef2f33f0ff0c5a 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 # postrm for abook
-# copyright 2003-2009 by Gerfried Fuchs <rhonda@debian.at>
-# Licenced under BSD style
+# copyright 2003-2012 by Gerfried Fuchs <rhonda@debian.org>
+# Licenced under WTFPLv2
 
 if [ -x "`which update-menus 2>/dev/null`" ]; then
        update-menus
index 96f875af9131f666f515530d5ee3e2eeb217bebd..02a2a7c9562f44101316f99b72abb29f1c6ef76a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 # debian/rules for abook
-# copyright 2003-2009 by Gerfried Fuchs <rhonda@debian.at>
-# Licenced under BSD style
+# copyright 2003-2012 by Gerfried Fuchs <rhonda@debian.org>
+# Licenced under WTFPLv2
 
 PKG = abook
 TMP = $(CURDIR)/debian/$(PKG)
@@ -58,8 +58,7 @@ install: build
        $(checkroot)
        -rm -rf $(TMP)
        $(INSTALL_DIR) $(TMP)
-       cd $(TMP) && $(INSTALL_DIR) usr/share/doc/$(PKG)/examples \
-               usr/share/doc/$(PKG)/contrib
+       cd $(TMP) && $(INSTALL_DIR) usr/share/doc/$(PKG)/examples
        $(MAKE) prefix=$(TMP)/usr install INSTALL_PROGRAM="$(INSTALL_PROGRAM)"
        test "$(STRIP)" != true || strip \
                --remove-section=.comment --remove-section=.note \
@@ -67,13 +66,10 @@ install: build
        $(INSTALL_FILE) ChangeLog $(TMP)/usr/share/doc/$(PKG)/changelog
        $(INSTALL_FILE) ANNOUNCE AUTHORS BUGS FAQ README THANKS TODO \
                $(TMP)/usr/share/doc/$(PKG)
-       $(INSTALL_FILE) sample.abookrc contrib/mail2abook.py \
-               contrib/vcard2abook.pl $(TMP)/usr/share/doc/$(PKG)/examples
-       $(INSTALL_FILE) contrib/abook+vim/README contrib/abook+vim/mail.vim \
-               $(TMP)/usr/share/doc/$(PKG)/contrib
+       $(INSTALL_FILE) sample.abookrc \
+               $(TMP)/usr/share/doc/$(PKG)/examples
        cd $(TMP)/usr/share && gzip -9 man/man1/abook.1 man/man5/abookrc.5 \
-               doc/$(PKG)/examples/mail2abook.py doc/$(PKG)/changelog \
-               doc/$(PKG)/contrib/mail.vim
+               doc/$(PKG)/changelog
 
 
 # Build architecture-independent files here.
diff --git a/edit.c b/edit.c
index aed24c6da6e2a606723510f90fe13ce8abc7f375..b9138e6707d3dbdf671eb6425b8692b8603ef580 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -1,6 +1,6 @@
 
 /*
- * $Id: edit.c,v 1.43 2005/10/20 13:59:30 cduval Exp $
+ * $Id: edit.c,v 1.55 2006/09/06 02:46:44 cduval Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
@@ -9,6 +9,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <ctype.h>
 #include <assert.h>
 #include "abook_curses.h"
 #include "ui.h"
@@ -18,6 +19,7 @@
 #include "list.h"
 #include "edit.h"
 #include "misc.h"
+#include "views.h"
 #include "xmalloc.h"
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
  * some extern variables
  */
 
-extern struct abook_field abook_fields[];
-
-extern list_item *database;
-extern int curitem;
-extern int items;
+extern int views_count;
 
 WINDOW *editw;
 
+
 static void
 editor_tab(const int tab)
 {
        int i, j;
        int x_pos = 2; /* current x pos */
-       static char *tab_names[] = {
-               N_("CONTACT"),
-               N_("ADDRESS"),
-               N_(" PHONE "),
-               N_(" OTHER "),
-               N_("CUSTOM ")
-       };
+       char *tab_name;
 
        mvwhline(editw, TABLINE + 1, 0, UI_HLINE_CHAR, EDITW_COLS);
 
-       for(i = 0; i < TABS; i++) {
-               int width = strwidth(gettext(tab_names[i])) + 5;
+       for(i = 0; i < views_count; i++) {
+               view_info(i, &tab_name, NULL);
+               int width = strwidth(tab_name) + 5;
 
                if(x_pos + width + 1 > EDITW_COLS) {
-                       statusline_msg(_("Tab name too wide for screen"));
+                       statusline_addstr(_("Tab name too wide for screen"));
                        break;
                }
 
@@ -63,7 +57,7 @@ editor_tab(const int tab)
 
                mvwaddch(editw,  TABLINE, x_pos,  UI_ULCORNER_CHAR);
                mvwaddch(editw,  TABLINE, x_pos + 1,  UI_LBOXLINE_CHAR);
-               mvwaddstr(editw, TABLINE, x_pos + 2,  gettext(tab_names[i]));
+               mvwaddstr(editw, TABLINE, x_pos + 2,  tab_name);
                mvwaddch(editw,  TABLINE, x_pos + width - 3, UI_RBOXLINE_CHAR);
                mvwaddch(editw,  TABLINE, x_pos + width - 2, UI_URCORNER_CHAR);
 
@@ -82,36 +76,36 @@ editor_tab(const int tab)
 void
 get_first_email(char *str, int item)
 {
-       char *tmp;
+       char *tmp, *emails = db_email_get(item);
 
-       if(database[item][EMAIL] == NULL) {
+       if(!*emails) {
                *str = 0;
                return;
        }
 
-       strncpy(str, database[item][EMAIL], MAX_EMAIL_LEN);
+       strncpy(str, emails, MAX_EMAIL_LEN);
+       free(emails);
        if( (tmp = strchr(str, ',')) )
                *tmp = 0;
        else
-               str[MAX_EMAIL_LEN-1] = 0;
+               str[MAX_EMAIL_LEN - 1] = 0;
 }
 
+/* This only rolls emails from the 'email' field, not emails from any
+ * field of type FIELD_EMAILS.
+ * TODO: expand to ask for which field to roll if several are present? */
 static void
-roll_emails(int item)
+roll_emails(int item, enum rotate_dir dir)
 {
-       char tmp[MAX_EMAILSTR_LEN];
-       char *p;
-
-       strcpy(tmp, database[item][EMAIL]);
+       abook_list *emails = csv_to_abook_list(db_fget(item, EMAIL));
 
-       if( !(p = strchr(tmp, ',')) )
+       if(!emails)
                return;
-       else
-               *p = 0;
 
-       strcpy(database[item][EMAIL], p+1);
-       strcat(database[item][EMAIL], ",");
-       strcat(database[item][EMAIL], tmp);
+       free(db_fget(item, EMAIL));
+       abook_list_rotate(&emails, dir);
+       db_fput(item, EMAIL, abook_list_to_csv(emails));
+       abook_list_free(&emails);
 }
 
 static void
@@ -119,6 +113,7 @@ init_editor()
 {
        clear();
        editw = newwin(EDITW_LINES, EDITW_COLS, EDITW_TOP, EDITW_X);
+       notimeout(editw, TRUE); /* handling of escape key */
 
        refresh_statusline();
 }
@@ -132,47 +127,39 @@ enum {
 static int
 edit_undo(int item, int mode)
 {
-       int i;
-       static list_item *backup = NULL;
+       static list_item backup = NULL;
        static int backed_up_item = -1;
 
        switch(mode) {
                case CLEAR_UNDO:
                        if(backup) {
-                               free_list_item(backup[0]);
-                               xfree(backup);
+                               item_empty(backup);
+                               item_free(&backup);
                        }
                        break;
                case BACKUP_ITEM:
                        if(backup) {
-                               free_list_item(backup[0]);
-                               xfree(backup);
+                               item_empty(backup);
+                               item_free(&backup);
                        }
-                       backup = xmalloc(sizeof(list_item));
-                       for(i = 0; i < ITEM_FIELDS; i++)
-                               if(database[item][i] == NULL)
-                                       backup[0][i] = NULL;
-                               else
-                                       backup[0][i] =
-                                               xstrdup(database[item][i]);
+                       backup = item_create();
+                       item_duplicate(backup, db_item_get(item));
                        backed_up_item = item;
                        break;
                case RESTORE_ITEM:
                        if(backup) {
-                               free_list_item(database[backed_up_item]);
-                               itemcpy(database[backed_up_item], backup[0]);
-                               xfree(backup);
+                               item_empty(db_item_get(backed_up_item));
+                               item_copy(db_item_get(backed_up_item), backup);
+                               item_free(&backup);
                                return backed_up_item;
                        }
                        break;
                default:
                        assert(0);
        }
-
        return item;
 }
 
-
 static void
 close_editor()
 {
@@ -192,15 +179,14 @@ print_editor_header(int item)
 
        get_first_email(email, item);
 
-       if(*database[item][EMAIL])
+       if(*email)
                snprintf(header, EDITW_COLS, "%s <%s>",
-                               database[item][NAME],
+                               db_name_get(item),
                                email);
        else
-               snprintf(header, EDITW_COLS, "%s", database[item][NAME]);
+               snprintf(header, EDITW_COLS, "%s", db_name_get(item));
 
-       mvwaddstr(editw, 0, (EDITW_COLS - strwidth(header)) / 2,
-                       header);
+       mvwaddstr(editw, 0, (EDITW_COLS - strwidth(header)) / 2, header);
 
        free(header);
 }
@@ -208,29 +194,14 @@ print_editor_header(int item)
 static void
 editor_print_data(int tab, int item)
 {
-       int i, j;
+       int j = 1, nb;
        int y, x;
+       abook_field_list *cur;
+       char *str;
 
-       for(i = 0, j = 1; i < ITEM_FIELDS; i++) {
-               if(abook_fields[i].tab != tab)
-                       continue;
+       view_info(tab, NULL, &cur);
 
-               if(i == EMAIL) { /* special field */
-                       int k;
-                       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
-                       split_emailstr(item, emails);
-                       getyx(editw, y, x);
-                       mvwaddstr(editw, y+1, FIELDS_START_X,
-                                       _("E-mail addresses:"));
-                       for(k = 0; k < MAX_EMAILS; k++) {
-                               getyx(editw, y, x);
-                               mvwprintw(editw, y+1, FIELDS_START_X,
-                               "%c -", '2' + k);
-                               mvwprintw(editw, y +1, TAB_COLON_POS,
-                                               ": %s", emails[k]);
-                       }
-                       continue;
-               }
+       for(; cur; cur = cur->next) {
 
                if(j > 1) {
                        getyx(editw, y, x);
@@ -238,12 +209,62 @@ editor_print_data(int tab, int item)
                } else
                        y = FIELDS_START_Y;
 
-               mvwprintw(editw, y, FIELDS_START_X, "%d - %s",
-                               j,
-                               gettext(abook_fields[i].name));
+               mvwprintw(editw, y, FIELDS_START_X, "%c - ",
+                               (j < 10) ? '0' + j : 'A' + j - 10);
+               mvwaddnstr(editw, y, FIELDS_START_X + 4, cur->field->name,
+                               bytes2width(cur->field->name,
+                                       FIELDNAME_MAX_WIDTH));
                mvwaddch(editw, y, TAB_COLON_POS, ':');
-               mvwaddstr(editw, y, TAB_COLON_POS + 2,
-                               safe_str(database[item][i]));
+
+               if((cur->field->type == FIELD_EMAILS) ||
+                               (cur->field->type == FIELD_LIST)) {
+                       abook_list *emails, *e;
+                       
+                       find_field_number(cur->field->key, &nb);
+                       emails = csv_to_abook_list(db_fget_byid(item, nb));
+
+                       for(e = emails; e; e = e->next) {
+                               getyx(editw, y, x);
+                               mvwaddnstr(editw, y + 1, TAB_COLON_POS + 2,
+                                               e->data,
+                                               bytes2width(e->data,
+                                                       FIELD_MAX_WIDTH));
+                               mvwaddch(editw, y + 1, TAB_COLON_POS,
+                                               UI_VLINE_CHAR);
+                       }
+                       if(emails) {
+                               mvwaddch(editw, y + 2, TAB_COLON_POS,
+                                               UI_LLCORNER_CHAR);
+                               mvwhline(editw, y + 2, TAB_COLON_POS + 1,
+                                               UI_HLINE_CHAR,
+                                               EDITW_COLS - TAB_COLON_POS - 2);
+                       }
+                       abook_list_free(&emails);
+               } else if(cur->field->type == FIELD_DATE) {
+                       int day, month, year;
+                       char buf[12];
+
+                       find_field_number(cur->field->key, &nb);
+                       if((str = db_fget_byid(item, nb)) != NULL)
+                               strncpy(buf, str, sizeof(buf));
+
+                       if(str && parse_date_string(buf, &day, &month, &year)) {
+                               if(year)
+                                       str = strdup_printf("%04d-%02d-%02d",
+                                               year, month, day);
+                               else
+                                       str = strdup_printf("--%02d-%02d",
+                                               month, day);
+                               mvwaddnstr(editw, y, TAB_COLON_POS + 2, str,
+                                       bytes2width(str, FIELD_MAX_WIDTH));
+                               free(str);
+                       }
+               } else {
+                       find_field_number(cur->field->key, &nb);
+                       str = safe_str(db_fget_byid(item, nb));
+                       mvwaddnstr(editw, y, TAB_COLON_POS + 2, str,
+                               bytes2width(str, FIELD_MAX_WIDTH));
+               }
 
                j++;
        }
@@ -258,22 +279,19 @@ editor_print_data(int tab, int item)
  *  (char **field)
  *   a pointer to a pointer which will point a new string. if the latter
  *   pointer != NULL it will be freed (if user doesn't cancel)
+ *  (size_t max_len)
+ *   maximum length of field to read from user
  *
  * returns (int)
  *  a nonzero value if user has cancelled and zero if user has typed a
  *  valid string
  */
-
 static int
-change_field(char *msg, char **field)
+change_field(char *msg, char **field, size_t max_len)
 {
-       int max_len = MAX_FIELD_LEN;
        char *old;
        int ret = 0;
 
-       if(!strncmp("E-mail", msg, 6))
-               max_len = MAX_EMAIL_LEN;
-
        old = *field;
 
        *field = ui_readline(msg, old, max_len - 1, 0);
@@ -293,13 +311,14 @@ change_field(char *msg, char **field)
        return ret;
 }
 
-static void
-change_name_field(char **field)
+static int
+change_name_field(char *msg, char **field, size_t max_len)
 {
        char *tmp;
+       int ret;
 
        tmp = xstrdup(*field);
-       change_field("Name: ", field);
+       ret = change_field(msg, field, max_len);
 
        if(*field == NULL || ! **field) {
                xfree(*field);
@@ -307,6 +326,8 @@ change_name_field(char **field)
        }
 
        xfree(tmp);
+
+       return ret;
 }
 
 static void
@@ -317,83 +338,232 @@ fix_email_str(char *str)
 }
 
 static void
-edit_emails(char c, int item)
+edit_list(int item, int nb, int isemail)
 {
-       char *field;
-       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
-       char tmp[MAX_EMAILSTR_LEN] = "";
-       int i, len;
-       int email_num = c - '2';
+       char *field, *msg, *keys;
+       abook_list *list, *e;
+       int choice = 1, elem_count;
+
+       list = csv_to_abook_list(db_fget_byid(item, nb));
+
+       for(e = list, elem_count = 0; e; e = e->next, elem_count++)
+               ;
+
+       if(elem_count) {
+               keys = xstrndup(S_("keybindings_new_123456789|n123456789"),
+                               elem_count + 1);
+               msg = strdup_printf(_("Choose %s to modify (<1>%s%c%s%s."),
+                               isemail ? _("email") : _("item"),
+                               (elem_count > 1) ? "-<" : "",
+                               (elem_count > 1) ?  '0' + elem_count : ')',
+                               (elem_count > 1) ? ">)" : "",
+                               (elem_count < MAX_LIST_ITEMS) ?
+                                       _(" or <n>ew") : ""
+                               );
+               choice = statusline_askchoice(
+                               msg,
+                               keys,
+                               (elem_count < MAX_LIST_ITEMS) ? 1 : 2
+                               );
+               free(keys);
+               free(msg);
+       }
 
-       split_emailstr(item, emails);
-       field = xstrdup(emails[email_num]);
+       if(choice == 0)
+               return;
+
+       field = (choice > 1) ?
+               xstrdup(abook_list_get(list, choice - 2)->data) :
+               NULL;
 
-       if(change_field("E-mail: ", &field))
+       if(change_field(isemail ? _("E-mail: ") : _("Item: "),
+                               &field, MAX_EMAIL_LEN))
                return; /* user cancelled ( C-g ) */
 
-       if(field) {
-               strncpy(emails[email_num], field, MAX_EMAIL_LEN);
-               fix_email_str(emails[email_num]);
-       } else
-               *emails[email_num] = 0;
+       /* TODO if list item contains commas, should use quotes instead */
+       if(field)
+               fix_email_str(field);
 
-       xfree(database[item][EMAIL]);
+       if(choice == 1)
+               abook_list_append(&list, field);
+       else
+               abook_list_replace(&list, choice - 2, field);
 
-       for(i = 0; i < MAX_EMAILS; i++) {
-               if( *emails[i] ) {
-                       strcat(tmp, emails[i]);
-                       strcat(tmp, ",");
-               }
-       }
+       if(field)
+               xfree(field);
 
-       len = strlen(tmp);
-       if(tmp[len -1] == ',')
-               tmp[len-1] =0;
+       field = abook_list_to_csv(list);
+       db_fput_byid(item, nb, field ? field : xstrdup(""));
+       abook_list_free(&list);
+}
 
-       database[item][EMAIL] = xstrdup(tmp);
+static int is_valid_date(const int day, const int month, const int year)
+{
+       int valid = 1;
+       int month_length[13] =
+               { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+       /*
+        * leap year
+        */
+       if ((!(year % 4)) && ((year % 100) || !(year % 400)))
+               month_length[2] = 29;
+
+       if (month < 1 || month > 12)
+               valid = 0;
+       else if (day < 1 || day > month_length[month])
+               valid = 0;
+       else if (year < 0) /* we don't accept negative year numbers */
+               valid = 0;
+
+       return valid;
 }
 
-static int
-edit_field(int tab, char c, int item)
+int
+parse_date_string(char *s, int *day, int *month, int *year)
 {
-       int i, j;
-       int n = c - '1' + 1;
-       char *str;
+       int i = 0;
+       char *p = s;
+       assert(s && day && month && year);
+
+       if(*s == '-' && *s++ == '-') { /* omitted year */
+               *year = 0;
+               p = ++s;
+               i++;
+       }
 
-       if(n < 1 || n > MAX_TAB_FIELDS)
-               return 0;
+       while(*s) {
+               if(isdigit(*s)) {
+                       s++;
+                       continue;
+               } else if(*s == '-') {
+                       if(++i > 3)
+                               return FALSE;
+                       *s++ = '\0';
+                       switch(i) {
+                               case 1: *year = safe_atoi(p); break;
+                               case 2: *month = safe_atoi(p); break;
+                       }
+                       p = s;
+               } else
+               return FALSE;
+       }
 
-       edit_undo(item, BACKUP_ITEM);
+       if (i != 2 || !*p)
+               return FALSE;
 
-       if(tab == TAB_CONTACT) {
-               switch(c) {
-                       case '1': change_name_field(&database[item][NAME]);
-                                 break;
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5': edit_emails(c, item); break;
-                       default: return 0;
-               }
-               return 1;
+       *day = atoi(p);
+
+       return is_valid_date(*day, *month, *year);
+}
+
+static void
+edit_date(int item, int nb)
+{
+       int i, date[3], old = FALSE;
+       char buf[12], *s = db_fget_byid(item, nb);
+       char *field[] = { N_("Day: "), N_("Month: "), N_("Year (optional): ") };
+
+       if(s) {
+               strncpy(buf, s, sizeof(buf));
+               old = parse_date_string(buf, &date[0], &date[1], &date[2]);
        }
 
-       for(i = 0, j = 0; i< ITEM_FIELDS; i++) {
-               if(abook_fields[i].tab == tab)
-                       j++;
-               if(j==n)
-                       break;
+       for(i = 0; i < 3; i++) {
+               s = (old && date[i]) ? strdup_printf("%d", date[i]) : NULL;
+               if(change_field(gettext(field[i]), &s, 5))
+                       return; /* user aborted with ^G */
+
+               date[i] = (s && is_number(s)) ? atoi(s) : 0;
+
+               if(!s) {
+                       switch(i) {
+                               case 0: db_fput_byid(item, nb, NULL); /*delete*/
+                               case 1: /* fall through */ return;
+                       }
+               } else
+                       xfree(s);
        }
 
-       if(j != n)
-               return 0;
+       /* ISO 8601 date, of the YYYY-MM-DD or --MM-DD format */
+       if(is_valid_date(date[0], date[1], date[2])) {
+               if(date[2])
+                       s = strdup_printf("%04d-%02d-%02d",
+                               date[2], date[1], date[0]);
+               else
+                       s = strdup_printf("--%02d-%02d", date[1], date[0]);
+
+               db_fput_byid(item, nb, xstrdup(s));
+       } else
+               statusline_msg(_("Invalid date"));
+}
+
+/* input range: 1-9A-Z
+ * output range: 0-34 */
+static int
+key_to_field_number(char c)
+{
+       int n = c - '1';
+       if(n >= 0 && n < 9)
+               return n;
+
+       n = c - 'A' + 9;
+       if(n > 8 && n < 35)
+               return n;
+
+       return -1;
+}
+
+static void
+edit_field(int tab, char c, int item_number)
+{
+       int i = 0, number, idx;
+       char *msg;
+       abook_field_list *f;
+       list_item item;
+
+       if((number = key_to_field_number(c)) < 0)
+               return;
+
+       edit_undo(item_number, BACKUP_ITEM);
+
+       view_info(tab, NULL, &f);
+
+       while(1) {
+               if(!f)
+                       return;
 
-       str = strdup_printf("%s: ", gettext(abook_fields[i].name));
-       change_field(str, &database[item][i]);
+               if(i == number)
+                       break;
 
-       free(str);
+               f = f->next;
+               i++;
+       }
 
-       return 1;
+       find_field_number(f->field->key, &idx);
+       
+       switch(f->field->type) {
+               case FIELD_STRING:
+                       msg = strdup_printf("%s: ", f->field->name);
+                       item = db_item_get(item_number);
+                       if(strcmp(f->field->key, "name") == 0)
+                               change_name_field(msg,&item[idx],MAX_FIELD_LEN);
+                       else
+                               change_field(msg,&item[idx],MAX_FIELD_LEN);
+                       free(msg);
+                       break;
+               case FIELD_LIST:
+                       edit_list(item_number, idx, 0);
+                       break;
+               case FIELD_EMAILS:
+                       edit_list(item_number, idx, 1);
+                       break;
+               case FIELD_DATE:
+                       edit_date(item_number, idx);
+                       return;
+               default:
+                       assert(0);
+       }
 }
 
 static int
@@ -413,31 +583,44 @@ edit_loop(int item)
        refresh();
        wrefresh(editw);
 
-       switch((c = getch())) {
-               case 'c': tab = TAB_CONTACT; break;
-               case 'a': tab = TAB_ADDRESS; break;
-               case 'p': tab = TAB_PHONE; break;
-               case 'o': tab = TAB_OTHER; break;
-               case 'C': tab = TAB_CUSTOM; break;
+       c = getch();
+       if(c == '\033') {
+               statusline_addstr("ESC-");
+               c = getch();
+               clear_statusline();
+
+               /* Escaped bindings */
+               switch(c) {
+                       case 'r': roll_emails(item, ROTATE_RIGHT); break;
+                       default: break;
+               }
+
+               return item;
+       }
+
+       /* No uppercase nor numeric key should be used in this menu,
+        * as they are reserved for field selection */
+       switch(c) {
                case 'h':
-               case KEY_LEFT: tab = tab == 0 ? MAX_TAB : tab - 1;
+               case KEY_LEFT: tab = tab == 0 ? views_count - 1 : tab - 1;
                               break;
                case 'l':
-               case KEY_RIGHT: tab = tab == MAX_TAB ? 0 : tab + 1;
+               case KEY_RIGHT: tab = tab == views_count - 1 ? 0 : tab + 1;
                                break;
                case KEY_UP:
                case '<':
-               case 'k': if(is_valid_item(item-1)) item--; break;
+               case 'k': if(is_valid_item(item - 1)) item--; break;
                case KEY_DOWN:
                case '>':
                case 'j': if(is_valid_item(item + 1)) item++; break;
-               case 'r': roll_emails(item); break;
+               case 'r': roll_emails(item, ROTATE_LEFT); break;
                case '?': display_help(HELP_EDITOR); break;
                case 'u': item = edit_undo(item, RESTORE_ITEM); break;
                case 'm': launch_mutt(item); clearok(stdscr, 1); break;
                case 'v': launch_wwwbrowser(item); clearok(stdscr, 1); break;
                case 12 : clearok(stdscr, 1); break; /* ^L (refresh screen) */
-               default:  return edit_field(tab, c, item) ? item : -1;
+               case 'q': return -1;
+               default: edit_field(tab, c, item);
        }
 
        return item;
@@ -446,17 +629,17 @@ edit_loop(int item)
 void
 edit_item(int item)
 {
-       if( item < 0 ) {
-               if( curitem < 0 )
+       if(item < 0) {
+               if(list_get_curitem() < 0)
                        return;
                else
-                       item = curitem;
+                       item = list_get_curitem();
        }
 
        init_editor();
 
        while((item = edit_loop(item)) >= 0)
-               curitem = item; /* hmm, this is not very clean way to go */
+               list_set_curitem(item); /* this is not very clean way to go */
 
        close_editor();
 }
@@ -465,21 +648,20 @@ void
 add_item()
 {
        char *field = NULL;
-       list_item item;
+       list_item item = item_create();
 
-       change_field("Name: ", &field);
+       change_field(_("Name: "), &field, MAX_FIELD_LEN);
 
        if( field == NULL )
                return;
 
-       memset(item, 0, sizeof(item));
-
-       item[NAME] = field;
+       item_fput(item, NAME, field);
 
        add_item2database(item);
+       item_free(&item);
 
-       curitem = LAST_ITEM;
+       list_set_curitem(last_item());
 
-       edit_item(LAST_ITEM);
+       edit_item(last_item());
 }
 
diff --git a/edit.h b/edit.h
index e9ac9202b4aa2c7051cc52c6bef445524ef9776a..8f1ada501b76df84a3c1ef78693265357ec1d515 100644 (file)
--- a/edit.h
+++ b/edit.h
@@ -4,32 +4,22 @@
 void           edit_item(int item);
 void           get_first_email(char *str, int item);
 void           add_item();
+int            parse_date_string(char *s, int *day, int *month, int *year);
 
 #define EDITW_COLS     (COLS - 6)
 #define EDITW_LINES    (LINES - 5)
 #define EDITW_TOP      2
 #define EDITW_X                3
 
-#define EDITOR_HELPLINE        N_("?:help c:contact a:address p:phone o:other")
+#define EDITOR_HELPLINE        N_("?:help q:quit editor")
 
 #define TABLINE                1
 
-#define MAX_TAB_FIELDS 7
-
 #define TAB_COLON_POS  28
+#define FIELDNAME_MAX_WIDTH    20
+#define FIELD_MAX_WIDTH        (EDITW_COLS - TAB_COLON_POS - FIELDS_START_X - 2)
+
 #define FIELDS_START_Y 4
 #define FIELDS_START_X 4
 
-enum {
-       TAB_CONTACT,
-       TAB_ADDRESS,
-       TAB_PHONE,
-       TAB_OTHER,
-       TAB_CUSTOM
-};
-
-#define MAX_TAB                TAB_CUSTOM
-
-#define TABS           (MAX_TAB+1)
-
 #endif
index 8d0faa95a01b3a9f6cae2850a4a5392d57c4d1bf..f13d0995943dbbba872a5c70b5f924c302c28bb1 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -1,6 +1,6 @@
 
 /*
- * $Id: filter.c,v 1.48.2.1.2.2 2006/04/10 16:02:10 jheinonen Exp $
+ * $Id: filter.c,v 1.55 2006/09/06 02:46:44 cduval Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
@@ -27,9 +27,8 @@
 #include "xmalloc.h"
 #include <assert.h>
 
-extern int items;
-extern list_item *database;
-extern struct abook_field abook_fields[];
+extern abook_field_list *fields_list;
+extern int fields_count;
 
 /*
  * function declarations
@@ -62,6 +61,7 @@ static int    elm_alias_export(FILE *out, struct db_enumerator e);
 static int     text_export_database(FILE *out, struct db_enumerator e);
 static int     spruce_export_database(FILE *out, struct db_enumerator e);
 static int     wl_export_database(FILE *out, struct db_enumerator e);
+static int     bsdcal_export_database(FILE *out, struct db_enumerator e);
 
 /*
  * end of function declarations
@@ -92,6 +92,7 @@ struct abook_output_filter e_filters[] = {
        { "text", N_("plain text"), text_export_database },
        { "wl", N_("Wanderlust address book"), wl_export_database },
        { "spruce", N_("Spruce address book"), spruce_export_database },
+       { "bsdcal", N_("BSD calendar"), bsdcal_export_database },
        { "\0", NULL, NULL }
 };
 
@@ -194,7 +195,7 @@ import_database()
 {
        int filter;
        char *filename;
-       int tmp = items;
+       int tmp = db_n_items();
 
        import_screen();
 
@@ -215,7 +216,7 @@ import_database()
 
        if(i_read_file(filename, i_filters[filter].func ))
                statusline_msg(_("Error occured while opening the file"));
-       else if(tmp == items)
+       else if(tmp == db_n_items())
                statusline_msg(_("File does not seem to be a valid addressbook"));
 
        refresh_screen();
@@ -246,7 +247,7 @@ int
 import_file(char filtname[FILTNAME_LEN], char *filename)
 {
        int i;
-       int tmp = items;
+       int tmp = db_n_items();
        int ret = 0;
 
        for(i=0;; i++) {
@@ -271,7 +272,7 @@ import_file(char filtname[FILTNAME_LEN], char *filename)
        } else
                ret =  i_read_file(filename, i_filters[i].func);
 
-       if(tmp == items)
+       if(tmp == db_n_items())
                ret = 1;
 
        return ret;
@@ -281,7 +282,7 @@ import_file(char filtname[FILTNAME_LEN], char *filename)
  * export
  */
 
-static int             e_write_file(char *filename,
+static int e_write_file(char *filename,
                int (*func) (FILE *in, struct db_enumerator e), int mode);
 
 static void
@@ -531,10 +532,10 @@ ldif_read_line(FILE *in)
 static void
 ldif_add_item(ldif_item li)
 {
-       list_item abook_item;
+       list_item item;
        int i;
 
-       memset(abook_item, 0, sizeof(abook_item));
+       item = item_create();
 
        if(!li[LDIF_ITEM_FIELDS -1])
                goto bail_out;
@@ -542,14 +543,15 @@ ldif_add_item(ldif_item li)
 
        for(i=0; i < LDIF_ITEM_FIELDS; i++) {
                if(ldif_conv_table[i] >= 0 && li[i] && *li[i])
-                       abook_item[ldif_conv_table[i]] = xstrdup(li[i]);
+                       item_fput(item,ldif_conv_table[i],xstrdup(li[i]));
        }
 
-       add_item2database(abook_item);
+       add_item2database(item);
 
 bail_out:
        for(i=0; i < LDIF_ITEM_FIELDS; i++)
                xfree(li[i]);
+       item_free(&item);
 
 }
 
@@ -568,9 +570,11 @@ ldif_convert(ldif_item item, char *type, char *value)
                        if(i == LDIF_ITEM_FIELDS - 1) /* this is a dirty hack */
                                if(safe_strcmp("person", value))
                                        break;
-                       if(item[i])
-                               xfree(item[i]);
-                       item[i] = xstrdup(value);
+
+                       if(item_fget(item, i))
+                               free(item_fget(item, i));
+
+                       item_fput(item, i, xstrdup(value));
                }
        }
 }
@@ -638,8 +642,7 @@ mutt_read_line(FILE *in, char **alias, char **rest)
        if( !(line = ptr = getaline(in)) )
                return 1; /* error / EOF */
 
-       while( ISSPACE(*ptr) )
-               ptr++;
+       SKIPWS(ptr);
 
        if(strncmp("alias", ptr, 5)) {
                free(line);
@@ -648,8 +651,7 @@ mutt_read_line(FILE *in, char **alias, char **rest)
 
        ptr += 5;
 
-       while( ISSPACE(*ptr) )
-               ptr++;
+       SKIPWS(ptr);
 
        tmp = ptr;
 
@@ -658,13 +660,13 @@ mutt_read_line(FILE *in, char **alias, char **rest)
 
        alias_len = (size_t)(ptr - tmp);
 
-       *alias = xmalloc_inc(alias_len, 1);
+       if(alias)
+               *alias = xmalloc_inc(alias_len, 1);
 
        strncpy(*alias, tmp, alias_len);
        *(*alias + alias_len) = 0;
 
-       while(ISSPACE(*ptr))
-               ptr++;
+       SKIPWS(ptr);
 
        *rest = xstrdup(ptr);
 
@@ -695,7 +697,7 @@ mutt_fix_quoting(char *p)
 static void
 mutt_parse_email(list_item item)
 {
-       char *line = item[NAME];
+       char *line = item_fget(item, NAME);
        char *tmp;
        char *name, *email;
 #if 0
@@ -709,11 +711,12 @@ mutt_parse_email(list_item item)
        free(tmp);
 
        if(name)
-               item[NAME] = name;
+               item_fput(item, NAME, name);
        else
                return;
+
        if(email)
-               item[EMAIL] = email;
+               item_fput(item, EMAIL, email);
        else
                return;
 
@@ -742,22 +745,25 @@ mutt_parse_email(list_item item)
 static int
 mutt_parse_file(FILE *in)
 {
-       list_item item;
+       list_item item = item_create();
 
        for(;;) {
-               memset(item, 0, sizeof(item));
+               memset(item, 0, fields_count * sizeof(char *));
 
-               if(!mutt_read_line(in, &item[NICK],
-                               &item[NAME]) )
+               if(!mutt_read_line(in,
+                                       (field_id(NICK) != -1) ?
+                                       &item[field_id(NICK)] : NULL,
+                                       &item[field_id(NAME)]))
                        mutt_parse_email(item);
 
                if(feof(in)) {
-                       free_list_item(item);
+                       item_empty(item);
                        break;
                }
 
                add_item2database(item);
        }
+       item_free(&item);
 
        return 0;
 }
@@ -795,7 +801,8 @@ ldif_export_database(FILE *out, struct db_enumerator e)
                int j;
                get_first_email(email, e.item);
 
-               tmp = strdup_printf("cn=%s,mail=%s", database[e.item][NAME], email);
+               tmp = strdup_printf("cn=%s,mail=%s",db_name_get(e.item),email);
+
                ldif_fput_type_and_value(out, "dn", tmp);
                free(tmp);
 
@@ -804,10 +811,11 @@ ldif_export_database(FILE *out, struct db_enumerator e)
                                if(ldif_conv_table[j] == EMAIL)
                                        ldif_fput_type_and_value(out,
                                                ldif_field_names[j], email);
-                               else if(database[e.item][ldif_conv_table[j]])
+                               else if(db_fget(e.item,ldif_conv_table[j]))
                                        ldif_fput_type_and_value(out,
                                                ldif_field_names[j],
-                                               database[e.item][ldif_conv_table[j]]);
+                                               db_fget(e.item,
+                                                       ldif_conv_table[j]));
                        }
                }
 
@@ -826,39 +834,56 @@ ldif_export_database(FILE *out, struct db_enumerator e)
  * html export filter
  */
 
-static void            html_export_write_head(FILE *out, int extra);
+static void            html_export_write_head(FILE *out);
 static void            html_export_write_tail(FILE *out);
 
-extern int extra_column;
+extern struct index_elem *index_elements;
+
+static void
+html_print_emails(FILE *out, struct list_field *f)
+{
+       abook_list *l = csv_to_abook_list(f->data);
+
+       for(; l; l = l->next) {
+               fprintf(out, "<a href=\"mailto:%s\">%s</a>", l->data, l->data);
+               if(l->next)
+                       fprintf(out, ", ");
+       }
+
+       abook_list_free(&l);
+}
 
 static int
 html_export_database(FILE *out, struct db_enumerator e)
 {
-       char tmp[MAX_EMAILSTR_LEN];
-       int extra;
+       struct list_field f;
+       struct index_elem *cur;
 
-       if(items < 1)
+       if(list_is_empty())
                return 2;
 
-       extra = (extra_column > 2 && extra_column < ITEM_FIELDS) ?
-               extra_column : PHONE;
+       init_index();
 
-       html_export_write_head(out, extra);
+       html_export_write_head(out);
 
        db_enumerate_items(e) {
-               get_first_email(tmp, e.item);
-               if (*tmp)
-                   fprintf(out, "<tr>\n<td><a href=\"mailto:%s\">%s</a>\n",
-                           tmp,
-                           database[e.item][NAME] );
-               else
-                   fprintf(out, "<tr>\n<td>%s\n",
-                           database[e.item][NAME] );
-
-               fprintf(out, "<td>%s\n<td>%s\n",
-                               database[e.item][EMAIL],
-                               safe_str(database[e.item][extra]) );
-               fprintf(out, "</tr>\n\n");
+               fprintf(out, "<tr>");
+               for(cur = index_elements; cur; cur = cur->next) {
+                       if(cur->type != INDEX_FIELD)
+                               continue;
+
+                       get_list_field(e.item, cur, &f);
+
+                       if(f.type == FIELD_EMAILS) {
+                               fprintf(out, "<td>");
+                               html_print_emails(out, &f);
+                               fprintf(out, "</td>");
+                               continue;
+                       } else {
+                               fprintf(out, "<td>%s</td>", safe_str(f.data));
+                       }
+               }
+               fprintf(out, "</tr>\n");
        }
 
        html_export_write_tail(out);
@@ -866,21 +891,28 @@ html_export_database(FILE *out, struct db_enumerator e)
        return 0;
 }
 
-
 static void
-html_export_write_head(FILE *out, int extra)
+html_export_write_head(FILE *out)
 {
-       char *realname = get_real_name();
+       char *realname = get_real_name(), *str;
+       struct index_elem *cur;
 
        fprintf(out, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
-       fprintf(out, "<html>\n<head>\n <title>%s's addressbook</title>", realname );
+       fprintf(out, "<html>\n<head>\n <title>%s's addressbook</title>",
+                       realname );
        fprintf(out, "\n</head>\n<body>\n");
        fprintf(out, "\n<h2>%s's addressbook</h2>\n", realname );
        fprintf(out, "<br><br>\n\n");
 
-       fprintf(out, "<table border=\"1\" align=\"center\">\n");
-       fprintf(out, "\n<tr><th>Name<th>E-mail address(es)<th>%s</tr>\n\n",
-                       abook_fields[extra].name);
+       fprintf(out, "<table border=\"1\" align=\"center\">\n<tr>");
+       for(cur = index_elements; cur; cur = cur->next) {
+               if(cur->type != INDEX_FIELD)
+                       continue;
+
+               get_field_info(cur->d.field.id, NULL, &str, NULL);
+               fprintf(out, "<th>%s</th>", str);
+       }
+       fprintf(out, "</tr>\n\n");
 
        free(realname);
 }
@@ -928,10 +960,11 @@ pine_convert_emails(char *s)
                *tmp = '\0';
 
        for(i = 1; ( tmp = strchr(s, ',') ) != NULL ; i++, s = tmp + 1)
-               if(i > MAX_EMAILS - 1) {
+               if(i > MAX_LIST_ITEMS - 1) {
                        *tmp = '\0';
                        break;
                }
+
 }
 
 static void
@@ -942,11 +975,11 @@ pine_parse_buf(char *buf)
        char *end;
        char tmp[PINE_BUF_SIZE];
        int i, len, last;
-       int pine_conv_table[] = {NICK, NAME, EMAIL, -1, NOTES};
+       int pine_conv_table[]= {NICK, NAME, EMAIL, -1, NOTES};
 
-       memset(&item, 0, sizeof(item));
+       item = item_create();
 
-       for(i = 0, last=0; !last ; i++) {
+       for(i=0, last=0; !last ; i++) {
                if( !(end = strchr(start, '\t')) )
                        last=1;
 
@@ -958,13 +991,15 @@ pine_parse_buf(char *buf)
                        strncpy(tmp, start, len);
                        tmp[len] = 0;
                        if(*tmp)
-                               item[pine_conv_table[i]] = xstrdup(tmp);
+                               item_fput(item, pine_conv_table[i],
+                                               xstrdup(tmp));
                }
                start = end + 1;
        }
 
-       pine_convert_emails(item[EMAIL]);
+       pine_convert_emails(item_fget(item, EMAIL));
        add_item2database(item);
+       item_free(&item);
 }
 
 
@@ -1024,14 +1059,18 @@ pine_parse_file(FILE *in)
 static int
 pine_export_database(FILE *out, struct db_enumerator e)
 {
+       char *emails;
+
        db_enumerate_items(e) {
-               fprintf(out, have_multiple_emails(e.item) ?
+               emails = db_email_get(e.item);
+               fprintf(out, strchr(emails, ',') /* multiple addresses? */ ?
                                "%s\t%s\t(%s)\t\t%s\n" : "%s\t%s\t%s\t\t%s\n",
-                               safe_str(database[e.item][NICK]),
-                               safe_str(database[e.item][NAME]),
-                               safe_str(database[e.item][EMAIL]),
-                               safe_str(database[e.item][NOTES])
+                               safe_str(db_fget(e.item, NICK)),
+                               safe_str(db_name_get(e.item)),
+                               emails,
+                               safe_str(db_fget(e.item, NOTES))
                                );
+               free(emails);
        }
 
        return 0;
@@ -1080,11 +1119,7 @@ static int allcsv_conv_table[] = {
        NICK,
        URL,
        NOTES,
-       CUSTOM1,
-       CUSTOM2,
-       CUSTOM3,
-       CUSTOM4,
-       CUSTOM5,
+       ANNIVERSARY
 };
 
 static int palmcsv_conv_table[] = {
@@ -1102,11 +1137,7 @@ static int palmcsv_conv_table[] = {
        STATE,
        ZIP,
        COUNTRY,
-       CUSTOM1,
-       CUSTOM2,
-       CUSTOM3,
-       CUSTOM4,
-       CUSTOM5,
+       ANNIVERSARY,
 };
 
 static void
@@ -1119,7 +1150,7 @@ csv_convert_emails(char *s)
                return;
 
        for(i = 1; ( tmp = strchr(s, ',') ) != NULL ; i++, s = tmp + 1)
-               if(i > MAX_EMAILS - 1) {
+               if(i > MAX_LIST_ITEMS - 1) {
                        *tmp = 0;
                        break;
                }
@@ -1156,7 +1187,7 @@ static int
 csv_field_to_item(int *table_base, size_t table_size, int field)
 {
        if(field < table_size)
-               return table_base[field];
+               return field_id(table_base[field]);
 
        return -1;
 }
@@ -1225,7 +1256,7 @@ csv_parse_line(char *line, int *table_base, size_t table_size)
        bool in_quote = FALSE;
        list_item item;
 
-       memset(item, 0, sizeof(item));
+       item = item_create();
 
        for(p = start = line, field = 0; *p; p++) {
                if(in_quote) {
@@ -1239,10 +1270,8 @@ csv_parse_line(char *line, int *table_base, size_t table_size)
 
                if(*p == ',' && !in_quote) {
                        *p = 0;
-                       csv_field_to_item(table_base, table_size, field);
                        csv_store_item(item,
-                               csv_field_to_item(table_base,
-                                                       table_size, field),
+                               csv_field_to_item(table_base,table_size,field),
                                start);
                        field++;
                        start = p + 1;
@@ -1254,8 +1283,9 @@ csv_parse_line(char *line, int *table_base, size_t table_size)
        csv_store_item(item, csv_field_to_item(table_base, table_size, field),
                start);
 
-       csv_convert_emails(item[EMAIL]);
+       csv_convert_emails(item_fget(item, EMAIL));
        add_item2database(item);
+       item_free(&item);
 }
 
 static int
@@ -1324,13 +1354,13 @@ csv_export_common(FILE *out, struct db_enumerator e,
                                        (*special_func)(out, e.item, fields[i]);
                        } else
                                /*fprintf(out,(
-                       strchr(safe_str(database[e.item][fields[i]]), ',') ||
-                       strchr(safe_str(database[e.item][fields[i]]), '\"')) ?
+                       strchr(safe_str(database[e.item][field_idx(fields[i])]), ',') ||
+                       strchr(safe_str(database[e.item][field_idx(fields[i])]), '\"')) ?
                                "\"%s\"" : "%s",
-                               safe_str(database[e.item][fields[i]])
+                               safe_str(database[e.item][field_idx(fields[i])])
                                );*/
                                fprintf(out, "\"%s\"",
-                                       safe_str(database[e.item][fields[i]]));
+                                       safe_str(db_fget(e.item,fields[i])));
 
                        if(fields[i + 1] != CSV_LAST)
                                fputc(',', out);
@@ -1381,11 +1411,7 @@ allcsv_export_database(FILE *out, struct db_enumerator e)
                NICK,
                URL,
                NOTES,
-               CUSTOM1,
-               CUSTOM2,
-               CUSTOM3,
-               CUSTOM4,
-               CUSTOM5,
+               ANNIVERSARY,
                CSV_LAST
        };
 
@@ -1405,11 +1431,7 @@ allcsv_export_database(FILE *out, struct db_enumerator e)
        fprintf(out, "\"NICK\",");
        fprintf(out, "\"URL\",");
        fprintf(out, "\"NOTES\",");
-       fprintf(out, "\"CUSTOM1\",");
-       fprintf(out, "\"CUSTOM2\",");
-       fprintf(out, "\"CUSTOM3\",");
-       fprintf(out, "\"CUSTOM4\",");
-       fprintf(out, "\"CUSTOM5\"\n");
+       fprintf(out, "\"ANNIVERSARY\"\n");
 
        csv_export_common(out, e, allcsv_export_fields, NULL);
 
@@ -1448,7 +1470,7 @@ palm_csv_handle_specials(FILE *out, int item, int field)
 {
        switch(field) {
                case PALM_CSV_NAME:
-                       palm_split_and_write_name(out, database[item][NAME]);
+                       palm_split_and_write_name(out, db_name_get(item));
                        break;
                case PALM_CSV_CAT:
                        fprintf(out, "\"abook\"");
@@ -1504,62 +1526,67 @@ palm_export_database(FILE *out, struct db_enumerator e)
 static int
 gcrd_export_database(FILE *out, struct db_enumerator e)
 {
-       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
        int j;
-       char *name;
+       char *name, *tmp;
+       abook_list *emails, *em;
 
        db_enumerate_items(e) {
                fprintf(out, "BEGIN:VCARD\r\nFN:%s\r\n",
-                               safe_str(database[e.item][NAME]));
+                               safe_str(db_name_get(e.item)));
 
-               name = get_surname(database[e.item][NAME]);
-               for( j = strlen(database[e.item][NAME]) - 1; j >= 0; j-- ) {
-                       if(database[e.item][NAME][j] == ' ')
+               name = get_surname(db_name_get(e.item));
+               for( j = strlen(db_name_get(e.item)) - 1; j >= 0; j-- ) {
+                       if((db_name_get(e.item))[j] == ' ')
                                break;
                }
                fprintf(out, "N:%s;%.*s\r\n",
                        safe_str(name),
                        j,
-                       safe_str(database[e.item][NAME])
+                       safe_str(db_name_get(e.item))
                        );
 
                free(name);
 
-               if ( database[e.item][ADDRESS] )
+               if(db_fget(e.item, ADDRESS))
                        fprintf(out, "ADR:;;%s;%s;%s;%s;%s;%s\r\n",
-                               safe_str(database[e.item][ADDRESS]),
-                               safe_str(database[e.item][ADDRESS2]),
-                               safe_str(database[e.item][CITY]),
-                               safe_str(database[e.item][STATE]),
-                               safe_str(database[e.item][ZIP]),
-                               safe_str(database[e.item][COUNTRY])
+                               safe_str(db_fget(e.item, ADDRESS)),
+                               safe_str(db_fget(e.item, ADDRESS2)),
+                               safe_str(db_fget(e.item, CITY)),
+                               safe_str(db_fget(e.item, STATE)),
+                               safe_str(db_fget(e.item, ZIP)),
+                               safe_str(db_fget(e.item, COUNTRY))
                                );
 
-               if (database[e.item][PHONE])
+               if(db_fget(e.item, PHONE))
                        fprintf(out, "TEL;HOME:%s\r\n",
-                               database[e.item][PHONE]);
-               if (database[e.item][WORKPHONE])
+                                       db_fget(e.item, PHONE));
+               if(db_fget(e.item, WORKPHONE))
                        fprintf(out, "TEL;WORK:%s\r\n",
-                               database[e.item][WORKPHONE]);
-
-               if (database[e.item][FAX])
-                       fprintf(out, "TEL;FAX:%s\r\n", database[e.item][FAX]);
-               if (database[e.item][MOBILEPHONE])
-                       fprintf(out, "TEL;CELL:%s\r\n", database[e.item][MOBILEPHONE]);
-
-               if ( database[e.item][EMAIL] ) {
-                       split_emailstr(e.item, emails);
-                       for(j=0; j < MAX_EMAILS ; j++) {
-                               if ( *emails[j] )
-                                       fprintf(out, "EMAIL;INTERNET:%s\r\n",
-                                               emails[j]);
-                       }
+                                       db_fget(e.item, WORKPHONE));
+               if(db_fget(e.item, FAX))
+                       fprintf(out, "TEL;FAX:%s\r\n",
+                                       db_fget(e.item, FAX));
+               if(db_fget(e.item, MOBILEPHONE))
+                       fprintf(out, "TEL;CELL:%s\r\n",
+                                       db_fget(e.item, MOBILEPHONE));
+
+               tmp = db_email_get(e.item);
+               if(*tmp) {
+                       emails = csv_to_abook_list(tmp);
+
+                       for(em = emails; em; em = em->next)
+                               fprintf(out, "EMAIL;INTERNET:%s\r\n", em->data);
+
+                       abook_list_free(&emails);
                }
+               free(tmp);
 
-               if ( database[e.item][NOTES] )
-                       fprintf(out, "NOTE:%s\r\n", database[e.item][NOTES]);
-               if (database[e.item][URL])
-                       fprintf(out, "URL:%s\r\n",  database[e.item][URL]);
+               if(db_fget(e.item, NOTES))
+                       fprintf(out, "NOTE:%s\r\n",
+                                       db_fget(e.item, NOTES));
+               if(db_fget(e.item, URL))
+                       fprintf(out, "URL:%s\r\n",
+                                       db_fget(e.item, URL));
 
                fprintf(out, "END:VCARD\r\n\r\n");
 
@@ -1582,10 +1609,10 @@ mutt_alias_genalias(int i)
 {
        char *tmp, *pos;
 
-       if(database[i][NICK])
-               return xstrdup(database[i][NICK]);
+       if(db_fget(i, NICK))
+               return xstrdup(db_fget(i, NICK));
 
-       tmp = xstrdup(database[i][NAME]);
+       tmp = xstrdup(db_name_get(i));
 
        if( ( pos = strchr(tmp, ' ') ) )
                *pos = 0;
@@ -1603,11 +1630,10 @@ mutt_alias_export(FILE *out, struct db_enumerator e)
 
        db_enumerate_items(e) {
                alias = mutt_alias_genalias(e.item);
-
                get_first_email(email, e.item);
                fprintf(out, *email ? "alias %s %s <%s>\n": "alias %s %s%s\n",
                                alias,
-                               database[e.item][NAME],
+                               db_name_get(e.item),
                                email);
                xfree(alias);
        }
@@ -1627,29 +1653,29 @@ mutt_alias_export(FILE *out, struct db_enumerator e)
 
 static void
 text_write_address_us(FILE *out, int i) {
-       fprintf(out, "\n%s", database[i][ADDRESS]);
+       fprintf(out, "\n%s", db_fget(i, ADDRESS));
 
-       if (database[i][ADDRESS2])
-               fprintf(out, "\n%s", database[i][ADDRESS2]);
+       if(db_fget(i, ADDRESS2))
+               fprintf(out, "\n%s", db_fget(i, ADDRESS2));
 
-       if (database[i][CITY])
-               fprintf(out, "\n%s", database[i][CITY]);
+       if(db_fget(i, CITY))
+               fprintf(out, "\n%s", db_fget(i, CITY));
 
-       if (database[i][STATE] || database[i][ZIP]) {
+       if(db_fget(i, STATE) || db_fget(i, ZIP)) {
                fputc('\n', out);
 
-               if(database[i][STATE]) {
-                       fprintf(out, "%s", database[i][STATE]);
-                       if(database[i][ZIP])
+               if(db_fget(i, STATE)) {
+                       fprintf(out, "%s", db_fget(i, STATE));
+                       if(db_fget(i, ZIP))
                                fputc(' ', out);
                }
 
-               if(database[i][ZIP])
-                       fprintf(out, "%s", database[i][ZIP]);
+               if(db_fget(i, ZIP))
+                       fprintf(out, "%s", db_fget(i, ZIP));
        }
 
-       if (database[i][COUNTRY])
-               fprintf(out, "\n%s", database[i][COUNTRY]);
+       if(db_fget(i, COUNTRY))
+               fprintf(out, "\n%s", db_fget(i, COUNTRY));
 }
 
 
@@ -1657,44 +1683,43 @@ static void
 text_write_address_uk(FILE *out, int i) {
        int j;
 
-       for (j = ADDRESS; j <= COUNTRY; j++)
-               if (database[i][j])
-                       fprintf(out, "\n%s", database[i][j]);
+       for(j = ADDRESS; j <= COUNTRY; j++)
+               if(db_fget(i, j))
+                       fprintf(out, "\n%s", db_fget(i, j));
 }
 
 static void
 text_write_address_eu(FILE *out, int i) {
-       fprintf(out, "\n%s", database[i][ADDRESS]);
+       fprintf(out, "\n%s", db_fget(i, ADDRESS));
 
-       if (database[i][ADDRESS2])
-               fprintf(out, "\n%s", database[i][ADDRESS2]);
+       if(db_fget(i, ADDRESS2))
+               fprintf(out, "\n%s", db_fget(i, ADDRESS2));
 
-       if (database[i][ZIP] || database[i][CITY]) {
+       if(db_fget(i, ZIP) || db_fget(i, CITY)) {
                fputc('\n', out);
 
-               if(database[i][ZIP]) {
-                       fprintf(out, "%s", database[i][ZIP]);
-                       if(database[i][CITY])
+               if(db_fget(i, ZIP)) {
+                       fprintf(out, "%s", db_fget(i, ZIP));
+                       if(db_fget(i, CITY))
                                fputc(' ', out);
                }
 
-               if(database[i][CITY])
-                       fprintf(out, "%s", database[i][CITY]);
+               fprintf(out, "%s", safe_str(db_fget(i, CITY)));
        }
 
-       if (database[i][STATE])
-               fprintf(out, "\n%s", database[i][STATE]);
+       if(db_fget(i, STATE))
+               fprintf(out, "\n%s", db_fget(i, STATE));
 
-       if (database[i][COUNTRY])
-               fprintf(out, "\n%s", database[i][COUNTRY]);
+       if(db_fget(i, COUNTRY))
+               fprintf(out, "\n%s", db_fget(i, COUNTRY));
 }
 
 static int
 text_export_database(FILE * out, struct db_enumerator e)
 {
-       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
+       abook_list *emails, *em;
        int j;
-       char *realname = get_real_name();
+       char *realname = get_real_name(), *str = NULL, *tmp;
        char *style = opt_get_str(STR_ADDRESS_STYLE);
 
        fprintf(out,
@@ -1706,23 +1731,27 @@ text_export_database(FILE * out, struct db_enumerator e)
        db_enumerate_items(e) {
                fprintf(out,
                        "-----------------------------------------\n\n");
-               fprintf(out, "%s", database[e.item][NAME]);
-               if (database[e.item][NICK] && *database[e.item][NICK])
-                       fprintf(out, "\n(%s)", database[e.item][NICK]);
+               fprintf(out, "%s", db_name_get(e.item));
+               if(db_fget(e.item, NICK) && *db_fget(e.item, NICK))
+                       fprintf(out, "\n(%s)", db_fget(e.item, NICK));
                fprintf(out, "\n");
 
-               if (*database[e.item][EMAIL]) {
+               tmp = db_email_get(e.item);
+               if(*tmp) {
+                       emails = csv_to_abook_list(tmp);
+
                        fprintf(out, "\n");
-                       split_emailstr(e.item, emails);
-                       for (j = 0; j < MAX_EMAILS; j++)
-                               if (*emails[j])
-                                       fprintf(out, "%s\n", emails[j]);
+                       for(em = emails; em; em = em->next)
+                               fprintf(out, "%s\n", em->data);
+
+                       abook_list_free(&emails);
                }
+               free(tmp);
                /* Print address */
-               if (database[e.item][ADDRESS]) {
-                       if (!safe_strcmp(style, "us"))  /* US like */
+               if(db_fget(e.item, ADDRESS)) {
+                       if(!safe_strcmp(style, "us"))   /* US like */
                                text_write_address_us(out, e.item);
-                       else if (!safe_strcmp(style, "uk"))     /* UK like */
+                       else if(!safe_strcmp(style, "uk"))      /* UK like */
                                text_write_address_uk(out, e.item);
                        else    /* EU like */
                                text_write_address_eu(out, e.item);
@@ -1730,22 +1759,24 @@ text_export_database(FILE * out, struct db_enumerator e)
                        fprintf(out, "\n");
                }
 
-               if ((database[e.item][PHONE]) ||
-                       (database[e.item][WORKPHONE]) ||
-                       (database[e.item][FAX]) ||
-                       (database[e.item][MOBILEPHONE])) {
+               if((db_fget(e.item, PHONE)) ||
+                       (db_fget(e.item, WORKPHONE)) ||
+                       (db_fget(e.item, FAX)) ||
+                       (db_fget(e.item, MOBILEPHONE))) {
                        fprintf(out, "\n");
-                       for (j = PHONE; j <= MOBILEPHONE; j++)
-                               if (database[e.item][j])
-                                       fprintf(out, "%s: %s\n",
-                                               abook_fields[j].name,
-                                               database[e.item][j]);
+                       for(j = PHONE; j <= MOBILEPHONE; j++)
+                               if(db_fget(e.item, j)) {
+                                       get_field_info(field_id(j),
+                                                       NULL, &str, NULL);
+                                       fprintf(out, "%s: %s\n", str,
+                                               db_fget(e.item, j));
+                               }
                }
 
-               if (database[e.item][URL])
-                       fprintf(out, "\n%s\n", database[e.item][URL]);
-               if (database[e.item][NOTES])
-                       fprintf(out, "\n%s\n", database[e.item][NOTES]);
+               if(db_fget(e.item, URL))
+                       fprintf(out, "\n%s\n", db_fget(e.item, URL));
+               if(db_fget(e.item, NOTES))
+                       fprintf(out, "\n%s\n", db_fget(e.item, NOTES));
 
                fprintf(out, "\n");
        }
@@ -1772,10 +1803,7 @@ elm_alias_export(FILE *out, struct db_enumerator e)
        db_enumerate_items(e) {
                alias = mutt_alias_genalias(e.item);
                get_first_email(email, e.item);
-               fprintf(out, "%s = %s = %s\n",
-                               alias,
-                               database[e.item][NAME],
-                               email);
+               fprintf(out, "%s = %s = %s\n",alias,db_name_get(e.item),email);
                xfree(alias);
        }
 
@@ -1796,16 +1824,16 @@ spruce_export_database (FILE *out, struct db_enumerator e)
 {
        char email[MAX_EMAIL_LEN];
 
-       fprintf (out, "# This is a generated file made by abook for the Spruce e-mail client.\n\n");
+       fprintf(out, "# This is a generated file made by abook for the Spruce e-mail client.\n\n");
 
        db_enumerate_items(e) {
-               if(strcmp (safe_str(database[e.item][EMAIL]), "")) {
-                       get_first_email(email, e.item);
+               get_first_email(email, e.item);
+               if(strcmp(email, "")) {
                        fprintf(out, "# Address %d\nName: %s\nEmail: %s\nMemo: %s\n\n",
                                        e.item,
-                                       database[e.item][NAME],
+                                       db_name_get(e.item),
                                        email,
-                                       safe_str(database[e.item][NOTES])
+                                       safe_str(db_fget(e.item, NOTES))
                                        );
                }
        }
@@ -1826,17 +1854,17 @@ spruce_export_database (FILE *out, struct db_enumerator e)
 static int
 wl_export_database(FILE *out, struct db_enumerator e)
 {
-       char emails[MAX_EMAILS][MAX_EMAIL_LEN];
+       char email[MAX_EMAIL_LEN];
 
-       fprintf (out, "# Wanderlust address book written by %s\n\n", PACKAGE);
+       fprintf(out, "# Wanderlust address book written by %s\n\n", PACKAGE);
        db_enumerate_items(e) {
-               split_emailstr(e.item, emails);
-               if (**emails) {
+               get_first_email(email, e.item);
+               if(*email) {
                        fprintf(out,
                                "%s\t\"%s\"\t\"%s\"\n",
-                               *emails,
-                               safe_str(database[e.item][NICK]),
-                               safe_str(database[e.item][NAME])
+                               email,
+                               safe_str(db_fget(e.item, NICK)),
+                               safe_str(db_name_get(e.item))
                        );
                }
        }
@@ -1850,3 +1878,33 @@ wl_export_database(FILE *out, struct db_enumerator e)
  * end of wanderlust addressbook export filter
  */
 
+/*
+ * BSD calendar export filter
+ */
+
+static int
+bsdcal_export_database(FILE *out, struct db_enumerator e)
+{
+       db_enumerate_items(e) {
+               int year, month = 0, day = 0;
+               char *anniversary = db_fget(e.item, ANNIVERSARY);
+
+               if(anniversary) {
+                       parse_date_string(anniversary, &day, &month, &year);
+
+                       fprintf(out,
+                               _("%02d/%02d\tAnniversary of %s\n"),
+                               month,
+                               day,
+                               safe_str(db_name_get(e.item))
+                       );
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * end of BSD calendar export filter
+ */
+
diff --git a/help.h b/help.h
index 776a0003cc13469dac1c070a53ba7375b3dd40db..cda0ec5c3677bc63e384c302d16d95482308c344 100644 (file)
--- a/help.h
+++ b/help.h
@@ -52,14 +52,17 @@ NULL
 static char *editorhelp[] = {
 
 "\n",
-N_("   a,c,p,o,C/arrows/h,l    change tab\n"),
+N_("   arrows/h,l              change tab\n"),
 "\n",
-N_("   1 - 5                   edit fields\n"),
+N_("   q                       quit to main screen\n"),
+"\n",
+N_("   1 - 5 A - Z             edit fields\n"),
 "\n",
 N_("   k or <                  previous item\n"),
 N_("   j or >                  next item\n"),
 "\n",
-N_("   r                       roll e-mail addresses\n"),
+N_("   r                       roll e-mail addresses up\n"),
+N_("   ESC-r                   roll e-mail addresses down\n"),
 "\n",
 N_("   u                       undo\n"),
 "\n",
index 25499c0f12644f0c385f58833c83d8a4601231a4..b7a866f64e2ba152f7166c4881480afa8f98951f 100644 (file)
@@ -32,6 +32,7 @@ transform = @program_transform_name@
 libdir = @libdir@
 includedir = @includedir@
 datadir = @datadir@
+datarootdir = @datarootdir@
 localedir = $(datadir)/locale
 gettextsrcdir = $(datadir)/gettext/intl
 aliaspath = $(localedir)
diff --git a/list.c b/list.c
index 1c250850402f7399d78a5f1a9abf26e2bd1819f9..a6d442f249f1b260098effd75b48ca6bfa5f8b72 100644 (file)
--- a/list.c
+++ b/list.c
@@ -1,6 +1,6 @@
 
 /*
- * $Id: list.c,v 1.27 2005/09/17 10:10:26 jheinonen Exp $
+ * $Id: list.c,v 1.33 2006/09/05 08:21:35 jheinonen Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
 #include "options.h"
 #include "xmalloc.h"
 
-#define MIN_EXTRA_COLUMN       ADDRESS /* 2 */
-#define MAX_EXTRA_COLUMN       LAST_FIELD
 
 int curitem = -1;
 int first_list_item = -1;
 char *selected = NULL;
 
-int extra_column = -1;
-int extra_alternative = -1;
-
-extern int items;
-extern list_item *database;
-extern struct abook_field abook_fields[];
+extern abook_field_list *fields_list;
+struct index_elem *index_elements = NULL;
 
 static WINDOW *list = NULL;
 
-static int
-init_extra_field(enum str_opts option)
+
+static void
+index_elem_add(int type, char *a, char *b)
 {
-       int i, ret = -1;
-       char *option_str;
+       struct index_elem *tmp = NULL, *cur, *cur2;
+       int field, len = 0;
 
-       option_str = opt_get_str(option);
+       if(!a || !*a)
+               return;
 
-       if(option_str && *option_str) {
-               for(i = 0; i < ITEM_FIELDS; i++) {
-                       if(!strcasecmp(option_str, abook_fields[i].key)) {
-                               ret = i;
-                               break;
-                       }
-               }
-               if(ret < MIN_EXTRA_COLUMN || ret > MAX_EXTRA_COLUMN) {
-                       ret = -1;
-               }
+       switch(type) {
+               case INDEX_TEXT:
+                       tmp = xmalloc(sizeof(struct index_elem));
+                       tmp->d.text = xstrdup(a);
+                       break;
+               case INDEX_FIELD: /* fall through */
+               case INDEX_ALT_FIELD:
+                       find_field_number(a, &field);
+                       if(field == -1)
+                               return;
+                       len = (b && *b && is_number(b)) ? atoi(b) : 0;
+                       tmp = xmalloc(sizeof(struct index_elem));
+                       tmp->d.field.id = field;
+                       tmp->d.field.len = len;
+                       break;
+               default:
+                       assert(0);
+       }
+       tmp->type = type;
+       tmp->next = NULL;
+       tmp->d.field.next = NULL;
+
+       if(!index_elements) { /* first element */
+               index_elements = tmp;
+               return;
+       }
+
+       for(cur = index_elements; cur->next; cur = cur->next)
+               ;
+       if(type != INDEX_ALT_FIELD)
+               cur->next = tmp;
+       else { /* add as an alternate field */
+               tmp->d.field.len = cur->d.field.len;
+               for(cur2 = cur; cur2->d.field.next; cur2 = cur2->d.field.next)
+                       ;
+               cur2->d.field.next = tmp;
+       }
+}
+
+static void
+parse_index_format(char *s)
+{
+       char *p, *start, *lstart = NULL;
+       int in_field = 0, in_alternate = 0, in_length = 0, type;
+
+       p = start = s;
+
+       while(*p) {
+               if(*p == '{' && !in_field) {
+                       *p = 0;
+                       index_elem_add(INDEX_TEXT, start, NULL);
+                       start = ++p;
+                       in_field = 1;
+               } else if(*p == ':' && in_field && !in_alternate) {
+                       *p = 0;
+                       lstart = ++p;
+                       in_length = 1;
+               } else if(*p == '|' && in_field) {
+                       *p = 0;
+                       type = in_alternate ? INDEX_ALT_FIELD : INDEX_FIELD;
+                       index_elem_add(type, start, in_length ? lstart : NULL);
+                       start = ++p;
+                       in_length = 0;
+                       in_alternate = 1;
+               } else if(*p == '}' && in_field) {
+                       *p = 0;
+                       type = in_alternate ? INDEX_ALT_FIELD : INDEX_FIELD;
+                       index_elem_add(type, start, in_length ? lstart : NULL);
+                       start = ++p;
+                       in_field = in_alternate = in_length = 0;
+               } else
+                       p++;
        }
+       if(!in_field)
+               index_elem_add(INDEX_TEXT, start, NULL);
+}
 
-       return ret;
+void
+init_index()
+{
+       assert(!index_elements);
+       parse_index_format(opt_get_str(STR_INDEX_FORMAT));
 }
 
 void
@@ -64,13 +129,6 @@ init_list()
 {
        list = newwin(LIST_LINES, LIST_COLS, LIST_TOP, 0);
        scrollok(list, TRUE);
-
-       /*
-        * init extra_column and extra alternative
-        */
-
-       extra_column = init_extra_field(STR_EXTRA_COLUMN);
-       extra_alternative = init_extra_field(STR_EXTRA_ALTERNATIVE);
 }
 
 void
@@ -80,6 +138,117 @@ close_list()
        list = NULL;
 }
 
+void
+get_list_field(int item, struct index_elem *e, struct list_field *res)
+{
+       char *s;
+
+       res->data = s = NULL;
+
+       do { /* find first non-empty field data in the alternate fields list */
+               s = db_fget_byid(item, e->d.field.id);
+       } while(!(s && *s) && ((e = e->d.field.next) != NULL));
+
+       if(!e || !s || !*s)
+               return;
+
+       res->data = s;
+       get_field_info(e->d.field.id, NULL, NULL, &res->type);
+}
+
+static void
+print_list_field(int item, int line, int *x_pos, struct index_elem *e)
+{
+       char *s, *p;
+       int width, x_start, mustfree = FALSE, len = abs(e->d.field.len);
+       struct list_field f;
+
+       get_list_field(item, e, &f);
+       s = f.data;
+
+       if(!s || !*s) {
+               *x_pos += len;
+               return;
+       }
+       
+       if(f.type == FIELD_EMAILS && !opt_get_bool(BOOL_SHOW_ALL_EMAILS))
+               if((p = strchr(s, ',')) != NULL) {
+                       s = xstrndup(s, p - s);
+                       mustfree = TRUE;
+               }
+
+       width = len ? bytes2width(s, len) : strwidth(s);
+       x_start = *x_pos + ((e->d.field.len < 0) ? len - width : 0);
+       if(width + x_start >= COLS)
+               width = COLS - x_start;
+
+       if(width)
+               mvwaddnstr(list, line, x_start, s, width);
+
+       if(mustfree)
+               free(s);
+               
+       *x_pos += len ? len : width;
+}
+
+static void
+highlight_line(WINDOW *win, int line)
+{
+       wstandout(win);
+
+       /*
+        * this is a tricky one
+        */
+#if 0
+/*#ifdef mvwchgat*/
+       mvwchgat(win, line, 0, -1,  A_STANDOUT, 0, NULL);
+#else
+       /*
+        * buggy function: FIXME
+        */
+       scrollok(win, FALSE);
+       {
+               int i;
+               wmove(win, line, 0);
+               for(i = 0; i < COLS; i++)
+                       waddch(win, ' ');
+       /*wattrset(win, 0);*/
+       }
+       scrollok(win, TRUE);
+#endif
+}
+
+static void
+print_list_line(int item, int line, int highlight)
+{
+       struct index_elem *cur;
+       int x_pos = 1;
+
+       scrollok(list, FALSE);
+       if(highlight)
+               highlight_line(list, line);
+
+       if(selected[item])
+               mvwaddch(list, line, 0, '*' );
+
+       for(cur = index_elements; cur; cur = cur->next)
+               switch(cur->type) {
+                       case INDEX_TEXT:
+                               mvwaddstr(list, line, x_pos, cur->d.text);
+                               x_pos += strwidth(cur->d.text);
+                               break;
+                       case INDEX_FIELD:
+                               print_list_field(item, line, &x_pos, cur);
+                               break;
+                       default:
+                               assert(0);
+               }
+
+       scrollok(list, TRUE);
+       if(highlight)
+               wstandend(list);
+}
+
 void
 refresh_list()
 {
@@ -106,8 +275,9 @@ refresh_list()
        else if(curitem > LAST_LIST_ITEM)
                first_list_item = max(curitem - LIST_LINES + 1, 0);
 
-        for( line = 0, i = first_list_item ; i <= LAST_LIST_ITEM && i < items;
-                       line++, i++ ) {
+        for(line = 0, i = first_list_item;
+                       i <= LAST_LIST_ITEM && i < db_n_items();
+                       line++, i++) {
 
                print_list_line(i, line, i == curitem);
         }
@@ -120,56 +290,28 @@ refresh_list()
         wrefresh(list);
 }
 
-void
-print_list_line(int i, int line, int highlight)
-{
-       int extra = extra_column;
-       char tmp[MAX_EMAILSTR_LEN];
-       int real_emaillen = (extra_column > 0 || extra_alternative > 0) ?
-               EMAILLEN : COLS - EMAILPOS;
-
-       scrollok(list, FALSE);
-       if(highlight)
-               highlight_line(list, line);
-
-       if(selected[i])
-               mvwaddch(list, line, 0, '*' );
-
-       mvwaddnstr(list, line, NAMEPOS, database[i][NAME],
-               bytes2width(database[i][NAME], NAMELEN));
-       if(opt_get_bool(BOOL_SHOW_ALL_EMAILS))
-               mvwaddnstr(list, line, EMAILPOS, database[i][EMAIL],
-                               bytes2width(database[i][EMAIL], real_emaillen));
-       else {
-               get_first_email(tmp, i);
-               mvwaddnstr(list, line, EMAILPOS, tmp,
-                       bytes2width(tmp, real_emaillen));
-       }
-
-       if(extra < 0 || !database[i][extra])
-               extra = extra_alternative;
-       if(extra >= 0)
-               mvwaddnstr(list, line, EXTRAPOS,
-                       safe_str(database[i][extra]),
-                       bytes2width(safe_str(database[i][extra]), EXTRALEN));
-
-       scrollok(list, TRUE);
-       if(highlight)
-               wstandend(list);
-}
-
-
 void
 list_headerline()
 {
+       struct index_elem *e;
+       int x_pos = 1, width;
+       char *str = NULL;
+
 #if defined(A_BOLD) && defined(A_NORMAL)
        attrset(A_BOLD);
 #endif
-       mvaddstr(2, NAMEPOS, gettext(abook_fields[NAME].name));
-       mvaddstr(2, EMAILPOS, gettext(abook_fields[EMAIL].name));
-       if(extra_column > 0)
-               mvaddnstr(2, EXTRAPOS, gettext(abook_fields[extra_column].name),
-                               COLS-EXTRAPOS);
+
+       for(e = index_elements; e; e = e->next)
+               if(e->type == INDEX_TEXT)
+                       x_pos += strwidth(e->d.text);
+               else if(e->type == INDEX_FIELD) {
+                       get_field_info(e->d.field.id, NULL, &str, NULL);
+                       width = e->d.field.len ? abs(e->d.field.len) : strwidth(str);
+                       mvaddnstr(2, x_pos, str, width);
+                       x_pos += width;
+               } else
+                       assert(0);
+
 #if defined(A_BOLD) && defined(A_NORMAL)
        attrset(A_NORMAL);
 #endif
@@ -189,7 +331,7 @@ scroll_up()
 void
 scroll_down()
 {
-       if(curitem > items - 2)
+       if(curitem > db_n_items() - 2)
                return;
 
        curitem++;
@@ -213,12 +355,15 @@ page_up()
 void
 page_down()
 {
-       if(curitem > items - 2)
+       if(curitem > db_n_items() - 2)
                return;
 
-       curitem = curitem == LAST_LIST_ITEM ?
-               ((curitem += LIST_LINES) > LAST_ITEM ? LAST_ITEM : curitem) :
-               min(LAST_LIST_ITEM, LAST_ITEM);
+       if(curitem == LAST_LIST_ITEM) {
+               if((curitem += LIST_LINES) > last_item())
+                       curitem = last_item();
+       } else {
+               curitem = min(LAST_LIST_ITEM, last_item());
+       }
 
        refresh_list();
 }
@@ -226,13 +371,29 @@ page_down()
 void
 select_none()
 {
-        memset(selected, 0, items);
+        memset(selected, 0, db_n_items());
 }
 
 void
 select_all()
 {
-        memset(selected, 1, items);
+        memset(selected, 1, db_n_items());
+}
+
+void
+list_set_selection(int item, int value)
+{
+       assert(is_valid_item(item));
+
+       selected[item] = !!value;
+}
+
+void
+list_invert_curitem_selection()
+{
+       assert(is_valid_item(curitem));
+
+       selected[curitem] = !selected[curitem];
 }
 
 void
@@ -240,34 +401,40 @@ move_curitem(int direction)
 {
         list_item tmp;
 
-        if( curitem < 0 || curitem > LAST_ITEM )
+        if(curitem < 0 || curitem > last_item())
                 return;
 
-        itemcpy(tmp, database[curitem]);
-
-        switch(direction) {
-                case MOVE_ITEM_UP:
-                        if( curitem < 1 )
-                                return;
-                        itemcpy(database[curitem], database[curitem - 1]);
-                        itemcpy(database[curitem-1], tmp);
-                        scroll_up();
-                        break;
-
-                case MOVE_ITEM_DOWN:
-                        if( curitem >= LAST_ITEM )
-                                return;
-                        itemcpy(database[curitem], database[curitem + 1]);
-                        itemcpy(database[curitem+1], tmp);
-                        scroll_down();
-                        break;
-        }
+       tmp = item_create();
+       item_copy(tmp, db_item_get(curitem));
+
+       switch(direction) {
+               case MOVE_ITEM_UP:
+                       if( curitem < 1 )
+                               goto out_move;
+                       item_copy(db_item_get(curitem),
+                                       db_item_get(curitem - 1));
+                       item_copy(db_item_get(curitem-1), tmp);
+                       scroll_up();
+                       break;
+
+               case MOVE_ITEM_DOWN:
+                       if(curitem >= last_item())
+                               goto out_move;
+                       item_copy(db_item_get(curitem),
+                                       db_item_get(curitem + 1));
+                       item_copy(db_item_get(curitem + 1), tmp);
+                       scroll_down();
+                       break;
+       }
+
+out_move:
+       item_free(&tmp);
 }
 
 void
 goto_home()
 {
-       if(items > 0)
+       if(db_n_items() > 0)
                curitem = 0;
 
        refresh_list();
@@ -276,46 +443,18 @@ goto_home()
 void
 goto_end()
 {
-       if(items > 0)
-               curitem = LAST_ITEM;
+       if(db_n_items() > 0)
+               curitem = last_item();
 
        refresh_list();
 }
 
-
-void
-highlight_line(WINDOW *win, int line)
-{
-       wstandout(win);
-
-       /*
-        * this is a tricky one
-        */
-#if 0
-/*#ifdef mvwchgat*/
-       mvwchgat(win, line, 0, -1,  A_STANDOUT, 0, NULL);
-#else
-       /*
-        * buggy function: FIXME
-        */
-       scrollok(win, FALSE);
-       {
-               int i;
-               wmove(win, line, 0);
-               for(i = 0; i < COLS; i++)
-                       waddch(win, ' ');
-       /*wattrset(win, 0);*/
-       }
-       scrollok(win, TRUE);
-#endif
-}
-
 int
 selected_items()
 {
        int i, n = 0;
 
-       for(i = 0; i < items; i++)
+       for(i = 0; i < db_n_items(); i++)
                if(selected[i])
                        n++;
 
@@ -327,42 +466,48 @@ invert_selection()
 {
        int i;
 
-       if(items < 1)
+       if(list_is_empty())
                return;
 
-       for(i = 0; i < items; i++)
+       for(i = 0; i < db_n_items(); i++)
                selected[i] = !selected[i];
 }
 
 int
-list_current_item()
+list_is_empty()
 {
-       return curitem;
+       return db_n_items() < 1;
 }
 
 int
-list_is_empty()
+list_get_curitem()
+{
+       return curitem;
+}
+
+void
+list_set_curitem(int i)
 {
-       return items < 1;
+       curitem = i;
 }
 
 int
 duplicate_item()
 {
-       int i;
        list_item item;
-
+       
        if(curitem < 0)
                return 1;
 
-       for(i = 0; i < ITEM_FIELDS; i++)
-               item[i] = database[curitem][i] ? xstrdup(database[curitem][i]) :
-                       NULL;
-
-       if(add_item2database(item))
+       item = item_create();
+       item_duplicate(item, db_item_get(curitem));
+       if(add_item2database(item)) {
+               item_free(&item);
                return 1;
+       }
+       item_free(&item);
 
-       curitem = LAST_ITEM;
+       curitem = last_item();
        refresh_list();
 
        return 0;
diff --git a/list.h b/list.h
index ac8377f1228e734ffdd2ee9bfacc95e630604da5..45b00f832dc1be61435508c75a5425e350a175b1 100644 (file)
--- a/list.h
+++ b/list.h
@@ -3,10 +3,34 @@
 
 #include "ui.h"
 
+#define INDEX_TEXT  1
+#define INDEX_FIELD 2
+#define INDEX_ALT_FIELD 3
+
+struct index_elem {
+       int type;
+       union {
+               char *text;
+               struct {
+                       int id;
+                       int len;
+                       struct index_elem *next;
+               } field;
+       } d;
+       struct index_elem *next;
+};
+
+struct list_field {
+       char *data;
+       int type;
+};
+
+void           init_index();
 void           init_list();
+int            init_extra_field(enum str_opts option);
 void           close_list();
 void            refresh_list();
-void           print_list_line(int i, int line, int highlight);
+void   get_list_field(int item, struct index_elem *e, struct list_field *res);
 void           list_headerline();
 void            scroll_up();
 void            scroll_down();
@@ -14,14 +38,16 @@ void                page_up();
 void           page_down();
 void            select_none();
 void            select_all();
+void           set_selection(int item, int value);
+void           list_invert_curitem_selection();
 void            move_curitem(int direction);
 void           goto_home();
 void           goto_end();
-void           highlight_line(WINDOW *win, int line);
 int            selected_items();
 void           invert_selection();
-int            list_current_item();
 int            list_is_empty();
+int            list_get_curitem();
+void           list_set_curitem(int i);
 int            duplicate_item();
 
 
@@ -31,19 +57,11 @@ enum {
 };
 
 #define LIST_TOP        3
-#define LIST_BOTTOM     (LINES-2)
+#define LIST_BOTTOM     (LINES - 2)
 
-#define LIST_LINES     (LIST_BOTTOM-LIST_TOP)
+#define LIST_LINES     (LIST_BOTTOM - LIST_TOP)
 #define LIST_COLS      COLS
 
-#define NAMEPOS                2
-#define EMAILPOS        opt_get_int(INT_EMAILPOS)
-#define EXTRAPOS       opt_get_int(INT_EXTRAPOS)
-
-#define NAMELEN                (EMAILPOS-NAMEPOS -1)
-#define EMAILLEN        (EXTRAPOS-EMAILPOS -1)
-#define EXTRALEN       (COLS-EXTRAPOS)
-
-#define LAST_LIST_ITEM ( first_list_item + LIST_LINES - 1 )
+#define LAST_LIST_ITEM (first_list_item + LIST_LINES - 1)
 
 #endif
diff --git a/misc.c b/misc.c
index 9f0a0a3f6824dc88f7c28bdfacb35a1c4f2f7b16..d49980cf5f851c21836b3965c28014579ba16b8f 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1,6 +1,6 @@
 
 /*
- * $Id: misc.c,v 1.21 2005/10/05 11:03:36 jheinonen Exp $
+ * $Id: misc.c,v 1.23 2006/09/04 18:29:25 cduval Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
@@ -19,6 +19,7 @@
 #      include "config.h"
 #endif
 #include <mbswidth.h>
+#include "abook.h"
 #include "misc.h"
 #include "xmalloc.h"
 
@@ -63,6 +64,19 @@ strtrim(char *s)
        return s;
 }
 
+int
+is_number(char *p)
+{
+       if(!p || !*p || (*p == '-' && !*++p))
+               return 0;
+
+       for(; *p; p++)
+               if(!isdigit(*p))
+                       return 0;
+
+       return 1;
+}
+
 
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
@@ -1076,3 +1090,189 @@ int main (void)
 #endif /* SNPRINTF_TEST */
 
 #endif /* !HAVE_SNPRINTF */
+
+
+
+
+/*
+ * List handling functions
+ */
+
+void
+abook_list_append(abook_list **list, char *str)
+{
+       abook_list *tmp;
+
+       if(!str)
+               return;
+
+       for(tmp = *list; tmp && tmp->next; tmp = tmp->next)
+               ;
+
+       if(tmp) {
+               tmp->next = xmalloc(sizeof(abook_list));
+               tmp = tmp->next;
+       } else
+               tmp = *list = xmalloc(sizeof(abook_list));
+
+       tmp->data = xstrdup(str);
+       tmp->next = NULL;
+}
+
+void
+abook_list_free(abook_list **list)
+{
+       abook_list *prev = NULL, *tmp = *list;
+
+       if(!list)
+               return;
+
+       while(tmp) {
+               xfree(tmp->data);
+               prev = tmp;
+               tmp = tmp->next;
+               xfree(prev);
+       }
+
+       *list = NULL;
+}
+
+abook_list *
+csv_to_abook_list(char *str)
+{
+       char *start, *p = str, *end;
+       abook_list *list = NULL;
+
+       if(!str)
+               return NULL;
+
+       SKIPWS(p);
+       start = end = p;
+
+       while(*p) {
+               if(!strchr(", ", *p)) {
+                       end = ++p;
+                       continue;
+               }
+
+               if((*p == ',') && (end - start)) {
+                       abook_list_append(&list, xstrndup(start, end - start));
+                       p++;
+                       SKIPWS(p);
+                       start = end = p;
+                       continue;
+               }
+
+               p++;
+       }
+       if(end - start)
+               abook_list_append(&list, xstrndup(start, end - start));
+
+       return list;
+}
+
+char *
+abook_list_to_csv(abook_list *list)
+{
+       abook_list *tmp;
+       char *res = NULL;
+
+       for(tmp = list; tmp; tmp = tmp->next) {
+               if(tmp == list)
+                       res = xstrdup(tmp->data);
+               else {
+                       res = xrealloc(res, strlen(res)+strlen(tmp->data)+2);
+                       strcat(res, ",");
+                       strcat(res, tmp->data);
+               }
+       }
+
+       return res;
+}
+
+void
+abook_list_rotate(abook_list **list, enum rotate_dir dir)
+{
+       abook_list *tmp = *list;
+
+       if(!tmp || !tmp->next)
+               return;
+
+       switch(dir) {
+               case ROTATE_LEFT:
+                       for(; tmp && tmp->next; tmp = tmp->next)
+                               ;
+
+                       tmp->next = *list;
+                       tmp = *list;
+                       *list = (*list)->next;
+                       tmp->next = NULL;
+                       break;
+               case ROTATE_RIGHT:
+                       for(; tmp && tmp->next && tmp->next->next;
+                                       tmp = tmp->next)
+                               ;
+
+                       tmp->next->next = *list;
+                       *list = tmp->next;
+                       tmp->next = NULL;
+                       break;
+               default:
+                       assert(0);
+       }
+}
+
+/* if str == NULL, deleting the list element */
+void
+abook_list_replace(abook_list **list, int index, char *str)
+{
+       abook_list *cur, *prev;
+       int i = 0;
+
+       cur = prev = *list;
+
+       if((index == 0) && !str) {
+               *list = cur->next;
+               free(cur->data);
+               free(cur);
+               return;
+       }
+       
+       while(1) {
+               if(!cur)
+                       return;
+
+               if(i == index)
+                       break;
+
+               prev = cur;
+               cur = cur->next;
+               i++;
+       }
+
+       if(str) {
+               free(cur->data);
+               cur->data = xstrdup(str);
+       } else {
+               prev->next = cur->next;
+               free(cur->data);
+               free(cur);
+       }
+}
+
+abook_list *
+abook_list_get(abook_list *list, int index)
+{
+       int i = 0;
+
+       while(1) {
+               if(!list)
+                       return NULL;
+
+               if(i == index)
+                       return list;
+
+               i++;
+               list = list->next;
+       }
+}
diff --git a/misc.h b/misc.h
index b40a4a1af9ca435186389e469292811af6ded909..fadd0ae072717bf2c31506dfdc0b1fd537f2a284 100644 (file)
--- a/misc.h
+++ b/misc.h
@@ -1,11 +1,23 @@
 #ifndef _MISC_H
 #define _MISC_H
 
+typedef struct abook_list_t {
+       char *data;
+       struct abook_list_t *next;
+} abook_list;
+
+enum rotate_dir {
+       ROTATE_LEFT,
+       ROTATE_RIGHT
+};
+
 char           *revstr(char *str);
 char           *strupper(char *str);
 char           *strlower(char *str);
 char           *strtrim(char *);
 
+int            is_number(char *s);
+
 char           *strdup_printf(const char *format, ... );
 char           *strconcat(const char *str, ...);
 
@@ -20,6 +32,16 @@ int          strwidth(const char *s);
 int            bytes2width(const char *s, int width);
 
 
+void           abook_list_append(abook_list **list, char *str);
+void           abook_list_free(abook_list **list);
+char           *abook_list_to_csv(abook_list *list);
+abook_list     *csv_to_abook_list(char *str);
+void           abook_list_rotate(abook_list **list, enum rotate_dir dir);
+void           abook_list_replace(abook_list **list, int index, char *str);
+abook_list     *abook_list_get(abook_list *list, int index);
+#define        abook_list_delete(list, index) abook_list_replace(list, index, NULL)
+
+
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
 #endif
@@ -34,3 +56,6 @@ int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
 #endif
 
 #endif
+
+
+
index 3b8c338b059c316796ebb2a7a3a38e9b371ed89a..92d56703c22d1782728aa895597f83f41e3b87df 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1,6 +1,6 @@
 
 /*
- * $Id: options.c,v 1.27.4.1 2006/04/09 18:57:34 jheinonen Exp $
+ * $Id: options.c,v 1.33 2006/09/06 08:48:33 jheinonen Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
@@ -17,6 +17,7 @@
 #include "abook.h"
 #include "gettext.h"
 #include "misc.h"
+#include "views.h"
 #include "xmalloc.h"
 
 #ifndef FALSE
@@ -49,11 +50,7 @@ static struct option abook_vars[] = {
        { "autosave", OT_BOOL, BOOL_AUTOSAVE, TRUE },
 
        { "show_all_emails", OT_BOOL, BOOL_SHOW_ALL_EMAILS, TRUE },
-       { "emailpos", OT_INT, INT_EMAILPOS, 25 },
-       { "extra_column", OT_STR, STR_EXTRA_COLUMN, UL "phone" },
-       { "extra_alternative", OT_STR, STR_EXTRA_ALTERNATIVE, UL "-1" },
-       { "extrapos", OT_INT, INT_EXTRAPOS, 65 },
-
+       { "index_format", OT_STR, STR_INDEX_FORMAT, UL " {name:22} {email:40} {phone:12|workphone|mobile}" },
        { "mutt_command", OT_STR, STR_MUTT_COMMAND, UL "mutt" },
        { "mutt_return_all_emails", OT_BOOL, BOOL_MUTT_RETURN_ALL_EMAILS,
                TRUE },
@@ -67,6 +64,7 @@ static struct option abook_vars[] = {
        { "use_ascii_only", OT_BOOL, BOOL_USE_ASCII_ONLY, FALSE },
 
        { "add_email_prevent_duplicates", OT_BOOL, BOOL_ADD_EMAIL_PREVENT_DUPLICATES, FALSE },
+       { "preserve_fields", OT_STR, STR_PRESERVE_FIELDS, UL "standard" },
        { "sort_field", OT_STR, STR_SORT_FIELD, UL "nick" },
        { "show_cursor", OT_BOOL, BOOL_SHOW_CURSOR, FALSE },
 
@@ -206,36 +204,87 @@ opt_line_remove_comments(char *p)
        }
 }
 
-void
-find_token_start(buffer *b)
+/* After calling,
+ * - b->data points to the found token, or NULL is end of parsing
+ * - b->ptr  points to the begining of next token
+ *
+ * If the TOKEN_ALLOC option is used, the original string is not mangled
+ * and memory is allocated for the token.
+ */
+static char *
+get_token(buffer *b, int options)
 {
+       char quote = 0, c;
+       char *end = NULL;
+
        assert(b);
 
-       for(; ISSPACE(*b -> ptr); b -> ptr ++);
-}
+       SKIPWS(b->ptr);
+       if(*b->ptr && strchr("\"'", *b->ptr))
+               quote = *(b->ptr++);
+       b->data = b->ptr;
 
-void
-find_token_end(buffer *b)
-{
-       assert(b);
+       while(1) {
+               if(!(c = *b->ptr)) {
+                       end = b->ptr;
+                       break;
+               }
 
-       for(find_token_start(b); *(b -> ptr); b -> ptr ++) {
-               if(ISSPACE(*(b -> ptr))) {
+               if(!quote && (
+                               ISSPACE(c) ||
+                               ((options & TOKEN_EQUAL) && (c == '=')) ||
+                               ((options & TOKEN_COMMA) && (c == ',')))
+                               ) {
+                       end = b->ptr;
+                       break;
+               } else if(c == quote) {
+                       quote = 0;
+                       end = b->ptr++;
                        break;
                }
+
+               b->ptr++;
+       }
+
+       if(quote)
+               return _("quote mismatch");
+
+       if(options & (TOKEN_EQUAL | TOKEN_COMMA))
+               SKIPWS(b->ptr); /* whitespaces can precede the sign */
+
+       if((options & TOKEN_EQUAL) && (*b->ptr != '='))
+               return _("no assignment character found");
+
+       if((options & TOKEN_COMMA) && *b->ptr && (*b->ptr != ','))
+               return _("error in comma separated list");
+
+       if(b->ptr == b->data) {
+               b->data = NULL;
+               return NULL; /* no error, just end of parsing */
        }
+
+       if(options & TOKEN_ALLOC) /* freeing is the caller's responsibility */
+               b->data = xstrndup(b->data, end - b->data);
+       else
+               *end = 0;
+
+       b->ptr++; /* advance to next token */
+       SKIPWS(b->ptr);
+
+       return NULL;
 }
 
 static const char *
-opt_set_set_option(char *var, char *p, struct option *opt)
+opt_set_set_option(char *p, struct option *opt)
 {
        int len;
 
-       strtrim(p);
+       assert(p);
 
+       strtrim(p);
        len = strlen(p);
 
-       if(p[len - 1] == '\"' && *p == '\"') {
+       if(*p == '\"' && p[len - 1] == '\"') {
                if(len < 3)
                        return _("invalid value");
                p[len - 1] = 0;
@@ -266,59 +315,142 @@ opt_set_set_option(char *var, char *p, struct option *opt)
 }
 
 static const char *
-opt_parse_set(buffer *b)
+opt_set_option(char *var, char *p)
 {
        int i;
-       char *p;
-
-       find_token_start(b);
-       if((p = strchr(b -> ptr, '=')))
-               *p++ = 0;
-       else
-               return _("invalid value assignment");
 
-       strtrim(b -> ptr);
+       assert(var);
+       assert(p);
 
-       for(i = 0;abook_vars[i].option; i++)
-               if(!strcmp(abook_vars[i].option, b -> ptr))
-                       return opt_set_set_option(b -> ptr, p, &abook_vars[i]);
+       for(i = 0; abook_vars[i].option; i++)
+               if(!strcmp(abook_vars[i].option, var))
+                       return opt_set_set_option(p, &abook_vars[i]);
 
        return _("unknown option");
 }
 
-#include "database.h" /* needed for change_custom_field_name */
+static int
+check_options()
+{
+       char *str;
+       int err = 0;
+
+       str = opt_get_str(STR_PRESERVE_FIELDS);
+       if(strcasecmp(str, "all") && strcasecmp(str, "none") &&
+                       strcasecmp(str, "standard")) {
+               fprintf(stderr, _("valid values for the 'preserve_fields' "
+                                       "option are 'all', 'standard' "
+                                       "(default), and 'none'\n"));
+               restore_default(&abook_vars[STR_PRESERVE_FIELDS]);
+               err++;
+       }
+       str = opt_get_str(STR_ADDRESS_STYLE);
+       if(strcasecmp(str, "eu") && strcasecmp(str, "uk") &&
+                       strcasecmp(str, "us")) {
+               fprintf(stderr, _("valid values for the 'address_style' "
+                                       "option are 'eu' (default), 'uk', "
+                                       "and 'us'\n"));
+               restore_default(&abook_vars[STR_ADDRESS_STYLE]);
+               err++;
+       }
+
+       return err;
+}
+
+/*
+ * syntax: set <option> = <value>
+ */
+static const char *
+opt_parse_set(buffer *b)
+{
+       char *var, *err;
+
+       if((err = get_token(b, TOKEN_EQUAL)))
+               return err;
+
+       if((var = b->data) == NULL)
+               return _("invalid value assignment");
+
+       return opt_set_option(var, b->ptr);
+}
 
 static const char *
 opt_parse_customfield(buffer *b)
 {
-       char *p, num[5];
-       int n;
-       size_t len;
+       return _("customfield: obsolete command - please use the "
+                       "'field' and 'view' commands instead");
+}
+
+#include "views.h" /* needed for add_field_to_view */
+
+/*
+ * syntax: view <tab name> = <field1> [ , <field2>, ... ]
+ */
+static const char *
+opt_parse_view(buffer *b)
+{
+       char *err, *view;
+
+       if((err = get_token(b, TOKEN_EQUAL)))
+               return err;
+
+       if((view = b->data) == NULL)
+               return _("no view name provided");
 
-       find_token_start(b);
-       p = b -> ptr;
-       find_token_end(b);
+       while(1) {
+               if((err = get_token(b, TOKEN_COMMA)))
+                       return err;
 
-       memset(num, 0, sizeof(num));
+               if(b->data == NULL)
+                       break;
+
+               if((err = add_field_to_view(view, b->data)))
+                       return err;
+       }
+
+       return NULL;
+}
+
+#include "database.h" /* needed for declare_new_field */
+
+/*
+ * syntax: field <identifier> = <human readable name> [ , <type> ]
+ */
+static const char *
+opt_parse_field(buffer *b)
+{
+       char *err, *field, *name;
+
+       if((err = get_token(b, TOKEN_EQUAL)))
+               return err;
 
-       len = (b -> ptr - p);
-       strncpy(num, p, min(sizeof(num) - 1, len));
-       n = safe_atoi(num);
+       if((field = b->data) == NULL)
+               return _("no field identifier provided");
 
-       find_token_start(b);
+       if((err = get_token(b, TOKEN_COMMA)))
+               return err;
 
-       if(change_custom_field_name(b->ptr, n) == -1)
-               return _("invalid custom field number");
+       if((name = b->data) == NULL)
+               return _("no field name provided");
+
+       if((err = declare_new_field(field,
+                                       name,
+                                       b->ptr,
+                                       0 /* reject "standard" fields */)))
+               return err;
 
        return NULL;
 }
 
+
 static struct {
        char *token;
        const char * (*func) (buffer *line);
 } opt_parsers[] = {
        { "set", opt_parse_set },
-       { "customfield", opt_parse_customfield },
+       { "customfield", opt_parse_customfield }, /* obsolete */
+       { "view", opt_parse_view },
+       { "field", opt_parse_field },
        { NULL }
 };
 
@@ -334,12 +466,12 @@ opt_parse_line(char *line, int n, char *fn)
 
        b.ptr = line;
 
-       find_token_start(&b);
-       b.data = b.ptr;
-       find_token_end(&b);
-       *b.ptr++ = 0;
+       if((err = get_token(&b, 0))) {
+               fprintf(stderr, "%s\n", err);
+               return FALSE;
+       }
 
-       if(!*line)
+       if(b.data == NULL)
                return FALSE;
 
        strtrim(b.data);
@@ -375,7 +507,6 @@ load_opts(char *filename)
        if((in = fopen(filename, "r")) == NULL)
                return -1;
 
-
        for(n = 1;!feof(in); n++) {
                line = getaline(in);
 
@@ -394,6 +525,11 @@ load_opts(char *filename)
 
        free(line);
 
+       /* post-initialization */
+       err += check_options();
+       if(!strcasecmp(opt_get_str(STR_PRESERVE_FIELDS), "standard"))
+               init_standard_fields();
+
        return err;
 }
 
index 73b300cdf59cbcaffeb48e8f2ecf44de9f67d05e..138efc2fcaa13fe6ce124fea894140df4ebe7faa 100644 (file)
--- a/options.h
+++ b/options.h
@@ -8,9 +8,16 @@ typedef int bool;
 #endif
 
 /*
- * bool options
+ * token parsing options
  */
 
+#define TOKEN_ALLOC (1<<1) /* allocate memory for the token */
+#define TOKEN_EQUAL (1<<2) /* left hand value of assignment */
+#define TOKEN_COMMA (1<<3) /* comma is a separator */
+
+/*
+ * bool options
+ */
 
 enum bool_opts {
        BOOL_AUTOSAVE,
@@ -39,10 +46,12 @@ enum int_opts {
 enum str_opts {
        STR_EXTRA_COLUMN,
        STR_EXTRA_ALTERNATIVE,
+       STR_INDEX_FORMAT,
        STR_MUTT_COMMAND,
        STR_PRINT_COMMAND,
        STR_WWW_COMMAND,
        STR_ADDRESS_STYLE,
+       STR_PRESERVE_FIELDS,
        STR_SORT_FIELD,
        STR_MAX
 };
index 4457703dbab7e4e0d178fdc1eb3d66948e610fac..4f86c18b9c6238a7750e5fcaaa37ee6e0ce0d0db 100644 (file)
@@ -1,2 +1,2 @@
 # Set of available languages
-de fr ja sv
+de fr it ja sv
index 896137a8ae350ef3ac8596ae697231cd3a81590a..e4a3c6ed656cce8bc898ce7b723a9664fb8d1a4e 100644 (file)
@@ -24,6 +24,7 @@ VPATH = @srcdir@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 datadir = @datadir@
+datarootdir = @datarootdir@
 localedir = @localedir@
 gettextsrcdir = $(datadir)/gettext/po
 
index b1e0b766e5a87c48f32e08a1f983be8bd388c5cc..34f1debd8736fa80143eb1c9dda6b7245500a7a1 100644 (file)
@@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Free Software Foundation, Inc.
 # It can be your email address, or a mailing list address where translators
 # can write to without being subscribed, or the URL of a web page through
 # which the translators can contact you.
-MSGID_BUGS_ADDRESS = <cedricduval+abook@free.fr>
+MSGID_BUGS_ADDRESS = <abook-devel@lists.sourceforge.net>
 
 # This is the list of locale categories, beyond LC_MESSAGES, for which the
 # message catalogs shall be used.  It is usually empty.
index d88f435ea6751d076a80fd598d66c7f6454a3f7a..b23c8f5160fd90286c995d829ff2ec1b7f9d8378 100644 (file)
@@ -9,3 +9,4 @@ help.h
 list.c
 options.c
 ui.c
+views.c
index f68b46e631b186dc6c3876f3039b9602f22ad6d0..e98a57060f2e2cfba7d8753b20012e6ea1874fa5 100644 (file)
@@ -7,8 +7,8 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: <cedricduval+abook@free.fr>\n"
-"POT-Creation-Date: 2005-12-06 07:50+0200\n"
+"Report-Msgid-Bugs-To: <abook-devel@lists.sourceforge.net>\n"
+"POT-Creation-Date: 2006-09-06 17:14+0300\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,219 +16,219 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: abook.c:91
+#: abook.c:93
 #, c-format
 msgid "Cannot create directory %s\n"
 msgstr ""
 
-#: abook.c:97
+#: abook.c:99
 #, c-format
 msgid "%s is not a directory\n"
 msgstr ""
 
-#: abook.c:115
+#: abook.c:117
 #, c-format
 msgid "Memory allocation failure: %s\n"
 msgstr ""
 
-#: abook.c:126
+#: abook.c:128
 #, c-format
 msgid "Press enter to continue...\n"
 msgstr ""
 
-#: abook.c:138
+#: abook.c:143
 #, c-format
 msgid "File %s is not writeable"
 msgstr ""
 
-#: abook.c:143
+#: abook.c:148
 msgid "If you continue all changes will be lost. Do you want to continue?"
 msgstr ""
 
-#: abook.c:162
+#: abook.c:167
 msgid "Save database"
 msgstr ""
 
-#: abook.c:164
+#: abook.c:169
 msgid "Quit without saving"
 msgstr ""
 
-#: abook.c:218
+#: abook.c:225
 #, c-format
 msgid "%s is not a valid HOME directory\n"
 msgstr ""
 
-#: abook.c:249
+#: abook.c:256
 #, c-format
 msgid ""
 "Cannot combine options --mutt-query, --convert, --add-email or --add-email-"
 "quiet\n"
 msgstr ""
 
-#: abook.c:280
+#: abook.c:287
 #, c-format
 msgid "please use option --%s after --convert option\n"
 msgstr ""
 
-#: abook.c:379
+#: abook.c:386
 #, c-format
 msgid "%s: unrecognized arguments on command line\n"
 msgstr ""
 
-#: abook.c:401
+#: abook.c:408
 msgid "     -h\t--help\t\t\t\tshow usage"
 msgstr ""
 
-#: abook.c:402
+#: abook.c:409
 msgid "     -C\t--config\t<file>\t\tuse an alternative configuration file"
 msgstr ""
 
-#: abook.c:403
+#: abook.c:410
 msgid "\t--datafile\t<file>\t\tuse an alternative addressbook file"
 msgstr ""
 
-#: abook.c:404
+#: abook.c:411
 msgid "\t--mutt-query\t<string>\tmake a query for mutt"
 msgstr ""
 
-#: abook.c:405
+#: abook.c:412
 msgid ""
 "\t--add-email\t\t\tread an e-mail message from stdin and\n"
 "\t\t\t\t\tadd the sender to the addressbook"
 msgstr ""
 
-#: abook.c:409
+#: abook.c:416
 msgid ""
 "\t--add-email-quiet\t\tsame as --add-email but doesn't\n"
 "\t\t\t\t\trequire to confirm adding"
 msgstr ""
 
-#: abook.c:413
+#: abook.c:420
 msgid "\t--convert\t\t\tconvert address book files"
 msgstr ""
 
-#: abook.c:414
+#: abook.c:421
 msgid "\toptions to use with --convert:"
 msgstr ""
 
-#: abook.c:415
+#: abook.c:422
 msgid "\t--informat\t<format>\tformat for input file"
 msgstr ""
 
-#: abook.c:416
+#: abook.c:423
 msgid "\t\t\t\t\t(default: abook)"
 msgstr ""
 
-#: abook.c:417
+#: abook.c:424
 msgid "\t--infile\t<file>\t\tsource file"
 msgstr ""
 
-#: abook.c:418
+#: abook.c:425
 msgid "\t\t\t\t\t(default: stdin)"
 msgstr ""
 
-#: abook.c:419
+#: abook.c:426
 msgid "\t--outformat\t<format>\tformat for output file"
 msgstr ""
 
-#: abook.c:420
+#: abook.c:427
 msgid "\t\t\t\t\t(default: text)"
 msgstr ""
 
-#: abook.c:421
+#: abook.c:428
 msgid "\t--outfile\t<file>\t\tdestination file"
 msgstr ""
 
-#: abook.c:422
+#: abook.c:429
 msgid "\t\t\t\t\t(default: stdout)"
 msgstr ""
 
-#: abook.c:423
+#: abook.c:430
 msgid "\t--formats\t\t\tlist available formats"
 msgstr ""
 
-#: abook.c:494
+#: abook.c:501
 #, c-format
 msgid "Cannot open database\n"
 msgstr ""
 
-#: abook.c:620
+#: abook.c:627
 #, c-format
 msgid "too few arguments to make conversion\n"
 msgstr ""
 
-#: abook.c:621
+#: abook.c:628
 #, c-format
 msgid "try --help\n"
 msgstr ""
 
-#: abook.c:626
+#: abook.c:633
 #, c-format
 msgid ""
 "input and output formats are the same\n"
 "exiting...\n"
 msgstr ""
 
-#: abook.c:639
+#: abook.c:647
 #, c-format
 msgid "input format %s not supported\n"
 msgstr ""
 
-#: abook.c:643
+#: abook.c:651
 #, c-format
 msgid "cannot read file %s\n"
 msgstr ""
 
-#: abook.c:652
+#: abook.c:660
 #, c-format
 msgid "output format %s not supported\n"
 msgstr ""
 
-#: abook.c:658
+#: abook.c:666
 #, c-format
 msgid "cannot write file %s\n"
 msgstr ""
 
-#: abook.c:679
+#: abook.c:687
 #, c-format
 msgid "cannot open %s\n"
 msgstr ""
 
-#: abook.c:682
+#: abook.c:690
 #, c-format
 msgid "%d item(s) added to %s\n"
 msgstr ""
 
-#: abook.c:684
+#: abook.c:692
 msgid "Valid sender address not found"
 msgstr ""
 
-#: abook.c:724
+#: abook.c:732
 #, c-format
 msgid "Address %s already in addressbook\n"
 msgstr ""
 
-#: abook.c:734
+#: abook.c:742
 #, c-format
 msgid ""
 "cannot open /dev/tty\n"
 "you may want to use --add-email-quiet\n"
 msgstr ""
 
-#: abook.c:740
+#: abook.c:748
 #, c-format
 msgid "Add \"%s <%s>\" to %s? (%c/%c)\n"
 msgstr ""
 
-#: abook.c:744 abook.c:751 ui.c:344 ui.c:606
+#: abook.c:752 abook.c:759 ui.c:343 ui.c:609
 msgid "keybinding for yes|y"
 msgstr ""
 
-#: abook.c:745 abook.c:747 ui.c:342
+#: abook.c:753 abook.c:755 ui.c:341
 msgid "keybinding for no|n"
 msgstr ""
 
-#: abook.c:771
+#: abook.c:780
 #, c-format
 msgid "stdin is a directory or cannot stat stdin\n"
 msgstr ""
@@ -237,120 +237,145 @@ msgstr ""
 msgid "q:quit  ?:help  a:add  r:remove"
 msgstr ""
 
-#: database.c:57
+#: database.c:45
 msgid "Name"
 msgstr ""
 
-#: database.c:58
-msgid "E-mails"
+#: database.c:46
+msgid "E-mail addresses"
 msgstr ""
 
-#: database.c:59
+#: database.c:47
 msgid "Address"
 msgstr ""
 
-#: database.c:60
+#: database.c:48
 msgid "Address2"
 msgstr ""
 
-#: database.c:61
+#: database.c:49
 msgid "City"
 msgstr ""
 
-#: database.c:62
+#: database.c:50
 msgid "State/Province"
 msgstr ""
 
-#: database.c:63
+#: database.c:51
 msgid "ZIP/Postal Code"
 msgstr ""
 
-#: database.c:64
+#: database.c:52
 msgid "Country"
 msgstr ""
 
-#: database.c:65
+#: database.c:53
 msgid "Home Phone"
 msgstr ""
 
-#: database.c:66
+#: database.c:54
 msgid "Work Phone"
 msgstr ""
 
-#: database.c:67
+#: database.c:55
 msgid "Fax"
 msgstr ""
 
-#: database.c:68
+#: database.c:56
 msgid "Mobile"
 msgstr ""
 
-#: database.c:69
+#: database.c:57
 msgid "Nickname/Alias"
 msgstr ""
 
-#: database.c:70
+#: database.c:58
 msgid "URL"
 msgstr ""
 
-#: database.c:71
+#: database.c:59
 msgid "Notes"
 msgstr ""
 
-#: database.c:72
-msgid "Custom1"
+#: database.c:60
+msgid "Anniversary day"
 msgstr ""
 
-#: database.c:73
-msgid "Custom2"
+#: database.c:166
+msgid "field already defined"
 msgstr ""
 
-#: database.c:74
-msgid "Custom3"
+#: database.c:170
+msgid "standard field does not need to be declared"
 msgstr ""
 
-#: database.c:75
-msgid "Custom4"
+#: database.c:185
+msgid "unknown type"
 msgstr ""
 
-#: database.c:76
-msgid "Custom5"
+#: database.c:585
+msgid "Invalid field value defined in configuration"
 msgstr ""
 
-#: database.c:424
-msgid "Invalid field value defined in configuration"
+#: database.c:588
+msgid "Invalid field value for sorting"
 msgstr ""
 
-#: edit.c:44
-msgid "CONTACT"
+#: edit.c:51
+msgid "Tab name too wide for screen"
 msgstr ""
 
-#: edit.c:45
-msgid "ADDRESS"
+#: edit.c:353
+msgid "keybindings_new_123456789|n123456789"
 msgstr ""
 
-#: edit.c:46
-msgid " PHONE "
+#: edit.c:355
+#, c-format
+msgid "Choose %s to modify (<1>%s%c%s%s."
 msgstr ""
 
-#: edit.c:47
-msgid " OTHER "
+#: edit.c:356
+msgid "email"
 msgstr ""
 
-#: edit.c:48
-msgid "CUSTOM "
+#: edit.c:356
+msgid "item"
 msgstr ""
 
-#: edit.c:57
-msgid "Tab name too wide for screen"
+#: edit.c:361
+msgid " or <n>ew"
+msgstr ""
+
+#: edit.c:379
+msgid "E-mail: "
+msgstr ""
+
+#: edit.c:379
+msgid "Item: "
+msgstr ""
+
+#: edit.c:465
+msgid "Day: "
+msgstr ""
+
+#: edit.c:465
+msgid "Month: "
+msgstr ""
+
+#: edit.c:465
+msgid "Year (optional): "
+msgstr ""
+
+#: edit.c:498
+msgid "Invalid date"
 msgstr ""
 
-#: edit.c:224
-msgid "E-mail addresses:"
+#: edit.c:653
+msgid "Name: "
 msgstr ""
 
-#: edit.h:13
-msgid "?:help c:contact a:address p:phone o:other"
+#: edit.h:14
+msgid "?:help q:quit editor"
 msgstr ""
 
 #: filter.c:71 filter.c:82
@@ -409,54 +434,63 @@ msgstr ""
 msgid "Spruce address book"
 msgstr ""
 
-#: filter.c:107
+#: filter.c:95
+msgid "BSD calendar"
+msgstr ""
+
+#: filter.c:108
 msgid "input:"
 msgstr ""
 
-#: filter.c:114
+#: filter.c:115
 msgid "output:"
 msgstr ""
 
-#: filter.c:179
+#: filter.c:180
 msgid "import database"
 msgstr ""
 
-#: filter.c:181 filter.c:298
+#: filter.c:182 filter.c:299
 msgid "please select a filter"
 msgstr ""
 
-#: filter.c:189 filter.c:306
+#: filter.c:190 filter.c:307
 msgid "x -\tcancel"
 msgstr ""
 
-#: filter.c:210 filter.c:344
+#: filter.c:211 filter.c:345
 msgid "Filename: "
 msgstr ""
 
-#: filter.c:217
+#: filter.c:218
 msgid "Error occured while opening the file"
 msgstr ""
 
-#: filter.c:219
+#: filter.c:220
 msgid "File does not seem to be a valid addressbook"
 msgstr ""
 
-#: filter.c:296
+#: filter.c:297
 msgid "export database"
 msgstr ""
 
-#: filter.c:329
+#: filter.c:330
 msgid "Export <a>ll, export <s>elected, or <c>ancel?"
 msgstr ""
 
-#: filter.c:330 ui.c:629
+#: filter.c:331 ui.c:632
 msgid "keybindings:all/selected/cancel|asc"
 msgstr ""
 
-#: filter.c:351
+#: filter.c:352
 msgid "Error occured while exporting"
 msgstr ""
 
+#: filter.c:1896
+#, c-format
+msgid "%02d/%02d\tAnniversary of %s\n"
+msgstr ""
+
 #: help.h:11
 msgid "\t?\t\thelp\n"
 msgstr ""
@@ -578,122 +612,222 @@ msgid "\tv\t\tview URL with web browser\n"
 msgstr ""
 
 #: help.h:55
-msgid "\ta,c,p,o,C/arrows/h,l\tchange tab\n"
+msgid "\tarrows/h,l\t\tchange tab\n"
 msgstr ""
 
 #: help.h:57
-msgid "\t1 - 5\t\t\tedit fields\n"
+msgid "\tq\t\t\tquit to main screen\n"
 msgstr ""
 
 #: help.h:59
-msgid "\tk or <\t\t\tprevious item\n"
+msgid "\t1 - 5 A - Z\t\tedit fields\n"
 msgstr ""
 
-#: help.h:60
-msgid "\tj or >\t\t\tnext item\n"
+#: help.h:61
+msgid "\tk or <\t\t\tprevious item\n"
 msgstr ""
 
 #: help.h:62
-msgid "\tr\t\t\troll e-mail addresses\n"
+msgid "\tj or >\t\t\tnext item\n"
 msgstr ""
 
 #: help.h:64
+msgid "\tr\t\t\troll e-mail addresses up\n"
+msgstr ""
+
+#: help.h:65
+msgid "\tESC-r\t\t\troll e-mail addresses down\n"
+msgstr ""
+
+#: help.h:67
 msgid "\tu\t\t\tundo\n"
 msgstr ""
 
-#: help.h:66
+#: help.h:69
 msgid "\tm\t\t\tsend mail with mutt\n"
 msgstr ""
 
-#: help.h:67
+#: help.h:70
 msgid "\tv\t\t\tview url with web browser\n"
 msgstr ""
 
-#: options.c:240 options.c:259
+#: options.c:250
+msgid "quote mismatch"
+msgstr ""
+
+#: options.c:256
+msgid "no assignment character found"
+msgstr ""
+
+#: options.c:259
+msgid "error in comma separated list"
+msgstr ""
+
+#: options.c:289 options.c:308
 msgid "invalid value"
 msgstr ""
 
-#: options.c:278
+#: options.c:329
+msgid "unknown option"
+msgstr ""
+
+#: options.c:341
+#, c-format
+msgid ""
+"valid values for the 'preserve_fields' option are 'all', "
+"'standard' (default), and 'none'\n"
+msgstr ""
+
+#: options.c:350
+#, c-format
+msgid ""
+"valid values for the 'address_style' option are 'eu' (default), 'uk', and "
+"'us'\n"
+msgstr ""
+
+#: options.c:372
 msgid "invalid value assignment"
 msgstr ""
 
-#: options.c:286
-msgid "unknown option"
+#: options.c:380
+msgid ""
+"customfield: obsolete command - please use the 'field' and 'view' commands "
+"instead"
+msgstr ""
+
+#: options.c:398
+msgid "no view name provided"
 msgstr ""
 
-#: options.c:311
-msgid "invalid custom field number"
+#: options.c:428
+msgid "no field identifier provided"
 msgstr ""
 
-#: options.c:358
+#: options.c:434
+msgid "no field name provided"
+msgstr ""
+
+#: options.c:490
 #, c-format
 msgid "%s: parse error at line %d: "
 msgstr ""
 
-#: options.c:362
+#: options.c:494
 #, c-format
 msgid "unknown token %s\n"
 msgstr ""
 
-#: ui.c:146
+#: ui.c:145
 #, c-format
 msgid "Your terminal size is %dx%d\n"
 msgstr ""
 
-#: ui.c:147
+#: ui.c:146
 #, c-format
 msgid "Terminal is too small. Minimum terminal size for abook is %dx%d\n"
 msgstr ""
 
-#: ui.c:333
+#: ui.c:332
 msgid " (Y/n)?"
 msgstr ""
 
-#: ui.c:333
+#: ui.c:332
 msgid " (y/N)?"
 msgstr ""
 
-#: ui.c:411
+#: ui.c:410
 msgid "help"
 msgstr ""
 
-#: ui.c:420
+#: ui.c:419
 msgid "Press any key to continue..."
 msgstr ""
 
-#: ui.c:541
+#: ui.c:539
 msgid "Remove selected item(s)"
 msgstr ""
 
-#: ui.c:551
+#: ui.c:549
 msgid "Clear WHOLE database"
 msgstr ""
 
-#: ui.c:579
+#: ui.c:582
 msgid "Search hit bottom, continuing at top"
 msgstr ""
 
-#: ui.c:604
+#: ui.c:607
 #, c-format
 msgid "Your current data will be lost - Press '%c' to continue"
 msgstr ""
 
-#: ui.c:629
+#: ui.c:632
 msgid "Print <a>ll, print <s>elected, or <c>ancel?"
 msgstr ""
 
-#: ui.c:635
+#: ui.c:638
 msgid "No selected items"
 msgstr ""
 
-#: ui.c:661
+#: ui.c:664
 msgid "File to open: "
 msgstr ""
 
-#: ui.c:671
+#: ui.c:674
 msgid "Save current database"
 msgstr ""
 
-#: ui.c:679
+#: ui.c:682
 msgid "Sorry, the specified file appears not to be a valid abook addressbook"
 msgstr ""
+
+#: views.c:87
+msgid "undeclared field"
+msgstr ""
+
+#: views.c:92
+msgid "maximal number of fields per view reached"
+msgstr ""
+
+#: views.c:95
+msgid "field already in this view"
+msgstr ""
+
+#: views.c:139
+msgid "CONTACT"
+msgstr ""
+
+#: views.c:140
+msgid "ADDRESS"
+msgstr ""
+
+#: views.c:142
+msgid "PHONE"
+msgstr ""
+
+#: views.c:143
+msgid "OTHER"
+msgstr ""
+
+#: views.c:165 views.c:166 views.c:167 views.c:168 views.c:169
+msgid "CUSTOM"
+msgstr ""
+
+#: views.c:165
+msgid "Custom1"
+msgstr ""
+
+#: views.c:166
+msgid "Custom2"
+msgstr ""
+
+#: views.c:167
+msgid "Custom3"
+msgstr ""
+
+#: views.c:168
+msgid "Custom4"
+msgstr ""
+
+#: views.c:169
+msgid "Custom5"
+msgstr ""
index 3fe1872864821a4865a48f1a3a1deea76138f6a6..54ac034dbb0b6452574f85356a108b21f5539154 100644 (file)
Binary files a/po/de.gmo and b/po/de.gmo differ
index 13647d44376049e55ff70b78e16bb77ed9cf08a5..21d4caca190457ac2c67bd3c7a99343954624729 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -2,13 +2,14 @@
 # Copyright (C) 2005 Free Software Foundation, Inc.
 # This file is distributed under the same license as the abook package.
 # Johannes Weißl <jargon@molb.org>, 2005.
+# Gerfried Fuchs <alfie@ist.org>, 2006.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: abook 0.5.5pre1\n"
-"Report-Msgid-Bugs-To: <cedricduval+abook@free.fr>\n"
-"POT-Creation-Date: 2005-12-06 07:50+0200\n"
-"PO-Revision-Date: 2005-10-03 00:56+0200\n"
+"Report-Msgid-Bugs-To: <abook-devel@lists.sourceforge.net>\n"
+"POT-Creation-Date: 2006-09-06 17:14+0300\n"
+"PO-Revision-Date: 2006-09-04 21:00+0200\n"
 "Last-Translator: Johannes Weißl <jargon@molb.org>\n"
 "Language-Team: German <de@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -17,49 +18,49 @@ msgstr ""
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
 # Difficulties: how to translate tab, item, custom, comma separated values
-#: abook.c:91
+#: abook.c:93
 #, c-format
 msgid "Cannot create directory %s\n"
 msgstr "Kann Verzeichnis %s nicht anlegen\n"
 
-#: abook.c:97
+#: abook.c:99
 #, c-format
 msgid "%s is not a directory\n"
 msgstr "%s ist kein Verzeichnis\n"
 
-#: abook.c:115
+#: abook.c:117
 #, c-format
 msgid "Memory allocation failure: %s\n"
 msgstr "Fehler beim Anfordern von Hauptspeicher: %s\n"
 
-#: abook.c:126
+#: abook.c:128
 #, c-format
 msgid "Press enter to continue...\n"
 msgstr "Eingabetaste drücken, um fortzufahren...\n"
 
-#: abook.c:138
+#: abook.c:143
 #, c-format
 msgid "File %s is not writeable"
 msgstr "Datei %s ist nicht beschreibbar"
 
-#: abook.c:143
+#: abook.c:148
 msgid "If you continue all changes will be lost. Do you want to continue?"
 msgstr "Beim Fortfahren gehen alle Änderungen verloren. Fortfahren?"
 
-#: abook.c:162
+#: abook.c:167
 msgid "Save database"
 msgstr "Speichere Datenbank"
 
-#: abook.c:164
+#: abook.c:169
 msgid "Quit without saving"
 msgstr "Beenden ohne zu speichern"
 
-#: abook.c:218
+#: abook.c:225
 #, c-format
 msgid "%s is not a valid HOME directory\n"
 msgstr "%s ist kein gültiges HOME Verzeichnis\n"
 
-#: abook.c:249
+#: abook.c:256
 #, c-format
 msgid ""
 "Cannot combine options --mutt-query, --convert, --add-email or --add-email-"
@@ -68,33 +69,33 @@ msgstr ""
 "Die Optionen --mutt-query, --convert, --add-email und --add-email-"
 "quietkönnen nicht kombiniert werden\n"
 
-#: abook.c:280
+#: abook.c:287
 #, c-format
 msgid "please use option --%s after --convert option\n"
 msgstr "Bitte die Option --%s nach der Option --convert angeben\n"
 
-#: abook.c:379
+#: abook.c:386
 #, c-format
 msgid "%s: unrecognized arguments on command line\n"
 msgstr "%s: unbekannte Argumente auf der Kommandozeile\n"
 
-#: abook.c:401
+#: abook.c:408
 msgid "     -h\t--help\t\t\t\tshow usage"
 msgstr "     -h\t--help\t\t\t\tHilfe anzeigen"
 
-#: abook.c:402
+#: abook.c:409
 msgid "     -C\t--config\t<file>\t\tuse an alternative configuration file"
 msgstr "     -C\t--config\t<datei>\t\tAlternative Config-Datei verwenden"
 
-#: abook.c:403
+#: abook.c:410
 msgid "\t--datafile\t<file>\t\tuse an alternative addressbook file"
 msgstr "\t--datafile\t<datei>\t\tAlternative Adressbuch-Datei verwenden"
 
-#: abook.c:404
+#: abook.c:411
 msgid "\t--mutt-query\t<string>\tmake a query for mutt"
 msgstr "\t--mutt-query\t<string>\tMutt-Anfrage durchführen"
 
-#: abook.c:405
+#: abook.c:412
 msgid ""
 "\t--add-email\t\t\tread an e-mail message from stdin and\n"
 "\t\t\t\t\tadd the sender to the addressbook"
@@ -102,7 +103,7 @@ msgstr ""
 "\t--add-email\t\t\tE-Mail-Adresse von stdin lesen und\n"
 "\t\t\t\t\tAbsender zum Adressbuch hinzufügen"
 
-#: abook.c:409
+#: abook.c:416
 msgid ""
 "\t--add-email-quiet\t\tsame as --add-email but doesn't\n"
 "\t\t\t\t\trequire to confirm adding"
@@ -110,67 +111,67 @@ msgstr ""
 "\t--add-email-quiet\t\twie --add-email, aber man muss\n"
 "\t\t\t\t\tdas Hinzufügen nicht bestätigen"
 
-#: abook.c:413
+#: abook.c:420
 msgid "\t--convert\t\t\tconvert address book files"
 msgstr "\t--convert\t\t\tAdressbuch-Dateien konvertieren"
 
-#: abook.c:414
+#: abook.c:421
 msgid "\toptions to use with --convert:"
 msgstr "\tOptionen in Verbindung mit --convert:"
 
-#: abook.c:415
+#: abook.c:422
 msgid "\t--informat\t<format>\tformat for input file"
 msgstr "\t--informat\t<format>\tFormat für Eingabedatei"
 
-#: abook.c:416
+#: abook.c:423
 msgid "\t\t\t\t\t(default: abook)"
 msgstr "\t\t\t\t\t(Standard: abook)"
 
-#: abook.c:417
+#: abook.c:424
 msgid "\t--infile\t<file>\t\tsource file"
 msgstr "\t--infile\t<datei>\t\tQuelldatei"
 
-#: abook.c:418
+#: abook.c:425
 msgid "\t\t\t\t\t(default: stdin)"
 msgstr "\t\t\t\t\t(Standard: stdin)"
 
-#: abook.c:419
+#: abook.c:426
 msgid "\t--outformat\t<format>\tformat for output file"
 msgstr "\t--outformat\t<format>\tFormat für Ausgabedatei"
 
-#: abook.c:420
+#: abook.c:427
 msgid "\t\t\t\t\t(default: text)"
 msgstr "\t\t\t\t\t(Standard: text)"
 
-#: abook.c:421
+#: abook.c:428
 msgid "\t--outfile\t<file>\t\tdestination file"
 msgstr "\t--outfile\t<datei>\t\tZieldatei"
 
-#: abook.c:422
+#: abook.c:429
 msgid "\t\t\t\t\t(default: stdout)"
 msgstr "\t\t\t\t\t(Standard: stdout)"
 
-#: abook.c:423
+#: abook.c:430
 msgid "\t--formats\t\t\tlist available formats"
 msgstr "\t--formats\t\t\tVerfügbare Formate auflisten"
 
-#: abook.c:494
+#: abook.c:501
 #, c-format
 msgid "Cannot open database\n"
 msgstr "Kann die Datenbank nicht öffnen\n"
 
-#: abook.c:620
+#: abook.c:627
 #, c-format
 msgid "too few arguments to make conversion\n"
 msgstr "zu wenig Argumente um die Konvertierung durchzuführen\n"
 
-#: abook.c:621
+#: abook.c:628
 #, c-format
 msgid "try --help\n"
 msgstr "versuche einmal --help\n"
 
 # I think "Abbruch" is better than e.g. "Beenden"
-#: abook.c:626
+#: abook.c:633
 #, c-format
 msgid ""
 "input and output formats are the same\n"
@@ -179,47 +180,47 @@ msgstr ""
 "Eingabe- und Ausgabedatei sind identisch\n"
 "Abbruch...\n"
 
-#: abook.c:639
+#: abook.c:647
 #, c-format
 msgid "input format %s not supported\n"
 msgstr "Eingabeformat %s wird nicht unterstützt\n"
 
-#: abook.c:643
+#: abook.c:651
 #, c-format
 msgid "cannot read file %s\n"
 msgstr "kann die Datei %s nicht lesen\n"
 
-#: abook.c:652
+#: abook.c:660
 #, c-format
 msgid "output format %s not supported\n"
 msgstr "Ausgabeformat %s wird nicht unterstützt\n"
 
-#: abook.c:658
+#: abook.c:666
 #, c-format
 msgid "cannot write file %s\n"
 msgstr "kann die Datei %s nicht schreiben\n"
 
-#: abook.c:679
+#: abook.c:687
 #, c-format
 msgid "cannot open %s\n"
 msgstr "kann %s nicht öffnen\n"
 
-#: abook.c:682
+#: abook.c:690
 #, c-format
 msgid "%d item(s) added to %s\n"
 msgstr "%d Element(e) zu %s hinzugefügt\n"
 
-#: abook.c:684
+#: abook.c:692
 msgid "Valid sender address not found"
 msgstr "Keine gültige Absender-Adresse gefunden"
 
-#: abook.c:724
+#: abook.c:732
 #, c-format
 msgid "Address %s already in addressbook\n"
 msgstr "Adresse %s befindet sich bereits im Adressbuch\n"
 
 # I don't want to translate 'you' with 'du'
-#: abook.c:734
+#: abook.c:742
 #, c-format
 msgid ""
 "cannot open /dev/tty\n"
@@ -228,20 +229,20 @@ msgstr ""
 "kann /dev/tty nicht öffnen\n"
 "versuche es einmal mit --add-email-quiet\n"
 
-#: abook.c:740
+#: abook.c:748
 #, c-format
 msgid "Add \"%s <%s>\" to %s? (%c/%c)\n"
 msgstr "Füge \"%s <%s>\" zu %s hinzu? (%c/%c)\n"
 
-#: abook.c:744 abook.c:751 ui.c:344 ui.c:606
+#: abook.c:752 abook.c:759 ui.c:343 ui.c:609
 msgid "keybinding for yes|y"
 msgstr "j"
 
-#: abook.c:745 abook.c:747 ui.c:342
+#: abook.c:753 abook.c:755 ui.c:341
 msgid "keybinding for no|n"
 msgstr "n"
 
-#: abook.c:771
+#: abook.c:780
 #, c-format
 msgid "stdin is a directory or cannot stat stdin\n"
 msgstr ""
@@ -252,124 +253,151 @@ msgstr ""
 msgid "q:quit  ?:help  a:add  r:remove"
 msgstr "q:Ende  ?:Hilfe  a:Hinzufügen  r:Entfernen"
 
-#: database.c:57
+#: database.c:45
 msgid "Name"
 msgstr "Name"
 
-#: database.c:58
-msgid "E-mails"
-msgstr "E-Mails"
+#: database.c:46
+msgid "E-mail addresses"
+msgstr "E-Mail-Adressen"
 
-#: database.c:59
+#: database.c:47
 msgid "Address"
 msgstr "Adresse"
 
-#: database.c:60
+#: database.c:48
 msgid "Address2"
 msgstr "Adresse2"
 
-#: database.c:61
+#: database.c:49
 msgid "City"
 msgstr "Ort"
 
 # better translation?
-#: database.c:62
+#: database.c:50
 msgid "State/Province"
 msgstr "Bundesland"
 
-#: database.c:63
+#: database.c:51
 msgid "ZIP/Postal Code"
 msgstr "Postleitzahl"
 
-#: database.c:64
+#: database.c:52
 msgid "Country"
 msgstr "Land"
 
 # better translation?
-#: database.c:65
+#: database.c:53
 msgid "Home Phone"
 msgstr "Telefon (priv.)"
 
 # better translation?
-#: database.c:66
+#: database.c:54
 msgid "Work Phone"
 msgstr "Telefon (dienstl.)"
 
-#: database.c:67
+#: database.c:55
 msgid "Fax"
 msgstr "Fax"
 
-#: database.c:68
+#: database.c:56
 msgid "Mobile"
 msgstr "Mobiltelefon"
 
-#: database.c:69
+#: database.c:57
 msgid "Nickname/Alias"
 msgstr "Spitzname/Alias"
 
-#: database.c:70
+#: database.c:58
 msgid "URL"
 msgstr "URL"
 
-#: database.c:71
+#: database.c:59
 msgid "Notes"
 msgstr "Bemerkung"
 
-#: database.c:72
-msgid "Custom1"
-msgstr "Benutzer1"
-
-#: database.c:73
-msgid "Custom2"
-msgstr "Benutzer2"
+#: database.c:60
+msgid "Anniversary day"
+msgstr ""
 
-#: database.c:74
-msgid "Custom3"
-msgstr "Benutzer3"
+#: database.c:166
+msgid "field already defined"
+msgstr "Feld bereits definiert"
 
-#: database.c:75
-msgid "Custom4"
-msgstr "Benutzer4"
+#: database.c:170
+msgid "standard field does not need to be declared"
+msgstr ""
 
-#: database.c:76
-msgid "Custom5"
-msgstr "Benutzer5"
+#: database.c:185
+msgid "unknown type"
+msgstr "unbekannter Typ"
 
-#: database.c:424
+#: database.c:585
 msgid "Invalid field value defined in configuration"
 msgstr "Ungültiger Feld-Wert in der Konfiguration festgelegt"
 
-#: edit.c:44
-msgid "CONTACT"
-msgstr "KONTAKT"
+#: database.c:588
+#, fuzzy
+msgid "Invalid field value for sorting"
+msgstr "Ungültiger Feld-Wert in der Konfiguration festgelegt"
 
-#: edit.c:45
-msgid "ADDRESS"
-msgstr "ADRESSE"
+#: edit.c:51
+msgid "Tab name too wide for screen"
+msgstr "Kartei-Name zu breit für den Bildschirm"
 
-#: edit.c:46
-msgid " PHONE "
-msgstr "TELEFON"
+#: edit.c:353
+msgid "keybindings_new_123456789|n123456789"
+msgstr "n123456789"
 
-#: edit.c:47
-msgid " OTHER "
-msgstr "ANDERE"
+#: edit.c:355
+#, c-format
+msgid "Choose %s to modify (<1>%s%c%s%s."
+msgstr ""
 
-#: edit.c:48
-msgid "CUSTOM "
-msgstr "BENUTZER"
+#: edit.c:356
+msgid "email"
+msgstr "E-Mail"
 
-#: edit.c:57
-msgid "Tab name too wide for screen"
-msgstr "Kartei-Name zu breit für den Bildschirm"
+#: edit.c:356
+msgid "item"
+msgstr "Element"
+
+#: edit.c:361
+msgid " or <n>ew"
+msgstr " oder <n>eu"
+
+#: edit.c:379
+msgid "E-mail: "
+msgstr "E-Mails: "
+
+#: edit.c:379
+msgid "Item: "
+msgstr "Element: "
+
+#: edit.c:465
+msgid "Day: "
+msgstr ""
 
-#: edit.c:224
-msgid "E-mail addresses:"
-msgstr "E-Mail-Adressen:"
+#: edit.c:465
+msgid "Month: "
+msgstr ""
 
-#: edit.h:13
-msgid "?:help c:contact a:address p:phone o:other"
-msgstr "?:Hilfe c:Kontakt a:Adresse p:Telefon o:Andere"
+#: edit.c:465
+msgid "Year (optional): "
+msgstr ""
+
+#: edit.c:498
+#, fuzzy
+msgid "Invalid date"
+msgstr "ungültiger Wert"
+
+#: edit.c:653
+msgid "Name: "
+msgstr "Name: "
+
+#: edit.h:14
+msgid "?:help q:quit editor"
+msgstr "?:Hilfe q:Editor beenden"
 
 #: filter.c:71 filter.c:82
 msgid "abook native format"
@@ -428,55 +456,64 @@ msgstr "pine Adressbuch"
 msgid "Spruce address book"
 msgstr "Spruce Adressbuch"
 
-#: filter.c:107
+#: filter.c:95
+msgid "BSD calendar"
+msgstr ""
+
+#: filter.c:108
 msgid "input:"
 msgstr "Eingabe:"
 
-#: filter.c:114
+#: filter.c:115
 msgid "output:"
 msgstr "Ausgabe:"
 
-#: filter.c:179
+#: filter.c:180
 msgid "import database"
 msgstr "importiere Datenbank"
 
-#: filter.c:181 filter.c:298
+#: filter.c:182 filter.c:299
 msgid "please select a filter"
 msgstr "Bitte Filter auswählen"
 
-#: filter.c:189 filter.c:306
+#: filter.c:190 filter.c:307
 msgid "x -\tcancel"
 msgstr "x -\tabbrechen"
 
-#: filter.c:210 filter.c:344
+#: filter.c:211 filter.c:345
 msgid "Filename: "
 msgstr "Dateiname: "
 
-#: filter.c:217
+#: filter.c:218
 msgid "Error occured while opening the file"
 msgstr "Fehler beim Öffnen der Datei"
 
-#: filter.c:219
+#: filter.c:220
 msgid "File does not seem to be a valid addressbook"
 msgstr "Die Datei scheint kein gültiges Adressbuch zu sein"
 
-#: filter.c:296
+#: filter.c:297
 msgid "export database"
 msgstr "exportiere Datenbank"
 
 # instead: Exportiere alle (a), exportiere ausgewählte (s), oder abbrechen (c)?
-#: filter.c:329
+#: filter.c:330
 msgid "Export <a>ll, export <s>elected, or <c>ancel?"
 msgstr "Exportiere <a>lle, exportiere au<s>gewählte, oder bri<c>h ab?"
 
-#: filter.c:330 ui.c:629
+#: filter.c:331 ui.c:632
 msgid "keybindings:all/selected/cancel|asc"
 msgstr ""
 
-#: filter.c:351
+#: filter.c:352
 msgid "Error occured while exporting"
 msgstr "Fehler beim Exportieren aufgetreten"
 
+#: filter.c:1896
+#, c-format
+msgid "%02d/%02d\tAnniversary of %s\n"
+msgstr ""
+
 #: help.h:11
 msgid "\t?\t\thelp\n"
 msgstr "\t?\t\tHilfe\n"
@@ -603,127 +640,232 @@ msgid "\tv\t\tview URL with web browser\n"
 msgstr "\tv\t\tURL mit Web-Browser anzeigen\n"
 
 #: help.h:55
-msgid "\ta,c,p,o,C/arrows/h,l\tchange tab\n"
+#, fuzzy
+msgid "\tarrows/h,l\t\tchange tab\n"
 msgstr "\ta,c,p,o,C/Pfeilt./h,l\tTab wechseln\n"
 
 #: help.h:57
-msgid "\t1 - 5\t\t\tedit fields\n"
-msgstr "\t1 - 5\t\t\tFelder bearbeiten\n"
+#, fuzzy
+msgid "\tq\t\t\tquit to main screen\n"
+msgstr "\tQ\t\tBeenden ohne zu speichern\n"
 
 #: help.h:59
+#, fuzzy
+msgid "\t1 - 5 A - Z\t\tedit fields\n"
+msgstr "\t1 - 5\t\t\tFelder bearbeiten\n"
+
+#: help.h:61
 msgid "\tk or <\t\t\tprevious item\n"
 msgstr "\tk or <\t\t\tVorheriges Element\n"
 
-#: help.h:60
+#: help.h:62
 msgid "\tj or >\t\t\tnext item\n"
 msgstr "\tj or >\t\t\tNächstes Element\n"
 
-#: help.h:62
-msgid "\tr\t\t\troll e-mail addresses\n"
+#: help.h:64
+#, fuzzy
+msgid "\tr\t\t\troll e-mail addresses up\n"
 msgstr "\tr\t\t\tE-Mail-Adressen rotieren\n"
 
-#: help.h:64
+#: help.h:65
+#, fuzzy
+msgid "\tESC-r\t\t\troll e-mail addresses down\n"
+msgstr "\tr\t\t\tE-Mail-Adressen rotieren\n"
+
+#: help.h:67
 msgid "\tu\t\t\tundo\n"
 msgstr "\tu\t\t\tRückgängig\n"
 
-#: help.h:66
+#: help.h:69
 msgid "\tm\t\t\tsend mail with mutt\n"
 msgstr "\tm\t\t\tE-Mail mit Mutt senden\n"
 
-#: help.h:67
+#: help.h:70
 msgid "\tv\t\t\tview url with web browser\n"
 msgstr "\tv\t\t\tURL mit Web-Browser anzeigen\n"
 
-#: options.c:240 options.c:259
+#: options.c:250
+msgid "quote mismatch"
+msgstr ""
+
+#: options.c:256
+msgid "no assignment character found"
+msgstr ""
+
+#: options.c:259
+msgid "error in comma separated list"
+msgstr "Fehler in komma-separierter Liste"
+
+#: options.c:289 options.c:308
 msgid "invalid value"
 msgstr "ungültiger Wert"
 
-#: options.c:278
+#: options.c:329
+msgid "unknown option"
+msgstr "unbekannte Option"
+
+#: options.c:341
+#, c-format
+msgid ""
+"valid values for the 'preserve_fields' option are 'all', "
+"'standard' (default), and 'none'\n"
+msgstr ""
+
+#: options.c:350
+#, c-format
+msgid ""
+"valid values for the 'address_style' option are 'eu' (default), 'uk', and "
+"'us'\n"
+msgstr ""
+
+#: options.c:372
 msgid "invalid value assignment"
 msgstr "ungültige Wertzuweisung"
 
-#: options.c:286
-msgid "unknown option"
-msgstr "unbekannte Option"
+#: options.c:380
+msgid ""
+"customfield: obsolete command - please use the 'field' and 'view' commands "
+"instead"
+msgstr ""
+
+#: options.c:398
+msgid "no view name provided"
+msgstr ""
+
+#: options.c:428
+msgid "no field identifier provided"
+msgstr ""
 
-#: options.c:311
-msgid "invalid custom field number"
-msgstr "ungültige benutzerdefinierte Feldnummer"
+#: options.c:434
+msgid "no field name provided"
+msgstr ""
 
-#: options.c:358
+#: options.c:490
 #, c-format
 msgid "%s: parse error at line %d: "
 msgstr "%s: Fehler beim Parsen in Zeile %d: "
 
-#: options.c:362
+#: options.c:494
 #, c-format
 msgid "unknown token %s\n"
 msgstr "unbekanntes Symbol %s\n"
 
-#: ui.c:146
+#: ui.c:145
 #, c-format
 msgid "Your terminal size is %dx%d\n"
 msgstr "Die Größe des Terminals ist %dx%d.\n"
 
-#: ui.c:147
+#: ui.c:146
 #, c-format
 msgid "Terminal is too small. Minimum terminal size for abook is %dx%d\n"
 msgstr "Das Terminal ist zu klein. Die minimale Größe für abook ist %dx%d.\n"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (Y/n)?"
 msgstr " (J/n)?"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (y/N)?"
 msgstr " (j/N)?"
 
-#: ui.c:411
+#: ui.c:410
 msgid "help"
 msgstr "Hilfe"
 
-#: ui.c:420
+#: ui.c:419
 msgid "Press any key to continue..."
 msgstr "Taste drücken, um fortzufahren..."
 
 # "Lösche ausgewählte(s) Element(e)" sounds silly ... plural form is ok.
-#: ui.c:541
+#: ui.c:539
 msgid "Remove selected item(s)"
 msgstr "Lösche ausgewählte Elemente"
 
-#: ui.c:551
+#: ui.c:549
 msgid "Clear WHOLE database"
 msgstr "Lösche GESAMTE Datenbank"
 
-#: ui.c:579
+#: ui.c:582
 msgid "Search hit bottom, continuing at top"
 msgstr "Suche hat das Ende erreicht, weiter am Anfang"
 
 # Why 'y', and not 'j'?
 # c-format
-#: ui.c:604
+#: ui.c:607
 #, c-format
 msgid "Your current data will be lost - Press '%c' to continue"
 msgstr "Die aktuellen Daten sind verloren - Drücke '%c' um fortzufahren"
 
 # instead: Drucke alle (a), drucke ausgewählte (s), oder abbrechen (c)?
-#: ui.c:629
+#: ui.c:632
 msgid "Print <a>ll, print <s>elected, or <c>ancel?"
 msgstr "Drucke <a>lle, drucke au<s>gewählte oder bri<c>h ab?"
 
-#: ui.c:635
+#: ui.c:638
 msgid "No selected items"
 msgstr "Keine Elemente ausgewählt"
 
-#: ui.c:661
+#: ui.c:664
 msgid "File to open: "
 msgstr "Öffne Datei: "
 
-#: ui.c:671
+#: ui.c:674
 msgid "Save current database"
 msgstr "Speichere aktuelle Datenbank"
 
-#: ui.c:679
+#: ui.c:682
 msgid "Sorry, the specified file appears not to be a valid abook addressbook"
 msgstr ""
 "Die angegebene Datei scheint leider kein gültiges abook Adressbuch zu sein"
+
+#: views.c:87
+msgid "undeclared field"
+msgstr ""
+
+#: views.c:92
+msgid "maximal number of fields per view reached"
+msgstr ""
+
+#: views.c:95
+msgid "field already in this view"
+msgstr ""
+
+#: views.c:139
+msgid "CONTACT"
+msgstr "KONTAKT"
+
+#: views.c:140
+msgid "ADDRESS"
+msgstr "ADRESSE"
+
+#: views.c:142
+msgid "PHONE"
+msgstr "TELEFON"
+
+#: views.c:143
+msgid "OTHER"
+msgstr "ANDERE"
+
+#: views.c:165 views.c:166 views.c:167 views.c:168 views.c:169
+msgid "CUSTOM"
+msgstr "BENUTZER"
+
+#: views.c:165
+msgid "Custom1"
+msgstr "Benutzer1"
+
+#: views.c:166
+msgid "Custom2"
+msgstr "Benutzer2"
+
+#: views.c:167
+msgid "Custom3"
+msgstr "Benutzer3"
+
+#: views.c:168
+msgid "Custom4"
+msgstr "Benutzer4"
+
+#: views.c:169
+msgid "Custom5"
+msgstr "Benutzer5"
index a9790e99117db22dfcad74a0d85e17767bbbaec7..dde05f8b455a1f399d8de8de49b2b69d58075682 100644 (file)
Binary files a/po/fr.gmo and b/po/fr.gmo differ
index 1a469d37dca5ae5f11105814e777e5947efa961c..917d233bbfbcdd985ef828d8aa0571ea6599fa42 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,59 +6,59 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: abook\n"
-"Report-Msgid-Bugs-To: <cedricduval+abook@free.fr>\n"
-"POT-Creation-Date: 2005-12-06 07:50+0200\n"
-"PO-Revision-Date: 2005-10-03 10:53+0200\n"
+"Report-Msgid-Bugs-To: <abook-devel@lists.sourceforge.net>\n"
+"POT-Creation-Date: 2006-09-06 17:14+0300\n"
+"PO-Revision-Date: 2006-09-05 11:42+0200\n"
 "Last-Translator: Cedric Duval <cedricduval+abook@free.fr>\n"
 "Language-Team: french\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: abook.c:91
+#: abook.c:93
 #, c-format
 msgid "Cannot create directory %s\n"
 msgstr "Impossible de créer le répertoire %s\n"
 
-#: abook.c:97
+#: abook.c:99
 #, c-format
 msgid "%s is not a directory\n"
 msgstr "%s n'est pas un répertoire\n"
 
-#: abook.c:115
+#: abook.c:117
 #, c-format
 msgid "Memory allocation failure: %s\n"
 msgstr "Erreur d'allocation mémoire: %s\n"
 
-#: abook.c:126
+#: abook.c:128
 #, c-format
 msgid "Press enter to continue...\n"
 msgstr "Appuyez sur entrée pour continuer...\n"
 
-#: abook.c:138
+#: abook.c:143
 #, c-format
 msgid "File %s is not writeable"
 msgstr "Impossible d'écrire dans le fichier %s"
 
-#: abook.c:143
+#: abook.c:148
 msgid "If you continue all changes will be lost. Do you want to continue?"
 msgstr ""
-"En continuant vos modifications seront perdues. Voulez-vous continuer ?"
+"Si vous continuez, vos modifications seront perdues. Voulez-vous continuer ?"
 
-#: abook.c:162
+#: abook.c:167
 msgid "Save database"
 msgstr "Sauvegarder la base de données"
 
-#: abook.c:164
+#: abook.c:169
 msgid "Quit without saving"
 msgstr "Quitter sans sauvegarder"
 
-#: abook.c:218
+#: abook.c:225
 #, c-format
 msgid "%s is not a valid HOME directory\n"
 msgstr "%s n'est pas un répertoire personnel (HOME) valide\n"
 
-#: abook.c:249
+#: abook.c:256
 #, c-format
 msgid ""
 "Cannot combine options --mutt-query, --convert, --add-email or --add-email-"
@@ -67,35 +67,34 @@ msgstr ""
 "Impossible de combiner les options --mutt-query, --convert, --add-email ou --"
 "add-email-quiet\n"
 
-#: abook.c:280
+#: abook.c:287
 #, c-format
 msgid "please use option --%s after --convert option\n"
 msgstr "Veuillez utiliser l'option --%s après l'option --convert\n"
 
-#: abook.c:379
+#: abook.c:386
 #, c-format
 msgid "%s: unrecognized arguments on command line\n"
 msgstr "%s: paramètres de ligne de commande non reconnus\n"
 
-#: abook.c:401
+#: abook.c:408
 msgid "     -h\t--help\t\t\t\tshow usage"
-msgstr "     -h\t--help\t\t\t\tmontrer l'utilisation"
+msgstr "     -h\t--help\t\t\t\tafficher l'aide"
 
-#: abook.c:402
+#: abook.c:409
 msgid "     -C\t--config\t<file>\t\tuse an alternative configuration file"
 msgstr ""
-"     -C\t--config\t<fichier>\tutiliser un fichier de configuration\n"
-"\t\t\t\t\talternatif"
+"     -C\t--config\t<fichier>\tutiliser un autre fichier de configuration"
 
-#: abook.c:403
+#: abook.c:410
 msgid "\t--datafile\t<file>\t\tuse an alternative addressbook file"
 msgstr "\t--datafile\t<fichier>\tutiliser un autre carnet d'adresses"
 
-#: abook.c:404
+#: abook.c:411
 msgid "\t--mutt-query\t<string>\tmake a query for mutt"
 msgstr "\t--mutt-query\t<chaine>\teffectuer une requête pour mutt"
 
-#: abook.c:405
+#: abook.c:412
 msgid ""
 "\t--add-email\t\t\tread an e-mail message from stdin and\n"
 "\t\t\t\t\tadd the sender to the addressbook"
@@ -104,7 +103,7 @@ msgstr ""
 "\t\t\t\t\tl'entrée standard et ajouter\n"
 "\t\t\t\t\tl'expéditeur au carnet d'adresses"
 
-#: abook.c:409
+#: abook.c:416
 msgid ""
 "\t--add-email-quiet\t\tsame as --add-email but doesn't\n"
 "\t\t\t\t\trequire to confirm adding"
@@ -112,66 +111,66 @@ msgstr ""
 "\t--add-email-quiet\t\tcomme --add-email mais sans nécessité de confirmer\n"
 "\t\t\t\t\tl'ajout"
 
-#: abook.c:413
+#: abook.c:420
 msgid "\t--convert\t\t\tconvert address book files"
 msgstr "\t--convert\t\t\tconvertir des carnets d'adresses"
 
-#: abook.c:414
+#: abook.c:421
 msgid "\toptions to use with --convert:"
-msgstr "\toptions à utiliser avec --convert :"
+msgstr "\toptions à utiliser avec --convert:"
 
-#: abook.c:415
+#: abook.c:422
 msgid "\t--informat\t<format>\tformat for input file"
 msgstr "\t--informat\t<format>\tformat du fichier source"
 
-#: abook.c:416
+#: abook.c:423
 msgid "\t\t\t\t\t(default: abook)"
 msgstr "\t\t\t\t\t(défaut: abook)"
 
-#: abook.c:417
+#: abook.c:424
 msgid "\t--infile\t<file>\t\tsource file"
 msgstr "\t--infile\t<file>\t\tfichier source"
 
-#: abook.c:418
+#: abook.c:425
 msgid "\t\t\t\t\t(default: stdin)"
 msgstr "\t\t\t\t\t(défaut: entrée standard)"
 
-#: abook.c:419
+#: abook.c:426
 msgid "\t--outformat\t<format>\tformat for output file"
 msgstr "\t--outformat\t<format>\tformat du fichier de destination"
 
-#: abook.c:420
+#: abook.c:427
 msgid "\t\t\t\t\t(default: text)"
 msgstr "\t\t\t\t\t(défaut: texte)"
 
-#: abook.c:421
+#: abook.c:428
 msgid "\t--outfile\t<file>\t\tdestination file"
 msgstr "\t--outfile\t<file>\t\tfichier de destination"
 
-#: abook.c:422
+#: abook.c:429
 msgid "\t\t\t\t\t(default: stdout)"
 msgstr "\t\t\t\t\t(défaut: sortie standard)"
 
-#: abook.c:423
+#: abook.c:430
 msgid "\t--formats\t\t\tlist available formats"
 msgstr "\t--formats\t\t\tlister les formats disponibles"
 
-#: abook.c:494
+#: abook.c:501
 #, c-format
 msgid "Cannot open database\n"
 msgstr "Impossible d'ouvrir la base de données\n"
 
-#: abook.c:620
+#: abook.c:627
 #, c-format
 msgid "too few arguments to make conversion\n"
 msgstr "trop peu de paramètres pour effectuer la conversion\n"
 
-#: abook.c:621
+#: abook.c:628
 #, c-format
 msgid "try --help\n"
 msgstr "essayez --help\n"
 
-#: abook.c:626
+#: abook.c:633
 #, c-format
 msgid ""
 "input and output formats are the same\n"
@@ -180,68 +179,68 @@ msgstr ""
 "la source et la destination sont identiques\n"
 "arrêt...\n"
 
-#: abook.c:639
+#: abook.c:647
 #, c-format
 msgid "input format %s not supported\n"
 msgstr "le format source %s n'est pas supporté\n"
 
-#: abook.c:643
+#: abook.c:651
 #, c-format
 msgid "cannot read file %s\n"
 msgstr "Impossible de lire le fichier %s\n"
 
-#: abook.c:652
+#: abook.c:660
 #, c-format
 msgid "output format %s not supported\n"
 msgstr "le format de destination %s n'est pas supporté\n"
 
-#: abook.c:658
+#: abook.c:666
 #, c-format
 msgid "cannot write file %s\n"
 msgstr "impossible d'écrire le fichier %s\n"
 
-#: abook.c:679
+#: abook.c:687
 #, c-format
 msgid "cannot open %s\n"
 msgstr "impossible d'ouvrir %s\n"
 
-#: abook.c:682
+#: abook.c:690
 #, c-format
 msgid "%d item(s) added to %s\n"
 msgstr "%d entrées ajoutées à %s\n"
 
-#: abook.c:684
+#: abook.c:692
 msgid "Valid sender address not found"
 msgstr "Aucune adresse d'expéditeur valide trouvée"
 
-#: abook.c:724
+#: abook.c:732
 #, c-format
 msgid "Address %s already in addressbook\n"
 msgstr "L'adresse %s figure déjà dans le carnet d'adresses\n"
 
-#: abook.c:734
+#: abook.c:742
 #, c-format
 msgid ""
 "cannot open /dev/tty\n"
 "you may want to use --add-email-quiet\n"
 msgstr ""
 "impossible d'ouvrir /dev/tty\n"
-"peut-être souhaiter-vous utiliser --add-email-quiet\n"
+"peut-être souhaitez-vous utiliser --add-email-quiet\n"
 
-#: abook.c:740
+#: abook.c:748
 #, c-format
 msgid "Add \"%s <%s>\" to %s? (%c/%c)\n"
 msgstr "Ajouter \"%s <%s>\" à %s ? (%c/%c)\n"
 
-#: abook.c:744 abook.c:751 ui.c:344 ui.c:606
+#: abook.c:752 abook.c:759 ui.c:343 ui.c:609
 msgid "keybinding for yes|y"
 msgstr "o"
 
-#: abook.c:745 abook.c:747 ui.c:342
+#: abook.c:753 abook.c:755 ui.c:341
 msgid "keybinding for no|n"
 msgstr "n"
 
-#: abook.c:771
+#: abook.c:780
 #, c-format
 msgid "stdin is a directory or cannot stat stdin\n"
 msgstr "stdin est un répertoire, ou impossible d'en quérir son état\n"
@@ -250,122 +249,147 @@ msgstr "stdin est un répertoire, ou impossible d'en quérir son état\n"
 msgid "q:quit  ?:help  a:add  r:remove"
 msgstr "q:quitter ?:aide a:ajouter r:supprimer"
 
-#: database.c:57
+#: database.c:45
 msgid "Name"
 msgstr "Nom"
 
-#: database.c:58
-msgid "E-mails"
-msgstr "Emails"
+#: database.c:46
+msgid "E-mail addresses"
+msgstr "Adresses email:"
 
-#: database.c:59
+#: database.c:47
 msgid "Address"
 msgstr "Adresse"
 
-#: database.c:60
+#: database.c:48
 msgid "Address2"
 msgstr "Adresse2"
 
-#: database.c:61
+#: database.c:49
 msgid "City"
 msgstr "Ville"
 
-#: database.c:62
+#: database.c:50
 msgid "State/Province"
 msgstr "État/Province"
 
-#: database.c:63
+#: database.c:51
 msgid "ZIP/Postal Code"
 msgstr "Code postal"
 
-#: database.c:64
+#: database.c:52
 msgid "Country"
 msgstr "Pays"
 
-#: database.c:65
+#: database.c:53
 msgid "Home Phone"
 msgstr "Téléphone domicile"
 
-#: database.c:66
+#: database.c:54
 msgid "Work Phone"
 msgstr "Téléphone travail"
 
-#: database.c:67
+#: database.c:55
 msgid "Fax"
 msgstr "Fax"
 
-#: database.c:68
+#: database.c:56
 msgid "Mobile"
 msgstr "Portable"
 
-#: database.c:69
+#: database.c:57
 msgid "Nickname/Alias"
 msgstr "Surnom/Pseudo"
 
-#: database.c:70
+#: database.c:58
 msgid "URL"
 msgstr "URL"
 
-#: database.c:71
+#: database.c:59
 msgid "Notes"
 msgstr "Notes"
 
-#: database.c:72
-msgid "Custom1"
-msgstr "Personnalisé1"
+#: database.c:60
+msgid "Anniversary day"
+msgstr "Date d'anniversaire"
 
-#: database.c:73
-msgid "Custom2"
-msgstr "Personnalisé2"
+#: database.c:166
+msgid "field already defined"
+msgstr "champ déjà défini"
 
-#: database.c:74
-msgid "Custom3"
-msgstr "Personnalisé3"
+#: database.c:170
+msgid "standard field does not need to be declared"
+msgstr "les champs standard n'ont pas besoin d'être déclarés"
 
-#: database.c:75
-msgid "Custom4"
-msgstr "Personnalisé4"
+#: database.c:185
+msgid "unknown type"
+msgstr "type inconnu"
 
-#: database.c:76
-msgid "Custom5"
-msgstr "Personnalisé5"
-
-#: database.c:424
+#: database.c:585
 msgid "Invalid field value defined in configuration"
 msgstr "Valeur de champ invalide définie dans la configuration"
 
-#: edit.c:44
-msgid "CONTACT"
-msgstr "CONTACT"
+#: database.c:588
+msgid "Invalid field value for sorting"
+msgstr "Valeur de champ invalide pour le classement"
 
-#: edit.c:45
-msgid "ADDRESS"
-msgstr "ADRESSE"
+# Comment traduire 'tab' ?
+#: edit.c:51
+msgid "Tab name too wide for screen"
+msgstr "Intitulé d'onglet trop large pour l'écran"
 
-#: edit.c:46
-msgid " PHONE "
-msgstr "TÉLÉPHONE"
+#: edit.c:353
+msgid "keybindings_new_123456789|n123456789"
+msgstr "n123456789"
 
-#: edit.c:47
-msgid " OTHER "
-msgstr "AUTRE"
+#: edit.c:355
+#, c-format
+msgid "Choose %s to modify (<1>%s%c%s%s."
+msgstr "Choisir %s à modifier (<1>%s%c%s%s."
 
-#: edit.c:48
-msgid "CUSTOM "
-msgstr "PERSONNALISÉ"
+#: edit.c:356
+msgid "email"
+msgstr "email"
 
-# Comment traduire 'tab' ?
-#: edit.c:57
-msgid "Tab name too wide for screen"
-msgstr "Intitulé de \"tab\" trop large pour l'écran"
+#: edit.c:356
+msgid "item"
+msgstr "entrée"
 
-#: edit.c:224
-msgid "E-mail addresses:"
-msgstr "Adresses email:"
+#: edit.c:361
+msgid " or <n>ew"
+msgstr " ou <n>nouveau"
+
+#: edit.c:379
+msgid "E-mail: "
+msgstr "Emails: "
+
+#: edit.c:379
+msgid "Item: "
+msgstr "Entrée: "
+
+#: edit.c:465
+msgid "Day: "
+msgstr "Jour: "
+
+#: edit.c:465
+msgid "Month: "
+msgstr "Mois: "
+
+#: edit.c:465
+msgid "Year (optional): "
+msgstr "Année (optionnelle): "
+
+#: edit.c:498
+msgid "Invalid date"
+msgstr "Date invalide"
+
+#: edit.c:653
+msgid "Name: "
+msgstr "Nom: "
 
-#: edit.h:13
-msgid "?:help c:contact a:address p:phone o:other"
-msgstr "?:aide c:contact a:adresse p:téléphone o:autre"
+#: edit.h:14
+msgid "?:help q:quit editor"
+msgstr "?:aide q:quitter l'éditeur"
 
 #: filter.c:71 filter.c:82
 msgid "abook native format"
@@ -423,54 +447,63 @@ msgstr "carnet d'adresses Wanderlust"
 msgid "Spruce address book"
 msgstr "carnet d'adresses Spruce"
 
-#: filter.c:107
+#: filter.c:95
+msgid "BSD calendar"
+msgstr ""
+
+#: filter.c:108
 msgid "input:"
 msgstr "entrée:"
 
-#: filter.c:114
+#: filter.c:115
 msgid "output:"
 msgstr "sortie:"
 
-#: filter.c:179
+#: filter.c:180
 msgid "import database"
 msgstr "importer la base de données"
 
-#: filter.c:181 filter.c:298
+#: filter.c:182 filter.c:299
 msgid "please select a filter"
-msgstr "veuiller choisir un filtre"
+msgstr "veuillez choisir un filtre"
 
-#: filter.c:189 filter.c:306
+#: filter.c:190 filter.c:307
 msgid "x -\tcancel"
 msgstr "x - \tannuler"
 
-#: filter.c:210 filter.c:344
+#: filter.c:211 filter.c:345
 msgid "Filename: "
 msgstr "Nom de fichier: "
 
-#: filter.c:217
+#: filter.c:218
 msgid "Error occured while opening the file"
 msgstr "Une erreur est survenue à l'ouverture du fichier"
 
-#: filter.c:219
+#: filter.c:220
 msgid "File does not seem to be a valid addressbook"
 msgstr "Le fichier spécifié ne semble pas être un carnet d'adresses valide"
 
-#: filter.c:296
+#: filter.c:297
 msgid "export database"
 msgstr "exporter la base de données"
 
-#: filter.c:329
+#: filter.c:330
 msgid "Export <a>ll, export <s>elected, or <c>ancel?"
 msgstr "Exporter <t>out, exporter les entrées <s>électionnées, ou <a>nnuler ?"
 
-#: filter.c:330 ui.c:629
+#: filter.c:331 ui.c:632
 msgid "keybindings:all/selected/cancel|asc"
 msgstr "tsa"
 
-#: filter.c:351
+#: filter.c:352
 msgid "Error occured while exporting"
 msgstr "Une erreur est survenue lors de l'exportation"
 
+#: filter.c:1896
+#, c-format
+msgid "%02d/%02d\tAnniversary of %s\n"
+msgstr ""
+
 #: help.h:11
 msgid "\t?\t\thelp\n"
 msgstr "\t?\t\taide\n"
@@ -491,7 +524,7 @@ msgstr ""
 
 #: help.h:15
 msgid "\t^L\t\trefresh screen\n"
-msgstr "\t^L\t\traffraîchir l'écran\n"
+msgstr "\t^L\t\trafraîchir l'écran\n"
 
 #: help.h:17
 msgid "\tarrows / j,k\tscroll list\n"
@@ -511,7 +544,7 @@ msgstr "\tr / suppr\t\tsupprimer les entrées sélectionnées\n"
 
 #: help.h:21
 msgid "\tD\t\tduplicate item\n"
-msgstr "\tD\t\tduppliquer une entrée\n"
+msgstr "\tD\t\tdupliquer une entrée\n"
 
 #: help.h:23
 msgid "\tspace\t\tselect item\n"
@@ -523,7 +556,7 @@ msgstr "\t+\t\ttout sélectionner\n"
 
 #: help.h:25
 msgid "\t-\t\tunselect all\n"
-msgstr "\t+\t\ttout désélectionner\n"
+msgstr "\t-\t\ttout désélectionner\n"
 
 #: help.h:26
 msgid "\t*\t\tinvert selection\n"
@@ -596,123 +629,238 @@ msgid "\tv\t\tview URL with web browser\n"
 msgstr "\tv\t\tvisualiser l'URL avec un navigateur web\n"
 
 #: help.h:55
-msgid "\ta,c,p,o,C/arrows/h,l\tchange tab\n"
-msgstr "\ta,c,p,o,C/flèches/h,l\tchanger de \"tab\"\n"
+msgid "\tarrows/h,l\t\tchange tab\n"
+msgstr "\tflèches/h,l\tchanger de \"tab\"\n"
 
 #: help.h:57
-msgid "\t1 - 5\t\t\tedit fields\n"
-msgstr "\t1 - 5\t\t\téditer les champs\n"
+msgid "\tq\t\t\tquit to main screen\n"
+msgstr "\tq\t\tretourner à l'écran principal\n"
 
 #: help.h:59
+msgid "\t1 - 5 A - Z\t\tedit fields\n"
+msgstr "\t1 - 5 A - Z\t\t\téditer les champs\n"
+
+#: help.h:61
 msgid "\tk or <\t\t\tprevious item\n"
 msgstr "\tk ou <\t\t\tentrée précédente\n"
 
-#: help.h:60
+#: help.h:62
 msgid "\tj or >\t\t\tnext item\n"
 msgstr "\tj ou >\t\t\tentrée suivante\n"
 
-#: help.h:62
-msgid "\tr\t\t\troll e-mail addresses\n"
-msgstr "\tr\t\t\tenrouler les adresses email\n"
-
 #: help.h:64
+msgid "\tr\t\t\troll e-mail addresses up\n"
+msgstr "\tr\t\t\trotation des adresses email vers le haut\n"
+
+#: help.h:65
+msgid "\tESC-r\t\t\troll e-mail addresses down\n"
+msgstr "\tESC-r\t\t\trotation des adresses email vers le bas\n"
+
+#: help.h:67
 msgid "\tu\t\t\tundo\n"
-msgstr "\tu\t\t\tdéfaire\n"
+msgstr "\tu\t\t\tannuler\n"
 
-#: help.h:66
+#: help.h:69
 msgid "\tm\t\t\tsend mail with mutt\n"
 msgstr "\tm\t\t\tenvoyer un courrier électronique avec mutt\n"
 
-#: help.h:67
+#: help.h:70
 msgid "\tv\t\t\tview url with web browser\n"
 msgstr "\tv\t\t\tvisualiser l'URL avec un navigateur web\n"
 
-#: options.c:240 options.c:259
+#: options.c:250
+msgid "quote mismatch"
+msgstr "problème de correspondance de guillemets"
+
+#: options.c:256
+msgid "no assignment character found"
+msgstr "pas de caractère d'affectation trouvé"
+
+#: options.c:259
+msgid "error in comma separated list"
+msgstr "erreur dans la liste de valeurs délimitées par des virgules"
+
+#: options.c:289 options.c:308
 msgid "invalid value"
 msgstr "valeur invalide"
 
-#: options.c:278
+#: options.c:329
+msgid "unknown option"
+msgstr "option inconnue"
+
+#: options.c:341
+#, c-format
+msgid ""
+"valid values for the 'preserve_fields' option are 'all', "
+"'standard' (default), and 'none'\n"
+msgstr ""
+"les valeurs correctes pour 'preserve_fields' sont 'all', "
+"'standard' (défaut), et 'none'\n"
+
+#: options.c:350
+#, c-format
+msgid ""
+"valid values for the 'address_style' option are 'eu' (default), 'uk', and "
+"'us'\n"
+msgstr ""
+"les valeurs correctes pour 'address_style' sont 'eu' (défaut), 'uk', et "
+"'us'\n"
+
+#: options.c:372
 msgid "invalid value assignment"
 msgstr "affectation de valeur invalide"
 
-#: options.c:286
-msgid "unknown option"
-msgstr "option inconnue"
+#: options.c:380
+msgid ""
+"customfield: obsolete command - please use the 'field' and 'view' commands "
+"instead"
+msgstr ""
+"customfield: commande obsolète - veuillez utiliser les commandes 'field' et "
+"'view'"
 
-#: options.c:311
-msgid "invalid custom field number"
-msgstr "numéro de champ personnalisé invalide"
+#: options.c:398
+msgid "no view name provided"
+msgstr "aucun nom de vue donné"
 
-#: options.c:358
+#: options.c:428
+msgid "no field identifier provided"
+msgstr "aucun identifieur de champ donné"
+
+#: options.c:434
+msgid "no field name provided"
+msgstr "aucun nom de champ donné"
+
+#: options.c:490
 #, c-format
 msgid "%s: parse error at line %d: "
-msgstr "%s: erreur d'analyse lexicale à la ligne %d:"
+msgstr "%s: erreur d'analyse lexicale à la ligne %d: "
 
-#: options.c:362
+#: options.c:494
 #, c-format
 msgid "unknown token %s\n"
 msgstr "symbole inconnu %s\n"
 
-#: ui.c:146
+#: ui.c:145
 #, c-format
 msgid "Your terminal size is %dx%d\n"
 msgstr "La taille de votre terminal est de %dx%d\n"
 
-#: ui.c:147
+#: ui.c:146
 #, c-format
 msgid "Terminal is too small. Minimum terminal size for abook is %dx%d\n"
 msgstr "Terminal trop petit. Taille minimale de terminal pour abook: %dx%d\n"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (Y/n)?"
 msgstr " (O/n) ?"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (y/N)?"
 msgstr " (o/N) ?"
 
-#: ui.c:411
+#: ui.c:410
 msgid "help"
 msgstr "aide"
 
-#: ui.c:420
+#: ui.c:419
 msgid "Press any key to continue..."
 msgstr "Appuyez sur une touche pour continuer..."
 
-#: ui.c:541
+#: ui.c:539
 msgid "Remove selected item(s)"
 msgstr "Supprimer les entrées sélectionnées"
 
-#: ui.c:551
+#: ui.c:549
 msgid "Clear WHOLE database"
 msgstr "Effacer ENTIÈREMENT la base de données"
 
-#: ui.c:579
+#: ui.c:582
 msgid "Search hit bottom, continuing at top"
 msgstr "La recherche a atteint la fin, poursuite au début"
 
-#: ui.c:604
+#: ui.c:607
 #, c-format
 msgid "Your current data will be lost - Press '%c' to continue"
 msgstr "Vos données actuelles seront perdues - Appuyez sur '%c' pour continuer"
 
-#: ui.c:629
+#: ui.c:632
 msgid "Print <a>ll, print <s>elected, or <c>ancel?"
 msgstr "Imprimer <t>out, imprimer les entrées <s>électionnées, ou <a>nnuler ?"
 
-#: ui.c:635
+#: ui.c:638
 msgid "No selected items"
 msgstr "Pas d'entrée sélectionnée"
 
-#: ui.c:661
+#: ui.c:664
 msgid "File to open: "
 msgstr "Fichier à ouvrir: "
 
-#: ui.c:671
+#: ui.c:674
 msgid "Save current database"
 msgstr "Sauvegarder la base de données"
 
-#: ui.c:679
+#: ui.c:682
 msgid "Sorry, the specified file appears not to be a valid abook addressbook"
 msgstr ""
 "Désolé, le fichier spécifié ne semble pas être un carnet d'adresses valide"
+
+#: views.c:87
+msgid "undeclared field"
+msgstr "champ non déclaré"
+
+#: views.c:92
+msgid "maximal number of fields per view reached"
+msgstr "nombre maximal de champs par vue atteint"
+
+#: views.c:95
+msgid "field already in this view"
+msgstr "ce champ est déjà dans cette vue"
+
+#: views.c:139
+msgid "CONTACT"
+msgstr "CONTACT"
+
+#: views.c:140
+msgid "ADDRESS"
+msgstr "ADRESSE"
+
+#: views.c:142
+msgid "PHONE"
+msgstr "TÉLÉPHONE"
+
+#: views.c:143
+msgid "OTHER"
+msgstr "AUTRE"
+
+#: views.c:165 views.c:166 views.c:167 views.c:168 views.c:169
+msgid "CUSTOM"
+msgstr "PERSONNALISÉ"
+
+#: views.c:165
+msgid "Custom1"
+msgstr "Personnalisé1"
+
+#: views.c:166
+msgid "Custom2"
+msgstr "Personnalisé2"
+
+#: views.c:167
+msgid "Custom3"
+msgstr "Personnalisé3"
+
+#: views.c:168
+msgid "Custom4"
+msgstr "Personnalisé4"
+
+#: views.c:169
+msgid "Custom5"
+msgstr "Personnalisé5"
+
+#~ msgid "sorry, input for this field type is not yet implemented"
+#~ msgstr "désolé, l'entrée pour ce type de champ n'est pas encore implémentée"
+
+#~ msgid "?:help c:contact a:address p:phone o:other"
+#~ msgstr "?:aide c:contact a:adresse p:téléphone o:autre"
+
+#~ msgid "invalid custom field number"
+#~ msgstr "numéro de champ personnalisé invalide"
diff --git a/po/it.gmo b/po/it.gmo
new file mode 100644 (file)
index 0000000..c184bb8
Binary files /dev/null and b/po/it.gmo differ
diff --git a/po/it.po b/po/it.po
new file mode 100644 (file)
index 0000000..a420877
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,865 @@
+# Italian translations for abook package.
+# Copyright (C) 2006 Free Software Foundation, Inc.
+# This file is distributed under the same license as the abook package.
+# Automatically generated, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: abook 0.5.5\n"
+"Report-Msgid-Bugs-To: <abook-devel@lists.sourceforge.net>\n"
+"POT-Creation-Date: 2006-09-06 17:14+0300\n"
+"PO-Revision-Date: 2006-08-26 01:26+0200\n"
+"Last-Translator: Claudio Stazzone <c.stazzo@jumpy.it>\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-Country: ITALY\n"
+"X-Poedit-SourceCharset: iso-8859-15\n"
+
+#: abook.c:93
+#, c-format
+msgid "Cannot create directory %s\n"
+msgstr "Non posso creare la directory %s\n"
+
+#: abook.c:99
+#, c-format
+msgid "%s is not a directory\n"
+msgstr "%s non è una directory\n"
+
+#: abook.c:117
+#, c-format
+msgid "Memory allocation failure: %s\n"
+msgstr "Allocazione di memoria fallita: %s\n"
+
+#: abook.c:128
+#, c-format
+msgid "Press enter to continue...\n"
+msgstr "Premi invio per continuare...\n"
+
+#: abook.c:143
+#, c-format
+msgid "File %s is not writeable"
+msgstr "Il file %s non è scrivibile"
+
+#: abook.c:148
+msgid "If you continue all changes will be lost. Do you want to continue?"
+msgstr "Se continui i cambiamenti verranno persi. Vuoi continuare?"
+
+#: abook.c:167
+msgid "Save database"
+msgstr "Salva il database"
+
+#: abook.c:169
+msgid "Quit without saving"
+msgstr "Esci senza salvare"
+
+#: abook.c:225
+#, c-format
+msgid "%s is not a valid HOME directory\n"
+msgstr "%s non è una directory HOME valida\n"
+
+#: abook.c:256
+#, c-format
+msgid ""
+"Cannot combine options --mutt-query, --convert, --add-email or --add-email-"
+"quiet\n"
+msgstr ""
+"Non posso combinare le opzioni --mutt-query, --convert, --add-email o --add-"
+"email-quiet\n"
+
+#: abook.c:287
+#, c-format
+msgid "please use option --%s after --convert option\n"
+msgstr "per favore usa l'opzione --%s dopo --convert option\n"
+
+#: abook.c:386
+#, c-format
+msgid "%s: unrecognized arguments on command line\n"
+msgstr "%s: argomenti non validi\n"
+
+#: abook.c:408
+msgid "     -h\t--help\t\t\t\tshow usage"
+msgstr "     -h\t--help\t\t\t\tmostra l'utilizzo"
+
+#: abook.c:409
+msgid "     -C\t--config\t<file>\t\tuse an alternative configuration file"
+msgstr "     -C\t--config\t<file>\t\tusa un file di configurazione diverso"
+
+#: abook.c:410
+msgid "\t--datafile\t<file>\t\tuse an alternative addressbook file"
+msgstr "\t--datafile\t<file>\t\tusa un file di rubrica diverso"
+
+#: abook.c:411
+msgid "\t--mutt-query\t<string>\tmake a query for mutt"
+msgstr "\t--mutt-query\t<string>\tesegue una ricerca per mutt"
+
+#: abook.c:412
+msgid ""
+"\t--add-email\t\t\tread an e-mail message from stdin and\n"
+"\t\t\t\t\tadd the sender to the addressbook"
+msgstr ""
+"\t--add-email\t\t\tlegge un messaggio da standard input e\n"
+"\t\t\t\t\taggiunge il mittente alla rubrica"
+
+#: abook.c:416
+msgid ""
+"\t--add-email-quiet\t\tsame as --add-email but doesn't\n"
+"\t\t\t\t\trequire to confirm adding"
+msgstr ""
+"\t--add-email-quiet\t\tlo stesso che --add-email ma non\n"
+"\t\t\t\t\trichiede la conferma"
+
+#: abook.c:420
+msgid "\t--convert\t\t\tconvert address book files"
+msgstr "\t--convert\t\t\tconverte i file di rubrica"
+
+#: abook.c:421
+msgid "\toptions to use with --convert:"
+msgstr "\topzioni da usare con --convert:"
+
+#: abook.c:422
+msgid "\t--informat\t<format>\tformat for input file"
+msgstr "\t--informat\t<format>\tformato del file di input"
+
+#: abook.c:423
+msgid "\t\t\t\t\t(default: abook)"
+msgstr "\t\t\t\t\t(predefinito: abook)"
+
+#: abook.c:424
+msgid "\t--infile\t<file>\t\tsource file"
+msgstr "\t--infile\t<file>\t\tfile sorgente"
+
+#: abook.c:425
+msgid "\t\t\t\t\t(default: stdin)"
+msgstr "\t\t\t\t\t(predefinito: standard input)"
+
+#: abook.c:426
+msgid "\t--outformat\t<format>\tformat for output file"
+msgstr "\t--outformat\t<format>\tformato file di output"
+
+#: abook.c:427
+msgid "\t\t\t\t\t(default: text)"
+msgstr "\t\t\t\t\t(predefinito: testo)"
+
+#: abook.c:428
+msgid "\t--outfile\t<file>\t\tdestination file"
+msgstr "\t--outfile\t<file>\t\tfile di destinazione"
+
+#: abook.c:429
+msgid "\t\t\t\t\t(default: stdout)"
+msgstr "\t\t\t\t\t(predefinito: standard output)"
+
+#: abook.c:430
+msgid "\t--formats\t\t\tlist available formats"
+msgstr "\t--formats\t\t\tlista dei formati disponibili"
+
+#: abook.c:501
+#, c-format
+msgid "Cannot open database\n"
+msgstr "Non posso aprire il database\n"
+
+#: abook.c:627
+#, c-format
+msgid "too few arguments to make conversion\n"
+msgstr "argomenti insufficienti per convertire\n"
+
+#: abook.c:628
+#, c-format
+msgid "try --help\n"
+msgstr "prova --help\n"
+
+#: abook.c:633
+#, c-format
+msgid ""
+"input and output formats are the same\n"
+"exiting...\n"
+msgstr ""
+"i formati di input e output sono gli stessi\n"
+"uscita...\n"
+
+#: abook.c:647
+#, c-format
+msgid "input format %s not supported\n"
+msgstr "formato di input %s non supportato\n"
+
+#: abook.c:651
+#, c-format
+msgid "cannot read file %s\n"
+msgstr "non posso leggere il file %s\n"
+
+#: abook.c:660
+#, c-format
+msgid "output format %s not supported\n"
+msgstr "formato di output %s non supportato\n"
+
+#: abook.c:666
+#, c-format
+msgid "cannot write file %s\n"
+msgstr "non posso scrivere il file %s\n"
+
+#: abook.c:687
+#, c-format
+msgid "cannot open %s\n"
+msgstr "non posso aprire %s\n"
+
+#: abook.c:690
+#, c-format
+msgid "%d item(s) added to %s\n"
+msgstr "%d oggetto/i aggiunto/i a %s\n"
+
+#: abook.c:692
+msgid "Valid sender address not found"
+msgstr "Impossibile trovare un valido indirizzo del mittente"
+
+#: abook.c:732
+#, c-format
+msgid "Address %s already in addressbook\n"
+msgstr "Indirizzo %s già presente in rubrica\n"
+
+#: abook.c:742
+#, c-format
+msgid ""
+"cannot open /dev/tty\n"
+"you may want to use --add-email-quiet\n"
+msgstr ""
+"non posso aprire /dev/tty\n"
+"puoi usare --add-email-quiet\n"
+
+#: abook.c:748
+#, c-format
+msgid "Add \"%s <%s>\" to %s? (%c/%c)\n"
+msgstr "Aggiungi \"%s <%s>\" a %s? (%c/%c)\n"
+
+#: abook.c:752 abook.c:759 ui.c:343 ui.c:609
+msgid "keybinding for yes|y"
+msgstr "s"
+
+#: abook.c:753 abook.c:755 ui.c:341
+msgid "keybinding for no|n"
+msgstr "n"
+
+#: abook.c:780
+#, c-format
+msgid "stdin is a directory or cannot stat stdin\n"
+msgstr "standard input è una directory o non posso usare standard input\n"
+
+#: abook.h:16
+msgid "q:quit  ?:help  a:add  r:remove"
+msgstr "q:esci  ?:aiuto  a:aggiungi  r:cancella"
+
+#: database.c:45
+msgid "Name"
+msgstr "Nome"
+
+#: database.c:46
+msgid "E-mail addresses"
+msgstr "Indirizzi e-mail"
+
+#: database.c:47
+msgid "Address"
+msgstr "Indirizzo"
+
+#: database.c:48
+msgid "Address2"
+msgstr "Secondo Indirizzo"
+
+#: database.c:49
+msgid "City"
+msgstr "Città"
+
+#: database.c:50
+msgid "State/Province"
+msgstr "Stato/Provincia"
+
+#: database.c:51
+msgid "ZIP/Postal Code"
+msgstr "CAP"
+
+#: database.c:52
+msgid "Country"
+msgstr "Paese"
+
+#: database.c:53
+msgid "Home Phone"
+msgstr "Tel. Casa"
+
+#: database.c:54
+msgid "Work Phone"
+msgstr "Tel. Ufficio"
+
+#: database.c:55
+msgid "Fax"
+msgstr "Fax"
+
+#: database.c:56
+msgid "Mobile"
+msgstr "Cellulare"
+
+#: database.c:57
+msgid "Nickname/Alias"
+msgstr "Soprannome"
+
+#: database.c:58
+msgid "URL"
+msgstr "Sito Internet"
+
+#: database.c:59
+msgid "Notes"
+msgstr "Note"
+
+#: database.c:60
+msgid "Anniversary day"
+msgstr "Anniversario"
+
+#: database.c:166
+msgid "field already defined"
+msgstr "campo già definito"
+
+#: database.c:170
+msgid "standard field does not need to be declared"
+msgstr "campo standard non necessita dichiarazione"
+
+#: database.c:185
+msgid "unknown type"
+msgstr "tipo sconosciuto"
+
+#: database.c:585
+msgid "Invalid field value defined in configuration"
+msgstr "Valore di campo errato nella configurazione"
+
+#: database.c:588
+msgid "Invalid field value for sorting"
+msgstr "Valore di campo errato per l'ordinamento"
+
+#: edit.c:51
+msgid "Tab name too wide for screen"
+msgstr "Nome etichetta troppo largo per lo schermo"
+
+#: edit.c:353
+msgid "keybindings_new_123456789|n123456789"
+msgstr "keybindings_new_123456789|n123456789"
+
+#: edit.c:355
+#, c-format
+msgid "Choose %s to modify (<1>%s%c%s%s."
+msgstr "Scegli %s per modificare (<1>%s%c%s%s."
+
+#: edit.c:356
+msgid "email"
+msgstr "email"
+
+#: edit.c:356
+msgid "item"
+msgstr "oggetto"
+
+#: edit.c:361
+msgid " or <n>ew"
+msgstr "o <n>uovo"
+
+#: edit.c:379
+msgid "E-mail: "
+msgstr "E-mails:"
+
+#: edit.c:379
+msgid "Item: "
+msgstr "Oggetto:"
+
+#: edit.c:465
+msgid "Day: "
+msgstr ""
+
+#: edit.c:465
+msgid "Month: "
+msgstr ""
+
+#: edit.c:465
+msgid "Year (optional): "
+msgstr ""
+
+#: edit.c:498
+#, fuzzy
+msgid "Invalid date"
+msgstr "valore non valido"
+
+#: edit.c:653
+msgid "Name: "
+msgstr "Nome: "
+
+#: edit.h:14
+msgid "?:help q:quit editor"
+msgstr "?:aiuto q:esci editor"
+
+#: filter.c:71 filter.c:82
+msgid "abook native format"
+msgstr "formato nativo di abook"
+
+#: filter.c:72
+msgid "ldif / Netscape addressbook"
+msgstr "ldif / rubrica Netscape"
+
+#: filter.c:73 filter.c:84
+msgid "mutt alias"
+msgstr "alias di mutt"
+
+#: filter.c:74 filter.c:86
+msgid "pine addressbook"
+msgstr "rubrica di Pine"
+
+#: filter.c:75 filter.c:88
+msgid "comma separated values"
+msgstr "valori separati da virgole"
+
+#: filter.c:76 filter.c:89
+msgid "comma separated values (all fields)"
+msgstr "valori separati da virgole (tutti i campi)"
+
+#: filter.c:77 filter.c:90
+msgid "Palm comma separated values"
+msgstr "Valori separati da virgole per Palm"
+
+#: filter.c:83
+msgid "ldif / Netscape addressbook (.4ld)"
+msgstr "ldif / rubrica Netscape (.4ld)"
+
+#: filter.c:85
+msgid "html document"
+msgstr "documento html"
+
+#: filter.c:87
+msgid "GnomeCard (VCard) addressbook"
+msgstr "Rubrica GnomeCard (VCard)"
+
+#: filter.c:91
+msgid "elm alias"
+msgstr "alias di elm"
+
+#: filter.c:92
+msgid "plain text"
+msgstr "testo puro"
+
+#: filter.c:93
+msgid "Wanderlust address book"
+msgstr "Rubrica Wanderlust"
+
+#: filter.c:94
+msgid "Spruce address book"
+msgstr "Rubrica Spruce"
+
+#: filter.c:95
+msgid "BSD calendar"
+msgstr ""
+
+#: filter.c:108
+msgid "input:"
+msgstr "input:"
+
+#: filter.c:115
+msgid "output:"
+msgstr "output:"
+
+#: filter.c:180
+msgid "import database"
+msgstr "importa un database"
+
+#: filter.c:182 filter.c:299
+msgid "please select a filter"
+msgstr "seleziona un filtro"
+
+#: filter.c:190 filter.c:307
+msgid "x -\tcancel"
+msgstr "x -\tcancella"
+
+#: filter.c:211 filter.c:345
+msgid "Filename: "
+msgstr "Nome del file:"
+
+#: filter.c:218
+msgid "Error occured while opening the file"
+msgstr "Errore nell'apertura del file"
+
+#: filter.c:220
+msgid "File does not seem to be a valid addressbook"
+msgstr "Il file non sembra essere una rubrica valida"
+
+#: filter.c:297
+msgid "export database"
+msgstr "esporta il database"
+
+#: filter.c:330
+msgid "Export <a>ll, export <s>elected, or <c>ancel?"
+msgstr "Esporta <t>utti, esporta <s>elezionati, o <c>ancella?"
+
+#: filter.c:331 ui.c:632
+msgid "keybindings:all/selected/cancel|asc"
+msgstr "tsc"
+
+#: filter.c:352
+msgid "Error occured while exporting"
+msgstr "Errore nell'esportazione"
+
+#: filter.c:1896
+#, c-format
+msgid "%02d/%02d\tAnniversary of %s\n"
+msgstr ""
+
+#: help.h:11
+msgid "\t?\t\thelp\n"
+msgstr "\t?\t\taiuto\n"
+
+#: help.h:12
+msgid "\tq\t\tquit\n"
+msgstr "\tq\t\tesci\n"
+
+#: help.h:13
+msgid "\tQ\t\tquit without saving\n"
+msgstr "\tQ\t\tesci senza salvare\n"
+
+#: help.h:14
+msgid "\tP\t\tquit and output selected item(s) to stderr\n"
+msgstr ""
+"\tP\t\tesci e restituisci gli oggetti\n"
+"\t\t\tselezionati su stderr\n"
+
+#: help.h:15
+msgid "\t^L\t\trefresh screen\n"
+msgstr "\t^L\t\tridisegna lo schermo\n"
+
+#: help.h:17
+msgid "\tarrows / j,k\tscroll list\n"
+msgstr "\tarrows / j,k\tscorri la lista\n"
+
+#: help.h:18
+msgid "\tenter\t\tview/edit item\n"
+msgstr "\tenter\t\tmostra/modifica oggetto\n"
+
+#: help.h:19
+msgid "\ta\t\tadd item\n"
+msgstr "\ta\t\taggiungi oggetto\n"
+
+#: help.h:20
+msgid "\tr / del\t\tremove selected items\n"
+msgstr "\tr / del\t\tcancella oggetti selezionati\n"
+
+#: help.h:21
+msgid "\tD\t\tduplicate item\n"
+msgstr "\tD\t\tduplica oggetto\n"
+
+#: help.h:23
+msgid "\tspace\t\tselect item\n"
+msgstr "\tspace\t\tseleziona oggetto\n"
+
+#: help.h:24
+msgid "\t+\t\tselect all\n"
+msgstr "\t+\t\tseleziona tutti\n"
+
+#: help.h:25
+msgid "\t-\t\tunselect all\n"
+msgstr "\t-\t\tdeseleziona tutti\n"
+
+#: help.h:26
+msgid "\t*\t\tinvert selection\n"
+msgstr "\t*\t\tinverti selezione\n"
+
+#: help.h:28
+msgid "\tw\t\twrite database to disk\n"
+msgstr "\tw\t\tscrivi database su disco\n"
+
+#: help.h:29
+msgid "\tl\t\tread database from disk\n"
+msgstr "\tl\t\tleggi database da disco\n"
+
+#: help.h:30
+msgid "\tC\t\tclear whole database\n"
+msgstr "\tC\t\tcancella l'intero database\n"
+
+#: help.h:31
+msgid "\ti\t\timport database\n"
+msgstr "\ti\t\timporta database\n"
+
+#: help.h:32
+msgid "\te\t\texport database\n"
+msgstr "\te\t\tesporta database\n"
+
+#: help.h:33
+msgid "\tp\t\tprint database\n"
+msgstr "\tp\t\tstampa database\n"
+
+#: help.h:34
+msgid "\to\t\topen database\n"
+msgstr "\to\t\tapri database\n"
+
+#: help.h:36
+msgid "\ts\t\tsort database\n"
+msgstr "\ts\t\tordina database\n"
+
+#: help.h:37
+msgid "\tS\t\t\"surname sort\"\n"
+msgstr "\tS\t\tordinamento per cognome\n"
+
+#: help.h:38
+msgid "\tF\t\tsort by field (defined in configuration file)\n"
+msgstr ""
+"\tF\t\tordina per campo (definito nel file di\n"
+"\t\t\tconfigurazione)\n"
+
+#: help.h:40
+msgid "\t/\t\tsearch\n"
+msgstr "\t/\t\tcerca\n"
+
+#: help.h:41
+msgid "\t\\\t\tsearch next occurrence\n"
+msgstr "\t\\\t\tricerca occorrenza successiva\n"
+
+#: help.h:43
+msgid "\tA\t\tmove current item up\n"
+msgstr "\tA\t\tmuovi oggetto corrente in alto\n"
+
+#: help.h:44
+msgid "\tZ\t\tmove current item down\n"
+msgstr "\tZ\t\tmuovi oggetto corrente in basso\n"
+
+#: help.h:46
+msgid "\tm\t\tsend mail with mutt\n"
+msgstr "\tm\t\tspedisci mail con mutt\n"
+
+#: help.h:47
+msgid "\tv\t\tview URL with web browser\n"
+msgstr "\tv\t\tmostra URL con browser html\n"
+
+#: help.h:55
+msgid "\tarrows/h,l\t\tchange tab\n"
+msgstr "\tfrecce/h,l\tcambia tab\n"
+
+#: help.h:57
+msgid "\tq\t\t\tquit to main screen\n"
+msgstr "\tq\t\t\tvai allo schermo principale\n"
+
+#: help.h:59
+msgid "\t1 - 5 A - Z\t\tedit fields\n"
+msgstr "\t1 - 5 A - Z\t\tmodifica campi\n"
+
+#: help.h:61
+msgid "\tk or <\t\t\tprevious item\n"
+msgstr "\tk or <\t\t\toggetto precedente\n"
+
+#: help.h:62
+msgid "\tj or >\t\t\tnext item\n"
+msgstr "\tj or >\t\t\toggetto successivo\n"
+
+#: help.h:64
+msgid "\tr\t\t\troll e-mail addresses up\n"
+msgstr "\tr\t\t\tporta verso l'alto indirizzi e-mail\n"
+
+#: help.h:65
+msgid "\tESC-r\t\t\troll e-mail addresses down\n"
+msgstr "\tESC-r\t\t\tporta verso il basso indirizzi e-mail\n"
+
+#: help.h:67
+msgid "\tu\t\t\tundo\n"
+msgstr "\tu\t\t\tannulla\n"
+
+#: help.h:69
+msgid "\tm\t\t\tsend mail with mutt\n"
+msgstr "\tm\t\t\tspedisci mail con mutt\n"
+
+#: help.h:70
+msgid "\tv\t\t\tview url with web browser\n"
+msgstr "\tv\t\t\tmostra url con browser html\n"
+
+#: options.c:250
+msgid "quote mismatch"
+msgstr "manca una virgoletta"
+
+#: options.c:256
+msgid "no assignment character found"
+msgstr "errore di assegnamento"
+
+#: options.c:259
+msgid "error in comma separated list"
+msgstr "errore nei valori separati da virgole"
+
+#: options.c:289 options.c:308
+msgid "invalid value"
+msgstr "valore non valido"
+
+#: options.c:329
+msgid "unknown option"
+msgstr "opzione sconosciuta"
+
+#: options.c:341
+#, c-format
+msgid ""
+"valid values for the 'preserve_fields' option are 'all', "
+"'standard' (default), and 'none'\n"
+msgstr ""
+"valori validi per l'opzione 'preserved_fields' sono 'all', "
+"'standard' (predefinito), e  'none'\n"
+
+#: options.c:350
+#, c-format
+msgid ""
+"valid values for the 'address_style' option are 'eu' (default), 'uk', and "
+"'us'\n"
+msgstr ""
+"valori validi per l'opzione 'address_style' sono 'eu' (predefinito), 'uk', e "
+"'us'\n"
+
+#: options.c:372
+msgid "invalid value assignment"
+msgstr "assegnazione di valore errata"
+
+#: options.c:380
+msgid ""
+"customfield: obsolete command - please use the 'field' and 'view' commands "
+"instead"
+msgstr "customfield: comando obsoleto - usare i comandi 'field' e 'view'"
+
+#: options.c:398
+msgid "no view name provided"
+msgstr "nessun nome della vista fornito"
+
+#: options.c:428
+msgid "no field identifier provided"
+msgstr "nessun identificatore di campo fornito"
+
+#: options.c:434
+msgid "no field name provided"
+msgstr "nome campo non fornito"
+
+#: options.c:490
+#, c-format
+msgid "%s: parse error at line %d: "
+msgstr "%s: errore interpretazione linea %d: "
+
+#: options.c:494
+#, c-format
+msgid "unknown token %s\n"
+msgstr "istruzione %s sconosciuta\n"
+
+#: ui.c:145
+#, c-format
+msgid "Your terminal size is %dx%d\n"
+msgstr "La dimensione del terminale è %dx%d\n"
+
+#: ui.c:146
+#, c-format
+msgid "Terminal is too small. Minimum terminal size for abook is %dx%d\n"
+msgstr ""
+"Il terminale è troppo piccolo. La dimensione minima per abook è %dx%d\n"
+
+#: ui.c:332
+msgid " (Y/n)?"
+msgstr " (S/n)?"
+
+#: ui.c:332
+msgid " (y/N)?"
+msgstr " (s/N)?"
+
+#: ui.c:410
+msgid "help"
+msgstr "aiuto"
+
+#: ui.c:419
+msgid "Press any key to continue..."
+msgstr "Premi un tasto per continuare..."
+
+#: ui.c:539
+msgid "Remove selected item(s)"
+msgstr "Cancella l'oggetto/gli oggetti selezionato/i"
+
+#: ui.c:549
+msgid "Clear WHOLE database"
+msgstr "Cancella TUTTO il database"
+
+#: ui.c:582
+msgid "Search hit bottom, continuing at top"
+msgstr "La ricerca è finita, continuo dall'inizio"
+
+#: ui.c:607
+#, c-format
+msgid "Your current data will be lost - Press '%c' to continue"
+msgstr "I dati correnti saranno persi - Premi '%c' per continuare"
+
+#: ui.c:632
+msgid "Print <a>ll, print <s>elected, or <c>ancel?"
+msgstr "Stampa <t>utti, stampa <s>elezionati, o <c>ancella?"
+
+#: ui.c:638
+msgid "No selected items"
+msgstr "Nessun oggetto selezionato"
+
+#: ui.c:664
+msgid "File to open: "
+msgstr "File da aprire:"
+
+#: ui.c:674
+msgid "Save current database"
+msgstr "Salva il database corrente"
+
+#: ui.c:682
+msgid "Sorry, the specified file appears not to be a valid abook addressbook"
+msgstr "Mi dispiace, il file selezionato non è una rubrica valida per Abook"
+
+#: views.c:87
+msgid "undeclared field"
+msgstr "campo non dichiarato"
+
+#: views.c:92
+msgid "maximal number of fields per view reached"
+msgstr "raggiunto numero massimo di campi per vista"
+
+#: views.c:95
+msgid "field already in this view"
+msgstr "campo già presente in questa vista"
+
+#: views.c:139
+msgid "CONTACT"
+msgstr "CONTATTO"
+
+#: views.c:140
+msgid "ADDRESS"
+msgstr "INDIRIZZO"
+
+#: views.c:142
+msgid "PHONE"
+msgstr "TELEFONO"
+
+#: views.c:143
+msgid "OTHER"
+msgstr "ALTRO"
+
+#: views.c:165 views.c:166 views.c:167 views.c:168 views.c:169
+msgid "CUSTOM"
+msgstr "PERSONALIZZATO"
+
+#: views.c:165
+msgid "Custom1"
+msgstr "Personalizzato 1"
+
+#: views.c:166
+msgid "Custom2"
+msgstr "Personalizzato 2"
+
+#: views.c:167
+msgid "Custom3"
+msgstr "Personalizzato 3"
+
+#: views.c:168
+msgid "Custom4"
+msgstr "Personalizzato 4"
+
+#: views.c:169
+msgid "Custom5"
+msgstr "Personalizzato 5"
+
+#~ msgid "sorry, input for this field type is not yet implemented"
+#~ msgstr "mi dispiace, questo tipo di campo non e' ancora stato implementato"
+
+#~ msgid "?:help c:contact a:address p:phone o:other"
+#~ msgstr "?:aiuto c:contatto a:indirizzo p:telefono o:altro"
+
+#~ msgid "invalid custom field number"
+#~ msgstr "numero di campo personalizzato non valido"
index 3acef2815f70cd2f8c443613c3ef5edd1133f04c..62a5a7192b47735151240c8b6203e607e871b1e6 100644 (file)
Binary files a/po/ja.gmo and b/po/ja.gmo differ
index 8eb5e5bfa9d90cb3c7e40f6c1160c3712061349e..907ad4ca0c43882243eec1b291922b47391c85e8 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -4,8 +4,8 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: 0.5.5\n"
-"Report-Msgid-Bugs-To: <cedricduval+abook@free.fr>\n"
-"POT-Creation-Date: 2005-12-06 07:50+0200\n"
+"Report-Msgid-Bugs-To: <abook-devel@lists.sourceforge.net>\n"
+"POT-Creation-Date: 2006-09-06 17:14+0300\n"
 "PO-Revision-Date: 2005-10-18 18:10+0200\n"
 "Last-Translator: TAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>\n"
 "Language-Team: japanese\n"
@@ -13,49 +13,49 @@ msgstr ""
 "Content-Type: text/plain; charset=euc-jp\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: abook.c:91
+#: abook.c:93
 #, c-format
 msgid "Cannot create directory %s\n"
 msgstr "¥Ç¥£¥ì¥¯¥È¥ê %s ¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó\n"
 
-#: abook.c:97
+#: abook.c:99
 #, c-format
 msgid "%s is not a directory\n"
 msgstr "%s ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó\n"
 
-#: abook.c:115
+#: abook.c:117
 #, c-format
 msgid "Memory allocation failure: %s\n"
 msgstr "¥á¥â¥ê¼èÆÀ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿: %s\n"
 
-#: abook.c:126
+#: abook.c:128
 #, c-format
 msgid "Press enter to continue...\n"
 msgstr "³¤±¤ë¤Ë¤Ï Enter ¥­¡¼¤ò...\n"
 
-#: abook.c:138
+#: abook.c:143
 #, c-format
 msgid "File %s is not writeable"
 msgstr "¥Õ¥¡¥¤¥ë %s ¤Ï½ñ¤­¹þ¤ßÉÔ²Äǽ¤Ç¤¹"
 
-#: abook.c:143
+#: abook.c:148
 msgid "If you continue all changes will be lost. Do you want to continue?"
 msgstr "¤³¤Î¤Þ¤Þ¤À¤ÈÊѹ¹ÅÀ¤¬¤¹¤Ù¤Æ¾Ã¤¨¤Æ¤·¤Þ¤¤¤Þ¤¹¤¬¡¢Â³¤±¤Æ¤â¤è¤í¤·¤¤¤Ç¤¹¤«?"
 
-#: abook.c:162
+#: abook.c:167
 msgid "Save database"
 msgstr "¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÊݸ"
 
-#: abook.c:164
+#: abook.c:169
 msgid "Quit without saving"
 msgstr "Êݸ¤»¤º¤Ë½ªÎ»"
 
-#: abook.c:218
+#: abook.c:225
 #, c-format
 msgid "%s is not a valid HOME directory\n"
 msgstr "%s ¤ÏÀµ¤·¤¤ HOME ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó\n"
 
-#: abook.c:249
+#: abook.c:256
 #, c-format
 msgid ""
 "Cannot combine options --mutt-query, --convert, --add-email or --add-email-"
@@ -64,35 +64,35 @@ msgstr ""
 "¼¡¤Î¥ª¥×¥·¥ç¥ó¤òƱ»þ¤ËÊ£¿ô»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó: --mutt-query, --convert, "
 "--add-email, --add-email-quiet\n"
 
-#: abook.c:280
+#: abook.c:287
 #, c-format
 msgid "please use option --%s after --convert option\n"
 msgstr "--%s ¥ª¥×¥·¥ç¥ó¤Ï --convert ¥ª¥×¥·¥ç¥ó¤Î¸å¤Ë»ØÄꤷ¤Æ¤¯¤À¤µ¤¤\n"
 
-#: abook.c:379
+#: abook.c:386
 #, c-format
 msgid "%s: unrecognized arguments on command line\n"
 msgstr "%s: Ç§¼±¤Ç¤­¤Ê¤¤¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¿ô¤Ç¤¹\n"
 
-#: abook.c:401
+#: abook.c:408
 msgid "     -h\t--help\t\t\t\tshow usage"
 msgstr "     -h\t--help\t\t\t\t»ÈÍÑÊýË¡"
 
-#: abook.c:402
+#: abook.c:409
 msgid "     -C\t--config\t<file>\t\tuse an alternative configuration file"
 msgstr ""
 "     -C\t--config\t<¥Õ¥¡¥¤¥ë>\t\tÄ̾ï¤Î¾ì½ê°Ê³°¤Ë¤¢¤ëÀßÄê¥Õ¥¡¥¤¥ë¤ò»È¤¦"
 
-#: abook.c:403
+#: abook.c:410
 msgid "\t--datafile\t<file>\t\tuse an alternative addressbook file"
 msgstr ""
 "\t--datafile\t<¥Õ¥¡¥¤¥ë>\t\tÄ̾ï¤Î¾ì½ê°Ê³°¤Ë¤¢¤ë¥¢¥É¥ì¥¹Ä¢¥Õ¥¡¥¤¥ë¤ò»È¤¦"
 
-#: abook.c:404
+#: abook.c:411
 msgid "\t--mutt-query\t<string>\tmake a query for mutt"
 msgstr "\t--mutt-query\t<ʸ»úÎó>\tÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ mutt ÍѤËÀ°·Á½ÐÎϤ¹¤ë"
 
-#: abook.c:405
+#: abook.c:412
 msgid ""
 "\t--add-email\t\t\tread an e-mail message from stdin and\n"
 "\t\t\t\t\tadd the sender to the addressbook"
@@ -100,7 +100,7 @@ msgstr ""
 "\t--add-email\t\t\t¥á¡¼¥ë¤òɸ½àÆþÎϤ«¤éÆɤ߽Ф·¤Æ\n"
 "\t\t\t\t\t¤½¤Îº¹½Ð¿Í¤ò¥¢¥É¥ì¥¹Ä¢¤ËÄɲ乤ë"
 
-#: abook.c:409
+#: abook.c:416
 msgid ""
 "\t--add-email-quiet\t\tsame as --add-email but doesn't\n"
 "\t\t\t\t\trequire to confirm adding"
@@ -108,66 +108,66 @@ msgstr ""
 "\t--add-email-quiet\t\t--add-email ¤ÈƱ¤¸¡£¤¿¤À¤·\n"
 "\t\t\t\t\tÄɲ乤ëÁ°¤Ë³Îǧ¤òµá¤á¤Ê¤¤"
 
-#: abook.c:413
+#: abook.c:420
 msgid "\t--convert\t\t\tconvert address book files"
 msgstr "\t--convert\t\t\t¥¢¥É¥ì¥¹Ä¢¥Õ¥¡¥¤¥ë¤ò¾·Á¼°¤ØÊÑ´¹¤¹¤ë"
 
-#: abook.c:414
+#: abook.c:421
 msgid "\toptions to use with --convert:"
 msgstr "\t--convert ¤Ç»È¤¦¥ª¥×¥·¥ç¥ó:"
 
-#: abook.c:415
+#: abook.c:422
 msgid "\t--informat\t<format>\tformat for input file"
 msgstr "\t--informat\t<·Á¼°>\tÊÑ´¹¸µ¥Õ¥¡¥¤¥ë¤Î·Á¼°"
 
-#: abook.c:416
+#: abook.c:423
 msgid "\t\t\t\t\t(default: abook)"
 msgstr "\t\t\t\t\t(´ûÄêÃÍ: abook)"
 
-#: abook.c:417
+#: abook.c:424
 msgid "\t--infile\t<file>\t\tsource file"
 msgstr "\t--infile\t<¥Õ¥¡¥¤¥ë>\t\tÊÑ´¹¸µ¥Õ¥¡¥¤¥ë"
 
-#: abook.c:418
+#: abook.c:425
 msgid "\t\t\t\t\t(default: stdin)"
 msgstr "\t\t\t\t\t(´ûÄêÃÍ: É¸½àÆþÎÏ)"
 
-#: abook.c:419
+#: abook.c:426
 msgid "\t--outformat\t<format>\tformat for output file"
 msgstr "\t--outformat\t<·Á¼°>\t½ÐÎÏÀè¥Õ¥¡¥¤¥ë¤Î·Á¼°"
 
-#: abook.c:420
+#: abook.c:427
 msgid "\t\t\t\t\t(default: text)"
 msgstr "\t\t\t\t\t(´ûÄêÃÍ: text)"
 
-#: abook.c:421
+#: abook.c:428
 msgid "\t--outfile\t<file>\t\tdestination file"
 msgstr "\t--outfile\t<¥Õ¥¡¥¤¥ë>\t\t½ÐÎÏÀè¥Õ¥¡¥¤¥ë"
 
-#: abook.c:422
+#: abook.c:429
 msgid "\t\t\t\t\t(default: stdout)"
 msgstr "\t\t\t\t\t(´ûÄêÃÍ: É¸½à½ÐÎÏ)"
 
-#: abook.c:423
+#: abook.c:430
 msgid "\t--formats\t\t\tlist available formats"
 msgstr "\t--formats\t\t\tÍøÍѲÄǽ¤Ê·Á¼°°ìÍ÷¤òɽ¼¨¤¹¤ë"
 
-#: abook.c:494
+#: abook.c:501
 #, c-format
 msgid "Cannot open database\n"
 msgstr "¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬³«¤±¤Þ¤»¤ó\n"
 
-#: abook.c:620
+#: abook.c:627
 #, c-format
 msgid "too few arguments to make conversion\n"
 msgstr "ÊÑ´¹¤ËɬÍפʥª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó\n"
 
-#: abook.c:621
+#: abook.c:628
 #, c-format
 msgid "try --help\n"
 msgstr "--help ¤ò¤´Í÷¤¯¤À¤µ¤¤\n"
 
-#: abook.c:626
+#: abook.c:633
 #, c-format
 msgid ""
 "input and output formats are the same\n"
@@ -176,46 +176,46 @@ msgstr ""
 "ÆþÎϤȽÐÎϤηÁ¼°¤¬Æ±¤¸¤Ç¤¹\n"
 "½ªÎ»¤·¤Þ¤¹\n"
 
-#: abook.c:639
+#: abook.c:647
 #, c-format
 msgid "input format %s not supported\n"
 msgstr "ÆþÎÏ·Á¼°¤È¤·¤Æ %s ¤Ï¤´ÍøÍѤ¤¤¿¤À¤±¤Þ¤»¤ó\n"
 
-#: abook.c:643
+#: abook.c:651
 #, c-format
 msgid "cannot read file %s\n"
 msgstr "¥Õ¥¡¥¤¥ë %s ¤¬Æɤ߽Ф»¤Þ¤»¤ó\n"
 
-#: abook.c:652
+#: abook.c:660
 #, c-format
 msgid "output format %s not supported\n"
 msgstr "½ÐÎÏ·Á¼°¤È¤·¤Æ %s ¤Ï¤´ÍøÍѤ¤¤¿¤À¤±¤Þ¤»¤ó\n"
 
-#: abook.c:658
+#: abook.c:666
 #, c-format
 msgid "cannot write file %s\n"
 msgstr "¥Õ¥¡¥¤¥ë %s ¤Ë½ñ¤­¹þ¤á¤Þ¤»¤ó\n"
 
-#: abook.c:679
+#: abook.c:687
 #, c-format
 msgid "cannot open %s\n"
 msgstr "%s ¤¬³«¤±¤Þ¤»¤ó\n"
 
-#: abook.c:682
+#: abook.c:690
 #, c-format
 msgid "%d item(s) added to %s\n"
 msgstr "%d ¸Ä¤Î¹àÌܤò %s ¤ËÄɲä·¤Þ¤·¤¿\n"
 
-#: abook.c:684
+#: abook.c:692
 msgid "Valid sender address not found"
 msgstr "ǧ¼±²Äǽ¤Êº¹½Ð¿Í¥¢¥É¥ì¥¹¤¬¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿"
 
-#: abook.c:724
+#: abook.c:732
 #, c-format
 msgid "Address %s already in addressbook\n"
 msgstr "¥¢¥É¥ì¥¹ %s ¤Ï´û¤Ë¥¢¥É¥ì¥¹Ä¢¤ËÆþ¤Ã¤Æ¤¤¤Þ¤¹\n"
 
-#: abook.c:734
+#: abook.c:742
 #, c-format
 msgid ""
 "cannot open /dev/tty\n"
@@ -224,20 +224,20 @@ msgstr ""
 "/dev/tty ¤¬³«¤±¤Þ¤»¤ó\n"
 "--add-email-quiet ¤ò¤´ÍøÍѤˤʤä¿Êý¤¬Îɤ¤¤«¤â¤·¤ì¤Þ¤»¤ó\n"
 
-#: abook.c:740
+#: abook.c:748
 #, c-format
 msgid "Add \"%s <%s>\" to %s? (%c/%c)\n"
 msgstr "\"%s <%s>\" ¤ò %s ¤ËÄɲä·¤Þ¤¹¤«? (%c/%c)\n"
 
-#: abook.c:744 abook.c:751 ui.c:344 ui.c:606
+#: abook.c:752 abook.c:759 ui.c:343 ui.c:609
 msgid "keybinding for yes|y"
 msgstr "y"
 
-#: abook.c:745 abook.c:747 ui.c:342
+#: abook.c:753 abook.c:755 ui.c:341
 msgid "keybinding for no|n"
 msgstr "n"
 
-#: abook.c:771
+#: abook.c:780
 #, c-format
 msgid "stdin is a directory or cannot stat stdin\n"
 msgstr "ɸ½àÆþÎϤ¬¥Ç¥£¥ì¥¯¥È¥ê¤«¡¢stat ÉÔ²Äǽ¤Ç¤¹\n"
@@ -246,121 +246,153 @@ msgstr "ɸ
 msgid "q:quit  ?:help  a:add  r:remove"
 msgstr "q:½ªÎ»  ?:¥Ø¥ë¥×  a:Äɲà r:ºï½ü"
 
-#: database.c:57
+#: database.c:45
 msgid "Name"
 msgstr "»á̾"
 
-#: database.c:58
-msgid "E-mails"
-msgstr "¥¢¥É¥ì¥¹"
+#: database.c:46
+#, fuzzy
+msgid "E-mail addresses"
+msgstr "¥á¡¼¥ë¥¢¥É¥ì¥¹: "
 
-#: database.c:59
+#: database.c:47
 msgid "Address"
 msgstr "½»½ê"
 
-#: database.c:60
+#: database.c:48
 msgid "Address2"
 msgstr "½»½ê2"
 
-#: database.c:61
+#: database.c:49
 msgid "City"
 msgstr "»ÔĮ¼"
 
-#: database.c:62
+#: database.c:50
 msgid "State/Province"
 msgstr "ÅÔÆ»Éܸ©"
 
-#: database.c:63
+#: database.c:51
 msgid "ZIP/Postal Code"
 msgstr "͹ÊØÈÖ¹æ"
 
-#: database.c:64
+#: database.c:52
 msgid "Country"
 msgstr "¹ñ"
 
-#: database.c:65
+#: database.c:53
 msgid "Home Phone"
 msgstr "¼«ÂðÅÅÏÃ"
 
-#: database.c:66
+#: database.c:54
 msgid "Work Phone"
 msgstr "¿¦¾ìÅÅÏÃ"
 
-#: database.c:67
+#: database.c:55
 msgid "Fax"
 msgstr "Fax"
 
-#: database.c:68
+#: database.c:56
 msgid "Mobile"
 msgstr "·ÈÂÓÅÅÏÃ"
 
-#: database.c:69
+#: database.c:57
 msgid "Nickname/Alias"
 msgstr "ÊÌ̾¡¦Î¬¹æ"
 
-#: database.c:70
+#: database.c:58
 msgid "URL"
 msgstr "URL"
 
-#: database.c:71
+#: database.c:59
 msgid "Notes"
 msgstr "¥á¥â"
 
-#: database.c:72
-msgid "Custom1"
-msgstr "³ÈÄ¥¾ðÊó1"
-
-#: database.c:73
-msgid "Custom2"
-msgstr "³ÈÄ¥¾ðÊó2"
+#: database.c:60
+msgid "Anniversary day"
+msgstr ""
 
-#: database.c:74
-msgid "Custom3"
-msgstr "³ÈÄ¥¾ðÊó3"
+#: database.c:166
+msgid "field already defined"
+msgstr ""
 
-#: database.c:75
-msgid "Custom4"
-msgstr "³ÈÄ¥¾ðÊó4"
+#: database.c:170
+msgid "standard field does not need to be declared"
+msgstr ""
 
-#: database.c:76
-msgid "Custom5"
-msgstr "³ÈÄ¥¾ðÊó5"
+#: database.c:185
+#, fuzzy
+msgid "unknown type"
+msgstr "ÉÔÌÀ¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹"
 
-#: database.c:424
+#: database.c:585
 msgid "Invalid field value defined in configuration"
 msgstr "ÉÔÀµ¤Ê¹àÌÜ̾¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹"
 
-#: edit.c:44
-msgid "CONTACT"
-msgstr "Ï¢ÍíÀè"
+#: database.c:588
+#, fuzzy
+msgid "Invalid field value for sorting"
+msgstr "ÉÔÀµ¤Ê¹àÌÜ̾¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹"
 
-#: edit.c:45
-msgid "ADDRESS"
-msgstr " ½»½ê "
+#: edit.c:51
+msgid "Tab name too wide for screen"
+msgstr "¥¿¥Ö̾¤¬²èÌ̤«¤é¤Ï¤ß½Ð¤Þ¤¹"
 
-#: edit.c:46
-msgid " PHONE "
-msgstr " ÅÅÏà"
+#: edit.c:353
+msgid "keybindings_new_123456789|n123456789"
+msgstr ""
 
-#: edit.c:47
-msgid " OTHER "
-msgstr "¤½¤Î¾"
+#: edit.c:355
+#, c-format
+msgid "Choose %s to modify (<1>%s%c%s%s."
+msgstr ""
 
-#: edit.c:48
-msgid "CUSTOM "
-msgstr " ³ÈÄ¥ "
+#: edit.c:356
+#, fuzzy
+msgid "email"
+msgstr "¥¢¥É¥ì¥¹"
 
-#: edit.c:57
-msgid "Tab name too wide for screen"
-msgstr "¥¿¥Ö̾¤¬²èÌ̤«¤é¤Ï¤ß½Ð¤Þ¤¹"
+#: edit.c:356
+msgid "item"
+msgstr ""
 
-#: edit.c:224
-msgid "E-mail addresses:"
-msgstr "¥á¡¼¥ë¥¢¥É¥ì¥¹: "
+#: edit.c:361
+msgid " or <n>ew"
+msgstr ""
 
-#: edit.h:13
-msgid "?:help c:contact a:address p:phone o:other"
-msgstr "?:¥Ø¥ë¥× c:Ï¢ÍíÀè a:½»½ê p:ÅÅÏào:¤½¤Î¾"
+#: edit.c:379
+#, fuzzy
+msgid "E-mail: "
+msgstr "¥¢¥É¥ì¥¹"
+
+#: edit.c:379
+msgid "Item: "
+msgstr ""
+
+#: edit.c:465
+msgid "Day: "
+msgstr ""
+
+#: edit.c:465
+msgid "Month: "
+msgstr ""
+
+#: edit.c:465
+msgid "Year (optional): "
+msgstr ""
+
+#: edit.c:498
+#, fuzzy
+msgid "Invalid date"
+msgstr "ÉÔÀµ¤ÊÃͤǤ¹"
+
+#: edit.c:653
+#, fuzzy
+msgid "Name: "
+msgstr "»á̾"
+
+#: edit.h:14
+msgid "?:help q:quit editor"
+msgstr ""
 
 #: filter.c:71 filter.c:82
 msgid "abook native format"
@@ -418,54 +450,63 @@ msgstr "Wanderlust 
 msgid "Spruce address book"
 msgstr "Spruce ¥¢¥É¥ì¥¹Ä¢"
 
-#: filter.c:107
+#: filter.c:95
+msgid "BSD calendar"
+msgstr ""
+
+#: filter.c:108
 msgid "input:"
 msgstr "ÆþÎÏ:"
 
-#: filter.c:114
+#: filter.c:115
 msgid "output:"
 msgstr "½ÐÎÏ:"
 
-#: filter.c:179
+#: filter.c:180
 msgid "import database"
 msgstr "¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¼è¤ê¹þ¤ß"
 
-#: filter.c:181 filter.c:298
+#: filter.c:182 filter.c:299
 msgid "please select a filter"
 msgstr "·Á¼°¤òÁª¤ó¤Ç¤¯¤À¤µ¤¤"
 
-#: filter.c:189 filter.c:306
+#: filter.c:190 filter.c:307
 msgid "x -\tcancel"
 msgstr "x -\tÃæ»ß"
 
-#: filter.c:210 filter.c:344
+#: filter.c:211 filter.c:345
 msgid "Filename: "
 msgstr "¥Õ¥¡¥¤¥ë̾: "
 
-#: filter.c:217
+#: filter.c:218
 msgid "Error occured while opening the file"
 msgstr "¥Õ¥¡¥¤¥ë¤ò³«¤¯ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿"
 
-#: filter.c:219
+#: filter.c:220
 msgid "File does not seem to be a valid addressbook"
 msgstr "¥Õ¥¡¥¤¥ë¤¬Àµ¤·¤¤¥¢¥É¥ì¥¹Ä¢¤Ç¤Ï¤Ê¤¤¤è¤¦¤Ç¤¹"
 
-#: filter.c:296
+#: filter.c:297
 msgid "export database"
 msgstr "¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î½ÐÎÏ"
 
-#: filter.c:329
+#: filter.c:330
 msgid "Export <a>ll, export <s>elected, or <c>ancel?"
 msgstr "½ÐÎÏÂоݠ a:¤¹¤Ù¤Æ  s:ÁªÂòÉôʬ¤Î¤ß  c:Ãæ»ß?"
 
-#: filter.c:330 ui.c:629
+#: filter.c:331 ui.c:632
 msgid "keybindings:all/selected/cancel|asc"
 msgstr "asc"
 
-#: filter.c:351
+#: filter.c:352
 msgid "Error occured while exporting"
 msgstr "½ÐÎÏÃæ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿"
 
+#: filter.c:1896
+#, c-format
+msgid "%02d/%02d\tAnniversary of %s\n"
+msgstr ""
+
 #: help.h:11
 msgid "\t?\t\thelp\n"
 msgstr "\t?\t\t¥Ø¥ë¥×\n"
@@ -587,123 +628,238 @@ msgid "\tv\t\tview URL with web browser\n"
 msgstr "\tv\t\tURL ¤ò¥Ö¥é¥¦¥¶¤Ç±ÜÍ÷¤¹¤ë\n"
 
 #: help.h:55
-msgid "\ta,c,p,o,C/arrows/h,l\tchange tab\n"
+#, fuzzy
+msgid "\tarrows/h,l\t\tchange tab\n"
 msgstr "\ta,c,p,o,C/Ìð°õ/h,l\t¥¿¥Ö¤ÎÊѹ¹\n"
 
 #: help.h:57
-msgid "\t1 - 5\t\t\tedit fields\n"
-msgstr "\t1 - 5\t\t\t¹àÌܤÎÊÔ½¸\n"
+#, fuzzy
+msgid "\tq\t\t\tquit to main screen\n"
+msgstr "\tQ\t\tÊݸ¤»¤º¤Ë½ªÎ»\n"
 
 #: help.h:59
+#, fuzzy
+msgid "\t1 - 5 A - Z\t\tedit fields\n"
+msgstr "\t1 - 5\t\t\t¹àÌܤÎÊÔ½¸\n"
+
+#: help.h:61
 msgid "\tk or <\t\t\tprevious item\n"
 msgstr "\tk,<\t\t\tÁ°¤Î¹àÌÜ\n"
 
-#: help.h:60
+#: help.h:62
 msgid "\tj or >\t\t\tnext item\n"
 msgstr "\tj,>\t\t\t¼¡¤Î¹àÌÜ\n"
 
-#: help.h:62
-msgid "\tr\t\t\troll e-mail addresses\n"
+#: help.h:64
+#, fuzzy
+msgid "\tr\t\t\troll e-mail addresses up\n"
 msgstr "\tr\t\t\t¥á¡¼¥ë¥¢¥É¥ì¥¹¤Î½çÈÖ¤òÊѤ¨¤ë\n"
 
-#: help.h:64
+#: help.h:65
+#, fuzzy
+msgid "\tESC-r\t\t\troll e-mail addresses down\n"
+msgstr "\tr\t\t\t¥á¡¼¥ë¥¢¥É¥ì¥¹¤Î½çÈÖ¤òÊѤ¨¤ë\n"
+
+#: help.h:67
 msgid "\tu\t\t\tundo\n"
 msgstr "\tu\t\t\t¥¢¥ó¥É¥¥ (°ì¤ÄÁ°¤Î¾õÂÖ¤ËÌ᤹)\n"
 
-#: help.h:66
+#: help.h:69
 msgid "\tm\t\t\tsend mail with mutt\n"
 msgstr "\tm\t\t\tMutt ¤Ç¥á¡¼¥ë¤òÁ÷¤ë\n"
 
-#: help.h:67
+#: help.h:70
 msgid "\tv\t\t\tview url with web browser\n"
 msgstr "\tv\t\t\tURL ¤ò¥Ö¥é¥¦¥¶¤Ç±ÜÍ÷\n"
 
-#: options.c:240 options.c:259
+#: options.c:250
+msgid "quote mismatch"
+msgstr ""
+
+#: options.c:256
+msgid "no assignment character found"
+msgstr ""
+
+#: options.c:259
+#, fuzzy
+msgid "error in comma separated list"
+msgstr "¥³¥ó¥Þ¶èÀÚ¤ê¥Æ¥­¥¹¥È"
+
+#: options.c:289 options.c:308
 msgid "invalid value"
 msgstr "ÉÔÀµ¤ÊÃͤǤ¹"
 
-#: options.c:278
+#: options.c:329
+msgid "unknown option"
+msgstr "ÉÔÌÀ¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹"
+
+#: options.c:341
+#, c-format
+msgid ""
+"valid values for the 'preserve_fields' option are 'all', "
+"'standard' (default), and 'none'\n"
+msgstr ""
+
+#: options.c:350
+#, c-format
+msgid ""
+"valid values for the 'address_style' option are 'eu' (default), 'uk', and "
+"'us'\n"
+msgstr ""
+
+#: options.c:372
 msgid "invalid value assignment"
 msgstr "ÉÔÀµ¤ÊÂåÆþ¤Ç¤¹"
 
-#: options.c:286
-msgid "unknown option"
-msgstr "ÉÔÌÀ¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹"
+#: options.c:380
+msgid ""
+"customfield: obsolete command - please use the 'field' and 'view' commands "
+"instead"
+msgstr ""
+
+#: options.c:398
+msgid "no view name provided"
+msgstr ""
+
+#: options.c:428
+msgid "no field identifier provided"
+msgstr ""
 
-#: options.c:311
-msgid "invalid custom field number"
-msgstr "ÉÔÀµ¤Ê³ÈÄ¥¹àÌÜÈÖ¹æ¤Ç¤¹"
+#: options.c:434
+msgid "no field name provided"
+msgstr ""
 
-#: options.c:358
+#: options.c:490
 #, c-format
 msgid "%s: parse error at line %d: "
 msgstr "%s: Ê¸Ë¡¥¨¥é¡¼¤¬ %d ¹ÔÌܤˤ¢¤ê¤Þ¤¹: "
 
-#: options.c:362
+#: options.c:494
 #, c-format
 msgid "unknown token %s\n"
 msgstr "%s ¤ÏÉÔÌÀ¤ÊÀßÄꥳ¥Þ¥ó¥É¤Ç¤¹\n"
 
-#: ui.c:146
+#: ui.c:145
 #, c-format
 msgid "Your terminal size is %dx%d\n"
 msgstr "²èÌÌ¥µ¥¤¥º¤Ï %dx%d ¤Ç¤¹\n"
 
-#: ui.c:147
+#: ui.c:146
 #, c-format
 msgid "Terminal is too small. Minimum terminal size for abook is %dx%d\n"
 msgstr "²èÌ̤¬¾®¤µ¤¹¤®¤Þ¤¹¡£¾¯¤Ê¤¯¤È¤â %dx%d ¤ÏɬÍפǤ¹\n"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (Y/n)?"
 msgstr " (Y/n)?"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (y/N)?"
 msgstr " (y/N)?"
 
-#: ui.c:411
+#: ui.c:410
 msgid "help"
 msgstr "¥Ø¥ë¥×"
 
-#: ui.c:420
+#: ui.c:419
 msgid "Press any key to continue..."
 msgstr "²¿¤«¥­¡¼¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤..."
 
-#: ui.c:541
+#: ui.c:539
 msgid "Remove selected item(s)"
 msgstr "ÁªÂò¹àÌܤòºï½ü¤·¤Þ¤¹¤«"
 
-#: ui.c:551
+#: ui.c:549
 msgid "Clear WHOLE database"
 msgstr "¥Ç¡¼¥¿¥Ù¡¼¥¹Á´ÂΤò¾Ãµî¤·¤Þ¤¹¤«"
 
-#: ui.c:579
+#: ui.c:582
 msgid "Search hit bottom, continuing at top"
 msgstr "ºÇ¸å¤Þ¤Ç¸¡º÷¤·¤Þ¤·¤¿¡£ºÇ½é¤«¤é¤â¸¡º÷¤·¤Æ¤¤¤Þ¤¹"
 
-#: ui.c:604
+#: ui.c:607
 #, c-format
 msgid "Your current data will be lost - Press '%c' to continue"
 msgstr "¸½ºß¤Î¥Ç¡¼¥¿¤Ï¾Ã¤¨¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¤è¤í¤·¤±¤ì¤Ð '%c' ¤Ç³¤±¤Æ¤¯¤À¤µ¤¤"
 
-#: ui.c:629
+#: ui.c:632
 msgid "Print <a>ll, print <s>elected, or <c>ancel?"
 msgstr "°õºþÂоݠ a:¤¹¤Ù¤Æ  s:ÁªÂò¹àÌܤΤߠ c:Ãæ»ß?"
 
-#: ui.c:635
+#: ui.c:638
 msgid "No selected items"
 msgstr "²¿¤âÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
 
-#: ui.c:661
+#: ui.c:664
 msgid "File to open: "
 msgstr "³«¤¯¥Õ¥¡¥¤¥ë: "
 
-#: ui.c:671
+#: ui.c:674
 msgid "Save current database"
 msgstr "¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÊݸ¤·¤Þ¤¹¤«"
 
-#: ui.c:679
+#: ui.c:682
 msgid "Sorry, the specified file appears not to be a valid abook addressbook"
 msgstr ""
 "¿½¤·Ìõ¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤´»ØÄê¤Î¥Õ¥¡¥¤¥ë¤ÏÀµµ¬¤Î abook ¥¢¥É¥ì¥¹Ä¢¤Ç¤Ï¤Ê¤¤¤è¤¦¤Ç¤¹"
+
+#: views.c:87
+msgid "undeclared field"
+msgstr ""
+
+#: views.c:92
+msgid "maximal number of fields per view reached"
+msgstr ""
+
+#: views.c:95
+msgid "field already in this view"
+msgstr ""
+
+#: views.c:139
+msgid "CONTACT"
+msgstr "Ï¢ÍíÀè"
+
+#: views.c:140
+msgid "ADDRESS"
+msgstr " ½»½ê "
+
+#: views.c:142
+#, fuzzy
+msgid "PHONE"
+msgstr " ÅÅÏà"
+
+#: views.c:143
+#, fuzzy
+msgid "OTHER"
+msgstr "¤½¤Î¾"
+
+#: views.c:165 views.c:166 views.c:167 views.c:168 views.c:169
+#, fuzzy
+msgid "CUSTOM"
+msgstr " ³ÈÄ¥ "
+
+#: views.c:165
+msgid "Custom1"
+msgstr "³ÈÄ¥¾ðÊó1"
+
+#: views.c:166
+msgid "Custom2"
+msgstr "³ÈÄ¥¾ðÊó2"
+
+#: views.c:167
+msgid "Custom3"
+msgstr "³ÈÄ¥¾ðÊó3"
+
+#: views.c:168
+msgid "Custom4"
+msgstr "³ÈÄ¥¾ðÊó4"
+
+#: views.c:169
+msgid "Custom5"
+msgstr "³ÈÄ¥¾ðÊó5"
+
+#~ msgid "?:help c:contact a:address p:phone o:other"
+#~ msgstr "?:¥Ø¥ë¥× c:Ï¢ÍíÀè a:½»½ê p:ÅÅÏào:¤½¤Î¾"
+
+#~ msgid "invalid custom field number"
+#~ msgstr "ÉÔÀµ¤Ê³ÈÄ¥¹àÌÜÈÖ¹æ¤Ç¤¹"
index 72cc1247ef2747a918f16c31bb2d5d9054f41b1e..d87a1f1c18cf60b926e2a1936186415632ff8306 100644 (file)
Binary files a/po/sv.gmo and b/po/sv.gmo differ
index 03572f6da5f6c55def2a435deea157e504583794..2258706e38a5a97d1a882701c662a57b5b347208 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -6,9 +6,9 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: abook 0.5.4\n"
-"Report-Msgid-Bugs-To: <cedricduval+abook@free.fr>\n"
-"POT-Creation-Date: 2005-12-06 07:50+0200\n"
-"PO-Revision-Date: 2005-09-23 22:13+0200\n"
+"Report-Msgid-Bugs-To: <abook-devel@lists.sourceforge.net>\n"
+"POT-Creation-Date: 2006-09-06 17:14+0300\n"
+"PO-Revision-Date: 2006-08-05 14:20+0200\n"
 "Last-Translator: Susanna Björverud <susanna.bjorverud@telia.com>\n"
 "Language-Team: none\n"
 "MIME-Version: 1.0\n"
@@ -16,50 +16,50 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: abook.c:91
+#: abook.c:93
 #, c-format
 msgid "Cannot create directory %s\n"
 msgstr "Kan inte skapa mapp %s\n"
 
-#: abook.c:97
+#: abook.c:99
 #, c-format
 msgid "%s is not a directory\n"
 msgstr "%s är inte en mapp\n"
 
-#: abook.c:115
+#: abook.c:117
 #, c-format
 msgid "Memory allocation failure: %s\n"
 msgstr "Fel vid tilldelning av minne: %s\n"
 
-#: abook.c:126
+#: abook.c:128
 #, c-format
 msgid "Press enter to continue...\n"
 msgstr "Tryck enter för att fortsätta...\n"
 
-#: abook.c:138
+#: abook.c:143
 #, c-format
 msgid "File %s is not writeable"
 msgstr "Filen %s kan inte skrivas"
 
-#: abook.c:143
+#: abook.c:148
 msgid "If you continue all changes will be lost. Do you want to continue?"
 msgstr ""
 "Om du fortsätter så kommer alla ändringar att gå förlorade. Vill du fortsätta"
 
-#: abook.c:162
+#: abook.c:167
 msgid "Save database"
 msgstr "Spara databasen"
 
-#: abook.c:164
+#: abook.c:169
 msgid "Quit without saving"
 msgstr "Avsluta utan att spara"
 
-#: abook.c:218
+#: abook.c:225
 #, c-format
 msgid "%s is not a valid HOME directory\n"
 msgstr "%s är inte en giltig hemmamapp\n"
 
-#: abook.c:249
+#: abook.c:256
 #, c-format
 msgid ""
 "Cannot combine options --mutt-query, --convert, --add-email or --add-email-"
@@ -68,33 +68,33 @@ msgstr ""
 "Det går inte att kombinera flaggorna --mutt-query, --convert, --add-email "
 "eller --add-email-quiet\n"
 
-#: abook.c:280
+#: abook.c:287
 #, c-format
 msgid "please use option --%s after --convert option\n"
 msgstr "var god och använd flaggan --%s efter flaggan --convert\n"
 
-#: abook.c:379
+#: abook.c:386
 #, c-format
 msgid "%s: unrecognized arguments on command line\n"
 msgstr "%s: okända parametrar på kommandoraden\n"
 
-#: abook.c:401
+#: abook.c:408
 msgid "     -h\t--help\t\t\t\tshow usage"
 msgstr "    -h\t--help\t\t\t\tvisa användning"
 
-#: abook.c:402
+#: abook.c:409
 msgid "     -C\t--config\t<file>\t\tuse an alternative configuration file"
 msgstr "     -C\t--config\t<fil>\t\tanvänd en alternative konfigurationsfil"
 
-#: abook.c:403
+#: abook.c:410
 msgid "\t--datafile\t<file>\t\tuse an alternative addressbook file"
 msgstr "\t--datafile\t<fil>\t\tanvänd en alternative adressboksfil"
 
-#: abook.c:404
+#: abook.c:411
 msgid "\t--mutt-query\t<string>\tmake a query for mutt"
 msgstr "\t--mutt-query\t<sträng>\tgör en förfrågan till mutt"
 
-#: abook.c:405
+#: abook.c:412
 msgid ""
 "\t--add-email\t\t\tread an e-mail message from stdin and\n"
 "\t\t\t\t\tadd the sender to the addressbook"
@@ -102,7 +102,7 @@ msgstr ""
 "\t--add-email\t\t\tläs ett ebrev från stdin och\n"
 "\t\t\t\t\tlägg till avsändaren i adressboken"
 
-#: abook.c:409
+#: abook.c:416
 msgid ""
 "\t--add-email-quiet\t\tsame as --add-email but doesn't\n"
 "\t\t\t\t\trequire to confirm adding"
@@ -110,66 +110,66 @@ msgstr ""
 "\t--add-email-quiet\t\tsamma som --add-email men utan\n"
 "\t\t\t\t\tanvändarbekräftelse"
 
-#: abook.c:413
+#: abook.c:420
 msgid "\t--convert\t\t\tconvert address book files"
 msgstr "\t--convert\t\t\tkonvertera adressbokfiler"
 
-#: abook.c:414
+#: abook.c:421
 msgid "\toptions to use with --convert:"
 msgstr "\tflaggor som kan användas med --convert:"
 
-#: abook.c:415
+#: abook.c:422
 msgid "\t--informat\t<format>\tformat for input file"
 msgstr "\t--informat\t<format>\tinputfilens format"
 
-#: abook.c:416
+#: abook.c:423
 msgid "\t\t\t\t\t(default: abook)"
 msgstr "\t\t\t\t\t(förvalt: abook)"
 
-#: abook.c:417
+#: abook.c:424
 msgid "\t--infile\t<file>\t\tsource file"
 msgstr "\t--infile\t<fil>\t\tkällfil"
 
-#: abook.c:418
+#: abook.c:425
 msgid "\t\t\t\t\t(default: stdin)"
 msgstr "\t\t\t\t\t(förvalt: stdin)"
 
-#: abook.c:419
+#: abook.c:426
 msgid "\t--outformat\t<format>\tformat for output file"
 msgstr "\t--outformat\t<format>\toutputfilens format"
 
-#: abook.c:420
+#: abook.c:427
 msgid "\t\t\t\t\t(default: text)"
 msgstr "\t\t\t\t\t(förvalt: text)"
 
-#: abook.c:421
+#: abook.c:428
 msgid "\t--outfile\t<file>\t\tdestination file"
 msgstr "\t--outfile\t<fil>\t\tmålfil"
 
-#: abook.c:422
+#: abook.c:429
 msgid "\t\t\t\t\t(default: stdout)"
 msgstr "\t\t\t\t\t(förvalt: stdout)"
 
-#: abook.c:423
+#: abook.c:430
 msgid "\t--formats\t\t\tlist available formats"
 msgstr "\t--formats\t\t\tlista tillgängliga format"
 
-#: abook.c:494
+#: abook.c:501
 #, c-format
 msgid "Cannot open database\n"
 msgstr "Kan inte öppna databasen\n"
 
-#: abook.c:620
+#: abook.c:627
 #, c-format
 msgid "too few arguments to make conversion\n"
 msgstr "alltför få parametrar för att kunna konvertera\n"
 
-#: abook.c:621
+#: abook.c:628
 #, c-format
 msgid "try --help\n"
 msgstr "prova --help\n"
 
-#: abook.c:626
+#: abook.c:633
 #, c-format
 msgid ""
 "input and output formats are the same\n"
@@ -178,46 +178,46 @@ msgstr ""
 "input- och outputformat är identiska\n"
 "avslutar...\n"
 
-#: abook.c:639
+#: abook.c:647
 #, c-format
 msgid "input format %s not supported\n"
 msgstr "inputformater %s stöds ej\n"
 
-#: abook.c:643
+#: abook.c:651
 #, c-format
 msgid "cannot read file %s\n"
 msgstr "kan inte läsa filen %s\n"
 
-#: abook.c:652
+#: abook.c:660
 #, c-format
 msgid "output format %s not supported\n"
 msgstr "outputformatet %s stöds ej\n"
 
-#: abook.c:658
+#: abook.c:666
 #, c-format
 msgid "cannot write file %s\n"
 msgstr "kan inte skriva till filen %s\n"
 
-#: abook.c:679
+#: abook.c:687
 #, c-format
 msgid "cannot open %s\n"
 msgstr "kan inte öppna %s\n"
 
-#: abook.c:682
+#: abook.c:690
 #, c-format
 msgid "%d item(s) added to %s\n"
 msgstr "%d post(er) har lagts till i %s\n"
 
-#: abook.c:684
+#: abook.c:692
 msgid "Valid sender address not found"
 msgstr "Kunde inte hitta en giltig avsändaradress"
 
-#: abook.c:724
+#: abook.c:732
 #, c-format
 msgid "Address %s already in addressbook\n"
 msgstr "Addressen %s finns redan i adressboken\n"
 
-#: abook.c:734
+#: abook.c:742
 #, c-format
 msgid ""
 "cannot open /dev/tty\n"
@@ -226,20 +226,20 @@ msgstr ""
 "kan inte öppna /dev/tty\n"
 "du bör kanske använda --add-email-quiet\n"
 
-#: abook.c:740
+#: abook.c:748
 #, fuzzy, c-format
 msgid "Add \"%s <%s>\" to %s? (%c/%c)\n"
 msgstr "Lägg till \"%s <%s>\" i %s? (j/n)\n"
 
-#: abook.c:744 abook.c:751 ui.c:344 ui.c:606
+#: abook.c:752 abook.c:759 ui.c:343 ui.c:609
 msgid "keybinding for yes|y"
 msgstr "j"
 
-#: abook.c:745 abook.c:747 ui.c:342
+#: abook.c:753 abook.c:755 ui.c:341
 msgid "keybinding for no|n"
 msgstr "n"
 
-#: abook.c:771
+#: abook.c:780
 #, c-format
 msgid "stdin is a directory or cannot stat stdin\n"
 msgstr ""
@@ -249,122 +249,153 @@ msgstr ""
 msgid "q:quit  ?:help  a:add  r:remove"
 msgstr "q:avsluta  ?:hjälp  a:lägg till  r:ta bort"
 
-#: database.c:57
+#: database.c:45
 msgid "Name"
 msgstr "Namn"
 
-#: database.c:58
-msgid "E-mails"
-msgstr "Ebrev"
+#: database.c:46
+#, fuzzy
+msgid "E-mail addresses"
+msgstr "Ebrevsadresser:"
 
-#: database.c:59
+#: database.c:47
 msgid "Address"
 msgstr "Adress"
 
-#: database.c:60
+#: database.c:48
 msgid "Address2"
 msgstr "Adress2"
 
-#: database.c:61
+#: database.c:49
 msgid "City"
 msgstr "Stad"
 
-#: database.c:62
+#: database.c:50
 msgid "State/Province"
 msgstr "Delstat/Provins/Landskap"
 
-#: database.c:63
+#: database.c:51
 msgid "ZIP/Postal Code"
 msgstr "Postnummer"
 
-#: database.c:64
+#: database.c:52
 msgid "Country"
 msgstr "Land"
 
-#: database.c:65
+#: database.c:53
 msgid "Home Phone"
 msgstr "Hemtelefon"
 
-#: database.c:66
+#: database.c:54
 msgid "Work Phone"
 msgstr "Arbetstelefon"
 
-#: database.c:67
+#: database.c:55
 msgid "Fax"
 msgstr "Fax"
 
-#: database.c:68
+#: database.c:56
 msgid "Mobile"
 msgstr "Mobiltelefon"
 
-#: database.c:69
+#: database.c:57
 #, fuzzy
 msgid "Nickname/Alias"
 msgstr "Smeknamn/Alias"
 
-#: database.c:70
+#: database.c:58
 msgid "URL"
 msgstr "URL"
 
-#: database.c:71
+#: database.c:59
 msgid "Notes"
 msgstr "Anteckningar"
 
-#: database.c:72
-msgid "Custom1"
-msgstr "Egen1"
-
-#: database.c:73
-msgid "Custom2"
-msgstr "Egen2"
+#: database.c:60
+msgid "Anniversary day"
+msgstr ""
 
-#: database.c:74
-msgid "Custom3"
-msgstr "Egen3"
+#: database.c:166
+msgid "field already defined"
+msgstr ""
 
-#: database.c:75
-msgid "Custom4"
-msgstr "Egen4"
+#: database.c:170
+msgid "standard field does not need to be declared"
+msgstr ""
 
-#: database.c:76
-msgid "Custom5"
-msgstr "Egen5"
+#: database.c:185
+#, fuzzy
+msgid "unknown type"
+msgstr "okänd flagga"
 
-#: database.c:424
+#: database.c:585
 msgid "Invalid field value defined in configuration"
 msgstr "Ogiltigt fältvärde i konfigurationen"
 
-#: edit.c:44
-msgid "CONTACT"
-msgstr "KONTAKT"
+#: database.c:588
+#, fuzzy
+msgid "Invalid field value for sorting"
+msgstr "Ogiltigt fältvärde i konfigurationen"
 
-#: edit.c:45
-msgid "ADDRESS"
-msgstr "ADRESS"
+#: edit.c:51
+msgid "Tab name too wide for screen"
+msgstr "Flikrubrik för bred för skärmen"
 
-#: edit.c:46
-msgid " PHONE "
-msgstr " TELEFON "
+#: edit.c:353
+msgid "keybindings_new_123456789|n123456789"
+msgstr ""
 
-#: edit.c:47
-msgid " OTHER "
-msgstr " ANNAT "
+#: edit.c:355
+#, c-format
+msgid "Choose %s to modify (<1>%s%c%s%s."
+msgstr ""
 
-#: edit.c:48
-msgid "CUSTOM "
-msgstr "EGEN "
+#: edit.c:356
+#, fuzzy
+msgid "email"
+msgstr "Ebrev"
 
-#: edit.c:57
-msgid "Tab name too wide for screen"
-msgstr "Flikrubrik för bred för skärmen"
+#: edit.c:356
+msgid "item"
+msgstr ""
 
-#: edit.c:224
-msgid "E-mail addresses:"
-msgstr "Ebrevsadresser:"
+#: edit.c:361
+msgid " or <n>ew"
+msgstr ""
+
+#: edit.c:379
+#, fuzzy
+msgid "E-mail: "
+msgstr "Ebrev"
+
+#: edit.c:379
+msgid "Item: "
+msgstr ""
 
-#: edit.h:13
-msgid "?:help c:contact a:address p:phone o:other"
-msgstr "?:hjälp c:kontact a:adress p:telefon o:annat"
+#: edit.c:465
+msgid "Day: "
+msgstr ""
+
+#: edit.c:465
+msgid "Month: "
+msgstr ""
+
+#: edit.c:465
+msgid "Year (optional): "
+msgstr ""
+
+#: edit.c:498
+#, fuzzy
+msgid "Invalid date"
+msgstr "ogiltigt värde"
+
+#: edit.c:653
+msgid "Name: "
+msgstr "Namn: "
+
+#: edit.h:14
+msgid "?:help q:quit editor"
+msgstr ""
 
 #: filter.c:71 filter.c:82
 msgid "abook native format"
@@ -423,54 +454,63 @@ msgstr "pine-adressbok"
 msgid "Spruce address book"
 msgstr "Spruce-adressbok"
 
-#: filter.c:107
+#: filter.c:95
+msgid "BSD calendar"
+msgstr ""
+
+#: filter.c:108
 msgid "input:"
 msgstr "input:"
 
-#: filter.c:114
+#: filter.c:115
 msgid "output:"
 msgstr "output:"
 
-#: filter.c:179
+#: filter.c:180
 msgid "import database"
 msgstr "importera databaser"
 
-#: filter.c:181 filter.c:298
+#: filter.c:182 filter.c:299
 msgid "please select a filter"
 msgstr "var god och välj filter"
 
-#: filter.c:189 filter.c:306
+#: filter.c:190 filter.c:307
 msgid "x -\tcancel"
 msgstr "x -\tavbryt"
 
-#: filter.c:210 filter.c:344
+#: filter.c:211 filter.c:345
 msgid "Filename: "
 msgstr "Filnamn:"
 
-#: filter.c:217
+#: filter.c:218
 msgid "Error occured while opening the file"
 msgstr "Fel vid öppnandet av filen"
 
-#: filter.c:219
+#: filter.c:220
 msgid "File does not seem to be a valid addressbook"
 msgstr "Den angivna filen verkar inte vara en giltig adressbok"
 
-#: filter.c:296
+#: filter.c:297
 msgid "export database"
 msgstr "exportera databasen"
 
-#: filter.c:329
+#: filter.c:330
 msgid "Export <a>ll, export <s>elected, or <c>ancel?"
 msgstr ""
 
-#: filter.c:330 ui.c:629
+#: filter.c:331 ui.c:632
 msgid "keybindings:all/selected/cancel|asc"
 msgstr ""
 
-#: filter.c:351
+#: filter.c:352
 msgid "Error occured while exporting"
 msgstr "Fel vid export"
 
+#: filter.c:1896
+#, c-format
+msgid "%02d/%02d\tAnniversary of %s\n"
+msgstr ""
+
 #: help.h:11
 msgid "\t?\t\thelp\n"
 msgstr "\t?\t\thjälp\n"
@@ -592,129 +632,244 @@ msgid "\tv\t\tview URL with web browser\n"
 msgstr "\tv\t\tvisa URL i webbläsare\n"
 
 #: help.h:55
-msgid "\ta,c,p,o,C/arrows/h,l\tchange tab\n"
+#, fuzzy
+msgid "\tarrows/h,l\t\tchange tab\n"
 msgstr "\ta,c,p,o,C/pilar/h,l\tbyt flik\n"
 
 #: help.h:57
-msgid "\t1 - 5\t\t\tedit fields\n"
-msgstr "\t1 - 5\t\t\tredigera fält\n"
+#, fuzzy
+msgid "\tq\t\t\tquit to main screen\n"
+msgstr "\tQ\t\tavsluta utan att spara\n"
 
 #: help.h:59
+#, fuzzy
+msgid "\t1 - 5 A - Z\t\tedit fields\n"
+msgstr "\t1 - 5\t\t\tredigera fält\n"
+
+#: help.h:61
 msgid "\tk or <\t\t\tprevious item\n"
 msgstr "\tk or <\t\t\tföregående post\n"
 
-#: help.h:60
+#: help.h:62
 msgid "\tj or >\t\t\tnext item\n"
 msgstr "\tj or >\t\t\tnästa post\n"
 
-#: help.h:62
-msgid "\tr\t\t\troll e-mail addresses\n"
+#: help.h:64
+#, fuzzy
+msgid "\tr\t\t\troll e-mail addresses up\n"
 msgstr "\tr\t\t\trotera ebrevsadresser\n"
 
-#: help.h:64
+#: help.h:65
+#, fuzzy
+msgid "\tESC-r\t\t\troll e-mail addresses down\n"
+msgstr "\tr\t\t\trotera ebrevsadresser\n"
+
+#: help.h:67
 msgid "\tu\t\t\tundo\n"
 msgstr "\tu\t\t\tångra\n"
 
-#: help.h:66
+#: help.h:69
 msgid "\tm\t\t\tsend mail with mutt\n"
 msgstr "\tm\t\t\tskicka post med mutt\n"
 
-#: help.h:67
+#: help.h:70
 msgid "\tv\t\t\tview url with web browser\n"
 msgstr "\tv\t\t\tvisa url i webbläsare\n"
 
-#: options.c:240 options.c:259
+#: options.c:250
+msgid "quote mismatch"
+msgstr ""
+
+#: options.c:256
+msgid "no assignment character found"
+msgstr ""
+
+#: options.c:259
+#, fuzzy
+msgid "error in comma separated list"
+msgstr "kommaseparerade värden"
+
+#: options.c:289 options.c:308
 msgid "invalid value"
 msgstr "ogiltigt värde"
 
-#: options.c:278
+#: options.c:329
+msgid "unknown option"
+msgstr "okänd flagga"
+
+#: options.c:341
+#, c-format
+msgid ""
+"valid values for the 'preserve_fields' option are 'all', "
+"'standard' (default), and 'none'\n"
+msgstr ""
+
+#: options.c:350
+#, c-format
+msgid ""
+"valid values for the 'address_style' option are 'eu' (default), 'uk', and "
+"'us'\n"
+msgstr ""
+
+#: options.c:372
 msgid "invalid value assignment"
 msgstr "tilldelat ogiltigt värde"
 
-#: options.c:286
-msgid "unknown option"
-msgstr "okänd flagga"
+#: options.c:380
+msgid ""
+"customfield: obsolete command - please use the 'field' and 'view' commands "
+"instead"
+msgstr ""
 
-#: options.c:311
-msgid "invalid custom field number"
-msgstr "ogiltigt nummer på eget fält"
+#: options.c:398
+msgid "no view name provided"
+msgstr ""
 
-#: options.c:358
+#: options.c:428
+msgid "no field identifier provided"
+msgstr ""
+
+#: options.c:434
+msgid "no field name provided"
+msgstr ""
+
+#: options.c:490
 #, c-format
 msgid "%s: parse error at line %d: "
 msgstr "%s: parsning misslyckades på rad %d: "
 
-#: options.c:362
+#: options.c:494
 #, c-format
 msgid "unknown token %s\n"
 msgstr "okänd symbol %s\n"
 
-#: ui.c:146
+#: ui.c:145
 #, c-format
 msgid "Your terminal size is %dx%d\n"
 msgstr "Storleken på ditt terminalfönster är %dx%d\n"
 
-#: ui.c:147
+#: ui.c:146
 #, fuzzy, c-format
 msgid "Terminal is too small. Minimum terminal size for abook is %dx%d\n"
 msgstr ""
 "Terminalfönstret är alltför litet. Den minsta tillåtna storleken för abook "
 "är %dx%d\n"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (Y/n)?"
 msgstr "(J/n)"
 
-#: ui.c:333
+#: ui.c:332
 msgid " (y/N)?"
 msgstr "(j/N)"
 
-#: ui.c:411
+#: ui.c:410
 msgid "help"
 msgstr "hjälp"
 
-#: ui.c:420
+#: ui.c:419
 msgid "Press any key to continue..."
 msgstr "Tryck på en tangent för att fortsätta..."
 
-#: ui.c:541
+#: ui.c:539
 msgid "Remove selected item(s)"
 msgstr "Ta bort valda post(er)"
 
-#: ui.c:551
+#: ui.c:549
 msgid "Clear WHOLE database"
 msgstr "Nollställ HELA databasen"
 
-#: ui.c:579
+#: ui.c:582
 msgid "Search hit bottom, continuing at top"
 msgstr "Sök nådde slutet, fortsätter från början"
 
-#: ui.c:604
+#: ui.c:607
 #, fuzzy, c-format
 msgid "Your current data will be lost - Press '%c' to continue"
 msgstr "Nuvarande data kommer att förloras - Tryck på 'y' för att fortsätta"
 
-#: ui.c:629
+#: ui.c:632
 msgid "Print <a>ll, print <s>elected, or <c>ancel?"
 msgstr ""
 
-#: ui.c:635
+#: ui.c:638
 msgid "No selected items"
 msgstr "Inga poster valda"
 
-#: ui.c:661
+#: ui.c:664
 msgid "File to open: "
 msgstr "Öppna fil: "
 
-#: ui.c:671
+#: ui.c:674
 msgid "Save current database"
 msgstr "Spara denna databas"
 
-#: ui.c:679
+#: ui.c:682
 msgid "Sorry, the specified file appears not to be a valid abook addressbook"
 msgstr ""
 "Förlåt, men den angivna filen verkar inte vara en giltig abook-adressbok"
 
+#: views.c:87
+msgid "undeclared field"
+msgstr ""
+
+#: views.c:92
+msgid "maximal number of fields per view reached"
+msgstr ""
+
+#: views.c:95
+msgid "field already in this view"
+msgstr ""
+
+#: views.c:139
+msgid "CONTACT"
+msgstr "KONTAKT"
+
+#: views.c:140
+msgid "ADDRESS"
+msgstr "ADRESS"
+
+#: views.c:142
+#, fuzzy
+msgid "PHONE"
+msgstr " TELEFON "
+
+#: views.c:143
+#, fuzzy
+msgid "OTHER"
+msgstr " ANNAT "
+
+#: views.c:165 views.c:166 views.c:167 views.c:168 views.c:169
+#, fuzzy
+msgid "CUSTOM"
+msgstr "EGEN "
+
+#: views.c:165
+msgid "Custom1"
+msgstr "Egen1"
+
+#: views.c:166
+msgid "Custom2"
+msgstr "Egen2"
+
+#: views.c:167
+msgid "Custom3"
+msgstr "Egen3"
+
+#: views.c:168
+msgid "Custom4"
+msgstr "Egen4"
+
+#: views.c:169
+msgid "Custom5"
+msgstr "Egen5"
+
+#~ msgid "?:help c:contact a:address p:phone o:other"
+#~ msgstr "?:hjälp c:kontact a:adress p:telefon o:annat"
+
+#~ msgid "invalid custom field number"
+#~ msgstr "ogiltigt nummer på eget fält"
+
 #~ msgid "Export All/Selected/Cancel (A/s/c)?"
 #~ msgstr "Exportera Alla/Valda/Avbryt (A/s/c)?"
 
index 086235f8185bc465ca628cbb2c676b609c19f3b9..3dac32c5abc1fbb3c76f9becc2ecfb8b8e819f90 100644 (file)
@@ -1,33 +1,86 @@
 # sample abook configuration file
 # see abookrc(5) for detailed explanation
 
+##
+##  Commands
+## ==========
+
+
+#  Setting a variable
+# --------------------
+#
+# syntax: set <option> = <value>
+# 
+# See below for the list of available variables.
+
+
+#  Defining a new custom field
+# -----------------------------
+#
+# syntax: field <identifier> = <human readable name> [ , <type> ]
+#
+# with <type> being one of 'string' (default), 'emails', 'list', or 'date'
+#
+# Example of field definitions:
+field pager = Pager
+field address_lines = Address, list
+field birthday = Birthday, date
+
+
+#  Defining a view/tab
+# ---------------------
+#
+# view <view name> = <field1> [ , <field2>, ... ]
+#
+# with <fieldN> being the identifier of a field declared with the 'field'
+# command, or the identifier of a standard field.
+#
+# Standard fields:
+#    name, email,
+#    address, address2, city, state, zip, country,
+#    phone, workphone, fax, mobile,
+#    nick, url, notes, anniversary
+#
+# Note: if you don't define any view, abook will use a default display based
+#       on the above standard fields.
+#
+# Example of views:
+view CONTACT = name, email
+view ADDRESS = address_lines, city, state, zip, country
+view PHONE = phone, workphone, pager, mobile, fax
+view OTHER = url, birthday
+
+
+
+##
+##  Variables
+## ===========
+
 # Automatically save database on exit
 set autosave=true
 
+# Specify how fields not declared with the 'field' command nor
+# in a view should be preserved while loading an abook database.
+#
+# It must be one of 'all', 'standard' (default), or 'none'.
+#   * 'all': preserve any completely unknown field.
+#   * 'standard': only preserve the standard fields (see a list in the
+#                 description of the 'view' command) and the legacy
+#                 'custom[1-5]' fields.
+#   * 'none': discards any unknown field.
+set preserve_fields=standard
+
 # Show all email addresses in list
 set show_all_emails=true
 
-# Screen column for email field to start
-set emailpos=25
-
-# Field to be used in the extra column
-set extra_column=phone
-# frequently used values:
-#      -1              disabled
-#      phone           Home Phone
-#      workphone       Work Phone
-#      fax             Fax
-#      mobile          Mobile Phone
-#      nick            Nick / Alias
-#      url             URL
-
-# Specify an alternative field to be displayed in the extra
-# column if there is no data for the field specified in
-# extra_column for a particular item.  
-set extra_alternative=-1
-
-# Screen column for the extra field to start
-set extrapos=65
+# Format of an entry's line in the main abook screen
+#
+# The below example displays:
+#  * the content of the 'name' field (with a maximum of 22 characters)
+#  * the first of the 'phone', 'workphone' or 'mobile' fields
+#    happening not to be empty (right aligned within 12 characters)
+#  * the 'anniversary' field, with no length limit
+set index_format=" {name:25} {phone:-12|workphone|mobile} {anniversary}"
 
 # Command used to start mutt
 set mutt_command=mutt
@@ -55,11 +108,3 @@ set sort_field=nick
 # show cursor in main display
 set show_cursor=false
 
-# custom fields
-
-#customfield 1 Name1
-#customfield 2 Name2
-#customfield 3 Name3
-#customfield 4 Name4
-#customfield 5 Name5
-
diff --git a/ui.c b/ui.c
index d42f26e9eb78597e91b536573c7c731db2d16431..6fe2f0f47079ff9692441b62356cff8e416683ef 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ui.c,v 1.54.4.1 2006/04/09 18:57:34 jheinonen Exp $
+ * $Id: ui.c,v 1.58 2006/09/06 02:24:33 cduval Exp $
  *
  * by JH <jheinonen@users.sourceforge.net>
  *
@@ -38,7 +38,6 @@
  * external variables
  */
 
-extern int items, curitem;
 extern char *datafile;
 
 extern bool alternative_datafile;
@@ -281,7 +280,7 @@ statusline_askchoice(const char *msg, const char *choices, short dflt)
        char *s;
        int ch;
 
-       assert((dflt < 0) || (dflt > strlen(choices)));
+       assert((dflt >= 0) && (dflt <= strlen(choices)));
 
        if(dflt) {
                s = strdup_printf("%s [%c]", msg, choices[dflt - 1]);
@@ -433,7 +432,6 @@ display_help(int help)
  */
 
 extern char *selected;
-extern int curitem;
 
 void
 get_commands()
@@ -454,7 +452,7 @@ get_commands()
                        case 'q': return;
                        case 'Q': quit_abook(QUIT_DONTSAVE);    break;
                        case 'P': print_stderr(selected_items() ?
-                                                 -1 : list_current_item());
+                                                 -1 : list_get_curitem());
                                  return;
                        case '?':
                                  display_help(HELP_MAIN);
@@ -491,15 +489,15 @@ get_commands()
 
                        case 'o': ui_open_datafile();   break;
 
-                       case 's': sort_by_field(NAME);  break;
+                       case 's': sort_by_field("name");break;
                        case 'S': sort_surname();       break;
-                       case 'F': sort_by_field(-1);    break;
+                       case 'F': sort_by_field(NULL);  break;
 
                        case '/': ui_find(0);           break;
                        case '\\': ui_find(1);          break;
 
-                       case ' ': if(curitem >= 0) {
-                                  selected[curitem] = !selected[curitem];
+                       case ' ': if(list_get_curitem() >= 0) {
+                                  list_invert_curitem_selection();
                                   ui_print_number_of_items();
                                   refresh_list();
                                  }
@@ -519,13 +517,13 @@ get_commands()
                                break;
 
                        case 'm': launch_mutt(selected_items() ?
-                                                 -1 : list_current_item());
+                                                 -1 : list_get_curitem());
                                  refresh_screen();
                                  break;
 
                        case 'p': ui_print_database(); break;
 
-                       case 'v': launch_wwwbrowser(list_current_item());
+                       case 'v': launch_wwwbrowser(list_get_curitem());
                                  refresh_screen();
                                  break;
                }
@@ -569,26 +567,31 @@ ui_find(int next)
        } else {
                char *s;
                s = ui_readline("/", findstr, MAX_FIELD_LEN - 1, 0);
-               strncpy(findstr, s, MAX_FIELD_LEN);
-               free(s);
                refresh_screen();
+               if(s == NULL) {
+                       return; /* user cancelled (ctrl-G) */
+               } else {
+                       strncpy(findstr, s, MAX_FIELD_LEN);
+                       free(s);
+               }
        }
 
-       if( (item = find_item(findstr, curitem + !!next, search_fields)) < 0 &&
+       if( (item = find_item(findstr, list_get_curitem() + !!next,
+                       search_fields)) < 0 &&
                        (item = find_item(findstr, 0, search_fields)) >= 0)
                statusline_addstr(_("Search hit bottom, continuing at top"));
 
        if(item >= 0) {
-               curitem = item;
+               list_set_curitem(item);
                refresh_list();
        }
 }
 
-
 void
 ui_print_number_of_items()
 {
-       char *str = strdup_printf("     " "|%3d/%3d", selected_items(), items);
+       char *str = strdup_printf("     " "|%3d/%3d",
+               selected_items(), db_n_items());
 
        mvaddstr(0, COLS-strlen(str), str);
 
@@ -600,7 +603,7 @@ ui_read_database()
 {
        char *msg;
 
-       if(items > 0) {
+       if(!list_is_empty()) {
                msg = strdup_printf(_("Your current data will be lost - "
                                "Press '%c' to continue"),
                                *(S_("keybinding for yes|y")));
@@ -675,7 +678,7 @@ ui_open_datafile()
 
        load_database(filename);
 
-       if(items == 0) {
+       if(list_is_empty()) {
                statusline_msg(_("Sorry, the specified file appears not to be a valid abook addressbook"));
                load_database(datafile);
        } else {
diff --git a/ui.h b/ui.h
index e811431e0701acdf6b7b13b261fd0cd1f1352966..25bc8509db2070d224f907808bf50acf1de9079d 100644 (file)
--- a/ui.h
+++ b/ui.h
@@ -40,6 +40,8 @@ void          ui_open_datafile();
 
 #define UI_HLINE_CHAR          opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
                                        '-' : ACS_HLINE
+#define UI_VLINE_CHAR          opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
+                                       '|' : ACS_VLINE
 #define UI_TEE_CHAR            opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
                                        '-' : ACS_BTEE
 #define UI_LBOXLINE_CHAR       opt_get_bool(BOOL_USE_ASCII_ONLY) ? \
diff --git a/views.c b/views.c
new file mode 100644 (file)
index 0000000..5d6cc65
--- /dev/null
+++ b/views.c
@@ -0,0 +1,170 @@
+/*
+ * $Id: views.c,v 1.2 2006/08/07 15:06:53 cduval Exp $
+ *
+ * by Cedric Duval <cedricduval@free.fr>
+ *
+ * Copyright (C) Cedric Duval
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#ifdef HAVE_CONFIG_H
+#      include "config.h"
+#endif
+#include "gettext.h"
+#include "misc.h"
+#include "options.h"
+#include "views.h"
+#include "xmalloc.h"
+
+
+abook_view *abook_views = NULL;
+int views_count = 0;
+
+
+extern abook_field standard_fields[];
+
+
+static abook_view *
+find_view(char *name)
+{
+       abook_view *cur = abook_views;
+
+       for(; cur; cur = cur->next)
+               if(0 == strcasecmp(cur->name, name))
+                       return cur;
+
+       return NULL;
+}
+
+static abook_view *
+create_view(char *name) {
+       abook_view *v;
+
+       for(v = abook_views; v && v->next; v = v->next)
+               ;
+
+       if(v) {
+               v->next = xmalloc(sizeof(abook_view));
+               v = v->next;            
+       } else
+               abook_views = v = xmalloc(sizeof(abook_view));
+
+       v->name = xstrdup(name);
+       v->fields = NULL;
+       v->next = NULL;
+
+       views_count++;
+
+       return v;
+}
+
+static int
+fields_in_view(abook_view *view)
+{
+       int nb;
+       abook_field_list *f;
+
+       for(nb = 0, f = view->fields; f; f = f->next, nb++)
+               ;
+
+       return nb;
+}
+
+char *
+add_field_to_view(char *viewname, char *field)
+{
+       abook_view *v;
+       abook_field *f;
+
+       if(
+                       !(f = find_declared_field(field)) &&
+                       !(f = find_standard_field(field, 1 /*do_declare*/))
+               )
+               return _("undeclared field");
+       
+       if((v = find_view(viewname)) == NULL)
+               v = create_view(viewname);
+       else if(fields_in_view(v) == MAX_VIEW_FIELDS)
+               return _("maximal number of fields per view reached");
+
+       if(v->fields && (find_field(field, v->fields)))
+               return _("field already in this view");
+
+       add_field(&v->fields, f);
+       
+       return NULL;
+}
+
+void
+view_info(int number, char **name, abook_field_list **fields)
+{      int i = 0;
+       abook_view *cur = abook_views;
+
+       assert((number < views_count) && (number >= 0));
+       
+       while(i++ != number)
+               cur = cur->next;
+
+       if(fields)
+               *fields = cur->fields;
+
+       if(name)
+               *name = cur->name;
+}
+
+#define MAX_DEFAULT_FIELDS_PER_VIEW 6
+
+void
+init_default_views()
+{
+       char *str;
+       int i, j, add_custom_fields, add_custom_view = 0;
+       
+       add_custom_fields =
+               !strcasecmp(opt_get_str(STR_PRESERVE_FIELDS), "standard");
+
+       /* if the user has configured views, no need to provide defaults */
+       if(abook_views)
+               goto out;
+       add_custom_view = 1;
+
+       struct {
+               char *name;
+               int fields[MAX_DEFAULT_FIELDS_PER_VIEW + 1];
+       } default_views[] = {
+               { N_("CONTACT"), {NAME, EMAIL, -1} },
+               { N_("ADDRESS"),
+                       { ADDRESS, ADDRESS2, CITY, STATE, ZIP, COUNTRY, -1 } },
+               { N_("PHONE"), { PHONE, WORKPHONE, FAX, MOBILEPHONE, -1 } },
+               { N_("OTHER"), { NICK, URL, NOTES, -1 } },
+               { 0 }
+       };
+
+       for(i = 0; default_views[i].name; i++) {
+               for(j = 0; j < MAX_DEFAULT_FIELDS_PER_VIEW; j++) {
+                       if(default_views[i].fields[j] == -1)
+                               break;
+                       str = standard_fields[default_views[i].fields[j]].key;
+                       add_field_to_view(gettext(default_views[i].name), str);
+               }
+       }
+out:
+
+#define init_view(view, key, name) do { \
+       if(add_custom_fields || add_custom_view) \
+               declare_new_field(key, name, "string", \
+                               0 /*"standard" field already declared above*/);\
+       if(add_custom_view) \
+               add_field_to_view(view, key); \
+} while(0);
+
+       init_view(_("CUSTOM"), "custom1", _("Custom1"));
+       init_view(_("CUSTOM"), "custom2", _("Custom2"));
+       init_view(_("CUSTOM"), "custom3", _("Custom3"));
+       init_view(_("CUSTOM"), "custom4", _("Custom4"));
+       init_view(_("CUSTOM"), "custom5", _("Custom5"));
+}
diff --git a/views.h b/views.h
new file mode 100644 (file)
index 0000000..0a899ff
--- /dev/null
+++ b/views.h
@@ -0,0 +1,18 @@
+#ifndef _VIEWS_H
+#define _VIEWS_H
+
+#include "database.h"
+
+#define MAX_VIEW_FIELDS 35 /* keybindings for modifying a field: 1-9A-Z */
+
+typedef struct abook_view_t {
+       char *name;
+       abook_field_list *fields;
+       struct abook_view_t *next;
+} abook_view;
+
+char *add_field_to_view(char *tabname, char *field);
+void view_info(int number, char **name, abook_field_list **fields);
+void init_default_views();
+
+#endif /* _VIEWS_H */