node_modules/iltorb/brotli/enc/encode.c
static BROTLI_BOOL InjectFlushOrPushOutput(BrotliEncoderState* s,
    size_t* available_out, uint8_t** next_out, size_t* total_out) {
  if (s->stream_state_ == BROTLI_STREAM_FLUSH_REQUESTED &&
      s->last_byte_bits_ != 0) {
    InjectBytePaddingBlock(s);
    return BROTLI_TRUE;
  }

  if (s->available_out_ != 0 && *available_out != 0) {
    size_t copy_output_size =
        BROTLI_MIN(size_t, s->available_out_, *available_out);
    memcpy(*next_out, s->next_out_, copy_output_size);
    *next_out += copy_output_size;
    *available_out -= copy_output_size;
    s->next_out_ += copy_output_size;
    s->available_out_ -= copy_output_size;
    s->total_out_ += copy_output_size;
    if (total_out) *total_out = s->total_out_;
    return BROTLI_TRUE;
  }

  return BROTLI_FALSE;
}
/* Injects padding bits or pushes compressed data to output.
   Returns false if nothing is done. */
Injects padding bits or pushes compressed data to output.
Returns false if nothing is done.
Injects padding bits or pushes compressed data to output . Returns false if nothing is done .
static BROTLI_BOOL InjectFlushOrPushOutput(BrotliEncoderState* s,
    size_t* available_out, uint8_t** next_out, size_t* total_out) {
  if (s->stream_state_ == BROTLI_STREAM_FLUSH_REQUESTED &&
      s->last_byte_bits_ != 0) {
    InjectBytePaddingBlock(s);
    return BROTLI_TRUE;
  }
  if (s->available_out_ != 0 && *available_out != 0) {
    size_t copy_output_size =
        BROTLI_MIN(size_t, s->available_out_, *available_out);
    memcpy(*next_out, s->next_out_, copy_output_size);
    *next_out += copy_output_size;
    *available_out -= copy_output_size;
    s->next_out_ += copy_output_size;
    s->available_out_ -= copy_output_size;
    s->total_out_ += copy_output_size;
    if (total_out) *total_out = s->total_out_;
    return BROTLI_TRUE;
  }
  return BROTLI_FALSE;
}
static BROTLI_BOOL InjectFlushOrPushOutput ( BrotliEncoderState * s , size_t * available_out , uint8_t * * next_out , size_t * total_out ) { if ( s -> stream_state_ == BROTLI_STREAM_FLUSH_REQUESTED && s -> last_byte_bits_ != 0 ) { InjectBytePaddingBlock ( s ) ; return BROTLI_TRUE ; } if ( s -> available_out_ != 0 && * available_out != 0 ) { size_t copy_output_size = BROTLI_MIN ( size_t , s -> available_out_ , * available_out ) ; memcpy ( * next_out , s -> next_out_ , copy_output_size ) ; * next_out += copy_output_size ; * available_out -= copy_output_size ; s -> next_out_ += copy_output_size ; s -> available_out_ -= copy_output_size ; s -> total_out_ += copy_output_size ; if ( total_out ) * total_out = s -> total_out_ ; return BROTLI_TRUE ; } return BROTLI_FALSE ; }
Injects padding bits or pushes compressed data to output.
Injects padding bits or pushes compressed data to output .