source/rock/frontend/NagaQueen.c
static int _nq_memread(void *ptr, size_t size, NagaQueenCore *core) {
    char *source = (char *) core->stream;
    size_t tocopy = size;
    size_t remaining = core->streamlen - core->streamoffset;
    if (tocopy > remaining) {
      tocopy = remaining;
    }
    memcpy(ptr, source + core->streamoffset, tocopy);
    core->streamoffset += tocopy;
    return (int) tocopy;
}
///////////////////// IO interface: supports memory + files ////////////////////////
IO interface: supports memory + files
IO interface : supports memory + files
static int _nq_memread(void *ptr, size_t size, NagaQueenCore *core) {
    char *source = (char *) core->stream;
    size_t tocopy = size;
    size_t remaining = core->streamlen - core->streamoffset;
    if (tocopy > remaining) {
      tocopy = remaining;
    }
    memcpy(ptr, source + core->streamoffset, tocopy);
    core->streamoffset += tocopy;
    return (int) tocopy;
}
static int _nq_memread ( void * ptr , size_t size , NagaQueenCore * core ) { char * source = ( char * ) core -> stream ; size_t tocopy = size ; size_t remaining = core -> streamlen - core -> streamoffset ; if ( tocopy > remaining ) { tocopy = remaining ; } memcpy ( ptr , source + core -> streamoffset , tocopy ) ; core -> streamoffset += tocopy ; return ( int ) tocopy ; }
IO interface: supports memory + files
IO interface : supports memory + files