Upstream version 3.01

pull/2/head
Stelios Bounanos 2008-08-19 04:03:58 +01:00
rodzic 3f7b2d6c54
commit 2c52ee8645
4 zmienionych plików z 55 dodań i 55 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ dnl major and minor must be integers; patch may
dnl contain other characters or be empty dnl contain other characters or be empty
m4_define(FLDIGI_MAJOR, [3]) m4_define(FLDIGI_MAJOR, [3])
m4_define(FLDIGI_MINOR, [0]) m4_define(FLDIGI_MINOR, [0])
m4_define(FLDIGI_PATCH, []) m4_define(FLDIGI_PATCH, [1])
AC_INIT([fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[FLDIGI_PATCH], [w1hkj AT w1hkj DOT com]) AC_INIT([fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[FLDIGI_PATCH], [w1hkj AT w1hkj DOT com])

Wyświetl plik

@ -88,40 +88,32 @@ const char *ADIFHEADER =
<EOH>\n\n"; <EOH>\n\n";
int writeadif () { void writeadif () {
// open the adif file // open the adif file
#ifndef __CYGWIN__
string sfname = HomeDir;
sfname.append("fldigi.adif");
#else
string sfname = "C:/FL_LOGBOOK/log.adif";
#endif
FILE *adiFile; FILE *adiFile;
#ifndef __CYGWIN__ // Append to fldigi.adif on all platforms
adiFile = fopen (sfname.c_str(), "r"); string sfname = HomeDir;
if (!adiFile) { sfname.append("fldigi.adif");
adiFile = fopen(sfname.c_str(),"w");
if (!adiFile)
return 1;
fprintf (adiFile, ADIFHEADER,
strlen(ADIF_VERS), ADIF_VERS,
strlen(PACKAGE_NAME), PACKAGE_NAME,
strlen(PACKAGE_VERSION), PACKAGE_VERSION);
fclose(adiFile);
} else
fclose(adiFile);
#endif
adiFile = fopen (sfname.c_str(), "a"); adiFile = fopen (sfname.c_str(), "a");
if (!adiFile) if (adiFile) {
return 1;
// write the current record to the file // write the current record to the file
adif.append("<EOR>\n"); adif.append("<EOR>\n");
fprintf(adiFile,"%s", adif.c_str()); fprintf(adiFile,"%s", adif.c_str());
// printf("%s", adif.c_str());
// fflush(adiFile);
fclose (adiFile); fclose (adiFile);
return 0; }
// Append to FL_LOGBOOK adif file on Windows if and only if C:\FL_LOGBOOK exists
#ifdef __CYGWIN__
sfname = "C:/FL_LOGBOOK/log.adif";
adiFile = fopen (sfname.c_str(), "a");
if (adiFile) {
// write the current record to the file
adif.append("<EOR>\n");
fprintf(adiFile,"%s", adif.c_str());
fclose (adiFile);
}
#endif
} }
void putadif(int num, const char *s) void putadif(int num, const char *s)

Wyświetl plik

@ -224,7 +224,7 @@ configuration progdefaults = {
"", // string strCommPorts "", // string strCommPorts
9876, // int rx_msgid 9876, // int rx_msgid
6789, // int tx_msgid 6789, // int tx_msgid
"localhost", // string arq_address "127.0.0.1", // string arq_address
"3122", // string arq_port "3122", // string arq_port
// PSK viewer parameters // PSK viewer parameters
true, // bool VIEWERmarquee true, // bool VIEWERmarquee
@ -234,7 +234,7 @@ configuration progdefaults = {
10.0, // double VIEWERsquelch 10.0, // double VIEWERsquelch
15, // int VIEWERtimeout 15, // int VIEWERtimeout
false, // bool xmlrpc_server false, // bool xmlrpc_server
"localhost", // string xmlrpc_address "127.0.0.1", // string xmlrpc_address
"7362", // string xmlrpc_port "7362", // string xmlrpc_port
}; };
@ -1641,39 +1641,42 @@ FL_UNLOCK();
void configuration::testCommPorts() void configuration::testCommPorts()
{ {
char COM[] = "COMx";
char ttyS[] = "/dev/ttySx";
char ttyUSB[] = "/dev/ttyUSBx";
char devttyUSB[] = "/dev/usb/ttyUSBx";
int fd; int fd;
strCommPorts = "Ports:"; strCommPorts = "Ports:";
char COM[7] = "COMxxx";
for (int i = 0; i < 4; i++) { char sztty[20] = "/dev/usb/ttyUSBxxx";
ttyS[9] = '0' + i; #ifdef __CYGWIN__
COM[3] = '1' + i; for (int i = 0; i < 255; i++) {
if ((fd = open( ttyS, O_RDWR | O_NOCTTY | O_NDELAY)) < 0) #else
break; for (int i = 0; i < 8; i++) {
#endif
snprintf(sztty, sizeof(sztty), "/dev/ttyS%-d", i);
snprintf(COM, sizeof(COM), "COM%-d", i+1);
if ((fd = open( sztty, O_RDWR | O_NOCTTY | O_NDELAY)) < 0)
continue;
strCommPorts += '\n'; strCommPorts += '\n';
strCommPorts.append(ttyS); #ifdef __CYGWIN__
strCommPorts.append(" or ");
strCommPorts.append(COM); strCommPorts.append(COM);
#else
strCommPorts.append(sztty);
#endif
close(fd); close(fd);
} }
for (int i = 0; i < 4; i++) { for (int i = 0; i < 8; i++) {
ttyUSB[11] = '0' + i; snprintf(sztty, sizeof(sztty), "/dev/ttyUSB%-d", i);
if ((fd = open( ttyUSB, O_RDWR | O_NOCTTY | O_NDELAY)) < 0) if ((fd = open( sztty, O_RDWR | O_NOCTTY | O_NDELAY)) < 0)
break; continue;
strCommPorts += '\n'; strCommPorts += '\n';
strCommPorts.append(ttyUSB); strCommPorts.append(sztty);
close(fd); close(fd);
} }
for (int i = 0; i < 4; i++) { for (int i = 0; i < 8; i++) {
devttyUSB[15] = '0' + i; snprintf(sztty, sizeof(sztty), "/dev/usb/ttyUSB%-d", i);
if ((fd = open( devttyUSB, O_RDWR | O_NOCTTY | O_NDELAY)) < 0) if ((fd = open( sztty, O_RDWR | O_NOCTTY | O_NDELAY)) < 0)
break; continue;
strCommPorts += '\n'; strCommPorts += '\n';
strCommPorts.append(devttyUSB); strCommPorts.append(sztty);
close(fd); close(fd);
} }
} }

Wyświetl plik

@ -45,6 +45,11 @@
#include "socket.h" #include "socket.h"
#if HAVE_GETADDRINFO && !defined(AI_NUMERICSERV)
# define AI_NUMERICSERV 0
#endif
using namespace std; using namespace std;
// //
@ -617,7 +622,7 @@ size_t Socket::send(const void* buf, size_t len)
if (!wait(1)) if (!wait(1))
return 0; return 0;
ssize_t r = ::send(sockfd, buf, len, MSG_NOSIGNAL); ssize_t r = ::send(sockfd, buf, len, 0);
if (r == 0) if (r == 0)
shutdown(sockfd, SHUT_WR); shutdown(sockfd, SHUT_WR);
else if (r == -1) { else if (r == -1) {