28static const char *
const trans[040] = {
61static const char rub[] = {
"\\177"};
89#define INIT_BUF_SIZE 1024
90#define MAX_BUF_SIZE 1024*8192
296 memset(eval, 0,
sizeof(*eval));
333 for (
i = 0;
i <
sizeof(eval->
abuf) /
sizeof(eval->
abuf[0]);
i++)
444 if (
llen == bufsz - 1) {
540 while (
ipc->command) {
617 if ((
ipc =
ipc->lb1) == 0) {
695 if (
n > 0 &&
n < 999) {
707 while ((
c = *
rp++) != 0) {
714 else if (
c ==
'\\') {
716 if (
c >=
'1' &&
c <
NBRA+
'1') {
777 switch(
ipc->command) {
804 while (*
p1 !=
'\n') {
860 if ((
unsigned char)*
p1 >= 040) {
863 while ((*
p2++ = *
p3++) != 0)
886 *
p2++ = (*
p1 >> 6) +
'0';
895 *
p2++ = ((*
p1 >> 3) & 07) +
'0';
904 *
p2++ = (*
p1++ & 07) +
'0';
926 while ((*
p2++ = *
p3++) != 0)
1010 if (
ipc->pfl == 1) {
1022 if (
i && (
ipc->findex >= 0) && eval->
fcode[
ipc->findex])
1028 if (eval->
sflag == 0)
break;
1034 if (
ipc->findex >= 0)
1051 while ((*
p1 =
p2[(
unsigned char)*
p1]) != 0)
p1++;
1064 while (*++eval->
aptr) {
1065 if ((*eval->
aptr)->command ==
ACOM) {
int int const char ** match
const char apr_size_t len
APR general purpose library routines.
const unsigned char * buf
apr_pool_t const char apr_dbd_t const char ** error
const char int apr_pool_t * pool
void * memchr(const void *s, int c, size_t n)
apr_vformatter_buff_t const char * fmt
apr_vformatter_buff_t * c
#define apr_pcalloc(p, size)
apr_size_t const char * filename
apr_child_errfn_t * errfn
const char const char *const * args
apr_status_t() sed_err_fn_t(void *data, const char *error)
char * sed_get_finalize_error(const sed_commands_t *commands, apr_pool_t *pool)
int sed_canbe_finalized(const sed_commands_t *commands)
apr_status_t() sed_write_fn_t(void *ctx, char *buf, apr_size_t sz)
static const char *const trans[040]
static apr_status_t dosub(sed_eval_t *eval, char *rhsbuf, int n, step_vars_storage *step_vars)
static apr_status_t wline(sed_eval_t *eval, char *buf, apr_size_t sz)
apr_status_t sed_init_eval(sed_eval_t *eval, sed_commands_t *commands, sed_err_fn_t *errfn, void *data, sed_write_fn_t *writefn, apr_pool_t *p)
void sed_destroy_eval(sed_eval_t *eval)
static int substitute(sed_eval_t *eval, sed_reptr_t *ipc, step_vars_storage *step_vars)
static apr_status_t append_to_holdbuf(sed_eval_t *eval, const char *sz)
static apr_status_t append_to_linebuf(sed_eval_t *eval, const char *sz, step_vars_storage *step_vars)
static apr_status_t append_to_genbuf(sed_eval_t *eval, const char *sz, char **gspend)
static apr_status_t appendmem_to_linebuf(sed_eval_t *eval, const char *sz, apr_size_t len)
static apr_status_t grow_gen_buffer(sed_eval_t *eval, apr_size_t newsize, char **gspend)
apr_status_t sed_finalize_eval(sed_eval_t *eval, void *fout)
static apr_status_t grow_line_buffer(sed_eval_t *eval, apr_size_t newsize)
apr_status_t sed_reset_eval(sed_eval_t *eval, sed_commands_t *commands, sed_err_fn_t *errfn, void *data)
apr_status_t sed_eval_buffer(sed_eval_t *eval, const char *buf, apr_size_t bufsz, void *fout)
static apr_status_t copy_to_genbuf(sed_eval_t *eval, const char *sz)
int sed_step(char *p1, char *p2, int circf, step_vars_storage *vars)
static apr_status_t grow_hold_buffer(sed_eval_t *eval, apr_size_t newsize)
static char * place(sed_eval_t *eval, char *asp, char *al1, char *al2)
static apr_status_t copy_to_holdbuf(sed_eval_t *eval, const char *sz)
static apr_status_t grow_buffer(apr_pool_t *pool, char **buffer, char **spend, apr_size_t *cursize, apr_size_t newsize)
static apr_status_t command(sed_eval_t *eval, sed_reptr_t *ipc, step_vars_storage *step_vars)
static apr_status_t copy_to_linebuf(sed_eval_t *eval, const char *sz, step_vars_storage *step_vars)
static apr_status_t execute(sed_eval_t *eval)
static apr_status_t arout(sed_eval_t *eval)
static void eval_errf(sed_eval_t *eval, const char *fmt,...)
apr_status_t sed_eval_file(sed_eval_t *eval, apr_file_t *fin, void *fout)
sed_commands_t * commands