From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Pick up authors in mandoc-db.
Date: Tue, 3 May 2011 10:39:27 -0400 (EDT) [thread overview]
Message-ID: <201105031439.p43EdRkt006683@krisdoz.my.domain> (raw)
Log Message:
-----------
Pick up authors in mandoc-db.
Modified Files:
--------------
mdocml:
mandoc-db.1
mandoc-db.c
Revision Data
-------------
Index: mandoc-db.1
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc-db.1,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lmandoc-db.1 -Lmandoc-db.1 -u -p -r1.3 -r1.4
--- mandoc-db.1
+++ mandoc-db.1
@@ -67,6 +67,8 @@ a nil-terminated filename,
.It
a nil-terminated manual section,
.It
+a nil-terminated manual title,
+.It
and a nil-terminated description.
.El
.Pp
@@ -98,6 +100,8 @@ An include file as given in the SYNOPSIS
A variable name as given in the SYNOPSIS section.
.It Li 0x06
A standard as given in the STANDARDS section.
+.It Li 0x07
+An author as given in the AUTHORS section.
.El
.Pp
If a value is encountered outside of this range, the database is
Index: mandoc-db.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc-db.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lmandoc-db.c -Lmandoc-db.c -u -p -r1.16 -r1.17
--- mandoc-db.c
+++ mandoc-db.c
@@ -49,7 +49,8 @@ enum type {
MANDOC_UTILITY,
MANDOC_INCLUDES,
MANDOC_VARIABLE,
- MANDOC_STANDARD
+ MANDOC_STANDARD,
+ MANDOC_AUTHOR
};
#define MAN_ARGS DB *db, \
@@ -77,6 +78,7 @@ static int pman_node(MAN_ARGS);
static void pmdoc(DB *, const char *, DBT *, size_t *,
DBT *, DBT *, size_t *, struct mdoc *);
static void pmdoc_node(MDOC_ARGS);
+static void pmdoc_An(MDOC_ARGS);
static void pmdoc_Fd(MDOC_ARGS);
static void pmdoc_In(MDOC_ARGS);
static void pmdoc_Fn(MDOC_ARGS);
@@ -106,7 +108,7 @@ static const pmdoc_nf mdocs[MDOC_MAX]
NULL, /* El */
NULL, /* It */
NULL, /* Ad */
- NULL, /* An */
+ pmdoc_An, /* An */
NULL, /* Ar */
NULL, /* Cd */
NULL, /* Cm */
@@ -524,6 +526,23 @@ dbt_append(DBT *key, size_t *ksz, const
((char *)key->data)[(int)key->size - 1] = ' ';
dbt_appendb(key, ksz, cp, sz + 1);
+}
+
+/* ARGSUSED */
+static void
+pmdoc_An(MDOC_ARGS)
+{
+ uint32_t fl;
+
+ if (SEC_AUTHORS != n->sec)
+ return;
+
+ for (n = n->child; n; n = n->next)
+ if (MDOC_TEXT == n->type)
+ dbt_append(key, ksz, n->string);
+
+ fl = MANDOC_AUTHOR;
+ memcpy(val->data, &fl, 4);
}
/* ARGSUSED */
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2011-05-03 14:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201105031439.p43EdRkt006683@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).