examples/basic-decoder.c
static void
dump_streaminfo(miniflac_t* decoder, membuffer_t* mem) {
    uint32_t used;
    uint8_t  temp8;
    uint16_t temp16;
    uint32_t temp32;
    uint64_t temp64;
    uint8_t md5[16];

    fprintf(stdout,"[streaminfo]\n");

    if(miniflac_streaminfo_min_block_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp16) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  min_block_size: %u\n",temp16);

    if(miniflac_streaminfo_max_block_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp16) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  max_block_size: %u\n",temp16);

    if(miniflac_streaminfo_min_frame_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp32) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  min_frame_size: %u\n",temp16);

    if(miniflac_streaminfo_max_frame_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp32) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  max_frame_size: %u\n",temp16);

    if(miniflac_streaminfo_sample_rate(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp32) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  sample_rate: %u\n",temp32);

    if(miniflac_streaminfo_channels(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp8) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  channels: %u\n",temp8);

    if(miniflac_streaminfo_bps(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp8) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  bps: %u\n",temp8);

    if(miniflac_streaminfo_total_samples(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp64) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  total_samples: %lu\n",temp64);

    if(miniflac_streaminfo_md5_data(decoder,&mem->buffer[mem->pos],mem->len,&used,md5,16,NULL) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  md5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
      md5[ 0], md5[ 1], md5[ 2], md5[ 3],
      md5[ 4], md5[ 5], md5[ 6], md5[ 7],
      md5[ 8], md5[ 9], md5[10], md5[11],
      md5[12], md5[13], md5[14], md5[15]);
    fflush(stdout);

}
/* this programs reads the entire FLAC file into memory, so if any function
 * returns something besides MINIFLAC_OK, we have an issue, so just abort() */
this programs reads the entire FLAC file into memory, so if any function
returns something besides MINIFLAC_OK, we have an issue, so just abort()
this programs reads the entire FLAC file into memory so if any function returns something besides MINIFLAC_OK we have an issue so just abort ()
static void
dump_streaminfo(miniflac_t* decoder, membuffer_t* mem) {
    uint32_t used;
    uint8_t  temp8;
    uint16_t temp16;
    uint32_t temp32;
    uint64_t temp64;
    uint8_t md5[16];
    fprintf(stdout,"[streaminfo]\n");
    if(miniflac_streaminfo_min_block_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp16) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  min_block_size: %u\n",temp16);
    if(miniflac_streaminfo_max_block_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp16) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  max_block_size: %u\n",temp16);
    if(miniflac_streaminfo_min_frame_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp32) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  min_frame_size: %u\n",temp16);
    if(miniflac_streaminfo_max_frame_size(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp32) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  max_frame_size: %u\n",temp16);
    if(miniflac_streaminfo_sample_rate(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp32) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  sample_rate: %u\n",temp32);
    if(miniflac_streaminfo_channels(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp8) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  channels: %u\n",temp8);
    if(miniflac_streaminfo_bps(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp8) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  bps: %u\n",temp8);
    if(miniflac_streaminfo_total_samples(decoder,&mem->buffer[mem->pos],mem->len,&used,&temp64) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  total_samples: %lu\n",temp64);
    if(miniflac_streaminfo_md5_data(decoder,&mem->buffer[mem->pos],mem->len,&used,md5,16,NULL) != MINIFLAC_OK) abort();
    mem->pos += used;
    mem->len -= used;
    fprintf(stdout,"  md5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
      md5[ 0], md5[ 1], md5[ 2], md5[ 3],
      md5[ 4], md5[ 5], md5[ 6], md5[ 7],
      md5[ 8], md5[ 9], md5[10], md5[11],
      md5[12], md5[13], md5[14], md5[15]);
    fflush(stdout);
}
static void dump_streaminfo ( miniflac_t * decoder , membuffer_t * mem ) { uint32_t used ; uint8_t temp8 ; uint16_t temp16 ; uint32_t temp32 ; uint64_t temp64 ; uint8_t md5 [ 16 ] ; fprintf ( stdout , " \n " ) ; if ( miniflac_streaminfo_min_block_size ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp16 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp16 ) ; if ( miniflac_streaminfo_max_block_size ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp16 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp16 ) ; if ( miniflac_streaminfo_min_frame_size ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp32 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp16 ) ; if ( miniflac_streaminfo_max_frame_size ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp32 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp16 ) ; if ( miniflac_streaminfo_sample_rate ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp32 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp32 ) ; if ( miniflac_streaminfo_channels ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp8 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp8 ) ; if ( miniflac_streaminfo_bps ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp8 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp8 ) ; if ( miniflac_streaminfo_total_samples ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , & temp64 ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , temp64 ) ; if ( miniflac_streaminfo_md5_data ( decoder , & mem -> buffer [ mem -> pos ] , mem -> len , & used , md5 , 16 , NULL ) != MINIFLAC_OK ) abort ( ) ; mem -> pos += used ; mem -> len -= used ; fprintf ( stdout , " \n " , md5 [ 0 ] , md5 [ 1 ] , md5 [ 2 ] , md5 [ 3 ] , md5 [ 4 ] , md5 [ 5 ] , md5 [ 6 ] , md5 [ 7 ] , md5 [ 8 ] , md5 [ 9 ] , md5 [ 10 ] , md5 [ 11 ] , md5 [ 12 ] , md5 [ 13 ] , md5 [ 14 ] , md5 [ 15 ] ) ; fflush ( stdout ) ; }
this programs reads the entire FLAC file into memory, so if any function
 returns something besides MINIFLAC_OK, we have an issue, so just abort()
this programs reads the entire FLAC file into memory so if any function returns something besides MINIFLAC_OK we have an issue so just abort ()