[BACK]Return to mdoc_strings.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/Attic/mdoc_strings.c between version 1.6 and 1.7

version 1.6, 2009/06/17 09:41:00 version 1.7, 2009/06/17 10:53:32
Line 24 
Line 24 
   
 #include "libmdoc.h"  #include "libmdoc.h"
   
   /* FIXME: this file is poorly named. */
   
 struct mdoc_secname {  struct mdoc_secname {
         const char      *name;  /* Name of section. */          const char      *name;  /* Name of section. */
         int              flag;          enum mdoc_sec    sec;   /* Corresponding section. */
 #define MSECNAME_META   (1 << 0)/* Logical section (not real). */  
 };  };
   
 /* Section names corresponding to mdoc_sec. */  #define SECNAME_MAX     (18)
   
 static  const struct mdoc_secname secnames[] = {  static  const struct mdoc_secname secnames[SECNAME_MAX] = {
         { "PROLOGUE", MSECNAME_META },          { "NAME", SEC_NAME },
         { "BODY", MSECNAME_META },          { "LIBRARY", SEC_LIBRARY },
         { "NAME", 0 },          { "SYNOPSIS", SEC_SYNOPSIS },
         { "LIBRARY", 0 },          { "DESCRIPTION", SEC_DESCRIPTION },
         { "SYNOPSIS", 0 },          { "IMPLEMENTATION NOTES", SEC_IMPLEMENTATION },
         { "DESCRIPTION", 0 },          { "RETURN VALUES", SEC_RETURN_VALUES },
         { "IMPLEMENTATION NOTES", 0 },          { "ENVIRONMENT", SEC_ENVIRONMENT },
         { "RETURN VALUES", 0 },          { "FILES", SEC_FILES },
         { "ENVIRONMENT", 0 },          { "EXAMPLES", SEC_EXAMPLES },
         { "FILES", 0 },          { "DIAGNOSTICS", SEC_DIAGNOSTICS },
         { "EXAMPLES", 0 },          { "COMPATIBILITY", SEC_COMPATIBILITY },
         { "DIAGNOSTICS", 0 },          { "ERRORS", SEC_ERRORS },
         { "COMPATIBILITY", 0 },          { "SEE ALSO", SEC_SEE_ALSO },
         { "ERRORS", 0 },          { "STANDARDS", SEC_STANDARDS },
         { "SEE ALSO", 0 },          { "HISTORY", SEC_HISTORY },
         { "STANDARDS", 0 },          { "AUTHORS", SEC_AUTHORS },
         { "HISTORY", 0 },          { "CAVEATS", SEC_CAVEATS },
         { "AUTHORS", 0 },          { "BUGS", SEC_BUGS },
         { "CAVEATS", 0 },  
         { "BUGS", 0 },  
         { NULL, 0 }  
 };  };
   
 #ifdef __linux__  #ifdef __linux__
Line 191  mdoc_isdelim(const char *p)
Line 189  mdoc_isdelim(const char *p)
 enum mdoc_sec  enum mdoc_sec
 mdoc_atosec(const char *p)  mdoc_atosec(const char *p)
 {  {
         const struct mdoc_secname *n;          int              i;
         int                        i;  
   
         for (i = 0, n = secnames; n->name; n++, i++)          for (i = 0; i < SECNAME_MAX; i++)
                 if ( ! (n->flag & MSECNAME_META))                  if (0 == strcmp(p, secnames[i].name))
                         if (0 == strcmp(p, n->name))                          return(secnames[i].sec);
                                 return((enum mdoc_sec)i);  
   
         return(SEC_CUSTOM);          return(SEC_CUSTOM);
 }  }
Line 209  mdoc_atotime(const char *p)
Line 205  mdoc_atotime(const char *p)
         struct tm        tm;          struct tm        tm;
         char            *pp;          char            *pp;
   
         (void)memset(&tm, 0, sizeof(struct tm));          bzero(&tm, sizeof(struct tm));
   
         if (0 == strcmp(p, "$" "Mdocdate$"))          if (0 == strcmp(p, "$" "Mdocdate$"))
                 return(time(NULL));                  return(time(NULL));

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

CVSweb