[BACK]Return to mandocdb.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/mandocdb.c between version 1.140 and 1.141

version 1.140, 2015/03/27 17:36:56 version 1.141, 2015/04/02 21:03:18
Line 36 
Line 36 
 #include <ohash.h>  #include <ohash.h>
 #include <sqlite3.h>  #include <sqlite3.h>
   
   #include "mandoc_aux.h"
   #include "mandoc.h"
   #include "roff.h"
 #include "mdoc.h"  #include "mdoc.h"
 #include "man.h"  #include "man.h"
 #include "mandoc.h"  
 #include "mandoc_aux.h"  
 #include "manconf.h"  #include "manconf.h"
 #include "mansearch.h"  #include "mansearch.h"
   
Line 1418 
Line 1419 
         for ( ; NULL != n; n = n->next) {          for ( ; NULL != n; n = n->next) {
                 if (NULL != n->child)                  if (NULL != n->child)
                         putmdockey(mpage, n->child, m);                          putmdockey(mpage, n->child, m);
                 if (MDOC_TEXT == n->type)                  if (n->type == ROFFT_TEXT)
                         putkey(mpage, n->string, m);                          putkey(mpage, n->string, m);
         }          }
 }  }
Line 1442 
Line 1443 
          * the correct section or not.           * the correct section or not.
          */           */
   
         if (MAN_BODY == n->type && MAN_SH == n->tok) {          if (n->type == ROFFT_BODY && n->tok == MAN_SH) {
                 body = n;                  body = n;
                 assert(body->parent);                  assert(body->parent);
                 if (NULL != (head = body->parent->head) &&                  if (NULL != (head = body->parent->head) &&
                     1 == head->nchild &&                      1 == head->nchild &&
                     NULL != (head = (head->child)) &&                      NULL != (head = (head->child)) &&
                     MAN_TEXT == head->type &&                      head->type == ROFFT_TEXT &&
                     0 == strcmp(head->string, "NAME") &&                      0 == strcmp(head->string, "NAME") &&
                     NULL != body->child) {                      NULL != body->child) {
   
Line 1557 
Line 1558 
         assert(NULL != n);          assert(NULL != n);
         for (n = n->child; NULL != n; n = n->next) {          for (n = n->child; NULL != n; n = n->next) {
                 switch (n->type) {                  switch (n->type) {
                 case MDOC_ELEM:                  case ROFFT_ELEM:
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case MDOC_BLOCK:                  case ROFFT_BLOCK:
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case MDOC_HEAD:                  case ROFFT_HEAD:
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case MDOC_BODY:                  case ROFFT_BODY:
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case MDOC_TAIL:                  case ROFFT_TAIL:
                         if (NULL != mdocs[n->tok].fp)                          if (NULL != mdocs[n->tok].fp)
                                if (0 == (*mdocs[n->tok].fp)(mpage, meta, n))                                 if (0 == (*mdocs[n->tok].fp)(mpage, meta, n))
                                        break;                                         break;
Line 1574 
Line 1575 
                                     mdocs[n->tok].mask);                                      mdocs[n->tok].mask);
                         break;                          break;
                 default:                  default:
                         assert(MDOC_ROOT != n->type);                          assert(n->type != ROFFT_ROOT);
                         continue;                          continue;
                 }                  }
                 if (NULL != n->child)                  if (NULL != n->child)
Line 1591 
Line 1592 
   
         if (SEC_SYNOPSIS != n->sec ||          if (SEC_SYNOPSIS != n->sec ||
             NULL == (n = n->child) ||              NULL == (n = n->child) ||
             MDOC_TEXT != n->type)              n->type != ROFFT_TEXT)
                 return(0);                  return(0);
   
         /*          /*
Line 1602 
Line 1603 
         if (strcmp("#include", n->string))          if (strcmp("#include", n->string))
                 return(0);                  return(0);
   
         if (NULL == (n = n->next) || MDOC_TEXT != n->type)          if ((n = n->next) == NULL || n->type != ROFFT_TEXT)
                 return(0);                  return(0);
   
         /*          /*
Line 1632 
Line 1633 
         char    *cp;          char    *cp;
         size_t   sz;          size_t   sz;
   
         if (n->type != MDOC_TEXT)          if (n->type != ROFFT_TEXT)
                 return;                  return;
   
         /* Skip function pointer punctuation. */          /* Skip function pointer punctuation. */
Line 1658 
Line 1659 
         parse_mdoc_fname(mpage, n->child);          parse_mdoc_fname(mpage, n->child);
   
         for (n = n->child->next; n != NULL; n = n->next)          for (n = n->child->next; n != NULL; n = n->next)
                 if (n->type == MDOC_TEXT)                  if (n->type == ROFFT_TEXT)
                         putkey(mpage, n->string, TYPE_Fa);                          putkey(mpage, n->string, TYPE_Fa);
   
         return(0);          return(0);
Line 1669 
Line 1670 
         const struct mdoc_node *n)          const struct mdoc_node *n)
 {  {
   
         if (n->type != MDOC_HEAD)          if (n->type != ROFFT_HEAD)
                 return(1);                  return(1);
   
         if (n->child != NULL)          if (n->child != NULL)
Line 1703 
Line 1704 
         const struct mdoc_node *n)          const struct mdoc_node *n)
 {  {
   
         if (MDOC_BODY == n->type)          if (n->type == ROFFT_BODY)
                 mdoc_deroff(&mpage->desc, n);                  mdoc_deroff(&mpage->desc, n);
         return(0);          return(0);
 }  }
Line 1715 
Line 1716 
   
         if (SEC_NAME == n->sec)          if (SEC_NAME == n->sec)
                 putmdockey(mpage, n->child, NAME_TITLE);                  putmdockey(mpage, n->child, NAME_TITLE);
         else if (SEC_SYNOPSIS == n->sec && MDOC_HEAD == n->type) {          else if (n->sec == SEC_SYNOPSIS && n->type == ROFFT_HEAD) {
                 if (n->child == NULL)                  if (n->child == NULL)
                         putkey(mpage, meta->name, NAME_SYN);                          putkey(mpage, meta->name, NAME_SYN);
                 else                  else
Line 1724 
Line 1725 
         if ( ! (mpage->name_head_done ||          if ( ! (mpage->name_head_done ||
             n->child == NULL || n->child->string == NULL ||              n->child == NULL || n->child->string == NULL ||
             strcasecmp(n->child->string, meta->title))) {              strcasecmp(n->child->string, meta->title))) {
                 putkey(mpage, n->child->string, NAME_HEAD);                  putkey(mpage, n->child->string, ROFFT_HEAD);
                 mpage->name_head_done = 1;                  mpage->name_head_done = 1;
         }          }
         return(0);          return(0);
Line 1735 
Line 1736 
         const struct mdoc_node *n)          const struct mdoc_node *n)
 {  {
   
         return(SEC_CUSTOM == n->sec && MDOC_HEAD == n->type);          return(n->sec == SEC_CUSTOM && n->type == ROFFT_HEAD);
 }  }
   
 static int  static int
Line 1743 
Line 1744 
         const struct mdoc_node *n)          const struct mdoc_node *n)
 {  {
   
         return(MDOC_HEAD == n->type);          return(n->type == ROFFT_HEAD);
 }  }
   
 static int  static int
Line 1751 
Line 1752 
         const struct mdoc_node *n)          const struct mdoc_node *n)
 {  {
   
         return(MDOC_BODY == n->type);          return(n->type == ROFFT_BODY);
 }  }
   
 /*  /*

Legend:
Removed from v.1.140  
changed lines
  Added in v.1.141