Hi,

Couple of small diffs for tlf 0.9.30

patch-configure.in      fixes tlf configure detection of hamlib
                        and allows user to specify lib/include dirs for it
patch-src_audio.c       just simplifies some of the string generation here

- 73 Diane VA3DB

--
- [EMAIL PROTECTED] http://www.db.net/~db
--- configure.in.orig   Wed Apr  5 03:22:01 2006
+++ configure.in        Tue Nov 21 14:23:37 2006
@@ -8,6 +8,10 @@
 AC_PROG_INSTALL
 AC_PROG_AWK

+CPPFLAGS="-I${includedir}"
+LDFLAGS="-L${libdir}"
+LIBS="-L${libdir} ${LIBS}"
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h unistd.h])
@@ -22,6 +26,7 @@
 #AC_CHECK_LIB(hamlib,main,,AC_MSG_ERROR([Hamradio control libraries (hamlib) 
not found! ABORTED!]))
 #AC_CHECK_HEADERS(hamlib/rig.h hamlib/riglist.h,,AC_MSG_ERROR([hamlib 
header(s) not found! ABORTED]))

+
 dnl Check if we want to link the Hamradio control libraries (hamlib)
 AC_ARG_ENABLE([hamlib],
 [ ?--enable-hamlib ? Add support for hamradio control libraries],
@@ -33,7 +38,7 @@
 [wanthamlib=false])

 if test "x${wanthamlib}" != "xfalse"; then
-       AC_CHECK_LIB(hamlib,main,,AC_MSG_ERROR([Hamradio control libraries not 
found...]))
+       AC_CHECK_LIB(hamlib,rig_init,,AC_MSG_ERROR([Hamradio control libraries 
not found...]))
        AC_CHECK_HEADERS(hamlib/rig.h,,AC_MSG_ERROR([Hamlib headers not 
found...]))
        AC_DEFINE([WANT_HAMLIB], 1, [Want Hamlib])
        echo "enabling hamlib support"
--- src/audio.c.orig	Wed Apr  5 03:16:50 2006
+++ src/audio.c	Mon May  8 14:31:45 2006
@@ -30,6 +30,8 @@
 #include "onechar.h"

 extern char sc_device[];
+char soundlog_dir[FILENAME_MAX];
+char *home;

 int afd;

@@ -668,10 +670,8 @@
 				mvprintw(15,20, "recording %s", ph_message[0]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");			// (W9WI)
- 				strcat(commands, ph_message[0]);
+				snprintf(commands,sizeof(commands), "rec -w -w 8000 -d %s %s",
+					sc_device, ph_message[0]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -680,21 +680,16 @@
 				mvprintw(16,20, "");
 				refresh();

-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
-				strcat(commands, " ");			// (W9WI)
-				strcat(commands, ph_message[1]);
-				system (commands);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[1]);
 				runnit = 0;
 				break;
 			case 131 :
 				mvprintw(15,20, "recording %s", ph_message[2]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");			// (W9WI)
-				strcat(commands, ph_message[2]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[2]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -702,10 +697,8 @@
 				mvprintw(15,20, "recording %s", ph_message[3]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
-				strcat(commands, " ");			// (W9WI)
-				strcat(commands, ph_message[3]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[3]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -713,10 +706,8 @@
 				mvprintw(15,20, "recording %s", ph_message[4]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[4]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[4]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -724,10 +715,8 @@
 				mvprintw(15,20, "recording %s", ph_message[5]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[5]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[5]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -735,10 +724,8 @@
 				mvprintw(15,20, "recording %s", ph_message[6]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[6]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[6]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -746,10 +733,8 @@
 				mvprintw(15,20, "recording %s", ph_message[7]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[7]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[7]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -757,10 +742,8 @@
 				mvprintw(15,20, "recording %s", ph_message[8]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[8]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[8]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -768,10 +751,8 @@
 				mvprintw(15,20, "recording %s", ph_message[9]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[9]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[9]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -779,10 +760,8 @@
 				mvprintw(15,20, "recording %s", ph_message[10]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[10]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[10]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -790,10 +769,8 @@
 				mvprintw(15,20, "recording %s", ph_message[11]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[11]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[11]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -802,10 +779,8 @@
 				mvprintw(15,20, "recording %s", ph_message[12]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[12]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[12]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -814,10 +789,8 @@
 				mvprintw(15,20, "recording %s", ph_message[13]);
 				mvprintw(16,20, "");
 				refresh();
-				strcpy(commands,"rec -w -r 8000 -d ");
-				strcat(commands, sc_device);
- 				strcat(commands, " ");				// (W9WI)
-				strcat(commands, ph_message[13]);
+				snprintf(commands,sizeof(commands),"rec -w -r 8000 -d %s %s",
+					sc_device, ph_message[13]);
 				system (commands);
 				runnit = 0;
 				break;
@@ -840,7 +813,13 @@
 				runnit = 0;
 				break;
 			case '3' :
- 				sounddir = opendir("$HOME/tlf/soundlogs/");		// (W9WI)
+				if ((home = getenv("HOME")) != NULL) {
+				 	snprintf(soundlog_dir,sizeof(soundlog_dir),
+						"%s/tlf/soundlogs/", home);
+	 				sounddir = opendir(soundlog_dir);
+				} else
+					sounddir = NULL;
+

 				if (sounddir == NULL) break;

_______________________________________________
Tlf-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tlf-devel

Reply via email to