Lines Matching refs:tsdhdr
154 static PRLDAP_TPDHeader *prldap_tsd_realloc( PRLDAP_TPDHeader *tsdhdr,
525 PRLDAP_TPDHeader *tsdhdr;
531 tsdhdr = (PRLDAP_TPDHeader *)PR_GetThreadPrivate( prldap_tpdindex );
532 if ( tsdhdr == NULL || tpdindex >= tsdhdr->ptpdh_tpd_count ) {
533 tsdhdr = prldap_tsd_realloc( tsdhdr, tpdindex );
534 if ( tsdhdr == NULL ) {
539 tsdhdr->ptpdh_dataitems[ tpdindex ] = priv;
553 PRLDAP_TPDHeader *tsdhdr;
555 tsdhdr = (PRLDAP_TPDHeader *)PR_GetThreadPrivate( prldap_tpdindex );
556 if ( tsdhdr == NULL ) {
560 if ( tpdindex >= tsdhdr->ptpdh_tpd_count
561 || tsdhdr->ptpdh_dataitems == NULL ) {
565 return( tsdhdr->ptpdh_dataitems[ tpdindex ] );
573 * Note: tsdhdr can be NULL (allocates a new PRLDAP_TPDHeader).
576 prldap_tsd_realloc( PRLDAP_TPDHeader *tsdhdr, int maxindex )
581 if ( tsdhdr == NULL ) {
583 if (( tsdhdr = PR_Calloc( 1, sizeof( PRLDAP_TPDHeader ))) == NULL ) {
586 (void)PR_SetThreadPrivate( prldap_tpdindex, tsdhdr );
597 if ( count > tsdhdr->ptpdh_tpd_count ) {
602 if ( tsdhdr->ptpdh_dataitems != NULL ) { /* preserve old data */
603 memcpy( newdataitems, tsdhdr->ptpdh_dataitems,
604 tsdhdr->ptpdh_tpd_count * sizeof( void * ));
605 PR_Free( tsdhdr->ptpdh_dataitems );
608 tsdhdr->ptpdh_tpd_count = count;
609 tsdhdr->ptpdh_dataitems = newdataitems;
612 return( tsdhdr );
627 PRLDAP_TPDHeader *tsdhdr;
630 tsdhdr = (PRLDAP_TPDHeader *)priv;
631 if ( tsdhdr != NULL ) {
632 if ( tsdhdr->ptpdh_dataitems != NULL ) {
633 for ( i = 0; i < tsdhdr->ptpdh_tpd_count; ++i ) {
634 if ( tsdhdr->ptpdh_dataitems[ i ] != NULL ) {
635 PR_Free( tsdhdr->ptpdh_dataitems[ i ] );
636 tsdhdr->ptpdh_dataitems[ i ] = NULL;
639 PR_Free( tsdhdr->ptpdh_dataitems );
640 tsdhdr->ptpdh_dataitems = NULL;
642 PR_Free( tsdhdr );