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

Diff for /mandoc/Attic/mdoc_action.c between version 1.39 and 1.44

version 1.39, 2009/09/24 15:01:06 version 1.44, 2009/10/26 04:09:45
Line 14 
Line 14 
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
   #ifndef OSNAME
 #include <sys/utsname.h>  #include <sys/utsname.h>
   #endif
   
 #include <assert.h>  #include <assert.h>
 #include <errno.h>  #include <errno.h>
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   #include <time.h>
   
 #include "libmdoc.h"  #include "libmdoc.h"
   
Line 174  static const struct actions mdoc_actions[MDOC_MAX] = {
Line 177  static const struct actions mdoc_actions[MDOC_MAX] = {
         { NULL, NULL }, /* Ud */          { NULL, NULL }, /* Ud */
         { NULL, post_lb }, /* Lb */          { NULL, post_lb }, /* Lb */
         { NULL, NULL }, /* Lp */          { NULL, NULL }, /* Lp */
         { NULL, post_tilde }, /* Lk */          { NULL, NULL }, /* Lk */
         { NULL, NULL }, /* Mt */          { NULL, NULL }, /* Mt */
         { NULL, NULL }, /* Brq */          { NULL, NULL }, /* Brq */
         { NULL, NULL }, /* Bro */          { NULL, NULL }, /* Bro */
Line 186  static const struct actions mdoc_actions[MDOC_MAX] = {
Line 189  static const struct actions mdoc_actions[MDOC_MAX] = {
         { NULL, NULL }, /* %Q */          { NULL, NULL }, /* %Q */
         { NULL, NULL }, /* br */          { NULL, NULL }, /* br */
         { NULL, NULL }, /* sp */          { NULL, NULL }, /* sp */
           { NULL, NULL }, /* %U */
 };  };
   
 #define RSORD_MAX 13  #define RSORD_MAX 13
Line 520  static int
Line 524  static int
 post_os(POST_ARGS)  post_os(POST_ARGS)
 {  {
         char              buf[64];          char              buf[64];
   #ifndef OSNAME
         struct utsname    utsname;          struct utsname    utsname;
   #endif
   
           /*
            * Setting OSNAME to be the name of the target operating system,
            * e.g., "OpenBSD 4.4", will result in the compile-time constant
            * by supplied instead of the value in uname().
            */
   
         if (m->meta.os)          if (m->meta.os)
                 free(m->meta.os);                  free(m->meta.os);
   
Line 530  post_os(POST_ARGS)
Line 542  post_os(POST_ARGS)
                 return(0);                  return(0);
   
         if (0 == buf[0]) {          if (0 == buf[0]) {
   #ifdef  OSNAME
                   if (strlcat(buf, OSNAME, 64) >= 64)
                           return(mdoc_nerr(m, n, EUTSNAME));
   #else
                 if (-1 == uname(&utsname))                  if (-1 == uname(&utsname))
                         return(mdoc_nerr(m, n, EUTSNAME));                          return(mdoc_nerr(m, n, EUTSNAME));
                 if (strlcat(buf, utsname.sysname, 64) >= 64)                  if (strlcat(buf, utsname.sysname, 64) >= 64)
Line 538  post_os(POST_ARGS)
Line 554  post_os(POST_ARGS)
                         return(mdoc_nerr(m, n, ETOOLONG));                          return(mdoc_nerr(m, n, ETOOLONG));
                 if (strlcat(buf, utsname.release, 64) >= 64)                  if (strlcat(buf, utsname.release, 64) >= 64)
                         return(mdoc_nerr(m, n, ETOOLONG));                          return(mdoc_nerr(m, n, ETOOLONG));
   #endif
         }          }
   
         if (NULL == (m->meta.os = strdup(buf)))          if (NULL == (m->meta.os = strdup(buf)))
Line 757  post_tilde(POST_ARGS)
Line 774  post_tilde(POST_ARGS)
         np = n;          np = n;
         m->next = MDOC_NEXT_CHILD;          m->next = MDOC_NEXT_CHILD;
   
         /* XXX: not documented for `Lk'. */  
         if ( ! mdoc_word_alloc(m, n->line, n->pos, "~"))          if ( ! mdoc_word_alloc(m, n->line, n->pos, "~"))
                 return(0);                  return(0);
         m->last = np;          m->last = np;
Line 934  order_rs(int t)
Line 950  order_rs(int t)
 }  }
   
   
   /* ARGSUSED */
 static int  static int
 post_rs(POST_ARGS)  post_rs(POST_ARGS)
 {  {
Line 943  post_rs(POST_ARGS)
Line 960  post_rs(POST_ARGS)
         if (MDOC_BLOCK != n->type)          if (MDOC_BLOCK != n->type)
                 return(1);                  return(1);
   
           assert(n->body->child);
         for (next = NULL, nn = n->body->child->next; nn; nn = next) {          for (next = NULL, nn = n->body->child->next; nn; nn = next) {
                 o = order_rs(nn->tok);                  o = order_rs(nn->tok);
   

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.44

CVSweb