version 1.141, 2019/04/28 17:10:06 |
version 1.142, 2019/04/28 19:05:11 |
|
|
pnode_printsection(struct format *f, struct pnode *n) |
pnode_printsection(struct format *f, struct pnode *n) |
{ |
{ |
struct pnode *nc, *ncc; |
struct pnode *nc, *ncc; |
const char *title; |
|
int flags, level; |
int flags, level; |
|
|
if (n->parent == NULL) { |
if (n->parent == NULL) { |
Line 205 pnode_printsection(struct format *f, struct pnode *n) |
|
Line 204 pnode_printsection(struct format *f, struct pnode *n) |
|
level = ++f->level; |
level = ++f->level; |
flags = ARG_SPACE; |
flags = ARG_SPACE; |
switch (n->node) { |
switch (n->node) { |
case NODE_PREFACE: |
|
case NODE_SECTION: |
case NODE_SECTION: |
case NODE_APPENDIX: |
case NODE_APPENDIX: |
if (level == 1) |
if (level == 1) |
flags |= ARG_UPPER; |
flags |= ARG_UPPER; |
break; |
break; |
case NODE_SIMPLESECT: |
case NODE_SIMPLESECT: |
case NODE_LEGALNOTICE: |
|
if (level < 2) |
if (level < 2) |
level = 2; |
level = 2; |
break; |
break; |
default: |
case NODE_NOTE: |
if (level < 3) |
if (level < 3) |
level = 3; |
level = 3; |
break; |
break; |
|
default: |
|
abort(); |
} |
} |
|
|
TAILQ_FOREACH(nc, &n->childq, child) |
TAILQ_FOREACH(nc, &n->childq, child) |
if (nc->node == NODE_TITLE) |
if (nc->node == NODE_TITLE) |
break; |
break; |
|
|
if (nc == NULL) { |
|
switch (n->node) { |
|
case NODE_PREFACE: |
|
title = "Preface"; |
|
break; |
|
case NODE_APPENDIX: |
|
title = "Appendix"; |
|
break; |
|
case NODE_LEGALNOTICE: |
|
title = "Legal Notice"; |
|
break; |
|
case NODE_CAUTION: |
|
title = "Caution"; |
|
break; |
|
case NODE_NOTE: |
|
title = "Note"; |
|
break; |
|
case NODE_TIP: |
|
title = "Tip"; |
|
break; |
|
case NODE_WARNING: |
|
title = "Warning"; |
|
break; |
|
default: |
|
title = "Unknown"; |
|
break; |
|
} |
|
} |
|
|
|
switch (level) { |
switch (level) { |
case 1: |
case 1: |
macro_close(f); |
macro_close(f); |
Line 272 pnode_printsection(struct format *f, struct pnode *n) |
|
Line 242 pnode_printsection(struct format *f, struct pnode *n) |
|
macro_open(f, "Sy"); |
macro_open(f, "Sy"); |
break; |
break; |
} |
} |
|
macro_addnode(f, nc, flags); |
if (nc != NULL) |
|
macro_addnode(f, nc, flags); |
|
else |
|
macro_addarg(f, title, flags | ARG_QUOTED); |
|
macro_close(f); |
macro_close(f); |
|
|
/* |
/* |
Line 806 pnode_printrefentry(struct format *f, struct pnode *n) |
|
Line 772 pnode_printrefentry(struct format *f, struct pnode *n) |
|
case NODE_REFENTRY: |
case NODE_REFENTRY: |
case NODE_REFNAMEDIV: |
case NODE_REFNAMEDIV: |
case NODE_REFSYNOPSISDIV: |
case NODE_REFSYNOPSISDIV: |
case NODE_PREFACE: |
|
later = NULL; |
later = NULL; |
continue; |
continue; |
case NODE_APPENDIX: |
case NODE_APPENDIX: |
Line 1277 pnode_print(struct format *f, struct pnode *n) |
|
Line 1242 pnode_print(struct format *f, struct pnode *n) |
|
case NODE_REFSYNOPSISDIV: |
case NODE_REFSYNOPSISDIV: |
pnode_printrefsynopsisdiv(f, n); |
pnode_printrefsynopsisdiv(f, n); |
break; |
break; |
case NODE_PREFACE: |
|
case NODE_SECTION: |
case NODE_SECTION: |
case NODE_SIMPLESECT: |
case NODE_SIMPLESECT: |
case NODE_APPENDIX: |
case NODE_APPENDIX: |
case NODE_LEGALNOTICE: |
|
case NODE_NOTE: |
case NODE_NOTE: |
case NODE_TIP: |
|
case NODE_CAUTION: |
|
case NODE_WARNING: |
|
pnode_printsection(f, n); |
pnode_printsection(f, n); |
break; |
break; |
case NODE_REPLACEABLE: |
case NODE_REPLACEABLE: |
Line 1337 pnode_print(struct format *f, struct pnode *n) |
|
Line 1297 pnode_print(struct format *f, struct pnode *n) |
|
case NODE_XREF: |
case NODE_XREF: |
pnode_printxref(f, n); |
pnode_printxref(f, n); |
break; |
break; |
|
case NODE_CAUTION: |
|
case NODE_LEGALNOTICE: |
|
case NODE_PREFACE: |
|
case NODE_TIP: |
|
case NODE_WARNING: |
|
abort(); |
default: |
default: |
break; |
break; |
} |
} |
Line 1421 pnode_print(struct format *f, struct pnode *n) |
|
Line 1387 pnode_print(struct format *f, struct pnode *n) |
|
} else |
} else |
f->flags &= ~FMT_IMPL; |
f->flags &= ~FMT_IMPL; |
break; |
break; |
case NODE_PREFACE: |
|
case NODE_SECTION: |
case NODE_SECTION: |
|
case NODE_SIMPLESECT: |
case NODE_APPENDIX: |
case NODE_APPENDIX: |
case NODE_LEGALNOTICE: |
|
case NODE_NOTE: |
case NODE_NOTE: |
case NODE_TIP: |
|
case NODE_CAUTION: |
|
case NODE_WARNING: |
|
f->level--; |
f->level--; |
break; |
break; |
case NODE_BLOCKQUOTE: |
case NODE_BLOCKQUOTE: |