src/lib/gscphost/lappregistries.c
gs_retval_t streamregistry_getactiveringbuf_reset()
{
    gs_int32_t x,y;
    /* XXXOS this is not the most effective way of doing
     this needs improvment. */
    /* Build a list of all ringbufs make sure they
     are unique since multiple entrys could share
     a ringbuf
     */
    if (rbr!=0) (free(rbr));
    if ((rbr=malloc(sizeof(struct ringbuf *)*lsreg))==0) {
        gslog(LOG_EMERG,"Can't allocate memory in ftaregistry\n");
        return -1;
    }
    memset(rbr,0,sizeof(struct ringbuf *)*lsreg);
    lrbr=0;
    for(x=0;x<lsreg;x++) {
        if (sreg[x].used) {
            for(y=0;(y<lrbr)&&(rbr[y]!=sreg[x].r);y++);
            if (y>=lrbr) {
                rbr[y]=sreg[x].r;
                lrbr++;
            }
        }
    }
    return 0;
}
/* the following two functions are used to cycle
 through all ringbuffers
 */
the following two functions are used to cycle
through all ringbuffers
the following two functions are used to cycle through all ringbuffers
gs_retval_t streamregistry_getactiveringbuf_reset()
{
    gs_int32_t x,y;
    if (rbr!=0) (free(rbr));
    if ((rbr=malloc(sizeof(struct ringbuf *)*lsreg))==0) {
        gslog(LOG_EMERG,"Can't allocate memory in ftaregistry\n");
        return -1;
    }
    memset(rbr,0,sizeof(struct ringbuf *)*lsreg);
    lrbr=0;
    for(x=0;x<lsreg;x++) {
        if (sreg[x].used) {
            for(y=0;(y<lrbr)&&(rbr[y]!=sreg[x].r);y++);
            if (y>=lrbr) {
                rbr[y]=sreg[x].r;
                lrbr++;
            }
        }
    }
    return 0;
}
gs_retval_t streamregistry_getactiveringbuf_reset ( ) { gs_int32_t x , y ; if ( rbr != 0 ) ( free ( rbr ) ) ; if ( ( rbr = malloc ( sizeof ( struct ringbuf * ) * lsreg ) ) == 0 ) { gslog ( LOG_EMERG , " \n " ) ; return -1 ; } memset ( rbr , 0 , sizeof ( struct ringbuf * ) * lsreg ) ; lrbr = 0 ; for ( x = 0 ; x < lsreg ; x ++ ) { if ( sreg [ x ] . used ) { for ( y = 0 ; ( y < lrbr ) && ( rbr [ y ] != sreg [ x ] . r ) ; y ++ ) ; if ( y >= lrbr ) { rbr [ y ] = sreg [ x ] . r ; lrbr ++ ; } } } return 0 ; }
the following two functions are used to cycle
through all ringbuffers
the following two functions are used to cycle through all ringbuffers
/* XXXOS this is not the most effective way of doing
     this needs improvment. */ /* Build a list of all ringbufs make sure they
     are unique since multiple entrys could share
     a ringbuf
     */