- Update to 8.04

- Remove patch files accepted by vendor
This commit is contained in:
Diane Bruce 2008-05-28 14:32:58 +00:00
parent cd668670cd
commit e1cfd5b58c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=213813
19 changed files with 280 additions and 2019 deletions

View file

@ -5,8 +5,7 @@
# $FreeBSD$
PORTNAME= kb
PORTVERSION= 7.09
PORTREVISION= 1
PORTVERSION= 8.04
CATEGORIES= comms hamradio
MASTER_SITES= http://www.db.net/downloads/ \
${MASTER_SITE_LOCAL}
@ -16,34 +15,50 @@ DISTFILES= kb_src-${PORTVERSION}.tar.gz kb_inst-${PORTVERSION}.tar.gz
MAINTAINER= db@FreeBSD.org
COMMENT= Amateur Radio contest logger
USE_XLIB= yes
USE_GNOME= libgnome gtk20 libbonobo
NO_WRKSUBDIR= yes
PKGMESSAGE= ${FILESDIR}/pkg_message
MAN1= kb.1
DESKTOP_ENTRIES="KB" \
"Kick Butt logger" \
"${PREFIX}/share/pixmaps/kb/icons/kb-icon.png" \
"kb" \
"" \
true
pre-configure:
@${CP} ${FILESDIR}/Makefile ${WRKSRC}
.if exists(/usr/include/dev/speaker/speaker.h)
@${REINPLACE_CMD} -e 's|-UBSDSOUND|-DBSDSOUND="<dev/speaker/speaker.h>"|' ${WRKSRC}/Makefile
.elif exists(/usr/include/machine/speaker.h)
@${REINPLACE_CMD} -e 's|-UBSDSOUND|-DBSDSOUND="<machine/speaker.h>"|' ${WRKSRC}/Makefile
.if !exists(/usr/include/dev/speaker/speaker.h)
@${REINPLACE_CMD} -e 's|-DSPKR|-DOLDSPKR|' ${WRKSRC}/Makefile
.endif
@${RM} ${WRKSRC}/kb_server
@${RM} ${WRKSRC}/kb
@${CP} ${FILESDIR}/bsd_bells.c ${WRKSRC}
do-install:
@${INSTALL_SCRIPT} ${FILESDIR}/kbserver ${LOCALBASE}/etc/rc.d
${INSTALL_SCRIPT} ${FILESDIR}/kb ${LOCALBASE}/bin
${INSTALL_PROGRAM} ${WRKSRC}/kb ${LOCALBASE}/bin/kb_bin
${INSTALL_PROGRAM} ${WRKSRC}/kb_server ${LOCALBASE}/sbin
${INSTALL_PROGRAM} ${WRKSRC}/kb_server ${LOCALBASE}/bin
${INSTALL_DATA} ${FILESDIR}/kb.1 ${MANPREFIX}/man/man1
${MKDIR} ${DATADIR}
.for f in ${WRKSRC}/COUNTY.CQP ${WRKSRC}/DEFAULT.INI \
${WRKSRC}/CALL_LIB.LST ${WRKSRC}/CALL_SS.LST \
${WRKSRC}/CALL_FD.LST ${WRKSRC}/HELP.LST \
${WRKSRC}/COUNTRY.LST ${WRKSRC}/HELPFD.LST \
${WRKSRC}/SECTION.LST ${WRKSRC}/STATE.LST
.for f in COUNTY.CQP DEFAULT.INI CALL_LIB.LST CALL_SS.LST \
CALL_FD.LST HELP.LST COUNTRY.LST HELPFD.LST \
SECTION.LST STATE.LST
${INSTALL_DATA} ${WRKSRC}/$f ${DATADIR}
.endfor
@${CAT} ${PKGMESSAGE}
${MKDIR} ${PREFIX}/share/pixmaps/kb/icons
${INSTALL_DATA} ${FILESDIR}/kb-icon.png \
${PREFIX}/share/pixmaps/kb/icons/kb-icon.png
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${FILESDIR}/README_TIPS ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/kb_bsd/README_BSD ${DOCSDIR}
.for f in LICENSE README README_KINKS README_SRC
${INSTALL_DATA} ${WRKSRC}/$f ${DOCSDIR}
.endfor
.endif
@${ECHO} ""
@${ECHO} "Docs are in ${DOCSDIR} pay particular attention to README_BSD"
@${ECHO} ""
.include <bsd.port.mk>

View file

@ -1,6 +1,6 @@
MD5 (kb_src-7.09.tar.gz) = 2ac7a11e18c245278800f00b9bf3d300
SHA256 (kb_src-7.09.tar.gz) = 7b6a7a8c8fbe01fbe1086f5b783414b056bf1d5db5945d086a3e7e6de1bfa6f8
SIZE (kb_src-7.09.tar.gz) = 93896
MD5 (kb_inst-7.09.tar.gz) = 1984eb53d5ba56b43c188f07de9ae3dd
SHA256 (kb_inst-7.09.tar.gz) = 0890702b3ee182d056e9a33055aa4519fded84b15a67556279173865c1eb10d2
SIZE (kb_inst-7.09.tar.gz) = 199940
MD5 (kb_src-8.04.tar.gz) = 9c37650b59509ca781b7f47b7e04eb4a
SHA256 (kb_src-8.04.tar.gz) = 0294ba1ff6b40dda7db1065a53088e3d6d642411c51cddc14b866027840c6a8f
SIZE (kb_src-8.04.tar.gz) = 96647
MD5 (kb_inst-8.04.tar.gz) = 3eb637845509d4b344f023ac5da2d087
SHA256 (kb_inst-8.04.tar.gz) = cd6707ae05b544e74bc0fdf25ab84c17f93394953f6f1a4fb1c5a84c63af5add
SIZE (kb_inst-8.04.tar.gz) = 321463

View file

@ -6,11 +6,11 @@ LIBS+= `pkg-config --cflags --libs gtk+-2.0`
LIBS+= `pkg-config --cflags --libs libgnome-2.0`
LIBS+= `pkg-config --cflags --libs bonobo-activation-2.0`
all: kb_server kb
all: kb kb_server
kb_server: kb_server.c
${CC} ${CFLAGS} -o kb_server kb_server.c -lm
kb: boxes.c fboxes.c kb.c radio.c bsd_bells.c fields.c sboxes.c \
couzon.c init.c kb_server.c support.c elogs.c io.c network.c tree.c
${CC} ${CFLAGS} -I. ${LIBS} kb.c -UBSDSOUND -o kb
${CC} ${CFLAGS} -DSPKR -I. ${LIBS} kb.c -o kb

138
comms/kb/files/README_TIPS Normal file
View file

@ -0,0 +1,138 @@
Tips for the System Administrator:
Prior to Field Day:
To prevent users from inadvertently starting up more than one kb_server
(which would be a very bad thing), I put the kb_server executable on the
non-server computers with a different name. That way, if the server
computer dies and a backup computer needs to become the server, the file
is there and just needs to be renamed back to kb_server.
I set up the network computers at home before Field Day to make sure
everything works as expected. Last year, the battery died in one of the
computers less than a week before Field Day, and a hard disk died on
another a couple of weeks before that. Much better to have it happen at
home! I also set up all the Initial Screen information before Field Day
to save time at the site. KB will save a zero-byte data file that will
come up automatically when you start KB at Field Day. (It's most
convenient to do this in June, since KB's default contest for May is WPX
CW. In June, it's Field Day.)
At Field Day:
It's best to start up the client on the server computer before the other
clients are started. This will minimize network traffic, since the
first client connected to the server is assumed to be the master client.
When the master client is on a different computer from the server,
all the traffic between them is over the network, not local. If you
lose the master client (say someone accidentally exits KB on that
machine), the second-connected client automatically becomes the master,
and the network keeps going, but less efficiently. Similarly, when
shutting down the network, it's best (but not essential) to shut down
the remote clients first and then the master client last. When the last
client has exited, the server program shuts down automatically.
If a network computer gets turned off by accident, restart it. When you
reconnect it to the network, all the log information will be
resynchronized with what's already on the network. If it's a client
that goes down, it's all automatic. If it's the server, you'll have to
reconnect all the clients after the server is running again.
The VHF station at the AARA Field Day uses KB, but is not connected to
the network. 6-meters is logged as 160-meters, and the higher bands are
logged up from there. The VHF ops leave me a note as to which "band" is
which. After Field Day, I edit the band designators on the electronic
dupe sheets to reflect the correct bands. I then copy the VHF dupe
sheet file into the HF dupe sheet file for submittal. (Be careful here,
since the filenames from the HF and VHF stations for ALL of the files
(main data file, log, dupe sheets, etc.) will be identical. Take
appropriate action to keep them straight.) There is a command-line
capability with KB to specify a non-default file name, but using it at
Field Day, especially with unfamiliar users, is probably asking for trouble.
The GOTA station must not be networked with the other stations, since
all computers on the network are assumed to be logging with the same
call sign. The GOTA station will need its own dupe sheet. All warnings
about the identical file names for the VHF station apply here too.
I tend to prepare for the worst, so I like to do a file back-up
occasionally (to either a floppy disk or USB memory stick) using Alt-O
(Output). Use separate media for the main network, VHF, and GOTA
stations to avoid overwriting the identically-named data files. (If you
have a separate server computer, you won't have to interrupt any
operators on the network to do this.) KB forces a hard disk write after
every logged QSO, and I've never lost a contact using KB (with power
outages, etc.), but I don't want to be a goat at Field Day(!).
After Field Day:
See VHF station tip above (for after Field Day items).
The summary sheet that KB generates is for use as an aid in filling out
the ARRL online entry form. It is not for submittal to ARRL. (ARRL
only wants the dupe sheets.)
Tips for Operators/Users:
General:
At the AARA Field Day (the first two years we used KB), we set up a
"Demo" computer to allow users to get familiar with how KB works. This
computer was not networked to any of the "official" computers (the ones
with real Field Day logs on them). They could play with this computer,
get stuck, ask questions, work North Korea, etc. We also gave a
training session on this computer an hour or two before Field Day
started. We won't be doing a demo station this year, but by now our ops
are familiar enough with KB that it isn't necessary.
Specific:
When using KB to send messages (either CW or DVK), it is more convenient
to "shift the function keys". This allows each message to be sent with
a single keystroke. Which type of message is sent (CW or DVK) is
determined by which mode has been selected (CW or phone). The menu bar
functions then require pressing the shift key in conjunction with the
appropriate function key.
There are two "dupe modes" in KB: Ask and Always. "Ask" is good for
search-and-pounce operation. If a dupe is encountered, KB will ask
whether the operator wants to work that call again or not. "Always" is
good for running stations. In this mode, KB will mark each dupe with a
red star (and zero points), and let the operator continue without
interruption. (When running, it's a lot faster to just work the dupes
rather than to argue with them about it.)
When editing a previously logged call (to correct any logging errors),
the proper way to complete the task is to press <Enter>. Many
unfamiliar users (at our Field Day) hit <Escape> instead. Unfortunately
for them, <Escape> is the command to clear a field. Fortunately for
them (but only if they know about it), Alt-<Escape> will restore the
original contents of that field (before it was edited). Then they can
try editing again, and use <Enter> to resume operating.
Also, when sending CW or DVK messages, the proper way to interrupt the
message is to press <Pause/Break>. Unfortunately, unfamiliar operators
like to use <Escape> for this too, and KB dutifully clears the field.
There's no way to retrieve the previous contents in this case, however.
(I'm going to try more Post-It notes on the keyboard this year.)
Many of our club's operators are long-time users of CT and WriteLog. In
those programs, the space bar is used like a tab key. In KB, the space
bar is used to reassemble two parts of a call sign. (For example, the
operator only gets the last two letters of the call, RC, then asks for
the rest. When the rest is received, the operator has typed in the call
field: RC VE3, which when <Enter> or <TAB> is pressed, gets reassembled
to VE3RC. (Before Field Day 2006 started, our ops were insisting that
the space bar "has to be" used like a tab key, until they saw this.
Then they wondered how they could ever operate again without it. We got
no complaints about the space bar in 2007.)
An operator at one station can send a message across the network using
Alt-M. (When the rate is slow, and/or the ops want to harass each other,
they can stay in touch this way.) The messages will cover up part of
the menu bar (and the automatically generated network messages will also
do this). Pressing Alt-R will redraw the screen with the full menu bar
restored.

View file

@ -1,163 +0,0 @@
#ifdef DEBUG_BELLS
#include <stdio.h>
#include <stdlib.h>
#include <dev/speaker/speaker.h>
#include <fcntl.h>
#include "kb_bells.h"
#define MAX_BELLS (SPEED_CHANGE_SOUND+1)
int fd_bells;
static void bsd_play_bells(int isound);
main()
{
int i;
fd_bells = open("/dev/speaker",O_RDWR);
if(fd_bells<0) {
fprintf(stderr,"kldload speaker.ko\n");
exit(-1);
}
for(i=1;i < MAX_BELLS;i++) {
printf("%d \n", i);
bsd_play_bells(i);
getchar();
}
}
#endif
static void bsd_play_bells(int isound)
{
tone_t tones;
switch(isound)
{
case BELL_SOUND :
play_bell_sound ();
break;
case DUPE_SOUND :
play_dupe_sound ();
break;
case MESSAGE_SOUND :
play_message_sound ();
break;
case BAND_CHANGE_SOUND :
play_band_change_sound ();
break;
case SINGLE_MULT_SOUND :
play_single_mult_sound ();
break;
case DOUBLE_MULT_SOUND :
play_double_mult_sound ();
break;
case BAD_CALL_SOUND :
play_bad_call_sound ();
break;
case BAD_KEY_SOUND :
play_bad_key_sound ();
break;
case SPEED_CHANGE_SOUND :
play_speed_change_sound ();
break;
default:
break;
}
}
#define DELAY_TO_HZ(x) (x/4)
play_bell_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x474);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_dupe_sound ()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0xfe0);
tones.duration = 12;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x17c8);
tones.duration = 12;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_message_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0xd58);
tones.duration = 12;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x8e8);
tones.duration = 12;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0xd58);
tones.duration = 12;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_band_change_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x710);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = 0;
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x710);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = 0;
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_single_mult_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x8e8);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x6ac);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_double_mult_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x8e8);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x6ac);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = 0;
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x8e8);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
tones.frequency = DELAY_TO_HZ(0x6ac);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_bad_call_sound ()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x11d0);
tones.duration = 38;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_bad_key_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x17cc);
tones.duration = 42;
ioctl(fd_bells, SPKRTONE, &tones);
}
play_speed_change_sound()
{
tone_t tones;
tones.frequency = DELAY_TO_HZ(0x710);
tones.duration = 6;
ioctl(fd_bells, SPKRTONE, &tones);
}

View file

@ -1,7 +1,9 @@
#!/bin/sh
if [ ! -e ~/.kb ] ; then
if [ ! -e ~/.kb ];then
mkdir ~/.kb
cd ~/.kb
ln -s /usr/local/bin/kb_server kb_server
fi
cp -f /usr/local/share/kb/* ~/.kb
cd ~/.kb
cp -f /usr/local/share/kb/* .
exec kb_bin

BIN
comms/kb/files/kb-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

26
comms/kb/files/kb.1 Normal file
View file

@ -0,0 +1,26 @@
.Dd May 24, 2008
.Os Unix
.Dt kb 1
.Sh NAME
.Nm kb
.Nd Contest logger for gnome
.Sh SYNOPSIS
This program is a contest logger specifically written for the gnome
window manager,
though it will work under all window managers.
.Sh DESCRIPTION
.B kb
kb consists of a pair of programs, the kb GUI and the kb_server, which
is a logging reflector. A multi-op site can use one copy of kb_server to
replicate all events/logs to all clients running kb over a LAN;
such as at a field day. This does mean a lot of LAN traffic but
also means any user can take over the job of the kb_server and with
the replicated logs there is a lot of backup as well.
.Sh SEE ALSO
If documents were installed for kb on your system: README_BSD,README_SRC,
README, README_KINKS and README_TIPS.
.Pp
The location of documents is system dependent, but is typically in
/usr/local/share/doc/kb for BSD system and /usr/share/doc/kb for Linux systems.
.Sh AUTHORS
Walter J. Legowski (WA1KKM) <wa1kkm@k2ct.net>

View file

@ -1,34 +0,0 @@
#! /bin/sh
#
# PROVIDE: kbserver
# REQUIRE: NETWORKING
#
# Add the following lines to /etc/rc.conf to enable kb_server
#
#kbserver_enable="YES"
. /etc/rc.subr
name=kbserver
rcvar=`set_rcvar`
load_rc_config $name
kbserver_enable=${kbserver_enable-"NO"}
command=/usr/local/sbin/kb_server
start_cmd=kbserver_start
stop_cmd=kbserver_stop
kbserver_start()
{
echo "Starting kb_server: "
${command}
return 0
}
kbserver_stop()
{
echo "Stopping kb_server: "
killall kb_server
return 0
}
run_rc_command "$1"

View file

@ -1,35 +0,0 @@
--- boxes.c.orig 2007-11-24 19:46:36.000000000 -0500
+++ boxes.c 2007-11-24 19:42:17.000000000 -0500
@@ -749,8 +749,13 @@
guint ikey, istate;
gchar msg[43], email_file_names[5][13], lpr_line[81];
gint margin=9;
+#ifdef BSD
+ const gchar *lpr_cmd =
+ "lpr ";
+#else
const gchar *lpr_cmd =
"lpr -r -o page-top=36 -o page-left=18 -o page-bottom=36 ";
+#endif
const gchar *print_file_names[4] = {"PRINT.SUM", "PRINT.DUP",
"PRINT.LOG", "PRINT.MLT"};
@@ -778,14 +783,14 @@
if(icall_count)
{
write_summary_file (print_file_names[obd->item], margin);
- strcpy(lpr_line, lpr_cmd);
- strcat(lpr_line, print_file_names[obd->item]);
+ snprintf(lpr_line, sizeof(lpr_line), "%s %s", lpr_cmd,
+ print_file_names[obd->item]);
icopy = system(lpr_line);
if(isel_contest==WPX)
{
write_multiplier_file (print_file_names[3], margin);
- strcpy(lpr_line, lpr_cmd);
- strcat(lpr_line, print_file_names[3]);
+ snprintf(lpr_line, sizeof(lpr_line), "%s %s", lpr_cmd,
+ print_file_names[3]);
icopy = system(lpr_line);
}
if(!icopy)

View file

@ -1,915 +0,0 @@
--- elogs.c.orig 2007-11-22 13:24:56.000000000 -0500
+++ elogs.c 2007-11-22 14:19:17.000000000 -0500
@@ -56,7 +56,6 @@
gchar locus_line[4], ops_line[45];
gint iqsos[2] = {0, 0}, idupes[2] = {0, 0}, ipoints[2] = {0, 0};
gint mults[2] = {0, 0}, izones[2] = {0, 0}, nlw[2] = {0, 0};
- gchar skip_line[3] = {'\r', '\n', '\0'};
const gchar *stpr = "State/Province: ";
const gchar *category_choices[8] = {"Single Operator",
"Single Operator, Assisted",
@@ -106,9 +105,7 @@
concat(line_out, cr_array[1].date, 4, 5, !COPY);
strcat(line_out, " ");
strcat(line_out, select_contest_items[isel_contest]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Call: ");
strcpy(station, init_screen_choices[0]);
@@ -169,9 +166,7 @@
strcat(line_out, "Section: ___");
break;
}
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp, "%s\n\n", line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Category: ");
for(i=0; i<8; i++)
@@ -192,16 +187,12 @@
strcpy(ops_line, "");
break;
}
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp, "%s\n\n", line_out);
if(strlen(ops_line))
{
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, ops_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp, "%s\n\n", line_out);
}
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Mode: ");
@@ -211,24 +202,18 @@
strcat(line_out, power_line);
concat(line_out, blank80, 0, 9, !COPY);
strcat(line_out, "Hours of Operation: __");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp, "%s\n\n\n", line_out);
switch (isel_contest)
{
case DX :
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" Net QSO Country Claimed");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" QSOs Points Mults Score");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp, "%s\n\n", line_out);
for(i=0; i<6; i++)
{
concat(line_out, blank80, 0, margin+2, COPY);
@@ -247,10 +232,9 @@
int_to_comma (score_mb.mults[mode][i], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n", line_out);
}
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "All Bands");
concat(line_out, blank80, 0, 3, !COPY);
@@ -269,21 +253,17 @@
int_to_comma (ipoints[mode]*mults[mode], score_line);
left_blank_pad (score_line, sizeof(score_line));
strcat(line_out, score_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
break;
case FD :
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" Net CW Net PH");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" QSOs QSOs");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
for(i=0; i<6; i++)
{
concat(line_out, blank80, 0, margin+2, COPY);
@@ -297,10 +277,9 @@
int_to_comma (score_mb.qsos[PH][i]-score_mb.dupes[PH][i], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "All Bands");
concat(line_out, blank80, 0, 4, !COPY);
@@ -315,8 +294,7 @@
int_to_comma (iqsos[CW]-idupes[CW]+iqsos[PH]-idupes[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "QSO Points");
concat(line_out, blank80, 0, 3, !COPY);
@@ -331,8 +309,7 @@
int_to_comma (ipoints[CW]+ipoints[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Power Multiplier");
concat(line_out, blank80, 0, 21, !COPY);
@@ -345,43 +322,34 @@
int_to_comma (pm, sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "QSO Score");
concat(line_out, blank80, 0, 28, !COPY);
int_to_comma (pm*(ipoints[CW]+ipoints[PH]), sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Bonus Points");
concat(line_out, blank80, 0, 24, !COPY);
concat(line_out, under_line, 0, 6, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Claimed Score");
concat(line_out, blank80, 0, 23, !COPY);
concat(line_out, under_line, 0, 6, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
break;
case WPX :
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" Net QSO Prefix Claimed");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" QSOs Points Mults Score");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
for(i=0; i<6; i++)
{
concat(line_out, blank80, 0, margin+2, COPY);
@@ -400,10 +368,9 @@
int_to_comma (score_mb.mults[mode][i], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "All Bands");
concat(line_out, blank80, 0, 3, !COPY);
@@ -422,8 +389,7 @@
int_to_comma (ipoints[mode]*mults[mode], score_line);
left_blank_pad (score_line, sizeof(score_line));
strcat(line_out, score_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
break;
case CQP :
break;
@@ -431,14 +397,11 @@
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" Net QSO Country Zone Claimed");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" QSOs Points Mults Mults Score");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
for(i=0; i<6; i++)
{
concat(line_out, blank80, 0, margin+2, COPY);
@@ -461,10 +424,9 @@
int_to_comma (score_mb.zones[mode][i], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "All Bands");
concat(line_out, blank80, 0, 2, !COPY);
@@ -487,22 +449,17 @@
int_to_comma (ipoints[mode]*(mults[mode]+izones[mode]), score_line);
left_blank_pad (score_line, sizeof(score_line));
strcat(line_out, score_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
break;
case SS :
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" Net QSO Section Claimed");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" QSOs Points Mults Score");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
concat(line_out, blank80, 0, 12, !COPY);
int_to_comma (iqsos[mode]-idupes[mode], sum_line);
@@ -520,21 +477,15 @@
int_to_comma (ipoints[mode]*mults[mode], score_line);
left_blank_pad (score_line, sizeof(score_line));
strcat(line_out, score_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" ARRL Sections Check-Off List");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" (Sections worked marked with an asterisk)");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
for(j=1; j<11; j++)
{
concat(line_out, blank80, 0, margin, COPY);
@@ -554,8 +505,7 @@
strcat(line_out, mult_line);
strcat(line_out, locus_line);
}
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
break;
case A160 :
@@ -565,18 +515,14 @@
int_to_comma (iqsos[CW]-idupes[CW], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "QSO Points");
concat(line_out, blank80, 0, 9, !COPY);
int_to_comma (ipoints[CW], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "States/Prov");
for(i=0; i<2; i++)
@@ -587,9 +533,7 @@
int_to_comma (nlw[CW], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Countries");
nlw[0] = 0;
@@ -602,18 +546,14 @@
int_to_comma (nlw[CW], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Total Mults");
concat(line_out, blank80, 0, 8, !COPY);
int_to_comma (mults[CW], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Claimed Score");
concat(line_out, blank80, 0, 1, !COPY);
@@ -621,16 +561,13 @@
score_line);
left_blank_pad (score_line, sizeof(score_line));
strcat(line_out, score_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
break;
case TEN :
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
" CW Phone All");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "QSOs");
concat(line_out, blank80, 0, 15, !COPY);
@@ -645,9 +582,7 @@
int_to_comma (iqsos[CW]-idupes[CW]+iqsos[PH]-idupes[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "QSO Points");
concat(line_out, blank80, 0, 9, !COPY);
@@ -662,9 +597,7 @@
int_to_comma (ipoints[CW]+ipoints[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "States/Prov");
for(i=0; i<2; i++)
@@ -683,9 +616,7 @@
int_to_comma (nlw[CW]+nlw[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Countries");
nlw[0] = 0;
@@ -706,9 +637,7 @@
int_to_comma (nlw[CW]+nlw[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Total Mults");
concat(line_out, blank80, 0, 8, !COPY);
@@ -723,9 +652,7 @@
int_to_comma (mults[CW]+mults[PH], sum_line);
left_blank_pad (sum_line, sizeof(sum_line));
strcat(line_out, sum_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Claimed Score");
concat(line_out, blank80, 0, 30, !COPY);
@@ -733,76 +660,51 @@
score_line);
left_blank_pad (score_line, sizeof(score_line));
strcat(line_out, score_line);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
break;
}
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"\n\n");
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
"Club Participation? ( ) Yes ( ) No If yes, print name below.");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Name of Club: ");
concat(line_out, under_line, 0, 49, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Rigs: ");
concat(line_out, under_line, 0, 57, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
concat(line_out, under_line, 0, 63, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Antennas: ");
concat(line_out, under_line, 0, 53, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
concat(line_out, under_line, 0, 63, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Remarks: ");
concat(line_out, under_line, 0, 54, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
concat(line_out, under_line, 0, 63, !COPY);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n%s\n\n",line_out,line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
"This is to certify that in this contest I have operated my");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
"transmitter within the limitations of my license and have");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out,
"observed fully the rules and regulations of the contest.");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, "Date ");
concat(line_out, under_line, 0, 9, !COPY);
@@ -810,25 +712,20 @@
concat(line_out, under_line, 0, 22, !COPY);
strcat(line_out, ", ");
strcat(line_out, init_screen_choices[1]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, init_screen_choices[2]);
strcat(line_out, ", ");
strcat(line_out, init_screen_choices[1]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, init_screen_choices[3]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
if(strlen(init_screen_choices[4]))
{
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, init_screen_choices[4]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, init_screen_choices[5]);
@@ -836,8 +733,7 @@
strcat(line_out, init_screen_choices[6]);
strcat(line_out, " ");
strcat(line_out, init_screen_choices[7]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
fflush(fp);
fsync(fileno(fp));
fclose(fp);
@@ -852,7 +748,6 @@
gchar station[14], mode_line[6], dupe_line[2];
gchar title_line[74], header_line1[74], call_hold[14], call_fill[14];
gint iqsos[2] = {0, 0}, max_lines=54;
- gchar skip_line[3] = {'\r', '\n', '\0'};
gchar form_feed[2] = {'\f', '\0'};
fp = fopen(filnam, "w");
@@ -924,10 +819,7 @@
int_to_char (npages, npages_char);
left_blank_pad (npages_char, sizeof(npages_char));
strcat(line_out, npages_char);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n\n",line_out);
}
if(margin || new_mb)
{
@@ -936,9 +828,7 @@
strcat(line_out, header_line1);
strcat(line_out, bandw[i]);
strcat(line_out, mode_char[j]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
}
strcpy(call_hold, "");
ic = 0;
@@ -973,8 +863,7 @@
ic %= 4;
if(!ic)
{
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
idl++;
}
}
@@ -986,14 +875,13 @@
}
if(ic)
{
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
if(margin)
fputs(form_feed, fp);
}
if(!margin)
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
}
fflush(fp);
fsync(fileno(fp));
@@ -1014,7 +902,6 @@
gchar hl2_zone[7], hl2_country[10];
gint iqsos[2] = {0, 0}, nqsos[2] = {0, 0};
gint nzones[2] = {0, 0}, nmults[2] = {0, 0}, npts[2] = {0, 0};
- gchar skip_line[3] = {'\r', '\n', '\0'};
gchar form_feed[2] = {'\f', '\0'};
fp = fopen(filnam, "w");
@@ -1154,19 +1041,13 @@
strcat(line_out, ipage_char);
strcat(line_out, " of ");
strcat(line_out, npages_char);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, header_line1);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, header_line2);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
}
for(i=(ipage-1)*50+1; i<=ipage*50; i++)
{
@@ -1361,11 +1242,10 @@
npts[0] += atoi(cr_array[i].points);
npts[1] += atoi(cr_array[i].points);
strcat(line_out, cr_array[i].points);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
else if(margin)
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
}
if(margin)
{
@@ -1385,7 +1265,7 @@
left_blank_pad (footer2_vars[2], sizeof(footer2_vars[2]));
int_to_char (npts[1], footer2_vars[3]);
left_blank_pad (footer2_vars[3], sizeof(footer2_vars[3]));
- fputs(skip_line, fp);
+ fprintf(fp,"\n");
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, footer_line1);
concat(line_out, blank80, 0, 9, !COPY);
@@ -1402,8 +1282,7 @@
strcat(line_out, footer1_vars[2]);
concat(line_out, blank80, 0, 3, !COPY);
strcat(line_out, footer1_vars[3]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, footer_line2);
concat(line_out, blank80, 0, 9, !COPY);
@@ -1420,9 +1299,7 @@
strcat(line_out, footer2_vars[2]);
concat(line_out, blank80, 0, 3, !COPY);
strcat(line_out, footer2_vars[3]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(form_feed, fp);
+ fprintf(fp,"%s\f\n",line_out);
}
}
fflush(fp);
@@ -1439,7 +1316,6 @@
gchar title_line[74], header_line1[74];
gint max_lines=54;
gint iqsos[2] = {0, 0};
- gchar skip_line[3] = {'\r', '\n', '\0'};
gchar form_feed[2] = {'\f', '\0'};
fp = fopen(filnam, "w");
@@ -1499,15 +1375,10 @@
strcat(line_out, ipage_char);
strcat(line_out, " of ");
strcat(line_out, npages_char);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n\n",line_out);
concat(line_out, blank80, 0, margin, COPY);
strcat(line_out, header_line1);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(skip_line, fp);
+ fprintf(fp,"%s\n\n",line_out);
}
jfirst = (ipage-1)*max_lines*10+1;
jlast = ipage*max_lines*10<px_tree.npx ?
@@ -1525,14 +1396,12 @@
ic %= 10;
if(!ic)
{
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
}
if(ic)
{
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
if(margin)
fputs(form_feed, fp);
@@ -1662,8 +1531,7 @@
strcat(category_cab, " ");
strcat(category_cab, mode_cab);
strcpy(line_out, "START-OF-LOG: 2.0");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
if(strlen(section)>0)
{
strcpy(line_out, "ARRL-SECTION: ");
@@ -1671,80 +1539,45 @@
}
else
strcpy(line_out, "ARRL-SECTION:");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
strcpy(line_out, "CALLSIGN: ");
strcat(line_out, init_screen_choices[0]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
strcpy(line_out, "CATEGORY: ");
strcat(line_out, category_cab);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
if(isel_contest==WPX && !strcmp(init_screen_choices[11], "<SO-TRI/SE>"))
{
strcpy(line_out, "CATEGORY-OVERLAY: ");
strcat(line_out, "TB-WIRES");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
strcpy(line_out, "CLAIMED-SCORE: ");
strcat(line_out, score_cab);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
strcpy(line_out, "CLUB:");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
strcpy(line_out, "CONTEST: ");
strcat(line_out, contest_cab);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
strcpy(line_out, "NAME: ");
strcat(line_out, init_screen_choices[2]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
strcpy(line_out, "ADDRESS: ");
strcat(line_out, init_screen_choices[3]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- if(strlen(init_screen_choices[4]))
- {
- strcpy(line_out, "ADDRESS: ");
- strcat(line_out, init_screen_choices[4]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- strcpy(line_out, "ADDRESS: ");
- strcat(line_out, init_screen_choices[5]);
- strcat(line_out, ", ");
- strcat(line_out, init_screen_choices[6]);
- strcat(line_out, " ");
- strcat(line_out, init_screen_choices[7]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- }
- else
- {
- strcpy(line_out, "ADDRESS: ");
- strcat(line_out, init_screen_choices[5]);
- strcat(line_out, ", ");
- strcat(line_out, init_screen_choices[6]);
- strcat(line_out, " ");
- strcat(line_out, init_screen_choices[7]);
- add_eol_chars (line_out);
- fputs(line_out, fp);
- strcpy(line_out, "ADDRESS:");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- }
- strcpy(line_out, "OPERATORS:");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- strcpy(line_out, "SOAPBOX:");
- add_eol_chars (line_out);
- fputs(line_out, fp);
- fputs(line_out, fp);
- fputs(line_out, fp);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
+ if(strlen(init_screen_choices[4])!=0)
+ fprintf(fp,"ADDRESS: %s\n",
+ init_screen_choices[4]);
+ fprintf(fp,"ADDRESS: %s, %s %s\n",init_screen_choices[5],
+ init_screen_choices[6],init_screen_choices[7]);
+
+ fprintf(fp,"OPERATORS:\n");
+ fprintf(fp,"SOAPBOX:\n");
+ fprintf(fp,"SOAPBOX:\n");
+ fprintf(fp,"SOAPBOX:\n");
+ fprintf(fp,"SOAPBOX:\n");
+ fprintf(fp,"SOAPBOX:\n");
switch (isel_contest)
{
case WPX :
@@ -1790,8 +1623,7 @@
strcat(line_out, exch_rcvd_cab);
strcat(line_out, " ");
strcat(line_out, cr_array[i].tx);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
break;
case FD :
@@ -1836,8 +1668,7 @@
strcat(line_out, exch_rcvd_cab);
strcat(line_out, " ");
strcat(line_out, cr_array[i].tx);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
break;
case CQP :
@@ -1892,8 +1723,7 @@
strcat(line_out, ck_rcvd_cab);
strcat(line_out, " ");
strcat(line_out, rst_rcvd_cab);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
break;
case A160 :
@@ -1947,8 +1777,7 @@
strcat(line_out, exch_rcvd_cab);
strcat(line_out, " ");
strcat(line_out, cr_array[i].tx);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
break;
default :
@@ -1995,13 +1824,10 @@
strcat(line_out, exch_rcvd_cab);
strcat(line_out, " ");
strcat(line_out, cr_array[i].tx);
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"%s\n",line_out);
}
}
- strcpy(line_out, "END-OF-LOG:");
- add_eol_chars (line_out);
- fputs(line_out, fp);
+ fprintf(fp,"END-OF-LOG:\n");
fflush(fp);
fsync(fileno(fp));
fclose(fp);

View file

@ -1,15 +0,0 @@
--- fields.c.orig 2007-09-10 10:57:01.000000000 -0400
+++ fields.c 2007-11-22 19:53:19.000000000 -0500
@@ -1418,6 +1418,12 @@
gint cyan_bar_color, text_color;
gchar str_hold[81];
+ /* If esk->ikey is nul shunt it off here. I saw it happen - db VA3DB */
+ if (esd->ikey == '\0')
+ {
+ play_bells (BELL_SOUND);
+ return;
+ }
beep = 1;
ccol = *esd->cursor_colp-esd->field_col;
lflp = strlen(esd->field_linep);

View file

@ -1,27 +0,0 @@
--- globs.h.orig 2007-07-20 10:26:01.000000000 -0400
+++ globs.h 2007-11-23 09:38:53.000000000 -0500
@@ -169,8 +169,15 @@
"<18.0>", "<19.2>", "<20.6>", "<22.2>", "<24.0>",
"<26.2>", "<28.8>", "<32.0>", "<36.0>", "<41.1>",
"<48.0>", "<57.6>", "<72.0>"};
+/* These device names are really specific to FreeBSD -db */
+#ifdef BSD
+static const gchar *port_bracket[6] = {"<OFF>", "<ttyd0>", "<ttyd1>",
+ "<ttyU0>", "<ttyU1>", "<TELNET>"};
+#else
static const gchar *port_bracket[6] = {"<OFF>", "<ttyS0>", "<ttyS1>",
"<ttyUSB0>", "<ttyUSB1>", "<TELNET>"};
+#endif
+
static const gchar *yn_bracket[2] = {"<YES>", "<NO>"};
static const gchar *dupe_bracket[2] = {"<ASK>", "<ALWAYS>"};
static const gchar *partial_bracket[3] = {"<NO>", "<2>", "<3>"};
@@ -178,7 +185,7 @@
" Station Call Sign", "Operator Call Sign",
" Operator Name", " Address",
" Address", " City",
- " State", " Zip Code",
+ " State/Province", " Zip/Postal Code",
" Latitude", " Longitude",
" Offset to UTC", " Entry Category",
" Power", " Contest Type",

View file

@ -1,150 +1,19 @@
--- init.c.orig 2007-09-10 10:34:21.000000000 -0400
+++ init.c 2007-11-24 16:43:45.000000000 -0500
@@ -30,6 +30,7 @@
static gint set_error_check(gpointer data);
static gint check_precedence(void);
static gint butt_kick(gpointer widget);
+static void set_fixed_font(GtkWidget *);
struct init_vars
{
gint row1;
@@ -108,33 +109,13 @@
(col1+9)*wcol,
(row1+9)*hrow+hrow/2,
layout);
- pfd = pango_font_description_from_string ("misc fixed 16");
- pc = gtk_widget_get_pango_context (widget);
- pl = pango_context_get_language (pc);
- pfm = pango_context_get_metrics (pc, pfd, pl);
- ipfmgadw = pango_font_metrics_get_approximate_digit_width (pfm);
- cursor_offset = 8-pango_font_metrics_get_descent (pfm)/PANGO_SCALE;
- pango_font_metrics_unref (pfm);
- if(ipfmgadw==10240)
- {
- pango_layout_set_font_description (layout, pfd);
- pango_font_description_free (pfd);
- }
- else
- {
- pango_font_description_free (pfd);
- pfd = pango_font_description_from_string ("luxi mono 12");
- pango_layout_set_font_description (layout, pfd);
- pango_font_description_free (pfd);
- printf("%s\n", missing_font);
- printf("For a more readable KB screen ");
- printf("add the Misc Fixed font to your system.\n");
- printf("%s\n", missing_font);
- write_line (row1+23, col1+20, missing_font, HI_RED, SAVEPIX);
- write_line (row1+24, col1+6,
- "Now Using Alternate Font. KB Screens May Exhibit Display Problems.",
- HI_RED, SAVEPIX);
- }
+ /* Original code would only work on a 1024 wide screen.
+ * This works for other sized screens, including mine which is 1280 wide.
+ *
+ * - Diane VA3DB db@db.net
+ */
+ set_fixed_font(widget);
+
concat(comp_mon, __DATE__, 0, 2, COPY);
concat(comp_yr, __DATE__, 7, 10, COPY);
while(strcmp(comp_mon, month_array[icm]) && icm<11)
@@ -404,6 +385,7 @@
mode = CW;
else
mode = PH;
+ shift_fkeys = 0;
if(!sccfn && strcmp(init_screen_choices[16], port_bracket[0]))
--- init.c.orig 2008-05-27 11:46:25.000000000 -0400
+++ init.c 2008-05-27 11:47:49.000000000 -0400
@@ -525,6 +525,8 @@
pfd = pango_font_description_from_string ("misc fixed 16");
pfm = pango_context_get_metrics (pc, pfd, pl);
ipfmgadw = pango_font_metrics_get_approximate_digit_width (pfm);
+/* A misc fixed 16 is not a monospace font! -db */
+#if 0
if(ipfmgadw/PANGO_SCALE==wcol)
{
idisplay_type = IDT_KEYER;
@@ -1139,8 +1121,13 @@
beep = 0;
break;
case 7 :
- if(isdigit_ui(ikey) || ikey=='-')
- beep = 0;
+ /* Canadian postal codes will be ANA[space]NAN
+ * I will cheat and allow any combination of alpha, numeric and space.
+ * - Diane VA3DB <db@db.net>
+ */
+ ikey = toupper_ui(ikey);
+ if(isalpha_ui(ikey) || isdigit_ui(ikey) || ikey==' ' || ikey=='-')
+ beep = 0;
break;
case 8 :
ikey = toupper_ui(ikey);
@@ -1163,7 +1150,7 @@
edit_line (&esd);
}
else
- play_bells (BAD_KEY_SOUND);
+ play_bells (BAD_KEY_SOUND);
cursor_offset = 4;
@@ -533,6 +535,7 @@
pango_font_description_free (pfd);
}
return TRUE;
}
@@ -1791,6 +1778,7 @@
}
write_ini_file ();
insert_mode = 0;
+ shift_fkeys = 0;
shift_fkeys = (strcmp(set_screen_choices[11], yn_bracket[1]));
ssd->done = TRUE;
break;
@@ -2381,3 +2369,57 @@
update_rect.height);
return TRUE;
}
+
+/*
+ * set_fixed_font
+ *
+ * Author - Diane Bruce <db@db.net> VA3DB
+ * Inputs - None
+ * Output - None
+ * Side effects - Try to find a font that fits the screen
+ * giving 80 columns across
+ * KB relies upon the width of a monospace font being equal
+ * in width to one of 80 (NUMBER_OF_COLUMNS) columns.
+ * Bugs - I am sure there must be better ways of doing this.
+ * There is probably a mapping function between
+ * font size and pixel width. I'll look for that next.
+ */
+#define SBUFSIZE 64
+static void
+set_fixed_font(GtkWidget *widget)
+{
+ int width_col;
+ char font_desc[SBUFSIZE];
+ int width_font;
+ int font_size;
+ gint ipfmgadw;
+ PangoFontDescription *pfd;
+ PangoContext *pc;
+ PangoLanguage *pl;
+ PangoFontMetrics *pfm;
+
+ width_col = widget->allocation.width/NUMBER_OF_COLUMNS;
+
+ pc = gtk_widget_get_pango_context (widget);
+ pl = pango_context_get_language (pc);
+
+ for (font_size = 10; font_size < 24; font_size++)
+ {
+ snprintf(font_desc, sizeof(font_desc)-1, "monospace %d", font_size);
+
+ pfd = pango_font_description_from_string (font_desc);
+ pfm = pango_context_get_metrics (pc, pfd, pl);
+ ipfmgadw = pango_font_metrics_get_approximate_digit_width (pfm);
+ if (ipfmgadw/PANGO_SCALE == width_col)
+ {
+ printf("Found a good font [%s]\n", font_desc);
+ pango_font_metrics_unref (pfm);
+ break;
+ }
+ pango_font_metrics_unref (pfm);
+ }
+
+ cursor_offset = 8-pango_font_metrics_get_descent (pfm)/PANGO_SCALE;
+ pango_layout_set_font_description (layout, pfd);
+ pango_font_description_free (pfd);
+}
else
+#endif
{
for(nff=0; nff<2; nff++)
{

View file

@ -1,533 +0,0 @@
--- io.c.orig 2007-07-01 15:19:57.000000000 -0400
+++ io.c 2008-02-21 11:30:53.000000000 -0500
@@ -17,6 +17,7 @@
static void rewrite_contest_file(void);
static void write_call_library_file(void);
static gint process_tmp_file(const gchar *filnam);
+static char* chomp(char *s);
static void fill_iend_array(void)
{
@@ -99,24 +100,22 @@
strcat(contest_line, cr_array[qnum].tx);
strcpy(field_hold, cr_array[qnum].prefix);
right_blank_pad(field_hold, sizeof(cr_array[qnum].prefix));
- strcat(contest_line, field_hold);
- add_eol_chars (contest_line);
+ sprintf(contest_line,"%s%s\n",contest_line,field_hold);
}
static void read_ini_file(void)
{
FILE *fp;
gchar filnam[13], msg[49], contest_ini_line[76];
- gint i, icolon, lcil, socil;
+ gint i, socil;
+ char *token;
guint answer;
- strcpy(filnam, contest_file_base);
- strcat(filnam, ".INI");
+ snprintf(filnam,sizeof(filnam), "%s.INI", contest_file_base);
fp = fopen(filnam, "r");
if(fp==NULL)
{
- strcpy(msg, filnam);
- strcat(msg, " does not exist. Use default? (Y/N)");
+ snprintf(msg,sizeof(msg),"%s does not exist. Use default? (Y/N)");
play_bells (DUPE_SOUND);
answer = boxed_message (msg, 0, LT_GRAY);
if(toupper_ui(answer)=='Y') fp = fopen("DEFAULT.INI","r");
@@ -125,53 +124,41 @@
socil = sizeof(contest_ini_line);
for(i=0; i<MAX_INIT_ITEMS; i++)
{
- fgets(contest_ini_line, socil, fp);
- if(feof(fp)) break;
- icolon = kb_index (contest_ini_line, ":");
- if(icolon>-1)
- {
- lcil = strlen(contest_ini_line);
- if(contest_ini_line[lcil-1]=='\n') contest_ini_line[lcil-1] = '\0';
- if(contest_ini_line[lcil-2]=='\r') contest_ini_line[lcil-2] = '\0';
- lcil = strlen(contest_ini_line);
- if(lcil>icolon+1)
- concat(init_screen_choices[i], contest_ini_line,
- icolon+1, lcil-1, COPY);
- }
+ if(fgets(contest_ini_line, socil, fp) == NULL)
+ break;
+ token = strtok(contest_ini_line, ":\r\n");
+ if (token != NULL)
+ {
+ token = strtok(NULL,":\r\n");
+ if (token != NULL)
+ strcpy(init_screen_choices[i], token);
+ }
}
for(i=0; i<MAX_SET_ITEMS; i++)
{
- fgets(contest_ini_line, socil, fp);
- if(feof(fp)) break;
- icolon = kb_index (contest_ini_line, ":");
- if(icolon>-1)
- {
- lcil = strlen(contest_ini_line);
- if(contest_ini_line[lcil-1]=='\n') contest_ini_line[lcil-1] = '\0';
- if(contest_ini_line[lcil-2]=='\r') contest_ini_line[lcil-2] = '\0';
- lcil = strlen(contest_ini_line);
- if(lcil>icolon+1)
- concat(set_screen_choices[i], contest_ini_line,
- icolon+1, lcil-1, COPY);
- }
+ if(fgets(contest_ini_line, socil, fp) == NULL)
+ break;
+ token = strtok(contest_ini_line, ":\r\n");
+ if (token != NULL)
+ {
+ token = strtok(NULL,":\r\n");
+ if (token != NULL)
+ strcpy(set_screen_choices[i], token);
+ }
}
if(!strcmp(set_screen_choices[1], "<NEVER>"))
strcpy(set_screen_choices[1], dupe_bracket[0]);
for(i=0; i<MAX_KEYER_ITEMS; i++)
{
- fgets(contest_ini_line, socil, fp);
- if(feof(fp)) break;
- icolon = kb_index (contest_ini_line, ":");
- if(icolon>-1)
- {
- lcil = strlen(contest_ini_line);
- if(contest_ini_line[lcil-1]=='\n') contest_ini_line[lcil-1] = '\0';
- if(contest_ini_line[lcil-2]=='\r') contest_ini_line[lcil-2] = '\0';
- lcil = strlen(contest_ini_line);
- if(lcil>icolon+1)
- concat(keyer_screen_choices[i], contest_ini_line,
- icolon+1, lcil-1, COPY);
- }
+ if(fgets(contest_ini_line, socil, fp) == NULL)
+ break;
+ token = strtok(contest_ini_line, ":\r\n");
+ if(token != NULL)
+ {
+ token = strtok(NULL,":\r\n");
+ if (token != NULL)
+ strcpy(keyer_screen_choices[i], token);
+ }
}
fclose(fp);
}
@@ -187,17 +174,14 @@
fp = fopen(filnam, "r");
if(fp==NULL)
{
- strcpy(msg, "Error reading ");
- strcat(msg, filnam);
+ snprintf(msg, sizeof(msg), "Error reading %s", filnam);
rw_error_box (main_drawing_area, msg);
return;
}
icall_count = 0;
socl = sizeof(contest_line);
- for( ; ; )
+ while(fgets(contest_line, socl, fp) != NULL)
{
- fgets(contest_line, socl, fp);
- if(feof(fp)) break;
icall_count++;
fill_cr_array_all (contest_line, icall_count);
}
@@ -257,16 +241,13 @@
gchar filnam[13], contest_line[76];
ded_num = 0;
- strcpy(filnam, contest_file_base);
- strcat(filnam, ".DED");
+ sprintf(filnam,"%s.DED", filnam);
fp = fopen(filnam, "r");
if(fp==NULL)
return;
socl = sizeof(contest_line);
- for( ; ; )
+ while(fgets(contest_line, socl, fp) != NULL)
{
- fgets(contest_line, socl, fp);
- if(feof(fp)) break;
ded_num++;
strcpy(ded_array[ded_num], contest_line);
}
@@ -276,7 +257,7 @@
static void read_locus_file(void)
{
FILE *fp;
- gint i, j, lcil, icn, soli;
+ gint i, j, icn, soli;
gchar filnam[13], msg[49], clat[5], clong[6];
gchar line_in[80];
gint n=0;
@@ -320,20 +301,14 @@
fp = fopen(filnam, "r");
if(fp==NULL)
{
- strcpy(msg, "Error reading ");
- strcat(msg, filnam);
+ snprintf(msg,sizeof(msg),"Error reading %s",filnam);
rw_error_box (main_drawing_area, msg);
return;
}
soli = sizeof(line_in);
- for( ; ; )
+ while(fgets(line_in, soli, fp) != NULL)
{
- fgets(line_in, soli, fp);
- if(feof(fp)) break;
- lcil = strlen(line_in);
- if(line_in[lcil-1]=='\n') line_in[lcil-1] = '\0';
- if(line_in[lcil-2]=='\r') line_in[lcil-2] = '\0';
- lcil = strlen(line_in);
+ chomp(line_in);
n++;
concat(loci.locus_name[n], line_in,
col_num[icn][0], col_num[icn][1], COPY);
@@ -376,8 +351,7 @@
fp = fopen(filnam, "r");
if(fp==NULL)
{
- strcpy(msg, "Error reading ");
- strcat(msg, filnam);
+ snprintf(msg, sizeof(msg), "Error reading %s",filnam);
rw_error_box (main_drawing_area, msg);
return;
}
@@ -385,12 +359,12 @@
contest_nc[i][0] = '\0';
for(i=0; i<MAX_COUNTRIES; i++)
{
- countries.country_name[i][0] = '\0';
- countries.country_abv[i][0] = '\0';
- countries.country_syn[i][0] = '\0';
- countries.continent_abv[i][0] = '\0';
- countries.zones_in_country[i][0] = '\0';
- countries.country_lat[i] = 0.;
+ countries.country_name[i][0] = '\0';
+ countries.country_abv[i][0] = '\0';
+ countries.country_syn[i][0] = '\0';
+ countries.continent_abv[i][0] = '\0';
+ countries.zones_in_country[i][0] = '\0';
+ countries.country_lat[i] = 0.;
countries.country_long[i] = 0.;
}
for(i=0; i<6; i++)
@@ -401,13 +375,9 @@
countries.izone_worked[i][j] = 0;
}
soli = sizeof(line_in);
- for( ; ; )
+ while(fgets(line_in, soli, fp) != NULL)
{
- fgets(line_in, soli, fp);
- if(feof(fp)) break;
- lcil = strlen(line_in);
- if(line_in[lcil-1]=='\n') line_in[lcil-1] = '\0';
- if(line_in[lcil-2]=='\r') line_in[lcil-2] = '\0';
+ chomp(line_in);
lcil = strlen(line_in);
if(line_in[0]=='-')
{
@@ -456,11 +426,11 @@
countries.country_lat[0] = -89.;
for(i=0; i<=n; i++)
{
- right_blank_unpad (countries.country_name[i]);
- right_blank_unpad (countries.country_abv[i]);
- right_blank_unpad (countries.country_syn[i]);
- right_blank_unpad (countries.continent_abv[i]);
- right_blank_unpad (countries.zones_in_country[i]);
+ right_blank_unpad (countries.country_name[i]);
+ right_blank_unpad (countries.country_abv[i]);
+ right_blank_unpad (countries.country_syn[i]);
+ right_blank_unpad (countries.continent_abv[i]);
+ right_blank_unpad (countries.zones_in_country[i]);
}
for(i=0; i<=notc; i++)
{
@@ -491,16 +461,16 @@
for(k=j; k<=n; k++)
{
strcpy(countries.country_name[k],
- countries.country_name[k+1]);
+ countries.country_name[k+1]);
strcpy(countries.country_abv[k],
- countries.country_abv[k+1]);
+ countries.country_abv[k+1]);
strcpy(countries.country_syn[k],
- countries.country_syn[k+1]);
+ countries.country_syn[k+1]);
strcpy(countries.continent_abv[k],
- countries.continent_abv[k+1]);
+ countries.continent_abv[k+1]);
strcpy(countries.zones_in_country[k],
- countries.zones_in_country[k+1]);
- countries.country_lat[k] = countries.country_lat[k+1];
+ countries.zones_in_country[k+1]);
+ countries.country_lat[k] = countries.country_lat[k+1];
countries.country_long[k] = countries.country_long[k+1];
}
n--;
@@ -557,19 +527,14 @@
fp = fopen(clib.filnam, "r");
if(fp==NULL)
{
- strcpy(msg, "Error reading ");
- strcat(msg, clib.filnam);
+ snprintf(msg, sizeof(msg), "Error reading %s", clib.filnam);
rw_error_box (main_drawing_area, msg);
return;
}
soli = sizeof(line_in);
- for( ; ; )
+ while(fgets(line_in, soli, fp) != NULL)
{
- fgets(line_in, soli, fp);
- if(feof(fp)) break;
- lcil = strlen(line_in);
- if(line_in[lcil-1]=='\n') line_in[lcil-1] = '\0';
- if(line_in[lcil-2]=='\r') line_in[lcil-2] = '\0';
+ chomp(line_in);
right_blank_pad (line_in, soli);
lcil = strlen(line_in);
n++;
@@ -595,9 +560,9 @@
fclose(fp);
for(i=0; i<=n; i++)
{
- right_blank_unpad (clib.call[i]);
- right_blank_unpad (clib.country[i]);
- right_blank_unpad (clib.section[i]);
+ right_blank_unpad (clib.call[i]);
+ right_blank_unpad (clib.country[i]);
+ right_blank_unpad (clib.section[i]);
right_blank_unpad (clib.county[i]);
}
clib.number_of_calls = n+1;
@@ -606,7 +571,6 @@
static void read_help_file(void)
{
FILE *fp;
- gint lcil, soli;
gchar filnam[13], msg[49];
gchar line_in[80];
gint n=-1;
@@ -622,19 +586,13 @@
fp = fopen(filnam, "r");
if(fp==NULL)
{
- strcpy(msg, "Error reading ");
- strcat(msg, filnam);
+ snprintf(msg,sizeof(msg), "Error reading %s",filnam);
rw_error_box (main_drawing_area, msg);
return;
}
- soli = sizeof(line_in);
- for( ; ; )
+ while(fgets(line_in, sizeof(line_in), fp) != NULL)
{
- fgets(line_in, soli, fp);
- if(feof(fp)) break;
- lcil = strlen(line_in);
- if(line_in[lcil-1]=='\n') line_in[lcil-1] = '\0';
- if(line_in[lcil-2]=='\r') line_in[lcil-2] = '\0';
+ chomp(line_in);
n++;
strcpy(helpbv.help_lines[n], line_in);
}
@@ -652,13 +610,10 @@
fp = fopen(filnam, "w");
if(fp==NULL)
{
- strcpy(msg, "Error writing ");
- strcat(msg, filnam);
+ snprintf(msg,sizeof(msg),"Error writing %s",filnam);
rw_error_box (main_drawing_area, msg);
return;
}
-// fflush(fp);
-// fsync(fileno(fp));
fclose(fp);
}
@@ -672,11 +627,7 @@
concat(filnam_hold, filnam, 0, idot-1, COPY);
else
strcpy(filnam_hold, filnam);
- strcpy(msg, "cp ");
- strcat(msg, filnam);
- strcat(msg, " ");
- strcat(msg, filnam_hold);
- strcat(msg, ".BAK");
+ snprintf(msg, sizeof(msg), "cp %s %s.BAK",filnam,filnam_hold);
icopy = system(msg);
return icopy;
}
@@ -687,13 +638,11 @@
gchar filnam[13], msg[49], contest_ini_line[76];
gint i;
- strcpy(filnam, contest_file_base);
- strcat(filnam, ".INI");
+ snprintf(filnam, sizeof(filnam), "%s.INI", contest_file_base);
fp = fopen(filnam, "w");
if(fp==NULL)
{
- strcpy(msg, "Error writing ");
- strcat(msg, filnam);
+ snprintf(msg, sizeof(msg), "Error writing %s", filnam);
rw_error_box (main_drawing_area, msg);
return;
}
@@ -703,8 +652,7 @@
left_blank_unpad(contest_ini_line);
strcat(contest_ini_line, ":");
strcat(contest_ini_line, init_screen_choices[i]);
- add_eol_chars (contest_ini_line);
- fputs(contest_ini_line, fp);
+ fprintf(fp,"%s\n",contest_ini_line);
}
for(i=0; i<MAX_SET_ITEMS; i++)
{
@@ -712,8 +660,7 @@
left_blank_unpad(contest_ini_line);
strcat(contest_ini_line, ":");
strcat(contest_ini_line, set_screen_choices[i]);
- add_eol_chars (contest_ini_line);
- fputs(contest_ini_line, fp);
+ fprintf(fp,"%s\n",contest_ini_line);
}
for(i=0; i<MAX_KEYER_ITEMS; i++)
{
@@ -721,8 +668,7 @@
left_blank_unpad(contest_ini_line);
strcat(contest_ini_line, ":");
strcat(contest_ini_line, keyer_screen_choices[i]);
- add_eol_chars (contest_ini_line);
- fputs(contest_ini_line, fp);
+ fprintf(fp,"%s\n",contest_ini_line);
}
fflush(fp);
fsync(fileno(fp));
@@ -738,8 +684,7 @@
fp = fopen(filnam, "a");
if(fp==NULL)
{
- strcpy(msg, "Error writing ");
- strcat(msg, filnam);
+ snprintf(msg, sizeof(msg), "Error writing %s", filnam);
rw_error_box (main_drawing_area, msg);
return;
}
@@ -757,21 +702,18 @@
FILE *fp;
gchar filnam[13], msg[49], contest_line[76];
- strcpy(filnam, contest_file_base);
- strcat(filnam, ".DED");
+ snprintf(filnam, sizeof(filnam), "%s.DED", contest_file_base);
fp = fopen(filnam, "a");
if(fp==NULL)
{
- strcpy(msg, "Error writing ");
- strcat(msg, filnam);
+ snprintf(msg, sizeof(msg), "Error writing %s",filnam);
rw_error_box (main_drawing_area, msg);
return;
}
strcpy(contest_line, cmd);
- add_eol_chars (contest_line);
- fputs(contest_line, fp);
+ fprintf(fp,"%s\n",contest_line);
make_contest_line (contest_line, qnum);
- fputs(contest_line, fp);
+ fprintf(fp, "%s\n", contest_line);
fflush(fp);
fsync(fileno(fp));
fclose(fp);
@@ -789,8 +731,7 @@
fp = fopen(filnam, "w");
if(fp==NULL)
{
- strcpy(msg, "Error writing ");
- strcat(msg, filnam);
+ snprintf(msg, sizeof(msg), "Error writing %s", filnam);
rw_error_box (main_drawing_area, msg);
return;
}
@@ -813,8 +754,7 @@
fp = fopen(clib.filnam, "w");
if(fp==NULL)
{
- strcpy(msg, "Error writing ");
- strcat(msg, clib.filnam);
+ snprintf(msg, sizeof(msg),"Error writing %s",clib.filnam);
rw_error_box (main_drawing_area, msg);
return;
}
@@ -856,8 +796,7 @@
strcat(library_line, " ");
strcat(library_line, clib.check[9999]);
right_blank_unpad(library_line);
- add_eol_chars (library_line);
- fputs(library_line, fp);
+ fprintf(fp,"%s\n",library_line);
}
fflush(fp);
fsync(fileno(fp));
@@ -867,24 +806,35 @@
static gint process_tmp_file(const gchar *filnam)
{
FILE *fp;
+ FILE *pfp;
gchar filnam_hold[14], psc_line[81], system_line[41];
gint ami_running=-1;
- strcpy(filnam_hold, filnam);
- strcat(filnam_hold, ".tmp");
- strcpy(system_line, "ps -C ");
- strcat(system_line, filnam);
- strcat(system_line, " | sort > ");
- strcat(system_line, filnam_hold);
- system(system_line);
- fp = fopen(filnam_hold, "r");
- if(fp!=NULL)
+ snprintf(system_line, sizeof(system_line) - 1, "ps|grep %s|grep -v grep",
+ filnam);
+ pfp = popen(system_line, "r");
+ if(pfp!=NULL)
{
- fgets(psc_line, sizeof(psc_line), fp);
+ fgets(psc_line, sizeof(psc_line), pfp);
if(kb_index (psc_line, filnam)>-1)
ami_running = 0;
- fclose(fp);
- remove(filnam_hold);
+ fclose(pfp);
}
return ami_running;
}
+
+static char*
+chomp(char *s)
+{
+ char *p;
+
+ p = strchr(s, '\n');
+ if (p != NULL)
+ {
+ *p = '\0';
+ p--;
+ if (*p == '\r')
+ *p = '\0';
+ }
+}
+

View file

@ -1,32 +0,0 @@
--- kb.c.orig 2007-09-10 14:58:04.000000000 -0400
+++ kb.c 2007-11-24 14:46:35.000000000 -0500
@@ -1,7 +1,12 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>
+#endif
+#ifndef BSD
#include <sys/io.h>
+#endif
#include <stdlib.h>
#include <time.h>
#include <string.h>
@@ -3090,10 +3095,14 @@
gtk_key_snooper_install (kp_snooper, drawing_area);
+#ifdef __FreeBSD__
+ fd_bells = open("/dev/speaker", O_RDWR);
+#else
fd_bells = open("/dev/kb_bells", O_RDWR);
+#endif
g_thread_init (NULL);
gtk_main ();
- close(fd_bells);
-
+ if(fd_bells > 0)
+ close(fd_bells);
return 0;
}

View file

@ -1,86 +1,50 @@
--- 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);
}
--- support.c.orig 2008-03-30 09:31:55.000000000 -0400
+++ support.c 2008-05-14 08:05:30.000000000 -0400
@@ -4,7 +4,11 @@
#include <signal.h>
+#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
#ifdef BSD
+#ifdef OLDSPKR
+#include <machine/speaker.h>
+#else
+ ioctl(fd_bells, _IO(KB_BELLS_IOCTL_BASE, isound));
#include <dev/speaker/speaker.h>
+#endif
}
#include "bsd_bells.c"
#endif
static void get_kb_time(void)
@@ -189,25 +203,8 @@
static void fill_kb_dt(void)
@@ -1199,31 +1203,21 @@
static gint get_running_pid(const gchar *filnam)
{
- 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);
FILE *fp;
- gchar filnam_hold[14], psc_line[81], system_line[41];
+ gchar psc_line[81], system_line[41];
gint ami_running=-1;
- strcpy(filnam_hold, filnam);
- strcat(filnam_hold, ".tmp");
#ifdef BSD
- strcpy(system_line, "ps | grep ");
- strcat(system_line, filnam);
- strcat(system_line, " | grep -v grep > ");
- strcat(system_line, filnam_hold);
+ sprintf(system_line, "ps | grep %s | grep -v grep", filnam);
#else
- strcpy(system_line, "ps -C ");
- strcat(system_line, filnam);
- strcat(system_line, " | sort > ");
- strcat(system_line, filnam_hold);
+ sprintf(system_line, "ps -C | grep %s | sort", filnam);
#endif
- system(system_line);
- fp = fopen(filnam_hold, "r");
+ fp = popen(system_line, "r");
if(fp!=NULL)
{
fgets(psc_line, sizeof(psc_line), fp);
if(kb_index (psc_line, filnam)>-1)
ami_running = atoi(psc_line);
fclose(fp);
- remove(filnam_hold);
}
return ami_running;
}
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)
{

View file

@ -1,8 +0,0 @@
kb is now installed.
If you want the speaker bell to work, make sure you add
speaker_load="YES" to /boot/loader.conf if your kernel
does not have speaker support. You will also need to modify
/etc/devfs.conf to add permission for users to use the speaker.
...
perm speaker 0660
...

View file

@ -1,7 +1,6 @@
bin/kb
bin/kb_bin
sbin/kb_server
etc/rc.d/kbserver
bin/kb_server
%%DATADIR%%/CALL_FD.LST
%%DATADIR%%/CALL_LIB.LST
%%DATADIR%%/CALL_SS.LST
@ -12,4 +11,14 @@ etc/rc.d/kbserver
%%DATADIR%%/HELPFD.LST
%%DATADIR%%/SECTION.LST
%%DATADIR%%/STATE.LST
share/pixmaps/kb/icons/kb-icon.png
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/README_BSD
%%PORTDOCS%%%%DOCSDIR%%/README_KINKS
%%PORTDOCS%%%%DOCSDIR%%/README_SRC
%%PORTDOCS%%%%DOCSDIR%%/README_TIPS
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm share/pixmaps/kb/icons
@dirrm share/pixmaps/kb
@dirrm %%DATADIR%%