1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

Update documentation.

* doc/gpg.texi, doc/specify-user-id.texi, doc/yat2m.c: Update from
current GnuPG master (commit bdde44a).
This commit is contained in:
Werner Koch 2012-01-30 10:40:31 +01:00
parent b99e77d59c
commit 422774a1d9
3 changed files with 1080 additions and 624 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ are only valid for @command{gpg} others are only good for
@itemize @bullet @itemize @bullet
@item By key Id. @item By key Id.
This format is deduced from the length of the string and its content or This format is deduced from the length of the string and its content or
@code{0x} prefix. The key Id of an X.509 certificate are the low 64 bits @code{0x} prefix. The key Id of an X.509 certificate are the low 64 bits
of its SHA-1 fingerprint. The use of key Ids is just a shortcut, for of its SHA-1 fingerprint. The use of key Ids is just a shortcut, for
@ -59,16 +59,17 @@ avoids any ambiguities in case that there are duplicated key IDs.
@end cartouche @end cartouche
@noindent @noindent
(@command{gpgsm} also accepts colons between each pair of hexadecimal @command{gpgsm} also accepts colons between each pair of hexadecimal
digits because this is the de-facto standard on how to present X.509 digits because this is the de-facto standard on how to present X.509
fingerprints.) fingerprints. @command{gpg} also allows the use of the space
separated SHA-1 fingerprint as printed by the key listing commands.
@item By exact match on OpenPGP user ID. @item By exact match on OpenPGP user ID.
This is denoted by a leading equal sign. It does not make sense for This is denoted by a leading equal sign. It does not make sense for
X.509 certificates. X.509 certificates.
@cartouche @cartouche
@example @example
=Heinrich Heine <heinrichh@@uni-duesseldorf.de> =Heinrich Heine <heinrichh@@uni-duesseldorf.de>
@end example @end example
@end cartouche @end cartouche

View File

@ -1,6 +1,6 @@
/* yat2m.c - Yet Another Texi 2 Man converter /* yat2m.c - Yet Another Texi 2 Man converter
* Copyright (C) 2005 g10 Code GmbH * Copyright (C) 2005 g10 Code GmbH
* Copyright (C) 2006 2006 Free Software Foundation, Inc. * Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -29,11 +29,11 @@
@end macro @end macro
@macro mansect {a} @macro mansect {a}
@end macro @end macro
@macro manpause @macro manpause
@end macro @end macro
@macro mancont @macro mancont
@end macro @end macro
They are used by yat2m to select parts of the Texinfo which should They are used by yat2m to select parts of the Texinfo which should
go into the man page. These macros need to be used without leading go into the man page. These macros need to be used without leading
left space. Processing starts after a "manpage" macro has been left space. Processing starts after a "manpage" macro has been
@ -72,7 +72,21 @@
extracted from one file, either using the --store or the --select extracted from one file, either using the --store or the --select
option. option.
If you want to indent tables in the source use this style:
@table foo
@item
@item
@table
@item
@end
@end
Don't change the indentation within a table and keep the same
number of white space at the start of the line. yat2m simply
detects the number of white spaces in front of an @item and remove
this number of spaces from all following lines until a new @item
is found or there are less spaces than for the last @item.
*/ */
#include <stdio.h> #include <stdio.h>
@ -87,7 +101,7 @@
#define PGM "yat2m" #define PGM "yat2m"
#define VERSION "0.5" #define VERSION "1.0"
/* The maximum length of a line including the linefeed and one extra /* The maximum length of a line including the linefeed and one extra
character. */ character. */
@ -97,8 +111,8 @@
static int verbose; static int verbose;
static int quiet; static int quiet;
static int debug; static int debug;
static const char *opt_source; static const char *opt_source;
static const char *opt_release; static const char *opt_release;
static const char *opt_select; static const char *opt_select;
static const char *opt_include; static const char *opt_include;
static int opt_store; static int opt_store;
@ -148,22 +162,22 @@ struct section_buffer_s
typedef struct section_buffer_s *section_buffer_t; typedef struct section_buffer_s *section_buffer_t;
/* Variable to keep info about the current page together. */ /* Variable to keep info about the current page together. */
static struct static struct
{ {
/* Filename of the current page or NULL if no page is active. Malloced. */ /* Filename of the current page or NULL if no page is active. Malloced. */
char *name; char *name;
/* Number of allocated elements in SECTIONS below. */ /* Number of allocated elements in SECTIONS below. */
size_t n_sections; size_t n_sections;
/* Array with the data of the sections. */ /* Array with the data of the sections. */
section_buffer_t sections; section_buffer_t sections;
} thepage; } thepage;
/* The list of standard section names. COMMANDS and ASSUAN are GnuPG /* The list of standard section names. COMMANDS and ASSUAN are GnuPG
specific. */ specific. */
static const char * const standard_sections[] = static const char * const standard_sections[] =
{ "NAME", "SYNOPSIS", "DESCRIPTION", { "NAME", "SYNOPSIS", "DESCRIPTION",
"RETURN VALUE", "EXIT STATUS", "ERROR HANDLING", "ERRORS", "RETURN VALUE", "EXIT STATUS", "ERROR HANDLING", "ERRORS",
"COMMANDS", "OPTIONS", "USAGE", "EXAMPLES", "FILES", "COMMANDS", "OPTIONS", "USAGE", "EXAMPLES", "FILES",
@ -286,7 +300,7 @@ isodatestring (void)
static char buffer[11+5]; static char buffer[11+5];
struct tm *tp; struct tm *tp;
time_t atime = time (NULL); time_t atime = time (NULL);
if (atime < 0) if (atime < 0)
strcpy (buffer, "????" "-??" "-??"); strcpy (buffer, "????" "-??" "-??");
else else
@ -307,7 +321,7 @@ static section_buffer_t
get_section_buffer (const char *name) get_section_buffer (const char *name)
{ {
int i; int i;
section_buffer_t sect; section_buffer_t sect;
/* If there is no section we put everything into the required NAME /* If there is no section we put everything into the required NAME
section. Given that this is the first one listed it is likely section. Given that this is the first one listed it is likely
@ -414,6 +428,8 @@ write_th (FILE *fp)
{ {
char *name, *p; char *name, *p;
fputs (".\\\" Created from Texinfo source by yat2m " VERSION "\n", fp);
name = ascii_strupr (xstrdup (thepage.name)); name = ascii_strupr (xstrdup (thepage.name));
p = strrchr (name, '.'); p = strrchr (name, '.');
if (!p || !p[1]) if (!p || !p[1])
@ -449,9 +465,9 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
{ "code", 0, "\\fB", "\\fR" }, { "code", 0, "\\fB", "\\fR" },
{ "sc", 0, "\\fB", "\\fR" }, { "sc", 0, "\\fB", "\\fR" },
{ "var", 0, "\\fI", "\\fR" }, { "var", 0, "\\fI", "\\fR" },
{ "samp", 0, "\\(aq", "\\(aq'" }, { "samp", 0, "\\(aq", "\\(aq" },
{ "file", 0, "`\\fI","\\fR'" }, { "file", 0, "\\(oq\\fI","\\fR\\(cq" },
{ "env", 0, "`\\fI","\\fR'" }, { "env", 0, "\\(oq\\fI","\\fR\\(cq" },
{ "acronym", 0 }, { "acronym", 0 },
{ "dfn", 0 }, { "dfn", 0 },
{ "option", 0, "\\fB", "\\fR" }, { "option", 0, "\\fB", "\\fR" },
@ -465,7 +481,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
{ "uref", 0, "(\\fB", "\\fR)" }, { "uref", 0, "(\\fB", "\\fR)" },
{ "footnote",0, " ([", "])" }, { "footnote",0, " ([", "])" },
{ "emph", 0, "\\fI", "\\fR" }, { "emph", 0, "\\fI", "\\fR" },
{ "w", 1 }, { "w", 1 },
{ "c", 5 }, { "c", 5 },
{ "opindex", 1 }, { "opindex", 1 },
{ "cpindex", 1 }, { "cpindex", 1 },
@ -477,8 +493,8 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
{ "chapheading", 0}, { "chapheading", 0},
{ "item", 2, ".TP\n.B " }, { "item", 2, ".TP\n.B " },
{ "itemx", 2, ".TP\n.B " }, { "itemx", 2, ".TP\n.B " },
{ "table", 3 }, { "table", 3 },
{ "itemize", 3 }, { "itemize", 3 },
{ "bullet", 0, "* " }, { "bullet", 0, "* " },
{ "end", 4 }, { "end", 4 },
{ "quotation",1, ".RS\n\\fB" }, { "quotation",1, ".RS\n\\fB" },
@ -502,7 +518,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
{ {
case 1: /* Throw away the entire line. */ case 1: /* Throw away the entire line. */
s = memchr (rest, '\n', len); s = memchr (rest, '\n', len);
return s? (s-rest)+1 : len; return s? (s-rest)+1 : len;
case 2: /* Handle @item. */ case 2: /* Handle @item. */
break; break;
case 3: /* Handle table. */ case 3: /* Handle table. */
@ -510,7 +526,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
fputs (".RS\n", fp); fputs (".RS\n", fp);
/* Now throw away the entire line. */ /* Now throw away the entire line. */
s = memchr (rest, '\n', len); s = memchr (rest, '\n', len);
return s? (s-rest)+1 : len; return s? (s-rest)+1 : len;
break; break;
case 4: /* Handle end. */ case 4: /* Handle end. */
for (s=rest, n=len; n && (*s == ' ' || *s == '\t'); s++, n--) for (s=rest, n=len; n && (*s == ' ' || *s == '\t'); s++, n--)
@ -538,7 +554,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
} }
/* Now throw away the entire line. */ /* Now throw away the entire line. */
s = memchr (rest, '\n', len); s = memchr (rest, '\n', len);
return s? (s-rest)+1 : len; return s? (s-rest)+1 : len;
case 5: /* Handle special comments. */ case 5: /* Handle special comments. */
for (s=rest, n=len; n && (*s == ' ' || *s == '\t'); s++, n--) for (s=rest, n=len; n && (*s == ' ' || *s == '\t'); s++, n--)
; ;
@ -550,7 +566,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
} }
/* Now throw away the entire line. */ /* Now throw away the entire line. */
s = memchr (rest, '\n', len); s = memchr (rest, '\n', len);
return s? (s-rest)+1 : len; return s? (s-rest)+1 : len;
case 6: case 6:
*eol_action = 1; *eol_action = 1;
break; break;
@ -625,17 +641,17 @@ proc_texi_buffer (FILE *fp, const char *line, size_t len,
{ {
switch (*s) switch (*s)
{ {
case '@': case '{': case '}': case '@': case '{': case '}':
putc (*s, fp); in_cmd = 0; putc (*s, fp); in_cmd = 0;
break; break;
case ':': /* Not ending a sentence flag. */ case ':': /* Not ending a sentence flag. */
in_cmd = 0; in_cmd = 0;
break; break;
case '.': case '!': case '?': /* Ending a sentence. */ case '.': case '!': case '?': /* Ending a sentence. */
putc (*s, fp); in_cmd = 0; putc (*s, fp); in_cmd = 0;
break; break;
case ' ': case '\t': case '\n': /* Non collapsing spaces. */ case ' ': case '\t': case '\n': /* Non collapsing spaces. */
putc (*s, fp); in_cmd = 0; putc (*s, fp); in_cmd = 0;
break; break;
default: default:
cmdidx = 0; cmdidx = 0;
@ -653,7 +669,7 @@ proc_texi_buffer (FILE *fp, const char *line, size_t len,
s--; len++; s--; len++;
in_cmd = 0; in_cmd = 0;
} }
else if (cmdidx < sizeof cmdbuf -1) else if (cmdidx < sizeof cmdbuf -1)
cmdbuf[cmdidx++] = *s; cmdbuf[cmdidx++] = *s;
else else
{ {
@ -732,7 +748,7 @@ write_content (FILE *fp, line_buffer_t lines)
/* fputs ("---\n", fp); */ /* fputs ("---\n", fp); */
parse_texi_line (fp, line->line, &table_level); parse_texi_line (fp, line->line, &table_level);
} }
} }
} }
@ -821,7 +837,7 @@ finish_page (void)
write_content (fp, sect->lines); write_content (fp, sect->lines);
} }
} }
} }
} }
@ -854,10 +870,11 @@ parse_file (const char *fname, FILE *fp, char **section_name, int in_pause)
int in_gpgone = 0; /* Keep track of "@ifset gpgone" parts. */ int in_gpgone = 0; /* Keep track of "@ifset gpgone" parts. */
int not_in_gpgone = 0; /* Keep track of "@ifclear gpgone" parts. */ int not_in_gpgone = 0; /* Keep track of "@ifclear gpgone" parts. */
int not_in_man = 0; /* Keep track of "@ifclear isman" parts. */ int not_in_man = 0; /* Keep track of "@ifclear isman" parts. */
int item_indent = 0; /* How far is the current @item indented. */
/* Helper to define a macro. */ /* Helper to define a macro. */
char *macroname = NULL; char *macroname = NULL;
char *macrovalue = NULL; char *macrovalue = NULL;
size_t macrovaluesize = 0; size_t macrovaluesize = 0;
size_t macrovalueused = 0; size_t macrovalueused = 0;
@ -877,6 +894,24 @@ parse_file (const char *fname, FILE *fp, char **section_name, int in_pause)
} }
line[--n] = 0; line[--n] = 0;
/* Kludge to allow indentation of tables. */
for (p=line; *p == ' ' || *p == '\t'; p++)
;
if (*p)
{
if (*p == '@' && !strncmp (p+1, "item", 4))
item_indent = p - line; /* Set a new indent level. */
else if (p - line < item_indent)
item_indent = 0; /* Switch off indention. */
if (item_indent)
{
memmove (line, line+item_indent, n - item_indent + 1);
n -= item_indent;
}
}
if (*line == '@') if (*line == '@')
{ {
for (p=line+1, n=1; *p && *p != ' ' && *p != '\t'; p++) for (p=line+1, n=1; *p && *p != ' ' && *p != '\t'; p++)
@ -901,7 +936,7 @@ parse_file (const char *fname, FILE *fp, char **section_name, int in_pause)
macrovalue[--macrovalueused] = 0; /* Kill the last LF. */ macrovalue[--macrovalueused] = 0; /* Kill the last LF. */
macrovalue[macrovalueused] = 0; /* Terminate macro. */ macrovalue[macrovalueused] = 0; /* Terminate macro. */
macrovalue = xrealloc (macrovalue, macrovalueused+1); macrovalue = xrealloc (macrovalue, macrovalueused+1);
for (m= macrolist; m; m = m->next) for (m= macrolist; m; m = m->next)
if (!strcmp (m->name, macroname)) if (!strcmp (m->name, macroname))
break; break;
@ -1168,10 +1203,10 @@ top_parse_file (const char *fname, FILE *fp)
if not in a section. */ if not in a section. */
while (macrolist) while (macrolist)
{ {
macro_t m = macrolist->next; macro_t next = macrolist->next;
free (m->value); free (macrolist->value);
free (m); free (macrolist);
macrolist = m; macrolist = next;
} }
parse_file (fname, fp, &section_name, 0); parse_file (fname, fp, &section_name, 0);
@ -1180,7 +1215,7 @@ top_parse_file (const char *fname, FILE *fp)
} }
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
int last_argc = -1; int last_argc = -1;
@ -1273,7 +1308,7 @@ main (int argc, char **argv)
opt_select = strrchr (*argv, '/'); opt_select = strrchr (*argv, '/');
if (opt_select) if (opt_select)
opt_select++; opt_select++;
else else
opt_select = *argv; opt_select = *argv;
argc--; argv++; argc--; argv++;
} }
@ -1297,8 +1332,8 @@ main (int argc, char **argv)
argc--; argv++; argc--; argv++;
} }
} }
} }
if (argc > 1) if (argc > 1)
die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n"); die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n");