Lines Matching refs:bvp
48 static int berval_from_file( const char *path, struct berval *bvp,
215 * Populate *bvp from "value" of length "vlen."
225 * If successful, LDAPTOOL_FILEURL_SUCCESS is returned and bvp->bv_len
226 * and bvp->bv_val are set (the latter is set to malloc'd memory).
231 struct berval *bvp, int recognize_url_syntax, int always_try_file,
296 rc = berval_from_file( path, bvp, reporterrs );
308 rc = berval_from_file( value, bvp, reporterrs );
310 bvp->bv_len = vlen;
311 if (( bvp->bv_val = (char *)malloc( vlen + 1 )) == NULL ) {
315 SAFEMEMCPY( bvp->bv_val, value, vlen );
316 bvp->bv_val[ vlen ] = '\0';
348 * Populate *bvp with the contents of the file named by "path".
353 * If successful, LDAPTOOL_FILEURL_SUCCESS is returned and bvp->bv_len
354 * and bvp->bv_val are set (the latter is set to malloc'd memory).
359 berval_from_file( const char *path, struct berval *bvp, int reporterrs )
385 bvp->bv_len = ftell( fp );
387 if (( bvp->bv_val = (char *)malloc( bvp->bv_len + 1 )) == NULL ) {
399 rlen = fread( bvp->bv_val, 1, bvp->bv_len, fp );
403 if ( rlen != (long)bvp->bv_len ) {
405 free( bvp->bv_val );
409 bvp->bv_val[ bvp->bv_len ] = '\0';