OSDN Git Service

20080725
authorsendan <sendan@b9d4a4f1-8ba9-4454-8150-46c023f248aa>
Fri, 25 Jul 2008 08:40:06 +0000 (08:40 +0000)
committersendan <sendan@b9d4a4f1-8ba9-4454-8150-46c023f248aa>
Fri, 25 Jul 2008 08:40:06 +0000 (08:40 +0000)
git-svn-id: http://svn.osdn.jp/svnroot/linuxcw@7 b9d4a4f1-8ba9-4454-8150-46c023f248aa

14 files changed:
linuxcw/INSTALL
linuxcw/Makefile.am
linuxcw/Makefile.in
linuxcw/cwrand/Makefile [deleted file]
linuxcw/cwrand/Makefile.am
linuxcw/cwrand/Makefile.in
linuxcw/cwrand/anunnec.c [new file with mode: 0644]
linuxcw/cwrand/cwrand.c
linuxcw/cwrand/cwrand.h
linuxcw/cwrand/optin.c
linuxcw/cwrand/prototype.h
linuxcw/cwread/cwread.c
linuxcw/cwread/sample.txt [new file with mode: 0644]
linuxcw/libcw/cw_default_memset_roman.c

index e69de29..94ac79e 100644 (file)
@@ -0,0 +1,27 @@
+// linuxcw プロジェクト //
+
+linuxcw のパッケージはUNIX環境でモールス信号を学習する為の小道具を集めたものです。
+UNIX環境用の物は他にも優れたものがあるようですが、私自身の勉強の為に書いてます。
+将来的には和文やハングルにも対応していきたいと思ってます。
+
+
+
+// 動作環境
+
+UNIX(POSIX)環境を考えてますが、Linuxでしか動作確認してません。
+
+// 開発環境
+
+20080724現在FedraCore7(32Bit)
+
+
+
+// インストール方法
+
+./configure
+make
+後に、必要なコマンドだけ手で必要な場所に移動してください。
+
+
+
+
index 80ec646..e5a2a4d 100644 (file)
@@ -1,5 +1,5 @@
 AUTOMAKE_OPTIONS = 1.10 no-dependencies
 
-SUBDIRS = almemsys libbeep libcw cwread
+SUBDIRS = almemsys libbeep libcw cwread cwrand
 
 
index ea72c0e..92dba7c 100644 (file)
@@ -157,7 +157,7 @@ target_alias = @target_alias@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = 1.10 no-dependencies
-SUBDIRS = almemsys libbeep libcw cwread
+SUBDIRS = almemsys libbeep libcw cwread cwrand
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
diff --git a/linuxcw/cwrand/Makefile b/linuxcw/cwrand/Makefile
deleted file mode 100644 (file)
index 5974670..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
-# cwrand/Makefile.  Generated from Makefile.in by configure.
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  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.
-
-
-
-
-pkgdatadir = $(datadir)/libbeep
-pkglibdir = $(libdir)/libbeep
-pkgincludedir = $(includedir)/libbeep
-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 = cwrand$(EXEEXT)
-subdir = cwrand
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-       $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS)
-am_cwrand_OBJECTS = cwrand-cwrand.$(OBJEXT) cwrand-optin.$(OBJEXT)
-cwrand_OBJECTS = $(am_cwrand_OBJECTS)
-cwrand_DEPENDENCIES =
-cwrand_LINK = $(CCLD) $(cwrand_CFLAGS) $(CFLAGS) $(cwrand_LDFLAGS) \
-       $(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. -I$(top_builddir)
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(cwrand_SOURCES)
-DIST_SOURCES = $(cwrand_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /home/masashi/c/linuxcw/missing --run aclocal-1.10
-AMTAR = ${SHELL} /home/masashi/c/linuxcw/missing --run tar
-AUTOCONF = ${SHELL} /home/masashi/c/linuxcw/missing --run autoconf
-AUTOHEADER = ${SHELL} /home/masashi/c/linuxcw/missing --run autoheader
-AUTOMAKE = ${SHELL} /home/masashi/c/linuxcw/missing --run automake-1.10
-AWK = gawk
-CC = gcc
-CCDEPMODE = depmode=none
-CFLAGS = -Wall -O2 -g
-CPP = gcc -E
-CPPFLAGS = 
-CYGPATH_W = echo
-DEFS = -DHAVE_CONFIG_H
-DEPDIR = .deps
-ECHO_C = 
-ECHO_N = -n
-ECHO_T = 
-EGREP = /bin/grep -E
-EXEEXT = 
-GREP = /bin/grep
-INSTALL = /usr/bin/install -c
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LDFLAGS = 
-LIBOBJS = 
-LIBS = 
-LTLIBOBJS = 
-MAKEINFO = ${SHELL} /home/masashi/c/linuxcw/missing --run makeinfo
-MKDIR_P = /bin/mkdir -p
-MYCFLAGS = -Wall -O2 -g
-OBJEXT = o
-PACKAGE = libbeep
-PACKAGE_BUGREPORT = 
-PACKAGE_NAME = 
-PACKAGE_STRING = 
-PACKAGE_TARNAME = 
-PACKAGE_VERSION = 
-PATH_SEPARATOR = :
-RANLIB = ranlib
-SET_MAKE = 
-SHELL = /bin/sh
-STRIP = 
-VERSION = 1.1.11
-abs_builddir = /home/masashi/c/linuxcw/cwrand
-abs_srcdir = /home/masashi/c/linuxcw/cwrand
-abs_top_builddir = /home/masashi/c/linuxcw
-abs_top_srcdir = /home/masashi/c/linuxcw
-ac_ct_CC = gcc
-am__include = include
-am__leading_dot = .
-am__quote = 
-am__tar = ${AMTAR} chof - "$$tardir"
-am__untar = ${AMTAR} xf -
-bindir = ${exec_prefix}/bin
-build_alias = 
-builddir = .
-datadir = ${datarootdir}
-datarootdir = ${prefix}/share
-docdir = ${datarootdir}/doc/${PACKAGE}
-dvidir = ${docdir}
-exec_prefix = ${prefix}
-host_alias = 
-htmldir = ${docdir}
-includedir = ${prefix}/include
-infodir = ${datarootdir}/info
-install_sh = $(SHELL) /home/masashi/c/linuxcw/install-sh
-libdir = ${exec_prefix}/lib
-libexecdir = ${exec_prefix}/libexec
-localedir = ${datarootdir}/locale
-localstatedir = ${prefix}/var
-mandir = ${datarootdir}/man
-mkdir_p = /bin/mkdir -p
-oldincludedir = /usr/include
-pdfdir = ${docdir}
-prefix = /usr/local
-program_transform_name = s,x,x,
-psdir = ${docdir}
-sbindir = ${exec_prefix}/sbin
-sharedstatedir = ${prefix}/com
-srcdir = .
-sysconfdir = ${prefix}/etc
-target_alias = 
-top_builddir = ..
-top_srcdir = ..
-AUTOMAKE_OPTIONS = 1.10 no-dependencies
-cwrand_SOURCES = cwrand.c cwrand.h optin.c libcw.h libbeep.h almemsys.h
-cwrand_LDADD = -lcw -lbeep -lalmemsys
-cwrand_LDFLAGS = -L. -L../libbeep -L../libcw -L../almemsys
-cwrand_CFLAGS = -I. -I../libbeep -I../libcw -I../almemsys
-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 \
-               && exit 0; \
-             exit 1;; \
-         esac; \
-       done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  cwrand/Makefile'; \
-       cd $(top_srcdir) && \
-         $(AUTOMAKE) --foreign  cwrand/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
-install-binPROGRAMS: $(bin_PROGRAMS)
-       @$(NORMAL_INSTALL)
-       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-       @list='$(bin_PROGRAMS)'; for p in $$list; do \
-         p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-         if test -f $$p \
-         ; then \
-           f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-          echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-          $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
-         else :; fi; \
-       done
-
-uninstall-binPROGRAMS:
-       @$(NORMAL_UNINSTALL)
-       @list='$(bin_PROGRAMS)'; for p in $$list; do \
-         f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-         echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-         rm -f "$(DESTDIR)$(bindir)/$$f"; \
-       done
-
-clean-binPROGRAMS:
-       -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-cwrand$(EXEEXT): $(cwrand_OBJECTS) $(cwrand_DEPENDENCIES) 
-       @rm -f cwrand$(EXEEXT)
-       $(cwrand_LINK) $(cwrand_OBJECTS) $(cwrand_LDADD) $(LIBS)
-
-mostlyclean-compile:
-       -rm -f *.$(OBJEXT)
-
-distclean-compile:
-       -rm -f *.tab.c
-
-.c.o:
-       $(COMPILE) -c $<
-
-.c.obj:
-       $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-cwrand-cwrand.o: cwrand.c
-       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-cwrand.o `test -f 'cwrand.c' || echo '$(srcdir)/'`cwrand.c
-
-cwrand-cwrand.obj: cwrand.c
-       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-cwrand.obj `if test -f 'cwrand.c'; then $(CYGPATH_W) 'cwrand.c'; else $(CYGPATH_W) '$(srcdir)/cwrand.c'; fi`
-
-cwrand-optin.o: optin.c
-       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-optin.o `test -f 'optin.c' || echo '$(srcdir)/'`optin.c
-
-cwrand-optin.obj: optin.c
-       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-optin.obj `if test -f 'optin.c'; then $(CYGPATH_W) 'optin.c'; else $(CYGPATH_W) '$(srcdir)/optin.c'; fi`
-
-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; } \
-              END { for (i in files) print i; }'`; \
-       mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       tags=; \
-       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; } \
-              END { for (i in files) print i; }'`; \
-       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
-         test -n "$$unique" || unique=$$empty_fix; \
-         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-           $$tags $$unique; \
-       fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       tags=; \
-       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; } \
-              END { for (i in files) print i; }'`; \
-       test -z "$(CTAGS_ARGS)$$tags$$unique" \
-         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-            $$tags $$unique
-
-GTAGS:
-       here=`$(am__cd) $(top_builddir) && pwd` \
-         && cd $(top_srcdir) \
-         && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-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 $(srcdir)/$$file && test $$d != $(srcdir); then \
-             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
-           fi; \
-           cp -pR $$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)
-installdirs:
-       for dir in "$(DESTDIR)$(bindir)"; 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:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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 -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-       distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-info: install-info-am
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-ps: 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-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.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-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
-
-
-# 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:
index 1894403..4e0b875 100644 (file)
@@ -5,7 +5,7 @@ CFLAGS = @MYCFLAGS@
 
 bin_PROGRAMS = cwrand
 
-cwrand_SOURCES = cwrand.c cwrand.h optin.c libcw.h libbeep.h almemsys.h
+cwrand_SOURCES = cwrand.c cwrand.h optin.c anunnec.c libcw.h libbeep.h almemsys.h
 cwrand_LDADD= -lcw -lbeep -lalmemsys
 cwrand_LDFLAGS = -L. -L../libbeep -L../libcw -L../almemsys
 cwrand_CFLAGS =  -I. -I../libbeep -I../libcw -I../almemsys
index d8f084d..838feba 100644 (file)
@@ -43,7 +43,8 @@ CONFIG_CLEAN_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
-am_cwrand_OBJECTS = cwrand-cwrand.$(OBJEXT) cwrand-optin.$(OBJEXT)
+am_cwrand_OBJECTS = cwrand-cwrand.$(OBJEXT) cwrand-optin.$(OBJEXT) \
+       cwrand-anunnec.$(OBJEXT)
 cwrand_OBJECTS = $(am_cwrand_OBJECTS)
 cwrand_DEPENDENCIES =
 cwrand_LINK = $(CCLD) $(cwrand_CFLAGS) $(CFLAGS) $(cwrand_LDFLAGS) \
@@ -147,7 +148,7 @@ target_alias = @target_alias@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = 1.10 no-dependencies
-cwrand_SOURCES = cwrand.c cwrand.h optin.c libcw.h libbeep.h almemsys.h
+cwrand_SOURCES = cwrand.c cwrand.h optin.c anunnec.c libcw.h libbeep.h almemsys.h
 cwrand_LDADD = -lcw -lbeep -lalmemsys
 cwrand_LDFLAGS = -L. -L../libbeep -L../libcw -L../almemsys
 cwrand_CFLAGS = -I. -I../libbeep -I../libcw -I../almemsys
@@ -235,6 +236,12 @@ cwrand-optin.o: optin.c
 cwrand-optin.obj: optin.c
        $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-optin.obj `if test -f 'optin.c'; then $(CYGPATH_W) 'optin.c'; else $(CYGPATH_W) '$(srcdir)/optin.c'; fi`
 
+cwrand-anunnec.o: anunnec.c
+       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-anunnec.o `test -f 'anunnec.c' || echo '$(srcdir)/'`anunnec.c
+
+cwrand-anunnec.obj: anunnec.c
+       $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cwrand_CFLAGS) $(CFLAGS) -c -o cwrand-anunnec.obj `if test -f 'anunnec.c'; then $(CYGPATH_W) 'anunnec.c'; else $(CYGPATH_W) '$(srcdir)/anunnec.c'; fi`
+
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
        unique=`for i in $$list; do \
diff --git a/linuxcw/cwrand/anunnec.c b/linuxcw/cwrand/anunnec.c
new file mode 100644 (file)
index 0000000..10d3b09
--- /dev/null
@@ -0,0 +1,29 @@
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<string.h>
+#include<unistd.h>
+#include"libbeep.h"
+#include"libcw.h"
+#include"cwrand.h"
+#include"almemsys.h"
+
+
+int anunnec(int char_no, int exa_mode)
+{
+int co;
+int list[9] = { 38, 40, 41, 42, 43, 44, 46, 47, 48 };
+
+for(co = 0; co < 9; co++){
+   if(char_no == list[co]){
+      if(exa_mode == 1){
+         return 1;
+         }
+      }
+   }
+
+return 0;
+}
+
+
+
index 45a2cc5..ac8d13a 100644 (file)
@@ -1,6 +1,7 @@
 
 #include<stdio.h>
 #include<stdlib.h>
+#include<string.h>
 #include"almemsys.h"
 #include"libbeep.h"
 #include"libcw.h"
 int main(int argc, char ** argv)
 {
 int fd;
-int moji, no, co, co2;
+int moji, no, co, co2, inrand, mode, exa_mode;
 char cha;
+char sw[2];
+char * buf;
+char * swap = sw;
 
 moji = 0;
 co = 0;
 fd = -1;
 cha = 0x00;
+inrand = 0;
+mode = 0;
+exa_mode = 0;
+
+buf = (char *)calloc(2, sizeof(char));
+memset(swap, 0x00, 2);
+
+buf = safe_memcpy(buf, "  ", BUF_MAX);
 
 // cw用の構造体を定義します。
 cw_length cw_len;
@@ -25,27 +37,53 @@ cw_length cw_len;
 cw_default_memset(&cw_len);
 
 // デフォルトの信号の長さ(3)と周波数(2)を設定
-cw_defaultset(&cw_len, 700, 80);
+cw_defaultset(&cw_len, 700, 130);
 
-optin(argc, argv, &cw_len, &moji, &no);
+optin(argc, argv, &cw_len, &moji, &no, &mode, &exa_mode);
 
 // beepデバイスファイルを開いてFDを得る
 fd = beep_fdopen(fd);
 
-printf("%d %d\n", moji, no);
+#ifdef CWRAND_BUG
+printf("ブロックの文字数: %d  繰り返し数: %d\n", moji, no);
+printf("length_default:%d\n", cw_len.length_default);
+printf("exa_mode=%d mode=%d \n", exa_mode, mode);
+#endif
 
 cw_len.ws = cw_len.sp * 4; // '*' の長さを短点の4倍に設定
 cw_len.cs = cw_len.sp * 2;  // 前の文字の後ろに1スペースあるので2
 
 for(co2 = 0; co2 < no; co2++){
+
    for(co = 0; co < moji; co++){
-      cha = cw_len.roman.char_sign[(int)randdata(0, 48)];
-      cw_sign(&cw_len, fd, cha);
-      cw_sign(&cw_len, fd, ' ');
-      printf("%c\n", cha);
+      inrand = (int)randdata(0, 48);
+      cha = cw_len.roman.char_sign[inrand];
+
+      if(0 == anunnec(inrand, exa_mode)){
+         swap[0] = cha; 
+         buf = safe_strncat(buf, swap, BUF_MAX);
+         memset(swap, 0x00, 2);
+
+         if(mode == 0 || mode == 2){
+            printf("%c     %s\n", cha, cw_len.roman.note_sign[inrand]);
+            }
+         cw_sign(&cw_len, fd, cha);
+         cw_sign(&cw_len, fd, ' ');
+         }
+      else {
+         co = co - 1;
+         }
+
       }
    cw_sign(&cw_len, fd, '*');
-   printf("\n");
+
+   if(mode == 1 || mode == 2){
+      printf("%s\n", buf);
+      }
+
+   buf = safe_memcpy(buf, "  ", BUF_MAX);
+
+// printf("\n");
    }
 
 // 符号データベースの検索
index 8b25946..8599f73 100644 (file)
@@ -2,6 +2,7 @@
 #ifndef _CWRAND_H_
   #define _CWRAND_H_
 
+//#define CWRAND_BUG
 
   #include "prototype.h"
 
index c03c1ad..e6ec427 100644 (file)
@@ -1,6 +1,7 @@
 
 #include<stdio.h>
 #include<stdlib.h>
+#include<string.h>
 #include<unistd.h>
 #include"libbeep.h"
 #include"libcw.h"
@@ -8,7 +9,7 @@
 #include"almemsys.h"
 
 
-int optin(int argc, char * argv[], cw_length * cw_len, int * moji, int * co)
+int optin(int argc, char * argv[], cw_length * cw_len, int * moji, int * co, int * mode, int * exa_mode)
 {
 char i;
 int sp, to;
@@ -18,29 +19,75 @@ sp = 0;
 to = 0;
 * moji = 5;
 * co = 1;
+* mode = 0;
+* exa_mode = 0;
 
-while((i = (char)getopt(argc, argv, "v:s:c:m:t:"))!= EOF){
+while((i = (char)getopt(argc, argv, "v:s:c:m:t:-:"))!= EOF){
    switch(i){
       case 'c':
+                #ifdef CWRAND_BUG
                 printf("Frequency of CW pattern. <%s>\n", optarg);
+                #endif
                 * co = strtol(optarg, (char **)NULL, 10);
                 break; 
       case 'm':
+                #ifdef CWRAND_BUG
                 printf("number of charcters of random CW. <%s>\n", optarg);
+                #endif
                 * moji = strtol(optarg, (char **)NULL, 10);
                 break; 
       case 's':
+                #ifdef CWRAND_BUG
                 printf("cw speed set. <%s>\n", optarg);
+                #endif
                 sp = strtol(optarg, (char **)NULL, 10);
                 cw_speedset(cw_len, sp);
                 break; 
       case 't':
+                #ifdef CWRAND_BUG
                 printf("cw tone set. <%s>\n", optarg);
+                #endif
                 to = strtol(optarg, (char **)NULL, 10);
                 cw_toneset(cw_len, to);
                 break; 
-      case 'v':
-                printf("cwrand -c <Frequency> -m <Nomber> -s <Speed> -t <tone>\n");
+      case '-':
+                if(0 == memcmp(optarg, "help", 4)){
+                    printf("cwrand は、欧文モールス信号の学習の為の道具です。\n");
+                    printf("       ランダムに文字を選択し、モールスを発信します。\n");
+                    printf("       cwrand は以下のオプションに対応しています。\n");
+                    printf("\n");
+                    printf("cwrand -c <Frequency> -m <Nomber> -s <Speed> -t <tone>\n");
+                    printf("--help           ヘルプの表示\n");
+                    printf("--print1         一行ずつ表示します\n");
+                    printf("--print2         いち文字ずつ表示します\n");
+                    printf("--examination    国家試験に出ない符号をのぞきます\n");
+                    exit(1);
+                    }
+
+                else if(0 == memcmp(optarg, "examination", 11)){
+                    #ifdef CWRAND_BUG
+                    printf("An unnecessary sign is deleted.\n");
+                    #endif
+                    * exa_mode = 1;
+                    }
+
+                else if(0 == memcmp(optarg, "print1", 6)){
+                    #ifdef CWRAND_BUG
+                    printf("print mode setings. 1\n");
+                    #endif
+                    * mode = 1;
+                    }
+
+                else if(0 == memcmp(optarg, "print2", 6)){
+                    #ifdef CWRAND_BUG
+                    printf("print mode setings. 1\n");
+                    #endif
+                    * mode = 2;
+                    }
+
+                else{
+                    }
+
                 break; 
 
 
index d160b8f..051faf7 100644 (file)
@@ -1,3 +1,4 @@
 
-int optin(int argc, char * argv[], cw_length * cw_len, int * moji, int * co);
+int optin(int argc, char * argv[], cw_length * cw_len, int * moji, int * co, int * mode, int * exa_mode);
+int anunnec(int char_no, int exa_mode);
 
index 037f086..e48341f 100644 (file)
@@ -26,7 +26,7 @@ cw_length cw_len;
 cw_default_memset(&cw_len);
 
 // デフォルトの信号の長さ(3)と周波数(2)を設定
-cw_defaultset(&cw_len, 700, 80);
+cw_defaultset(&cw_len, 700, 130);
 
 optin(argc, argv, &cw_len);
 
diff --git a/linuxcw/cwread/sample.txt b/linuxcw/cwread/sample.txt
new file mode 100644 (file)
index 0000000..0b0ed3a
--- /dev/null
@@ -0,0 +1,12 @@
+, , , , , , , , , , 
+. . . . . . . . . . 
+: : : : : : : : : : 
+? ? ? ? ? ? ? ? ? ? 
+\ \ \ \ \ \ \ \ \ \ 
+- - - - - - - - - -
+) ) ) ) ) ) ) ) ) ) 
+( ( ( ( ( ( ( ( ( ( 
+= = = = = = = = = = 
+/ / / / / / / / / / 
++ + + + + + + + + + 
+" " " " " " " " " " 
index d520948..2a63651 100644 (file)
@@ -70,6 +70,9 @@ memcpy(cw_len->roman.note_sign[48], "-..-", 4); cw_len->roman.char_sign[48] = 'x
 memcpy(cw_len->roman.note_sign[49], " ", 1); cw_len->roman.char_sign[49] = ' ';  // 文字間の空白
 memcpy(cw_len->roman.note_sign[50], "*", 1); cw_len->roman.char_sign[50] = '*';  // ワード間の空白
 
+// An unnecessary sign to the examination. 
+// 38, 40, 41, 42, 43, 44, 46, 47, 48 
+
 return 0;
 }