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

Diff for /mandoc/mandoc.c between version 1.75 and 1.78

version 1.75, 2013/12/31 23:23:10 version 1.78, 2014/04/08 01:37:27
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * 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 31 
Line 31 
 #include <time.h>  #include <time.h>
   
 #include "mandoc.h"  #include "mandoc.h"
   #include "mandoc_aux.h"
 #include "libmandoc.h"  #include "libmandoc.h"
   
 #define DATESIZE 32  #define DATESIZE 32
Line 160  mandoc_escape(const char **end, const char **start, in
Line 161  mandoc_escape(const char **end, const char **start, in
         /*          /*
          * These escapes are of the form \X'Y', where 'X' is the trigger           * These escapes are of the form \X'Y', where 'X' is the trigger
          * and 'Y' is any string.  These have opaque sub-strings.           * and 'Y' is any string.  These have opaque sub-strings.
            * The \B and \w escapes are handled in roff.c, roff_res().
          */           */
         case ('A'):          case ('A'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('b'):          case ('b'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('B'):  
                 /* FALLTHROUGH */  
         case ('D'):          case ('D'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('o'):          case ('o'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('R'):          case ('R'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('w'):  
                 /* FALLTHROUGH */  
         case ('X'):          case ('X'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('Z'):          case ('Z'):
                 if ('\'' != **start)                  if ('\0' == **start)
                         return(ESCAPE_ERROR);                          return(ESCAPE_ERROR);
                 gly = ESCAPE_IGNORE;                  gly = ESCAPE_IGNORE;
                   term = **start;
                 *start = ++*end;                  *start = ++*end;
                 term = '\'';  
                 break;                  break;
   
         /*          /*
Line 202  mandoc_escape(const char **end, const char **start, in
Line 200  mandoc_escape(const char **end, const char **start, in
         case ('v'):          case ('v'):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ('x'):          case ('x'):
                 if ('\'' != **start)                  if (strchr("\0 %&()*+-./0123456789:<=>", **start))
                         return(ESCAPE_ERROR);                          return(ESCAPE_ERROR);
                 gly = ESCAPE_IGNORE;                  gly = ESCAPE_IGNORE;
                   term = **start;
                 *start = ++*end;                  *start = ++*end;
                 term = '\'';  
                 break;                  break;
   
         /*          /*
Line 351  mandoc_escape(const char **end, const char **start, in
Line 349  mandoc_escape(const char **end, const char **start, in
         }          }
   
         return(gly);          return(gly);
 }  
   
 void *  
 mandoc_calloc(size_t num, size_t size)  
 {  
         void            *ptr;  
   
         ptr = calloc(num, size);  
         if (NULL == ptr) {  
                 perror(NULL);  
                 exit((int)MANDOCLEVEL_SYSERR);  
         }  
   
         return(ptr);  
 }  
   
   
 void *  
 mandoc_malloc(size_t size)  
 {  
         void            *ptr;  
   
         ptr = malloc(size);  
         if (NULL == ptr) {  
                 perror(NULL);  
                 exit((int)MANDOCLEVEL_SYSERR);  
         }  
   
         return(ptr);  
 }  
   
   
 void *  
 mandoc_realloc(void *ptr, size_t size)  
 {  
   
         ptr = realloc(ptr, size);  
         if (NULL == ptr) {  
                 perror(NULL);  
                 exit((int)MANDOCLEVEL_SYSERR);  
         }  
   
         return(ptr);  
 }  
   
 char *  
 mandoc_strndup(const char *ptr, size_t sz)  
 {  
         char            *p;  
   
         p = mandoc_malloc(sz + 1);  
         memcpy(p, ptr, sz);  
         p[(int)sz] = '\0';  
         return(p);  
 }  
   
 char *  
 mandoc_strdup(const char *ptr)  
 {  
         char            *p;  
   
         p = strdup(ptr);  
         if (NULL == p) {  
                 perror(NULL);  
                 exit((int)MANDOCLEVEL_SYSERR);  
         }  
   
         return(p);  
 }  }
   
 /*  /*

Legend:
Removed from v.1.75  
changed lines
  Added in v.1.78

CVSweb