freebsd-ports/comms/kb/files/patch-support.c
Diane Bruce eab2edfb13 The KB contest logging computer program runs on the Linux operating system
with the Gnome desktop. The program is under development, and currently
supports the CQ WW, CQ WPX, and ARRL DX contests, plus Field Day.
Features include on-the-fly dupe checking, CW and voice message keying,
super check partial, packet (Telnet and rf nodes), networking, and
radio control (currently for the FT-1000 only). The program is designed
to be used by U.S. stations, with some support for Canadian stations.
New features and contests are being added regularly, and I will consider
adding support for DX stations if there is sufficient demand.

(The port version has bug fixes and some modifications for Canadian stations.
- db)

Submitted by:	self
2007-12-21 16:55:15 +00:00

86 lines
2.1 KiB
C

--- support.c.orig 2007-07-18 14:21:10.000000000 -0400
+++ support.c 2007-12-20 18:48:00.000000000 -0500
@@ -1,3 +1,6 @@
+#ifdef BSDSOUND
+#include BSDSOUND
+#endif
#include <termios.h>
#include <libgnome/libgnome.h>
#include <sys/utsname.h>
@@ -20,7 +23,6 @@
static void concat(gchar *s1, const gchar *s2, gint is2, gint js2,
gint nullout_s1);
static gint kb_index(const gchar *s1, const gchar *s2);
-static void add_eol_chars(gchar *line_out);
static void left_zero_pad(gchar *s1, gint ss1);
static void left_blank_pad(gchar *s1, gint ss1);
static void left_blank_unpad(gchar *s1);
@@ -144,10 +146,22 @@
layout);
}
+#ifdef BSDSOUND
+#include "bsd_bells.c"
+#endif
static void play_bells(int isound)
{
- if(!strcmp(set_screen_choices[3], "<YES>"))
- ioctl(fd_bells, _IO(KB_BELLS_IOCTL_BASE, isound));
+ if(fd_bells<0)
+ return;
+ if(strcmp(set_screen_choices[3], "<YES>") !=0)
+ return;
+#ifdef BSD
+#ifdef BSDSOUND
+ bsd_play_bells(isound);
+#endif
+#else
+ ioctl(fd_bells, _IO(KB_BELLS_IOCTL_BASE, isound));
+#endif
}
static void get_kb_time(void)
@@ -189,25 +203,8 @@
static void fill_kb_dt(void)
{
- gchar *t1;
-
- t1 = asctime(&kb_time);
- kb_dt.date[0] = month_num[2*kb_time.tm_mon];
- kb_dt.date[1] = month_num[2*kb_time.tm_mon+1];
- kb_dt.date[2] = *(t1+8);
- if(kb_dt.date[2]==' ')
- kb_dt.date[2] = '0';
- kb_dt.date[3] = *(t1+9);
- kb_dt.date[4] = *(t1+22);
- kb_dt.date[5] = *(t1+23);
- kb_dt.date[6] = '\0';
- kb_dt.time[0] = *(t1+11);
- kb_dt.time[1] = *(t1+12);
- kb_dt.time[2] = *(t1+14);
- kb_dt.time[3] = *(t1+15);
- kb_dt.time[4] = *(t1+17);
- kb_dt.time[5] = *(t1+18);
- kb_dt.time[6] = '\0';
+ strftime(kb_dt.date, sizeof(kb_dt.date), "%m%d%g", &kb_time);
+ strftime(kb_dt.time, sizeof(kb_dt.time), "%H%M%S", &kb_time);
}
static gint idelta_time(const gchar *day1, const gchar *day2,
@@ -284,15 +281,6 @@
return -1;
}
-static void add_eol_chars(gchar *line_out)
-{
- gint lcil;
-
- lcil = strlen(line_out);
- line_out[lcil] = '\r';
- line_out[lcil+1] = '\n';
- line_out[lcil+2] = '\0';
-}
static void left_zero_pad(gchar *s1, gint ss1)
{