Compare commits

..

95 Commits

Author SHA1 Message Date
Sebastien Van Cauwenberghe 9a1e8769ab Add EOT message
When program keeps running, the ### EOT message allows the user
to know that the stdin has been fully transmitted.
2017-02-16 14:05:31 -08:00
Kamal Mostafa d4ce82136d tests: use cmp not md5sum for tx-consistency tests
OS X doesn't provide md5sum.
https://github.com/kamalmostafa/minimodem/issues/24#issuecomment-213816836
2016-04-24 09:40:29 -07:00
Kamal Mostafa 17e17b784e minimodem-0.24-1 2016-04-23 11:22:32 -07:00
Kamal Mostafa fc03264643 debian: bump standards-version=3.9.7 and debhelper-compat-version=9 2016-04-23 11:22:00 -07:00
Kamal Mostafa ea3f837c90 Fix --tx float consistency: disable .wav "PEAK chunk" header
Fixes: tests/17-verify-tx-consistent-float.test

This might also relate to:
https://github.com/kamalmostafa/minimodem/issues/24
2016-04-23 10:34:35 -07:00
Kamal Mostafa 78cff1778b tests: verify --tx consistency
PASS: 16-verify-tx-consistent.test
FAIL: 17-verify-tx-consistent-float.test

The FAIL is due inconsistency in the .wav header (only for floats)
constructed by libsndfile -- its different every wall-clock second.
Even just a bare header (no audio samples) shows the effect:

  minimodem --float-samples --tx 1000 -f /tmp/xx.wav </dev/null
  sum -r /tmp/xx.wav
  sleep 1
  minimodem --float-samples --tx 1000 -f /tmp/xx.wav </dev/null
  sum -r /tmp/xx.wav

This might also relate to:
https://github.com/kamalmostafa/minimodem/issues/24
2016-04-23 10:24:13 -07:00
Kamal Mostafa c2e4d9e1c4 Do not emit 0.5 sec flush for audio file output 2016-04-17 09:49:27 -07:00
Chris Osborn 513a11d454 Limit carrier/idle generation for input with delays
For non-interactive output (writing to an audio file), generate the
idle output carrier for same duration that the input is idle.  Makes
this case generate an output .wav file of just over 1 second duration:

  { echo hello; sleep 1; echo world; } | minimodem --tx -f /tmp/xx.wav 300
2016-04-17 08:49:36 -07:00
Kamal Mostafa 84b2406b97 Rename tv_idletimeout (no functional change) 2016-04-17 08:43:32 -07:00
Kamal Mostafa ad83ef5df3 Refactor emit idle tone (no functional change)
Clean up the "emit idle tone" code, which should never have involved
tx_leader_bits_len (that was a copy-paste laziness).

"Emit idle tone" simply generates the idle tone for a hardcoded period
of time now codified as 'idle_tone_usec' and set to 1/25 of a second
(to match the existing behavior).
2016-04-13 09:41:20 -07:00
Colin Ian King 96a60f51b0 initialize ampl_out to avoid it containing garbage
static analysis from clang scan-build detected some paths
in the call to fsk_frame_analyze where ampl_out is not being
set:

fsk.c:493:13: warning: Assigned value is garbage or undefined
            best_a = ampl_out;

..probably the sanest approach here is to initialize it to 0.0
just to avoid it being garbage rather than setting it to zero in
the failed error paths in fsk_frame_analyze.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
2016-03-21 12:42:30 -07:00
Colin Ian King 2d3bd487ca Fix the final few printf format specifiers in fsk.c
Signed-off-by: Colin Ian King <colin.king@canonical.com>
2016-03-21 12:42:30 -07:00
Colin Ian King 7397c3cd9b Fix build warnings about ternary operator precedence
Be more explicit with parenthesis to avoid any possibly confusion
about operator precendence.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
2016-03-21 12:42:29 -07:00
Colin Ian King d6a616fff8 Use %td for ptrdiff_t printf format specifier
Signed-off-by: Colin Ian King <colin.king@canonical.com>
2016-03-21 12:42:29 -07:00
Colin Ian King 632e92f1ae Use %u printf format specifier for unsigned int
Signed-off-by: Colin Ian King <colin.king@canonical.com>
2016-03-21 12:42:29 -07:00
Kamal Mostafa 93b35cbd9d baudot_charset: fix compile warning
Thanks to Colin Ian King <colin.king@canonical.com>.
2016-03-21 12:42:29 -07:00
Kamal Mostafa 3a8d490074 fix harmless strncasecmp off-by-one 2016-02-20 07:02:09 -08:00
Kamal Mostafa bc794806db minimodem-0.23-1 2016-02-19 13:14:29 -08:00
Kamal Mostafa 37bf388038 fix configure.ac version macro glitch 2016-02-19 13:04:28 -08:00
Kamal Mostafa f801ae3f28 update copyright dates 2016 2016-02-19 12:29:58 -08:00
Kamal Mostafa 842c1923e2 trim tests/testdata-ascii.txt
Remove confusing old copy of README.
2016-02-19 12:29:21 -08:00
Kamal Mostafa 6e22843115 add TTY/TDD to README 2016-02-19 12:28:11 -08:00
Kamal Mostafa 4b3301a7ef TTY/TDD self-test and man page entry 2016-01-21 13:20:48 -08:00
Rodrigo Menezes f48257ac59 TTY/TDD support 2016-01-20 10:07:21 -08:00
Kevin Zheng a23c5c73be Clean up configure script 2015-12-22 12:09:51 -06:00
Kevin Zheng 40c1f4c35c Fix bash-isms in configure script 2015-12-22 12:07:51 -06:00
Kamal Mostafa 0555866e57 minimodem-0.22.1-1 2015-08-24 13:55:27 -07:00
Kamal Mostafa 2b5e2c6a40 Do not enable tx-carrier for non-interactive --file sessions
The logic that determined whether to 'block_input' was backwards with
respect to non-interactive --file sessions, such that using --file
*enabled* the tx-carrier behavior when it should have disabled it.
This went unnoticed because on reasonably fast systems, reading the
input data from the file never induce the timeout anyway -- only very
slow machines reveal the problem: long gaps of 'mark' between each
frame, as if each input character was slowly typed interactively.

Fixes: ecebf01 Add ability to output a carrier while waiting for data
2015-08-24 13:54:34 -07:00
Kamal Mostafa 6d9b4d2e0c minimodem-0.22-1 2015-08-23 10:42:47 -07:00
Kamal Mostafa 639b695f31 eliminate all instances of implicit double-promotion 2015-08-23 10:16:15 -07:00
Kamal Mostafa d002c60a92 appease clang self-assignment warning 2015-08-23 09:12:34 -07:00
Kamal Mostafa ed8e633af0 fix non-integer mark/space frequency handling 2015-08-23 09:00:40 -07:00
Kamal Mostafa 17adb2158f clean up autoconf config files 2015-08-23 08:29:12 -07:00
Kevin Zheng 2020b4c2bf Untrack automatically generated files 2015-08-23 08:19:41 -07:00
Kamal Mostafa 2953cdcd8a add Nick Moriarty to AUTHORS 2015-04-22 16:58:44 -07:00
Nick Moriarty 8915ce1525 Fix ALSA latency (causing ALSA not to block).
With arbitrarily large latency setting (unsigned int)-1, ALSA will happily
accept all the samples we want to throw at it.

Reducing to a reasonably long (but still sub-second) value of 100ms, we
cause ALSA writes to block and work properly with --tx-carrier.
2015-04-22 17:48:28 +01:00
Nick Moriarty ecebf013f0 Add ability to output a carrier while waiting for data
Added --tx-carrier, which continues to output a tone while a blocking source
waits for more data on stdin.
2015-04-22 17:48:28 +01:00
Kamal Mostafa 49bfa06f8e minimodem: --binary-raw {nbits} output mode 2015-04-21 14:01:03 -07:00
Kamal Mostafa 1439efa68d minimodem-0.21-1 2014-11-24 08:37:09 -08:00
Kamal Mostafa 2ae79d8a5b man: add uic-train and uic-ground modes 2014-11-16 13:02:59 -08:00
Kamal Mostafa 3b54fa7768 add Marcos Vives Del Sol to AUTHORS and debian/copyright 2014-11-16 12:46:14 -08:00
Kamal Mostafa ff47edfb68 minimodem: accept "uic*" for uic-ground 2014-11-16 12:46:14 -08:00
Marcos Vives Del Sol 532bcfb84c Honor --invert-start-stop in TX 2014-11-16 12:46:14 -08:00
Marcos Vives Del Sol 25d01f73d8 Add UIC-751-3 decoding and optional MSB-first TX/RX
[ kamal: cleanup ]
2014-11-16 12:46:14 -08:00
Marcos Vives Del Sol ff0346f5a8 Really use 64 data types for demodulation
[ kamal: cleanup ]
2014-11-16 12:46:14 -08:00
Kamal Mostafa 2cdf2d29e4 build_expect_bits_string cleanup 2014-11-16 12:46:14 -08:00
Marcos Vives Del Sol bbf121a63f Compute expected bit strings outside of main loop 2014-11-16 12:46:14 -08:00
Marcos Vives Del Sol 163af2539c Add Windows executable to gitignore 2014-11-16 12:46:13 -08:00
Marcos Vives Del Sol cc6b5c9123 Change code to use 64-bit variables for decoding 2014-11-16 12:46:13 -08:00
Marcos Vives Del Sol 909adf0d59 Add option to change start-stop polarity 2014-11-16 12:46:13 -08:00
Kamal Mostafa 40f1d50cbd fsk: calc separate divergences for mark and space bits
Calculate and consider separate signal-strength divergence values for
mark and space bits, so that imbalanced (but consistent) mark/space
strengths do not drive down confidence.

Note: This change makes all existing test cases yield very slightly
higher confidence values.
2014-11-16 11:00:36 -08:00
Kamal Mostafa 746f0f6c7a minimodem: free samplebuf to appease valgrind 2014-11-14 09:12:27 -08:00
Kamal Mostafa eaf229ea5e minimodem-0.20-1 2014-11-13 11:08:29 -08:00
Kamal Mostafa d3a6fd1f26 debian/control: move Vcs- fields to github; bump S-V to 3.9.6 2014-11-13 11:08:29 -08:00
Kamal Mostafa ba5ecec2f7 update copyright dates 2014 2014-11-13 10:56:31 -08:00
Kamal Mostafa 84cfb3ad67 autoreconf (automake 1.14.1) 2014-11-13 10:56:31 -08:00
Kamal Mostafa 8401f038e6 fix tests/ harness for automake 1.13
See http://osdir.com/ml/bug-automake-gnu/2013-06/msg00010.html
2014-11-09 10:34:00 -08:00
Kamal Mostafa 8c9484a738 callerid: handle name and phone '[N/A]' or '[blocked]' 2014-11-08 10:30:07 -08:00
Kamal Mostafa a6a7e0da35 callerid: warn when used with --auto-carrier 2014-11-08 09:27:31 -08:00
Billseph Gamesh 2a37e24964 callerid: fix MDMF decode when 0x08 (Name N/A) field is encountered
Off-by-one comparison caused any MDMF packet with an 0x08 field to
get junked.
2014-11-08 08:51:12 -08:00
David A Aitcheson a126663220 man: fix url to wikipedia SAME page
Prevent groff from botching this embedded URL when it generates
minimodem.1.html.
2014-11-04 07:46:14 -08:00
Kamal Mostafa 3c5ac8819d simpleaudio: do not crash on stereo input file
Complain about non-mono input audio files instead of crashing.
Thanks goblin@github for the report.

GitHub: fixes kamalmostafa/minimodem#1
2014-03-18 15:01:05 -07:00
Kamal Mostafa 3c227b516a minimodem-0.19-1 2013-09-18 09:11:36 -07:00
Kamal Mostafa 151e360720 minimodem: -7 implements 7-bit ASCII 2013-09-17 07:56:20 -07:00
Kamal Mostafa a524e38222 minimodem: fix --baudot cmdline switch
The --baudot (a.k.a. -5) command line switch didn't actually engage
the Baudot encoder/decoder, just set 5 bits per frame.
2013-09-05 15:36:49 -07:00
Kamal Mostafa d51803bc69 minimodem-0.18-1 2013-06-10 09:29:26 -07:00
Kamal Mostafa f9bdf43423 update copyright dates 2013-06-10 09:28:02 -07:00
Kamal Mostafa 31f8af5056 debian/control: enable Vcs- fields 2013-06-10 09:05:29 -07:00
Kamal Mostafa 0140e0df12 minimodem: --tx SAME emits 16 sync-byte preamble
Emit a preamble of 16 (hardcoded) sync-bytes if --sync-byte is
specified with --tx mode.  This makes --tx SAME emit the required
preamble of 16 0xAB's automatically.  So --rx SAME now directly
decodes the output of --tx SAME without needing to manually inject
the preamble byte(s), simplifying the test case.

Thanks to Harold Giddings, for reporting the issue.
2013-06-08 10:16:56 -07:00
Kamal Mostafa 24f1acff4f minimodem: fsk_transmit_frame factored out 2013-06-08 10:04:06 -07:00
Kamal Mostafa 8876f6674a minimodem: rename bfsk_sync_on_data to bfsk_do_rx_sync 2013-06-08 09:27:01 -07:00
Kamal Mostafa 9e741dd474 minimodem-0.17.1-1 2013-03-21 13:08:35 -07:00
Kamal Mostafa d98d0d6387 (portability) link with -lm explicitly
We need to explicitly link with -lm since we actually call lroundf() and sin().
2013-03-21 13:04:35 -07:00
Kamal Mostafa c25545951f minimodem-0.17-1 2013-03-20 12:10:37 -07:00
Kamal Mostafa d774ad74dd minimodem: handle arbitrary --startbits N
minimodem --startbits N works for rx and tx, where (0 <= N <= 20).

Thanks Martyn (kronalias), for reporting.
2013-03-20 12:08:52 -07:00
Kamal Mostafa b76b5a3fa3 minimodem-0.16.1-1 2013-01-25 15:09:47 -08:00
Kamal Mostafa 7ab18a268f minimodem: do not call setitimer(new_value=NULL)
Linux kernel warns:

    minimodem calls setitimer() with new_value NULL pointer. Misfeature support
    will be removed

Thanks Robert Hooker, for reporting.
2013-01-25 15:03:54 -08:00
Kamal Mostafa 1f74732147 minimodem-0.16-1 2012-11-03 14:32:40 -07:00
Kamal Mostafa 9d3200ca60 autoreconf 2012-11-03 14:28:47 -07:00
Kamal Mostafa 032d0bb79c minimodem: refine frame position if confidence falls
Allows for more accurate tracking, esp. for no-frame-bits protocols.
Fixes tests/test-80-SAME-datastream.
2012-11-03 14:20:33 -07:00
Kamal Mostafa 4709b5d146 tests: 80-SAME-datastream 2012-11-03 14:15:53 -07:00
Kamal Mostafa 1446844d32 minimodem: do not transmit leader tone if no start bits 2012-11-03 14:10:44 -07:00
Kamal Mostafa c2fa2dae93 fsk: fix FSK_DEBUG character decode 2012-11-03 13:26:10 -07:00
Kamal Mostafa 6ad778ce03 minimodem: fix --tx startbits/stopbits handling
Make --tx support specified --startbits and --stopbits; also enables --tx SAME.

Thanks to Jamie Batmanglidj for reporting the issue.
2012-11-01 12:48:40 -07:00
Kamal Mostafa 83f8c7cbdd minimodem-0.15.1-1 2012-10-16 18:11:21 -07:00
Kamal Mostafa 7fed380d0a callerid: do not use recursive call to reset
Testing by Mike Tedesco shows the recursive databits_decode_callerid()
seems to break on OS X (only); I don't see why it should.  Avoid the
issue by not making a recursive call.
2012-10-16 18:02:21 -07:00
Kamal Mostafa 93bf08f750 callerid: fix parser - do not store noise bytes 2012-10-10 10:05:51 -07:00
Kamal Mostafa 5e28a8026f minimodem-0.15-1 2012-10-05 20:16:44 -07:00
Kamal Mostafa 1a60f1c12d update README text 2012-10-05 20:07:23 -07:00
Kamal Mostafa 65493fa12a minimodem: --rx callerid
New "callerid" baudmode supports Bell202 Caller-ID (MDMF or SDMF) prototol.
2012-10-05 19:40:17 -07:00
Kamal Mostafa 49ccd10e1f minimodem: --rx prints all bytes unmolested, unless --print-filter
Now, minimodem prints all received bytes without isprint() filtering,
unless --print-filter is specified.  Allows for binary file transfers
and multibyte characters.
2012-10-05 13:29:30 -07:00
Kamal Mostafa ead6952a58 (portability) simple-tone-generator.c needs stdio.h 2012-10-04 18:13:23 -07:00
Mike Tedesco 577b84d7f2 (portability) use stdlib.h not malloc.h 2012-10-04 18:10:33 -07:00
Mike Tedesco d8f7601b4f (portability) simpleaudio.c needs stdio.h 2012-10-04 18:08:31 -07:00
Kamal Mostafa 761cf00b16 minimodem: handle SIGINT on --rx: close the sa backend and print stats 2012-10-02 14:22:38 -07:00
78 changed files with 1419 additions and 9940 deletions

10
.gitignore vendored
View File

@ -1,7 +1,17 @@
*.o *.o
.deps .deps
Makefile Makefile
Makefile.in
/aclocal.m4
/autom4te.cache/
/compile
/config.h.in
/config.h /config.h
/config.log /config.log
/config.status /config.status
/configure
/depcomp
/install-sh
/missing
/stamp-h1 /stamp-h1
/test-driver

View File

@ -1 +1,3 @@
Kamal Mostafa <kamal@whence.com> Kamal Mostafa <kamal@whence.com>
Marcos Vives Del Sol <socram8888@gmail.com> [ UIC-751-3 mode ]
Nick Moriarty <njmoriarty@gmail.com> [ --tx-carrier feature ]

View File

@ -1,5 +1,5 @@
minimodem - software audio Bell-type or RTTY FSK modem minimodem - software audio Bell-type or RTTY FSK modem
Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com> Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

View File

@ -1,700 +0,0 @@
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
THANKS depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPS_CFLAGS = @DEPS_CFLAGS@
DEPS_LIBS = @DEPS_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src tests
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
ctags-recursive install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

16
README
View File

@ -1,10 +1,14 @@
minimodem - software audio Bell-type or RTTY FSK modem minimodem - general-purpose software audio FSK modem
Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com> Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
Minimodem is a command-line program which generates (or decodes) audio Minimodem is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, emulating an old Bell-type or modem tones at any specified baud rate, using various framing protocols.
radio-teletype FSK modem. The tones can be played to (or recorded from) It acts a general-purpose software FSK modem, and includes support for
the system audio (PulseAudio or ALSA) or to an audio file. various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.
Minimodem can play and capture audio modem tones in real-time via the
system audio device, or in batched mode via audio files.
Minimodem can be used to transfer data between nearby computers using an Minimodem can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using audio cable (or just via sound waves), or between remote computers using

5
THANKS
View File

@ -26,6 +26,11 @@ and hardware relating to the S.A.M.E. protocol.
Thanks Chris! Thanks Chris!
Mike Tedesco <mike.tedesco@venturesoft.com> provided encouragement and
testing for the Caller-ID protocol handling, and portability fixes for OS X.
Thanks Mike!
My employer Canonical, Ltd. for encouraging me to spend time developing My employer Canonical, Ltd. for encouraging me to spend time developing
and maintaining this and other open-source projects. Thanks, Canonical! and maintaining this and other open-source projects. Thanks, Canonical!

1131
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 to enable ALSA support */
#undef USE_ALSA
/* Define to 1 to enable internal benchmarks */
#undef USE_BENCHMARKS
/* Define to 1 to enable pulseaudio support */
#undef USE_PULSEAUDIO
/* Define to 1 to enable sndfile support */
#undef USE_SNDFILE
/* Version number of package */
#undef VERSION

5090
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +1,79 @@
dnl
dnl configure.ac Generated by project-setup
dnl
AC_DEFUN([PKG_NAME], [minimodem])
AC_DEFUN([PKG_VERSION], [0.14])
AC_DEFUN([PKG_AUTHOR], [Kamal Mostafa <kamal@whence.com>])
AC_DEFUN([PKG_BUGS_TO], [kamal@whence.com])
AC_PREREQ([2.64]) AC_PREREQ([2.64])
AC_INIT([minimodem], [0.24], [kamal@whence.com])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/Makefile.in])
AM_INIT_AUTOMAKE
AC_INIT(PKG_NAME, PKG_VERSION, PKG_BUGS_TO) VERSION=AC_PACKAGE_VERSION
dnl Release versioning info
VERSION=PKG_VERSION
AC_SUBST(VERSION) AC_SUBST(VERSION)
AM_INIT_AUTOMAKE # Program Checks
AC_CONFIG_SRCDIR([src/Makefile.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC AC_PROG_CC
# AC_PROG_RANLIB
# Library Checks
AC_SEARCH_LIBS([lroundf], [m])
# Configure dependency libs deps_packages="fftw3f"
# fftw3f
deps_packages+=" fftw3f"
# ALSA # ALSA
AC_ARG_WITH([alsa], AC_ARG_WITH([alsa], [AS_HELP_STRING([--without-alsa],
AS_HELP_STRING([--without-alsa], [build without ALSA support])) [build without ALSA support])])
AS_IF([test "x$with_alsa" == "xno"], AS_IF([test "x$with_alsa" == "xno"], [
# then use_alsa=0
use_alsa=0, ], [
# else use_alsa=1
use_alsa=1 deps_packages="$deps_packages alsa"
deps_packages+=" alsa") ])
AC_DEFINE_UNQUOTED(USE_ALSA, $use_alsa, AC_DEFINE_UNQUOTED([USE_ALSA], [$use_alsa],
[Define to 1 to enable ALSA support]) [Define to 1 to enable ALSA support])
# pulseaudio # pulseaudio
AC_ARG_WITH([pulseaudio], AC_ARG_WITH([pulseaudio], AS_HELP_STRING([--without-pulseaudio],
AS_HELP_STRING([--without-pulseaudio], [build without pulseaudio support])) [build without pulseaudio support]))
AS_IF([test "x$with_pulseaudio" == "xno"], AS_IF([test "x$with_pulseaudio" == "xno"], [
# then use_pulseaudio=0
use_pulseaudio=0, ], [
# else use_pulseaudio=1
use_pulseaudio=1 deps_packages="$deps_packages libpulse-simple"
deps_packages+=" libpulse-simple") ])
AC_DEFINE_UNQUOTED(USE_PULSEAUDIO, $use_pulseaudio, AC_DEFINE_UNQUOTED([USE_PULSEAUDIO], [$use_pulseaudio],
[Define to 1 to enable pulseaudio support]) [Define to 1 to enable pulseaudio support])
# sndfile # sndfile
AC_ARG_WITH([sndfile], AC_ARG_WITH([sndfile], AS_HELP_STRING([--without-sndfile],
AS_HELP_STRING([--without-sndfile], [build without sndfile support])) [build without sndfile support]))
AS_IF([test "x$with_sndfile" == "xno"], AS_IF([test "x$with_sndfile" == "xno"], [
# then use_sndfile=0
use_sndfile=0, ], [
# else use_sndfile=1
use_sndfile=1 deps_packages="$deps_packages sndfile"
deps_packages+=" sndfile") ])
AC_DEFINE_UNQUOTED(USE_SNDFILE, $use_sndfile, AC_DEFINE_UNQUOTED([USE_SNDFILE], [$use_sndfile],
[Define to 1 to enable sndfile support]) [Define to 1 to enable sndfile support])
# benchmarks # benchmarks
AC_ARG_WITH([benchmarks], AC_ARG_WITH([benchmarks], AS_HELP_STRING([--disable-benchmarks],
AS_HELP_STRING([--disable-benchmarks], [build without internal benchmarks])) [build without internal benchmarks]))
AS_IF([test "x$with_benchmarks" == "xno"], AS_IF([test "x$with_benchmarks" == "xno"], [
# then use_benchmarks=0
use_benchmarks=0, ], [
# else use_benchmarks=1
use_benchmarks=1) ])
AC_DEFINE_UNQUOTED(USE_BENCHMARKS, $use_benchmarks, AC_DEFINE_UNQUOTED([USE_BENCHMARKS], [$use_benchmarks],
[Define to 1 to enable internal benchmarks]) [Define to 1 to enable internal benchmarks])
AC_MSG_RESULT([ AC_MSG_RESULT([
PKG_NAME PKG_VERSION configuration summary: option summary:
--with-pulseaudio $with_pulseaudio ($use_pulseaudio) alsa $with_alsa ($use_alsa)
--with-alsa $with_alsa ($use_alsa) benchmarks $with_benchmarks ($use_benchmarks)
--with-sndfile $with_sndfile ($use_sndfile) pulseaudio $with_pulseaudio ($use_pulseaudio)
--with-benchmarks $with_benchmarks ($use_benchmarks) sndfile $with_sndfile ($use_sndfile)
deps_packages: $deps_packages
]) ])
# Checks for libraries. # Checks for libraries.
PKG_CHECK_MODULES(DEPS, [ $deps_packages ]) PKG_CHECK_MODULES(DEPS, [$deps_packages])
AC_SUBST(DEPS_CFLAGS) AC_SUBST([auto_find_tests], ['$(sort $(wildcard *.test))'])
AC_SUBST(DEPS_LIBS)
# Checks for header files. AC_CONFIG_FILES([Makefile src/Makefile src/minimodem.1 tests/Makefile])
# AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
# AC_HEADER_STDBOOL
# AC_TYPE_PID_T
# Checks for library functions.
# AC_FUNC_FORK
AC_CONFIG_FILES([
Makefile
src/Makefile
src/minimodem.1
tests/Makefile
])
# testdata/Makefile
AC_OUTPUT AC_OUTPUT

134
debian/changelog vendored
View File

@ -1,3 +1,137 @@
minimodem (0.24-1) unstable; urgency=medium
[ Chris Osborn ]
* Limit carrier/idle generation for input with delays
[ Kamal Mostafa ]
* Fix --tx float consistency: disable .wav "PEAK chunk" header
* Do not emit 0.5 sec flush for audio file output
* debian: bump standards-version=3.9.7 and debhelper-compat-version=9
[ Colin Ian King ]
* multiple static analysis and warnings fixes
-- Kamal Mostafa <kamal@whence.com> Sat, 23 Apr 2016 10:35:44 -0700
minimodem (0.23-1) unstable; urgency=medium
[ Rodrigo Menezes ]
* TTY/TDD support
-- Kamal Mostafa <kamal@whence.com> Fri, 19 Feb 2016 13:05:07 -0800
minimodem (0.22.1-1) unstable; urgency=medium
* Do not enable tx-carrier for non-interactive --file sessions
-- Kamal Mostafa <kamal@whence.com> Mon, 24 Aug 2015 13:51:57 -0700
minimodem (0.22-1) unstable; urgency=medium
[ Kamal Mostafa ]
* minimodem --binary-raw {nbits}: raw binary bits output mode
* fix non-integer mark/space frequency handling
* eliminate all instances of implicit double-promotion
[Nick Moriarty ]
* minimodem --tx-carrier: output a carrier while waiting for data
* Fix ALSA latency (causing ALSA not to block).
[ Kevin Zheng ]
* Untrack automatically generated files
-- Kamal Mostafa <kamal@whence.com> Sun, 23 Aug 2015 10:34:55 -0700
minimodem (0.21-1) unstable; urgency=medium
[ Marcos Vives Del Sol ]
* UIC-751-3 600 bps train message modes (uic-train, uic-ground)
* minimodem --invert-start-stop option inverts polarity of framing bits
[ Kamal Mostafa ]
* fsk confidence algo: calc separate divergences for mark and space bits
(improves signal demodulation)
-- Kamal Mostafa <kamal@whence.com> Mon, 24 Nov 2014 08:28:06 -0800
minimodem (0.20-1) unstable; urgency=medium
* fix stereo input file crash (thanks goblin@github)
* fix man page URL (thanks David Aitcheson)
* fix caller-id for blocked info (thanks Billseph Gamesh)
* test harness update for automake >= 1.13
* debian/control housekeeping
-- Kamal Mostafa <kamal@whence.com> Thu, 13 Nov 2014 10:31:57 -0800
minimodem (0.19-1) unstable; urgency=low
* minimodem new command line switch: -7 implements 7-bit ASCII
* fixed --baudot command line switch
-- Kamal Mostafa <kamal@whence.com> Wed, 18 Sep 2013 09:08:47 -0700
minimodem (0.18-1) unstable; urgency=low
* minimodem --tx SAME emits 16 sync-byte preamble
-- Kamal Mostafa <kamal@whence.com> Mon, 10 Jun 2013 09:28:20 -0700
minimodem (0.17.1-1) unstable; urgency=low
* (portability) link with -lm explicitly
- unbreaks Ubuntu 13.04 build.
-- Kamal Mostafa <kamal@whence.com> Thu, 21 Mar 2013 13:06:42 -0700
minimodem (0.17-1) unstable; urgency=low
* handle arbitrary --startbits N
-- Kamal Mostafa <kamal@whence.com> Wed, 20 Mar 2013 12:07:13 -0700
minimodem (0.16.1-1) unstable; urgency=low
* do not induce 'setitimer new_value NULL' kernel warning
-- Kamal Mostafa <kamal@whence.com> Fri, 25 Jan 2013 15:06:54 -0800
minimodem (0.16-1) unstable; urgency=low
* refine frame position if confidence falls
* fix --tx mode startbits/stopbits handling
* do not transmit leader tone if no startbit
-- Kamal Mostafa <kamal@whence.com> Sat, 03 Nov 2012 14:29:11 -0700
minimodem (0.15.1-1) unstable; urgency=low
* caller-ID parser fixes
-- Kamal Mostafa <kamal@whence.com> Tue, 16 Oct 2012 18:09:49 -0700
minimodem (0.15-1) unstable; urgency=low
* caller-ID support
* fixed multibyte character and binary data transfer
* stats are printed after ^C interrupt
* portability fixes (thanks, Mike Tedesco)
* minimodem new runtime command line switches:
--rx callerid Bell202 CID 1200 bps
--print-filter inhibit printing non-printable bytes
-- Kamal Mostafa <kamal@whence.com> Fri, 05 Oct 2012 20:08:24 -0700
minimodem (0.14-1) unstable; urgency=low minimodem (0.14-1) unstable; urgency=low
* general --rx performance enhancements * general --rx performance enhancements

2
debian/compat vendored
View File

@ -1 +1 @@
7 9

22
debian/control vendored
View File

@ -2,21 +2,25 @@ Source: minimodem
Section: comm Section: comm
Priority: optional Priority: optional
Maintainer: Kamal Mostafa <kamal@whence.com> Maintainer: Kamal Mostafa <kamal@whence.com>
Build-Depends: debhelper (>= 7.0.50~), libfftw3-dev, libpulse-dev, libasound2-dev [linux-any], libsndfile1-dev Build-Depends: debhelper (>= 9), libfftw3-dev, libpulse-dev, libasound2-dev [linux-any], libsndfile1-dev
Standards-Version: 3.9.3 Standards-Version: 3.9.7
Homepage: http://www.whence.com/minimodem Homepage: http://www.whence.com/minimodem
#Vcs-Git: git://git.debian.org/collab-maint/minimodem.git Vcs-Git: https://github.com/kamalmostafa/minimodem.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/minimodem.git;a=summary Vcs-Browser: https://github.com/kamalmostafa/minimodem
Package: minimodem Package: minimodem
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: pulseaudio Suggests: pulseaudio
Description: software audio Bell-type or RTTY FSK modem Description: general-purpose software audio FSK modem
Minimodem is a command-line program which generates (or decodes) audio Minimodem is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, emulating an old Bell-type or modem tones at any specified baud rate, using various framing protocols.
radio-teletype FSK modem. The tones can be played to (or recorded from) It acts a general-purpose software FSK modem, and includes support for
the system audio (PulseAudio or ALSA) or to an audio file. various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.
.
Minimodem can play and capture audio modem tones in real-time via the
system audio device, or in batched mode via audio files.
. .
Minimodem can be used to transfer data between nearby computers using an Minimodem can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using audio cable (or just via sound waves), or between remote computers using

8
debian/copyright vendored
View File

@ -4,11 +4,15 @@ Upstream-Contact: Kamal Mostafa <kamal@whence.com>
Source: http://www.whence.com/minimodem Source: http://www.whence.com/minimodem
Files: * Files: *
Copyright: 2011-2012 Kamal Mostafa <kamal@whence.com> Copyright: 2011-2016 Kamal Mostafa <kamal@whence.com>
License: GPL-3.0+
Files: src/*uic*
Copyright: 2014 Marcos Vives Del Sol <socram8888@gmail.com>
License: GPL-3.0+ License: GPL-3.0+
Files: debian/* Files: debian/*
Copyright: 2011-2012 Kamal Mostafa <kamal@whence.com> Copyright: 2011-2016 Kamal Mostafa <kamal@whence.com>
License: GPL-3.0+ License: GPL-3.0+
License: GPL-3.0+ License: GPL-3.0+

630
depcomp
View File

@ -1,630 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
# Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u="sed s,\\\\\\\\,/,g"
depmode=msvisualcpp
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -1,520 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

376
missing
View File

@ -1,376 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2009-04-28.21; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
tar*)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar*)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

1
src/.gitignore vendored
View File

@ -1,3 +1,4 @@
/minimodem /minimodem
/minimodem.1 /minimodem.1
/minimodem.1.html /minimodem.1.html
/minimodem.exe

View File

@ -1,7 +1,7 @@
# #
# Makefile.am # Makefile.am
# #
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com> # Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,9 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
AM_CFLAGS = -Wall # -Werror AM_CFLAGS = -Wall # -Werror -Wdouble-promotion
INCLUDES = $(DEPS_CFLAGS) AM_CPPFLAGS = $(DEPS_CFLAGS)
bin_PROGRAMS = minimodem bin_PROGRAMS = minimodem
@ -42,11 +42,15 @@ FSK_SRC = fsk.h fsk.c
BAUDOT_SRC = baudot.h baudot.c BAUDOT_SRC = baudot.h baudot.c
UIC_SRC = uic_codes.h uic_codes.c
DATABITS_SRC = \ DATABITS_SRC = \
databits.h \ databits.h \
databits_ascii.c \ databits_ascii.c \
databits_binary.c \ databits_binary.c \
databits_baudot.c $(BAUDOT_SRC) databits_callerid.c \
databits_baudot.c $(BAUDOT_SRC) \
databits_uic.c $(UIC_SRC)
minimodem_LDADD = $(DEPS_LIBS) minimodem_LDADD = $(DEPS_LIBS)
minimodem_SOURCES = minimodem.c $(DATABITS_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC) minimodem_SOURCES = minimodem.c $(DATABITS_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC)

View File

@ -1,607 +0,0 @@
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am
#
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = minimodem$(EXEEXT)
subdir = src
DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/minimodem.1.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES = minimodem.1
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
am__objects_1 = baudot.$(OBJEXT)
am__objects_2 = databits_ascii.$(OBJEXT) databits_binary.$(OBJEXT) \
databits_baudot.$(OBJEXT) $(am__objects_1)
am__objects_3 = fsk.$(OBJEXT)
am__objects_4 = simpleaudio.$(OBJEXT) simple-tone-generator.$(OBJEXT) \
simpleaudio-pulse.$(OBJEXT) simpleaudio-alsa.$(OBJEXT) \
simpleaudio-benchmark.$(OBJEXT) simpleaudio-sndfile.$(OBJEXT)
am_minimodem_OBJECTS = minimodem.$(OBJEXT) $(am__objects_2) \
$(am__objects_3) $(am__objects_4)
minimodem_OBJECTS = $(am_minimodem_OBJECTS)
am__DEPENDENCIES_1 =
minimodem_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(minimodem_SOURCES)
DIST_SOURCES = $(minimodem_SOURCES)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man_MANS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPS_CFLAGS = @DEPS_CFLAGS@
DEPS_LIBS = @DEPS_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CFLAGS = -Wall # -Werror
INCLUDES = $(DEPS_CFLAGS)
dist_man_MANS = minimodem.1
EXTRA_DIST = minimodem.1.html
SIMPLEAUDIO_SRC = \
simpleaudio.h \
simpleaudio_internal.h \
simpleaudio.c \
simple-tone-generator.c \
simpleaudio-pulse.c \
simpleaudio-alsa.c \
simpleaudio-benchmark.c \
simpleaudio-sndfile.c
FSK_SRC = fsk.h fsk.c
BAUDOT_SRC = baudot.h baudot.c
DATABITS_SRC = \
databits.h \
databits_ascii.c \
databits_binary.c \
databits_baudot.c $(BAUDOT_SRC)
minimodem_LDADD = $(DEPS_LIBS)
minimodem_SOURCES = minimodem.c $(DATABITS_SRC) $(FSK_SRC) $(SIMPLEAUDIO_SRC)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
minimodem.1: $(top_builddir)/config.status $(srcdir)/minimodem.1.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
minimodem$(EXEEXT): $(minimodem_OBJECTS) $(minimodem_DEPENDENCIES) $(EXTRA_minimodem_DEPENDENCIES)
@rm -f minimodem$(EXEEXT)
$(LINK) $(minimodem_OBJECTS) $(minimodem_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/baudot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_ascii.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_baudot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/databits_binary.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsk.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/minimodem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-tone-generator.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-alsa.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-benchmark.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-pulse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio-sndfile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleaudio.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list=''; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-man uninstall-man1
minimodem.1.html: minimodem.1 Makefile
man --html=cat ./minimodem.1 | sed '5,$$ s:\(http\:[^ &]*\):<A HREF="\1">\1</A>:g' > $@
[ -s $@ ] || { rm $@; exit 1; }
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -194,7 +194,7 @@ baudot_encode_table[0x60][2] = {
* 1 LTRS state * 1 LTRS state
* 2 FIGS state * 2 FIGS state
*/ */
static int baudot_charset = 0; // FIXME static unsigned int baudot_charset = 0; // FIXME
void void

View File

@ -17,12 +17,38 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// Reverses the ordering of the bits on an integer
static inline unsigned long long
bit_reverse(unsigned long long value,
unsigned int bits)
{
unsigned int out = 0;
while (bits--) {
out = (out << 1) | (value & 1);
value >>= 1;
}
return out;
}
// Gets "bits" bits from "value" starting "offset" bits from the start
static inline unsigned long long
bit_window(unsigned long long value,
unsigned int offset,
unsigned int bits)
{
unsigned long long mask = (1ULL << bits) - 1;
value = (value >> offset) & mask;
return value;
}
typedef int (databits_encoder)( typedef int (databits_encoder)(
unsigned int *databits_outp, char char_out ); unsigned int *databits_outp, char char_out );
typedef unsigned int (databits_decoder)( typedef unsigned int (databits_decoder)(
char *dataout_p, unsigned int dataout_size, char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ); unsigned long long bits, unsigned int n_databits );
int int
@ -30,7 +56,7 @@ databits_encode_ascii8( unsigned int *databits_outp, char char_out );
unsigned int unsigned int
databits_decode_ascii8( char *dataout_p, unsigned int dataout_size, databits_decode_ascii8( char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ); unsigned long long bits, unsigned int n_databits );
#include "baudot.h" #include "baudot.h"
@ -40,7 +66,7 @@ databits_decode_ascii8( char *dataout_p, unsigned int dataout_size,
unsigned int unsigned int
databits_decode_baudot( char *dataout_p, unsigned int dataout_size, databits_decode_baudot( char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ); unsigned long long bits, unsigned int n_databits );
int int
@ -48,6 +74,17 @@ databits_encode_binary( unsigned int *databits_outp, char char_out );
unsigned int unsigned int
databits_decode_binary( char *dataout_p, unsigned int dataout_size, databits_decode_binary( char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ); unsigned long long bits, unsigned int n_databits );
unsigned int
databits_decode_callerid( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int
databits_decode_uic_ground( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );
unsigned int
databits_decode_uic_train( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits );

View File

@ -34,7 +34,7 @@ databits_encode_ascii8( unsigned int *databits_outp, char char_out )
/* returns nbytes decoded */ /* returns nbytes decoded */
unsigned int unsigned int
databits_decode_ascii8( char *dataout_p, unsigned int dataout_size, databits_decode_ascii8( char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ) unsigned long long bits, unsigned int n_databits )
{ {
if ( ! dataout_p ) // databits processor reset: noop if ( ! dataout_p ) // databits processor reset: noop
return 0; return 0;

View File

@ -28,7 +28,7 @@
/* returns nbytes decoded */ /* returns nbytes decoded */
unsigned int unsigned int
databits_decode_baudot( char *dataout_p, unsigned int dataout_size, databits_decode_baudot( char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ) unsigned long long bits, unsigned int n_databits )
{ {
if ( ! dataout_p ) { // databits processor reset: reset Baudot state if ( ! dataout_p ) { // databits processor reset: reset Baudot state
baudot_reset(); baudot_reset();

View File

@ -28,7 +28,7 @@
// returns nbytes decoded // returns nbytes decoded
unsigned int unsigned int
databits_decode_binary( char *dataout_p, unsigned int dataout_size, databits_decode_binary( char *dataout_p, unsigned int dataout_size,
unsigned int bits, unsigned int n_databits ) unsigned long long bits, unsigned int n_databits )
{ {
if ( ! dataout_p ) // databits processor reset: noop if ( ! dataout_p ) // databits processor reset: noop
return 0; return 0;

210
src/databits_callerid.c Normal file
View File

@ -0,0 +1,210 @@
/*
* databits_callerid.c
*
* Copyright (C) 2012 Kamal Mostafa <kamal@whence.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "databits.h"
#include <stdio.h>
/*
* Caller-ID (USA SDMF/MDMF) databits decoder
*
* Reference: http://melabs.com/resources/callerid.htm
*/
#define CID_MSG_MDMF 0x80
#define CID_MSG_SDMF 0x04
#define CID_DATA_DATETIME 0x01
#define CID_DATA_PHONE 0x02
#define CID_DATA_PHONE_NA 0x04
#define CID_DATA_NAME 0x07
#define CID_DATA_NAME_NA 0x08
static const char *cid_datatype_names[] = {
"unknown0:", "Time:", "Phone:", "unknown3:",
"Phone:", "unknown5:", "unknown6:", "Name:",
"Name:"
};
static int cid_msgtype = 0;
static int cid_ndata = 0;
static unsigned char cid_buf[256];
static unsigned int
decode_mdmf_callerid( char *dataout_p, unsigned int dataout_size )
{
unsigned int dataout_n = 0;
unsigned int cid_i = 0;
unsigned int cid_msglen = cid_buf[1];
unsigned char *m = cid_buf + 2;
while ( cid_i < cid_msglen ) {
unsigned int cid_datatype = *m++;
if ( cid_datatype > CID_DATA_NAME_NA ) {
// FIXME: bad datastream -- print something here
return 0;
}
unsigned int cid_datalen = *m++;
if ( m + 2 + cid_datalen >= cid_buf + sizeof(cid_buf) ) {
// FIXME: bad datastream -- print something here
return 0;
}
// dataout_n += sprintf(dataout_p+dataout_n, "CID: %d (%d)\n", cid_datatype, cid_datalen);
dataout_n += sprintf(dataout_p+dataout_n, "%-6s ",
cid_datatype_names[cid_datatype]);
int prlen = 0;
char *prdata = NULL;
switch ( cid_datatype ) {
case CID_DATA_DATETIME:
dataout_n += sprintf(dataout_p+dataout_n,
"%.2s/%.2s %.2s:%.2s\n", m+0, m+2, m+4, m+6);
break;
case CID_DATA_PHONE:
if ( cid_datalen == 10 ) {
dataout_n += sprintf(dataout_p+dataout_n,
"%.3s-%.3s-%.4s\n", m+0, m+3, m+6);
break;
} else {
// fallthrough
}
case CID_DATA_NAME:
prdata = (char *)m;
prlen = cid_datalen;
break;
case CID_DATA_PHONE_NA:
case CID_DATA_NAME_NA:
if ( cid_datalen == 1 && *m == 'O' ) {
prdata = "[N/A]";
prlen = 5;
} else if ( cid_datalen == 1 && *m == 'P' ) {
prdata = "[blocked]";
prlen = 9;
}
break;
default:
// FIXME: warning here?
break;
}
if ( prdata )
dataout_n += sprintf(dataout_p+dataout_n, "%.*s\n", prlen, prdata);
m += cid_datalen;
cid_i += cid_datalen + 2;
}
return dataout_n;
}
static unsigned int
decode_sdmf_callerid( char *dataout_p, unsigned int dataout_size )
{
unsigned int dataout_n = 0;
unsigned int cid_msglen = cid_buf[1];
unsigned char *m = cid_buf + 2;
dataout_n += sprintf(dataout_p+dataout_n, "%-6s ",
cid_datatype_names[CID_DATA_DATETIME]);
dataout_n += sprintf(dataout_p+dataout_n, "%.2s/%.2s %.2s:%.2s\n",
m+0, m+2, m+4, m+6);
m += 8;
dataout_n += sprintf(dataout_p+dataout_n, "%-6s ",
cid_datatype_names[CID_DATA_PHONE]);
unsigned int cid_datalen = cid_msglen - 8;
if ( cid_datalen == 10 )
dataout_n += sprintf(dataout_p+dataout_n, "%.3s-%.3s-%.4s\n",
m+0, m+3, m+6);
else
dataout_n += sprintf(dataout_p+dataout_n, "%.*s\n",
cid_datalen, m);
return dataout_n;
}
static unsigned int
decode_cid_reset()
{
cid_msgtype = 0;
cid_ndata = 0;
return 0;
}
// FIXME: doesn't respect dataout_size at all!
/* returns nbytes decoded */
unsigned int
databits_decode_callerid( char *dataout_p, unsigned int dataout_size,
unsigned long long bits, unsigned int n_databits )
{
if ( ! dataout_p ) // databits processor reset
return decode_cid_reset();
if ( cid_msgtype == 0 ) {
if ( bits == CID_MSG_MDMF )
cid_msgtype = CID_MSG_MDMF;
else if ( bits == CID_MSG_SDMF )
cid_msgtype = CID_MSG_SDMF;
else
return 0;
cid_buf[cid_ndata++] = bits;
return 0;
}
if ( cid_ndata >= sizeof(cid_buf) ) {
// FIXME? buffer overflow; do what here?
return decode_cid_reset();
}
cid_buf[cid_ndata++] = bits;
// Collect input bytes until we've collected as many as the message
// length byte says there will be, plus two (the message type byte
// and the checksum byte)
unsigned long long cid_msglen = cid_buf[1];
if ( cid_ndata < cid_msglen + 2)
return 0;
// Now we have a whole CID message in cid_buf[] -- decode it
// FIXME: check the checksum
unsigned int dataout_n = 0;
dataout_n += sprintf(dataout_p+dataout_n, "CALLER-ID\n");
if ( cid_msgtype == CID_MSG_MDMF )
dataout_n += decode_mdmf_callerid(dataout_p+dataout_n,
dataout_size-dataout_n);
else
dataout_n += decode_sdmf_callerid(dataout_p+dataout_n,
dataout_size-dataout_n);
// All done; reset for the next one
decode_cid_reset();
return dataout_n;
}

74
src/databits_uic.c Executable file
View File

@ -0,0 +1,74 @@
/*
* databits_uic.c
*
* Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include "databits.h"
#include "uic_codes.h"
/*
* UIC-751-3 Ground-train decoder
*/
unsigned int
databits_decode_uic(char *output,
unsigned long long input,
unsigned int type)
{
int written;
if (!output) {
return 0;
}
unsigned int code = (unsigned int) bit_reverse(bit_window(input, 24, 8), 8);
written = sprintf(output, "Train ID: %X%X%X%X%X%X - Message: %02X (%s)\n",
(unsigned int) bit_window(input, 0, 4),
(unsigned int) bit_window(input, 4, 4),
(unsigned int) bit_window(input, 8, 4),
(unsigned int) bit_window(input, 12, 4),
(unsigned int) bit_window(input, 16, 4),
(unsigned int) bit_window(input, 20, 4),
code,
uic_message_meaning(code, type)
);
return written;
}
unsigned int
databits_decode_uic_ground(char *output,
unsigned int outputSize,
unsigned long long input,
unsigned int inputSize)
{
return databits_decode_uic(output,
input,
UIC_TYPE_GROUNDTRAIN);
}
unsigned int
databits_decode_uic_train(char *output,
unsigned int outputSize,
unsigned long long input,
unsigned int inputSize)
{
return databits_decode_uic(output,
input,
UIC_TYPE_TRAINGROUND);
}

View File

@ -1,7 +1,7 @@
/* /*
* fsk.c * fsk.c
* *
* Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com> * Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,9 +18,9 @@
*/ */
#include <malloc.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> // fabs, hypotf #include <math.h> // fabsf, hypotf
#include <float.h> // FLT_EPSILON #include <float.h> // FLT_EPSILON
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
@ -49,7 +49,7 @@ fsk_plan_new(
#ifdef USE_FFT #ifdef USE_FFT
fskp->band_width = filter_bw; fskp->band_width = filter_bw;
float fft_half_bw = fskp->band_width / 2.0; float fft_half_bw = fskp->band_width / 2.0f;
fskp->fftsize = (sample_rate + fft_half_bw) / fskp->band_width; fskp->fftsize = (sample_rate + fft_half_bw) / fskp->band_width;
fskp->nbands = fskp->fftsize / 2 + 1; fskp->nbands = fskp->fftsize / 2 + 1;
@ -62,7 +62,7 @@ fsk_plan_new(
errno = EINVAL; errno = EINVAL;
return NULL; return NULL;
} }
debug_log("### b_mark=%u b_space=%u fftsize=%u\n", debug_log("### b_mark=%u b_space=%u fftsize=%d\n",
fskp->b_mark, fskp->b_space, fskp->fftsize); fskp->b_mark, fskp->b_space, fskp->fftsize);
@ -129,7 +129,7 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples,
memcpy(fskp->fftin, samples, bit_nsamples * sizeof(float)); memcpy(fskp->fftin, samples, bit_nsamples * sizeof(float));
float magscalar = 2.0 / (float)bit_nsamples; float magscalar = 2.0f / (float)bit_nsamples;
#if 0 #if 0
//// apodization window //// apodization window
@ -148,7 +148,7 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples,
float zoff = 0.0; // 0.5 // FIXME which is it?? float zoff = 0.0; // 0.5 // FIXME which is it??
unsigned int z = bit_nsamples /* not -1 ... explain */; unsigned int z = bit_nsamples /* not -1 ... explain */;
float w = a0 float w = a0
- a1 * cos((2.0*M_PI*((float)i+zoff)) / z); - a1 * cosf((2.0*M_PI*((float)i+zoff)) / z);
fskp->fftin[i] *= w; fskp->fftin[i] *= w;
} }
#endif #endif
@ -178,13 +178,13 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples,
static float static float
fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit, fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
int n_bits, const char *expect_bits_string, int n_bits, const char *expect_bits_string,
unsigned int *bits_outp, float *ampl_outp ) unsigned long long *bits_outp, float *ampl_outp )
{ {
unsigned int bit_nsamples = (float)(samples_per_bit + 0.5); unsigned int bit_nsamples = (float)(samples_per_bit + 0.5f);
unsigned int bit_values[32]; unsigned int bit_values[64];
float bit_sig_mags[32]; float bit_sig_mags[64];
float bit_noise_mags[32]; float bit_noise_mags[64];
unsigned int bit_begin_sample; unsigned int bit_begin_sample;
int bitnum; int bitnum;
@ -201,8 +201,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
continue; continue;
assert( expect_bits[bitnum] == '1' || expect_bits[bitnum] == '0' ); assert( expect_bits[bitnum] == '1' || expect_bits[bitnum] == '0' );
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5); bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
debug_log( " bit# %2u @ %7u: ", bitnum, bit_begin_sample); debug_log( " bit# %2d @ %7u: ", bitnum, bit_begin_sample);
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples, fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
&bit_values[bitnum], &bit_values[bitnum],
&bit_sig_mags[bitnum], &bit_sig_mags[bitnum],
@ -236,7 +236,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
* diff between start bit and stop bit strength not be "large". */ * diff between start bit and stop bit strength not be "large". */
float s_mag = bit_sig_mags[1]; // start bit float s_mag = bit_sig_mags[1]; // start bit
float p_mag = bit_sig_mags[n_bits-1]; // stop bit float p_mag = bit_sig_mags[n_bits-1]; // stop bit
if ( fabs(s_mag-p_mag) > (s_mag * FSK_AVOID_TRANSIENTS) ) { if ( fabsf(s_mag-p_mag) > (s_mag * FSK_AVOID_TRANSIENTS) ) {
debug_log(" avoid transient\n"); debug_log(" avoid transient\n");
return 0.0; return 0.0;
} }
@ -246,8 +246,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
for ( bitnum=0; bitnum<n_bits; bitnum++ ) { for ( bitnum=0; bitnum<n_bits; bitnum++ ) {
if ( expect_bits[bitnum] != 'd' ) if ( expect_bits[bitnum] != 'd' )
continue; continue;
bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5); bit_begin_sample = (float)(samples_per_bit * bitnum + 0.5f);
debug_log( " bit# %2u @ %7u: ", bitnum, bit_begin_sample); debug_log( " bit# %2d @ %7u: ", bitnum, bit_begin_sample);
fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples, fsk_bit_analyze(fskp, samples+bit_begin_sample, bit_nsamples,
&bit_values[bitnum], &bit_values[bitnum],
&bit_sig_mags[bitnum], &bit_sig_mags[bitnum],
@ -269,6 +269,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
#if CONFIDENCE_ALGO == 5 || CONFIDENCE_ALGO == 6 #if CONFIDENCE_ALGO == 5 || CONFIDENCE_ALGO == 6
float total_bit_sig = 0.0, total_bit_noise = 0.0; float total_bit_sig = 0.0, total_bit_noise = 0.0;
float avg_mark_sig = 0.0, avg_space_sig = 0.0;
unsigned int n_mark = 0, n_space = 0;
for ( bitnum=0; bitnum<n_bits; bitnum++ ) { for ( bitnum=0; bitnum<n_bits; bitnum++ ) {
// Deal with floating point data type quantization noise... // Deal with floating point data type quantization noise...
// If total_bit_noise <= FLT_EPSILON, then assume it to be 0.0, // If total_bit_noise <= FLT_EPSILON, then assume it to be 0.0,
@ -276,6 +278,14 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
total_bit_sig += bit_sig_mags[bitnum]; total_bit_sig += bit_sig_mags[bitnum];
if ( bit_noise_mags[bitnum] > FLT_EPSILON ) if ( bit_noise_mags[bitnum] > FLT_EPSILON )
total_bit_noise += bit_noise_mags[bitnum]; total_bit_noise += bit_noise_mags[bitnum];
if ( bit_values[bitnum] == 1 ) {
avg_mark_sig += bit_sig_mags[bitnum];
n_mark++;
} else {
avg_space_sig += bit_sig_mags[bitnum];
n_space++;
}
} }
// Compute the "frame SNR" // Compute the "frame SNR"
@ -284,13 +294,19 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
// Compute avg bit sig and noise magnitudes // Compute avg bit sig and noise magnitudes
float avg_bit_sig = total_bit_sig / n_bits; float avg_bit_sig = total_bit_sig / n_bits;
// Compute separate avg bit sig for mark and space
if ( n_mark )
avg_mark_sig /= n_mark;
if ( n_space )
avg_space_sig /= n_space;
#if CONFIDENCE_ALGO == 6 #if CONFIDENCE_ALGO == 6
// Compute average "divergence": bit_mag_divergence / other_bits_mag // Compute average "divergence": bit_mag_divergence / other_bits_mag
float divergence = 0.0; float divergence = 0.0;
for ( bitnum=0; bitnum<n_bits; bitnum++ ) { for ( bitnum=0; bitnum<n_bits; bitnum++ ) {
float avg_bit_sig_other = (total_bit_sig - fabs(bit_sig_mags[bitnum])) float avg_bit_sig_other;
/ (n_bits - 1); avg_bit_sig_other = bit_values[bitnum] ? avg_mark_sig : avg_space_sig;
divergence += fabs(bit_sig_mags[bitnum] - avg_bit_sig_other) divergence += fabsf(bit_sig_mags[bitnum] - avg_bit_sig_other)
/ avg_bit_sig_other; / avg_bit_sig_other;
} }
divergence *= 2; divergence *= 2;
@ -317,7 +333,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
#if CONFIDENCE_ALGO == 6 #if CONFIDENCE_ALGO == 6
// Frame confidence is the frame ( SNR * consistency ) // Frame confidence is the frame ( SNR * consistency )
confidence = snr * (1.0 - divergence); confidence = snr * (1.0f - divergence);
#else #else
// Frame confidence is the frame SNR // Frame confidence is the frame SNR
confidence = snr; confidence = snr;
@ -372,8 +388,8 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
else else
normalized_bit_str = bit_strengths[bitnum] - v_space; normalized_bit_str = bit_strengths[bitnum] - v_space;
debug_log("%.2f ", normalized_bit_str); debug_log("%.2f ", normalized_bit_str);
// float divergence = fabs(1.0 - normalized_bit_str); // float divergence = fabsf(1.0 - normalized_bit_str);
float divergence = fabs(normalized_bit_str); float divergence = fabsf(normalized_bit_str);
if ( worst_divergence < divergence ) if ( worst_divergence < divergence )
worst_divergence = divergence; worst_divergence = divergence;
} }
@ -407,7 +423,7 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
for ( bitnum=0; bitnum<n_bits-1; bitnum++ ) for ( bitnum=0; bitnum<n_bits-1; bitnum++ )
{ {
float normalized_bit_str = bit_strengths[bitnum] / v; float normalized_bit_str = bit_strengths[bitnum] / v;
float divergence = fabs(1.0 - normalized_bit_str); float divergence = fabsf(1.0 - normalized_bit_str);
if ( worst_divergence < divergence ) if ( worst_divergence < divergence )
worst_divergence = divergence; worst_divergence = divergence;
} }
@ -422,9 +438,9 @@ fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit,
// into the bits_outp word. // into the bits_outp word.
*bits_outp = 0; *bits_outp = 0;
for ( bitnum=0; bitnum<n_bits; bitnum++ ) for ( bitnum=0; bitnum<n_bits; bitnum++ )
*bits_outp |= bit_values[bitnum] << bitnum; *bits_outp |= (unsigned long long) bit_values[bitnum] << bitnum;
debug_log(" frame algo=%u confidence=%f ampl=%f\n", debug_log(" frame algo=%d confidence=%f ampl=%f\n",
CONFIDENCE_ALGO, confidence, *ampl_outp); CONFIDENCE_ALGO, confidence, *ampl_outp);
return confidence; return confidence;
} }
@ -437,7 +453,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
unsigned int try_step_nsamples, unsigned int try_step_nsamples,
float try_confidence_search_limit, float try_confidence_search_limit,
const char *expect_bits_string, const char *expect_bits_string,
unsigned int *bits_outp, unsigned long long *bits_outp,
float *ampl_outp, float *ampl_outp,
unsigned int *frame_start_outp unsigned int *frame_start_outp
) )
@ -450,7 +466,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
unsigned int best_t = 0; unsigned int best_t = 0;
float best_c = 0.0, best_a = 0.0; float best_c = 0.0, best_a = 0.0;
unsigned int best_bits = 0; unsigned long long best_bits = 0;
// Scan the frame positions starting with the one try_first_sample, // Scan the frame positions starting with the one try_first_sample,
// alternating between a step above that, a step below that, above, below, // alternating between a step above that, a step below that, above, below,
@ -458,15 +474,15 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
int j; int j;
for ( j=0; ; j++ ) for ( j=0; ; j++ )
{ {
int up = j%2 ? 1 : -1; int up = ( j % 2 ) ? 1 : -1;
int t = try_first_sample + up*((j+1)/2)*try_step_nsamples; int t = try_first_sample + up*((j+1)/2)*try_step_nsamples;
if ( t >= (int)try_max_nsamples ) if ( t >= (int)try_max_nsamples )
break; break;
if ( t < 0 ) if ( t < 0 )
continue; continue;
float c, ampl_out; float c, ampl_out = 0.0;
unsigned int bits_out = 0; unsigned long long bits_out = 0;
debug_log("try fsk_frame_analyze at t=%d\n", t); debug_log("try fsk_frame_analyze at t=%d\n", t);
c = fsk_frame_analyze(fskp, samples+t, samples_per_bit, c = fsk_frame_analyze(fskp, samples+t, samples_per_bit,
expect_n_bits, expect_bits_string, expect_n_bits, expect_bits_string,
@ -492,14 +508,25 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
if ( confidence == 0 ) if ( confidence == 0 )
return 0; return 0;
// FIXME? hardcoded chop off framing bits for debug
#ifdef FSK_DEBUG #ifdef FSK_DEBUG
unsigned char bitchar = ( *bits_outp >> 2 ) & 0xFF; unsigned char bitchar;
// FIXME? hardcoded chop off framing bits for debug
// Hmmm... we have now way to distinguish between:
// 8-bit data with no start/stopbits == 8 bits
// 5-bit with prevstop+start+stop == 8 bits
switch ( expect_n_bits ) {
case 11: bitchar = ( *bits_outp >> 2 ) & 0xFF;
break;
case 8:
default:
bitchar = *bits_outp & 0xFF;
break;
}
debug_log("FSK_FRAME bits='"); debug_log("FSK_FRAME bits='");
for ( j=0; j<expect_n_bits; j++ ) for ( j=0; j<expect_n_bits; j++ )
debug_log("%c", ( *bits_outp >> j ) & 1 ? '1' : '0' ); debug_log("%c", ( ( *bits_outp >> j ) & 1 ) ? '1' : '0' );
debug_log("' datum='%c' (0x%02x) c=%f a=%f t=%d\n", debug_log("' datum='%c' (0x%02x) c=%f a=%f t=%u\n",
isprint(bitchar)||isspace(bitchar) ? bitchar : '.', isprint(bitchar)||isspace(bitchar) ? bitchar : '.',
bitchar, bitchar,
confidence, best_a, best_t); confidence, best_a, best_t);
@ -521,7 +548,7 @@ fsk_detect_carrier(fsk_plan *fskp, float *samples, unsigned int nsamples,
bzero(fskp->fftin, (fskp->fftsize * sizeof(float) * pa_nchannels)); bzero(fskp->fftin, (fskp->fftsize * sizeof(float) * pa_nchannels));
memcpy(fskp->fftin, samples, nsamples * sizeof(float)); memcpy(fskp->fftin, samples, nsamples * sizeof(float));
fftwf_execute(fskp->fftplan); fftwf_execute(fskp->fftplan);
float magscalar = 1.0 / ((float)nsamples/2.0); float magscalar = 1.0f / ((float)nsamples/2.0f);
float max_mag = 0.0; float max_mag = 0.0;
int max_mag_band = -1; int max_mag_band = -1;
int i = 1; /* start detection at the first non-DC band */ int i = 1; /* start detection at the first non-DC band */

View File

@ -65,7 +65,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples,
unsigned int try_step_nsamples, unsigned int try_step_nsamples,
float try_confidence_search_limit, float try_confidence_search_limit,
const char *expect_bits_string, const char *expect_bits_string,
unsigned int *bits_outp, unsigned long long *bits_outp,
float *ampl_outp, float *ampl_outp,
unsigned int *frame_start_outp unsigned int *frame_start_outp
); );

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH MINIMODEM 1 "August 19, 2012" .TH MINIMODEM 1 "June 10, 2013"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -16,7 +16,7 @@
.\" .sp <n> insert n+1 empty lines .\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7) .\" for manpage-specific macros, see man(7)
.SH NAME .SH NAME
minimodem \- software audio Bell-type or RTTY FSK modem minimodem \- general-purpose software audio FSK modem
.SH SYNOPSIS .SH SYNOPSIS
.B minimodem --tx .B minimodem --tx
.RI [ options ] .RI [ options ]
@ -26,16 +26,21 @@ minimodem \- software audio Bell-type or RTTY FSK modem
.RI [ options ] .RI [ options ]
.I {baudmode} .I {baudmode}
.SH DESCRIPTION .SH DESCRIPTION
.B minimodem .B Minimodem
is a command-line program which generates (or decodes) audio is a command-line program which decodes (or generates) audio
modem tones at any specified baud rate, emulating an old Bell-type or modem tones at any specified baud rate, using various framing protocols.
radio-teletype FSK modem. The tones can be played to (or recorded from) It acts a general-purpose software FSK modem, and includes support for
the system audio (PulseAudio or ALSA) or to an audio file. various standard FSK protocols such as Bell103, Bell202, RTTY, TTY/TDD,
NOAA SAME, and Caller-ID.
.PP .PP
.B minimodem .B Minimodem
can be used to transfer data between nearby computers using an audio can play and capture audio modem tones in real-time via the system
cable (or just via sound waves), or between remote computers using radio, audio device, or in batched mode via audio files.
telephone, or another audio communications medium. .PP
.B Minimodem
can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using
radio, telephone, or another audio communications medium.
.SH "TX/RX MODE" .SH "TX/RX MODE"
.TP .TP
.B \-t, \-\-tx, \-\-transmit, \-\-write .B \-t, \-\-tx, \-\-transmit, \-\-write
@ -43,6 +48,41 @@ transmit mode: generate audio tones
.TP .TP
.B \-r, \-\-rx, \-\-receive, \-\-read .B \-r, \-\-rx, \-\-receive, \-\-read
receive mode: decode audio tones receive mode: decode audio tones
.SH {baudmode}
The required \fI{baudmode}\fR parameter may be any floating-point value to
specify a baud rate, or any of the special keywords listed below.
The \fI{baudmode}\fR also implies certain other parameter defaults
depending on the rate, including standard (or at least reasonable)
default mark and space tone frequencies.
.TP
.B {any floating point value N}
: Bell202-style at N bps \-\-ascii
.TP
.B 1200
: Bell202 1200 bps \-\-ascii
.TP
.B 300
: Bell103 300 bps \-\-ascii
.TP
.B rtty
: RTTY 45.45 bps \-\-baudot \-\-stopbits 1.5
.TP
.B tdd
: TTY/TDD 45.45 bps \-\-baudot \-\-stopbits 2.0
.TP
.B same
: SAME 520.83 bps \-\-startbits 0 \-\-stopbits 0 \-\-sync-byte 0xAB
.br
NOAA Specific Area Message Encoding (SAME) protocol
.TP
.B callerid
: Bell202 1200 bps Caller-ID (MDMF or SDMF) protocol
.TP
.B uic-train
: UIC-751-3 600 bps train-to-ground message protocol
.TP
.B uic-ground
: UIC-751-3 600 bps ground-to-train message protocol
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-a, \-\-auto-carrier .B \-a, \-\-auto-carrier
@ -136,34 +176,32 @@ The bits are printed in the order they are received. Framing bits (start
and stop bits) are omitted from the output. and stop bits) are omitted from the output.
(This option applies to \-\-rx mode only). (This option applies to \-\-rx mode only).
.TP .TP
.B \-\-binary-raw {nbits}
Print all received bits (data bits and any framing bits) as raw binary output
using characters '0' and '1'. Framing bits are not interpreted, but simply
passed through to the output. The bits are printed in the order they are
received, in lines {nbits} wide. So in order to display a standard 8-N-1
bitstream (8 databits + 1 start bit + 1 stop bit), use "--binary-raw 10"
or a multiple of 10.
(This option applies to \-\-rx mode only).
.TP
.B \-\-print-filter
Filter the received text output, replacing any "non-printable" bytes
with a '.' character.
(This option applies to \-\-rx mode only).
.TP
.B \-\-print-eot
Print "### EOT" to stderr after each transmit completes.
.TP
.B \-\-tx-carrier
When transmitting from a blocking source, keep a carrier going while waiting
for more data.
.TP
.B \-\-benchmarks .B \-\-benchmarks
Run and report internal performance tests (all other flags are ignored). Run and report internal performance tests (all other flags are ignored).
.TP .TP
.B \-V, \-\-version .B \-V, \-\-version
print program version print program version
.SH {baudmode}
The required \fI{baudmode}\fR parameter may be any floating-point value to
specify a baud rate, or either of the strings "rtty" or "same".
The \fI{baudmode}\fR also implies certain other parameter defaults
depending on the rate, including standard (or at least reasonable)
default mark and space tone frequencies.
.TP
.B {any floating point value N}
: Bell-syle N bps \-\-ascii
.TP
.B 1200
: Bell202 1200 bps \-\-ascii
.TP
.B 300
: Bell103 300 bps \-\-ascii
.TP
.B rtty
: RTTY 45.45 bps \-\-baudot \-\-stopbits 1.5
.TP
.B same
: SAME 520.83 bps \-\-startbits 0 \-\-stopbits 0 \-\-sync-byte 0xAB
.br
NOAA Specific Area Message Encoding (SAME) protocol
.SH EXAMPLES .SH EXAMPLES
.TP .TP
.B minimodem --tx 100 .B minimodem --tx 100
@ -178,7 +216,7 @@ Decode amateur radio RTTY signals (listen near 14.085 MHz).
.B minimodem --rx same .B minimodem --rx same
Decode NOAA SAME protocol emergency alert transmissions, e.g. Decode NOAA SAME protocol emergency alert transmissions, e.g.
.br .br
http://en.wikipedia.org/wiki/Specific_Area_Message_Encoding <http://en.wikipedia.org/wiki/Specific_Area_Message_Encoding>.
.TP .TP
.B minimodem --tx 0.5 .B minimodem --tx 0.5
Experiment with very low baud rates (works in noisy conditions). Experiment with very low baud rates (works in noisy conditions).
@ -201,7 +239,7 @@ The latest version is available at <http://www.whence.com/minimodem>.
.B minimodem .B minimodem
was written by Kamal Mostafa <kamal@whence.com>. was written by Kamal Mostafa <kamal@whence.com>.
.SH COPYRIGHT .SH COPYRIGHT
Copyright \(co 2011-2012 by Kamal Mostafa <kamal@whence.com>. Copyright \(co 2011-2016 by Kamal Mostafa <kamal@whence.com>.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
.br .br
This is free software: you are free to change and redistribute it. This is free software: you are free to change and redistribute it.

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* /*
* simple-tone-generator.c * simple-tone-generator.c
* *
* Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com> * Copyright (C) 2011-2016 Kamal Mostafa <kamal@whence.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,8 +20,9 @@
#include <math.h> #include <math.h>
#include <strings.h> #include <strings.h>
#include <malloc.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <stdio.h>
#include "simpleaudio.h" #include "simpleaudio.h"
@ -48,15 +49,15 @@ simpleaudio_tone_init( unsigned int new_sin_table_len, float mag )
} }
unsigned int i; unsigned int i;
unsigned short mag_s = 32767.0 * tone_mag + 0.5f; unsigned short mag_s = 32767.0f * tone_mag + 0.5f;
if ( tone_mag > 1.0f ) // clamp to 1.0 to avoid overflow if ( tone_mag > 1.0f ) // clamp to 1.0 to avoid overflow
mag_s = 32767; mag_s = 32767;
if ( mag_s < 1 ) // "short epsilon" if ( mag_s < 1 ) // "short epsilon"
mag_s = 1; mag_s = 1;
for ( i=0; i<sin_table_len; i++ ) for ( i=0; i<sin_table_len; i++ )
sin_table_short[i] = lroundf( mag_s * sin(M_PI*2.0*(float)i/sin_table_len) ); sin_table_short[i] = lroundf( mag_s * sinf((float)M_PI*2*i/sin_table_len) );
for ( i=0; i<sin_table_len; i++ ) for ( i=0; i<sin_table_len; i++ )
sin_table_float[i] = tone_mag * sinf(M_PI*2.0*(float)i/sin_table_len); sin_table_float[i] = tone_mag * sinf((float)M_PI*2*i/sin_table_len);
} else { } else {
if ( sin_table_short ) { if ( sin_table_short ) {
@ -115,7 +116,7 @@ simpleaudio_tone(simpleaudio *sa_out, float tone_freq, size_t nsamples_dur)
float wave_nsamples = simpleaudio_get_rate(sa_out) / tone_freq; float wave_nsamples = simpleaudio_get_rate(sa_out) / tone_freq;
size_t i; size_t i;
#define TURNS_TO_RADIANS(t) ( M_PI*2.0 * (t) ) #define TURNS_TO_RADIANS(t) ( (float)M_PI*2 * (t) )
#define SINE_PHASE_TURNS ( (float)i/wave_nsamples + sa_tone_cphase ) #define SINE_PHASE_TURNS ( (float)i/wave_nsamples + sa_tone_cphase )
#define SINE_PHASE_RADIANS TURNS_TO_RADIANS(SINE_PHASE_TURNS) #define SINE_PHASE_RADIANS TURNS_TO_RADIANS(SINE_PHASE_TURNS)
@ -142,7 +143,7 @@ simpleaudio_tone(simpleaudio *sa_out, float tone_freq, size_t nsamples_dur)
for ( i=0; i<nsamples_dur; i++ ) for ( i=0; i<nsamples_dur; i++ )
short_buf[i] = sin_lu_short(SINE_PHASE_TURNS); short_buf[i] = sin_lu_short(SINE_PHASE_TURNS);
} else { } else {
unsigned short mag_s = 32767.0 * tone_mag + 0.5f; unsigned short mag_s = 32767.0f * tone_mag + 0.5f;
if ( tone_mag > 1.0f ) // clamp to 1.0 to avoid overflow if ( tone_mag > 1.0f ) // clamp to 1.0 to avoid overflow
mag_s = 32767; mag_s = 32767;
if ( mag_s < 1 ) // "short epsilon" if ( mag_s < 1 ) // "short epsilon"

View File

@ -24,7 +24,7 @@
#if USE_ALSA #if USE_ALSA
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <alsa/asoundlib.h> #include <alsa/asoundlib.h>
@ -155,7 +155,7 @@ sa_alsa_open_stream(
channels, channels,
rate, rate,
1 /* soft_resample (allow) */, 1 /* soft_resample (allow) */,
(unsigned int)-1 /* latency (allow max to avoid underruns) */); 100000 /* latency (us) */);
if (error) { if (error) {
fprintf(stderr, "E: %s\n", snd_strerror(error)); fprintf(stderr, "E: %s\n", snd_strerror(error));
snd_pcm_close(pcm); snd_pcm_close(pcm);

View File

@ -24,7 +24,7 @@
#if USE_BENCHMARKS #if USE_BENCHMARKS
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>

View File

@ -24,7 +24,7 @@
#if USE_PULSEAUDIO #if USE_PULSEAUDIO
#include <stdio.h> #include <stdio.h>
#include <malloc.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <pulse/simple.h> #include <pulse/simple.h>

View File

@ -25,7 +25,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <malloc.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
@ -62,12 +61,12 @@ sa_sndfile_read( simpleaudio *sa, void *buf, size_t nframes )
return -1; return -1;
} }
if ( sa->rxnoise != 0.0 ) { if ( sa->rxnoise != 0.0f ) {
int i; int i;
float *fbuf = buf; float *fbuf = buf;
float f = sa->rxnoise * 2; float f = sa->rxnoise * 2;
for ( i=0; i<nframes; i++ ) for ( i=0; i<nframes; i++ )
fbuf[i] += (drand48() - 0.5) * f; fbuf[i] += (rand()/RAND_MAX - 0.5f) * f;
} }
// fprintf(stderr, "sf_read: nframes=%ld n=%d\n", nframes, n); // fprintf(stderr, "sf_read: nframes=%ld n=%d\n", nframes, n);
@ -201,6 +200,15 @@ sa_sndfile_open_stream(
return 0; return 0;
} }
// Disable the insertion of this questionable "PEAK chunk" header thing.
// Relates only to writing SF_FORMAT_FLOAT .wav and .aiff files
// (minimodem --tx --float-samples). When left enabled, this adds some
// wonky bytes to the header which change from run to run (different every
// wall-clock second. WTF?
// http://www.mega-nerd.com/libsndfile/command.html#SFC_SET_ADD_PEAK_CHUNK
/* Turn off the PEAK chunk. */
sf_command(s, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE);
/* good or bad to override these? */ /* good or bad to override these? */
sa->rate = sfinfo.samplerate; sa->rate = sfinfo.samplerate;
sa->channels = sfinfo.channels; sa->channels = sfinfo.channels;

View File

@ -20,8 +20,9 @@
#include "simpleaudio.h" #include "simpleaudio.h"
#include "simpleaudio_internal.h" #include "simpleaudio_internal.h"
#include <malloc.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <stdio.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
@ -110,6 +111,13 @@ simpleaudio_open_stream(
backend_device, sa_stream_direction, sa_format, backend_device, sa_stream_direction, sa_format,
rate, channels, app_name, stream_name); rate, channels, app_name, stream_name);
if ( sa->channels != channels ) {
fprintf(stderr, "%s: input stream must be %u-channel (not %u)\n",
stream_name, channels, sa->channels);
simpleaudio_close(sa);
return 0;
}
if ( ok ) { if ( ok ) {
assert( sa->backend_framesize == sa->channels * sa->samplesize ); assert( sa->backend_framesize == sa->channels * sa->samplesize );
return sa; return sa;

68
src/uic_codes.c Executable file
View File

@ -0,0 +1,68 @@
/*
* uic_codes.c
*
* Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <assert.h>
#include "uic_codes.h"
uic_message uic_ground_to_train_messages[] = {
{ 0x00, "Test" },
{ 0x02, "Run slower" },
{ 0x03, "Extension of telegram" },
{ 0x04, "Run faster" },
{ 0x06, "Written order" },
{ 0x08, "Speech" },
{ 0x09, "Emergency stop" },
{ 0x0C, "Announcem. by loudspeaker" },
{ 0x55, "Idle" },
{ -1, NULL }
};
uic_message uic_train_to_ground_messages[] = {
{ 0x08, "Communic. desired" },
{ 0x0A, "Acknowl. of order" },
{ 0x06, "Advice" },
{ 0x00, "Test" },
{ 0x09, "Train staff wish to comm." },
{ 0x0C, "Telephone link desired" },
{ 0x03, "Extension of telegram" },
{ -1, NULL }
};
const char * uic_message_meaning(unsigned int code,
unsigned int type)
{
uic_message * messages;
if (type == UIC_TYPE_GROUNDTRAIN) {
messages = uic_ground_to_train_messages;
} else if (type == UIC_TYPE_TRAINGROUND) {
messages = uic_train_to_ground_messages;
} else {
assert(0);
}
while (messages->code != -1) {
if (messages->code == code) {
return messages->meaning;
}
messages++;
}
return "Unknown";
}

34
src/uic_codes.h Executable file
View File

@ -0,0 +1,34 @@
/*
* uic_codes.h
*
* Copyright (C) 2014 Marcos Vives Del Sol <socram8888@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
typedef struct {
unsigned int code;
char * meaning;
} uic_message;
enum {
UIC_TYPE_GROUNDTRAIN,
UIC_TYPE_TRAINGROUND,
};
extern uic_message uic_ground_to_train_messages[];
extern uic_message uic_train_to_ground_messages[];
const char * uic_message_meaning(unsigned int code,
unsigned int type);

View File

@ -0,0 +1,44 @@
#!/bin/bash
MINIMODEM="${MINIMODEM-./minimodem}"
[ -f "$MINIMODEM" ] || {
MINIMODEM="../src/minimodem"
[ -f "$MINIMODEM" ] || {
echo "E: cannot find minimodem in ./ or ../src/" 1>&2
exit 1
}
}
minimodem_tx_args="1200 $1"
textfile="testdata-ascii.txt"
TMPF="/tmp/minimodem-test-$$"
trap "rm -f $TMPF.*" 0
set -e
$MINIMODEM --tx --file $TMPF.1.wav $minimodem_tx_args < "$textfile"
sleep 1
$MINIMODEM --tx --file $TMPF.2.wav $minimodem_tx_args < "$textfile"
sleep 1
$MINIMODEM --tx --file $TMPF.3.wav $minimodem_tx_args < "$textfile"
cmp -s $TMPF.1.wav $TMPF.2.wav || {
echo -e "TX-NOT-CONSISTENT"
exit 1
}
cmp -s $TMPF.1.wav $TMPF.3.wav || {
echo -e "TX-NOT-CONSISTENT"
exit 1
}
stats="three runs of '--tx $minimodem_tx_args' created identical output"
result="OK "
exitcode=0
echo -e "$result $stats"
exit $exitcode

View File

@ -0,0 +1 @@
exec ./16-verify-tx-consistent.test --float-samples

2
tests/31-amplitude-float.test Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec ./30-amplitude.test --float

1
tests/41-noise-purefreqs.test Executable file
View File

@ -0,0 +1 @@
exec ./40-noise.test 1200 -M 1200 -S 2400

1
tests/60-multibyte.test Executable file
View File

@ -0,0 +1 @@
exec ./self-test testdata-multibyte.txt 1200

54
tests/70-callerid-mdmf.test Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
MINIMODEM="${MINIMODEM-./minimodem}"
[ -f "$MINIMODEM" ] || {
MINIMODEM="../src/minimodem"
[ -f "$MINIMODEM" ] || {
echo "E: cannot find minimodem in ./ or ../src/" 1>&2
exit 1
}
}
bytesfile="testdata-callerid-mdmf.bytes"
[ "$1" != "" ] && bytesfile="$1"
TMPF="/tmp/minimodem-test-$$"
trap "rm -f $TMPF.*" 0
set -e
textfile="${bytesfile%%.bytes}.txt"
minimodem_tx_args="1200 --ascii"
minimodem_rx_args="callerid"
$MINIMODEM --tx --file $TMPF.wav $minimodem_tx_args < "$bytesfile"
# cp $TMPF.wav /tmp/x.wav
$MINIMODEM --rx --file $TMPF.wav $minimodem_rx_args \
> $TMPF.out 2> $TMPF.err || {
cat $TMPF.err
exit 1
}
cmp "$textfile" $TMPF.out
{
read xlitcarrier
read xlitblankline
read xlithashes xlitnocarrier stats
stats="${stats% ###}"
} < $TMPF.err
result="OK "
exitcode=0
echo -e "$result $stats"
exit $exitcode

2
tests/71-callerid-sdmf.test Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec ./70-callerid-mdmf.test testdata-callerid-sdmf.bytes

1
tests/80-SAME.test Executable file
View File

@ -0,0 +1 @@
exec ./self-test testdata-ascii.txt SAME

1
tests/81-ascii7.test Executable file
View File

@ -0,0 +1 @@
exec ./self-test testdata-ascii.txt -7 1200

1
tests/81-tdd.test Executable file
View File

@ -0,0 +1 @@
exec ./self-test testdata-baudot.txt tdd

View File

@ -20,8 +20,8 @@
EXTRA_DIST = \ EXTRA_DIST = \
run-self-tests \ run-self-tests \
self-test \ self-test \
test-* \ *.test \
testdata-* testdata-*
TESTS = test-* TESTS = @auto_find_tests@

View File

@ -1,443 +0,0 @@
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Makefile.am
#
# Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__tty_colors = \
red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEPS_CFLAGS = @DEPS_CFLAGS@
DEPS_LIBS = @DEPS_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
run-self-tests \
self-test \
test-* \
testdata-*
TESTS = test-*
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu tests/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
esac; \
else \
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
else \
skipped="($$skip tests were not run)"; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
col="$$grn"; \
else \
col="$$red"; \
fi; \
echo "$${col}$$dashes$${std}"; \
echo "$${col}$$banner$${std}"; \
test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
test -z "$$report" || echo "$${col}$$report$${std}"; \
echo "$${col}$$dashes$${std}"; \
test "$$failed" -eq 0; \
else :; fi
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-TESTS check-am clean clean-generic \
distclean distclean-generic distdir dvi dvi-am html html-am \
info info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
for testcase in ./test-* for testcase in ./*.test
do do
$testcase $testcase
if [ $? -eq 0 ] if [ $? -eq 0 ]

View File

@ -1,2 +0,0 @@
#!/bin/bash
exec ./test-30-amplitude --float

View File

@ -1 +0,0 @@
exec ./test-40-noise 1200 -M 1200 -S 2400

View File

@ -15,34 +15,3 @@ the quick brown fox jumps over the lazy dog
Earning our SkyMiles Earning our SkyMiles
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
minimodem - software audio Bell-type or RTTY FSK modem
Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
Minimodem is a command-line program which generates (or decodes) audio
modem tones at any specified baud rate, emulating an old Bell-type or
radio-teletype FSK modem. The tones can be played to (or recorded from)
the system audio (PulseAudio or ALSA) or to an audio file.
Minimodem can be used to transfer data between nearby computers using an
audio cable (or just via sound waves), or between remote computers using
radio, telephone, or another audio communications medium.
----------------------------------------------------------------------------
minimodem - software audio Bell-type or RTTY FSK modem
Copyright (C) 2011-2012 Kamal Mostafa <kamal@whence.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -0,0 +1,2 @@
03240902JOHN DOE
8005551212}

View File

@ -0,0 +1,4 @@
CALLER-ID
Time: 03/24 09:02
Name: JOHN DOE
Phone: 800-555-1212

View File

@ -0,0 +1 @@
093012246095551212Q

View File

@ -0,0 +1,3 @@
CALLER-ID
Time: 09/30 12:24
Phone: 609-555-1212

View File

@ -0,0 +1,4 @@
Minimodem unterstützt jetzt Deutsch!
Beachten sie, dass wörter mit multibyte-zeichen korrekt gedruckt werden.
Minimodem ahora soporta Español!
Minimodem prend désormais en Français!