]> git.pld-linux.org Git - packages/aumix-gtk.git/blobdiff - aumix-home_etc.patch
- updated for 2.6.1.
[packages/aumix-gtk.git] / aumix-home_etc.patch
index 0b8befe4552fc6f95e32afda293e482b4bfc8566..cb8386a6d38b041efb263998882b3f7c2b49e542 100644 (file)
-diff -Nur aumix-1.27.4-orig/doc/aumix.1 aumix-1.27.4/doc/aumix.1
---- aumix-1.27.4-orig/doc/aumix.1      Wed Nov 24 13:51:36 1999
-+++ aumix-1.27.4/doc/aumix.1   Sat Nov 27 18:59:03 1999
-@@ -115,11 +115,11 @@
- .Nm
+diff -Nru aumix-2.6.1/doc/aumix.1 aumix-2.6.1.new/doc/aumix.1
+--- aumix-2.6.1/doc/aumix.1    Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/doc/aumix.1        Tue Jun 27 23:11:28 2000
+@@ -115,15 +115,19 @@
  go into interactive mode after doing things non-interactively.
  .It Fl L
--load settings from $HOME/.aumixrc, or /etc/aumixrc if the former is inaccessible
-+load settings from $HOME/etc/aumixrc, $HOME/.aumixrc, or /etc/aumixrc if the former are inaccessible
+ load settings from
+-.Pa $HOME/.aumixrc ,
+-or
++.Pa $CONFIG_DIR/aumixrc ,
++.Pa $HOME/.aumixrc
++(depreciated), or
+ .Pa /etc/aumixrc
+ if the former is inaccessible
  .It Fl q
  query all devices and print their settings
  .It Fl S
--save settings to $HOME/.aumixrc
-+save settings to $HOME/etc/aumixrc
+ save settings to
++.Pa $CONFIG_DIR/aumixrc
++or
+ .Pa $HOME/.aumixrc
++(depreciated)
  .El
- .Sh EXAMPLE
-@@ -173,7 +173,7 @@
- .It Em K No or Em k
+ .Sh EXAMPLES
+ The command
+@@ -189,7 +193,10 @@
  show a description of the functions of keys
- .It Em L No or Em l
--load settings from $HOME/.aumixrc, falling back to /etc/aumixrc
-+load settings from $HOME/.aumixrc or $HOME/etc/aumixrc, falling back to /etc/aumixrc
- .It Em M No or Em m
- mute or unmute
- .It Em O No or Em o
-@@ -254,7 +254,7 @@
- .Ev HOME
- variable is used.
- .Sh FILES
--Saved settings for the mixer are kept in the /etc/aumixrc and $HOME/.aumixrc files, but can be kept anywhere if specified explicitly.  Color schemes are normally kept in the directory given by DATADIRNAME at compilation time, but are preferentially loaded from the current directory and can be kept anywhere so long as the path to them is specified.  The format of these files is:
-+Saved settings for the mixer are kept in the /etc/aumixrc and $HOME/etc/aumixrc files ($HOME/.aumixrc is now obsolete, but still works), but can be kept anywhere if specified explicitly.  Color schemes are normally kept in the directory given by DATADIRNAME at compilation time, but are preferentially loaded from the current directory and can be kept anywhere so long as the path to them is specified.  The format of these files is:
-       item foreground background
-  
-diff -Nur aumix-1.27.4-orig/po/aumix.pot aumix-1.27.4/po/aumix.pot
---- aumix-1.27.4-orig/po/aumix.pot     Wed Nov 24 13:52:05 1999
-+++ aumix-1.27.4/po/aumix.pot  Sat Nov 27 19:07:58 1999
-@@ -75,7 +75,7 @@
- "other options:\n"
+ .It L or l
+ load settings from
+-.Pa $HOME/.aumixrc ,
++.Pa $CONFIG_DIR/aumixrc ,
++or
++.Pa $HOME/.aumixrc
++(depreciated),
+ falling back to
+ .Pa /etc/aumixrc
+ .It M or m
+@@ -264,8 +271,11 @@
+ Saved settings for the mixer are kept in the
+ .Pa /etc/aumixrc
+ and
+-.Pa $HOME/.aumixrc
+-files, but can be kept anywhere if specified explicitly.
++.Pa $CONFIG_DIR/aumixrc
++files, (
++.Pa $HOME/.aumixrc 
++is now obsolete, though it still works), 
++but can be kept anywhere if specified explicitly.
+ Color schemes are normally kept in the directory given
+ by
+ .Ev DATADIR
+diff -Nru aumix-2.6.1/po/de.po aumix-2.6.1.new/po/de.po
+--- aumix-2.6.1/po/de.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/de.po   Tue Jun 27 23:15:28 2000
+@@ -206,12 +206,12 @@
+ msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-Binary files aumix-1.27.4-orig/po/de.gmo and aumix-1.27.4/po/de.gmo differ
-diff -Nur aumix-1.27.4-orig/po/de.po aumix-1.27.4/po/de.po
---- aumix-1.27.4-orig/po/de.po Sat Nov 13 11:02:53 1999
-+++ aumix-1.27.4/po/de.po      Sat Nov 27 19:00:43 1999
-@@ -81,7 +81,7 @@
- "other options:\n"
- "  d:  adjust a device besides /dev/mixer\n"
- "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
- "  h:  this helpful message\n"
- msgstr ""
-@@ -99,7 +99,7 @@
- "Weitere Optionen:\n"
  "  d:  Anderes Gerät als /dev/mixer benutzen\n"
- "  f:  spezifizieren Sie Datei für Einsparung- und Ladeneinstellungen\n"
--"      (Rückstellungen zum ~ /.aumixrc or /etc/aumixrc)\n"
-+"      (Rückstellungen zum ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
+ "  f:  Spezifizieren Sie die Datei zum Speichern und Laden von Einstellungen\n"
+-"      (Standard sind ~/.aumixrc oder /etc/aumixrc)\n"
++"      (Standard sind $CONFIG_DIR/aumixrc oder /etc/aumixrc) or /etc/aumixrc)\n"
  "  h:  Diese nützlichen Informationen\n"
  
- #: src/common.c:567
-Binary files aumix-1.27.4-orig/po/es.gmo and aumix-1.27.4/po/es.gmo differ
-diff -Nur aumix-1.27.4-orig/po/es.po aumix-1.27.4/po/es.po
---- aumix-1.27.4-orig/po/es.po Sat Nov 13 11:02:53 1999
-+++ aumix-1.27.4/po/es.po      Sat Nov 27 19:01:09 1999
-@@ -81,7 +81,7 @@
- "other options:\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/es.po aumix-2.6.1.new/po/es.po
+--- aumix-2.6.1/po/es.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/es.po   Tue Jun 27 23:14:48 2000
+@@ -206,12 +206,12 @@
+ msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-@@ -99,7 +99,7 @@
- "Otras opciones:\n"
  "  d:  ajustar dispositivos además de /dev/mixer\n"
  "  f:  indicar el fichero para guardar y cargar las preferencias (por\n"
 -"      defecto es ~/.aumixrc o /etc/aumixrc\n"
-+"      defecto es ~/etc/aumixrc, ~/.aumixrc o /etc/aumixrc\n"
- "  C:  indicar el esquema de color\n"
++"      defecto es $CONFIG_DIR/aumixrc o /etc/aumixrc\n"
  "  h:  este mensaje de ayuda\n"
  
-Binary files aumix-1.27.4-orig/po/gl.gmo and aumix-1.27.4/po/gl.gmo differ
-diff -Nur aumix-1.27.4-orig/po/gl.po aumix-1.27.4/po/gl.po
---- aumix-1.27.4-orig/po/gl.po Sat Nov 13 11:02:53 1999
-+++ aumix-1.27.4/po/gl.po      Sat Nov 27 19:07:46 1999
-@@ -89,7 +89,7 @@
"other options:\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/fr.po aumix-2.6.1.new/po/fr.po
+--- aumix-2.6.1/po/fr.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/fr.po   Tue Jun 27 23:15:18 2000
+@@ -206,12 +206,12 @@
msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
+ "  h:  this helpful message\n"
+ msgstr ""
+ "  d:  ajuster un périphérique autre que /dev/mixer\n"
+ "  f:  spécifier le fichier de sauvegarde/chargement des paramètres\n"
+-"      (par défaut il s'agit de ~/.aumixrc ou /etc/aumixrc)\n"
++"      (par défaut il s'agit de $CONFIG_DIR/aumixrc ou /etc/aumixrc)\n"
+ "  h:  ce message d'aide\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/gl.po aumix-2.6.1.new/po/gl.po
+--- aumix-2.6.1/po/gl.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/gl.po   Tue Jun 27 23:14:38 2000
+@@ -214,12 +214,12 @@
+ msgid ""
+ "  d:  adjust a device besides /dev/mixer\n"
+ "  f:  specify file for saving and loading settings (defaults to\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-@@ -107,7 +107,7 @@
- "outras opcións:\n"
  "  d:  axustar outro dispositivo que non sexa /dev/mixer\n"
  "  f:  especificar ficheiro para gardar e cargar parámetros (por omisión é\n"
 -"      ~/.aumixrc ou /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc ou /etc/aumixrc)\n"
- "  C:  especifica-lo esquema de cor\n"
++"      $CONFIG_DIR/aumixrc ou /etc/aumixrc)\n"
  "  h:  amosar esta mensaxe de axuda\n"
  
-Binary files aumix-1.27.4-orig/po/pl.gmo and aumix-1.27.4/po/pl.gmo differ
-diff -Nur aumix-1.27.4-orig/po/pl.po aumix-1.27.4/po/pl.po
---- aumix-1.27.4-orig/po/pl.po Sat Nov 13 11:02:53 1999
-+++ aumix-1.27.4/po/pl.po      Sat Nov 27 19:00:09 1999
-@@ -81,7 +81,7 @@
"other options:\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/pl.po aumix-2.6.1.new/po/pl.po
+--- aumix-2.6.1/po/pl.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/pl.po   Tue Jun 27 23:16:16 2000
+@@ -210,12 +210,12 @@
msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-@@ -99,7 +99,7 @@
- "inne opcje:\n"
  "  d:  dostosowuje urz±dzenie inne ni¿ /dev/mixer\n"
  "  f:  okre¶la plik do zapisywania i ³adowania ustawieñ (domy¶lnie jest to\n"
--"      ~ /.aumixrc lub /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc lub /etc/aumixrc)\n"
- "  C:  okre¶la plik zawieraj±cy schemat u¿ycia kolorów\n"
+-"      ~/.aumixrc lub /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc lub /etc/aumixrc)\n"
  "  h:  ta pomocna informacja\n"
  
-Binary files aumix-1.27.4-orig/po/pt_BR.gmo and aumix-1.27.4/po/pt_BR.gmo differ
-diff -Nur aumix-1.27.4-orig/po/pt_BR.po aumix-1.27.4/po/pt_BR.po
---- aumix-1.27.4-orig/po/pt_BR.po      Sat Nov 13 11:02:54 1999
-+++ aumix-1.27.4/po/pt_BR.po   Sat Nov 27 19:01:53 1999
-@@ -84,7 +84,7 @@
"other options:\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/pt_BR.po aumix-2.6.1.new/po/pt_BR.po
+--- aumix-2.6.1/po/pt_BR.po    Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/pt_BR.po        Tue Jun 27 23:14:27 2000
+@@ -212,12 +212,12 @@
msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-@@ -102,7 +102,7 @@
- "outras opções:\n"
  "  d:  usar outro dispositivo que não o /dev/mixer\n"
  "  f:  SPECIFY FILE FOR SAVING AND LOADING SETTINGS (DEFAULTS TO\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  SPECIFY COLOR SCHEME\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  esta mensagem de ajuda\n"
  
-Binary files aumix-1.27.4-orig/po/ru.gmo and aumix-1.27.4/po/ru.gmo differ
-diff -Nur aumix-1.27.4-orig/po/ru.po aumix-1.27.4/po/ru.po
---- aumix-1.27.4-orig/po/ru.po Sat Nov 13 11:02:54 1999
-+++ aumix-1.27.4/po/ru.po      Sat Nov 27 19:02:27 1999
-@@ -82,7 +82,7 @@
"other options:\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/ru.po aumix-2.6.1.new/po/ru.po
+--- aumix-2.6.1/po/ru.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/ru.po   Tue Jun 27 23:16:07 2000
+@@ -210,12 +210,12 @@
msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-@@ -101,7 +101,7 @@
- "äÒÕÇÉÅ ÏÐÃÉÉ:\n"
- "  d:  ÒÅÇÕÌÉÒÏ×ÁÔØ ÕÓÔÒÏÊÓÔ×Á ËÒÏÍÅ /dev/mixer É /dev/sound/mixer\n"
+ "  d:  ÒÅÇÕÌÉÒÏ×ÁÔØ ÕÓÔÒÏÊÓÔ×Á ËÒÏÍÅ /dev/mixer\n"
  "  f:  ÕËÁÚÁÎÉÅ ÉÍÅÎÉ ÆÁÊÌÁ ÄÌÑ ÈÒÁÎÅÎÉÑ ÕÓÔÁÎÏ×ÏË (ÐÏ ÕÍÏÌÞÁÎÉÀ\n"
--"      ~ /.aumixrc ÉÌÉ /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc ÉÌÉ /etc/aumixrc)\n"
- "  C:  SPECIFY COLOR SCHEME\n"
+-"      ~/.aumixrc ÉÌÉ /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc ÉÌÉ /etc/aumixrc)\n"
  "  h:  ÜÔÁ ÐÏÍÏÝØ\n"
  
-Binary files aumix-1.27.4-orig/po/uk.gmo and aumix-1.27.4/po/uk.gmo differ
-diff -Nur aumix-1.27.4-orig/po/uk.po aumix-1.27.4/po/uk.po
---- aumix-1.27.4-orig/po/uk.po Sat Nov 20 07:59:46 1999
-+++ aumix-1.27.4/po/uk.po      Sat Nov 27 19:05:46 1999
-@@ -82,7 +82,7 @@
"other options:\n"
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/po/uk.po aumix-2.6.1.new/po/uk.po
+--- aumix-2.6.1/po/uk.po       Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/po/uk.po   Tue Jun 27 23:14:13 2000
+@@ -212,12 +212,12 @@
msgid ""
  "  d:  adjust a device besides /dev/mixer\n"
  "  f:  specify file for saving and loading settings (defaults to\n"
--"      ~ /.aumixrc or /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n"
- "  C:  specify color scheme\n"
+-"      ~/.aumixrc or /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc or /etc/aumixrc)\n"
  "  h:  this helpful message\n"
  msgstr ""
-@@ -101,7 +101,7 @@
- "¶ÎÛ¦ ÏÐæ§:\n"
  "  d:  ÒÅÇÕÌÀ×ÁÔÉ ÐÒÉÓÔÒϧ ÏËҦ͠/dev/mixer\n"
  "  f:  ×ËÁÚÁÎÎÑ ¦ÍÅΦ ÆÁÊÌÕ ÄÌÑ ÚÂÅÒ¦ÇÁÎÎÑ Ò¦×Φנ(ÚÁ ÚÁÍÏ×ÞÁÎÎÑÍ\n"
--"      ~ /.aumixrc ÞÉ /etc/aumixrc)\n"
-+"      ~/etc/aumixrc, ~/.aumixrc ÞÉ /etc/aumixrc)\n"
- "  C:  SPECIFY COLOR SCHEME\n"
+-"      ~/.aumixrc ÞÉ /etc/aumixrc)\n"
++"      $CONFIG_DIR/aumixrc ÞÉ /etc/aumixrc)\n"
  "  h:  ÃÑ ÄÏÐÏÍÏÇÁ\n"
  
-diff -Nur aumix-1.27.4-orig/src/common.c aumix-1.27.4/src/common.c
---- aumix-1.27.4-orig/src/common.c     Wed Nov 24 13:51:36 1999
-+++ aumix-1.27.4/src/common.c  Sat Nov 27 18:55:57 1999
-@@ -430,7 +430,8 @@
+ #: src/common.c:689
+diff -Nru aumix-2.6.1/src/Makefile.am aumix-2.6.1.new/src/Makefile.am
+--- aumix-2.6.1/src/Makefile.am        Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/src/Makefile.am    Wed Jun 28 00:12:13 2000
+@@ -2,8 +2,8 @@
+ if CURSES
+ bin_SCRIPTS   = xaumix
+ endif
+-aumix_SOURCES = common.c curses.c dummy.c gpm-xterm.c gtk.c interactive.c \
+-              mouse.c common.h curses.h gpm-xterm.h gtk.h interactive.h  \
++aumix_SOURCES = userdir.c common.c curses.c dummy.c gpm-xterm.c gtk.c interactive.c \
++              mouse.c userdir.h common.h curses.h gpm-xterm.h gtk.h interactive.h  \
+               mouse.h play.xpm record.xpm
+ localedir     = $(datadir)/locale
+ INCLUDES      = -I../intl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
+diff -Nru aumix-2.6.1/src/Makefile.in aumix-2.6.1.new/src/Makefile.in
+--- aumix-2.6.1/src/Makefile.in        Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/src/Makefile.in    Tue Jun 27 23:11:28 2000
+@@ -100,7 +100,7 @@
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+-aumix_OBJECTS =  common.o curses.o dummy.o gpm-xterm.o gtk.o \
++aumix_OBJECTS =  userdir.o common.o curses.o dummy.o gpm-xterm.o gtk.o \
+ interactive.o mouse.o
+ aumix_LDADD = $(LDADD)
+ aumix_DEPENDENCIES = 
+diff -Nru aumix-2.6.1/src/common.c aumix-2.6.1.new/src/common.c
+--- aumix-2.6.1/src/common.c   Tue Jun 27 23:11:47 2000
++++ aumix-2.6.1.new/src/common.c       Wed Jun 28 00:10:45 2000
+@@ -26,6 +26,7 @@
+ #include "gtk.h"
+ #endif                                /* HAVE_GTK */
+ #include "interactive.h"
++#include "userdir.h"
+ FILE           *OpenDefaultFile(char *mode);
+ FILE           *setfile;
+@@ -556,7 +557,8 @@
  {
  /* Open the settings file for reading or writing.
  
 -   Try first ${HOME}/.AUMIXRC, then AUMIXRC_PATH/AUMIXRC;
-+   Try first ${HOME}/.AUMIXRC, ${HOME}/etc/AUMIXRC,
-+   then AUMIXRC_PATH/AUMIXRC;
++   Try first ${HOME}/.AUMIXRC, then then ${HOME}/.AUMIXRC 
++   and eventualy AUMIXRC_PATH/AUMIXRC;
     become an error generator if neither can be opened.
  
     Input:
-@@ -447,8 +448,12 @@
+@@ -571,6 +573,8 @@
+       FILE           *setfile;
+       char           *home;
        char            filename[FILENAME_MAX];
++      struct cfv      etcfile;
++
        if (save_filename == NULL) {
                home = getenv("HOME");
--              sprintf(filename, "%s/.%s", home, AUMIXRC);
--              setfile = fopen(filename, mode);
-+              sprintf(filename, "%s/etc/%s", home, AUMIXRC);
-+                setfile = fopen(filename, mode);
-+                if (setfile == NULL) {
-+                        sprintf(filename, "%s/.%s", home, AUMIXRC);
-+                        setfile = fopen(filename, mode);
-+                }
+               if ((strlen(home) + strlen(AUMIXRC)) < PATH_MAX) {
+@@ -585,6 +589,19 @@
+               }
                if (setfile == NULL) {
-                       sprintf(filename, "%s/%s", AUMIXRC_PATH, AUMIXRC);
-                       setfile = fopen(filename, mode);
-@@ -549,7 +554,7 @@
- other options:\n\
-   d:  adjust a device besides /dev/mixer\n\
-   f:  specify file for saving and loading settings (defaults to\n\
--      ~ /.aumixrc or /etc/aumixrc)\n\
-+      ~/etc/aumixrc, ~/.aumixrc or /etc/aumixrc)\n\
-   C:  specify color scheme\n\
-   h:  this helpful message\n"));
- #ifdef HAVE_LIBNCURSES
+                       return NULL;
++              }
++              etcfile.variable = "CONFIG_DIR";
++              etcfile.home_dir = NULL;
++              etcfile.home_scd = NULL;
++              etcfile.subname  = AUMIXRC;
++              etcfile.prefix   = ".";
++              etcfile.suffix   = "";
++              etcfile.mode     = M_REGULAR_FILE;
++
++              setfile = fopencfv(&etcfile, mode);
++              if (setfile == NULL) {
++                      sprintf(filename, "%s/%s", AUMIXRC_PATH, AUMIXRC);
++                      setfile = fopen(filename, mode);
+               }
+       } else
+               setfile = fopen(save_filename, mode);
+diff -Nru aumix-2.6.1/src/userdir.c aumix-2.6.1.new/src/userdir.c
+--- aumix-2.6.1/src/userdir.c  Thu Jan  1 01:00:00 1970
++++ aumix-2.6.1.new/src/userdir.c      Tue Jun 27 23:11:28 2000
+@@ -0,0 +1,167 @@
++// $Id$
++#include "userdir.h"
++    
++static char *nonulhome = "";
++
++/******************************************************************************/
++    
++int getusercfv (char *variable, 
++                  char *home_dir, 
++                  char *user_dir, 
++                  size_t stringsize)
++{
++      struct stat st;
++      char *d;
++      
++      bzero (user_dir, stringsize);
++      if (variable == NULL || *variable == '\0') return (-1);
++      if (home_dir == NULL) home_dir = nonulhome;
++      d = getenv (variable);  
++      if (d == NULL || *d == '\0') return (-1);
++      if (*d == '/') 
++          {
++          strncpy (user_dir, d, stringsize-1);
++          }
++      else
++          {
++          snprintf (user_dir, stringsize-1, "%s/%s", home_dir, d);
++          }
++          
++      if (stat(user_dir,&st) != -1 && S_ISDIR(st.st_mode)) 
++          {
++          return (0);
++          }
++      
++      return (-1);
++}
++
++/******************************************************************************/
++
++int detectcfv(struct cfv *CFV) {
++      if (CFV->subname == NULL) CFV->subname = nonulhome;
++      if (CFV->home_dir == NULL) CFV->home_dir = getenv ("HOME");
++      if (CFV->home_dir == NULL) CFV->home_dir = CFV->home_scd;
++      if (CFV->home_dir == NULL) return (-1);
++      return 0;
++}
++
++/******************************************************************************/
++
++int preparemain(struct cfv *CFV) {
++      char *p;
++      struct stat st;
++      if ((p = strrchr(CFV->result, '/')) && *(p+1) == '\0') 
++          p = '\0';
++      snprintf ((rindex(CFV->result,'\0')), MAXPATHLEN-1, "/%s", 
++                CFV->subname);
++      if (stat( CFV->result,&st) != -1 
++           && CFV->mode ? 
++              S_ISDIR(st.st_mode) : 
++              S_ISREG(st.st_mode)) /* have file or dir */
++          return (1);
++      return 0;
++}
++
++/******************************************************************************/
++
++int preparehome(struct cfv *CFV) {
++      struct stat st;
++      if (CFV->home_dir == NULL || *(CFV->home_dir) == '\0') return (-1);
++      if (CFV->prefix == NULL && CFV->suffix == NULL) return (-1);
++      snprintf (CFV->result, MAXPATHLEN-1, "%s/%s%s%s", 
++                     CFV->home_dir, 
++                     CFV->prefix? CFV->prefix:"",
++                     CFV->subname,
++                     CFV->suffix? CFV->suffix:"");
++      if (stat(CFV->result,&st) != -1 
++               && CFV->mode ? 
++                  S_ISDIR(st.st_mode) : 
++                  S_ISREG(st.st_mode)) /* have file or dir */
++              return (2);
++      return (-1);
++}
++
++/******************************************************************************/
++
++int usercfv (struct cfv *CFV) {
++      int gr;
++      gr = detectcfv(CFV);
++      if (gr) return gr;
++      /* get environment variable */
++      gr = getusercfv (CFV->variable, 
++                      CFV->home_dir, 
++                      CFV->result,
++                      MAXPATHLEN);
++      if (gr != -1)   /* have main directory */
++          {
++              gr = preparemain(CFV);
++              if (gr) return gr;
++          }
++      /* don't have main directory or a proper variable set */
++      gr = preparehome(CFV);
++      return gr;
++}
++      
++/******************************************************************************/
++
++/* If directory or file doesn't exist returns the best one wich may be created */
++int notnullusercfv (struct cfv *CFV) {
++      int gr;
++      if ((usercfv(CFV)) == -1) {
++          gr = detectcfv(CFV);
++          if (gr) return gr;  /* remember, it works for errors! */
++          /* get the environment variable */
++          gr = getusercfv (CFV->variable, 
++                          CFV->home_dir, 
++                          CFV->result,
++                          MAXPATHLEN);
++          if (gr != -1)       /* have main directory */
++              {
++                  gr = preparemain(CFV);
++                  return 0;
++              }
++          /* don't have main directory or a proper variable set */
++          gr = preparehome(CFV);
++          return 0;
++      }
++      return 0;       
++}
++    
++/******************************************************************************/
++
++FILE *maynullfopencfv (struct cfv *CFV, const char *mode)
++    {
++    FILE *cfvfile = NULL;
++    
++    CFV->mode = M_REGULAR_FILE;
++    if ((usercfv (CFV)) == -1) return (NULL); 
++    cfvfile = fopen (CFV->result, mode);
++    return (cfvfile);
++    }
++/******************************************************************************/
++
++FILE *notnullfopencfv (struct cfv *CFV, const char *mode)
++    {
++    FILE *cfvfile = NULL;
++    
++    CFV->mode = M_REGULAR_FILE;
++    if ((notnullusercfv (CFV)) == -1) return (NULL);  
++    cfvfile = fopen (CFV->result, mode);
++    return (cfvfile);
++    }
++
++/******************************************************************************/
++    
++FILE *fopencfv (struct cfv *CFV, const char *mode)
++    {
++    FILE *cfvfile = NULL;
++
++    if (cfvfile == NULL && (strpbrk(mode, "wa")) != NULL) /* create in best location */
++      cfvfile = notnullfopencfv (CFV, mode);
++    else 
++      cfvfile = maynullfopencfv (CFV, mode);
++    
++    return (cfvfile);
++    }
++
++/******************************************************************************/
+\ No newline at end of file
+diff -Nru aumix-2.6.1/src/userdir.h aumix-2.6.1.new/src/userdir.h
+--- aumix-2.6.1/src/userdir.h  Thu Jan  1 01:00:00 1970
++++ aumix-2.6.1.new/src/userdir.h      Tue Jun 27 23:11:28 2000
+@@ -0,0 +1,56 @@
++// $Id$
++#ifndef USERDIR__H
++#define USERDIR__H
++
++#include <unistd.h>
++#include <string.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <sys/param.h>
++
++#define       M_REGULAR_FILE  0
++#define       M_DIRECTORY     1
++
++struct cfv {
++      char result[MAXPATHLEN];        /* our result                   */
++      char *variable; /* name of an environment variable              */
++      char *home_dir; /* home directory or NULL for autodetect        */
++      char *home_scd; /* directory if home_dir==NULL and no result    */
++      char *subname;  /* core name of a file/directory                */
++      char *prefix;   /* prefix when using directly home_dir          */
++      char *suffix;   /* suffix when using directly home_dir          */
++      int mode;       /* expected: M_REGULAR_FILE or M_DIRECTORY      */
++      };
++
++/* reads environment variable. if the path isn't absolute will add $HOME/
++ * at the beginning
++ * return: 0 - directory exists
++ *         -1 - directory doesn't exist
++ */
++int getusercfv (char *variable, 
++                  char *home_dir, 
++                  char *user_dir,
++                  size_t stringsize);
++/* reads the $HOME variable */
++int detectcfv(struct cfv *CFV);
++
++/* looks for the config/data file/dir.
++ * result: -1 - error - cannot find file/dir 
++ *         0 - ok
++ *         CFV.result set
++ */
++int usercfv (struct cfv *CFV);
++/* looks for the config/data file/dir.
++ * result: -1 - error - cannot read $HOME
++ *          0 - ok - if the CFV.result exists, read it. If not create it.
++ *              CFV.result set
++ */              
++int notnullusercfv (struct cfv *CFV);
++
++FILE *fopencfv (struct cfv *CFV, const char *mode);
++FILE *maynullfopencfv (struct cfv *CFV, const char *mode);
++FILE *notnullfopencfv (struct cfv *CFV, const char *mode);
++
++#endif
This page took 0.048421 seconds and 4 git commands to generate.