version 1.114, 2015/04/02 21:36:50 |
version 1.116, 2015/04/02 23:48:19 |
|
|
#include "libmandoc.h" |
#include "libmandoc.h" |
#include "libman.h" |
#include "libman.h" |
|
|
#define CHKARGS struct man *man, struct man_node *n |
#define CHKARGS struct man *man, struct roff_node *n |
|
|
typedef void (*v_check)(CHKARGS); |
typedef void (*v_check)(CHKARGS); |
|
|
Line 100 static v_check man_valids[MAN_MAX] = { |
|
Line 100 static v_check man_valids[MAN_MAX] = { |
|
void |
void |
man_valid_post(struct man *man) |
man_valid_post(struct man *man) |
{ |
{ |
struct man_node *n; |
struct roff_node *n; |
v_check *cp; |
v_check *cp; |
|
|
n = man->last; |
n = man->last; |
Line 300 post_IP(CHKARGS) |
|
Line 300 post_IP(CHKARGS) |
|
static void |
static void |
post_TH(CHKARGS) |
post_TH(CHKARGS) |
{ |
{ |
struct man_node *nb; |
struct roff_node *nb; |
const char *p; |
const char *p; |
|
|
free(man->meta.title); |
free(man->meta.title); |
free(man->meta.vol); |
free(man->meta.vol); |
free(man->meta.source); |
free(man->meta.os); |
free(man->meta.msec); |
free(man->meta.msec); |
free(man->meta.date); |
free(man->meta.date); |
|
|
man->meta.title = man->meta.vol = man->meta.date = |
man->meta.title = man->meta.vol = man->meta.date = |
man->meta.msec = man->meta.source = NULL; |
man->meta.msec = man->meta.os = NULL; |
|
|
nb = n; |
nb = n; |
|
|
/* ->TITLE<- MSEC DATE SOURCE VOL */ |
/* ->TITLE<- MSEC DATE OS VOL */ |
|
|
n = n->child; |
n = n->child; |
if (n && n->string) { |
if (n && n->string) { |
Line 336 post_TH(CHKARGS) |
|
Line 336 post_TH(CHKARGS) |
|
nb->line, nb->pos, "TH"); |
nb->line, nb->pos, "TH"); |
} |
} |
|
|
/* TITLE ->MSEC<- DATE SOURCE VOL */ |
/* TITLE ->MSEC<- DATE OS VOL */ |
|
|
if (n) |
if (n) |
n = n->next; |
n = n->next; |
Line 348 post_TH(CHKARGS) |
|
Line 348 post_TH(CHKARGS) |
|
nb->line, nb->pos, "TH %s", man->meta.title); |
nb->line, nb->pos, "TH %s", man->meta.title); |
} |
} |
|
|
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
/* TITLE MSEC ->DATE<- OS VOL */ |
|
|
if (n) |
if (n) |
n = n->next; |
n = n->next; |
Line 364 post_TH(CHKARGS) |
|
Line 364 post_TH(CHKARGS) |
|
n ? n->pos : nb->pos, "TH"); |
n ? n->pos : nb->pos, "TH"); |
} |
} |
|
|
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
/* TITLE MSEC DATE ->OS<- VOL */ |
|
|
if (n && (n = n->next)) |
if (n && (n = n->next)) |
man->meta.source = mandoc_strdup(n->string); |
man->meta.os = mandoc_strdup(n->string); |
else if (man->defos != NULL) |
else if (man->defos != NULL) |
man->meta.source = mandoc_strdup(man->defos); |
man->meta.os = mandoc_strdup(man->defos); |
|
|
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
/* TITLE MSEC DATE OS ->VOL<- */ |
/* If missing, use the default VOL name for MSEC. */ |
/* If missing, use the default VOL name for MSEC. */ |
|
|
if (n && (n = n->next)) |
if (n && (n = n->next)) |
Line 446 post_UC(CHKARGS) |
|
Line 446 post_UC(CHKARGS) |
|
p = bsd_versions[0]; |
p = bsd_versions[0]; |
} |
} |
|
|
free(man->meta.source); |
free(man->meta.os); |
man->meta.source = mandoc_strdup(p); |
man->meta.os = mandoc_strdup(p); |
} |
} |
|
|
static void |
static void |
Line 460 post_AT(CHKARGS) |
|
Line 460 post_AT(CHKARGS) |
|
"System V Release 2", |
"System V Release 2", |
}; |
}; |
|
|
|
struct roff_node *nn; |
const char *p, *s; |
const char *p, *s; |
struct man_node *nn; |
|
|
|
n = n->child; |
n = n->child; |
|
|
Line 485 post_AT(CHKARGS) |
|
Line 485 post_AT(CHKARGS) |
|
p = unix_versions[0]; |
p = unix_versions[0]; |
} |
} |
|
|
free(man->meta.source); |
free(man->meta.os); |
man->meta.source = mandoc_strdup(p); |
man->meta.os = mandoc_strdup(p); |
} |
} |
|
|
static void |
static void |