diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-04 08:21:17 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-05-04 08:21:17 +0000 |
commit | ccfcc5247a1dcd27d5b8759547f16bdb451120e3 (patch) | |
tree | 4ac6154e6983356b5b49ac3376a2f33166e1fc7c /mandoc-db.c | |
parent | d2f7b6220888999ed5a65f57c3573e8f59fa3590 (diff) | |
download | mandoc-ccfcc5247a1dcd27d5b8759547f16bdb451120e3.tar.gz mandoc-ccfcc5247a1dcd27d5b8759547f16bdb451120e3.tar.zst mandoc-ccfcc5247a1dcd27d5b8759547f16bdb451120e3.zip |
Add configurations (`Cd') to mandoc-db mining.
Also put some notes into index.sgml to the effect that mandoc-db exists,
but is not linked to the build.
Diffstat (limited to 'mandoc-db.c')
-rw-r--r-- | mandoc-db.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/mandoc-db.c b/mandoc-db.c index 0f8e56fd..85d5036e 100644 --- a/mandoc-db.c +++ b/mandoc-db.c @@ -1,4 +1,4 @@ -/* $Id: mandoc-db.c,v 1.17 2011/05/03 14:39:27 kristaps Exp $ */ +/* $Id: mandoc-db.c,v 1.18 2011/05/04 08:21:17 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -50,7 +50,8 @@ enum type { MANDOC_INCLUDES, MANDOC_VARIABLE, MANDOC_STANDARD, - MANDOC_AUTHOR + MANDOC_AUTHOR, + MANDOC_CONFIG }; #define MAN_ARGS DB *db, \ @@ -79,6 +80,7 @@ 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_Cd(MDOC_ARGS); static void pmdoc_Fd(MDOC_ARGS); static void pmdoc_In(MDOC_ARGS); static void pmdoc_Fn(MDOC_ARGS); @@ -110,7 +112,7 @@ static const pmdoc_nf mdocs[MDOC_MAX] = { NULL, /* Ad */ pmdoc_An, /* An */ NULL, /* Ar */ - NULL, /* Cd */ + pmdoc_Cd, /* Cd */ NULL, /* Cm */ NULL, /* Dv */ NULL, /* Er */ @@ -593,6 +595,23 @@ pmdoc_Fd(MDOC_ARGS) /* ARGSUSED */ static void +pmdoc_Cd(MDOC_ARGS) +{ + uint32_t fl; + + if (SEC_SYNOPSIS != n->sec) + return; + + for (n = n->child; n; n = n->next) + if (MDOC_TEXT == n->type) + dbt_append(key, ksz, n->string); + + fl = MANDOC_CONFIG; + memcpy(val->data, &fl, 4); +} + +/* ARGSUSED */ +static void pmdoc_In(MDOC_ARGS) { uint32_t fl; |