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

Diff for /mandoc/Attic/libmdocml.c between version 1.19 and 1.21

version 1.19, 2008/12/08 16:29:57 version 1.21, 2008/12/10 14:42:46
Line 25 
Line 25 
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "libmdocml.h"  
 #include "private.h"  #include "private.h"
   
 static  int      md_run_enter(const struct md_args *,  static  int      md_run_enter(const struct md_args *,
Line 131  static int
Line 130  static int
 md_run_leave(const struct md_args *args, struct md_mbuf *mbuf,  md_run_leave(const struct md_args *args, struct md_mbuf *mbuf,
                 struct md_rbuf *rbuf, int c, void *data)                  struct md_rbuf *rbuf, int c, void *data)
 {  {
           md_exit          fp;
   
         assert(args);          assert(args);
         assert(mbuf);          assert(mbuf);
         assert(rbuf);          assert(rbuf);
Line 138  md_run_leave(const struct md_args *args, struct md_mbu
Line 139  md_run_leave(const struct md_args *args, struct md_mbu
         /* Run exiters. */          /* Run exiters. */
         switch (args->type) {          switch (args->type) {
         case (MD_HTML):          case (MD_HTML):
                 if ( ! md_exit_html(data, -1 == c ? 0 : 1))                  fp = md_exit_html;
                         c = -1;  
                 break;                  break;
           case (MD_XML):
                   fp = md_exit_xml;
                   break;
         default:          default:
                 if ( ! md_exit_xml(data, -1 == c ? 0 : 1))                  fp = md_exit_noop;
                         c = -1;  
                 break;                  break;
         }          }
   
           if ( ! (*fp)(data, -1 == c ? 0 : 1))
                   c = -1;
   
         /* Make final flush of buffer. */          /* Make final flush of buffer. */
         if (-1 != c && ! md_buf_flush(mbuf))          if (-1 != c && ! md_buf_flush(mbuf))
                 return(-1);                  return(-1);
Line 173  md_run_enter(const struct md_args *args, struct md_mbu
Line 178  md_run_enter(const struct md_args *args, struct md_mbu
         case (MD_HTML):          case (MD_HTML):
                 fp = md_line_html;                  fp = md_line_html;
                 break;                  break;
         default:          case (MD_XML):
                 fp = md_line_xml;                  fp = md_line_xml;
                 break;                  break;
           default:
                   fp = md_line_noop;
                   break;
         }          }
   
         pos = 0;          pos = 0;
Line 218  int
Line 226  int
 md_run(const struct md_args *args,  md_run(const struct md_args *args,
                 const struct md_buf *out, const struct md_buf *in)                  const struct md_buf *out, const struct md_buf *in)
 {  {
           md_init          fp;
         struct md_mbuf   mbuf;          struct md_mbuf   mbuf;
         struct md_rbuf   rbuf;          struct md_rbuf   rbuf;
         void            *data;          void            *data;
Line 235  md_run(const struct md_args *args,
Line 244  md_run(const struct md_args *args,
         /* Run initialisers. */          /* Run initialisers. */
         switch (args->type) {          switch (args->type) {
         case (MD_HTML):          case (MD_HTML):
                 data = md_init_html(args, &mbuf, &rbuf);                  fp = md_init_html;
                 break;                  break;
           case (MD_XML):
                   fp = md_init_xml;
                   break;
         default:          default:
                 data = md_init_xml(args, &mbuf, &rbuf);                  fp = md_init_noop;
                 break;                  break;
         }          }
   
           data = (*fp)(args, &mbuf, &rbuf);
   
         /* Go into mainline. */          /* Go into mainline. */
         return(md_run_enter(args, &mbuf, &rbuf, data));          return(md_run_enter(args, &mbuf, &rbuf, data));

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.21

CVSweb