version 1.5, 2008/12/04 19:31:57 |
version 1.7, 2008/12/05 19:45:15 |
Line 31 extern size_t strlcpy(char *, const char *, size_t) |
|
Line 31 extern size_t strlcpy(char *, const char *, size_t) |
|
|
|
|
|
int |
int |
|
ml_putstring(struct md_mbuf *p, const char *buf, size_t *pos) |
|
{ |
|
|
|
return(ml_nputstring(p, buf, strlen(buf), pos)); |
|
} |
|
|
|
|
|
int |
ml_nputstring(struct md_mbuf *p, |
ml_nputstring(struct md_mbuf *p, |
const char *buf, size_t sz, size_t *pos) |
const char *buf, size_t sz, size_t *pos) |
{ |
{ |
Line 43 ml_nputstring(struct md_mbuf *p, |
|
Line 51 ml_nputstring(struct md_mbuf *p, |
|
|
|
/* Escaped value. */ |
/* Escaped value. */ |
case ('\\'): |
case ('\\'): |
if (-1 == (v = rofftok_scan(buf, &i))) { |
if (-1 == (v = rofftok_scan(buf, &i))) |
/* TODO: error. */ |
|
return(0); |
return(0); |
} |
|
|
|
switch (v) { |
switch (v) { |
case (ROFFTok_Sp_A): |
case (ROFFTok_Sp_A): |
Line 170 ml_nputstring(struct md_mbuf *p, |
|
Line 176 ml_nputstring(struct md_mbuf *p, |
|
ssz = 0; |
ssz = 0; |
break; |
break; |
default: |
default: |
/* TODO: print error. */ |
return(0); |
return(-1); |
|
} |
} |
break; |
break; |
|
|
Line 222 ml_nputs(struct md_mbuf *p, const char *buf, size_t sz |
|
Line 227 ml_nputs(struct md_mbuf *p, const char *buf, size_t sz |
|
if ( ! md_buf_puts(p, buf, sz)) |
if ( ! md_buf_puts(p, buf, sz)) |
return(0); |
return(0); |
|
|
*pos += sz; |
if (pos) |
|
*pos += sz; |
return(1); |
return(1); |
} |
} |
|
|
Line 237 ml_puts(struct md_mbuf *p, const char *buf, size_t *po |
|
Line 243 ml_puts(struct md_mbuf *p, const char *buf, size_t *po |
|
|
|
if ( ! md_buf_puts(p, buf, sz)) |
if ( ! md_buf_puts(p, buf, sz)) |
return(0); |
return(0); |
*pos += sz; |
|
|
if (pos) |
|
*pos += sz; |
return(1); |
return(1); |
} |
} |
|
|