util.c
changeset 18 d4ce82194b64
parent 16 e6a640ad2cc2
child 22 822094314703
--- a/util.c	Mon Nov 07 10:43:09 2011 -0800
+++ b/util.c	Wed Nov 09 15:54:37 2011 -0800
@@ -82,19 +82,6 @@
 
 
 /*
- * Output to stdout for squid, unless the debug level is at or above 5.
- */
-void
-out( const char *str )
-{
-	if ( v.debugmode >= 5 ) return;
-	fprintf( stdout, "%s", str );
-	fflush( stdout );
-	return;
-}
-
-
-/*
  * Given a string, reverse it in place.
  */
 void
@@ -177,47 +164,6 @@
 }
 
 
-/*
- * Read an entire file into memory, returning a pointer to the contents.
- * Returns NULL on error.
- *
- */
-char *
-slurp_file( char *file )
-{
-	FILE *fh       = NULL;
-	char *contents = NULL;
-	struct stat sb;
-
-	if ( stat( file, &sb ) != 0 ) {
-		debug( 1, LOC, "Unable to stat() file '%s': %s\n",
-				file, strerror(errno) );
-		return( NULL );
-	}
-
-	if ( (contents = malloc( sb.st_size + 1 )) == NULL ) {
-		debug( 5, LOC, "Unable to allocate memory for file '%s': %s\n",
-				file, strerror(errno) );
-		return( NULL );
-	}
-
-	if ( (fh = fopen( file, "r" )) == NULL ) {
-		debug( 1, LOC, "Could not open file for reading '%s': %s\n",
-				file, strerror(errno) );
-		return( NULL );
-	}
-
-	if ( fread( contents, sizeof(char), sb.st_size, fh ) != (unsigned int)sb.st_size ) {
-		debug( 5, LOC, "Short read for file '%s'?: %s\n", file );
-		fclose( fh );
-		return( NULL );
-	}
-
-	fclose( fh );
-	return( contents );
-}
-
-
 /* 
  * Allocate memory and copy +length+ bytes (plus 1 for null) from the given
  * +string+ into a new string, returning a pointer to it.