=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.52 retrieving revision 1.53 diff -c -r1.52 -r1.53 *** src/usr.bin/mandoc/mdoc_term.c 2009/08/22 18:40:00 1.52 --- src/usr.bin/mandoc/mdoc_term.c 2009/08/22 22:50:17 1.53 *************** *** 1,4 **** ! /* $Id: mdoc_term.c,v 1.52 2009/08/22 18:40:00 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc_term.c,v 1.53 2009/08/22 22:50:17 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 29,36 **** #define INDENT 5 #define HALFINDENT 3 - /* FIXME: macro arguments can be escaped. */ - #define TTYPE_PROG 0 #define TTYPE_CMD_FLAG 1 #define TTYPE_CMD_ARG 2 --- 29,34 ---- *************** *** 817,823 **** /* * List-type can override the width in the case of fixed-head * values (bullet, dash/hyphen, enum). Tags need a non-zero ! * offset. FIXME: double-check that correct. */ switch (type) { --- 815,821 ---- /* * List-type can override the width in the case of fixed-head * values (bullet, dash/hyphen, enum). Tags need a non-zero ! * offset. */ switch (type) { *************** *** 1233,1263 **** static int termp_rv_pre(DECL_ARGS) { ! int i; - i = arg_getattr(MDOC_Std, node); - assert(-1 != i); - assert(node->args->argv[i].sz); - term_newln(p); term_word(p, "The"); ! p->flags |= ttypes[TTYPE_FUNC_NAME]; ! term_word(p, *node->args->argv[i].value); ! p->flags &= ~ttypes[TTYPE_FUNC_NAME]; ! p->flags |= TERMP_NOSPACE; ! term_word(p, "() function returns the value 0 if successful;"); ! term_word(p, "otherwise the value -1 is returned and the"); ! term_word(p, "global variable"); p->flags |= ttypes[TTYPE_VAR_DECL]; term_word(p, "errno"); p->flags &= ~ttypes[TTYPE_VAR_DECL]; term_word(p, "is set to indicate the error."); ! return(1); } --- 1231,1271 ---- static int termp_rv_pre(DECL_ARGS) { ! const struct mdoc_node *nn; term_newln(p); term_word(p, "The"); ! nn = node->child; ! assert(nn); ! for ( ; nn; nn = nn->next) { ! p->flags |= ttypes[TTYPE_FUNC_NAME]; ! term_word(p, nn->string); ! p->flags &= ~ttypes[TTYPE_FUNC_NAME]; ! p->flags |= TERMP_NOSPACE; ! if (nn->next && NULL == nn->next->next) ! term_word(p, "(), and"); ! else if (nn->next) ! term_word(p, "(),"); ! else ! term_word(p, "()"); ! } ! if (node->child->next) ! term_word(p, "functions return"); ! else ! term_word(p, "function returns"); + term_word(p, "the value 0 if successful; otherwise the value " + "-1 is returned and the global variable"); + p->flags |= ttypes[TTYPE_VAR_DECL]; term_word(p, "errno"); p->flags &= ~ttypes[TTYPE_VAR_DECL]; term_word(p, "is set to indicate the error."); ! return(0); } *************** *** 1265,1283 **** static int termp_ex_pre(DECL_ARGS) { ! int i; - i = arg_getattr(MDOC_Std, node); - assert(-1 != i); - assert(node->args->argv[i].sz); - term_word(p, "The"); - p->flags |= ttypes[TTYPE_PROG]; - term_word(p, *node->args->argv[i].value); - p->flags &= ~ttypes[TTYPE_PROG]; - term_word(p, "utility exits 0 on success, and >0 if an error occurs."); ! return(1); } --- 1273,1305 ---- static int termp_ex_pre(DECL_ARGS) { ! const struct mdoc_node *nn; term_word(p, "The"); ! nn = node->child; ! assert(nn); ! for ( ; nn; nn = nn->next) { ! p->flags |= ttypes[TTYPE_PROG]; ! term_word(p, nn->string); ! p->flags &= ~ttypes[TTYPE_PROG]; ! p->flags |= TERMP_NOSPACE; ! if (nn->next && NULL == nn->next->next) ! term_word(p, ", and"); ! else if (nn->next) ! term_word(p, ","); ! else ! p->flags &= ~TERMP_NOSPACE; ! } ! ! if (node->child->next) ! term_word(p, "utilities exit"); ! else ! term_word(p, "utility exits"); ! ! term_word(p, "0 on success, and >0 if an error occurs."); ! ! return(0); }