[xiph-commits] r16856 - in trunk/ao: include/ao src

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Sat Jan 30 06:30:57 PST 2010


Author: xiphmont
Date: 2010-01-30 06:30:57 -0800 (Sat, 30 Jan 2010)
New Revision: 16856

Modified:
   trunk/ao/include/ao/ao_private.h
   trunk/ao/src/config.c
Log:
Fixes #1103; eliminate read_config_files namespace collision by adding 
ao_ prefix


Modified: trunk/ao/include/ao/ao_private.h
===================================================================
--- trunk/ao/include/ao/ao_private.h	2010-01-30 13:38:02 UTC (rev 16855)
+++ trunk/ao/include/ao/ao_private.h	2010-01-30 14:30:57 UTC (rev 16856)
@@ -105,8 +105,7 @@
 
 /* --- Functions --- */
 
-void read_config_files (ao_config *config);
-int read_config_file(ao_config *config, const char *config_file);
+void ao_read_config_files (ao_config *config);
 
 #define adebug(format, args...) {\
     if(device->verbose==2){                                             \

Modified: trunk/ao/src/config.c
===================================================================
--- trunk/ao/src/config.c	2010-01-30 13:38:02 UTC (rev 16855)
+++ trunk/ao/src/config.c	2010-01-30 14:30:57 UTC (rev 16856)
@@ -28,32 +28,15 @@
  ********************************************************************/
 
 #include "ao.h"
+#include "ao_private.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
 
-void read_config_files (ao_config *config)
-{
-	char userfile[FILENAME_MAX+1];
-	char *homedir = getenv("HOME");
-
-	/* Read the system-wide config file */
-	read_config_file(config, AO_SYSTEM_CONFIG);
-	
-	/* Read the user config file */
-	if ( homedir!=NULL && 
-	     strlen(homedir) <= FILENAME_MAX - strlen(AO_USER_CONFIG) )
-	{
-		strncpy(userfile, homedir, FILENAME_MAX);
-		strcat(userfile, AO_USER_CONFIG);
-		read_config_file(config, userfile);
-	}
-}
-
 #define LINE_LEN 100
 
-int read_config_file(ao_config *config, const char *config_file)
+static int ao_read_config_file(ao_config *config, const char *config_file)
 {
 	FILE *fp;
 	char line[LINE_LEN];
@@ -80,3 +63,22 @@
 
 	return 1;
 }
+
+void ao_read_config_files (ao_config *config)
+{
+	char userfile[FILENAME_MAX+1];
+	char *homedir = getenv("HOME");
+
+	/* Read the system-wide config file */
+	read_config_file(config, AO_SYSTEM_CONFIG);
+	
+	/* Read the user config file */
+	if ( homedir!=NULL && 
+	     strlen(homedir) <= FILENAME_MAX - strlen(AO_USER_CONFIG) )
+	{
+		strncpy(userfile, homedir, FILENAME_MAX);
+		strcat(userfile, AO_USER_CONFIG);
+		read_config_file(config, userfile);
+	}
+}
+



More information about the commits mailing list