Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/comms/echolinux/files/patch-echolinux_vox.c
18157 views
1
--- echolinux/vox.c.orig 2006-03-03 23:43:05 UTC
2
+++ echolinux/vox.c
3
@@ -14,7 +14,7 @@ $Log$
4
#include <stdlib.h>
5
#include <sys/ioctl.h>
6
#include <sys/stat.h>
7
-#include <linux/soundcard.h>
8
+#include <sys/soundcard.h>
9
#include <sys/types.h>
10
#include <sys/stat.h>
11
#include <sys/ioctl.h>
12
@@ -70,7 +70,7 @@ int mode;
13
14
/**************** read info file ***********/
15
16
-int sendInfoFile(void){
17
+static int sendInfoFile(void){
18
int count = 0, result;
19
char *temp, line[80];
20
21
@@ -79,7 +79,7 @@ int sendInfoFile(void){
22
23
infoFile = open(line, O_RDONLY);
24
if(infoFile < 0){
25
- infoFile = open("/etc/echolinux/info.txt", O_RDONLY);
26
+ infoFile = open("%%LOCALBASE%%/etc/echolinux/info.txt", O_RDONLY);
27
if(infoFile < 0){
28
perror("Openning info file.");
29
return(FALSE);
30
@@ -129,12 +129,12 @@ int sendInfoFile(void){
31
(struct sockaddr *) &destAddr,
32
sizeof destAddr);
33
34
-
35
+ return(TRUE);
36
}
37
38
/****************************************/
39
40
-int soundInput(void){
41
+static void soundInput(void){
42
43
// int arg, status;
44
int arg, status;
45
@@ -242,7 +242,7 @@ void sendNDATA(char *ndata){
46
47
/**************** Handle data from stdin ***********/
48
49
-int fromControl(void){
50
+static void fromControl(void){
51
int i;
52
char c;
53
char line[80], fileName[80], globalFileName[80];
54
@@ -260,7 +260,7 @@ int fromControl(void){
55
strcpy(fileName, echoLinuxDefaults);
56
line[strlen(line) - 1] = 0x00;
57
strcat(fileName, &line[2]);
58
- strcpy(globalFileName, "/etc/echolinux/");
59
+ strcpy(globalFileName, "%%LOCALBASE%%/etc/echolinux/");
60
strcat(globalFileName, &line[2]);
61
// strcat(fileName, "connect.wav");
62
if(((audioEffect = open(fileName, O_RDONLY)) != -1) || (audioEffect = open(globalFileName, O_RDONLY)) != -1){
63
@@ -305,14 +305,14 @@ int fromControl(void){
64
65
/******************* Audio sending routine **************/
66
67
-int sendAudio(void){
68
+static void sendAudio(void){
69
70
static short seq = 1;
71
short count = 0, total = 0;
72
short i, result, *pTemp, j;
73
char c, *temp, line[20];
74
fd_set readfds, testfds;
75
- int len_inet;
76
+ socklen_t len_inet;
77
// struct timeval timeout;
78
time_t startTime, timeNow;
79
long average;
80
@@ -399,7 +399,7 @@ int sendAudio(void){
81
}
82
}
83
if(sendStrength){
84
- sprintf(line, "%C %d", STRENGTH, average);
85
+ sprintf(line, "%C %ld", STRENGTH, average);
86
puts(line);
87
}
88
89
@@ -477,11 +477,11 @@ int sendAudio(void){
90
91
/************ Audio Receiving Function *******/
92
93
-int recvAudio(void){
94
+static void recvAudio(void){
95
struct gsmVoice_t *voicePacket;
96
fd_set readfds, testfds;
97
short i, result, j, *pTemp;
98
- int len_inet;
99
+ socklen_t len_inet;
100
audio_buf_info info;
101
unsigned char *temp;
102
char c, line[20];
103
@@ -559,7 +559,7 @@ int recvAudio(void){
104
}
105
average = average / 320;
106
if(sendStrength){
107
- sprintf(line, "%C %d", STRENGTH, average);
108
+ sprintf(line, "%C %ld", STRENGTH, average);
109
puts(line);
110
}
111
}
112
113