88 #define LEN(s) VSTRING_LEN(s)
90 static int cleanup_body_edit_ptr_rec_len;
96 const char *myname =
"cleanup_body_edit_start";
156 const char *myname =
"cleanup_body_edit_write";
160 ssize_t space_needed;
164 msg_info(
"%s: where %ld, buflen %ld region start %ld len %ld",
166 (
long) curr_rp->
start, (
long) curr_rp->
len);
175 if (curr_rp->
len > 0) {
178 space_needed = rec_len + cleanup_body_edit_ptr_rec_len;
179 if (space_needed > curr_rp->
len - space_used) {
188 msg_info(
"%s: link %ld -> %ld", myname,
191 (
long) next_rp->
start);
194 curr_rp->
next = next_rp;
off_t vstream_ftell(VSTREAM *stream)
CLEANUP_REGION * cleanup_region_return(CLEANUP_STATE *, CLEANUP_REGION *)
#define REC_TYPE_PTR_PAYL_SIZE
void cleanup_region_close(CLEANUP_STATE *, CLEANUP_REGION *)
int cleanup_body_edit_start(CLEANUP_STATE *state)
#define CLEANUP_OUT_BUF(s, t, b)
CLEANUP_REGION * cleanup_region_open(CLEANUP_STATE *, ssize_t)
int cleanup_body_edit_finish(CLEANUP_STATE *state)
void cleanup_region_init(CLEANUP_STATE *)
#define REC_TYPE_PTR_FORMAT
off_t append_hdr_pt_offset
void msg_warn(const char *fmt,...)
struct CLEANUP_REGION * curr_body_region
struct CLEANUP_REGION * body_regions
off_t vstream_fseek(VSTREAM *stream, off_t offset, int whence)
int cleanup_body_edit_write(CLEANUP_STATE *state, int rec_type, VSTRING *buf)
#define CLEANUP_OUT_OK(s)
off_t append_hdr_pt_target
struct CLEANUP_REGION * next
int rec_fprintf(VSTREAM *stream, int type, const char *format,...)
#define REC_SPACE_NEED(buflen, reclen)
void msg_info(const char *fmt,...)