Lines Matching refs:st
387 struct mime_encoder_state *st = &part->encstate; in encoder_nop_read() local
388 size_t insize = st->bufend - st->bufbeg; in encoder_nop_read()
399 memcpy(buffer, st->buf + st->bufbeg, size); in encoder_nop_read()
401 st->bufbeg += size; in encoder_nop_read()
415 struct mime_encoder_state *st = &part->encstate; in encoder_7bit_read() local
416 size_t cursize = st->bufend - st->bufbeg; in encoder_7bit_read()
427 *buffer = st->buf[st->bufbeg]; in encoder_7bit_read()
430 st->bufbeg++; in encoder_7bit_read()
441 struct mime_encoder_state *st = &part->encstate; in encoder_base64_read() local
446 while(st->bufbeg < st->bufend) { in encoder_base64_read()
448 if(st->pos > MAX_ENCODED_LINE_LENGTH - 4) { in encoder_base64_read()
457 st->pos = 0; in encoder_base64_read()
468 if(st->bufend - st->bufbeg < 3) in encoder_base64_read()
472 i = st->buf[st->bufbeg++] & 0xFF; in encoder_base64_read()
473 i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF); in encoder_base64_read()
474 i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF); in encoder_base64_read()
480 st->pos += 4; in encoder_base64_read()
496 if(st->bufend != st->bufbeg) { in encoder_base64_read()
498 if(st->bufend - st->bufbeg == 2) in encoder_base64_read()
499 i = (st->buf[st->bufbeg + 1] & 0xFF) << 8; in encoder_base64_read()
501 i |= (st->buf[st->bufbeg] & 0xFF) << 16; in encoder_base64_read()
504 if(++st->bufbeg != st->bufend) { in encoder_base64_read()
506 st->bufbeg++; in encoder_base64_read()
509 st->pos += 4; in encoder_base64_read()
537 static int qp_lookahead_eol(struct mime_encoder_state *st, int ateof, size_t n) in qp_lookahead_eol() argument
539 n += st->bufbeg; in qp_lookahead_eol()
540 if(n >= st->bufend && ateof) in qp_lookahead_eol()
542 if(n + 2 > st->bufend) in qp_lookahead_eol()
544 if(qp_class[st->buf[n] & 0xFF] == QP_CR && in qp_lookahead_eol()
545 qp_class[st->buf[n + 1] & 0xFF] == QP_LF) in qp_lookahead_eol()
554 struct mime_encoder_state *st = &part->encstate; in encoder_qp_read() local
564 while(st->bufbeg < st->bufend) { in encoder_qp_read()
567 int i = st->buf[st->bufbeg]; in encoder_qp_read()
572 switch(qp_class[st->buf[st->bufbeg] & 0xFF]) { in encoder_qp_read()
577 switch(qp_lookahead_eol(st, ateof, 1)) { in encoder_qp_read()
591 switch(qp_lookahead_eol(st, ateof, 0)) { in encoder_qp_read()
612 softlinebreak = st->pos + len > MAX_ENCODED_LINE_LENGTH; in encoder_qp_read()
613 if(!softlinebreak && st->pos + len == MAX_ENCODED_LINE_LENGTH) { in encoder_qp_read()
616 switch(qp_lookahead_eol(st, ateof, consumed)) { in encoder_qp_read()
643 st->pos += len; in encoder_qp_read()
645 st->pos = 0; in encoder_qp_read()
646 st->bufbeg += consumed; in encoder_qp_read()
860 struct mime_encoder_state *st = &part->encstate; in read_encoded_part_content() local
866 if(st->bufbeg < st->bufend || ateof) { in read_encoded_part_content()
886 if(st->bufbeg) { in read_encoded_part_content()
887 size_t len = st->bufend - st->bufbeg; in read_encoded_part_content()
890 memmove(st->buf, st->buf + st->bufbeg, len); in read_encoded_part_content()
891 st->bufbeg = 0; in read_encoded_part_content()
892 st->bufend = len; in read_encoded_part_content()
894 if(st->bufend >= sizeof(st->buf)) in read_encoded_part_content()
896 sz = read_part_content(part, st->buf + st->bufend, in read_encoded_part_content()
897 sizeof(st->buf) - st->bufend, hasread); in read_encoded_part_content()
908 st->bufend += sz; in read_encoded_part_content()