1 /* line64.c - routines for dealing with the slapd line format */
4 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
12 #include <ac/stdlib.h>
14 #include <ac/string.h>
15 #include <ac/socket.h>
25 #include "ldap_config.h"
30 LDAP_CONST char *urlstr,
45 url = fetchGetURL( (char*) urlstr, "" );
48 if( strncasecmp( "file://", urlstr, sizeof("file://")-1 ) == 0 ) {
49 p = strchr( &urlstr[sizeof("file://")-1], '/' );
54 /* we don't check for LDAP_DIRSEP since URLs should contain '/' */
56 /* skip over false root */
61 ldap_pvt_hex_unescape( p );
63 url = fopen( p, "rb" );
76 while( (bytes = fread( buffer, 1, sizeof(buffer), url )) != 0 ) {
77 char *newp = ber_memrealloc( p, total + bytes );
84 AC_MEMCPY( &p[total], buffer, bytes );