version 1.8, 2008/11/24 08:50:33 |
version 1.12, 2008/11/28 11:21:12 |
|
|
* PERFORMANCE OF THIS SOFTWARE. |
* PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
#include <assert.h> |
#include <assert.h> |
|
#include <ctype.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <err.h> |
#include <err.h> |
#include <stdio.h> |
#include <stdio.h> |
Line 136 md_run_leave(const struct md_args *args, struct md_mbu |
|
Line 137 md_run_leave(const struct md_args *args, struct md_mbu |
|
/* Run exiters. */ |
/* Run exiters. */ |
switch (args->type) { |
switch (args->type) { |
case (MD_HTML4_STRICT): |
case (MD_HTML4_STRICT): |
if ( ! md_exit_html4_strict(args, mbuf, rbuf, c, data)) |
if ( ! md_exit_html4_strict(data, -1 == c ? 0 : 1)) |
return(-1); |
c = -1; |
break; |
break; |
case (MD_DUMMY): |
|
break; |
|
default: |
default: |
abort(); |
if ( ! md_exit_valid(data, -1 == c ? 0 : 1)) |
|
c = -1; |
|
break; |
} |
} |
|
|
/* Make final flush of buffer. */ |
/* Make final flush of buffer. */ |
Line 172 md_run_enter(const struct md_args *args, struct md_mbu |
|
Line 173 md_run_enter(const struct md_args *args, struct md_mbu |
|
fp = md_line_html4_strict; |
fp = md_line_html4_strict; |
break; |
break; |
default: |
default: |
fp = md_line_dummy; |
fp = md_line_valid; |
break; |
break; |
} |
} |
|
|
|
|
return(md_run_leave(args, mbuf, rbuf, 0, p)); |
return(md_run_leave(args, mbuf, rbuf, 0, p)); |
|
|
for (i = 0; i < sz; i++) { |
for (i = 0; i < sz; i++) { |
|
/* |
|
if ( ! isascii(rbuf->buf[i])) { |
|
warnx("%s: non-ascii char (line %zu, col %zu)", |
|
rbuf->name, rbuf->line, pos); |
|
return(md_run_leave(args, mbuf, rbuf, -1, p)); |
|
} |
|
*/ |
if ('\n' != rbuf->buf[i]) { |
if ('\n' != rbuf->buf[i]) { |
if (pos < BUFFER_LINE) { |
if (pos < BUFFER_LINE) { |
/* LINTED */ |
/* LINTED */ |
|
|
} |
} |
|
|
line[pos] = 0; |
line[pos] = 0; |
if ( ! (*fp)(args, mbuf, rbuf, line, pos, p)) |
if ( ! (*fp)(p, line, pos)) |
return(md_run_leave(args, mbuf, rbuf, -1, p)); |
return(md_run_leave(args, mbuf, rbuf, -1, p)); |
rbuf->line++; |
rbuf->line++; |
pos = 0; |
pos = 0; |
Line 228 md_run(const struct md_args *args, |
|
Line 236 md_run(const struct md_args *args, |
|
|
|
mbuf.pos = 0; |
mbuf.pos = 0; |
rbuf.line = 1; |
rbuf.line = 1; |
data = NULL; |
|
|
|
/* Run initialisers. */ |
/* Run initialisers. */ |
switch (args->type) { |
switch (args->type) { |
case (MD_HTML4_STRICT): |
case (MD_HTML4_STRICT): |
if ( ! md_init_html4_strict(args, &mbuf, &rbuf, &data)) |
data = md_init_html4_strict |
return(-1); |
(args, &mbuf, &rbuf); |
break; |
break; |
case (MD_DUMMY): |
|
break; |
|
default: |
default: |
abort(); |
data = md_init_valid |
|
(args, &mbuf, &rbuf); |
|
break; |
} |
} |
|
|
/* Go into mainline. */ |
/* Go into mainline. */ |