version 1.99, 2011/02/06 22:05:20 |
version 1.102, 2011/03/07 01:35:51 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 48 static struct man_node *man_node_alloc(struct man *, i |
|
Line 48 static struct man_node *man_node_alloc(struct man *, i |
|
enum man_type, enum mant); |
enum man_type, enum mant); |
static int man_node_append(struct man *, |
static int man_node_append(struct man *, |
struct man_node *); |
struct man_node *); |
static int man_span_alloc(struct man *, |
|
const struct tbl_span *); |
|
static void man_node_free(struct man_node *); |
static void man_node_free(struct man_node *); |
static void man_node_unlink(struct man *, |
static void man_node_unlink(struct man *, |
struct man_node *); |
struct man_node *); |
Line 148 man_free1(struct man *man) |
|
Line 146 man_free1(struct man *man) |
|
free(man->meta.title); |
free(man->meta.title); |
if (man->meta.source) |
if (man->meta.source) |
free(man->meta.source); |
free(man->meta.source); |
if (man->meta.rawdate) |
if (man->meta.date) |
free(man->meta.rawdate); |
free(man->meta.date); |
if (man->meta.vol) |
if (man->meta.vol) |
free(man->meta.vol); |
free(man->meta.vol); |
if (man->meta.msec) |
if (man->meta.msec) |
Line 300 man_block_alloc(struct man *m, int line, int pos, enum |
|
Line 298 man_block_alloc(struct man *m, int line, int pos, enum |
|
return(1); |
return(1); |
} |
} |
|
|
static int |
|
man_span_alloc(struct man *m, const struct tbl_span *span) |
|
{ |
|
struct man_node *n; |
|
|
|
n = man_node_alloc(m, span->line, 0, MAN_TBL, MAN_MAX); |
|
n->span = span; |
|
|
|
if ( ! man_node_append(m, n)) |
|
return(0); |
|
|
|
m->next = MAN_NEXT_SIBLING; |
|
return(1); |
|
} |
|
|
|
int |
int |
man_word_alloc(struct man *m, int line, int pos, const char *word) |
man_word_alloc(struct man *m, int line, int pos, const char *word) |
{ |
{ |
Line 363 man_node_delete(struct man *m, struct man_node *p) |
|
Line 346 man_node_delete(struct man *m, struct man_node *p) |
|
man_node_free(p); |
man_node_free(p); |
} |
} |
|
|
|
int |
|
man_addeqn(struct man *m, const struct eqn *ep) |
|
{ |
|
struct man_node *n; |
|
|
|
assert( ! (MAN_HALT & m->flags)); |
|
|
|
n = man_node_alloc(m, ep->line, ep->pos, MAN_EQN, MAN_MAX); |
|
n->eqn = ep; |
|
|
|
if ( ! man_node_append(m, n)) |
|
return(0); |
|
|
|
m->next = MAN_NEXT_SIBLING; |
|
return(man_descope(m, ep->line, ep->pos)); |
|
} |
|
|
int |
int |
man_addspan(struct man *m, const struct tbl_span *sp) |
man_addspan(struct man *m, const struct tbl_span *sp) |
{ |
{ |
|
struct man_node *n; |
|
|
assert( ! (MAN_HALT & m->flags)); |
assert( ! (MAN_HALT & m->flags)); |
if ( ! man_span_alloc(m, sp)) |
|
|
n = man_node_alloc(m, sp->line, 0, MAN_TBL, MAN_MAX); |
|
n->span = sp; |
|
|
|
if ( ! man_node_append(m, n)) |
return(0); |
return(0); |
|
|
|
m->next = MAN_NEXT_SIBLING; |
return(man_descope(m, sp->line, 0)); |
return(man_descope(m, sp->line, 0)); |
} |
} |
|
|